WebKit.git
34 min agoBuild fix after r273465. master
rniwa@webkit.org [Thu, 25 Feb 2021 07:32:19 +0000 (07:32 +0000)]
Build fix after r273465.

* TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273476 268f45cc-cd09-0410-ab3c-d52691b4dbfc

75 min agoOptimize the code to check if an element delegates focus to its shadow root or not
rniwa@webkit.org [Thu, 25 Feb 2021 06:50:56 +0000 (06:50 +0000)]
Optimize the code to check if an element delegates focus to its shadow root or not
https://bugs.webkit.org/show_bug.cgi?id=222404

Reviewed by Simon Fraser.

Add a fast path for checking whether a given element is a shadow host with a shadow root
with delegatesFocus set to true in with a new node flag: DelegatesFocusToShadowRoot.

The flag is set in Element::attachShadow and never cleared as delegatesFocus can never be unset.

No new tests since there should be no observable behavioral differences.

* dom/Element.cpp:
(WebCore::Element::isKeyboardFocusable const): Optimized this code using the new flag.
(WebCore::shadowRootWithDelegatesFocus): Set the flag.
(WebCore::isProgramaticallyFocusable): Optimized this code using the new flag.
(WebCore::Element::focus): Ditto.
* dom/Node.h:
(WebCore::Node::delegatesFocusToShadowRoot const): Added.
(WebCore::Node::NodeFlag): Added NodeFlag::DelegatesFocusToShadowRoot.
(WebCore::Node::setDelegatesFocusToShadowRoot): Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273474 268f45cc-cd09-0410-ab3c-d52691b4dbfc

81 min ago[GPUP] Use a WeakPtr of GPUConnectionToWebProcess instead of a reference in some...
peng.liu6@apple.com [Thu, 25 Feb 2021 06:45:27 +0000 (06:45 +0000)]
[GPUP] Use a WeakPtr of GPUConnectionToWebProcess instead of a reference in some media related objects
https://bugs.webkit.org/show_bug.cgi?id=222293

Reviewed by Eric Carlson.

A GPUConnectionToWebProcess object may be destroyed when we close a page, then crash will happen
in callbacks accessing the GPUConnectionToWebProcess object. For example, in
`RemoteSourceBufferProxy::sourceBufferPrivateBufferedRangesChanged()`. This patch
replaces the references to a GPUConnectionToWebProcess with WeakPtr(s) in places where the
issue may happen.

No new tests. Fix some test crashes.

* GPUProcess/GPUConnectionToWebProcess.cpp:
(WebKit::GPUConnectionToWebProcess::isAlwaysOnLoggingAllowed const):
(WebKit::GPUConnectionToWebProcess::mediaEngineConfigurationFactoryProxy):
* GPUProcess/GPUConnectionToWebProcess.h:
* GPUProcess/media/RemoteAudioHardwareListenerProxy.cpp:
(WebKit::RemoteAudioHardwareListenerProxy::RemoteAudioHardwareListenerProxy):
(WebKit::RemoteAudioHardwareListenerProxy::audioHardwareDidBecomeActive):
(WebKit::RemoteAudioHardwareListenerProxy::audioHardwareDidBecomeInactive):
(WebKit::RemoteAudioHardwareListenerProxy::audioOutputDeviceChanged):
* GPUProcess/media/RemoteAudioHardwareListenerProxy.h:
* GPUProcess/media/RemoteAudioTrackProxy.cpp:
(WebKit::RemoteAudioTrackProxy::RemoteAudioTrackProxy):
(WebKit::RemoteAudioTrackProxy::configurationChanged):
* GPUProcess/media/RemoteAudioTrackProxy.h:
* GPUProcess/media/RemoteCDMFactoryProxy.cpp:
(WebKit::RemoteCDMFactoryProxy::RemoteCDMFactoryProxy):
* GPUProcess/media/RemoteCDMFactoryProxy.h:
* GPUProcess/media/RemoteCDMInstanceProxy.cpp:
(WebKit::RemoteCDMInstanceProxy::unrequestedInitializationDataReceived):
* GPUProcess/media/RemoteCDMInstanceSessionProxy.cpp:
(WebKit::RemoteCDMInstanceSessionProxy::updateKeyStatuses):
(WebKit::RemoteCDMInstanceSessionProxy::sendMessage):
(WebKit::RemoteCDMInstanceSessionProxy::sessionIdChanged):
* GPUProcess/media/RemoteImageDecoderAVFProxy.cpp:
(WebKit::RemoteImageDecoderAVFProxy::RemoteImageDecoderAVFProxy):
(WebKit::RemoteImageDecoderAVFProxy::encodedDataStatusChanged):
* GPUProcess/media/RemoteImageDecoderAVFProxy.h:
* GPUProcess/media/RemoteLegacyCDMFactoryProxy.cpp:
(WebKit::RemoteLegacyCDMFactoryProxy::RemoteLegacyCDMFactoryProxy):
(WebKit::RemoteLegacyCDMFactoryProxy::~RemoteLegacyCDMFactoryProxy):
(WebKit::RemoteLegacyCDMFactoryProxy::addProxy):
(WebKit::RemoteLegacyCDMFactoryProxy::removeProxy):
(WebKit::RemoteLegacyCDMFactoryProxy::addSession):
(WebKit::RemoteLegacyCDMFactoryProxy::removeSession):
* GPUProcess/media/RemoteLegacyCDMFactoryProxy.h:
* GPUProcess/media/RemoteLegacyCDMProxy.cpp:
(WebKit::RemoteLegacyCDMProxy::cdmMediaPlayer const):
* GPUProcess/media/RemoteLegacyCDMSessionProxy.cpp:
(WebKit::RemoteLegacyCDMSessionProxy::sendMessage):
(WebKit::RemoteLegacyCDMSessionProxy::sendError):
(WebKit::RemoteLegacyCDMSessionProxy::mediaKeysStorageDirectory const):
* GPUProcess/media/RemoteMediaEngineConfigurationFactoryProxy.cpp:
(WebKit::RemoteMediaEngineConfigurationFactoryProxy::RemoteMediaEngineConfigurationFactoryProxy):
* GPUProcess/media/RemoteMediaEngineConfigurationFactoryProxy.h:
* GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp:
(WebKit::RemoteMediaPlayerManagerProxy::RemoteMediaPlayerManagerProxy):
(WebKit::RemoteMediaPlayerManagerProxy::createMediaPlayer):
(WebKit::RemoteMediaPlayerManagerProxy::logger):
(WebKit::RemoteMediaPlayerManagerProxy::logger const): Deleted.
(WebKit::RemoteMediaPlayerManagerProxy::logChannel const): Deleted.
* GPUProcess/media/RemoteMediaPlayerManagerProxy.h:
(WebKit::RemoteMediaPlayerManagerProxy::gpuConnectionToWebProcess):
(WebKit::RemoteMediaPlayerManagerProxy::gpuConnectionToWebProcess const): Deleted.
(): Deleted.
* GPUProcess/media/RemoteMediaPlayerProxy.cpp:
(WebKit::RemoteMediaPlayerProxy::RemoteMediaPlayerProxy):
(WebKit::RemoteMediaPlayerProxy::loadMediaSource):
(WebKit::RemoteMediaPlayerProxy::requestResource):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerMediaKeysStorageDirectory const):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerMediaCacheDirectory const):
(WebKit::RemoteMediaPlayerProxy::addRemoteAudioTrackProxy):
(WebKit::RemoteMediaPlayerProxy::addRemoteVideoTrackProxy):
(WebKit::RemoteMediaPlayerProxy::addRemoteTextTrackProxy):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerCachedKeyForKeyId const):
(WebKit::RemoteMediaPlayerProxy::setLegacyCDMSession):
(WebKit::RemoteMediaPlayerProxy::cdmInstanceAttached):
(WebKit::RemoteMediaPlayerProxy::cdmInstanceDetached):
(WebKit::RemoteMediaPlayerProxy::attemptToDecryptWithInstance):
* GPUProcess/media/RemoteMediaPlayerProxy.h:
* GPUProcess/media/RemoteMediaSourceProxy.cpp:
(WebKit::RemoteMediaSourceProxy::RemoteMediaSourceProxy):
(WebKit::RemoteMediaSourceProxy::~RemoteMediaSourceProxy):
(WebKit::RemoteMediaSourceProxy::seekToTime):
(WebKit::RemoteMediaSourceProxy::addSourceBuffer):
* GPUProcess/media/RemoteMediaSourceProxy.h:
* GPUProcess/media/RemoteRemoteCommandListenerProxy.cpp:
(WebKit::RemoteRemoteCommandListenerProxy::RemoteRemoteCommandListenerProxy):
(WebKit::RemoteRemoteCommandListenerProxy::didReceiveRemoteControlCommand):
* GPUProcess/media/RemoteRemoteCommandListenerProxy.h:
* GPUProcess/media/RemoteSourceBufferProxy.cpp:
(WebKit::RemoteSourceBufferProxy::RemoteSourceBufferProxy):
(WebKit::RemoteSourceBufferProxy::~RemoteSourceBufferProxy):
(WebKit::RemoteSourceBufferProxy::sourceBufferPrivateDidReceiveInitializationSegment):
(WebKit::RemoteSourceBufferProxy::sourceBufferPrivateStreamEndedWithDecodeError):
(WebKit::RemoteSourceBufferProxy::sourceBufferPrivateAppendError):
(WebKit::RemoteSourceBufferProxy::sourceBufferPrivateHighestPresentationTimestampChanged):
(WebKit::RemoteSourceBufferProxy::sourceBufferPrivateDurationChanged):
(WebKit::RemoteSourceBufferProxy::sourceBufferPrivateDidParseSample):
(WebKit::RemoteSourceBufferProxy::sourceBufferPrivateDidDropSample):
(WebKit::RemoteSourceBufferProxy::sourceBufferPrivateAppendComplete):
(WebKit::RemoteSourceBufferProxy::sourceBufferPrivateDidReceiveRenderingError):
(WebKit::RemoteSourceBufferProxy::sourceBufferPrivateReportExtraMemoryCost):
(WebKit::RemoteSourceBufferProxy::sourceBufferPrivateBufferedDirtyChanged):
(WebKit::RemoteSourceBufferProxy::sourceBufferPrivateBufferedRangesChanged):
* GPUProcess/media/RemoteSourceBufferProxy.h:
* GPUProcess/media/RemoteTextTrackProxy.cpp:
(WebKit::RemoteTextTrackProxy::RemoteTextTrackProxy):
(WebKit::RemoteTextTrackProxy::configurationChanged):
(WebKit::RemoteTextTrackProxy::addDataCue):
(WebKit::RemoteTextTrackProxy::updateDataCue):
(WebKit::RemoteTextTrackProxy::removeDataCue):
(WebKit::RemoteTextTrackProxy::addGenericCue):
(WebKit::RemoteTextTrackProxy::updateGenericCue):
(WebKit::RemoteTextTrackProxy::removeGenericCue):
(WebKit::RemoteTextTrackProxy::parseWebVTTFileHeader):
(WebKit::RemoteTextTrackProxy::parseWebVTTCueData):
* GPUProcess/media/RemoteTextTrackProxy.h:
* GPUProcess/media/RemoteVideoTrackProxy.cpp:
(WebKit::RemoteVideoTrackProxy::RemoteVideoTrackProxy):
(WebKit::RemoteVideoTrackProxy::configurationChanged):
* GPUProcess/media/RemoteVideoTrackProxy.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273473 268f45cc-cd09-0410-ab3c-d52691b4dbfc

101 min ago[GPUP] Remove duplicated items in LayoutTests/gpu-process/TestExpectations related...
peng.liu6@apple.com [Thu, 25 Feb 2021 06:24:46 +0000 (06:24 +0000)]
[GPUP] Remove duplicated items in LayoutTests/gpu-process/TestExpectations related to media
https://bugs.webkit.org/show_bug.cgi?id=222390

Unreviewed test gardening.

We have enabled "Media in GPU Process" by default in WKTR, so platform-specific TestExpectations
such as platform/wk2/TestExpectations will be used as the baseline for media related tests.

* gpu-process/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273472 268f45cc-cd09-0410-ab3c-d52691b4dbfc

115 min ago[Cocoa] Web Inspector: expose the extension host that is used to load _WKInspectorExt...
bburg@apple.com [Thu, 25 Feb 2021 06:10:40 +0000 (06:10 +0000)]
[Cocoa] Web Inspector: expose the extension host that is used to load _WKInspectorExtension tabs
https://bugs.webkit.org/show_bug.cgi?id=222344
<rdar://problem/74678778>

Reviewed by Devin Rousso.

Clients need access to the WKWebView that hosts extension content in order to implement message passing
and event delivery to the extension panel iframes. (Currently, that WebView is
the same underlying WKWebView for the whole interface, but that is open to change.)

* UIProcess/API/Cocoa/_WKInspectorExtensionHost.h: New property.

* UIProcess/API/Cocoa/_WKInspectorPrivate.h:
* UIProcess/API/Cocoa/_WKInspector.mm:
(-[_WKInspector extensionHostWebView]): Added.
(-[_WKInspector handle]): Deleted.

* UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm:
(-[_WKRemoteWebInspectorViewController extensionHostWebView]): Added.
(-[_WKRemoteWebInspectorViewController handle]): Deleted.

* Shared/API/Cocoa/WKBrowsingContextHandle.mm:
(-[WKBrowsingContextHandle description]):
Drive-by, add the standard -description for debugging purposes.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273471 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 hours ago[css-grid] Do not allow negative heights
commit-queue@webkit.org [Thu, 25 Feb 2021 05:59:46 +0000 (05:59 +0000)]
[css-grid] Do not allow negative heights
https://bugs.webkit.org/show_bug.cgi?id=221439

Patch by Rob Buis <rbuis@igalia.com> on 2021-02-24
Reviewed by Darin Adler.

Source/WebCore:

Do not allow negative heights in calculations, instead
use Optional to indicate that the heights are not existing.

Test: fast/css-grid-layout/zero-height-crash.html

* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::DefiniteSizeStrategy::minLogicalSizeForChild const):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::replacedMinMaxLogicalHeightComputesAsNone const):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutBlock):
(WebCore::RenderGrid::gridGap const):
(WebCore::RenderGrid::placeItemsOnGrid const):
(WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded):

LayoutTests:

Add test for this.

* fast/css-grid-layout/zero-height-crash-expected.txt: Added.
* fast/css-grid-layout/zero-height-crash.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273470 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 hours agoAdd stubs to enable SafariForWebKitDevelopment to launch
achristensen@apple.com [Thu, 25 Feb 2021 04:57:48 +0000 (04:57 +0000)]
Add stubs to enable SafariForWebKitDevelopment to launch
https://bugs.webkit.org/show_bug.cgi?id=222388

Reviewed by Myles Maxfield.

Source/JavaScriptCore:

* JavaScriptCore.xcodeproj/project.pbxproj:
* runtime/SymbolStubsForSafariCompatibility.mm: Added.
(WTF::String::String):
(WTF::JSONImpl::ObjectBase::getArray const):
(WTF::JSONImpl::ObjectBase::getValue const):
(WTF::JSONImpl::ObjectBase::getObject const):
(Inspector::BackendDispatcher::sendResponse):

Source/WebKit:

I manually verified that before this change, DYLD won't let it launch or it calls a missing selector,
but after this change it launches and loads web pages.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _inspectorDelegate]):
(-[WKWebView _setInspectorDelegate:]):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273469 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 hours agoCrash in CompositeEditCommand::breakOutOfEmptyMailBlockquotedParagraph()
commit-queue@webkit.org [Thu, 25 Feb 2021 03:34:53 +0000 (03:34 +0000)]
Crash in CompositeEditCommand::breakOutOfEmptyMailBlockquotedParagraph()
https://bugs.webkit.org/show_bug.cgi?id=222339

Patch by Julian Gonzalez <julian_a_gonzalez@apple.com> on 2021-02-24
Reviewed by Ryosuke Niwa.

Make a copy of Ref<HTMLBRElement> when inserting before highest blockquote node.

* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::breakOutOfEmptyMailBlockquotedParagraph):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273468 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 hours agoSet xrCompatible in WebGLRenderingContextBase::getContextAttributes
commit-queue@webkit.org [Thu, 25 Feb 2021 02:43:19 +0000 (02:43 +0000)]
Set xrCompatible in WebGLRenderingContextBase::getContextAttributes
https://bugs.webkit.org/show_bug.cgi?id=222360

Patch by Imanol Fernandez <ifernandez@igalia.com> on 2021-02-24
Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

Update WebXR xrCompatible attribute test expectations.

* web-platform-tests/webxr/webGLCanvasContext_makecompatible_reentrant.https-expected.txt: Added.

Source/WebCore:

Fixes xrCompatibe false value in WebGLRenderingContextBase::getContextAttributes()
after WebGLRenderingContextBase::makeXRCompatible call succeeds.

Test: webGLCanvasContext_create_xrcompatible.https.html

* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::getContextAttributes):

LayoutTests:

Update WebXR xrCompatible attribute test expectations.

* platform/wpe/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273467 268f45cc-cd09-0410-ab3c-d52691b4dbfc

6 hours agoApp-bound request parameter should be passed to main resource requests not the main...
katherine_cheney@apple.com [Thu, 25 Feb 2021 01:45:50 +0000 (01:45 +0000)]
App-bound request parameter should be passed to main resource requests not the main frame
https://bugs.webkit.org/show_bug.cgi?id=222241
<rdar://problem/74560966>

Reviewed by Chris Dumez.

Source/WebKit:

Bug fix to set the isAppBound parameter on the resource request if it
is not on the main frame. Previously this only checked if the
resource was not a main resource before setting the parameter.

Otherwise mostly changes to add better testing.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::appBoundNavigationData):
(WebKit::NetworkProcess::clearAppBoundNavigationData):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkSession.h:
(WebKit::NetworkSession::appBoundNavigationTestingData):
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
* Scripts/webkit/messages.py:
* Shared/NavigatingToAppBoundDomain.h:
(WebKit::AppBoundNavigationTestingData::clearAppBoundNavigationDataTesting):
(WebKit::AppBoundNavigationTestingData::updateAppBoundNavigationTestingData):
(WebKit::AppBoundNavigationTestingData::encode const):
(WebKit::AppBoundNavigationTestingData::decode):
Struct to return data for tests.

* UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h:
* UIProcess/API/Cocoa/WKWebViewTesting.mm:
(-[WKWebView _appBoundNavigationData:]):
(-[WKWebView _clearAppBoundNavigationData:]):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::appBoundNavigationData):
(WebKit::WebPageProxy::clearAppBoundNavigationData):
* UIProcess/WebPageProxy.h:
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::loadResource):
The fix.

Tools:

Adds more robust testing to report when appBound/nonAppBound requests
load in the network process. This tests not only that the main frame’s
document loader is properly set, but also that all loads initiated from
app-bound requests are also app-bound to avoid regressions like this in the future.

* TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm:
Utilize some CSP test resources that have the exact setup needed to
test this fix.

* TestWebKitAPI/cocoa/TestWKWebView.h:
* TestWebKitAPI/cocoa/TestWKWebView.mm:
(-[WKWebView appBoundNavigationData:]):
(-[WKWebView clearAppBoundNavigationReports:]):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273465 268f45cc-cd09-0410-ab3c-d52691b4dbfc

6 hours ago[GPUP] Refactor RemoteImageDecoderAVF::createFrameImageAtIndex()
peng.liu6@apple.com [Thu, 25 Feb 2021 01:18:07 +0000 (01:18 +0000)]
[GPUP] Refactor RemoteImageDecoderAVF::createFrameImageAtIndex()
https://bugs.webkit.org/show_bug.cgi?id=222300

Reviewed by Jer Noble.

Use callOnMainThreadAndWait() instead of callOnMainThread() and remove the semaphore.

No new tests, this has no behavior change.

* GPUProcess/media/RemoteImageDecoderAVFProxy.messages.in:
* WebProcess/GPU/media/RemoteImageDecoderAVF.cpp:
(WebKit::RemoteImageDecoderAVF::createFrameImageAtIndex):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273464 268f45cc-cd09-0410-ab3c-d52691b4dbfc

6 hours agoFix typo in Introduction.md.
rniwa@webkit.org [Thu, 25 Feb 2021 01:18:01 +0000 (01:18 +0000)]
Fix typo in Introduction.md.
https://bugs.webkit.org/show_bug.cgi?id=222387

Patch by Cameron McCormack <heycam@apple.com> on 2021-02-24
Reviewed by Ryosuke Niwa.

* Introduction.md:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273463 268f45cc-cd09-0410-ab3c-d52691b4dbfc

7 hours ago[iOS] Reduce use of retain/release in WAKWindow and remove unneeded methods from...
darin@apple.com [Thu, 25 Feb 2021 01:04:09 +0000 (01:04 +0000)]
[iOS] Reduce use of retain/release in WAKWindow and remove unneeded methods from that class
https://bugs.webkit.org/show_bug.cgi?id=222330

Reviewed by Chris Dumez.

Source/WebCore:

* platform/ios/LegacyTileCache.h: Use pragma once, remove unneeded includes,
tweak coding style a bit to match WebKit standard. Removed hasPendingDraw.
added WEBCORE_EXPORT to setTileBordersVisible and setTilePaintCountersVisible
so they can be used in WebKitLegacy.

* platform/ios/LegacyTileCache.mm:
(WebCore::LegacyTileCache::hasPendingDraw const): Deleted.

* platform/ios/wak/WAKWindow.h: Use pragma once, remove unneeded includes,
tweak coding style a bit to match WebKit standard. Removed hasPendingDraw,
setTileControllerShouldUseLowScaleTiles, setTileBordersVisible,
setTilePaintCountsVisible, setAcceleratedDrawingEnabled, freezeVisibleRect,
and unfreezeVisibleRect.

* platform/ios/wak/WAKWindow.mm: Removed "using namespace WebCore".
Removed unused _WAKKeyWindow global. Converted currentEvent and
gOrientationProvider globals to NeverDestroyed<RetainPtr<>>.
(orientationProvider): Added
(currentEvent): Added.
(-[WAKWindow isKeyWindow]): Remove dead code; this method already always
returns YES.
(-[WAKWindow makeKeyWindow]): Remove dead code. This method wrote to a
global that was never read anywhere.
(-[WAKWindow sendEventSynchronously:]): Use the currentEvent function
and take advantage of the fact that it's a RetainPtr so we don't need a
a local variable named currentEventProtector.
(-[WAKWindow hasPendingDraw]): Deleted. No callers depend on this.
(-[WAKWindow willRotate]): Set _frozenVisibleRect here directly instead
of calling anoether method to do that.
(-[WAKWindow didRotate]): Ditto.
(-[WAKWindow freezeVisibleRect]): Deleted. The method above was the only
caller for this method.
(-[WAKWindow unfreezeVisibleRect]): Ditto.
(+[WAKWindow setOrientationProvider:]): Use the orientationProvider function.
Note, this now retains the passed-in object. This is safe; the only caller
passes in a class, so there's no risk of a retain cycle.
(+[WAKWindow hasLandscapeOrientation]): Use the orientationProvider function.
(-[WAKWindow setTileBordersVisible:]): Deleted. The only caller for this
was in WebKitLegacy, and refactored to use the tile cache directly.
(-[WAKWindow setTilePaintCountsVisible:]): Ditto.
(-[WAKWindow setAcceleratedDrawingEnabled:]): Ditto.
(-[WAKWindow setTileControllerShouldUseLowScaleTiles:]): Deleted. No
callers depend on this.
(+[WAKWindow currentEvent]): Use the currentEvent function.

Source/WebKitLegacy/mac:

* WebView/WebView.mm:
(-[WebView _preferencesChanged:]): Call LegacyTileCache functions directly rather
than indirecting through WAKWindow methods.
(-[WebView viewDidMoveToWindow]): Ditto. Also tweaked conditionals a little for clarity.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273462 268f45cc-cd09-0410-ab3c-d52691b4dbfc

7 hours ago[MSE] Media segment is incorrectly dropped when using negative timestampOffset or...
commit-queue@webkit.org [Thu, 25 Feb 2021 00:57:53 +0000 (00:57 +0000)]
[MSE] Media segment is incorrectly dropped when using negative timestampOffset or when source buffer appendWindow is set.
https://bugs.webkit.org/show_bug.cgi?id=222260

Patch by Jean-Yves Avenard <jya@apple.com> on 2021-02-24
Reviewed by Eric Carlson.

Source/WebCore:

Test: media/media-source/media-source-timestampoffset-trim.html

CoreMedia packs multiple audio frames together into a single CMSampleBuffer,
this allows for faster processing and easier insertion into the track buffer tree.
However, per mediasoure spec [1], a frame is to be dropped according to
its start time and duration. So if only the beginning of the MediaSample
was to be dropped, we would have incorrectly dropped the lot.
We now split the MediaSample if it is going to be dropped to ensure that
all usable content is inserted into the track buffer.
Audio splicing isn't done yet, but this gets us closer to it.

[1] https://w3c.github.io/media-source/#sourcebuffer-coded-frame-processing

* platform/graphics/SourceBufferPrivate.cpp:
(WebCore::SourceBufferPrivate::didReceiveSample):
* platform/graphics/SourceBufferPrivate.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::didParseInitializationData):
(WebCore::SourceBufferPrivateAVFObjC::didProvideMediaDataForTrackId):
* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
(WebCore::SourceBufferPrivateGStreamer::didReceiveSample):
* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h:

LayoutTests:

* media/media-source/media-source-timestampoffset-trim.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273461 268f45cc-cd09-0410-ab3c-d52691b4dbfc

7 hours agoUnreviewed, fix build with the latest iOS SDK.
cdumez@apple.com [Thu, 25 Feb 2021 00:15:03 +0000 (00:15 +0000)]
Unreviewed, fix build with the latest iOS SDK.

Source/WebCore:

* platform/DragData.h:
(WebCore::DragData::operator=): Deleted.

Source/WebKit:

* Shared/FocusedElementInformation.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273453 268f45cc-cd09-0410-ab3c-d52691b4dbfc

7 hours ago[iOS] Get default value in the UI process for whether synchronous XMLHttpRequest...
pvollan@apple.com [Thu, 25 Feb 2021 00:08:23 +0000 (00:08 +0000)]
[iOS] Get default value in the UI process for whether synchronous XMLHttpRequest are allowed during unload
https://bugs.webkit.org/show_bug.cgi?id=222377

Reviewed by Brent Fulgham.

Getting this default value in the UI process instead of in every WebContent process should be a small speedup,
since getting this default value is a bit costly on iOS.

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* Shared/ios/WebPreferencesDefaultValuesIOS.h: Added.
* Shared/ios/WebPreferencesDefaultValuesIOS.mm:
(WebKit::cachedAllowsRequest):
(WebKit::allowsDeprecatedSynchronousXMLHttpRequestDuringUnload):
(WebKit::setAllowsDeprecatedSynchronousXMLHttpRequestDuringUnload):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_lastNavigationWasAppBound):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273452 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 hours agoAdd platform enable for separated model investigation
weinig@apple.com [Thu, 25 Feb 2021 00:00:43 +0000 (00:00 +0000)]
Add platform enable for separated model investigation
https://bugs.webkit.org/show_bug.cgi?id=222383

Reviewed by Dean Jackson.

* wtf/PlatformEnableCocoa.h:
Add define.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273450 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 hours agoDevice motion / orientation events not working in third-party iframes despite Feature...
cdumez@apple.com [Wed, 24 Feb 2021 23:17:35 +0000 (23:17 +0000)]
Device motion / orientation events not working in third-party iframes despite Feature-Policy allowing it
https://bugs.webkit.org/show_bug.cgi?id=221399
<rdar://problem/74229227>

Reviewed by Youenn Fablet.

Source/WebCore:

Allow third-party iframes to request access to device motion / orientation events if permitted via
Feature-Policy. To match Blink, the following features need to be allowed via Feature-Policy:
- DeviceOrientationEvent: gyroscope, accelerometer and magnetometer
- DeviceMotionEvent: gyroscope and accelerometer

Tests: http/tests/device-orientation/device-motion-allowed-in-first-party-only.html
       http/tests/device-orientation/device-motion-third-party-iframe-allowed-by-feature-policy.html
       http/tests/device-orientation/device-motion-third-party-iframe-denied-by-insufficient-feature-policy.html
       http/tests/device-orientation/device-motion-third-party-iframe-denied.html
       http/tests/device-orientation/device-orientation-allowed-in-first-party-only.html
       http/tests/device-orientation/device-orientation-third-party-iframe-allowed-by-feature-policy.html
       http/tests/device-orientation/device-orientation-third-party-iframe-denied-by-insufficient-feature-policy.html
       http/tests/device-orientation/device-orientation-third-party-iframe-denied.html

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
Drop DeviceOrientationOrMotionEvent class as it is no longer needed.

* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::executeScriptInWorld):
Make sure we specify the document when taking a user gesture when asked to run a script.
This is important because some clients want to know that there was a user gesture for
a document within their origin (like device motion & orientation).

* dom/DeviceMotionEvent.cpp:
(WebCore::DeviceMotionEvent::requestPermission):
* dom/DeviceMotionEvent.h:
* dom/DeviceOrientationEvent.cpp:
(WebCore::DeviceOrientationEvent::requestPermission):
* dom/DeviceOrientationEvent.h:
Move requestPermission() from DeviceOrientationOrMotionEvent class to its subclasses now that their
implementations are slightly different.

* dom/DeviceOrientationAndMotionAccessController.cpp:
(WebCore::DeviceOrientationAndMotionAccessController::DeviceOrientationAndMotionAccessController):
(WebCore::DeviceOrientationAndMotionAccessController::accessState const):
(WebCore::DeviceOrientationAndMotionAccessController::shouldAllowAccess):
(WebCore::DeviceOrientationAndMotionAccessController::clearPermissions):
* dom/DeviceOrientationAndMotionAccessController.h:
DeviceOrientationAndMotionAccessController is tied to the top document as used to have a single
cached 'permission state' since we used to only support device orientation & motion events in
first-party content. Now that we support those events in third-party content, I replaced the
single 'permission state' data member into a map of 'permission state' per origin. This allows
us to know synchronously (and without IPC to the UIProcess) the known permission state of each
iframe.
Also, I now pass the document to UserGestureIndicator::processingUserGesture() to make sure that
interacting with the top frame does not allow a third-party iframe to request permission to use
the device motion & orientation API. The user needs to interact with that third-party iframe
to allow the iframe to prompt the user.

* dom/DeviceOrientationOrMotionEvent.cpp: Removed.
* dom/DeviceOrientationOrMotionEvent.h: Removed.
Drop DeviceOrientationOrMotionEvent class now that the 2 subclasses need a slightly different
implementation of requestPermission().

* dom/UserGestureIndicator.cpp:
(WebCore::UserGestureToken::isValidForDocument const):
Make parameter const since it can be.

(WebCore::UserGestureIndicator::processingUserGesture):
Check state first in the condition to avoid doing a null-deref when a UserGestureIndicator
gets constructed with no |state| but with a non-null |document|.

* dom/UserGestureIndicator.h:

* html/FeaturePolicy.cpp:
(WebCore::policyTypeName):
(WebCore::FeaturePolicy::parse):
(WebCore::FeaturePolicy::allows const):
* html/FeaturePolicy.h:
Add the following feature policies: accelerometer, gyroscope & magnetometer.
https://github.com/w3c/webappsec-permissions-policy/blob/main/features.md

* page/DOMWindow.cpp:
(WebCore::DOMWindow::page const):
(WebCore::DOMWindow::isAllowedToUseDeviceMotionOrOrientation const):
(WebCore::DOMWindow::isAllowedToUseDeviceMotion const):
(WebCore::DOMWindow::isAllowedToUseDeviceOrientation const):
(WebCore::DOMWindow::hasPermissionToReceiveDeviceMotionOrOrientationEvents const):
(WebCore::DOMWindow::startListeningForDeviceOrientationIfNecessary):
(WebCore::DOMWindow::startListeningForDeviceMotionIfNecessary):
* page/DOMWindow.h:
Differentiate permission support for device motion and device orientation that
they are different. In particular, the two types of events now require a different
subset of feature policies.

LayoutTests:

Add layout test coverage.

* TestExpectations:
* fast/device-orientation/device-motion-request-permission-denied-expected.txt:
* fast/device-orientation/device-motion-request-permission-granted-expected.txt:
* fast/device-orientation/device-motion-request-permission-user-gesture-expected.txt:
* fast/device-orientation/device-orientation-request-permission-denied-expected.txt:
* fast/device-orientation/device-orientation-request-permission-granted-expected.txt:
* fast/device-orientation/device-orientation-request-permission-user-gesture-expected.txt:
* fast/device-orientation/device-orientation-request-permission-user-gesture.html:
* http/tests/device-orientation/device-motion-allowed-in-first-party-only-expected.txt: Added.
* http/tests/device-orientation/device-motion-allowed-in-first-party-only.html: Added.
* http/tests/device-orientation/device-motion-third-party-iframe-allowed-by-feature-policy-expected.txt: Added.
* http/tests/device-orientation/device-motion-third-party-iframe-allowed-by-feature-policy.html: Added.
* http/tests/device-orientation/device-motion-third-party-iframe-denied-by-insufficient-feature-policy-expected.txt: Added.
* http/tests/device-orientation/device-motion-third-party-iframe-denied-by-insufficient-feature-policy.html: Added.
* http/tests/device-orientation/device-motion-third-party-iframe-denied-expected.txt: Added.
* http/tests/device-orientation/device-motion-third-party-iframe-denied.html: Added.
* http/tests/device-orientation/device-orientation-allowed-in-first-party-only-expected.txt: Added.
* http/tests/device-orientation/device-orientation-allowed-in-first-party-only.html: Added.
* http/tests/device-orientation/device-orientation-third-party-iframe-allowed-by-feature-policy-expected.txt: Added.
* http/tests/device-orientation/device-orientation-third-party-iframe-allowed-by-feature-policy.html: Added.
* http/tests/device-orientation/device-orientation-third-party-iframe-denied-by-insufficient-feature-policy-expected.txt: Added.
* http/tests/device-orientation/device-orientation-third-party-iframe-denied-by-insufficient-feature-policy.html: Added.
* http/tests/device-orientation/device-orientation-third-party-iframe-denied-expected.txt: Added.
* http/tests/device-orientation/device-orientation-third-party-iframe-denied.html: Added.
* http/tests/device-orientation/resources/request-motion-events.html: Added.
* http/tests/device-orientation/resources/request-orientation-events.html: Added.
* platform/ios-wk2/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273444 268f45cc-cd09-0410-ab3c-d52691b4dbfc

9 hours agoRegression(r269481) Kugou Music: Can not leave "MV" category after selecting it
cdumez@apple.com [Wed, 24 Feb 2021 23:02:00 +0000 (23:02 +0000)]
Regression(r269481) Kugou Music: Can not leave "MV" category after selecting it
https://bugs.webkit.org/show_bug.cgi?id=222380
<rdar://74602294>

Reviewed by Geoffrey Garen.

The new behavior in r269481 aligns us with the specification and with Blink so I
am adding a linked-on-after to maintain pre-r269481 behavior until Apps get
rebuilt against the new SDK.

* html/HTMLDocument.cpp:
(WebCore::HTMLDocument::supportedPropertyNames const):
* page/Quirks.cpp:
(WebCore::Quirks::shouldOmitHTMLDocumentSupportedPropertyNames):
* page/Quirks.h:
* platform/cocoa/VersionChecks.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273442 268f45cc-cd09-0410-ab3c-d52691b4dbfc

10 hours agoRegression(r268700) postMessage changes prototype of basic types
cdumez@apple.com [Wed, 24 Feb 2021 22:03:41 +0000 (22:03 +0000)]
Regression(r268700) postMessage changes prototype of basic types
https://bugs.webkit.org/show_bug.cgi?id=222228
<rdar://problem/74612853>

Reviewed by Geoffrey Garen.

Source/WebCore:

r268700 updated ScriptExecutionContext::globalObject() to call:
`WebCore::globalObject(mainThreadNormalWorld(), downcast<Document>(*this).page())`
instead of
`frame ? frame->script().globalObject(mainThreadNormalWorld()) : nullptr`

This was not right for subframes because globalObject() gets the globalObject from
the page's main frame instead of the document's frame.

This patch gets rid of the error-prone WebCore::globalObject() taking in a Page*
and replaces it with one taking in a Frame* to avoid such issues in the future.

Test: fast/dom/Window/postMessage-Object-prototype.html

* bindings/js/ScriptState.cpp:
(WebCore::globalObject):
* bindings/js/ScriptState.h:
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::globalObject):
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::addSelfToGlobalObjectInWorld):
(WebCore::InspectorFrontendHost::showContextMenu):

LayoutTests:

Add layout test coverage.

* fast/dom/Window/postMessage-Object-prototype-expected.txt: Added.
* fast/dom/Window/postMessage-Object-prototype.html: Added.
* fast/dom/Window/resources/postMessage-Object-prototype-frame.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273438 268f45cc-cd09-0410-ab3c-d52691b4dbfc

10 hours ago[webkitscmpy] Add flag for caller to opt out of identifier computation
jbedard@apple.com [Wed, 24 Feb 2021 22:02:34 +0000 (22:02 +0000)]
[webkitscmpy] Add flag for caller to opt out of identifier computation
https://bugs.webkit.org/show_bug.cgi?id=222337
<rdar://problem/74667858>

Reviewed by Dewei Zhu.

* Scripts/libraries/webkitscmpy/setup.py: Bump version.
* Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py: Ditto.
* Scripts/libraries/webkitscmpy/webkitscmpy/local/git.py:
(Git.commit): Allow caller to opt-out of retrieving the identifier.
(Git.find): Ditto.
* Scripts/libraries/webkitscmpy/webkitscmpy/local/svn.py:
(Svn.commit): Allow caller to opt-out of retrieving the identifier.
* Scripts/libraries/webkitscmpy/webkitscmpy/remote/bitbucket.py:
(BitBucket.commit): Allow caller to opt-out of retrieving the identifier.
(BitBucket.find): Ditto.
* Scripts/libraries/webkitscmpy/webkitscmpy/remote/git_hub.py:
(GitHub.commit): Allow caller to opt-out of retrieving the identifier.
(GitHub.find): Ditto.
* Scripts/libraries/webkitscmpy/webkitscmpy/remote/svn.py:
(Svn.commit): Allow caller to opt-out of retrieving the identifier.
* Scripts/libraries/webkitscmpy/webkitscmpy/scm_base.py:
(ScmBase.commit): Allow caller to opt-out of retrieving the identifier.
(ScmBase.find): Ditto.
* Scripts/libraries/webkitscmpy/webkitscmpy/test/git_unittest.py:
(TestGit.test_no_identifier):
(TestGitHub.test_no_identifier):
(TestBitBucket.test_no_identifier):
* Scripts/libraries/webkitscmpy/webkitscmpy/test/svn_unittest.py:
(TestLocalSvn.test_no_identifier):
(TestRemoteSvn.test_no_identifier):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273437 268f45cc-cd09-0410-ab3c-d52691b4dbfc

10 hours agoUnreviewed Windows test gardening to speed up EWS.
jbedard@apple.com [Wed, 24 Feb 2021 21:39:38 +0000 (21:39 +0000)]
Unreviewed Windows test gardening to speed up EWS.

* platform/win/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273436 268f45cc-cd09-0410-ab3c-d52691b4dbfc

10 hours ago[css-grid] Fix min/max widths of grid affected by ancestor
commit-queue@webkit.org [Wed, 24 Feb 2021 21:35:41 +0000 (21:35 +0000)]
[css-grid] Fix min/max widths of grid affected by ancestor
https://bugs.webkit.org/show_bug.cgi?id=222100

Patch by Ziran Sun <zsun@igalia.com> on 2021-02-24
Reviewed by Javier Fernandez.

LayoutTests/imported/w3c:

Updated test expectation files.

* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-002-expected.txt:
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-vertical-lr-002-expected.txt:
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-vertical-rl-002-expected.txt:

Source/WebCore:

We need to recalculate min/max widths of child that depend on the ancestor.
Before update logical-width, for element that needs preferredWidth recalcution,
it is necessary to make sure that min/max widths are set dirty.

This change is an import of chromium CL at
https://chromium-review.googlesource.com/c/chromium/src/+/527640/
Only the parts that apply to this issue are imported.

Tests were already imported in WPT.

* rendering/RenderBox.cpp:
(WebCore::shouldRecalculateMinMaxWidthsAffectedByAncestor):
(WebCore::RenderBox::updateLogicalWidth):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273435 268f45cc-cd09-0410-ab3c-d52691b4dbfc

10 hours ago[ macOS Wk2 ] imported/w3c/web-platform-tests/media-source/mediasource-activesourcebu...
commit-queue@webkit.org [Wed, 24 Feb 2021 21:17:24 +0000 (21:17 +0000)]
[ macOS Wk2 ] imported/w3c/web-platform-tests/media-source/mediasource-activesourcebuffers.html is a flakey text failure
https://bugs.webkit.org/show_bug.cgi?id=222371

Unreviewed test gardening.

Patch by Robert Jenner <jenner@apple.com> on 2021-02-24

* platform/mac-wk2/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273433 268f45cc-cd09-0410-ab3c-d52691b4dbfc

10 hours ago[Flatpak SDK] Update to sccache 0.2.15
commit-queue@webkit.org [Wed, 24 Feb 2021 21:16:29 +0000 (21:16 +0000)]
[Flatpak SDK] Update to sccache 0.2.15
https://bugs.webkit.org/show_bug.cgi?id=222271

Patch by Philippe Normand <pnormand@igalia.com> on 2021-02-24
Reviewed by Adrian Perez de Castro.

* elements/sdk/sccache.bst: Bump to latest stable release. The previous version broke in the
SDK update, timing out when starting the local server.
* patches/sccache-no-selenium.patch: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273432 268f45cc-cd09-0410-ab3c-d52691b4dbfc

10 hours agoFix linker warnings building gtest for macCatalyst
timothy_horton@apple.com [Wed, 24 Feb 2021 21:13:25 +0000 (21:13 +0000)]
Fix linker warnings building gtest for macCatalyst
https://bugs.webkit.org/show_bug.cgi?id=222346
<rdar://problem/74405116>

Reviewed by Alexey Proskuryakov.

* gtest/xcode/Config/FrameworkTarget.xcconfig:
* gtest/xcode/Config/General.xcconfig:
Work around a linker warning about macCatalyst by not specifying
an INSTALL_NAME that is outside of /System/iOSSupport, where all
macCatalyst-only binaries must live.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273430 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 hours agoUpdate fipsmodule cipher.c to handle EVP_CipherUpdate
youenn@apple.com [Wed, 24 Feb 2021 21:00:43 +0000 (21:00 +0000)]
Update fipsmodule cipher.c to handle EVP_CipherUpdate
https://bugs.webkit.org/show_bug.cgi?id=222354
<rdar://problem/74436356>

Reviewed by Eric Carlson.

Cherry-picking of https://boringssl.googlesource.com/boringssl/+/e7c0c9734f5491e62665ea156603209a80fbb235%5E%21/.

* Source/third_party/boringssl/src/crypto/fipsmodule/cipher/cipher.c:
(EVP_EncryptUpdate):
(EVP_DecryptUpdate):
* Source/third_party/boringssl/src/include/openssl/cipher.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273429 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 hours agoUnreviewed, silence -Wreturn-type warnings from r273127
commit-queue@webkit.org [Wed, 24 Feb 2021 20:45:56 +0000 (20:45 +0000)]
Unreviewed, silence -Wreturn-type warnings from r273127
https://bugs.webkit.org/show_bug.cgi?id=221880
<rdar://problem/74509452>

Patch by Michael Catanzaro <mcatanzaro@gnome.org> on 2021-02-24

* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeRelativeRGBComponent):
(WebCore::CSSPropertyParserHelpers::HueColorAdjuster::fixupAnglesForInterpolation):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273428 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 hours agoRevert r272735. rdar://problem/74674837
repstein@apple.com [Wed, 24 Feb 2021 20:23:55 +0000 (20:23 +0000)]
Revert r272735. rdar://problem/74674837

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273424 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 hours agoRevert r272810. rdar://problem/74674837
repstein@apple.com [Wed, 24 Feb 2021 20:23:48 +0000 (20:23 +0000)]
Revert r272810. rdar://problem/74674837

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273423 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 hours agoFix model test differences between platforms
weinig@apple.com [Wed, 24 Feb 2021 20:11:54 +0000 (20:11 +0000)]
Fix model test differences between platforms
https://bugs.webkit.org/show_bug.cgi?id=222323
<rdar://problem/74678133>

Reviewed by Zalan Bujtas.

* platform/ios/TestExpectations:
Unskip the tests that were changed to no longer rely on platform differences.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273421 268f45cc-cd09-0410-ab3c-d52691b4dbfc

12 hours agoUnreviewed, reverting r273373.
ryanhaddad@apple.com [Wed, 24 Feb 2021 20:03:05 +0000 (20:03 +0000)]
Unreviewed, reverting r273373.

The test added with this change is frequently failing

Reverted changeset:

"Null check ArrayBufferView RefPtr"
https://bugs.webkit.org/show_bug.cgi?id=221569
https://commits.webkit.org/r273373

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273418 268f45cc-cd09-0410-ab3c-d52691b4dbfc

12 hours agoMove PostResolutionCallbackDisabler to resolveComputedStyle
antti@apple.com [Wed, 24 Feb 2021 19:43:35 +0000 (19:43 +0000)]
Move PostResolutionCallbackDisabler to resolveComputedStyle
https://bugs.webkit.org/show_bug.cgi?id=222350

Reviewed by Ryosuke Niwa.

It can be constructed and deleted repeatedly in styleForElementIgnoringPendingStylesheets when
resolveComputedStyle calls it in a loop.

* dom/Document.cpp:
(WebCore::Document::styleForElementIgnoringPendingStylesheets):
* dom/Element.cpp:
(WebCore::Element::resolveComputedStyle):
(WebCore::Element::resolvePseudoElementStyle):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273415 268f45cc-cd09-0410-ab3c-d52691b4dbfc

12 hours agoAdd unit-tests for various step in build.webkit.org (follow-up fix)
aakash_jain@apple.com [Wed, 24 Feb 2021 19:37:26 +0000 (19:37 +0000)]
Add unit-tests for various step in build.webkit.org (follow-up fix)
https://bugs.webkit.org/show_bug.cgi?id=222075
<rdar://problem/74691345>

Unreviewed follow-up fix for unit-tests.

* CISupport/build-webkit-org/steps_unittest.py:
(TestRunWebKitPyTests.test_failure):
(TestRunWebKitPyTests.test_errors):
(TestRunWebKitPyTests.test_lot_of_failures):
(TestRunLLDBWebKitTests.test_failure):
(TestRunLLDBWebKitTests.test_errors):
(TestRunLLDBWebKitTests.test_lot_of_failures):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273412 268f45cc-cd09-0410-ab3c-d52691b4dbfc

12 hours agoCloop JSC test driver command shouldn't pass build flags
keith_miller@apple.com [Wed, 24 Feb 2021 19:10:45 +0000 (19:10 +0000)]
Cloop JSC test driver command shouldn't pass build flags
https://bugs.webkit.org/show_bug.cgi?id=222325

Reviewed by Darin Adler.

* CISupport/build-webkit-org/steps.py:
(RunLLINTCLoopTests):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273410 268f45cc-cd09-0410-ab3c-d52691b4dbfc

13 hours agoDisable Buildbot old-style step deprecation warning
aakash_jain@apple.com [Wed, 24 Feb 2021 19:03:28 +0000 (19:03 +0000)]
Disable Buildbot old-style step deprecation warning
https://bugs.webkit.org/show_bug.cgi?id=222363

Reviewed by Jonathan Bedard.

* CISupport/build-webkit-org/master_buildbot2.cfg:
* CISupport/ews-build/master.cfg:
* CISupport/runUnittests.py:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273409 268f45cc-cd09-0410-ab3c-d52691b4dbfc

13 hours ago[ macOS Wk2 ] inspector/dom/attributeModified.html is flakey timing out
tsavell@apple.com [Wed, 24 Feb 2021 18:44:07 +0000 (18:44 +0000)]
[ macOS Wk2 ] inspector/dom/attributeModified.html is flakey timing out
https://bugs.webkit.org/show_bug.cgi?id=222365

Unreviewed test gardenign.

Patch by Robert Jenner <jenner@apple.com> on 2021-02-24

* platform/mac-wk2/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273408 268f45cc-cd09-0410-ab3c-d52691b4dbfc

14 hours ago[GPU Process] In process DisplayList display should have a higher precedence than...
said@apple.com [Wed, 24 Feb 2021 17:58:32 +0000 (17:58 +0000)]
[GPU Process] In process DisplayList display should have a higher precedence than GPUP display
https://bugs.webkit.org/show_bug.cgi?id=222345

Reviewed by Wenson Hsieh.

Source/WebCore:

Give ShouldUseDisplayList a higher precedence since it is a debug option.

* platform/graphics/ImageBuffer.cpp:
(WebCore::ImageBuffer::create):

LayoutTests:

* gpu-process/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273407 268f45cc-cd09-0410-ab3c-d52691b4dbfc

14 hours ago[GPU Process] Implement ImageBufferShareableBitmapBackend::bytesPerRow()
said@apple.com [Wed, 24 Feb 2021 17:51:55 +0000 (17:51 +0000)]
[GPU Process] Implement ImageBufferShareableBitmapBackend::bytesPerRow()
https://bugs.webkit.org/show_bug.cgi?id=222348

Reviewed by Simon Fraser.

Source/WebKit:

The default implementation ImageBufferBackend::bytesPerRow() is not correct
for ImageBufferShareableBitmapBackend because ShareableBitmap aligns the
rows using IOSurfaceAlignProperty(kIOSurfaceBytesPerRow, ...).

* Shared/ShareableBitmap.h:
(WebKit::ShareableBitmap::bytesPerRow const):
* WebProcess/GPU/graphics/ImageBufferShareableBitmapBackend.cpp:
(WebKit::ImageBufferShareableBitmapBackend::bytesPerRow const):
* WebProcess/GPU/graphics/ImageBufferShareableBitmapBackend.h:

LayoutTests:

* gpu-process/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273406 268f45cc-cd09-0410-ab3c-d52691b4dbfc

14 hours agoFix null pointer deref in X509_issuer_and_serial_hash
youenn@apple.com [Wed, 24 Feb 2021 17:26:46 +0000 (17:26 +0000)]
Fix null pointer deref in X509_issuer_and_serial_hash
https://bugs.webkit.org/show_bug.cgi?id=222353
<rdar://problem/74446806>

Reviewed by Eric Carlson.

Cherry-picking of https://github.com/openssl/openssl/commit/8130d654d1de922ea224fa18ee3bc7262edc39c0.

* Source/third_party/boringssl/src/crypto/x509/x509_cmp.c:
(X509_issuer_and_serial_hash):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273405 268f45cc-cd09-0410-ab3c-d52691b4dbfc

14 hours ago[ews] Add python 3 support - part 3
aakash_jain@apple.com [Wed, 24 Feb 2021 17:26:08 +0000 (17:26 +0000)]
[ews] Add python 3 support - part 3
https://bugs.webkit.org/show_bug.cgi?id=222355

Reviewed by Jonathan Bedard.

* CISupport/ews-build/steps.py:
(ValidateCommiterAndReviewer.load_contributors_from_disk): Ensure that the file is closed.
* CISupport/ews-build/steps_unittest.py:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273404 268f45cc-cd09-0410-ab3c-d52691b4dbfc

14 hours ago[ews] Make unit-test compatible with latest buildbot
aakash_jain@apple.com [Wed, 24 Feb 2021 17:25:15 +0000 (17:25 +0000)]
[ews] Make unit-test compatible with latest buildbot
https://bugs.webkit.org/show_bug.cgi?id=222359

Reviewed by Jonathan Bedard.

* CISupport/ews-build/steps_unittest.py:
(BuildStepMixinAdditions):
(BuildStepMixinAdditions.setUpBuildStep): Invoke setUpTestReactor.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273403 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 hours ago[LegacyLineLayout] Inline level box should not stick out at the bottom of its contain...
zalan@apple.com [Wed, 24 Feb 2021 17:02:31 +0000 (17:02 +0000)]
[LegacyLineLayout] Inline level box should not stick out at the bottom of its containing block
https://bugs.webkit.org/show_bug.cgi?id=222334

Reviewed by Antti Koivisto.

Source/WebCore:

When the inline level box's baseline lands on a subpixel position, because of the way we integral "snap" the ascent and descent values
it can end up sticking out of the containing block.
(containing block's height is based on the max ascent + max descent and with implicitly floored descent values, it may not always be enclosing.)

* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::computeLogicalBoxHeights):

LayoutTests:

* platform/mac/css1/text_properties/vertical_align-expected.txt:
* platform/mac/fast/table/table-display-types-strict-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273386 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 hours agoRuntime-disabled CSS features still appear enabled via CSS.supports()
simon.fraser@apple.com [Wed, 24 Feb 2021 16:45:08 +0000 (16:45 +0000)]
Runtime-disabled CSS features still appear enabled via CSS.supports()
https://bugs.webkit.org/show_bug.cgi?id=222280
rdar://74595641

Reviewed by Sam Weinig.

Source/WebCore:

When parsing CSS.supports() for a runtime-disabled property, we'd successfully
parse a CSS-wide keyword like "inherit" and report that the property is supported.

We need to explicitly check for runtime-disabled properties.

Tests: css3/color-filters/color-filter-exposed-if-disabled.html
       fast/css/scroll-behavior-exposed-if-disabled.html

* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::isPropertyRuntimeDisabled const):
(WebCore::CSSParserImpl::consumeDeclaration):
* css/parser/CSSParserImpl.h:

LayoutTests:

* css3/color-filters/color-filter-exposed-if-disabled-expected.txt: Added. Fails tracked in webkit.org/b/217626
* css3/color-filters/color-filter-exposed-if-disabled.html: Added.
* fast/css/overscroll-behavior-invalidate-if-disabled-expected.txt:
* fast/css/overscroll-behavior-invalidate-if-disabled.html:
* fast/css/scroll-behavior-exposed-if-disabled-expected.txt: Added.
* fast/css/scroll-behavior-exposed-if-disabled.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273385 268f45cc-cd09-0410-ab3c-d52691b4dbfc

18 hours agoOnly import Python flatpak module on Linux
don.olmstead@sony.com [Wed, 24 Feb 2021 14:01:05 +0000 (14:01 +0000)]
Only import Python flatpak module on Linux
https://bugs.webkit.org/show_bug.cgi?id=222327

Reviewed by Philippe Normand.

Importing flatpak is only relavent for GTK/WPE ports. Also Windows can fail when importing
it due to platform differences.

* Scripts/run-bindings-tests:
* Scripts/run-builtins-generator-tests:
* Scripts/run-minibrowser:
* Scripts/run-perf-tests:
* Scripts/run-webkit-httpd:
* Scripts/run-webkit-tests:
* Scripts/test-webkitpy:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273384 268f45cc-cd09-0410-ab3c-d52691b4dbfc

18 hours agoAdd unit-tests for various step in build.webkit.org
aakash_jain@apple.com [Wed, 24 Feb 2021 13:21:57 +0000 (13:21 +0000)]
Add unit-tests for various step in build.webkit.org
https://bugs.webkit.org/show_bug.cgi?id=222075

Reviewed by Jonathan Bedard.

* CISupport/build-webkit-org/steps_unittest.py:
(TestRunWebKitPerlTests):
(TestRunWebKitPerlTests.test_success):
(TestRunWebKitPerlTests.test_failure):
(TestRunWebKitPyTests):
(TestRunWebKitPyTests.test_success):
(TestRunWebKitPyTests.test_unexpected_failure):
(TestRunWebKitPyTests.test_failure):
(TestRunWebKitPyTests.test_errors):
(TestRunWebKitPyTests.test_lot_of_failures):
(TestRunLLDBWebKitTests):
(TestRunLLDBWebKitTests.test_success):
(TestRunLLDBWebKitTests.test_unexpected_failure):
(TestRunLLDBWebKitTests.test_failure):
(TestRunLLDBWebKitTests.test_errors):
(TestRunLLDBWebKitTests.test_lot_of_failures):
(TestRunWebKitTests):
(TestRunWebKitTests.configureStep):
(TestRunWebKitTests.test_success):
(TestRunWebKitTests.test_warnings):
(TestRunWebKitTests.test_failure):
(TestRunWebKitTests.test_unexpected_error):
(TestRunWebKitTests.test_exception):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273383 268f45cc-cd09-0410-ab3c-d52691b4dbfc

18 hours agoRefactor OpenXR platform code into different classes and files.
commit-queue@webkit.org [Wed, 24 Feb 2021 13:13:21 +0000 (13:13 +0000)]
Refactor OpenXR platform code into different classes and files.
https://bugs.webkit.org/show_bug.cgi?id=222263

Patch by Imanol Fernandez <ifernandez@igalia.com> on 2021-02-24
Reviewed by Sergio Villar Senin.

OpenXR platform code is going to grow with graphics, extensions, swapchains, controllers and more.
This patch splits the code into different files to make it more readable and maintanable.

* Sources.txt:
* platform/xr/openxr/OpenXRExtensions.cpp: Added.
(PlatformXR::OpenXRExtensions::create):
(PlatformXR::OpenXRExtensions::OpenXRExtensions):
(PlatformXR::OpenXRExtensions::isExtensionSupported const):
* platform/xr/openxr/OpenXRExtensions.h: Added.
* platform/xr/openxr/OpenXRInstance.cpp: Added.
(PlatformXR::Instance::Impl::xrInstance const):
(PlatformXR::Instance::Impl::queue const):
(PlatformXR::Instance::Impl::extensions):
(PlatformXR::Instance::Impl::Impl):
(PlatformXR::Instance::Impl::~Impl):
(PlatformXR::Instance::singleton):
(PlatformXR::Instance::Instance):
(PlatformXR::Instance::enumerateImmersiveXRDevices):
* platform/xr/openxr/OpenXRUtils.h: Added.
(PlatformXR::createStructure):
(PlatformXR::resultToString):
(PlatformXR::XrPosefToPose):
(PlatformXR::xrViewToPose):
(PlatformXR::toXrViewConfigurationType):
* platform/xr/openxr/PlatformXROpenXR.cpp:
(PlatformXR::isSessionActive):
(PlatformXR::isSessionReady):
(PlatformXR::OpenXRDevice::OpenXRDevice):
(PlatformXR::OpenXRDevice::recommendedResolution):
(PlatformXR::OpenXRDevice::initializeTrackingAndRendering):
(PlatformXR::OpenXRDevice::shutDownTrackingAndRendering):
(PlatformXR::OpenXRDevice::initializeReferenceSpace):
(PlatformXR::OpenXRDevice::requestFrame):
(PlatformXR::OpenXRDevice::views const):
(PlatformXR::OpenXRDevice::enumerateReferenceSpaces const):
(PlatformXR::OpenXRDevice::createReferenceSpace):
(PlatformXR::OpenXRDevice::resetSession):
(PlatformXR::OpenXRDevice::handleSessionStateChange):
(PlatformXR::OpenXRDevice::waitUntilStopping):
* platform/xr/openxr/PlatformXROpenXR.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273382 268f45cc-cd09-0410-ab3c-d52691b4dbfc

18 hours agoImplement WebXR getViewport
commit-queue@webkit.org [Wed, 24 Feb 2021 13:09:49 +0000 (13:09 +0000)]
Implement WebXR getViewport
https://bugs.webkit.org/show_bug.cgi?id=222270

Patch by Imanol Fernandez <ifernandez@igalia.com> on 2021-02-24
Reviewed by Sergio Villar Senin.

LayoutTests/imported/w3c:

Update WebXR Viewport test expectations.

* web-platform-tests/webxr/xrViewport_valid.https-expected.txt: Added.
* web-platform-tests/webxr/xrWebGLLayer_viewports.https-expected.txt: Added.

Source/WebCore:

* Modules/webxr/WebXRFrame.cpp:
(WebCore::WebXRFrame::getViewerPose): set WebXRView viewport modifiable value.
* Modules/webxr/WebXRFrame.h:
(WebCore::WebXRFrame::isAnimationFrame const): add method.

* Modules/webxr/WebXRSession.cpp: Implement supportsViewportScaling().
(WebCore::WebXRSession::supportsViewportScaling const):
* Modules/webxr/WebXRSession.h:

* Modules/webxr/WebXRView.cpp: Add viewport scale data.
(WebCore::WebXRView::create):
(WebCore::WebXRView::WebXRView):
(WebCore::WebXRView::recommendedViewportScale const):
(WebCore::WebXRView::requestViewportScale):
* Modules/webxr/WebXRView.h:
(WebCore::WebXRView::frame const):
(WebCore::WebXRView::currentViewportScale const):
(WebCore::WebXRView::setCurrentViewportScale):
(WebCore::WebXRView::requestedViewportScale const):
(WebCore::WebXRView::isViewportModifiable const):
(WebCore::WebXRView::setViewportModifiable):

* Modules/webxr/WebXRView.idl: add requestViewportScale() and recommendedViewportScale.

* Modules/webxr/WebXRViewport.cpp: Implement viewport rect values.
(WebCore::WebXRViewport::create):
(WebCore::WebXRViewport::WebXRViewport):
* Modules/webxr/WebXRViewport.h:
(WebCore::WebXRViewport::x const):
(WebCore::WebXRViewport::y const):
(WebCore::WebXRViewport::width const):
(WebCore::WebXRViewport::height const):
(WebCore::WebXRViewport::updateViewport):

* Modules/webxr/WebXRWebGLLayer.cpp: Implement getViewport()
(WebCore::WebXRWebGLLayer::WebXRWebGLLayer):
(WebCore::m_rightViewport):
(WebCore::WebXRWebGLLayer::getViewport):
* Modules/webxr/WebXRWebGLLayer.h:

* Modules/webxr/WebXRWebGLLayer.idl: Add MayThrowException

* platform/xr/PlatformXR.h: Add supportsViewportScaling method
(PlatformXR::Device::supportsViewportScaling const):

LayoutTests:

Update WebXR Viewport test expectations.

* platform/wpe/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273381 268f45cc-cd09-0410-ab3c-d52691b4dbfc

19 hours agoNullptr crash in ApplyStyleCommand::applyRelativeFontStyleChange
svillar@igalia.com [Wed, 24 Feb 2021 12:53:56 +0000 (12:53 +0000)]
Nullptr crash in ApplyStyleCommand::applyRelativeFontStyleChange
https://bugs.webkit.org/show_bug.cgi?id=221393

Reviewed by Ryosuke Niwa.

Source/WebCore:

Applying a font style change over a range of nodes might change the node tree because in some cases
a span element needs to be created to wrap nodes so they could be styled. Apart from that consecutive
identical span nodes could be merged together. This means that the loop that iterates over a range
of nodes might actually surpass the end node if that end node was merged into some other.

Test: editing/execCommand/font-size-delta-crash.html

* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::applyRelativeFontStyleChange): Exit the loop if the iterator becomes a
child of the beyondEnd node because the latter was merged into the node that wraps the iterator.

LayoutTests:

* editing/execCommand/font-size-delta-crash-expected.txt: Added.
* editing/execCommand/font-size-delta-crash.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273380 268f45cc-cd09-0410-ab3c-d52691b4dbfc

20 hours ago[SOUP3] Use soup_auth_get_authority() to set the ProtectionSpace host and port
commit-queue@webkit.org [Wed, 24 Feb 2021 11:43:22 +0000 (11:43 +0000)]
[SOUP3] Use soup_auth_get_authority() to set the ProtectionSpace host and port
https://bugs.webkit.org/show_bug.cgi?id=222309

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2021-02-24
Reviewed by Adrian Perez de Castro.

Source/WebCore:

That returns the right values in case of proxy authentication.

* platform/network/soup/AuthenticationChallengeSoup.cpp:
(WebCore::protectionSpaceFromSoupAuthAndURL):

Tools:

It fixes two tests when using libsoup3.

* TestWebKitAPI/Tests/WebKitGLib/TestAuthentication.cpp:
(testWebViewAuthenticationProxy):
(testWebViewAuthenticationProxyHTTPS):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273379 268f45cc-cd09-0410-ab3c-d52691b4dbfc

21 hours agoREGRESSION(r267763): [GTK][WPE] user preferred languages are sent to the wrong networ...
carlosgc@webkit.org [Wed, 24 Feb 2021 10:57:33 +0000 (10:57 +0000)]
REGRESSION(r267763): [GTK][WPE] user preferred languages are sent to the wrong network process
https://bugs.webkit.org/show_bug.cgi?id=222347

Reviewed by Adrian Perez de Castro.

WebProcessPool::languageChanged() is creating the default website data store, so languages are sent to the newly
created network process. We should send them to the existing network processes instead.

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::languageChanged):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273378 268f45cc-cd09-0410-ab3c-d52691b4dbfc

21 hours ago[Flatpak SDK] PATH for rustc no longer set correctly
commit-queue@webkit.org [Wed, 24 Feb 2021 10:23:21 +0000 (10:23 +0000)]
[Flatpak SDK] PATH for rustc no longer set correctly
https://bugs.webkit.org/show_bug.cgi?id=222311

Patch by Philippe Normand <pnormand@igalia.com> on 2021-02-24
Reviewed by Žan Doberšek.

Pass PATH as flatpak --env option, setting is through bwrap no longer works.

* flatpak/flatpakutils.py:
(WebkitFlatpak.run_in_sandbox):
* flatpak/webkit-bwrap:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273377 268f45cc-cd09-0410-ab3c-d52691b4dbfc

22 hours agoUnreviewed. Fix GTK build with neewer wpe and wpe-fdo
carlosgc@webkit.org [Wed, 24 Feb 2021 09:26:43 +0000 (09:26 +0000)]
Unreviewed. Fix GTK build with neewer wpe and wpe-fdo

We need to explicitly include wpe.h now.

* UIProcess/API/glib/WebKitProtocolHandler.cpp:
* UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273376 268f45cc-cd09-0410-ab3c-d52691b4dbfc

22 hours agoNullptr crash in CompositeEditCommand::splitTreeToNode via InsertParagraphSeparatorCo...
commit-queue@webkit.org [Wed, 24 Feb 2021 09:20:30 +0000 (09:20 +0000)]
Nullptr crash in CompositeEditCommand::splitTreeToNode via InsertParagraphSeparatorCommand::doApply
https://bugs.webkit.org/show_bug.cgi?id=221387

Patch by Frederic Wang <fwang@igalia.com> on 2021-02-24
Reviewed by Ryosuke Niwa.

Source/WebCore:

WebCore::Position::upstream behaves specially for table renderer, which may confuse the
execution of WebCore::InsertParagraphSeparatorCommand::doApply() when the visible position
is within a table, leading to a debug assertion failure and a nullptr dereference in release
build. This patch fixes that by forcing createFragmentFromText to convert <table> to new
a default paragraph element.

Test: fast/editing/paste-and-match-style-with-table-crash.html

* editing/markup.cpp:
(WebCore::createFragmentFromText): Don't clone enclosing block that are <table>.

LayoutTests:

* fast/editing/paste-and-match-style-with-table-crash-expected.txt: Added.
* fast/editing/paste-and-match-style-with-table-crash.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273375 268f45cc-cd09-0410-ab3c-d52691b4dbfc

23 hours agoNullptr crash in Document::contextDocument() inside FontFaceSet::FontFaceSet
commit-queue@webkit.org [Wed, 24 Feb 2021 08:42:16 +0000 (08:42 +0000)]
Nullptr crash in Document::contextDocument() inside FontFaceSet::FontFaceSet
https://bugs.webkit.org/show_bug.cgi?id=221385

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2021-02-24
Reviewed by Ryosuke Niwa.

Source/WebCore:

When the document last reference is removed but still has node references, we need to keep the document valid
for CSSFontSelector to be able to create a FontFaceSet if document.fonts is requested. In that case the font
selector is marked as cleared, ongoing font load stopped and clients unegistered, but keeping the document until
it's actually destroyed.

Test: fast/css/fontloader-on-detached-document-crash.html

* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::~CSSFontSelector):
(WebCore::CSSFontSelector::clear):
(WebCore::CSSFontSelector::fontRequested):
(WebCore::CSSFontSelector::fallbackFontCount):
(WebCore::CSSFontSelector::fallbackFontAt):
* css/CSSFontSelector.h:
* dom/Document.cpp:
(WebCore::Document::~Document):
(WebCore::Document::removedLastRef):

LayoutTests:

* fast/css/fontloader-on-detached-document-crash-expected.txt: Added.
* fast/css/fontloader-on-detached-document-crash.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273374 268f45cc-cd09-0410-ab3c-d52691b4dbfc

24 hours agoNull check ArrayBufferView RefPtr
commit-queue@webkit.org [Wed, 24 Feb 2021 08:05:43 +0000 (08:05 +0000)]
Null check ArrayBufferView RefPtr
https://bugs.webkit.org/show_bug.cgi?id=221569

Patch by Rob Buis <rbuis@igalia.com> on 2021-02-24
Reviewed by Yusuke Suzuki.

Source/JavaScriptCore:

Null check ArrayBufferView RefPtr before using it.

* runtime/JSArrayBufferViewInlines.h:
(JSC::JSArrayBufferView::unsharedImpl):

LayoutTests:

Add test to verify oom situation does not result in a crash.

* crypto/crypto-random-values-oom-expected.txt: Added.
* crypto/crypto-random-values-oom.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273373 268f45cc-cd09-0410-ab3c-d52691b4dbfc

26 hours agoFix model test differences between platforms
weinig@apple.com [Wed, 24 Feb 2021 05:34:19 +0000 (05:34 +0000)]
Fix model test differences between platforms
https://bugs.webkit.org/show_bug.cgi?id=222323

Reviewed by Ryosuke Niwa.

* model-element/model-element-renderer-no-source.html:
* model-element/model-element-renderer.html:
Try to fix these on iOS by removing the doctype.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273372 268f45cc-cd09-0410-ab3c-d52691b4dbfc

27 hours ago[YARR JIT] Crash on overflow when compiling /(a{1000000000}b{1000000000}|c{1000000000...
msaboff@apple.com [Wed, 24 Feb 2021 05:00:30 +0000 (05:00 +0000)]
[YARR JIT] Crash on overflow when compiling /(a{1000000000}b{1000000000}|c{1000000000}|)d{1000000000}e{1000000000}/.test();
https://bugs.webkit.org/show_bug.cgi?id=220130

Reviewed by Yusuke Suzuki.

JSTests:

Modified the original fuzzer test to go 2^32-1.

* stress/regexp-backtrack-offset-overflow.js: Added.

Source/JavaScriptCore:

Changed code to subtract out the offset of a current op before adding the offset
of the prior op when backtracking to avoid overflowing checked arithmetic.
It looks like the code had this wrong for some time.

* yarr/YarrJIT.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273371 268f45cc-cd09-0410-ab3c-d52691b4dbfc

28 hours agoFix model test differences between platforms
ryanhaddad@apple.com [Wed, 24 Feb 2021 04:03:18 +0000 (04:03 +0000)]
Fix model test differences between platforms
https://bugs.webkit.org/show_bug.cgi?id=222323

Unreviewed test gardening.

* platform/ios/TestExpectations: Mark tests as failing until fix is reviewed & landed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273370 268f45cc-cd09-0410-ab3c-d52691b4dbfc

29 hours ago[ macOS ] media/modern-media-controls/tracks-support/mac/tracks-support-show-panel...
drousso@apple.com [Wed, 24 Feb 2021 02:41:27 +0000 (02:41 +0000)]
[ macOS ] media/modern-media-controls/tracks-support/mac/tracks-support-show-panel-fullscreen.html is a flakey text failure
https://bugs.webkit.org/show_bug.cgi?id=222134
<rdar://problem/74494853>

Unreviewed, this is an identical change to r273357.

* media/modern-media-controls/tracks-support/mac/tracks-support-show-panel-fullscreen.html:
Add a rAF+0s delay before attempting to hover the mute button to give it a chance to
"settle" after it becomes visible (based off of `.getBoundingClientRect().width`).

* platform/mac/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273368 268f45cc-cd09-0410-ab3c-d52691b4dbfc

29 hours ago[iOS] Add null checks for Node before accessing treeScope() in rangeForPointInRootVie...
wenson_hsieh@apple.com [Wed, 24 Feb 2021 02:18:39 +0000 (02:18 +0000)]
[iOS] Add null checks for Node before accessing treeScope() in rangeForPointInRootViewCoordinates
https://bugs.webkit.org/show_bug.cgi?id=222338
<rdar://problem/72292289>

Reviewed by Tim Horton.

Add a null check for the hit test result's `targetNode` inside `rangeForPointInRootViewCoordinates()` to avoid
crashing in the case where the target node is null and either `result <= selectionStart` is `false` or
`selectionEnd <= result` is `false`.

Additionally, avoid a potential null deref on `selectionStart.deepEquivalent().anchorNode()` and
`selectionEnd.deepEquivalent().anchorNode()` by using `Position::treeScope()` (which null checks the anchor
node) instead of directly asking the anchor node.

Note that the call sites of `rangeForPointInRootViewCoordinates()` already handle a `WTF::nullopt` return value
gracefully, by skipping the selection update.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::rangeForPointInRootViewCoordinates):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273367 268f45cc-cd09-0410-ab3c-d52691b4dbfc

30 hours agoREGRESSION (r273004): [ macOS ] media/modern-media-controls/volume-support/volume...
drousso@apple.com [Wed, 24 Feb 2021 01:41:31 +0000 (01:41 +0000)]
REGRESSION (r273004): [ macOS ] media/modern-media-controls/volume-support/volume-support-drag.html is a flakey text failure
https://bugs.webkit.org/show_bug.cgi?id=222117
<rdar://problem/74484639>

Unreviewed, this is an identical change to r273357.

* media/modern-media-controls/volume-support/volume-support-drag.html:
Add a rAF+0s delay before attempting to hover the mute button to give it a chance to
"settle" after it becomes visible (based off of `.getBoundingClientRect().width`).

* platform/mac/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273366 268f45cc-cd09-0410-ab3c-d52691b4dbfc

30 hours ago[Cocoa] Web Inspector: Add support for reloading the inspected page via _WKInspectorE...
pangle@apple.com [Wed, 24 Feb 2021 01:11:03 +0000 (01:11 +0000)]
[Cocoa] Web Inspector: Add support for reloading the inspected page via _WKInspectorExtension
https://bugs.webkit.org/show_bug.cgi?id=222296

Reviewed by BJ Burg.

Source/WebInspectorUI:

Added support for reloading the inspected page, including ignoring the cache if desired, via
_WKInspectorExtension.

* UserInterface/Controllers/WebInspectorExtensionController.js:
(WI.WebInspectorExtensionController.prototype.evaluateScriptForExtension):
(WI.WebInspectorExtensionController.prototype.reloadForExtension):
(WI.WebInspectorExtensionController):
* UserInterface/Protocol/InspectorFrontendAPI.js:
(InspectorFrontendAPI.evaluateScriptForExtension):
(InspectorFrontendAPI.reloadForExtension):

Source/WebKit:

Added a new method to _WKInspectorExtension which is used to implement `browser.devtools.inspectedWindow.reload`
in the Web Extensions API.

* UIProcess/API/APIInspectorExtension.cpp:
(API::InspectorExtension::reloadIgnoringCache):
* UIProcess/API/APIInspectorExtension.h:
* UIProcess/API/Cocoa/_WKInspectorExtension.h:
* UIProcess/API/Cocoa/_WKInspectorExtension.mm:
(-[_WKInspectorExtension reloadIgnoringCache:userAgent:injectedScript:completionHandler:]):
* UIProcess/Inspector/WebInspectorUIExtensionControllerProxy.cpp:
(WebKit::WebInspectorUIExtensionControllerProxy::reloadForExtension):
* UIProcess/Inspector/WebInspectorUIExtensionControllerProxy.h:
* WebProcess/Inspector/WebInspectorUIExtensionController.cpp:
(WebKit::WebInspectorUIExtensionController::reloadForExtension):
* WebProcess/Inspector/WebInspectorUIExtensionController.h:
* WebProcess/Inspector/WebInspectorUIExtensionController.messages.in:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273365 268f45cc-cd09-0410-ab3c-d52691b4dbfc

31 hours ago[macOS] Allow additional syscall support in the sandbox
bfulgham@apple.com [Wed, 24 Feb 2021 01:02:44 +0000 (01:02 +0000)]
[macOS] Allow additional syscall support in the sandbox
https://bugs.webkit.org/show_bug.cgi?id=222335
<rdar://74473824>

Reviewed by Per Arne Vollan.

Expand the WebContent process sandbox to allow SYS_open_dprotected_np

* WebProcess/com.apple.WebProcess.sb.in:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273359 268f45cc-cd09-0410-ab3c-d52691b4dbfc

31 hours ago[check-webkit-style] Fix Contributor sorting in Python 3
jbedard@apple.com [Wed, 24 Feb 2021 00:26:38 +0000 (00:26 +0000)]
[check-webkit-style] Fix Contributor sorting in Python 3
https://bugs.webkit.org/show_bug.cgi?id=222329
<rdar://problem/74656667>

Reviewed by Dewei Zhu.

* Scripts/webkitpy/common/config/committers.py:
(Contributor.__cmp__): Return an integer to indicate ordering.
(Contributor.__eq__): Add rich comparison operators for sorting.
(Contributor.__ne__): Ditto.
(Contributor.__lt__): Ditto.
(Contributor.__le__): Ditto.
(Contributor.__gt__): Ditto.
(Contributor.__ge__): Ditto.
* Scripts/webkitpy/common/config/contributors.json:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273358 268f45cc-cd09-0410-ab3c-d52691b4dbfc

31 hours agoREGRESSION: media/modern-media-controls/volume-support/volume-support-click.html...
drousso@apple.com [Wed, 24 Feb 2021 00:26:11 +0000 (00:26 +0000)]
REGRESSION: media/modern-media-controls/volume-support/volume-support-click.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=222181
<rdar://problem/74527698>

Reviewed by Eric Carlson.

* media/modern-media-controls/volume-support/volume-support-click.html:
Add a rAF+0s delay before attempting to hover the mute button to give it a chance to
"settle" after it becomes visible (based off of `.getBoundingClientRect().width`).

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273357 268f45cc-cd09-0410-ab3c-d52691b4dbfc

32 hours ago[ Big Sur Wk1 ] http/tests/security/http-0.9/default-port-script-blocked.html is...
tsavell@apple.com [Tue, 23 Feb 2021 23:13:12 +0000 (23:13 +0000)]
[ Big Sur Wk1 ] http/tests/security/http-0.9/default-port-script-blocked.html is flakey timing out
https://bugs.webkit.org/show_bug.cgi?id=221717

Unreviewed test gardening.

Patch by Robert Jenner <jenner@apple.com> on 2021-02-23

* platform/mac-wk1/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273356 268f45cc-cd09-0410-ab3c-d52691b4dbfc

33 hours ago[ macOS BigSur Wk2 ] compositing/video/video-border-radius-clipping.html is a flakey...
tsavell@apple.com [Tue, 23 Feb 2021 22:56:06 +0000 (22:56 +0000)]
[ macOS BigSur Wk2 ] compositing/video/video-border-radius-clipping.html is a flakey image failure
https://bugs.webkit.org/show_bug.cgi?id=222332

Unreviewed test gardening.

Patch by Robert Jenner <jenner@apple.com> on 2021-02-23

* platform/mac-wk2/TestExpectations: Added new test expectation to resolve issues with old expectation.
* platform/mac/TestExpectations: Removed incorrect test expectation set as Pass Fail Timeout.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273355 268f45cc-cd09-0410-ab3c-d52691b4dbfc

33 hours ago[BigSur Wk2] imported/w3c/web-platform-tests/media-source/mediasource-seek-during...
tsavell@apple.com [Tue, 23 Feb 2021 22:38:13 +0000 (22:38 +0000)]
[BigSur Wk2] imported/w3c/web-platform-tests/media-source/mediasource-seek-during-pending-seek.html is a flakey failure.
https://bugs.webkit.org/show_bug.cgi?id=222183

Unreviewed test gardening.

Patch by Amir Mark Jr <amir_mark@apple.com> on 2021-02-23

* platform/mac-wk2/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273335 268f45cc-cd09-0410-ab3c-d52691b4dbfc

33 hours agoUnreviewed Windows test gardening to speed up EWS.
ryanhaddad@apple.com [Tue, 23 Feb 2021 22:29:26 +0000 (22:29 +0000)]
Unreviewed Windows test gardening to speed up EWS.

* platform/win/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273334 268f45cc-cd09-0410-ab3c-d52691b4dbfc

33 hours ago[webkitscmpy] Add remote BitBucket
jbedard@apple.com [Tue, 23 Feb 2021 22:22:25 +0000 (22:22 +0000)]
[webkitscmpy] Add remote BitBucket
https://bugs.webkit.org/show_bug.cgi?id=222213
<rdar://problem/74542626>

Rubber-stamped by Aakash Jain.

* Scripts/libraries/webkitscmpy/setup.py: Increment version.
* Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py: Ditto.
* Scripts/libraries/webkitscmpy/webkitscmpy/mocks/remote/__init__.py: Export mock BitBucket.
* Scripts/libraries/webkitscmpy/webkitscmpy/mocks/remote/bitbucket.py: Added.
(BitBucket): Mock limited set of BitBucket REST APIs.
* Scripts/libraries/webkitscmpy/webkitscmpy/remote/__init__.py: Export BitBucket class.
* Scripts/libraries/webkitscmpy/webkitscmpy/remote/bitbucket.py: Added.
(BitBucket): Repository object interacting with BitBucket via REST API.
(BitBucket.is_webserver): Check if the provided URL is a bitbucket URL.
(BitBucket.__init__):
(BitBucket.is_git):
(BitBucket.request): Combine paginated requests into a single API call.
(BitBucket._distance): Preform binary search
(BitBucket._branches_for): Return branches for reference.
(BitBucket.default_branch): Return the default branch.
(BitBucket.branches): Return all branches for repository.
(BitBucket.tags): Return all tags for repository.
(BitBucket.commit): Convert hash, identifier or git ref to Commit object.
(BitBucket.find): Use git to match branches and tags to a hash instead of trying to do it ourselves.
* Scripts/libraries/webkitscmpy/webkitscmpy/remote/scm.py:
(Scm.from_url): Add BitBucket.
* Scripts/libraries/webkitscmpy/webkitscmpy/test/git_unittest.py:
(TestGitHub.test_detection): Add bitbucket url.
(TestBitBucket): Added.
* Scripts/libraries/webkitscmpy/webkitscmpy/test/svn_unittest.py:
(TestRemoteSvn.test_detection): Add bitbucket url.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273333 268f45cc-cd09-0410-ab3c-d52691b4dbfc

34 hours agoPass full environment when auto installing a Python module on Windows
don.olmstead@sony.com [Tue, 23 Feb 2021 21:36:07 +0000 (21:36 +0000)]
Pass full environment when auto installing a Python module on Windows
https://bugs.webkit.org/show_bug.cgi?id=221109
<rdar://problem/74002781>

Reviewed by Jonathan Bedard.

On Python 3 when the AutoInstall routine attempted to setup markupsafe-2.0.0 it would fail
when compiling native code. When compiling outside of Visual Studio there is a batch file
that sets up the environment. This adds a large number of environment variables which could
potentially change over time so to be safe the complete environment is passed to the
setup.py installation routine for Windows only.

* Scripts/libraries/webkitcorepy/webkitcorepy/autoinstall.py:
(Package.install):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273331 268f45cc-cd09-0410-ab3c-d52691b4dbfc

35 hours agoNullptr crash in ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline
commit-queue@webkit.org [Tue, 23 Feb 2021 20:19:23 +0000 (20:19 +0000)]
Nullptr crash in ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline
https://bugs.webkit.org/show_bug.cgi?id=221651

Patch by Frederic Wang <fwang@igalia.com> on 2021-02-23
Reviewed by Ryosuke Niwa.

Source/WebCore:

There are assumptions in the editing code that new containers have an associated renderer,
which is not the case if their style is "display: contents". This patch replaces the
strict debug ASSERT in CompositeEditCommand::appendBlockPlaceholder with a failure
specified by a nullptr return value, similar to other BlockPlaceholder APIs. That way
InsertParagraphSeparatorCommand::doApply can exit early when the block placeholder cannot
be inserted. This patch also fixes one nullptr dereference in release build happening when
executing Editor::replaceSelectionWithFragment.

Test: fast/editing/mutation-with-display-contents-container-crash.html

* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::appendBlockPlaceholder): Return null is the container
has no associated renderer.
* editing/CompositeEditCommand.h: Return a RefPtr, so it is null in case of failure.
* editing/InsertParagraphSeparatorCommand.cpp:
(WebCore::InsertParagraphSeparatorCommand::doApply): Abort command if the block placeholder
cannot be inserted in the container.

LayoutTests:

* fast/editing/mutation-with-display-contents-container-crash-expected.txt: Added.
* fast/editing/mutation-with-display-contents-container-crash.html: Added.
* platform/ios/fast/editing/mutation-with-display-contents-container-crash-expected.txt: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273330 268f45cc-cd09-0410-ab3c-d52691b4dbfc

35 hours agoMake system console logging synchronous
aboya@igalia.com [Tue, 23 Feb 2021 20:09:56 +0000 (20:09 +0000)]
Make system console logging synchronous
https://bugs.webkit.org/show_bug.cgi?id=222279

Reviewed by Alex Christensen.

Previously, the logging of messages to the system console was done in
PageConsoleClient::addMessage(), which was called by
Document::addConsoleMessage(). The latter was called in a TaskQueue
callback.

This had the unfortunate side effect of adding a delay from the time a
macro such as ALWAYS_LOG() is called and the text being printed to the
console. This is particularly a problem when logging 3rd party
libraries that don't use the WebKit logging API to log to stderr, such
as GStreamer, since it causes messages logged by WebKit to not be
synchronized with messages logged by 3rd party libraries or logging
systems. As a consequence the usefulness of WebKit logs is noticeably
reduced.

This patch fixes the issue by moving the code logging to the system
console to the synchronous part of Document::didLogMessage(), while
still handling the rest in the m_logMessageTaskQueue callback.

* dom/Document.cpp:
(WebCore::Document::didLogMessage):
* page/PageConsoleClient.cpp:
(WebCore::PageConsoleClient::addMessage):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273329 268f45cc-cd09-0410-ab3c-d52691b4dbfc

36 hours agoAX: VoiceOver incorrectly announces groups in ARIA tree instances as empty
cfleizach@apple.com [Tue, 23 Feb 2021 20:04:05 +0000 (20:04 +0000)]
AX: VoiceOver incorrectly announces groups in ARIA tree instances as empty
https://bugs.webkit.org/show_bug.cgi?id=221716
<rdar://problem/74205567>

Reviewed by Zalan Bujtas.

Source/WebCore:

ARIA treeitems are allowed to have a child group that can represent the disclosed rows, which are disclosed through aria-owns.

Test: accessibility/mac/treeitem-row-delegation.html

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::ariaTreeRows):

LayoutTests:

* accessibility/mac/treeitem-row-delegation-expected.txt: Added.
* accessibility/mac/treeitem-row-delegation.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273328 268f45cc-cd09-0410-ab3c-d52691b4dbfc

36 hours ago[CoordinatedGraphics] The whole content is unnecessarily repainted by animations...
Hironori.Fujii@sony.com [Tue, 23 Feb 2021 19:55:26 +0000 (19:55 +0000)]
[CoordinatedGraphics] The whole content is unnecessarily repainted by animations in non-AC mode pages
https://bugs.webkit.org/show_bug.cgi?id=221391

Reviewed by Carlos Garcia Campos.

When triggerRenderingUpdate was called back, it added the whole
view area into the dirty region to repaint in non-AC mode pages.
This caused a problem that the whole content was unnecessarily
repainted by animations in non-AC mode pages.

Call scheduleDisplay instead of setNeedsDisplay in
triggerRenderingUpdate.

However, if the dirty region is empty, display() exited early. If
triggerRenderingUpdate is called back,
DrawingAreaCoordinatedGraphics::display should be called to ensure
WebPage::updateRendering() called even if m_dirtyRegion is empty.

Added a new flag m_scheduledWhileWaitingForDidUpdate.

* WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
(WebKit::DrawingAreaCoordinatedGraphics::triggerRenderingUpdate):
Call scheduleDisplay() instead of setNeedsDisplay().
(WebKit::DrawingAreaCoordinatedGraphics::didUpdate):
(WebKit::DrawingAreaCoordinatedGraphics::scheduleDisplay): Don't
return early even if m_dirtyRegion is empty.
(WebKit::DrawingAreaCoordinatedGraphics::display()): Ditto.
(WebKit::DrawingAreaCoordinatedGraphics::display(UpdateInfo&)):
Return early if m_dirtyRegion is empty.
* WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h:
Added m_scheduledWhileWaitingForDidUpdate.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273327 268f45cc-cd09-0410-ab3c-d52691b4dbfc

37 hours agoVersioning.
repstein@apple.com [Tue, 23 Feb 2021 18:58:19 +0000 (18:58 +0000)]
Versioning.

WebKit-7612.1.6

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273321 268f45cc-cd09-0410-ab3c-d52691b4dbfc

37 hours agoUnreviewed, reverting r273304.
commit-queue@webkit.org [Tue, 23 Feb 2021 18:55:46 +0000 (18:55 +0000)]
Unreviewed, reverting r273304.
https://bugs.webkit.org/show_bug.cgi?id=222324

Introduced test failure

Reverted changeset:

"[macOS] Crash under AuxiliaryProcess::initializeSandbox"
https://bugs.webkit.org/show_bug.cgi?id=222233
https://trac.webkit.org/changeset/273304

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273320 268f45cc-cd09-0410-ab3c-d52691b4dbfc

37 hours ago[BigSur] imported/w3c/web-platform-tests/css/css-counter-styles/tibetan/css3-counter...
ryanhaddad@apple.com [Tue, 23 Feb 2021 18:46:59 +0000 (18:46 +0000)]
[BigSur] imported/w3c/web-platform-tests/css/css-counter-styles/tibetan/css3-counter-styles-156.html is consistently failing
https://bugs.webkit.org/show_bug.cgi?id=222118

Unreviewed test gardening.

* platform/mac/TestExpectations: This test is an ImageOnlyFailure.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273318 268f45cc-cd09-0410-ab3c-d52691b4dbfc

37 hours agoUnreviewed, reverting r273307.
commit-queue@webkit.org [Tue, 23 Feb 2021 18:10:55 +0000 (18:10 +0000)]
Unreviewed, reverting r273307.
https://bugs.webkit.org/show_bug.cgi?id=222320

Need to update CI code for CLoop bot before landing this

Reverted changeset:

"Detect unrecognized options in run-javascriptcore-tests"
https://bugs.webkit.org/show_bug.cgi?id=221186
https://trac.webkit.org/changeset/273307

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273316 268f45cc-cd09-0410-ab3c-d52691b4dbfc

38 hours agoshow-identifier fails with error: ascii codec can't decode byte 0xc3 in position
jbedard@apple.com [Tue, 23 Feb 2021 17:54:24 +0000 (17:54 +0000)]
show-identifier fails with error: ascii codec can't decode byte 0xc3 in position
https://bugs.webkit.org/show_bug.cgi?id=222313
<rdar://problem/74645910>

Reviewed by Aakash Jain.

* Scripts/libraries/webkitscmpy/setup.py: Bump version.
* Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py: Ditto.
* Scripts/libraries/webkitscmpy/webkitscmpy/contributor.py:
(Contributor.__repr__): Always return unicode for Python 2.
* Scripts/libraries/webkitscmpy/webkitscmpy/test/contributor_unittest.py:
(TestContributor.test_unicode):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273315 268f45cc-cd09-0410-ab3c-d52691b4dbfc

38 hours agoaspect-ratio shows in computed style when disabled
commit-queue@webkit.org [Tue, 23 Feb 2021 17:50:31 +0000 (17:50 +0000)]
aspect-ratio shows in computed style when disabled
https://bugs.webkit.org/show_bug.cgi?id=222286

Patch by Rob Buis <rbuis@igalia.com> on 2021-02-23
Reviewed by Simon Fraser.

Source/WebCore:

Make aspect-ratio invisible from style when disabled.

Test: fast/css/aspect-ratio-invalidate-if-disabled.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
* css/CSSProperties.json:

Tools:

Add support for disabling aspect-ratio in wk1.

* DumpRenderTree/TestOptions.cpp:
(WTR::TestOptions::defaults):

LayoutTests:

Add test.

* fast/css/aspect-ratio-invalidate-if-disabled-expected.txt: Added.
* fast/css/aspect-ratio-invalidate-if-disabled.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273314 268f45cc-cd09-0410-ab3c-d52691b4dbfc

38 hours agoREGRESSION(r273204): webkitpy tests fail
commit-queue@webkit.org [Tue, 23 Feb 2021 17:37:54 +0000 (17:37 +0000)]
REGRESSION(r273204): webkitpy tests fail
https://bugs.webkit.org/show_bug.cgi?id=222275
<rdar://problem/74614397>

Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2021-02-23
Reviewed by Jonathan Bedard.

Regenerate the IPC generation test expectations that were
not part of r273204.

Tested by
  ./Tools/Scripts/test-webkitpy-python2 -j1 -p Source/WebKit/Scripts/webkit/messages_unittest.py

* Scripts/webkit/tests/MessageArgumentDescriptions.cpp:
(IPC::jsValueForArguments):
(IPC::messageArgumentDescriptions):
* Scripts/webkit/tests/MessageNames.cpp:
(IPC::description):
(IPC::receiverName):
(IPC::isValidMessageName):
* Scripts/webkit/tests/MessageNames.h:
* Scripts/webkit/tests/TestWithSemaphoreMessages.h:
* Scripts/webkit/tests/TestWithStreamMessages.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273313 268f45cc-cd09-0410-ab3c-d52691b4dbfc

38 hours ago[CMake] Fix JSCOnly build on Windows
don.olmstead@sony.com [Tue, 23 Feb 2021 17:23:32 +0000 (17:23 +0000)]
[CMake] Fix JSCOnly build on Windows
https://bugs.webkit.org/show_bug.cgi?id=222316

Reviewed by Michael Catanzaro.

.:

Turn off ENABLE_WEBASSEMBLY for Windows on JSCOnly now that its possible to build it
without FTL.

* Source/cmake/OptionsJSCOnly.cmake:

Source/WTF:

Update sources for the JSCOnly Windows build.

* wtf/PlatformJSCOnly.cmake:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273312 268f45cc-cd09-0410-ab3c-d52691b4dbfc

38 hours ago[GStreamer][EME][Thunder] Initialize decryptor lazily
calvaris@igalia.com [Tue, 23 Feb 2021 17:09:50 +0000 (17:09 +0000)]
[GStreamer][EME][Thunder] Initialize decryptor lazily
https://bugs.webkit.org/show_bug.cgi?id=222314

Reviewed by Philippe Normand.

In some cases, WebKit can be run before Thunder nano services are
up and without PSON, the result can be that you end up with WebKit
thinking there is no DRM system available.

First thing this patch does it removing the once flag so we keep
asking if there are DRM systems available if we are asked about
them from JS.

Second thing is that if we are queried from JS about the
availability of DRM systems and there are some available, we
initialize the decryptor.

* platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::registerWebKitGStreamerElements):
* platform/graphics/gstreamer/eme/CDMThunder.cpp:
(WebCore::CDMFactoryThunder::supportedKeySystems const):
* platform/graphics/gstreamer/eme/WebKitThunderDecryptorGStreamer.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273311 268f45cc-cd09-0410-ab3c-d52691b4dbfc

38 hours agoOnly files in WebCore/testing should be in WebCoreTestSupport
don.olmstead@sony.com [Tue, 23 Feb 2021 17:08:46 +0000 (17:08 +0000)]
Only files in WebCore/testing should be in WebCoreTestSupport
https://bugs.webkit.org/show_bug.cgi?id=222297

Reviewed by Eric Carlson.

After r272721 the non-unified WinCairo build reported error C2859, filename is not the
type file that was used when this precompiled header was created. This was because a
handful of files were in the WebCore library as well as the WebCoreTestSupport library.

Investigating the XCode project it turned out that the files listed in the CMake for
WebCoreTestSupport didn't match. The XCode project had all of the mock files within
platform in WebCore and WebCoreTestSupport just had files in the testing directory.

All mock related files were added to the Sources.txt and the erroneous listing of them
in WebCoreTestSupport_SOURCES were removed.

During the investigation it turned out some mocks were being compiled in both WebCore
and WebCoreTestSupport within the XCode build. This was rectified and an additional
WEBCORE_EXPORT in PlatformSpeechSynthesizerMock was added to support this.

* CMakeLists.txt:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/mock/PlatformSpeechSynthesizerMock.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273310 268f45cc-cd09-0410-ab3c-d52691b4dbfc

39 hours ago[GStreamer] fast/mediastream/captureStream/canvas2d.html is flaky timing out since...
commit-queue@webkit.org [Tue, 23 Feb 2021 16:58:16 +0000 (16:58 +0000)]
[GStreamer] fast/mediastream/captureStream/canvas2d.html is flaky timing out since GStreamer 1.18 update
https://bugs.webkit.org/show_bug.cgi?id=218580

Patch by Philippe Normand <pnormand@igalia.com> on 2021-02-23
Reviewed by Xabier Rodriguez-Calvar.

Source/WebCore:

Live streams start without pre-rolling, that means they can reach PAUSED while sinks still
haven't received a sample to render. So we need to notify the media element in such cases
only after pre-rolling has completed. Otherwise the media element might emit a play event
too early, before pre-rolling has been completed.

No new tests, this patch fixes a few layout tests though, most notably removing flakiness
from fast/mediastream/captureStream/canvas2d.html.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::updateStates):
(WebCore::MediaPlayerPrivateGStreamer::triggerRepaint):

LayoutTests:

* platform/glib/TestExpectations: Unflag no-longer-flaky and now-passing media tests.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273309 268f45cc-cd09-0410-ab3c-d52691b4dbfc

39 hours agoUse adoptNS() as soon as we [[ObjcClass alloc] init] to avoid leaks in Tools/
cdumez@apple.com [Tue, 23 Feb 2021 16:21:48 +0000 (16:21 +0000)]
Use adoptNS() as soon as we [[ObjcClass alloc] init] to avoid leaks in Tools/
https://bugs.webkit.org/show_bug.cgi?id=222288

Reviewed by Darin Adler.

* DumpRenderTree/ios/PixelDumpSupportIOS.mm:
* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptControllerIOS::zoomScale const):
(WTR::UIScriptControllerIOS::scrollToOffset):
(WTR::UIScriptControllerIOS::immediateScrollToOffset):
(WTR::UIScriptControllerIOS::minimumZoomScale const):
(WTR::UIScriptControllerIOS::maximumZoomScale const):
* DumpRenderTree/mac/DumpRenderTree.mm:
(fontAllowList):
(adjustWebDocumentForFlexibleViewport):
(createWebViewAndOffscreenWindow):
(allocateGlobalControllers):
(releaseGlobalControllers):
(resetWebViewToConsistentState):
(runTest):
* DumpRenderTree/mac/DumpRenderTreeMac.h:
* DumpRenderTree/mac/DumpRenderTreePasteboard.mm:
(+[DumpRenderTreePasteboard _pasteboardWithName:]):
(+[DumpRenderTreePasteboard releaseLocalPasteboards]):
* DumpRenderTree/mac/EventSendingController.mm:
(drt_WebHTMLView_beginDraggingSessionWithItemsEventSource):
(+[EventSendingController initialize]):
(-[EventSendingController beginDragWithFiles:]):
(-[EventSendingController beginDragWithFilePromises:]):
(-[EventSendingController mouseUp:withModifiers:]):
(-[EventSendingController mouseMoveToX:Y:]):
* DumpRenderTree/mac/FrameLoadDelegate.mm:
(-[FrameLoadDelegate didClearWindowObjectInStandardWorldForFrame:]):
* DumpRenderTree/mac/TestRunnerMac.mm:
(TestRunner::setCustomPolicyDelegate):
(TestRunner::waitForPolicyDelegate):
(TestRunner::apiTestNewWindowDataLoadBaseURL):
* DumpRenderTree/mac/UIDelegate.mm:
(-[UIDelegate webView:dragImage:at:offset:event:pasteboard:source:slideBack:forView:]):
(-[UIDelegate dealloc]):
* TestRunnerShared/cocoa/LayoutTestSpellChecker.mm:
(ensureGlobalLayoutTestSpellChecker):
* TestWebKitAPI/Tests/WebKit/GetUserMedia.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/GetUserMediaNavigation.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/GetUserMediaReprompt.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/mac/CustomBundleParameter.mm:
(TestWebKitAPI::didReceiveMessageFromInjectedBundle):
* TestWebKitAPI/Tests/WebKitCocoa/CommandBackForward.mm:
(WebKit2_CommandBackForwardTestWKView::SetUp):
* TestWebKitAPI/Tests/WebKitCocoa/Download.mm:
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm:
* TestWebKitAPI/Tests/WebKitCocoa/NowPlayingControlsTests.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitCocoa/PasteMixedContent.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitCocoa/ReparentWebViewTimeout.mm:
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/SchemeRegistry.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitCocoa/SystemPreview.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitCocoa/TestSOAuthorization.mm:
(-[TestSOAuthorizationDelegate webView:createWebViewWithConfiguration:forNavigationAction:windowFeatures:]):
* TestWebKitAPI/Tests/WebKitCocoa/UserInitiatedActionInNavigationAction.mm:
(UserInitiatedActionTest::URLWithFragment):
* TestWebKitAPI/Tests/WebKitCocoa/UserMediaDisabled.mm:
(TEST_F):
* TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm:
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/WKInspectorDelegate.mm:
(-[UIDelegate _webView:configurationForLocalInspector:]):
* TestWebKitAPI/Tests/WebKitCocoa/WKPDFView.mm:
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/WKWebViewCandidateTests.mm:
(+[CandidateTestWebView setUpWithFrame:testPage:]):
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/WKWebViewDoesNotLogDuringInitialization.mm:
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/WKWebViewEvaluateJavaScript.mm:
* TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm:
(runWebsiteDataStoreCustomPaths):
* TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm:
(-[WebsitePoliciesWebsiteDataStoreDelegate webView:startURLSchemeTask:]):
* TestWebKitAPI/Tests/WebKitLegacy/mac/ClosingWebView.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitObjC/CustomProtocolsInvalidScheme.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitObjC/PreventImageLoadWithAutoResizing.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitObjC/UserContentTest.mm:
(TEST_F):
* TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm:
(+[InputAssistantItemTestingWebView leadingItemsForWebView:]):
(+[InputAssistantItemTestingWebView trailingItemsForWebView:]):
* TestWebKitAPI/Tests/ios/WKScrollViewDelegate.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/mac/CandidateTests.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/mac/MemoryCachePruneWithinResourceLoadDelegate.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/ios/mainIOS.mm:
(main):
* TestWebKitAPI/mac/TestFontOptions.mm:
(+[TestFontOptions sharedInstance]):
* TestWebKitAPI/mac/mainMac.mm:
(main):
* WebKitTestRunner/InjectedBundle/ios/AccessibilityControllerIOS.mm:
(WTR::AccessibilityController::addNotificationListener):
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::globalWebViewConfiguration):
(WTR::globalWebsiteDataStoreDelegateClient):
(WTR::initializeWebViewConfiguration):
(WTR::TestController::platformContext):
(WTR::TestController::platformPreferences):
(WTR::TestController::platformInitializeDataStore):
(WTR::TestController::platformCreateWebView):
(WTR::TestController::platformCreateOtherPage):
(WTR::TestController::platformAdjustContext):
(WTR::TestController::cocoaResetStateToConsistentValues):
(WTR::TestController::removeAllSessionCredentials):
(WTR::TestController::getAllStorageAccessEntries):
(WTR::TestController::loadedSubresourceDomains):
(WTR::TestController::clearLoadedSubresourceDomains):
(WTR::TestController::injectUserScript):
(WTR::TestController::setAllowStorageQuotaIncrease):
(WTR::TestController::setAllowsAnySSLCertificate):
* WebKitTestRunner/ios/GeneratedTouchesDebugWindow.mm:
(+[GeneratedTouchesDebugWindow sharedGeneratedTouchesDebugWindow]):
* WebKitTestRunner/ios/HIDEventGenerator.mm:
(+[HIDEventGenerator sharedHIDEventGenerator]):
* WebKitTestRunner/mac/TestControllerMac.mm:
(WTR::TestController::configureContentExtensionForTest):
* WebKitTestRunner/mac/WebKitTestRunnerPasteboard.mm:
(+[WebKitTestRunnerPasteboard _pasteboardWithName:]):
(+[WebKitTestRunnerPasteboard releaseLocalPasteboards]):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273308 268f45cc-cd09-0410-ab3c-d52691b4dbfc

39 hours agoDetect unrecognized options in run-javascriptcore-tests
commit-queue@webkit.org [Tue, 23 Feb 2021 16:18:08 +0000 (16:18 +0000)]
Detect unrecognized options in run-javascriptcore-tests
https://bugs.webkit.org/show_bug.cgi?id=221186

Patch by Angelos Oikonomopoulos <angelos@igalia.com> on 2021-02-23
Reviewed by Keith Miller.

run-javascriptcore-tests saves unrecognized arguments to pass
through to build-jsc even when --no-build is used. However, when
we're not building, nothing will ever use or look at the extra
arguments. This means that those arguments are silently eaten
up and, consequently, typos in option names can go undetected.

Change the script to fail when --no-build has been passed and
there are unrecognized options.

* Scripts/run-javascriptcore-tests:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273307 268f45cc-cd09-0410-ab3c-d52691b4dbfc

41 hours agoUnreviewed, GTK Ubuntu LTS build fix after r273241
dpino@igalia.com [Tue, 23 Feb 2021 15:05:07 +0000 (15:05 +0000)]
Unreviewed, GTK Ubuntu LTS build fix after r273241

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::invalidateLineLayoutPath): Function
modernLineLayout is only defined if ENABLE(LAYOUT_FORMATING_CONTEXT)

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273306 268f45cc-cd09-0410-ab3c-d52691b4dbfc

41 hours ago[iOS] Add a watchdog timer to forcibly reset deferring gesture recognizers
wenson_hsieh@apple.com [Tue, 23 Feb 2021 14:34:38 +0000 (14:34 +0000)]
[iOS] Add a watchdog timer to forcibly reset deferring gesture recognizers
https://bugs.webkit.org/show_bug.cgi?id=222216

Reviewed by Simon Fraser.

Add a mechanism to detect and resolve situations where at least one deferring gesture recognizer
(`WKDeferringGestureRecognizer`) is stuck in Possible state after ending touches, but the touch event gesture
recognizer is unable to be reset (i.e. neither possible or recognizing). This state is indicative of a general
class of bugs regarding native gesture deferral, wherein our "gesture gates" never end up being lifted after
ending all touches in the view. One such example of this type of bug was fixed in r272584, where all interaction
(touch events, scrolling, tapping) due to the touch end deferrers never exiting Possible state after long
pressing to present a context menu.

To make these kinds of bugs both easier to diagnose and less fatal in the future, we introduce a watchdog timer
that dispatches after ending all touches on the content view, and checks the consistency of deferring gesture
recognizers in the view; if we detect stuck deferring gestures, we handle this by forcibly resetting the stuck
deferring gestures and logging a fault message.

I manually verified this change by reverting my fix for the aforementioned bug (r272584), and observing both (1)
a system log fault message, and (2) that interactions continued to work even without the fix in r272584, after
the watchdog timer fired. See below for more details.

* SourcesCocoa.txt:
* UIProcess/ios/GestureRecognizerConsistencyEnforcer.h: Copied from Source/WebKit/UIProcess/ios/WKDeferringGestureRecognizer.h.
* UIProcess/ios/GestureRecognizerConsistencyEnforcer.mm: Added.
(WebKit::GestureRecognizerConsistencyEnforcer::GestureRecognizerConsistencyEnforcer):
(WebKit::GestureRecognizerConsistencyEnforcer::beginTracking):
(WebKit::GestureRecognizerConsistencyEnforcer::endTracking):
(WebKit::GestureRecognizerConsistencyEnforcer::reset):
(WebKit::GestureRecognizerConsistencyEnforcer::timerFired):

Add a helper class that wraps a `RunLoop::Timer` for the main runloop, and schedules a 1 second timer after all
deferring gestures have ended; assuming no new touches begin after this timer is scheduled, we'll perform a
consistency check over the content view's gestures and perform a log fault and force deferring gestures to end
if needed.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setUpInteraction]):
(-[WKContentView cleanUpInteraction]):

Make sure that we reset any extant `GestureRecognizerConsistencyEnforcer` if the web process crashes.

(-[WKContentView _removeDefaultGestureRecognizers]):
(-[WKContentView _addDefaultGestureRecognizers]):
(-[WKContentView _webTouchEventsRecognized:]):

Adjust a few compile-time guards so that deferring gesture recognizers exist on the view, even if
`ENABLE_IOS_TOUCH_EVENTS` is off. This makes some of the gesture deferral code throughout this file easier to
reason about in non-internal iOS builds, since we don't need to sprinkle as many `ENABLE(IOS_TOUCH_EVENTS)`
checks throughout this class.

(-[WKContentView touchEventGestureRecognizer]):
(-[WKContentView gestureRecognizerConsistencyEnforcer]):
(-[WKContentView deferringGestures]):
(-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
(-[WKContentView deferringGestureRecognizer:willBeginTouchesWithEvent:]):

Refactor `-deferringGestureRecognizer:shouldDeferGesturesAfterBeginningTouchesWithEvent:` so that it returns an
enum flag indicating whether the given gesture should be allowed to begin deferring native gestures; by making
this `-deferringGestureRecognizer:willBeginTouchesWithEvent:`, we can now put state management logic here that's
responsible for updating the `GestureRecognizerConsistencyEnforcer`.

(-[WKContentView deferringGestureRecognizer:didTransitionToState:]):
(-[WKContentView deferringGestureRecognizer:didEndTouchesWithEvent:]):
(-[WKContentView _deferringGestures]): Deleted.

Rename this to `-deferringGestures` and expose it as a readonly property, for use by the
`GestureRecognizerConsistencyEnforcer`.

(-[WKContentView deferringGestureRecognizer:shouldDeferGesturesAfterBeginningTouchesWithEvent:]): Deleted.
* UIProcess/ios/WKDeferringGestureRecognizer.h:
* UIProcess/ios/WKDeferringGestureRecognizer.mm:
(-[WKDeferringGestureRecognizer touchesBegan:withEvent:]):
(-[WKDeferringGestureRecognizer setState:]):

Add a delegate hook to inform `WKContentView` when the gesture recognizer state changes.

(-[WKDeferringGestureRecognizer deferringGestureDelegate]): Deleted.
* UIProcess/mac/WKPrintingView.h:

Fix a missing include that results in a build failure due to changed unified sources.

* WebKit.xcodeproj/project.pbxproj:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273305 268f45cc-cd09-0410-ab3c-d52691b4dbfc

42 hours ago[macOS] Crash under AuxiliaryProcess::initializeSandbox
pvollan@apple.com [Tue, 23 Feb 2021 13:58:35 +0000 (13:58 +0000)]
[macOS] Crash under AuxiliaryProcess::initializeSandbox
https://bugs.webkit.org/show_bug.cgi?id=222233

Unreviewed, address additional review feedback.

Add comment and logging when the WebKit client is setting the user directory suffix.

* Shared/mac/AuxiliaryProcessMac.mm:
(WebKit::initializeSandboxParameters):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273304 268f45cc-cd09-0410-ab3c-d52691b4dbfc

43 hours ago[GTK] Use std::bitset to specify WebKitTestServer's options
commit-queue@webkit.org [Tue, 23 Feb 2021 13:01:29 +0000 (13:01 +0000)]
[GTK] Use std::bitset to specify WebKitTestServer's options
https://bugs.webkit.org/show_bug.cgi?id=222273

Patch by Frederic Wang <fwang@igalia.com> on 2021-02-23
Reviewed by Carlos Garcia Campos.

* TestWebKitAPI/Tests/WebKitGLib/TestSSL.cpp:
(beforeAll):
* TestWebKitAPI/glib/WebKitGLib/WebKitTestServer.cpp:
(WebKitTestServer::WebKitTestServer):
* TestWebKitAPI/glib/WebKitGLib/WebKitTestServer.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273303 268f45cc-cd09-0410-ab3c-d52691b4dbfc

43 hours agoNullptr crash in ModifySelectionListLevelCommand::appendSiblingNodeRange
commit-queue@webkit.org [Tue, 23 Feb 2021 12:28:20 +0000 (12:28 +0000)]
Nullptr crash in ModifySelectionListLevelCommand::appendSiblingNodeRange
https://bugs.webkit.org/show_bug.cgi?id=221650

Patch by Frederic Wang <fwang@igalia.com> on 2021-02-23
Reviewed by Ryosuke Niwa.

Source/WebCore:

getStartEndListChildren relies on the render tree to move the "end" node to the next sibling,
but this does not necessarily correspond to a sibling of the "start" node in the DOM tree.
This breaks the assumption of ModifySelectionListLevelCommand::appendSiblingNodeRange that
the "start" and "end" nodes are siblings (in that order), causing a null-pointer dereference.
This patch fixes the issue by ensuring that getStartEndListChildren does not try to change
the "end" node if it is not a sibling of the "start" one.

Test: fast/editing/modify-selection-list-level-crash.html

* editing/ModifySelectionListLevel.cpp:
(WebCore::getStartEndListChildren): Don't change the end node if r->node() is a sibling of
startChildList.

LayoutTests:

* fast/editing/modify-selection-list-level-crash-expected.txt: Added.
* fast/editing/modify-selection-list-level-crash.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273302 268f45cc-cd09-0410-ab3c-d52691b4dbfc

47 hours agoHTMLCanvasElement::copiedImage() contains old image with GPU Process on
commit-queue@webkit.org [Tue, 23 Feb 2021 08:58:30 +0000 (08:58 +0000)]
HTMLCanvasElement::copiedImage() contains old image with GPU Process on
https://bugs.webkit.org/show_bug.cgi?id=222101

Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2021-02-23
Reviewed by Simon Fraser.

Source/WebKit:

Implement RemoteImageBufferProxy::copyImage and
RemoteImageBufferProxy::copyNativeImage.
Implement by asking the data from the GPU process.

Previously, with AcceleratedImageBufferShareableMappedBackend
the HTMLCanvasElement::copiedImage() would construct the copy
by copying the CGContext backed by the IOSurface that is accessible
by both processes. This would succeed. After a draw to the image,
the second copy would not reflect the draw but contain the same
image as the first copy.

Fix by not using the fact that the IOSurface is accessible by both
processes. In the end, IOSurfaces will not be available in
Web process.

Converts NativeImage to ShareableBitmap with WebCore::CompositeOperator::Copy
since the ImageBuffers might have unpremultiplied contents. Also, ShareableBitmap
does not have contents, so blending is overhead.

No new tests, enables ~150 tests.

* GPUProcess/graphics/RemoteGraphicsContextGL.cpp:
(WebKit::RemoteGraphicsContextGL::copyTextureFromMedia):
* GPUProcess/graphics/RemoteRenderingBackend.cpp:
(WebKit::RemoteRenderingBackend::getShareableBitmapForImageBuffer):
* GPUProcess/graphics/RemoteRenderingBackend.h:
* GPUProcess/graphics/RemoteRenderingBackend.messages.in:
* WebProcess/GPU/graphics/RemoteImageBufferProxy.h:
* WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp:
(WebKit::RemoteRenderingBackendProxy::getShareableBitmap):
* WebProcess/GPU/graphics/RemoteRenderingBackendProxy.h:

LayoutTests:

* gpu-process/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273301 268f45cc-cd09-0410-ab3c-d52691b4dbfc

47 hours agoHandle Page::didFinishLoadingImageForElement asynchronously
rniwa@webkit.org [Tue, 23 Feb 2021 08:20:01 +0000 (08:20 +0000)]
Handle Page::didFinishLoadingImageForElement asynchronously
https://bugs.webkit.org/show_bug.cgi?id=221390

Reviewed by Antti Koivisto.

Use EventLoop instead of RunLoop::main() to be thread safe in iOS WebKit1.

* page/Page.cpp:
(WebCore::Page::didFinishLoadingImageForElement):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273300 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 days agoNon-unified build fixes late February 2021 edition
don.olmstead@sony.com [Tue, 23 Feb 2021 07:43:16 +0000 (07:43 +0000)]
Non-unified build fixes late February 2021 edition
https://bugs.webkit.org/show_bug.cgi?id=222303

Unreviewed non-unified build fixes.

Source/JavaScriptCore:

* API/JSAPIValueWrapper.cpp:
* bytecode/SetPrivateBrandVariant.h:
* heap/HeapAnalyzer.h:
* heap/HeapProfiler.cpp:
* parser/ParserTokens.h:
* runtime/DOMAttributeGetterSetter.cpp:
* runtime/GlobalExecutable.cpp:
* runtime/JSScriptFetchParameters.cpp:

Source/WebCore:

* bindings/js/ScriptModuleLoader.cpp:
* layout/integration/LayoutIntegrationInlineContentBuilder.cpp:
* layout/integration/LayoutIntegrationInlineContentBuilder.h:
* workers/WorkerGlobalScopeProxy.h:
* workers/WorkerMessagingProxy.cpp:
* workers/WorkerOrWorkletScriptController.cpp:
* workers/WorkerOrWorkletScriptController.h:
* workers/service/ServiceWorkerJob.cpp:

Source/WebKit:

* GPUProcess/graphics/RemoteRenderingBackend.cpp:
* WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273299 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 days agoREGRESSION (r272928): ASSERT NOT REACHED in WebCore::FrameSelection::setSelectionWith...
rniwa@webkit.org [Tue, 23 Feb 2021 03:50:54 +0000 (03:50 +0000)]
REGRESSION (r272928): ASSERT NOT REACHED in WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance
https://bugs.webkit.org/show_bug.cgi?id=222219
<rdar://problem/74548257>

Reviewed by Wenson Hsieh.

The assertion failure was caused by confirmCompositionAndNotifyClient called in commitProvisionalLoad
committing the composition even though the composition node had been removed from the document.

Fixed the bug by canceling the composition if the composition node had been removed or the selection
had been moved away from it in confirmCompositionAndNotifyClient.

Test: editing/input/select-all-clear-input-method.html

* editing/Editor.cpp:
(WebCore::Editor::confirmOrCancelCompositionAndNotifyClient): Renamed from confirmCompositionAndNotifyClient.
* editing/Editor.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::commitProvisionalLoad):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273298 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 days ago[Payment Request] REGRESSION(r273143): crash shortly after showing the Apple Pay...
drousso@apple.com [Tue, 23 Feb 2021 03:34:22 +0000 (03:34 +0000)]
[Payment Request] REGRESSION(r273143): crash shortly after showing the Apple Pay sheet
https://bugs.webkit.org/show_bug.cgi?id=222298
<rdar://problem/74557943>

Reviewed by Wenson Hsieh.

* Platform/cocoa/PaymentAuthorizationPresenter.mm:
(WebKit::toNSErrors):
Don't use `adoptNS` with `+[NSMutableArray array]` since that returns an autoreleased object.
Use the helper `createNSArray` instead (as was previously done before r273143).

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273297 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 days agoWebMouseEvent.h should avoid pulling in WebCore headers that know about DOM nodes
wenson_hsieh@apple.com [Tue, 23 Feb 2021 03:16:32 +0000 (03:16 +0000)]
WebMouseEvent.h should avoid pulling in WebCore headers that know about DOM nodes
https://bugs.webkit.org/show_bug.cgi?id=222291

Reviewed by Darin Adler.

Source/WebCore:

Refactor `PointerEvent.h` so that the static class helper methods for getting the names of mouse, pen and touch
pointer event types are instead separate functions in `PointerEventTypeNames.h`. This allows us to just import
`PointerEventTypeNames.h` instead of `PointerEvent.h` in WebKit -- and, in particular, within WebKit headers
that are exclusive to the UI process.

No change in behavior.

* Headers.cmake:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/PointerEvent.cpp:
(WebCore::PointerEvent::mousePointerType): Deleted.
(WebCore::PointerEvent::penPointerType): Deleted.
(WebCore::PointerEvent::touchPointerType): Deleted.
* dom/PointerEvent.h:

Drive-by fix: also forward declare `Node` instead of including `Node.h`; `WebCore::Node` is only used in this
header in the context of `RefPtr<Node>`, so the forward declaration is sufficient.

* dom/PointerEventTypeNames.cpp: Added.
(WebCore::mousePointerEventType):
(WebCore::penPointerEventType):
(WebCore::touchPointerEventType):
* dom/PointerEventTypeNames.h: Added.
* dom/ios/PointerEventIOS.cpp:
* page/PointerCaptureController.cpp:
(WebCore::PointerCaptureController::reset):
(WebCore::PointerCaptureController::pointerEventForMouseEvent):
(WebCore::PointerCaptureController::dispatchEvent):
(WebCore::PointerCaptureController::pointerEventWillBeDispatched):
(WebCore::PointerCaptureController::pointerEventWasDispatched):
(WebCore::PointerCaptureController::processPendingPointerCapture):

Source/WebKit:

Import `PointerEventTypeNames.h` instead of `PointerEvent.h` in several UI process and shared headers.

* Shared/WebMouseEvent.h:
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(primaryPointerForType):
(webkitWebViewBaseSynthesizeMouseEvent):
* UIProcess/Automation/SimulatedInputDispatcher.cpp:
(WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::performMouseInteraction):
* UIProcess/gtk/PointerLockManager.cpp:
(WebKit::PointerLockManager::handleMotion):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273296 268f45cc-cd09-0410-ab3c-d52691b4dbfc