WebKit-https.git
8 months agoSet ruby-indent-level to 4
commit-queue@webkit.org [Wed, 27 Jan 2021 12:12:29 +0000 (12:12 +0000)]
Set ruby-indent-level to 4
https://bugs.webkit.org/show_bug.cgi?id=220982

Patch by Angelos Oikonomopoulos <angelos@igalia.com> on 2021-01-27
Reviewed by Fujii Hironori.

All the ruby source files seem to default to 4 as the indent
level; make it official.

* .dir-locals.el:
* .editorconfig:

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

8 months agoUpstream to WPT Shadow DOM tests related to :focus pseudo-class
rego@igalia.com [Wed, 27 Jan 2021 11:41:20 +0000 (11:41 +0000)]
Upstream to WPT Shadow DOM tests related to :focus pseudo-class
https://bugs.webkit.org/show_bug.cgi?id=220907

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

These tests landed originally in r250788 (bug #202432).

* web-platform-tests/shadow-dom/focus/focus-pseudo-matches-on-shadow-host-expected.txt: Renamed from LayoutTests/fast/shadow-dom/focus-pseudo-matches-on-shadow-host-expected.txt.
* web-platform-tests/shadow-dom/focus/focus-pseudo-matches-on-shadow-host.html: Renamed from LayoutTests/fast/shadow-dom/focus-pseudo-matches-on-shadow-host.html.
  Removed workaround to wait until :focus matches on "focus" event, as that has been fixed in r271146 (bug #220243).
* web-platform-tests/shadow-dom/focus/focus-pseudo-on-shadow-host-1-expected.xht: Added.
* web-platform-tests/shadow-dom/focus/focus-pseudo-on-shadow-host-1.html: Renamed from LayoutTests/fast/shadow-dom/focus-pseudo-on-shadow-host-1.html.
* web-platform-tests/shadow-dom/focus/focus-pseudo-on-shadow-host-2-expected.xht: Added.
* web-platform-tests/shadow-dom/focus/focus-pseudo-on-shadow-host-2.html: Renamed from LayoutTests/fast/shadow-dom/focus-pseudo-on-shadow-host-2.html.
* web-platform-tests/shadow-dom/focus/focus-pseudo-on-shadow-host-3-expected.xht: Added.
* web-platform-tests/shadow-dom/focus/focus-pseudo-on-shadow-host-3.html: Renamed from LayoutTests/fast/shadow-dom/focus-pseudo-on-shadow-host-3.html.

LayoutTests:

* fast/shadow-dom/focus-pseudo-on-shadow-host-1-expected.html: Removed.
* fast/shadow-dom/focus-pseudo-on-shadow-host-2-expected.html: Removed.
* fast/shadow-dom/focus-pseudo-on-shadow-host-3-expected.html: Removed.
* platform/ios/TestExpectations: Mark the new exported tests as passing.

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

8 months agoREGRESSION(r271929): MobileSafari hangs upon launch due to a trivial deadlock in...
rniwa@webkit.org [Wed, 27 Jan 2021 11:06:21 +0000 (11:06 +0000)]
REGRESSION(r271929): MobileSafari hangs upon launch due to a trivial deadlock in IOSurfacePool::setPoolSize
https://bugs.webkit.org/show_bug.cgi?id=221027

Reviewed by Tim Horton.

Avoid the deadlock by not grabbing the lock in IOSurfacePool::evict when discarding all surfaces.
To do this, we extract the code in discardAllSurfaces as discardAllSurfacesInternal and use it in evict.

* platform/graphics/cg/IOSurfacePool.cpp:
(WebCore::IOSurfacePool::evict): Calls discardAllSurfacesInternal.
(WebCore::IOSurfacePool::discardAllSurfaces):
(WebCore::IOSurfacePool::discardAllSurfacesInternal): Extracted out of discardAllSurfaces.
* platform/graphics/cg/IOSurfacePool.h:

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

8 months ago[JSC] Remove InspectorInstrumentation object
ysuzuki@apple.com [Wed, 27 Jan 2021 11:04:22 +0000 (11:04 +0000)]
[JSC] Remove InspectorInstrumentation object
https://bugs.webkit.org/show_bug.cgi?id=221028

Reviewed by Ryosuke Niwa.

Remove InspectorInstrumentation since it is not used. We would like to clean up Promise's rejection path.

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* JavaScriptCore.xcodeproj/project.pbxproj:
* Scripts/tests/builtins/JavaScriptCore-Builtin.Promise-Combined.js:
(rejectPromise):
(fulfillPromise):
* Scripts/tests/builtins/JavaScriptCore-Builtin.Promise-Separate.js:
(rejectPromise):
(fulfillPromise):
* Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Separate.js-result:
* Sources.txt:
* builtins/BuiltinNames.h:
* builtins/InspectorInstrumentationObject.js: Removed.
* builtins/PromiseOperations.js:
(globalPrivate.rejectPromise):
(globalPrivate.fulfillPromise):
* bytecode/LinkTimeConstant.h:
* runtime/InspectorInstrumentationObject.cpp: Removed.
* runtime/InspectorInstrumentationObject.h: Removed.
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):

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

8 months agoComplete WebXRRigidTransform implementation
commit-queue@webkit.org [Wed, 27 Jan 2021 11:04:16 +0000 (11:04 +0000)]
Complete WebXRRigidTransform implementation
https://bugs.webkit.org/show_bug.cgi?id=220732
<rdar://problem/73617302>

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

LayoutTests/imported/w3c:

Enable XRRigidTransform WebXR tests.

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

Source/WebCore:

- Implement XRRigidTransform.inverse().
- Expose raw matrix to be used in other WebXR math calculations (e.g pose composition).
- Correctly lazily initialize and reuse the Float32Array matrixData.

Tested by the WebXR platform tests.

* Modules/webxr/WebXRRigidTransform.cpp:
(WebCore::normalizeQuaternion):
(WebCore::WebXRRigidTransform::create):
(WebCore::WebXRRigidTransform::WebXRRigidTransform):
(WebCore::m_orientation):
(WebCore::m_rawTransform):
(WebCore::WebXRRigidTransform::matrix):
(WebCore::WebXRRigidTransform::inverse):
(WebCore::WebXRRigidTransform::rawTransform const):
* Modules/webxr/WebXRRigidTransform.h:
* platform/graphics/transforms/TransformationMatrix.cpp:
(WebCore::TransformationMatrix::fromQuaternion):
* platform/graphics/transforms/TransformationMatrix.h:

LayoutTests:

Enable XRRigidTransform WebXR tests.

* platform/wpe/TestExpectations:

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

8 months ago[MacOS] Enable NSURLSession WebSocket code path in WebKitTestRunner
youenn@apple.com [Wed, 27 Jan 2021 10:57:21 +0000 (10:57 +0000)]
[MacOS] Enable NSURLSession WebSocket code path in WebKitTestRunner
https://bugs.webkit.org/show_bug.cgi?id=220973

Reviewed by Darin Adler.

Source/WebKit:

Disable a debug assert unti it get fixed below.

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:webSocketTask:didCloseWithCode:reason:]):

Tools:

Enable NSURLSession WebSocket code path in MacOS.

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):

LayoutTests:

Add platform specific expectations.
The differences are mostly due to different handling in case of server-side closure of the web socket connection (see rdar://problem/73613227).

* platform/mac-bigsur-wk2/http/tests/websocket/tests/hybi/client-close-2-expected.txt: Added.
* platform/mac-bigsur-wk2/http/tests/websocket/tests/hybi/client-close-expected.txt: Added.
* platform/mac-bigsur-wk2/http/tests/websocket/tests/hybi/close-and-server-script-exception-expected.txt: Added.
* platform/mac-bigsur-wk2/http/tests/websocket/tests/hybi/close-code-and-reason-expected.txt: Added.
* platform/mac-bigsur-wk2/http/tests/websocket/tests/hybi/contentextensions/display-none-expected.txt: Added.
* platform/mac-bigsur-wk2/http/tests/websocket/tests/hybi/contentextensions/display-none-worker-expected.txt: Added.
* platform/mac-bigsur-wk2/http/tests/websocket/tests/hybi/deflate-frame-comp-bit-onoff-expected.txt: Added.
* platform/mac-bigsur-wk2/http/tests/websocket/tests/hybi/deflate-frame-set-bfinal-expected.txt: Added.
* platform/mac-bigsur-wk2/http/tests/websocket/tests/hybi/handshake-fail-by-no-cr-expected.txt: Added.
* platform/mac-bigsur-wk2/http/tests/websocket/tests/hybi/handshake-fail-by-null-char-in-status-expected.txt: Added.
* platform/mac-bigsur-wk2/http/tests/websocket/tests/hybi/handshake-ok-with-http-version-beyond-1_1-expected.txt: Added.
* platform/mac-bigsur-wk2/http/tests/websocket/tests/hybi/inspector/client-close-expected.txt: Added.
* platform/mac-bigsur-wk2/http/tests/websocket/tests/hybi/inspector/send-and-receive-expected.txt: Added.
* platform/mac-bigsur-wk2/http/tests/websocket/tests/hybi/inspector/server-close-expected.txt: Added.
* platform/mac-bigsur-wk2/http/tests/websocket/tests/hybi/interleaved-fragments-expected.txt: Added.
* platform/mac-bigsur-wk2/http/tests/websocket/tests/hybi/invalid-encode-length-expected.txt: Added.
* platform/mac-bigsur-wk2/http/tests/websocket/tests/hybi/pong-expected.txt: Added.
* platform/mac-bigsur-wk2/http/tests/websocket/tests/hybi/send-arraybuffer-expected.txt: Added.
* platform/mac-bigsur-wk2/http/tests/websocket/tests/hybi/send-arraybufferview-expected.txt: Added.
* platform/mac-bigsur-wk2/http/tests/websocket/tests/hybi/send-blob-expected.txt: Added.
* platform/mac-bigsur-wk2/http/tests/websocket/tests/hybi/send-blob-onmessage-origin-expected.txt: Added.
* platform/mac-bigsur-wk2/http/tests/websocket/tests/hybi/send-empty-expected.txt: Added.
* platform/mac-bigsur-wk2/http/tests/websocket/tests/hybi/send-expected.txt: Added.
* platform/mac-bigsur-wk2/http/tests/websocket/tests/hybi/send-onmessage-origin-expected.txt: Added.
* platform/mac-bigsur-wk2/http/tests/websocket/tests/hybi/unicode-expected.txt: Added.
* platform/mac-bigsur-wk2/http/tests/websocket/tests/hybi/websocket-cookie-overwrite-behavior-expected.txt: Added.
* platform/mac-bigsur-wk2/http/tests/websocket/tests/hybi/workers/close-code-and-reason-expected.txt: Added.
* platform/mac-bigsur-wk2/http/tests/websocket/tests/hybi/workers/send-arraybuffer-expected.txt: Added.
* platform/mac-bigsur-wk2/http/tests/websocket/tests/hybi/workers/send-arraybufferview-expected.txt: Added.
* platform/mac-bigsur-wk2/http/tests/websocket/tests/hybi/workers/send-blob-expected.txt: Added.
* platform/mac-bigsur-wk2/imported/w3c/web-platform-tests/websockets/Secure-Close-Reason-Unpaired-surrogates.any-expected.txt: Added.
* platform/mac-bigsur-wk2/imported/w3c/web-platform-tests/websockets/Secure-Close-Reason-Unpaired-surrogates.any.worker-expected.txt: Added.
* platform/mac-bigsur-wk2/imported/w3c/web-platform-tests/websockets/Send-65K-data.any-expected.txt: Added.
* platform/mac-bigsur-wk2/imported/w3c/web-platform-tests/websockets/Send-binary-65K-arraybuffer.any-expected.txt: Added.
* platform/mac-bigsur-wk2/imported/w3c/web-platform-tests/websockets/Send-binary-arraybuffer.any-expected.txt: Added.
* platform/mac-bigsur-wk2/imported/w3c/web-platform-tests/websockets/Send-data.any-expected.txt: Added.
* platform/mac-bigsur-wk2/imported/w3c/web-platform-tests/websockets/Send-paired-surrogates.any-expected.txt: Added.
* platform/mac-bigsur-wk2/imported/w3c/web-platform-tests/websockets/basic-auth.any-expected.txt: Added.
* platform/mac-bigsur-wk2/imported/w3c/web-platform-tests/websockets/basic-auth.any.worker-expected.txt: Added.
* platform/mac-bigsur-wk2/imported/w3c/web-platform-tests/websockets/bufferedAmount-unchanged-by-sync-xhr.any.worker-expected.txt: Added.
* platform/mac-bigsur-wk2/imported/w3c/web-platform-tests/websockets/constructor/009-expected.txt: Added.
* platform/mac-bigsur-wk2/imported/w3c/web-platform-tests/websockets/cookies/third-party-cookie-accepted.https-expected.txt: Added.
* platform/mac-bigsur-wk2/imported/w3c/web-platform-tests/websockets/interfaces/WebSocket/bufferedAmount/bufferedAmount-arraybuffer-expected.txt: Added.
* platform/mac-bigsur-wk2/imported/w3c/web-platform-tests/websockets/interfaces/WebSocket/bufferedAmount/bufferedAmount-blob-expected.txt: Added.
* platform/mac-bigsur-wk2/imported/w3c/web-platform-tests/websockets/interfaces/WebSocket/bufferedAmount/bufferedAmount-getting-expected.txt: Added.
* platform/mac-bigsur-wk2/imported/w3c/web-platform-tests/websockets/interfaces/WebSocket/bufferedAmount/bufferedAmount-large-expected.txt: Added.
* platform/mac-bigsur-wk2/imported/w3c/web-platform-tests/websockets/interfaces/WebSocket/bufferedAmount/bufferedAmount-unicode-expected.txt: Added.
* platform/mac-bigsur-wk2/imported/w3c/web-platform-tests/websockets/interfaces/WebSocket/send/008-expected.txt: Added.
* platform/mac-bigsur-wk2/imported/w3c/web-platform-tests/websockets/interfaces/WebSocket/send/009-expected.txt: Added.
* platform/mac-bigsur-wk2/imported/w3c/web-platform-tests/websockets/opening-handshake/003-sets-origin.worker-expected.txt: Added.
* platform/mac/TestExpectations:

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

8 months ago[Mac] MediaSampleCursor::stepInOrderedMap can hang when stepping to the end of a...
aestes@apple.com [Wed, 27 Jan 2021 09:07:36 +0000 (09:07 +0000)]
[Mac] MediaSampleCursor::stepInOrderedMap can hang when stepping to the end of a track that hasn't been fully parsed
https://bugs.webkit.org/show_bug.cgi?id=220555
<rdar://problem/72910000>

Reviewed by Eric Carlson.

Source/WebCore:

Test: http/tests/media/video-canplaythrough-webm.html

* platform/graphics/FloatSize.h: Exported toJSONObject.

Source/WebKit:

When a container has multiple tracks, CoreMedia determines the overall duration by creating
a cursor at a presentation time of +infinity then asking for its timing info, the expectation
being that the cursor will clamp itself to the track duration and report that in
MediaSampleCursor::getSampleTiming.

Previously, this could result in a hang for tracks that had not yet finished parsing, as
MediaSampleCursor was designed to wait for samples outside the playable range. With this
change, MediaSampleCursor no longer waits for samples outside the playable range but
rather reports clamped timing info without waiting for a sample. If CoreMedia asks for
information that requires a sample (e.g., sample location), MediaSampleCursor will respond
with `kMTPluginSampleCursorError_LocationNotAvailable`. So that CoreMedia can determine
the range of playable samples, this patch implements MediaSampleCursor::getPlayableHorizon.

To simplify this implementation, MediaSampleCursor now assumes that decode time equals
presentation time (for video tracks) or is invalid (for audio tracks). While here, also
added media logging that helped debug this issue.

Test: http/tests/media/video-canplaythrough-webm.html

* Shared/mac/MediaFormatReader/MediaSampleByteRange.cpp:
(WebKit::MediaSampleByteRange::MediaSampleByteRange): Asserted our assmpution about the
relationship between presentation time and decode time.
* Shared/mac/MediaFormatReader/MediaSampleCursor.cpp:
(WebKit::assumedDecodeTime): Added to compute decode time from presentation time and a
nominal sample.
(WebKit::upperBound): Changed to compute the decode key based on assumed decode time.
(WebKit::stepIterator): Removed the MediaTime specialization.
(WebKit::stepTime): Added to step a MediaTime rather than an iterator.
(WebKit::MediaSampleCursor::MediaSampleCursor): Initialized logging.
(WebKit::MediaSampleCursor::locateIterator const): Changed to find an iterator based on
presentation time and assumed decode time.
(WebKit::MediaSampleCursor::locateMediaSample const): Ditto.
(WebKit::MediaSampleCursor::locateTiming const): Added to locate timing info even if no
sample is available.
(WebKit::MediaSampleCursor::stepInOrderedMap): Changed to call getSampleMap, and removed
the MediaTime specialization.
(WebKit::MediaSampleCursor::stepInPresentationTime): Added to replace the MediaTime
specialization of stepInOrderedMap.
(WebKit::MediaSampleCursor::getSampleMap const): Added to call
MediaTrackReader::waitForSample and return as soon as at least one sample is available.
Returns kMTPluginSampleCursorError_NoSamples if the track finishes parsing with no
samples.
(WebKit::MediaSampleCursor::getMediaSample const): Changed to call getSampleMap.
(WebKit::MediaSampleCursor::getTiming const): Added to get timing info.
(WebKit::MediaSampleCursor::copyProperty): Added logging.
(WebKit::MediaSampleCursor::stepInDecodeOrderAndReportStepsTaken): Changed to call the new
version of stepInOrderedMap.
(WebKit::MediaSampleCursor::stepInPresentationOrderAndReportStepsTaken): Ditto.
(WebKit::MediaSampleCursor::stepByDecodeTime): Changed to call stepInPresentationTime.
(WebKit::MediaSampleCursor::stepByPresentationTime): Ditto.
(WebKit::MediaSampleCursor::compareInDecodeOrder const): Changed to call getTiming.
(WebKit::MediaSampleCursor::getSampleTiming const): Ditto.
(WebKit::MediaSampleCursor::getPlayableHorizon const): Implemented by taking the
difference between the last sample's end time and the cursor's presentation time.
(WebKit::MediaSampleCursor::logChannel const): Added.
(WebKit::makeIterator): Deleted.
(WebKit::makeTime): Deleted.
(WebKit::MediaSampleCursor::createAtDecodedSample): Deleted.
* Shared/mac/MediaFormatReader/MediaSampleCursor.h:
(WebKit::MediaSampleCursor::logger const): Configured logging.
(WebKit::MediaSampleCursor::logClassName const): Ditto.
(WebKit::MediaSampleCursor::logIdentifier const): Ditto.
* Shared/mac/MediaFormatReader/MediaTrackReader.cpp:
(WebKit::MediaTrackReader::mediaTypeString const): Ditto.
(WebKit::MediaTrackReader::nextSampleCursorLogIdentifier const): Ditto.
* Shared/mac/MediaFormatReader/MediaTrackReader.h:

LayoutTests:

* http/conf/mime.types: Added an entry for video/webm.
* http/tests/media/resources/long-test-vp9-vorbis.webm: Added.
* http/tests/media/video-canplaythrough-webm-expected.txt: Added.
* http/tests/media/video-canplaythrough-webm.html: Added.

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

8 months ago[Flatpak SDK] Flatpak 1.10 environment variable issues
philn@webkit.org [Wed, 27 Jan 2021 09:05:59 +0000 (09:05 +0000)]
[Flatpak SDK] Flatpak 1.10 environment variable issues
https://bugs.webkit.org/show_bug.cgi?id=220781

Patch by Philippe Normand  <pnormand@igalia.com> and Lauro Moura <lmoura@igalia.com> on 2021-01-27
Reviewed by Adrian Perez de Castro.

Flatpak no longer passes its env variables to bwrap, so the workaround is now to serialize
it on-disk in a JSON file and load it from our webkit-bwrap script.

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

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

8 months agoUse ScrollSnapOffsetsInfo in the scrolling tree
commit-queue@webkit.org [Wed, 27 Jan 2021 08:41:41 +0000 (08:41 +0000)]
Use ScrollSnapOffsetsInfo in the scrolling tree
https://bugs.webkit.org/show_bug.cgi?id=220915

Patch by Martin Robinson <mrobinson@igalia.com> on 2021-01-27
Reviewed by Simon Fraser.

Source/WebCore:

No new tests. This should not change behavior.

Use ScrollSnapOffsets more often in the scrolling tree to continue to
abstract away the details of how snap offsets are implemented.

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::setStateScrollingNodeSnapOffsetsAsFloat):
(WebCore::AsyncScrollingCoordinator::setScrollingNodeScrollableAreaGeometry):
(WebCore::AsyncScrollingCoordinator::updateScrollSnapPropertiesWithFrameView):
* page/scrolling/ScrollSnapOffsetsInfo.h:
(WebCore::ScrollSnapOffsetsInfo::isEqual const):
* page/scrolling/ScrollingStateScrollingNode.cpp:
(WebCore::ScrollingStateScrollingNode::applicableProperties const):
(WebCore::ScrollingStateScrollingNode::setSnapOffsetsInfo):
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::updateFromStateNode):
(): Deleted.
* platform/cocoa/ScrollController.h:
* platform/cocoa/ScrollController.mm:
(WebCore::ScrollController::updateScrollSnapState):
(WebCore::ScrollController::updateScrollSnapPoints):
(WebCore::otherScrollEventAxis): Deleted.

Source/WebKit:

Use ScrollSnapOffsets more often in the scrolling tree to continue to
abstract away the details of how snap offsets are implemented.

* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
(ArgumentCoder<ScrollingStateScrollingNode>::encode):
(ArgumentCoder<ScrollingStateScrollingNode>::decode):
(ArgumentCoder<ScrollSnapOffsetsInfo<float>>::encode):
(ArgumentCoder<ScrollSnapOffsetsInfo<float>>::decode):
(WebKit::dump):
* UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::shouldSnapForMainFrameScrolling const):
(WebKit::RemoteScrollingCoordinatorProxy::closestSnapOffsetForMainFrameScrolling const):
(WebKit::RemoteScrollingCoordinatorProxy::hasActiveSnapPoint const):
(WebKit::RemoteScrollingCoordinatorProxy::nearestActiveContentInsetAdjustedSnapOffset const):
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
(-[WKScrollingNodeScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]):
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):

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

8 months agoAdd support for RTCRtpParameters.rtcp
youenn@apple.com [Wed, 27 Jan 2021 08:36:19 +0000 (08:36 +0000)]
Add support for RTCRtpParameters.rtcp
https://bugs.webkit.org/show_bug.cgi?id=220912

Reviewed by Eric Carlson.

LayoutTests/imported/w3c:

* web-platform-tests/webrtc/RTCRtpParameters-codecs-expected.txt:
* web-platform-tests/webrtc/RTCRtpParameters-encodings-expected.txt:
* web-platform-tests/webrtc/RTCRtpParameters-headerExtensions-expected.txt:
* web-platform-tests/webrtc/RTCRtpParameters-rtcp-expected.txt:
* web-platform-tests/webrtc/RTCRtpParameters-transactionId-expected.txt:
* web-platform-tests/webrtc/RTCRtpReceiver-getParameters-expected.txt:

Source/WebCore:

Introduce corresponding WebIDL and binding to webrtc backend.
Covered by rebased tests.

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Modules/mediastream/RTCRtcpParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
* Modules/mediastream/RTCRtcpParameters.idl: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.idl.
* Modules/mediastream/RTCRtpParameters.h:
* Modules/mediastream/RTCRtpParameters.idl:
* Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
(WebCore::toRTCRtpParameters):
(WebCore::updateRTCRtpSendParameters):
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

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

8 months agoMute audio capture for speech recognition based on shouldInterruptAudioOnPageVisibili...
commit-queue@webkit.org [Wed, 27 Jan 2021 06:31:06 +0000 (06:31 +0000)]
Mute audio capture for speech recognition based on shouldInterruptAudioOnPageVisibilityChange when page is invisible
https://bugs.webkit.org/show_bug.cgi?id=220960

Patch by Sihui Liu <sihui_liu@appe.com> on 2021-01-26
Reviewed by Youenn Fablet.

Source/WebCore:

Add a boolean to indicate recognition state so we don't send end event twice.

* Modules/speech/SpeechRecognizer.cpp:
(WebCore::SpeechRecognizer::startRecognition):
(WebCore::SpeechRecognizer::abortRecognition):
(WebCore::SpeechRecognizer::stopRecognition):
(WebCore::SpeechRecognizer::resetRecognition):
* Modules/speech/SpeechRecognizer.h:

Source/WebKit:

We used to abort ongoing recognition when page becomes invisible. To match media capture's behavior, now we only
abort recognition when shouldInterruptAudioOnPageVisibilityChange is true.

Updated API test: WebKit2.SpeechRecognitionPageBecomesInvisible

* UIProcess/SpeechRecognitionServer.cpp:
(WebKit::SpeechRecognitionServer::abortForPageIsBecomingInvisible): Deleted.
* UIProcess/SpeechRecognitionServer.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::pageIsBecomingInvisible):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/SpeechRecognition.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitCocoa/speechrecognition-basic.html:

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

8 months agoRefactor computePreferredLogicalWidths
commit-queue@webkit.org [Wed, 27 Jan 2021 05:22:47 +0000 (05:22 +0000)]
Refactor computePreferredLogicalWidths
https://bugs.webkit.org/show_bug.cgi?id=220984

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

Refactor computePreferredLogicalWidths so the common
code dealing with min/max and border/padding handling
is centralized in RenderBox.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computePreferredLogicalWidths):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::computePreferredLogicalWidths):
* rendering/RenderBox.h:
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::computePreferredLogicalWidths):
* rendering/RenderFileUploadControl.cpp:
(WebCore::RenderFileUploadControl::computePreferredLogicalWidths):
* rendering/RenderFragmentContainer.cpp:
(WebCore::RenderFragmentContainer::computePreferredLogicalWidths):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::computePreferredLogicalWidths):
* rendering/RenderMenuList.cpp:
(RenderMenuList::computePreferredLogicalWidths):
* rendering/RenderSlider.cpp:
(WebCore::RenderSlider::computePreferredLogicalWidths):
* rendering/RenderTextControl.cpp:
(WebCore::RenderTextControl::computePreferredLogicalWidths):

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

8 months agoREGRESSION (r268947) Some table elements become blank when scroll-bar is toggled
simon.fraser@apple.com [Wed, 27 Jan 2021 04:56:57 +0000 (04:56 +0000)]
REGRESSION (r268947) Some table elements become blank when scroll-bar is toggled
https://bugs.webkit.org/show_bug.cgi?id=221016
<rdar://72881404>

Reviewed by Zalan Bujtas.
Source/WebCore:

FloatingObject aliased the state of layer->isSelfPainting() in its m_shouldPaint,
so when compositing code changed isSelfPaintingLayer() for a layer that is also
a float post-layout, FloatingObject was left in a state where it didn't paint.

Fix by dissociating FloatingObject's shouldPaint from the state of the layer.
Rename shouldPaint() to paintsFloat() for clarity (multiple FloatingObjects in
different block flows can represent the same float, and only one paints the float).

Test: compositing/scrolling/async-overflow-scrolling/self-painting-layer-float.html

* rendering/FloatingObjects.cpp:
(WebCore::FloatingObject::FloatingObject):
(WebCore::FloatingObject::create):
(WebCore::FloatingObject::cloneForNewParent const):
(WebCore::FloatingObject::shouldPaint const):
(WebCore::operator<<):
* rendering/FloatingObjects.h:
(WebCore::FloatingObject::paintsFloat const):
(WebCore::FloatingObject::setPaintsFloat):
(WebCore::FloatingObject::shouldPaint const): Deleted.
(WebCore::FloatingObject::setShouldPaint): Deleted.
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::repaintOverhangingFloats):
(WebCore::RenderBlockFlow::paintFloats):
(WebCore::RenderBlockFlow::insertFloatingObject):
(WebCore::RenderBlockFlow::addOverhangingFloats):
(WebCore::RenderBlockFlow::hitTestFloats):
(WebCore::RenderBlockFlow::adjustForBorderFit const):

LayoutTests:

* compositing/scrolling/async-overflow-scrolling/self-painting-layer-float-expected.html: Added.
* compositing/scrolling/async-overflow-scrolling/self-painting-layer-float.html: Added.

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

8 months ago[GLIB] Gardening soup crashes and other timeouts
lmoura@igalia.com [Wed, 27 Jan 2021 04:39:14 +0000 (04:39 +0000)]
[GLIB] Gardening soup crashes and other timeouts

Unreviewed test gardening.

* platform/glib/TestExpectations:

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

8 months ago[LFC][IFC] Do not create empty runs for empty lines
zalan@apple.com [Wed, 27 Jan 2021 02:42:19 +0000 (02:42 +0000)]
[LFC][IFC] Do not create empty runs for empty lines
https://bugs.webkit.org/show_bug.cgi?id=220994

Reviewed by Antti Koivisto.

Add a fast path for cases when the line has some inline level boxes but we don't consider them "contentful".
e.g. <div><span></span><span></span></div>
It is a relatively common when block level boxes are wrapped inside inline level boxes and
we end up constructing "empty" pre/post blocks (see continuation) e.g. <span><div>content</div></span>.
Such content generates "empty" lines and while this is clearly a performance improvement, it is
also a correctness fix as RenderBlockFlow checks for the number of lines to see if the block is empty and
the integration layer checks the number of runs on the line to decide if the line is "empty" (see LineLayout::lineCount).
(In LFC we check if the lines are empty and not if the line count is 0 since according to the spec even "empty" content generates (empty)lines)

* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes):
* layout/inlineformatting/InlineLineBox.h:
(WebCore::Layout::LineBox::hasContent const):
(WebCore::Layout::LineBox::setHasContent):

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

8 months agoREGRESSION (r271584): Hovering slowly over and out of "Top 100" items on liberation...
antti@apple.com [Wed, 27 Jan 2021 02:38:15 +0000 (02:38 +0000)]
REGRESSION (r271584): Hovering slowly over and out of "Top 100" items on liberation.fr does not restore animated state
https://bugs.webkit.org/show_bug.cgi?id=220862
<rdar://problem/73501684>

Reviewed by Simon Fraser.

Source/WebCore:

The optimization in r271584 fails to invalidate hover/active style when clearing the existing state under some circumstances.

Test: fast/selectors/hover-invalidation-descendant-clear.html

* dom/Document.cpp:
(WebCore::Document::updateHoverActiveState):

We would do descendant invalidation when changing the hover/active state of the rootmost changing element.
However since the state of descendants was changed before this invalidation happened we would try to invalidate
them in a tree that was already in the new state.

Fix by scoping the descendant invalidation over all changes.

* dom/Element.cpp:
(WebCore::Element::setActive):
(WebCore::Element::setHovered):

Switch to new 3-state enum type that allows us to skip descendant invalidation that has already been done by the caller.
Skope it to Style namepace.

* dom/Element.h:
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::setActive):
* html/HTMLAnchorElement.h:
* html/HTMLLabelElement.cpp:
(WebCore::HTMLLabelElement::setActive):
(WebCore::HTMLLabelElement::setHovered):
* html/HTMLLabelElement.h:
* html/shadow/SpinButtonElement.cpp:
(WebCore::SpinButtonElement::setHovered):
* html/shadow/SpinButtonElement.h:
* style/PseudoClassChangeInvalidation.cpp:
(WebCore::Style::PseudoClassChangeInvalidation::computeInvalidation):
* style/PseudoClassChangeInvalidation.h:
(WebCore::Style::PseudoClassChangeInvalidation::PseudoClassChangeInvalidation):
* style/StyleValidity.h:

LayoutTests:

* fast/selectors/hover-invalidation-descendant-clear-expected.html: Added.
* fast/selectors/hover-invalidation-descendant-clear.html: Added.

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

8 months ago[GPU Process] Compositing layout test crash in WebKit::GPUProcess::lowMemoryHandler
cdumez@apple.com [Wed, 27 Jan 2021 01:36:14 +0000 (01:36 +0000)]
[GPU Process] Compositing layout test crash in WebKit::GPUProcess::lowMemoryHandler
https://bugs.webkit.org/show_bug.cgi?id=221010
<rdar://problem/73631552>

Reviewed by Simon Fraser.

Make IOSurfacePool thread-safe now that it is used from multiple threads in the
GPUProcess.

* platform/graphics/cg/IOSurfacePool.cpp:
(WebCore::IOSurfacePool::IOSurfacePool):
(WebCore::IOSurfacePool::sharedPool):
(WebCore::IOSurfacePool::takeSurface):
(WebCore::IOSurfacePool::addSurface):
(WebCore::IOSurfacePool::setPoolSize):
(WebCore::IOSurfacePool::collectionTimerFired):
(WebCore::IOSurfacePool::discardAllSurfaces):
* platform/graphics/cg/IOSurfacePool.h:

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

8 months agoREGRESSION(r270637) Filtering does not work in Styles sidebar panel
commit-queue@webkit.org [Wed, 27 Jan 2021 01:12:03 +0000 (01:12 +0000)]
REGRESSION(r270637) Filtering does not work in Styles sidebar panel
https://bugs.webkit.org/show_bug.cgi?id=220993
<rdar://problem/73623818>

Patch by Razvan Caliman <rcaliman@apple.com> on 2021-01-26
Reviewed by Devin Rousso.

Stop expecting StyleDetailsPanel to define an abstract filterDidChange() method.
Subclasses implement their own on a per-use case basis.

* UserInterface/Views/ComputedStyleDetailsPanel.js:
(WI.ComputedStyleDetailsPanel.prototype.filterDidChange):
* UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js:
(WI.SpreadsheetRulesStyleDetailsPanel.prototype.filterDidChange):

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

8 months agoREGRESSION(r267641): WebKitDeveloperExtras preference has no effect for WebKitLegacy...
bburg@apple.com [Wed, 27 Jan 2021 01:11:19 +0000 (01:11 +0000)]
REGRESSION(r267641): WebKitDeveloperExtras preference has no effect for WebKitLegacy clients
https://bugs.webkit.org/show_bug.cgi?id=220996
<rdar://72173139>

Reviewed by Sam Weinig.

Source/WebKitLegacy/mac:

Read back this preference when propagating it, because the value depends on
more than just the preference key. For example, it allows Debug builds to act
as if the preference is always enabled.

* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WTF:

This preference should use custom bindings for WebKitLegacy.

* Scripts/Preferences/WebPreferencesDebug.yaml:

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

8 months agoRevive the build when MALLOC_HEAP_BREAKDOWN is enabled
sbarati@apple.com [Wed, 27 Jan 2021 00:32:32 +0000 (00:32 +0000)]
Revive the build when MALLOC_HEAP_BREAKDOWN is enabled
https://bugs.webkit.org/show_bug.cgi?id=220999

Reviewed by Yusuke Suzuki.

Source/WebCore:

* display/css/DisplayBox.cpp:
* display/css/DisplayBox.h:
* display/css/DisplayBoxClip.cpp:
* display/css/DisplayBoxClip.h:
* display/css/DisplayBoxDecorationData.cpp:
* display/css/DisplayBoxDecorationData.h:
* display/css/DisplayBoxModelBox.cpp:
* display/css/DisplayBoxModelBox.h:
* display/css/DisplayBoxRareGeometry.cpp:
* display/css/DisplayBoxRareGeometry.h:
* display/css/DisplayContainerBox.cpp:
* display/css/DisplayContainerBox.h:
* display/css/DisplayImageBox.cpp:
* display/css/DisplayImageBox.h:
* display/css/DisplayReplacedBox.cpp:
* display/css/DisplayReplacedBox.h:
* display/css/DisplayStyle.cpp:
* display/css/DisplayStyle.h:
* display/css/DisplayTextBox.cpp:
* display/css/DisplayTextBox.h:

Source/WTF:

* wtf/Bag.cpp:
* wtf/BitVector.cpp:
* wtf/ConcurrentBuffer.cpp:
* wtf/FastBitVector.cpp:
* wtf/HashTable.cpp:
* wtf/MetaAllocator.cpp:
* wtf/RefCountedArray.cpp:
* wtf/SegmentedVector.cpp:
* wtf/SmallPtrSet.cpp:
* wtf/UniqueArray.cpp:
* wtf/Vector.cpp:
* wtf/text/CString.cpp:
* wtf/text/StringBuffer.cpp:

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

8 months agoExpose the value of `<meta name="theme-color" content="...">` as SPI
drousso@apple.com [Wed, 27 Jan 2021 00:31:23 +0000 (00:31 +0000)]
Expose the value of `<meta name="theme-color" content="...">` as SPI
https://bugs.webkit.org/show_bug.cgi?id=220944
<rdar://problem/72198083>

Reviewed by Tim Horton.

Source/WebCore:

* html/HTMLMetaElement.h:
* html/HTMLMetaElement.cpp:
(WebCore::HTMLMetaElement::attributeChanged): Added.
(WebCore::HTMLMetaElement::parseAttribute):
(WebCore::HTMLMetaElement::removedFromAncestor): Added.
(WebCore::HTMLMetaElement::process):

* dom/Document.h:
(WebCore::Document::themeColor const): Added.
* dom/Document.cpp:
(WebCore::Document::processThemeColor): Added.
* page/Page.h:
* page/Page.cpp:
(WebCore::Page::themeColor const): Added.
* page/ChromeClient.h:
(WebCore::ChromeClient::themeColorChanged const): Added.
Save the `Color` to a variable so it can be accessed later during rendering so that updates
are kept in sync with other changes (e.g. modifying the CSS `background-color`).

* platform/graphics/cocoa/ColorCocoa.h:
* WebCore.xcodeproj/project.pbxproj:
Expose this file and export its functions so they can be used in WebKit.

Source/WebKit:

* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::themeColorChanged): Added.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::willCommitLayerTree):
(WebKit::WebPage::didCommitLoad):
(WebKit::WebPage::flushPendingThemeColorChange): Added.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::themeColorChanged const):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::updateRendering):
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::themeColorChanged): Added.
On macOS, keep a flag indicating whether the `themeColor` has changed. Use this flag when
updating rendering to send the `Color` to the UIProcess so that it's kept in sync with other
changes (e.g. modifying the CSS `background-color`).

* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
(WebKit::RemoteLayerTreeTransaction::themeColor const): Added.
(WebKit::RemoteLayerTreeTransaction::setThemeColor): Added.
* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::encode const):
(WebKit::RemoteLayerTreeTransaction::decode):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::didCommitLayerTree):
On iOS, include the `themeColor` in every `RemoteLayerTreeTransaction` so that it's kept in
sync with other changes (e.g. modifying the CSS `background-color`).

* UIProcess/PageClient.h:
(WebKit::PageClient::themeColorWillChange): Added.
(WebKit::PageClient::themeColorDidChange): Added.
* UIProcess/Cocoa/PageClientImplCocoa.h:
* UIProcess/Cocoa/PageClientImplCocoa.mm:
(WebKit::PageClientImplCocoa::themeColorWillChange): Added.
(WebKit::PageClientImplCocoa::themeColorDidChange): Added.
Add support for ObjC KVO of `-[WKWebView _themeColor]`.

* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::themeColor const): Added.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _themeColor]): Added.

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/HTMLMetaThemeColor.mm: Added.
(TEST.HTMLMetaThemeColor.OnLoad):
(TEST.HTMLMetaThemeColor.MultipleTags):
(-[WKWebViewThemeColorObserver initWithWebView:]):
(-[WKWebViewThemeColorObserver observeValueForKeyPath:ofObject:change:context:]):
(TEST.HTMLMetaThemeColor.KVO):

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:

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

8 months agoIPC::Decoder constructor should mark the Decoder as invalid if header decoding fails
bfulgham@apple.com [Wed, 27 Jan 2021 00:05:59 +0000 (00:05 +0000)]
IPC::Decoder constructor should mark the Decoder as invalid if header decoding fails
https://bugs.webkit.org/show_bug.cgi?id=220990
<rdar://problem/64984186>

Reviewed by Darin Adler.

Mark the decoder as invalid if any of the decode operations fail, not just the first one.

* Platform/IPC/Decoder.cpp:

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

8 months ago[LayoutTests] Pass authentication to CGI scripts
jbedard@apple.com [Tue, 26 Jan 2021 22:55:49 +0000 (22:55 +0000)]
[LayoutTests] Pass authentication to CGI scripts
https://bugs.webkit.org/show_bug.cgi?id=221007
<rdar://problem/73630042>

Reviewed by Stephanie Lewis.

* http/conf/apache2.2-httpd.conf: Pass authentication to CGI scripts.
* http/conf/apache2.4-httpd.conf: Ditto.
* http/conf/apache2.4-php7-httpd.conf: Ditto.
* http/conf/archlinux-httpd.conf: Ditto.
* http/conf/debian-httpd-2.4-php7.0.conf: Ditto.
* http/conf/debian-httpd-2.4-php7.1.conf: Ditto.
* http/conf/debian-httpd-2.4-php7.2.conf: Ditto.
* http/conf/debian-httpd-2.4-php7.3.conf: Ditto.
* http/conf/debian-httpd-2.4-php7.4.conf: Ditto.
* http/conf/fedora-httpd-2.2.conf: Ditto.
* http/conf/fedora-httpd-2.4-php7.conf: Ditto.
* http/conf/fedora-httpd-2.4.conf: Ditto.
* http/conf/flatpak-httpd.conf: Ditto.
* http/conf/win-httpd-2.4-php5.conf: Ditto.
* http/conf/win-httpd-2.4-php7.conf: Ditto.

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

8 months agoHarden NetworkProcess against integer overflow in CacheStorageEngine size calculation
bfulgham@apple.com [Tue, 26 Jan 2021 22:36:15 +0000 (22:36 +0000)]
Harden NetworkProcess against integer overflow in CacheStorageEngine size calculation
https://bugs.webkit.org/show_bug.cgi?id=220997
<rdar://problem/66116827>

Reviewed by Youenn Fablet.

Since the CacheStorage allocation is based on data provided by the WebContent process, we should
check for integer overflow before making an allocation.

* NetworkProcess/cache/CacheStorageEngineCache.cpp:
(WebKit::CacheStorage::Cache::put): Use checked arithmetic and return a failure if we overflow.

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

8 months ago[macOS] Disable ENABLE_SET_WEBCONTENT_PROCESS_INFORMATION_IN_NETWORK_PROCESS
pvollan@apple.com [Tue, 26 Jan 2021 22:23:07 +0000 (22:23 +0000)]
[macOS] Disable ENABLE_SET_WEBCONTENT_PROCESS_INFORMATION_IN_NETWORK_PROCESS
https://bugs.webkit.org/show_bug.cgi?id=221006

Unreviewed crash fix.

Enabling this is causing a crash. Disable while investigating.

* wtf/PlatformEnableCocoa.h:

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

8 months agoMake showRenderTree() dump FloatingObjects
simon.fraser@apple.com [Tue, 26 Jan 2021 22:20:09 +0000 (22:20 +0000)]
Make showRenderTree() dump FloatingObjects
https://bugs.webkit.org/show_bug.cgi?id=220991

Reviewed by Zalan Bujtas.

It's useful to see which RenderBlockFlows have floating object sets and which
floating objects they contain, so dump that in render tree dumps.

Other minor logging/initializer cleanup.

* rendering/FloatingObjects.cpp:
(WebCore::operator<<):
(WebCore::FloatingObjects::FloatingObjects):
* rendering/FloatingObjects.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::outputFloatingObjects const):
* rendering/RenderBlockFlow.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::outputRenderSubTreeAndMark const):
* rendering/RenderView.cpp:

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

8 months ago[ Mac wk1 ] fast/harness/render-tree-as-text-options.html is flaky failing in WK1
tsavell@apple.com [Tue, 26 Jan 2021 22:19:08 +0000 (22:19 +0000)]
[ Mac wk1 ] fast/harness/render-tree-as-text-options.html is flaky failing in WK1
https://bugs.webkit.org/show_bug.cgi?id=221009

unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

8 months ago[WASM-References] Change default value for externref's tables from null to undefined
commit-queue@webkit.org [Tue, 26 Jan 2021 21:45:19 +0000 (21:45 +0000)]
[WASM-References] Change default value for externref's tables from null to undefined
https://bugs.webkit.org/show_bug.cgi?id=220918

Patch by Dmitry Bezhetskov <dbezhetskov@igalia.com> on 2021-01-26
Reviewed by Yusuke Suzuki.

JSTests:

According to the reference types spec
https://webassembly.github.io/reference-types/js-api/#defaultvaluey
we should use undefined as a default value in Table ctor, set and grow
methods, so this patch replaces previous null default value for
externref's table to undefined.

* wasm/references/externref_table_import.js:
(string_appeared_here.fullGC.assert.eq.1.exports.get_tbl):
* wasm/references/table_js_api.js:
(testTableGrowForExternrefTables):
* wasm/references/table_misc.js:

Source/JavaScriptCore:

Update reference types tests to satisfy the spec:
Externref's tables default value should be undefined.

* wasm/js/JSWebAssemblyHelpers.h:
(JSC::defaultValueForTable):
* wasm/js/WebAssemblyTableConstructor.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
* wasm/js/WebAssemblyTablePrototype.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):

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

8 months ago[GLIB] API tests fail to report harness failures
lmoura@igalia.com [Tue, 26 Jan 2021 21:33:31 +0000 (21:33 +0000)]
[GLIB] API tests fail to report harness failures
https://bugs.webkit.org/show_bug.cgi?id=220938

Reviewed by Carlos Garcia Campos.

The GLibTestRunner class parses the stdout of the child test program to
detect failures and crashes using GLib's g_test_* protocol, but the
setup and teardown of each suite/program is done manually in the
beforeAll/afterAll functions. Their output/status need to be checked
separately by the runner scripts.

This commit checks if a failure happens before any test is run (a
beforeAll failure) and if there is still pending stderr output not
processed by g_test_run (an afterAll failure).

* glib/glib_test_runner.py:
(GLibTestRunner.run):

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

8 months ago[macOS] Deny mach-lookup to the service 'com.apple.tccd.system' in the WebContent...
pvollan@apple.com [Tue, 26 Jan 2021 21:31:09 +0000 (21:31 +0000)]
[macOS] Deny mach-lookup to the service 'com.apple.tccd.system' in the WebContent process
https://bugs.webkit.org/show_bug.cgi?id=220976
<rdar://problem/68935772>

Reviewed by Brent Fulgham.

Deny mach-lookup to the service 'com.apple.tccd.system' in the WebContent process, since there are no longer reports of this being used.

No new tests, since the result will depend on OS version.

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

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

8 months agoDisable TBA availability macro post-processing on iOS 14 / macOS 11
cdumez@apple.com [Tue, 26 Jan 2021 21:20:04 +0000 (21:20 +0000)]
Disable TBA availability macro post-processing on iOS 14 / macOS 11
https://bugs.webkit.org/show_bug.cgi?id=221004

Reviewed by Tim Horton.

Disable TBA availability macro post-processing on iOS 14 / macOS 11, now that TBA headers have been updated in r271813.

* Configurations/WebKit.xcconfig:
* Configurations/WebKitTargetConditionals.xcconfig:

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

8 months agoForbid '|' in URL hosts
commit-queue@webkit.org [Tue, 26 Jan 2021 21:14:33 +0000 (21:14 +0000)]
Forbid '|' in URL hosts
https://bugs.webkit.org/show_bug.cgi?id=220778

Patch by Alex Christensen <achristensen@webkit.org> on 2021-01-26
Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

* web-platform-tests/url/a-element-expected.txt:
* web-platform-tests/url/a-element-origin-expected.txt:
* web-platform-tests/url/a-element-origin-xhtml-expected.txt:
* web-platform-tests/url/a-element-xhtml-expected.txt:
* web-platform-tests/url/failure-expected.txt:
* web-platform-tests/url/resources/urltestdata.json:
* web-platform-tests/url/url-constructor-expected.txt:
* web-platform-tests/url/url-origin-expected.txt:

Source/WTF:

This is one of the proposed solutions to https://github.com/whatwg/url/issues/559
and RFC 3986 and 3987 forbid such characters, so let's try forbidding it.

* wtf/URLParser.cpp:
(WTF::isC0Control):
(WTF::isForbiddenHostCodePoint):

LayoutTests:

* fast/url/file-http-base-expected.txt:
* fast/url/file-http-base.html:

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

8 months agoScopedHighPerformanceGPURequest.h not marked framework private
commit-queue@webkit.org [Tue, 26 Jan 2021 21:06:59 +0000 (21:06 +0000)]
ScopedHighPerformanceGPURequest.h not marked framework private
https://bugs.webkit.org/show_bug.cgi?id=220989

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

The header was listed twice in the project, causing build failures.

No new tests, build fix.

* WebCore.xcodeproj/project.pbxproj:

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

8 months ago[macOS] Close all XPC connections to Launch Services after checking in
pvollan@apple.com [Tue, 26 Jan 2021 21:03:43 +0000 (21:03 +0000)]
[macOS] Close all XPC connections to Launch Services after checking in
https://bugs.webkit.org/show_bug.cgi?id=220952
<rdar://13785139>

Reviewed by Brent Fulgham.

After checking in with Launch Services on macOS, close all open XPC connections to the service.
This patch also adds checks for a valid Network process connection when updating the WebContent
process' information.

* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):
(WebKit::WebProcess::updateProcessName):
(WebKit::WebProcess::updateActivePages):

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

8 months ago[macOS] Add local sandbox reporting for access to Metal services in the WebContent...
pvollan@apple.com [Tue, 26 Jan 2021 20:44:04 +0000 (20:44 +0000)]
[macOS] Add local sandbox reporting for access to Metal services in the WebContent process
https://bugs.webkit.org/show_bug.cgi?id=220986

Reviewed by Brent Fulgham.

To determine if these services are still used in the WebContent process when the GPU process is enabled, add local sandbox reporting for access to Metal services.

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

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

8 months agoREGRESSION(r261238): WKWebView crashes on launch inside a quicklook preview
bfulgham@apple.com [Tue, 26 Jan 2021 20:40:18 +0000 (20:40 +0000)]
REGRESSION(r261238): WKWebView crashes on launch inside a quicklook preview
https://bugs.webkit.org/show_bug.cgi?id=219632
<rdar://problem/72154830>

Reviewed by Alexey Proskuryakov.

Partially revert r261238 to allow applications without access to 'nsurlsessiond' to still
be able to use WebKit for local file access. This workaround should be removed once we
complete the work needed to support true offline WebKit use.

* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm:
(WebKit::XPCServiceInitializerDelegate::checkEntitlements): Add an early return if the application
possesses the 'com.apple.security.network.client' entitlement.

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

8 months ago[macOS] Restrict process-info in sandbox
pvollan@apple.com [Tue, 26 Jan 2021 20:37:40 +0000 (20:37 +0000)]
[macOS] Restrict process-info in sandbox
https://bugs.webkit.org/show_bug.cgi?id=220985
<rdar://problem/70353532>

Reviewed by Brent Fulgham.

Access to process-info should be restricted to self.

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

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

8 months agoResync web-platform-tests/css/css-sizing/aspect-ratio from upstream
commit-queue@webkit.org [Tue, 26 Jan 2021 20:25:07 +0000 (20:25 +0000)]
Resync web-platform-tests/css/css-sizing/aspect-ratio from upstream
https://bugs.webkit.org/show_bug.cgi?id=220968

Patch by Rob Buis <rbuis@igalia.com> on 2021-01-26
Reviewed by Manuel Rego Casasnovas.

LayoutTests/imported/w3c:

Resync web-platform-tests/css/css-sizing/aspect-ratio from upstream c882810b64.

* resources/import-expectations.json:
* web-platform-tests/css/css-sizing/aspect-ratio/abspos-004.html:
* web-platform-tests/css/css-sizing/aspect-ratio/abspos-015-expected.xht: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/abspos-015.html: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/abspos-016-expected.xht: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/abspos-016.html: Copied from LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-005.html.
* web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-004.html:
* web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-005.html:
* web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-006.html:
* web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-007.html:
* web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-029-crash.html: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-030-expected.xht: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-030.html: Copied from LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-005.html.
* web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-025-expected.html: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-025.html: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-026-expected.html: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-026.html: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/grid-aspect-ratio-001-expected.xht: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/grid-aspect-ratio-001.html: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/grid-aspect-ratio-002-expected.xht: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/grid-aspect-ratio-002.html: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/grid-aspect-ratio-003-expected.xht: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/grid-aspect-ratio-003.html: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/grid-aspect-ratio-004-expected.xht: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/grid-aspect-ratio-004.html: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/grid-aspect-ratio-005-expected.xht: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/grid-aspect-ratio-005.html: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/grid-aspect-ratio-006-expected.xht: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/grid-aspect-ratio-006.html: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/grid-aspect-ratio-007-expected.xht: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/grid-aspect-ratio-007.html: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/grid-aspect-ratio-008-expected.xht: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/grid-aspect-ratio-008.html: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/grid-aspect-ratio-009-expected.xht: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/grid-aspect-ratio-009.html: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/grid-aspect-ratio-010-expected.xht: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/grid-aspect-ratio-010.html: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/grid-aspect-ratio-011-expected.xht: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/grid-aspect-ratio-011.html: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/grid-aspect-ratio-012-expected.xht: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/grid-aspect-ratio-012.html: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/grid-aspect-ratio-013-expected.xht: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/grid-aspect-ratio-013.html: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/grid-aspect-ratio-014-expected.xht: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/grid-aspect-ratio-014.html: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/intrinsic-size-004.html:
* web-platform-tests/css/css-sizing/aspect-ratio/intrinsic-size-009-expected.xht: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/intrinsic-size-009.html: Copied from LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-005.html.
* web-platform-tests/css/css-sizing/aspect-ratio/intrinsic-size-010-expected.xht: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/intrinsic-size-010.html: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/intrinsic-size-011-expected.xht: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/intrinsic-size-011.html: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/percentage-resolution-005-expected.xht: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/percentage-resolution-005.html: Copied from LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-005.html.
* web-platform-tests/css/css-sizing/aspect-ratio/replaced-element-028-expected.txt: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/replaced-element-028.html: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/replaced-element-029-expected.xht: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/replaced-element-029.html: Copied from LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-007.html.
* web-platform-tests/css/css-sizing/aspect-ratio/replaced-element-030-expected.xht: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/replaced-element-030.html: Copied from LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-007.html.
* web-platform-tests/css/css-sizing/aspect-ratio/replaced-element-031-expected.xht: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/replaced-element-031.html: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/replaced-element-032-expected.xht: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/replaced-element-032.html: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/support/100x100-green.png: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/support/1x1-green.png: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/support/200x200-green.png: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/support/w3c-import.log:
* web-platform-tests/css/css-sizing/aspect-ratio/table-element-001-expected.xht: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/table-element-001.html: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/w3c-import.log:
* web-platform-tests/css/css-sizing/aspect-ratio/zero-or-infinity-001-expected.xht: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/zero-or-infinity-001.html: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/zero-or-infinity-002-expected.xht: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/zero-or-infinity-002.html: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/zero-or-infinity-003-expected.xht: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/zero-or-infinity-003.html: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/zero-or-infinity-004-expected.xht: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/zero-or-infinity-004.html: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/zero-or-infinity-005-expected.xht: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/zero-or-infinity-005.html: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/zero-or-infinity-006-expected.xht: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/zero-or-infinity-006.html: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/zero-or-infinity-007-expected.xht: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/zero-or-infinity-007.html: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/zero-or-infinity-008-expected.xht: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/zero-or-infinity-008.html: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/zero-or-infinity-009-expected.xht: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/zero-or-infinity-009.html: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/zero-or-infinity-010-expected.xht: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/zero-or-infinity-010.html: Added.

LayoutTests:

Adapt platform test expectations.

* TestExpectations:

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

8 months ago[macOS] Deny mach-lookup to the service 'com.apple.audio.SandboxHelper' in the WebCon...
pvollan@apple.com [Tue, 26 Jan 2021 20:12:00 +0000 (20:12 +0000)]
[macOS] Deny mach-lookup to the service 'com.apple.audio.SandboxHelper' in the WebContent process
https://bugs.webkit.org/show_bug.cgi?id=220978
<rdar://problem/69320352>

Reviewed by Brent Fulgham.

Deny mach-lookup to the service 'com.apple.audio.SandboxHelper' in the WebContent process. Access to this service is only allowed
by extension if Media is running in the WebContent process.

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

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

8 months ago[macOS] Restrict access to OpenGL profiler
pvollan@apple.com [Tue, 26 Jan 2021 20:07:40 +0000 (20:07 +0000)]
[macOS] Restrict access to OpenGL profiler
https://bugs.webkit.org/show_bug.cgi?id=220980
<rdar://problem/70354481>

Reviewed by Brent Fulgham.

Only allow the OpenGL profiler to attach on internal installs.

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

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

8 months ago[CoreIPC] Add size check in decodeSharedBuffer to allow it to be validated against...
bfulgham@apple.com [Tue, 26 Jan 2021 20:02:43 +0000 (20:02 +0000)]
[CoreIPC] Add size check in decodeSharedBuffer to allow it to be validated against the SharedMemory received
https://bugs.webkit.org/show_bug.cgi?id=220962
<rdar://problem/68204552>

Reviewed by Darin Adler.

Add a new check during decoding so that we fail if the expected buffer size is larger than the block of
shared memory supplied in the IPC call.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::decodeSharedBuffer):

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

8 months agoUnreviewed, reverting r271578.
lmoura@igalia.com [Tue, 26 Jan 2021 19:53:57 +0000 (19:53 +0000)]
Unreviewed, reverting r271578.
https://bugs.webkit.org/show_bug.cgi?id=221003

Title changes reverted made WPEQt tests fail

Reverted changeset:

"[WPE] Fix WPEQt tests after r271514"
https://bugs.webkit.org/show_bug.cgi?id=220681
https://trac.webkit.org/changeset/271578

Patch by Commit Queue <commit-queue@webkit.org> on 2021-01-26

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

8 months agoRelease assert in Document::updateStyleIfNeeded() via PrintContext::end() inside...
ryanhaddad@apple.com [Tue, 26 Jan 2021 19:36:14 +0000 (19:36 +0000)]
Release assert in Document::updateStyleIfNeeded() via PrintContext::end() inside HTMLTitleElement::insertedIntoAncestor and removedFromAncestor
https://bugs.webkit.org/show_bug.cgi?id=218496

Unreviewed test gardening.

* TestExpectations: Skip the test to speed up EWS since it became flaky after r271549 was reverted.

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

8 months agoRevert part of r271493
achristensen@apple.com [Tue, 26 Jan 2021 18:52:40 +0000 (18:52 +0000)]
Revert part of r271493
https://bugs.webkit.org/show_bug.cgi?id=220066
<rdar://problem/73615999>

We have an internal app that calls registerSchemeForCustomProtocol on a non-main thread before WebKit initializes.
While this is a problem, we have to not crash on launch until they fix this.

* UIProcess/API/Cocoa/WKBrowsingContextController.mm:
(+[WKBrowsingContextController registerSchemeForCustomProtocol:]):
(+[WKBrowsingContextController unregisterSchemeForCustomProtocol:]):

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

8 months ago[JSC] Do not specify remote file location to the JSConly bots
commit-queue@webkit.org [Tue, 26 Jan 2021 18:24:53 +0000 (18:24 +0000)]
[JSC] Do not specify remote file location to the JSConly bots
https://bugs.webkit.org/show_bug.cgi?id=220923

Patch by Angelos Oikonomopoulos <angelos@igalia.com> on 2021-01-26
Reviewed by Carlos Alberto Lopez Perez.

There is no need to treat JSC buildbots that use remotes any
different. The worker side needs to supply the remote
configuration file in any case and it can also specify
--remote-config-file in TEST_JSC_ARGS.

What's more, letting the worker be in control makes it easier to
implement changes without having to request upstream configuration
changes (or, worse, temporarily overriding the configuration
recorded in config.json).

* CISupport/build-webkit-org/config.json:
* CISupport/build-webkit-org/factories.py:
(BuildAndJSCTestsFactory):
(BuildAndJSCTestsFactory.__init__):
* CISupport/build-webkit-org/steps.py:
(RunJavaScriptCoreTests.countFailures):

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

8 months ago[GPU process][macOS] Only allow access to diagnostic services for internal builds
pvollan@apple.com [Tue, 26 Jan 2021 18:22:35 +0000 (18:22 +0000)]
[GPU process][macOS] Only allow access to diagnostic services for internal builds
https://bugs.webkit.org/show_bug.cgi?id=220957

Reviewed by Brent Fulgham.

This patch also removes access to an unused logging service.

* GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in:

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

8 months agoUnreviewed, silence deprecation warning for our own API to address build issues.
cdumez@apple.com [Tue, 26 Jan 2021 17:48:17 +0000 (17:48 +0000)]
Unreviewed, silence deprecation warning for our own API to address build issues.

* UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:

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

8 months agoUnreviewed, reverting r271882.
cdumez@apple.com [Tue, 26 Jan 2021 17:28:40 +0000 (17:28 +0000)]
Unreviewed, reverting r271882.

Broke the build

Reverted changeset:

"Unreviewed, silence deprecation warning for our own API to
address build issues."
https://trac.webkit.org/changeset/271882

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

8 months agoUnreviewed, silence deprecation warning for our own API to address build issues.
cdumez@apple.com [Tue, 26 Jan 2021 17:05:29 +0000 (17:05 +0000)]
Unreviewed, silence deprecation warning for our own API to address build issues.

* UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:

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

8 months ago[LFC][IFC] Incorrect inline box width with horizontal alignment
zalan@apple.com [Tue, 26 Jan 2021 15:00:46 +0000 (15:00 +0000)]
[LFC][IFC] Incorrect inline box width with horizontal alignment
https://bugs.webkit.org/show_bug.cgi?id=220961

Reviewed by Antti Koivisto.

While the runs are relative to the line box, and the line box has the horizontal alignment offset
the final inline boxes are expected to include the horizontal alignment.
This patch ensures alignment offset is taken into account when the inline box width is computed.

* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes):

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

8 months agoWebGL power preference and discrete/internal gpu selection implemented incorrectly...
commit-queue@webkit.org [Tue, 26 Jan 2021 13:43:59 +0000 (13:43 +0000)]
WebGL power preference and discrete/internal gpu selection implemented incorrectly with ANGLE
https://bugs.webkit.org/show_bug.cgi?id=220843

Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2021-01-26
Reviewed by Dean Jackson.

Source/WebCore:

Use ANGLE extension EGL_ANGLE_power_preference to signal to ANGLE that the underlying
CGL context should be updated as a response to display reconfiguration signal.
This ensures that ANGLE state stays consistent with the actual CGL context behavior, as
we don't change the context behind ANGLE's back.

Remove the feature where the context GPU is selected based on the display the window is
on. This cannot work with the logic of "powerPreference = "high-performance" goes to
discrete GPU". Also, this cannot work with ANGLE at all, since all contexts are backed
by a single platform context. Thus all contexts will use the same underlying GPU.

No new tests due to the test runner missing features. The bug blockers track the testing.

* PlatformMac.cmake:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::isHighPerformanceContext):
* page/Chrome.cpp:
(WebCore::Chrome::windowScreenDidChange):
* platform/graphics/GraphicsContextGL.h:
* platform/graphics/RemoteGraphicsContextGLProxyBase.cpp:
* platform/graphics/RemoteGraphicsContextGLProxyBase.h:
* platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:
(WebCore::GraphicsContextGLOpenGL::create):
(WebCore::GraphicsContextGLOpenGL::createShared):
(WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL):
(WebCore::GraphicsContextGLOpenGL::setContextVisibility):
(WebCore::GraphicsContextGLOpenGL::displayWasReconfigured):
(WebCore::GraphicsContextGLOpenGL::simulateContextChanged):
* platform/graphics/mac/GraphicsChecksMac.cpp: Added.
(WebCore::attachToAppleGraphicsControl):
(WebCore::hasMuxCapability):
(WebCore::hasLowAndHighPowerGPUs):
* platform/graphics/mac/GraphicsChecksMac.h: Copied from Source/WebKit/WebProcess/WebCoreSupport/mac/WebSwitchingGPUClient.h.
* platform/graphics/mac/ScopedHighPerformanceGPURequest.h: Copied from Source/WebCore/platform/graphics/mac/SwitchingGPUClient.h.
(WebCore::ScopedHighPerformanceGPURequest::ScopedHighPerformanceGPURequest):
(WebCore::ScopedHighPerformanceGPURequest::~ScopedHighPerformanceGPURequest):
(WebCore::ScopedHighPerformanceGPURequest::operator=):
(WebCore::ScopedHighPerformanceGPURequest::acquire):
* platform/graphics/mac/SwitchingGPUClient.h:
* platform/graphics/opengl/GraphicsContextGLOpenGL.h:
* platform/graphics/opengl/GraphicsContextGLOpenGLManager.cpp:
(WebCore::GraphicsContextGLOpenGLManager::displayWasReconfigured):
(WebCore::GraphicsContextGLOpenGLManager::addContext):
(WebCore::GraphicsContextGLOpenGLManager::removeContext):
* platform/graphics/opengl/GraphicsContextGLOpenGLManager.h:
* testing/Internals.cpp:

Source/WebKit:

Move the high-performance GPU shutdown timer from individual web processes to the main class
in the ui process. This simplifies the implementation and reduces the number of timers.

* UIProcess/mac/HighPerformanceGPUManager.h:
* UIProcess/mac/HighPerformanceGPUManager.mm:
(WebKit::HighPerformanceGPUManager::HighPerformanceGPUManager):
(WebKit::HighPerformanceGPUManager::removeProcessRequiringHighPerformance):
(WebKit::HighPerformanceGPUManager::updateState):
* WebProcess/WebCoreSupport/mac/WebSwitchingGPUClient.cpp:
(WebKit::WebSwitchingGPUClient::requestHighPerformanceGPU):
(WebKit::WebSwitchingGPUClient::releaseHighPerformanceGPU):
* WebProcess/WebCoreSupport/mac/WebSwitchingGPUClient.h:

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

8 months ago[SOUP] Stop using SoupRequest API to load files in preparation for libsoup3
carlosgc@webkit.org [Tue, 26 Jan 2021 11:49:22 +0000 (11:49 +0000)]
[SOUP] Stop using SoupRequest API to load files in preparation for libsoup3
https://bugs.webkit.org/show_bug.cgi?id=220509

Reviewed by Adrian Perez de Castro.

Source/WebCore/platform/gtk/po:

* POTFILES.in: Add WebKitDirectoryInputStream.cpp

Source/WebKit:

SoupRequest API is gone in libsoup3 and there's no replacement for file requests. GResource and data URI loads
already happen in the web process so we only need to care about file and directory loads.

* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::createRequest): Create a GFile for local files.
(WebKit::NetworkDataTaskSoup::clearRequest): Clear the m_file.
(WebKit::NetworkDataTaskSoup::resume): Check also if there's a file operation to resume.
(WebKit::NetworkDataTaskSoup::didSendRequest): We always have a soup message now here because SoupRequest is
only used for HTTP.
(WebKit::NetworkDataTaskSoup::readCallback): In case of failure check if this is an HTTP or file request to
create the error.
(WebKit::NetworkDataTaskSoup::fileQueryInfoCallback): Call didGetFileInfo() and continue reading the file or directory.
(WebKit::NetworkDataTaskSoup::didGetFileInfo): Set URL, content type and length of the response for the given GFileInfo.
(WebKit::NetworkDataTaskSoup::readFileCallback): Complete the g_file_read_async operation.
(WebKit::NetworkDataTaskSoup::enumerateFileChildrenCallback): Create a WebKitDirectoryInputStream.
(WebKit::NetworkDataTaskSoup::didReadFile): Set the input stream and notify the response is ready.
* NetworkProcess/soup/NetworkDataTaskSoup.h:
* NetworkProcess/soup/Resources/directory.css: Added.
* NetworkProcess/soup/Resources/directory.js: Added.
* NetworkProcess/soup/WebKitDirectoryInputStream.cpp: Added.
(webkitDirectoryInputStreamCreateHeader):
(webkitDirectoryInputStreamCreateFooter):
(webkitDirectoryInputStreamCreateRow):
(webkitDirectoryInputStreamReadNextFile):
(webkitDirectoryInputStreamRead):
(webkitDirectoryInputStreamClose):
(webkit_directory_input_stream_class_init):
(webkitDirectoryInputStreamNew):
* NetworkProcess/soup/WebKitDirectoryInputStream.h: Added.
* PlatformGTK.cmake:
* PlatformWPE.cmake:
* SourcesGTK.txt:
* SourcesWPE.txt:

Tools:

Add WebKitDirectoryInputStream.cpp as exception for style checker.

* Scripts/webkitpy/style/checker.py:

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

8 months agoUnreviewed, reverting r271514 and r271549
rniwa@webkit.org [Tue, 26 Jan 2021 06:56:21 +0000 (06:56 +0000)]
Unreviewed, reverting r271514 and r271549

Made TestWebKitAPI.WebKit.PrintFrame flaky

Reverted changeset:

"Use event loop to set title"
https://bugs.webkit.org/show_bug.cgi?id=218496
https://trac.webkit.org/changeset/271514

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

8 months agoUnreviewed test gardening.
ryanhaddad@apple.com [Tue, 26 Jan 2021 06:21:57 +0000 (06:21 +0000)]
Unreviewed test gardening.

* platform/mac-wk1/TestExpectations: Expand scope of tests skipped due to rdar://65287528.

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

8 months agoCrash when remote inspecting in debug builds
simon.fraser@apple.com [Tue, 26 Jan 2021 05:09:16 +0000 (05:09 +0000)]
Crash when remote inspecting in debug builds
https://bugs.webkit.org/show_bug.cgi?id=220956
<rdar://73379637>

Reviewed by Devin Rousso.

Convert RemoteConnectionToTarget from using BlockPtr<> to Function<> because BlockPtr<>
was triggering crashes which seem to be related to mixing ARC and non-ARC code.

* inspector/remote/RemoteConnectionToTarget.h:
* inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm:
(Inspector::RemoteTargetHandleRunSourceGlobal):
(Inspector::RemoteTargetQueueTaskOnGlobalQueue):
(Inspector::RemoteTargetHandleRunSourceWithInfo):
(Inspector::RemoteConnectionToTarget::dispatchAsyncOnTarget):
(Inspector::RemoteConnectionToTarget::setup):
(Inspector::RemoteConnectionToTarget::close):
(Inspector::RemoteConnectionToTarget::sendMessageToTarget):
(Inspector::RemoteConnectionToTarget::queueTaskOnPrivateRunLoop):
(Inspector::RemoteConnectionToTarget::takeQueue):

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

8 months ago[Legacy Line Layout] Multiple inline boxes may stretch the line
zalan@apple.com [Tue, 26 Jan 2021 03:43:54 +0000 (03:43 +0000)]
[Legacy Line Layout] Multiple inline boxes may stretch the line
https://bugs.webkit.org/show_bug.cgi?id=220905

Reviewed by Antti Koivisto.

Source/WebCore:

This is a follow-up on r271110 where the top position of the inline box with the maximum ascent
gets adjusted to make sure it does not stick out of the line. This patch fixes the case when
multiple inline boxes have the same maximum ascent value.

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

LayoutTests:

* platform/ios/fast/block/basic/014-expected.txt:
* platform/mac/fast/block/basic/014-expected.txt:

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

8 months agoWeb Inspector: Add experimental setting to show Layout panel in Elements tab
nvasilyev@apple.com [Tue, 26 Jan 2021 03:29:03 +0000 (03:29 +0000)]
Web Inspector: Add experimental setting to show Layout panel in Elements tab
https://bugs.webkit.org/show_bug.cgi?id=220954
<rdar://problem/73590856>

Reviewed by BJ Burg.

Add "Show layout panel" checkbox to the Experimental settings that shows an empty
panel (for now) in Elements tab.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Base/Setting.js:
* UserInterface/Main.html:
* UserInterface/Views/ElementsTabContentView.js:
(WI.ElementsTabContentView):
* UserInterface/Views/LayoutDetailsSidebarPanel.js: Added.
(WI.LayoutDetailsSidebarPanel):
(WI.LayoutDetailsSidebarPanel.prototype.supportsDOMNode):
(WI.LayoutDetailsSidebarPanel.prototype.attached):
(WI.LayoutDetailsSidebarPanel.prototype.detached):
(WI.LayoutDetailsSidebarPanel.prototype.initialLayout):
(WI.LayoutDetailsSidebarPanel.prototype.layout):
(WI.LayoutDetailsSidebarPanel.prototype._mainResourceDidChange):
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createExperimentalSettingsView):

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

8 months agoREGRESSION (r270874): Some React Native apps are reported broken on iOS
shvaikalesh@gmail.com [Tue, 26 Jan 2021 02:13:11 +0000 (02:13 +0000)]
REGRESSION (r270874): Some React Native apps are reported broken on iOS
https://bugs.webkit.org/show_bug.cgi?id=220809

Reviewed by Saam Barati.

Source/JavaScriptCore:

r270874 fixed for/in shadowing issue by introducing an invariant: a property
returned by getOwn*PropertyNames() in DontEnumPropertiesMode::Exclude should be
reported as [[Enumerable]] by getOwnPropertySlot(). Otherwise, for/in skips the
property, which causes RN apps to break.

Since there is no way to enforce this invariant for opaque API objects like
JSCallbackObject, this change skips [[Enumerable]] check for them by introducing
GetOwnPropertySlotMayBeWrongAboutDontEnum out of line type info flag.

Also, this patch reverts JSCallbackObject::getOwnPropertySlot() changes of r270874
that are no longer necessary and observable (via Object.getOwnPropertyDescriptor).

* API/JSCallbackObject.h:
* API/JSCallbackObjectFunctions.h:
(JSC::JSCallbackObject<Parent>::getOwnPropertySlot):
* API/tests/testapiScripts/testapi.js:
* runtime/JSObject.cpp:
(JSC::JSObject::hasEnumerableProperty const):
* runtime/JSTypeInfo.h:
(JSC::TypeInfo::getOwnPropertySlotMayBeWrongAboutDontEnum const):

Source/WebCore:

* bridge/runtime_object.h:

Source/WebKit:

* WebProcess/Plugins/Netscape/JSNPObject.h:

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

8 months agoUnreviewed, add missing header includes to address build issues.
cdumez@apple.com [Tue, 26 Jan 2021 01:33:45 +0000 (01:33 +0000)]
Unreviewed, add missing header includes to address build issues.

Source/WebCore:

* Modules/webauthn/AuthenticationExtensionsClientOutputs.h:

Source/WebKit:

* UIProcess/API/Cocoa/WKUserScript.mm:
* UIProcess/API/Cocoa/_WKInspectorExtension.mm:
* UIProcess/Cocoa/AutomationClient.mm:
* UIProcess/WebAuthentication/Cocoa/AuthenticatorPresenterCoordinator.h:

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

8 months agoASSERT NOT REACHED in WebCore::DisplayList::isDrawingItem
wenson_hsieh@apple.com [Tue, 26 Jan 2021 01:30:04 +0000 (01:30 +0000)]
ASSERT NOT REACHED in WebCore::DisplayList::isDrawingItem
https://bugs.webkit.org/show_bug.cgi?id=220948
<rdar://problem/73588734>

Reviewed by Tim Horton.

Source/WebCore:

Additionally, fix a bug that is also caught when running this API test under debug. In the case where an out of
line item failed to decode (and is thus invalid), we still attempt to invoke its destructor when we're done
iterating, under `DisplayList::iterator::clearCurrentItem()`; we should not be doing this in the case where
`m_isValid` is `false`, since we already know that `m_currentBufferForItem` either contains an item that has
already been destroyed, or contains garbage data.

* platform/graphics/displaylists/DisplayList.cpp:
(WebCore::DisplayList::DisplayList::iterator::clearCurrentItem):

Tools:

The API test `DisplayListTests.OutOfLineItemDecodingFailure` was intended to read from the display list copy
rather than the original list, in order to exercise the (intentional) decoding failure.

Instead, this test erroneously attempts to read from the original display list (which, importantly, doesn't have
a reading client) and ends up exercising the decoding failure anyways, but additionally hits a debug assertion
in the process. Simply fix this by reading out of the correct display list (and rename the original display list
in the process to make the test more clear).

* TestWebKitAPI/Tests/WebCore/cg/DisplayListTestsCG.cpp:
(TestWebKitAPI::TEST)

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

8 months agoTwitter PiP video pauses when scrolling
peng.liu6@apple.com [Tue, 26 Jan 2021 00:58:00 +0000 (00:58 +0000)]
Twitter PiP video pauses when scrolling
https://bugs.webkit.org/show_bug.cgi?id=220887

This patch adds two quirks (requiresUserGestureToPauseInPictureInPicture and
requiresUserGestureToLoadInPictureInPicture) for twitter.com, so that when we scroll
the page while a video is in picture-in-picture, the video won't pause or close.

This patch also fixes a race condition related to function MediaElementSession::playbackPermitted()
by adding a parameter (MediaPlaybackOperation) to it. Because of the race condition, we
cannot resume a paused video in a picture-in-picture window on some sites (e.g., twitter.com).
That happens because when we click the play button on the picture-in-picture window to resume
a video, MediaElementSession::playbackPermitted() will be called by
HTMLMediaElement::mediaPlayerDidAddAudioTrack() when HTMLMediaElement::pause() returns false
(means the playback has already been resumed), so the request to add audio track will be rejected
due to the requiresUserGestureToPauseInPictureInPicture quirk and the video will be paused.
This patch fixes this race condition by enabling the requiresUserGestureToPauseInPictureInPicture
quirk only when the playback operation is "pause".

Reviewed by Eric Carlson.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::load):
(WebCore::HTMLMediaElement::pause):
(WebCore::HTMLMediaElement::suspendPlayback): We should use pauseInternal() instead of pause() here,
otherwise, it will be prevented by the requiresUserGestureToPauseInPictureInPicture quirk.
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::playbackPermitted const):
* html/MediaElementSession.h:
* page/Quirks.cpp:
(WebCore::Quirks::requiresUserGestureToPauseInPictureInPicture const):
(WebCore::Quirks::requiresUserGestureToLoadInPictureInPicture const):
* page/Quirks.h:

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

8 months agoChanges to commit-log-editor should trigger webkitpy EWS tests
aakash_jain@apple.com [Tue, 26 Jan 2021 00:50:53 +0000 (00:50 +0000)]
Changes to commit-log-editor should trigger webkitpy EWS tests
https://bugs.webkit.org/show_bug.cgi?id=220953

Reviewed by Jonathan Bedard.

* CISupport/ews-build/steps.py:
(CheckPatchRelevance): Added commit-log-editor to list of relevant files for webkitpy ews.
* CISupport/ews-build/steps_unittest.py: Improved unit-test to check for various file-names.

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

8 months ago[iOS] improve support for sequential scribble interactions that involving different...
drousso@apple.com [Tue, 26 Jan 2021 00:36:31 +0000 (00:36 +0000)]
[iOS] improve support for sequential scribble interactions that involving different inputs
https://bugs.webkit.org/show_bug.cgi?id=220933
<rdar:/problem/71911346>

Reviewed by Tim Horton.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView cleanUpInteraction]):
(-[WKContentView becomeFirstResponderForWebView]):
(-[WKContentView _zoomToRevealFocusedElement]):
(-[WKContentView _didCommitLoadForMainFrame]):
(-[WKContentView _willBeginTextInteractionInTextInputContext:]):
(-[WKContentView _didFinishTextInteractionInTextInputContext:]):
Rather than have a simple "yes/no" `_textInteractionIsHappening` we should keep a count of
scribble interactions (increment in `willBegin*` and decrement in `didFinish*`) so that we
don't send unnecessary/incorrect IPC to the WebProcess after the first scribble commits if
there's a second scribble in progress for another element.

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

8 months ago[run-webkit-tests] Support python layout tests
jbedard@apple.com [Tue, 26 Jan 2021 00:33:44 +0000 (00:33 +0000)]
[run-webkit-tests] Support python layout tests
https://bugs.webkit.org/show_bug.cgi?id=220749
Tools:

<rdar://problem/73375271>

Reviewed by Alexey Proskuryakov.

* Scripts/webkitpy/layout_tests/controllers/layout_test_finder.py:
(LayoutTestFinder._real_tests): Exclude "tools" directories.
(LayoutTestFinder._is_test_file): Special case for web socket's *_wsh.py files.
(LayoutTestFinder._is_w3c_resource_file): Exclude w3c Python files.

LayoutTests:

Reviewed by Alexey Proskuryakov.

* html5lib/generate-test-wrappers: Copied from LayoutTests/html5lib/generate-test-wrappers.py.
* html5lib/generate-test-wrappers.py: Removed.
* http/conf/apache2.2-httpd.conf: Allow .py files to be run as CGI binaries.
* http/conf/apache2.4-httpd.conf: Ditto.
* http/conf/apache2.4-php7-httpd.conf: Ditto.
* http/conf/archlinux-httpd.conf: Ditto.
* http/conf/debian-httpd-2.4-php7.0.conf: Ditto.
* http/conf/debian-httpd-2.4-php7.1.conf: Ditto.
* http/conf/debian-httpd-2.4-php7.2.conf: Ditto.
* http/conf/debian-httpd-2.4-php7.3.conf: Ditto.
* http/conf/debian-httpd-2.4-php7.4.conf: Ditto.
* http/conf/fedora-httpd-2.2.conf: Ditto.
* http/conf/fedora-httpd-2.4-php7.conf: Ditto.
* http/conf/fedora-httpd-2.4.conf: Ditto.
* http/conf/flatpak-httpd.conf: Ditto.
* http/conf/win-httpd-2.4-php5.conf: Ditto.
* http/conf/win-httpd-2.4-php7.conf: Ditto.
* media/track/opera/track/webvtt/parsing-cue-data/buildtests: Copied from LayoutTests/media/track/opera/track/webvtt/parsing-cue-data/buildtests.py.
* media/track/opera/track/webvtt/parsing-cue-data/buildtests.py: Removed.
* webgl/generate-webgl-tests: Copied from LayoutTests/webgl/generate-webgl-tests.py.
* webgl/generate-webgl-tests.py: Removed.

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

8 months agoSupport percentages when parsing color(srgb ...) and color(display-p3 ...) per-spec
weinig@apple.com [Mon, 25 Jan 2021 23:32:13 +0000 (23:32 +0000)]
Support percentages when parsing color(srgb ...) and color(display-p3 ...) per-spec
https://bugs.webkit.org/show_bug.cgi?id=220940

Reviewed by Simon Fraser.

Add support for using percentages when using the color(srgb ) and color(display-p3 ) syntax. Also
fix color(lab ) to allow elliding parameters and defaulting them to 0 as per-spec.

Source/WebCore:

Unfails some WPT tests and adds additional parsing tests for lab to fast/css/parsing-lab-colors.html

* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::parseColorFunctionForSRGBOrDisplayP3Parameters):
(WebCore::CSSPropertyParserHelpers::parseColorFunctionForLabParameters):

LayoutTests:

* TestExpectations:
* fast/css/parsing-lab-colors-expected.txt:
* fast/css/parsing-lab-colors.html:

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

8 months agoUnreviewed, reverting r271805.
ryanhaddad@apple.com [Mon, 25 Jan 2021 23:14:11 +0000 (23:14 +0000)]
Unreviewed, reverting r271805.

Appears to have broken generation of changed files/functions
in commit logs

Reverted changeset:

"The generated commit message have a directory label at the
first line rather than the bug's title if ChangeLogs have
different bug titles"
https://bugs.webkit.org/show_bug.cgi?id=220822
https://trac.webkit.org/changeset/271805

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

8 months agoASSERTION FAILED: This HTTPServer does not know how to respond to a request for ...
achristensen@apple.com [Mon, 25 Jan 2021 22:59:06 +0000 (22:59 +0000)]
ASSERTION FAILED: This HTTPServer does not know how to respond to a request for /Ahem.svg
https://bugs.webkit.org/show_bug.cgi?id=220949

* TestWebKitAPI/Tests/WebKitCocoa/Navigation.mm:
(TEST):
A path in the test I added in r271770 was missing a / at the beginning of a path.
It passes before and after this change, but it doesn't assert after it.

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

8 months ago[iOS] Obscured elements should not be focusable using the accessory bar
akeerthi@apple.com [Mon, 25 Jan 2021 22:51:56 +0000 (22:51 +0000)]
[iOS] Obscured elements should not be focusable using the accessory bar
https://bugs.webkit.org/show_bug.cgi?id=220929
<rdar://problem/73239409>

Reviewed by Tim Horton.

Source/WebCore:
* rendering/HitTestResult.h:

Export function so it can be called from WebKit layer.

Source/WebKit:
Currently, assistable elements hidden behind unassistable elements can
be focused using the next/previous buttons on the accessory bar. This
behavior is undesirable since users cannot see the focused element, but
are still presented UI to enter information into the element.

While the current behavior has been longstanding, its undesirability was
exposed after r269059, which made it possible to use the accessory bar
to focus elements across focusable scopes. As a result, it became possible
to focus a hidden input field on appleid.apple.com using the accessory bar.
Note that the hidden field is inside a subframe, which was previously
excluded from accessory bar next/previous operations. However, the same
bug would still exist even if the field was not inside a subframe, which
means that r269059 is not the root cause of the issue, but simply exposed
a larger underlying problem.

To prevent obscured elements from being focusable using the accessory bar,
we now use hit testing to determine whether or not an element is obscured,
before considering the element "assistable".

Test: fast/forms/ios/accessory-bar-navigation-obscured-input.html

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

An element is considered obscured if a hit test at its center position
relative to the main document targets a different element.

(WebKit::nextAssistableElement):

Obscured elements should not be assistable.

LayoutTests:
* fast/forms/ios/accessory-bar-navigation-obscured-input-expected.txt: Added.
* fast/forms/ios/accessory-bar-navigation-obscured-input.html: Added.

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

8 months ago[macOS] Create extension to Metal compiler service based on GPUP flags
pvollan@apple.com [Mon, 25 Jan 2021 22:39:36 +0000 (22:39 +0000)]
[macOS] Create extension to Metal compiler service based on GPUP flags
https://bugs.webkit.org/show_bug.cgi?id=220931
<rdar://problem/73574476>

Reviewed by Brent Fulgham.

Depending on which GPUP settings are enabled, an extension to the Metal compiler service should be created.

* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::gpuMachServices):
(WebKit::WebPageProxy::creationParameters):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_limitsNavigationsToAppBoundDomains):
* WebProcess/com.apple.WebProcess.sb.in:

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

8 months ago[iOS] imported/w3c/web-platform-tests/css/css-color/system-color-compute.html is...
ryanhaddad@apple.com [Mon, 25 Jan 2021 22:24:16 +0000 (22:24 +0000)]
[iOS] imported/w3c/web-platform-tests/css/css-color/system-color-compute.html is failing
https://bugs.webkit.org/show_bug.cgi?id=220947

Unreviewed test gardening.

* platform/ios/TestExpectations: Mark test as failing.

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

8 months ago[macOS] Restrict access to dtracehelper
pvollan@apple.com [Mon, 25 Jan 2021 22:09:52 +0000 (22:09 +0000)]
[macOS] Restrict access to dtracehelper
https://bugs.webkit.org/show_bug.cgi?id=220927
<rdar://70350947>

Reviewed by Brent Fulgham.

Only allow access to dtracehelper for internal installs.

* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
* WebProcess/com.apple.WebProcess.sb.in:

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

8 months agoFinish introduction of RenderLayerScrollableArea: remove remaining glue code from...
zimmermann@webkit.org [Mon, 25 Jan 2021 21:37:54 +0000 (21:37 +0000)]
Finish introduction of RenderLayerScrollableArea: remove remaining glue code from RenderLayer
https://bugs.webkit.org/show_bug.cgi?id=220851

Reviewed by Simon Fraser.

Remove the last remaining glue code from RenderLayer, that was added
in r271559 to minimize the patch size. After this patch all call sites
use RenderLayerScrollableArea directly, removing the need for proxy
methods in RenderLayer that forward to RenderLayerScrollableArea.

The decade old bug 60305 (Separate scrolling code out of RenderLayer)
is finally closed.

Covered by existing tests.

Source/WebCore:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::scrollTo const):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::revealSelection):
* html/HTMLMarqueeElement.cpp:
(WebCore::HTMLMarqueeElement::renderMarquee const):
* page/EventHandler.cpp:
(WebCore::EventHandler::selectCursor):
* page/FrameView.cpp:
(WebCore::FrameView::updateLayerPositionsAfterScrolling):
* page/SpatialNavigation.cpp:
(WebCore::scrollInDirection):
* page/ios/FrameIOS.mm:
(WebCore::Frame::overflowScrollPositionChangedForNode):
* page/mac/EventHandlerMac.mm:
(WebCore::scrollableAreaForBox):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::isPointInOverflowControl):
(WebCore::RenderBlock::baselinePosition const):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::computeIntrinsicLogicalWidths const):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::styleDidChange):
(WebCore::RenderBox::scrollLeft const):
(WebCore::RenderBox::scrollTop const):
(WebCore::setupWheelEventMonitor):
(WebCore::RenderBox::setScrollLeft):
(WebCore::RenderBox::setScrollTop):
(WebCore::RenderBox::setScrollPosition):
(WebCore::RenderBox::verticalScrollbarWidth const):
(WebCore::RenderBox::horizontalScrollbarHeight const):
(WebCore::RenderBox::scrollLayer):
(WebCore::RenderBox::logicalScroll):
(WebCore::RenderBox::panScroll):
(WebCore::RenderBox::scrollPosition const):
(WebCore::RenderBox::computeBackgroundIsKnownToBeObscured):
(WebCore::RenderBox::overflowClipRect const):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::computeStickyPositionConstraints const):
(WebCore::RenderBoxModelObject::constrainingRectForStickyPosition const):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollRectToVisible):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::computeOverflowTiledBackingCoverage):
(WebCore::RenderLayerBacking::computeParentGraphicsLayerRect const):
(WebCore::RenderLayerBacking::updateGeometry):
(WebCore::RenderLayerBacking::updateScrollOffset):
(WebCore::RenderLayerBacking::updateClippingStackLayerGeometry):
(WebCore::RenderLayerBacking::requiresHorizontalScrollbarLayer const):
(WebCore::RenderLayerBacking::requiresVerticalScrollbarLayer const):
(WebCore::RenderLayerBacking::requiresScrollCornerLayer const):
(WebCore::RenderLayerBacking::positionOverflowControlsLayers):
(WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
(WebCore::RenderLayerBacking::paintIntoLayer):
(WebCore::RenderLayerBacking::paintContents):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateScrollingNodeLayers):
(WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
(WebCore::LegacyWebKitScrollingLayerCoordinator::updateScrollingLayer):
* rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::styleDidChange):
* rendering/RenderLayerScrollableArea.cpp:
(WebCore::RenderLayerScrollableArea::paintOverflowControls):
(WebCore::RenderLayerScrollableArea::scrollByRecursively):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::hasScrollableOrRubberbandableAncestor):
* rendering/RenderMarquee.cpp:
(WebCore::RenderMarquee::start):
(WebCore::RenderMarquee::timerFired):
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::scroll):
(WebCore::RenderTextControlSingleLine::logicalScroll):
* rendering/RenderTreeAsText.cpp:

Source/WebKitLegacy/mac:
* DOM/DOMHTML.mm:
(-[DOMHTMLElement scrollXOffset]):
(-[DOMHTMLElement scrollYOffset]):
(-[DOMHTMLElement setScrollXOffset:scrollYOffset:adjustForIOSCaret:]):
* WebView/WebFrame.mm:
(-[WebFrame _scrollDOMRangeToVisible:]):
(-[WebFrame _scrollDOMRangeToVisible:withInset:]):

Source/WebKitLegacy/win:
* WebView.cpp:
(WebView::gesture):

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

8 months agoUpdate availability annotations to match the macOS 11.0 and iOS 14.0 GM SDKs
cdumez@apple.com [Mon, 25 Jan 2021 21:36:49 +0000 (21:36 +0000)]
Update availability annotations to match the macOS 11.0 and iOS 14.0 GM SDKs
https://bugs.webkit.org/show_bug.cgi?id=220874
<rdar://73474368>

Reviewed by Darin Adler.

Source/JavaScriptCore:
* API/JSContextPrivate.h:
* API/JSContextRefPrivate.h:

Source/WebKit:
* UIProcess/API/Cocoa/WKContentWorld.h:
* UIProcess/API/Cocoa/WKError.h:
* UIProcess/API/Cocoa/WKFindConfiguration.h:
* UIProcess/API/Cocoa/WKFindResult.h:
* UIProcess/API/Cocoa/WKFrameInfoPrivate.h:
* UIProcess/API/Cocoa/WKHTTPCookieStorePrivate.h:
* UIProcess/API/Cocoa/WKNavigationDelegate.h:
* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
* UIProcess/API/Cocoa/WKOpenPanelParametersPrivate.h:
* UIProcess/API/Cocoa/WKPDFConfiguration.h:
* UIProcess/API/Cocoa/WKPreferences.h:
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/API/Cocoa/WKScriptMessage.h:
* UIProcess/API/Cocoa/WKScriptMessageHandlerWithReply.h:
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/API/Cocoa/WKURLSchemeTaskPrivate.h:
* UIProcess/API/Cocoa/WKUserContentController.h:
* UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:
* UIProcess/API/Cocoa/WKUserScript.h:
* UIProcess/API/Cocoa/WKUserScriptPrivate.h:
* UIProcess/API/Cocoa/WKWebView.h:
* UIProcess/API/Cocoa/WKWebViewConfiguration.h:
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/WKWebpagePreferences.h:
* UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h:
* UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/API/Cocoa/_WKDownload.h:
* UIProcess/API/Cocoa/_WKFrameTreeNode.h:
* UIProcess/API/Cocoa/_WKInputDelegate.h:
* UIProcess/API/Cocoa/_WKInspectorDebuggableInfo.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKResourceLoadDelegate.h:
* UIProcess/API/Cocoa/_WKResourceLoadInfo.h:
* UIProcess/API/Cocoa/_WKResourceLoadStatisticsFirstParty.h:
* UIProcess/API/Cocoa/_WKResourceLoadStatisticsThirdParty.h:
* UIProcess/API/Cocoa/_WKTextManipulationConfiguration.h:
* UIProcess/API/Cocoa/_WKTextManipulationExclusionRule.h:
* UIProcess/API/Cocoa/_WKTextManipulationItem.h:
* UIProcess/API/Cocoa/_WKTextManipulationToken.h:
* UIProcess/API/Cocoa/_WKUserContentWorld.h:
* UIProcess/API/Cocoa/_WKUserStyleSheet.h:
* UIProcess/API/Cocoa/_WKWebAuthenticationAssertionResponse.h:
* UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h:
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.h:

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

8 months ago[ews] Commit Queue should retry the build when update-working-directory step fails
aakash_jain@apple.com [Mon, 25 Jan 2021 21:29:07 +0000 (21:29 +0000)]
[ews] Commit Queue should retry the build when update-working-directory step fails
https://bugs.webkit.org/show_bug.cgi?id=220836

Reviewed by Jonathan Bedard.

* CISupport/ews-build/steps.py:
(UpdateWorkingDirectory):
(UpdateWorkingDirectory.getResultSummary): Provide better failure message.
(UpdateWorkingDirectory.evaluateCommand): Retry the build when this step fails.
* CISupport/ews-build/steps_unittest.py:

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

8 months ago[iOS] Stop leaking an XPC boost message to XPC services
cdumez@apple.com [Mon, 25 Jan 2021 21:26:37 +0000 (21:26 +0000)]
[iOS] Stop leaking an XPC boost message to XPC services
https://bugs.webkit.org/show_bug.cgi?id=220883
<rdar://47402853>

Reviewed by Geoffrey Garen.

Turn on RB_full_manage_WK_jetsam feature flag so that we stop leaking an XPC boost
message to XPC services on IOS_FAMILY. Instead, RunningBoard will now be setting
the priority of our XPC services based on the RunningBoard assertions we're holding
for them. The feature flag is checked both by RunningBoard and WebKit.

I have verified that our bots have upgraded to a build that supports this.

* FeatureFlags/WebKit-appletvos.plist:
* FeatureFlags/WebKit-ios.plist:
* FeatureFlags/WebKit-watchos.plist:

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

8 months agoREGRESSION (Big Sur): Some tests in http/tests/security/http-0.9 flakily fail
commit-queue@webkit.org [Mon, 25 Jan 2021 21:25:12 +0000 (21:25 +0000)]
REGRESSION (Big Sur): Some tests in http/tests/security/http-0.9 flakily fail
https://bugs.webkit.org/show_bug.cgi?id=220188
<rdar://problem/72709565>

Patch by Alex Christensen <achristensen@webkit.org> on 2021-01-25
Reviewed by Alexey Proskuryakov.

rdar://69534004 caused two tests to become flaky on Big Sur.
That change was correct, but caused issues with our test infrastructure.
r271652 successfully made default-port-script-blocked.html no longer flaky, but made default-port-plugin-blocked.html a flaky timeout.
Now that all plugins are blocked, let's just remove this test, which is no longer needed.

* http/tests/security/http-0.9/default-port-plugin-blocked-expected.txt: Removed.
* http/tests/security/http-0.9/default-port-plugin-blocked.html: Removed.
* http/tests/security/http-0.9/resources/nph-load-plugin-fail.pl: Removed.
* platform/mac-wk1/TestExpectations:
* platform/wk2/TestExpectations:

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

8 months ago[macOS] Restrict access to mds data
pvollan@apple.com [Mon, 25 Jan 2021 21:24:23 +0000 (21:24 +0000)]
[macOS] Restrict access to mds data
https://bugs.webkit.org/show_bug.cgi?id=220920
<rdar://70355552>

Reviewed by Brent Fulgham.

Only root show have write access.

* GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in:
* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
* WebAuthnProcess/mac/com.apple.WebKit.WebAuthnProcess.sb.in:
* WebProcess/com.apple.WebProcess.sb.in:

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

8 months ago[Cocoa] Adjust logic for creating sandbox extensions based on GPUP flags
pvollan@apple.com [Mon, 25 Jan 2021 20:52:12 +0000 (20:52 +0000)]
[Cocoa] Adjust logic for creating sandbox extensions based on GPUP flags
https://bugs.webkit.org/show_bug.cgi?id=220917

Reviewed by Brent Fulgham.

Update which GPUP flag should be used in this logic. This patch also includes many IOKit classes on macOS in the set of
classes that should be extended when the appropriate GPU flags are set. In the case they are not being extended, logging
rules have been added in the sandbox, to determine if they are being used in that case.

* UIProcess/WebPageProxy.cpp:
(WebKit::gpuIOKitClasses):
(WebKit::WebPageProxy::creationParameters):
* WebProcess/com.apple.WebProcess.sb.in:

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

8 months agoMany WPT tests in css/css-color/predefined-*.html failing
ryanhaddad@apple.com [Mon, 25 Jan 2021 20:27:06 +0000 (20:27 +0000)]
Many WPT tests in css/css-color/predefined-*.html failing
https://bugs.webkit.org/show_bug.cgi?id=220928

Unreviewed test gardening.

* TestExpectations: Switch from Failure -> ImageOnlyFailure.

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

8 months agoSupport AbortSignal in addEventListenerOptions to unsubscribe from events
cdumez@apple.com [Mon, 25 Jan 2021 20:06:25 +0000 (20:06 +0000)]
Support AbortSignal in addEventListenerOptions to unsubscribe from events
https://bugs.webkit.org/show_bug.cgi?id=218753
<rdar://problem/71258012>

Reviewed by Darin Adler.

LayoutTests/imported/w3c:
Import test coverage from WPT.

* web-platform-tests/dom/events/AddEventListenerOptions-signal.any-expected.txt: Added.
* web-platform-tests/dom/events/AddEventListenerOptions-signal.any.html: Added.
* web-platform-tests/dom/events/AddEventListenerOptions-signal.any.js: Added.
* web-platform-tests/dom/events/AddEventListenerOptions-signal.any.worker-expected.txt: Added.
* web-platform-tests/dom/events/AddEventListenerOptions-signal.any.worker.html: Added.
* web-platform-tests/dom/events/w3c-import.log:

Source/WebCore:
Support AbortSignal in addEventListenerOptions to unsubscribe from events:
- https://github.com/whatwg/dom/issues/911
- https://github.com/whatwg/dom/pull/919

Blink already added support for this.

Tests: imported/w3c/web-platform-tests/dom/events/AddEventListenerOptions-signal.any.html
       imported/w3c/web-platform-tests/dom/events/AddEventListenerOptions-signal.any.worker.html

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Headers.cmake:
* Modules/async-clipboard/Clipboard.h:
* Modules/encryptedmedia/MediaKeySession.h:
* Modules/indexeddb/IDBRequest.h:
* Modules/mediastream/MediaDevices.h:
* Modules/mediastream/RTCPeerConnection.h:
* Modules/paymentrequest/PaymentRequest.h:
* Modules/speech/SpeechRecognition.h:
* Modules/webaudio/BaseAudioContext.h:
* Modules/webgpu/WebGPUDevice.h:
* Modules/webxr/WebXRSystem.h:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* animation/WebAnimation.h:
* css/MediaQueryList.cpp:
(WebCore::MediaQueryList::addListener):
(WebCore::MediaQueryList::removeListener):
* css/MediaQueryList.h:
* dom/AbortSignal.h:
* dom/AddEventListenerOptions.h: Copied from Source/WebCore/loader/appcache/DOMApplicationCache.h.
(WebCore::AddEventListenerOptions::AddEventListenerOptions):
* dom/AddEventListenerOptions.idl: Copied from Source/WebCore/loader/appcache/DOMApplicationCache.h.
* dom/EventListener.h:
* dom/EventListenerMap.cpp:
* dom/EventListenerOptions.h: Copied from Source/WebCore/loader/appcache/DOMApplicationCache.h.
(WebCore::EventListenerOptions::EventListenerOptions):
* dom/EventListenerOptions.idl: Copied from Source/WebCore/loader/appcache/DOMApplicationCache.h.
* dom/EventTarget.cpp:
(WebCore::EventTarget::addEventListener):
(WebCore::EventTarget::removeEventListenerForBindings):
(WebCore::EventTarget::removeEventListener):
(WebCore::EventTarget::setAttributeEventListener):
(WebCore::EventTarget::innerInvokeEventListeners):
* dom/EventTarget.h:
(WebCore::EventTarget::removeEventListener):
* dom/EventTarget.idl:
* dom/MessagePort.cpp:
(WebCore::MessagePort::MessagePort):
(WebCore::MessagePort::removeEventListener):
* dom/MessagePort.h:
* dom/Node.cpp:
(WebCore::tryAddEventListener):
(WebCore::tryRemoveEventListener):
(WebCore::Node::removeEventListener):
* dom/Node.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::removeEventListener):
* html/HTMLMediaElement.h:
* html/ImageDocument.cpp:
* html/track/TextTrackCue.h:
* inspector/agents/InspectorDOMAgent.cpp:
* loader/appcache/DOMApplicationCache.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::removeEventListener):
* page/DOMWindow.h:
* platform/cocoa/PlaybackSessionModelMediaElement.mm:
* platform/cocoa/VideoFullscreenModelVideoElement.mm:
* svg/SVGElement.cpp:
(WebCore::SVGElement::removeEventListener):
* svg/SVGElement.h:
* svg/SVGTRefElement.cpp:
* svg/animation/SVGSMILElement.cpp:
* testing/Internals.cpp:
* workers/service/ServiceWorkerContainer.h:

Source/WebKit:
Minor build fixes.

* WebProcess/Plugins/PDF/PDFPluginAnnotation.mm:

Source/WebKitLegacy/mac:
Minor build fixes.

* DOM/DOMNode.mm:

Source/WTF:
Add initializeWeakPtrFactory() protection function to CanMakeWeakPtr so that a subclass
can eagerly initialize the WeakPtrFactory even if it does not subclass
WeakPtrFactory<T, WeakPtrFactoryInitialization::Eager>. MessagePort used to subclass
WeakPtrFactory<T, WeakPtrFactoryInitialization::Eager> for thread-safety reason but it
now subclasses WeakPtrFactory<T, WeakPtrFactoryInitialization::Lazy> via EventTarget.

* wtf/WeakPtr.h:
(WTF::CanMakeWeakPtr::initializeWeakPtrFactory):

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

8 months agoThe generated commit message have a directory label at the first line rather than...
Hironori.Fujii@sony.com [Mon, 25 Jan 2021 19:58:49 +0000 (19:58 +0000)]
The generated commit message have a directory label at the first line rather than the bug's title if ChangeLogs have different bug titles
https://bugs.webkit.org/show_bug.cgi?id=220822

Reviewed by Darin Adler.

commit-log-editor generates the default commit message by
collecting all ChangeLog entries and merging them with prepending
directory lables. If it finds out a common prefix for all entries,
it removes the prefix from entries and hoists the prefix as the
beginning of the commit message. This step removes duplicated
lines of the bug title, the bug URL, the reviewed-by line, and the
descriptions.

If such prefix is not found, i.e. ChangeLog entries has different
bug titles, it simply merges all entries with directory labels. As
the result, the generated commit message has the directory label
at the first line. This is not desirable. The first line of the
commit message should be the bug title.

This patch yanks the first line of the first entry as the common
prefix in the case.

* Scripts/commit-log-editor:
(createCommitMessage):
(removeLongestCommonPrefixEndingInNewline):

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

8 months ago[macOS] Fix OS version check for ENABLE_SET_WEBCONTENT_PROCESS_INFORMATION_IN_NETWORK...
pvollan@apple.com [Mon, 25 Jan 2021 19:57:20 +0000 (19:57 +0000)]
[macOS] Fix OS version check for ENABLE_SET_WEBCONTENT_PROCESS_INFORMATION_IN_NETWORK_PROCESS
https://bugs.webkit.org/show_bug.cgi?id=219534
<rdar://problem/71973149>

Reviewed by Brent Fulgham.

The OS version check for ENABLE_SET_WEBCONTENT_PROCESS_INFORMATION_IN_NETWORK_PROCESS is incorrect.

* wtf/PlatformEnableCocoa.h:

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

8 months ago[GLIB] Gardening API failures after r271794
lmoura@igalia.com [Mon, 25 Jan 2021 19:05:34 +0000 (19:05 +0000)]
[GLIB] Gardening API failures after r271794

Unreviewed test gardening.

Looks like these failures flew under the radar by not actually being
run by run-gtk/wpe-tests, and were uncovered by r271794.

Marking them as failure to allow the EWS to run normally while they're
fixed.

* TestWebKitAPI/glib/TestExpectations.json:

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

8 months ago[build.webkit.org] Download the build archive from master when download from S3 fails
aakash_jain@apple.com [Mon, 25 Jan 2021 19:04:33 +0000 (19:04 +0000)]
[build.webkit.org] Download the build archive from master when download from S3 fails
https://bugs.webkit.org/show_bug.cgi?id=220932

Reviewed by Jonathan Bedard.

* CISupport/build-webkit-org/steps.py:
(DownloadBuiltProduct):
(DownloadBuiltProduct.evaluateCommand): If this fails, run DownloadBuiltProductFromMaster.
(DownloadBuiltProductFromMaster): Build step to download archive from master using buildbot FileDownload class.
(DownloadBuiltProductFromMaster.__init__):
(DownloadBuiltProductFromMaster.getResultSummary): Custom failure message.

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

8 months agolayout-test results shouldn't be hosted on build.webkit.org server
aakash_jain@apple.com [Mon, 25 Jan 2021 18:52:52 +0000 (18:52 +0000)]
layout-test results shouldn't be hosted on build.webkit.org server
https://bugs.webkit.org/show_bug.cgi?id=220864

Reviewed by Jonathan Bedard.

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

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

8 months ago[GPU Process] Web process should be terminated if DisplayListReaderHandle advances...
wenson_hsieh@apple.com [Mon, 25 Jan 2021 18:33:19 +0000 (18:33 +0000)]
[GPU Process] Web process should be terminated if DisplayListReaderHandle advances past 0
https://bugs.webkit.org/show_bug.cgi?id=220926

Reviewed by Simon Fraser.

Address another FIXME in the GPU Process by replacing a release assertion with a MESSAGE_CHECK. See below for
more details.

* GPUProcess/graphics/DisplayListReaderHandle.cpp:
(WebKit::DisplayListReaderHandle::advance):

Return `WTF::nullopt` instead of just crashing in the case where the number of bytes to advance exceeds the
number of unread bytes. This can (and should) only happen in the case where a compromised web content process
attempts to overwrite the number of unread bytes in the shared display list header.

* GPUProcess/graphics/DisplayListReaderHandle.h:
* GPUProcess/graphics/RemoteRenderingBackend.cpp:
(WebKit::RemoteRenderingBackend::nextDestinationImageBufferAfterApplyingDisplayLists):
* Shared/SharedDisplayListHandle.h:

Remove this virtual method from the base class, since the reader handle now returns an `Optional<size_t>`
instead of just a `size_t`.

* WebProcess/GPU/graphics/DisplayListWriterHandle.h:

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

8 months agoPCM: Use different well-known locations for triggering and reporting attribution
wilander@apple.com [Mon, 25 Jan 2021 18:28:41 +0000 (18:28 +0000)]
PCM: Use different well-known locations for triggering and reporting attribution
https://bugs.webkit.org/show_bug.cgi?id=220902
<rdar://problem/73550632>

Reviewed by Brent Fulgham.

The discussion in W3C Privacy CG concluded that we should use distinct
well-known URL paths for websites triggering attribution and for the
browser reporting attribution
(https://github.com/privacycg/private-click-measurement/issues/59).

This patch changes the one location to these two:
/.well-known/private-click-measurement/trigger-attribution
/.well-known/private-click-measurement/report-attribution

Source/WebCore:

Existing tests updated.

* loader/PrivateClickMeasurement.cpp:
(WebCore::PrivateClickMeasurement::parseAttributionRequest):
(WebCore::PrivateClickMeasurement::reportURL const):

Tools:

* TestWebKitAPI/Tests/WebCore/PrivateClickMeasurement.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitCocoa/EventAttribution.mm:
(TestWebKitAPI::TEST):

LayoutTests:

* http/tests/privateClickMeasurement/resources/redirectToConversion.php:
* http/tests/privateClickMeasurement/resources/redirectToConversionOnIPAddress.php:

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

8 months agoImport css/css-color tests from WPT
weinig@apple.com [Mon, 25 Jan 2021 18:19:47 +0000 (18:19 +0000)]
Import css/css-color tests from WPT
https://bugs.webkit.org/show_bug.cgi?id=220247
<rdar://problem/73002231>

Reviewed by Simon Fraser.

LayoutTests/imported/w3c:

Update WPT css/css-color tests.

* web-platform-tests/css/css-color/lab-002-expected.html:
* web-platform-tests/css/css-color/lab-003-expected.html:
* web-platform-tests/css/css-color/lch-001-expected.html:
* web-platform-tests/css/css-color/lch-002-expected.html:
* web-platform-tests/css/css-color/lch-003-expected.html:
* web-platform-tests/css/css-color/predefined-001-expected.html: Added.
* web-platform-tests/css/css-color/predefined-001.html: Added.
* web-platform-tests/css/css-color/predefined-002-expected.html: Added.
* web-platform-tests/css/css-color/predefined-002.html: Added.
* web-platform-tests/css/css-color/predefined-003-expected.html: Added.
* web-platform-tests/css/css-color/predefined-003.html: Added.
* web-platform-tests/css/css-color/predefined-004-expected.html: Added.
* web-platform-tests/css/css-color/predefined-004.html: Added.
* web-platform-tests/css/css-color/predefined-005-expected.html: Added.
* web-platform-tests/css/css-color/predefined-005.html: Added.
* web-platform-tests/css/css-color/predefined-006-expected.html: Added.
* web-platform-tests/css/css-color/predefined-006.html: Added.
* web-platform-tests/css/css-color/predefined-007-expected.html: Added.
* web-platform-tests/css/css-color/predefined-007.html: Added.
* web-platform-tests/css/css-color/predefined-008-expected.html: Added.
* web-platform-tests/css/css-color/predefined-008.html: Added.
* web-platform-tests/css/css-color/predefined-009-expected.html: Added.
* web-platform-tests/css/css-color/predefined-009.html: Added.
* web-platform-tests/css/css-color/predefined-010-expected.html: Added.
* web-platform-tests/css/css-color/predefined-010.html: Added.
* web-platform-tests/css/css-color/predefined-011-expected.html: Added.
* web-platform-tests/css/css-color/predefined-011.html: Added.
* web-platform-tests/css/css-color/predefined-012-expected.html: Added.
* web-platform-tests/css/css-color/predefined-012.html: Added.
* web-platform-tests/css/css-color/predefined-013-expected.html: Added.
* web-platform-tests/css/css-color/predefined-013.html: Added.
* web-platform-tests/css/css-color/predefined-014-expected.html: Added.
* web-platform-tests/css/css-color/predefined-014.html: Added.
* web-platform-tests/css/css-color/predefined-015-expected.html: Added.
* web-platform-tests/css/css-color/predefined-015.html: Added.
* web-platform-tests/css/css-color/predefined-016-expected.html: Added.
* web-platform-tests/css/css-color/predefined-016.html: Added.
* web-platform-tests/css/css-color/predefined-017-expected.html: Added.
* web-platform-tests/css/css-color/predefined-017.html: Added.
* web-platform-tests/css/css-color/system-color-compute-expected.txt: Added.
* web-platform-tests/css/css-color/system-color-compute.html: Added.
* web-platform-tests/css/css-color/t32-opacity-basic-0.6-a-expected.html: Added.
* web-platform-tests/css/css-color/t32-opacity-basic-0.6-a.xht:
* web-platform-tests/css/css-color/t32-opacity-zorder-c-expected.html: Added.
* web-platform-tests/css/css-color/t32-opacity-zorder-c.xht:
* web-platform-tests/css/css-color/t421-rgb-hex3-expand-b-expected.html: Added.
* web-platform-tests/css/css-color/t421-rgb-hex3-expand-b.xht:
* web-platform-tests/css/css-color/t422-rgba-a0.6-a-expected.html: Added.
* web-platform-tests/css/css-color/t422-rgba-a0.6-a.xht:
* web-platform-tests/css/css-color/t425-hsla-basic-a-expected.html: Added.
* web-platform-tests/css/css-color/t425-hsla-basic-a.xht:
* web-platform-tests/css/css-color/w3c-import.log:

LayoutTests:

* TestExpectations:
Add failing expectations for newly imported reftests that fail. Fixing them is
tracked in https://bugs.webkit.org/show_bug.cgi?id=220928.

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

8 months agoActivate simulcast through addTransceiver
youenn@apple.com [Mon, 25 Jan 2021 17:12:37 +0000 (17:12 +0000)]
Activate simulcast through addTransceiver
https://bugs.webkit.org/show_bug.cgi?id=173262
<rdar://problem/32713416>

Reviewed by Eric Carlson.

LayoutTests/imported/w3c:

* web-platform-tests/webrtc/RTCPeerConnection-addTransceiver.https-expected.txt:
* web-platform-tests/webrtc/RTCPeerConnection-transceivers.https-expected.txt:
* web-platform-tests/webrtc/protocol/simulcast-offer-expected.txt:

Source/WebCore:

Update WebIDL according latest version of the spec.
Add binding code to go from WebIDL to webrtc backend for sendEncodings parameters.
Minor refactoring to bring to web pages information on addTransceiver failures.

Covered by rebased tests.

* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCPeerConnection.idl:
* Modules/mediastream/RTCRtpEncodingParameters.idl:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
(WebCore::LibWebRTCMediaEndpoint::createTransceiverBackends):
(WebCore::LibWebRTCMediaEndpoint::addTransceiver):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::addTransceiverFromTrackOrKind):
* Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
(WebCore::fromRTCEncodingParameters):
(WebCore::fromRtpTransceiverInit):

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

8 months agoAX: @alt and bounds ignored when using img[src] points to an inaccessible SVG
andresg_22@apple.com [Mon, 25 Jan 2021 16:52:52 +0000 (16:52 +0000)]
AX: @alt and bounds ignored when using img[src] points to an inaccessible SVG
https://bugs.webkit.org/show_bug.cgi?id=160705
<rdar://problem/27771579>

Reviewed by Chris Fleizach and Darin Adler.

Source/WebCore:

Tests: accessibility/img-with-svg-source.html
       accessibility/ios-simulator/img-with-svg-source.html

The problem was caused by AccessibilityRenderObject::determineAccessibilityRole
that was returning AccessibilityRole::SVGRoot for all images with a remote
SVG source, regardless whether the SVG hierarchy contained some accessibility
data or not. This resulted in VoiceOver reading the image like an empty
group on Mac, or completely ignoring the image on iOS.
The solution in this patch is to only return AccessibilityRole::SVGRoot
if the SVG has some accessibility conveyable data. Added the method
AccessibilitySVGRoot::hasAccessibleContent for this purpose.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
(WebCore::AccessibilityRenderObject::remoteSVGRootElement const):
Comment was missplaced, moved it to the right place.
(WebCore::AccessibilityRenderObject::addRemoteSVGChildren):
* accessibility/AccessibilitySVGRoot.cpp:
(WebCore::AccessibilitySVGRoot::hasAccessibleContent const):
* accessibility/AccessibilitySVGRoot.h:

LayoutTests:

* accessibility/img-with-svg-source-expected.txt: Added.
* accessibility/img-with-svg-source.html: Added.
* accessibility/ios-simulator/img-with-svg-source-expected.txt: Added.
* accessibility/ios-simulator/img-with-svg-source.html: Added.
* accessibility/svg-shape-labelled-expected.txt:
* accessibility/svg-shape-labelled.html:
Removed the <img> test cases since they are covered correctly in the new
test img-with-svg-source.html.

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

8 months agoAdd Razvan Caliman to contributors.json
commit-queue@webkit.org [Mon, 25 Jan 2021 16:31:48 +0000 (16:31 +0000)]
Add Razvan Caliman to contributors.json
https://bugs.webkit.org/show_bug.cgi?id=220921

Patch by Razvan Caliman <rcaliman@apple.com> on 2021-01-25
Reviewed by Timothy Hatcher.

* Scripts/webkitpy/common/config/contributors.json:

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

8 months agoUnreviewed, reverting r270074 and r270170.
commit-queue@webkit.org [Mon, 25 Jan 2021 15:08:51 +0000 (15:08 +0000)]
Unreviewed, reverting r270074 and r270170.
https://bugs.webkit.org/show_bug.cgi?id=220922

Broke all GLib unit tests using a SoupServer

Reverted changesets:

"[GTK] Migrate WebKitTestServer to libsoup 2.48 API"
https://bugs.webkit.org/show_bug.cgi?id=219160
https://trac.webkit.org/changeset/270074

"[GTK] Allow WebKitTestServer to run non-loopback addresses
for API tests"
https://bugs.webkit.org/show_bug.cgi?id=219257
https://trac.webkit.org/changeset/270170

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

8 months agoResync libwebrtc with M87 latest branch
youenn@apple.com [Mon, 25 Jan 2021 13:40:30 +0000 (13:40 +0000)]
Resync libwebrtc with M87 latest branch
https://bugs.webkit.org/show_bug.cgi?id=220913

Reviewed by Eric Carlson.

Cherry-picking two changes that have been cherry-picked in upstream M87 after our latest resync.
This includes: https://webrtc-review.googlesource.com/c/src/+/187349 and https://webrtc-review.googlesource.com/c/src/+/191485.

* Source/webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.cc:
* Source/webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.h:
* Source/webrtc/modules/audio_coding/codecs/opus/opus_interface.cc:
* Source/webrtc/modules/audio_coding/codecs/opus/opus_unittest.cc:
* Source/webrtc/modules/audio_coding/test/TestVADDTX.cc:
* Source/webrtc/pc/peer_connection_rtp_unittest.cc:
* Source/webrtc/pc/sdp_offer_answer.cc:

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

8 months agoDumpRenderTree behaves differently to WebKitTestRunner wrt integrated/discrete GPU...
commit-queue@webkit.org [Mon, 25 Jan 2021 12:34:02 +0000 (12:34 +0000)]
DumpRenderTree behaves differently to WebKitTestRunner wrt integrated/discrete GPU behavior
https://bugs.webkit.org/show_bug.cgi?id=220852

Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2021-01-25
Reviewed by Alexey Proskuryakov.

Mark DumpRenderTree as supporting graphics switching. This lets
--prefer-integrated-gpu work as intended and compatible with WebKitTestRunner.

* DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
* DumpRenderTree/mac/Info.plist: Added.

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

8 months agoNullptr dereference in SpeechRecognition::stop()
commit-queue@webkit.org [Mon, 25 Jan 2021 12:30:59 +0000 (12:30 +0000)]
Nullptr dereference in SpeechRecognition::stop()
https://bugs.webkit.org/show_bug.cgi?id=220869
<rdar://problem/73507085>

Patch by Sihui Liu <sihui_liu@appe.com> on 2021-01-25
Reviewed by Ryosuke Niwa.

Source/WebCore:

It is possible that SpeechRecognition is created with a Document having no frame and ActiveDOMObjects of the
Document are stopped. In this case, SpeechRecognition::stop() will be invoked after a SpeechRecognition, of
which m_connection is nullptr, is constructed.

Test: fast/speechrecognition/detached-iframe.html

* Modules/speech/SpeechRecognition.cpp:
(WebCore::SpeechRecognition::stop):

LayoutTests:

* fast/speechrecognition/detached-iframe-expected.txt: Added.
* fast/speechrecognition/detached-iframe.html: Added.

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

8 months agoAX: iOS: VO: Web: Column Names Not Announced
cfleizach@apple.com [Mon, 25 Jan 2021 12:28:27 +0000 (12:28 +0000)]
AX: iOS: VO: Web: Column Names Not Announced
https://bugs.webkit.org/show_bug.cgi?id=220829
<rdar://problem/73469037>

Reviewed by Zalan Bujtas.

Source/WebCore:

We no longer use containedInTraits, but mean to override the tableAncestor methods.
Those need to account for the three types of tables.

Test: accessibility/ios-simulator/table-ancestory.html

* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _accessibilityTableAncestor]):
(-[WebAccessibilityObjectWrapper _accessibilityTraitsFromAncestors]):

Tools:

* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp:
(WTR::AccessibilityUIElement::isInTable const):
(WTR::AccessibilityUIElement::isInLandmark const):
(WTR::AccessibilityUIElement::isInList const):
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
* WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
* WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
(WTR::AccessibilityUIElement::isInTable const):
(WTR::AccessibilityUIElement::isInLandmark const):
(WTR::AccessibilityUIElement::isInList const):

LayoutTests:

* accessibility/ios-simulator/table-ancestory.html: Added.
* accessibility/ios-simulator/table-ancestory-expected.txt: Added.
* accessibility/ios-simulator/tables-lists.html: Updated.

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

8 months ago[GTK] run-gtk-tests: Use sys.exit(1) instead of return 1
aboya@igalia.com [Mon, 25 Jan 2021 10:23:06 +0000 (10:23 +0000)]
[GTK] run-gtk-tests: Use sys.exit(1) instead of return 1
https://bugs.webkit.org/show_bug.cgi?id=220860

Reviewed by Philippe Normand.

Several parts of the code in api_test_runner.py returned 1 on failure.
While common for main() functions, this is bad in functions that are
expected to return something else than an exit code, and lets the
program run after the error. sys.exit(1) should be used in those cases
instead.

* glib/api_test_runner.py:
(TestRunner._get_tests_from_google_test_suite):
(TestRunner.run_tests):

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

8 months agoscroll-padding should affect paging operations
commit-queue@webkit.org [Mon, 25 Jan 2021 09:45:47 +0000 (09:45 +0000)]
scroll-padding should affect paging operations
https://bugs.webkit.org/show_bug.cgi?id=219074
<rdar://problem/71747786>

Patch by Martin Robinson <mrobinson@igalia.com> on 2021-01-25
Reviewed by Simon Fraser.

Source/WebCore:

Have scroll-padding affect the amount of the scrollable area that moves during
paging operations. This is the behavior specified in the scroll snap specification
and allows scrollable areas with partially obscured areas to properly page through
their content.

See https://drafts.csswg.org/css-scroll-snap-1/#propdef-scroll-padding.

Tests: css3/scroll-snap/scroll-padding-mainframe-paging.html
       css3/scroll-snap/scroll-padding-overflow-paging.html

* page/FrameView.cpp:
(WebCore::FrameView::updateScrollbarSteps): Added this override method which
properly sets page steps. Only FrameView has access to the document.
* page/FrameView.h:
* platform/ScrollView.cpp:
(WebCore::ScrollView::updateScrollbars): Added this helper method, which is
virtual so that FrameView can override it.
(WebCore::ScrollView::updateScrollbarSteps): Use the helper method to actually
set the scrollbar steps.
* platform/ScrollView.h: Add new method declarations.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::scrollPaddingForViewportRect): Add this new helper which
gets the scroll-padding for a box.
* rendering/RenderBox.h: Add new helper.
* rendering/RenderLayer.cpp:
(WebCore::expandScrollRectToVisibleTargetRectToIncludeScrollPadding): Use the new
RenderBox helper.
(WebCore::RenderLayer::updateScrollbarsAfterLayout): Use the new updateScrollbarSteps helper.
(WebCore::RenderLayer::updateScrollbarSteps): Added this helper so that RenderLayerModelObject
can update steps when necessary.
* rendering/RenderLayer.h: Added new declarations.
* rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::styleDidChange): Update steps on FrameViews and RenderLayers
when the style change dictates it.

LayoutTests:

* css3/scroll-snap/scroll-padding-mainframe-paging-expected.txt: Added.
* css3/scroll-snap/scroll-padding-mainframe-paging.html: Added.
* css3/scroll-snap/scroll-padding-overflow-paging-expected.txt: Added.
* css3/scroll-snap/scroll-padding-overflow-paging.html: Added.
* platform/ios-wk2/TestExpectations: Skip failing tests.
* platform/mac-wk1/TestExpectations: Skip failing tests.

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

8 months agoNull Ptr Deref @ WebCore::ReplaceSelectionCommand::doApply
carlosgc@webkit.org [Mon, 25 Jan 2021 08:33:14 +0000 (08:33 +0000)]
Null Ptr Deref @ WebCore::ReplaceSelectionCommand::doApply
https://bugs.webkit.org/show_bug.cgi?id=218493

Reviewed by Youenn Fablet.

Source/WebCore:

Test: editing/execCommand/insert-image-replace-selection-crash.html

* editing/ReplaceSelectionCommand.cpp:
(WebCore::fragmentNeedsColorTransformed): Remove invalid assert.
(WebCore::ReplaceSelectionCommand::doApply): Null check insert position container node before using it.

LayoutTests:

* editing/execCommand/insert-image-replace-selection-crash-expected.txt: Added.
* editing/execCommand/insert-image-replace-selection-crash.html: Added.

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

8 months ago[iOS WK2] theverge.com - rubber band scrolling at the top of the page causes an abrup...
simon.fraser@apple.com [Mon, 25 Jan 2021 00:47:32 +0000 (00:47 +0000)]
[iOS WK2] theverge.com - rubber band scrolling at the top of the page causes an abrupt jump
https://bugs.webkit.org/show_bug.cgi?id=220886
<rdar://71177566>

Reviewed by Sam Weinig.
Source/WebCore:

theverge.com on iOS is a page that has long main thread stalls with forced layouts on a timer
that alter the page height; this caused the post-layout updateScrollbars() called from
FrameView::adjustViewSize() to call scrollToPosition() after adjusting the scroll position
to the allowed range.

If the page laid out while rubberbanding was happening, the current scroll position would
be negative, then clamped to 0, then sent to the UI process as a requested scroll to 0,
triggering the jump to top in the UI process.

There's existing code to prevent this from happening if we know that rubberbanding is
happening; this patch makes isRubberBandInProgress() work for iOS WK2. It does so
by having updateVisibleContentRects() push information about rubberbanding nodes onto
RemoteScrollingCoordinator.

We remove an unnecessary shouldUpdateScrollLayerPositionSynchronously() check in
FrameView::isRubberBandInProgress() - if it's true, then the scrolling coordinator
won't see any rubberbanding nodes anyway.

Test: fast/scrolling/ios/content-size-change-during-rubberband.html

* page/FrameView.cpp:
(WebCore::FrameView::isRubberBandInProgress const):
* page/FrameView.h:
* platform/ScrollView.cpp:
(WebCore::ScrollView::updateScrollbars):

Source/WebKit:

theverge.com on iOS is a page that has long main thread stalls with forced layouts on a timer
that alter the page height; this caused the post-layout updateScrollbars() called from
FrameView::adjustViewSize() to call scrollToPosition() after adjusting the scroll position
to the allowed range.

If the page laid out while rubberbanding was happening, the current scroll position would
be negative, then clamped to 0, then sent to the UI process as a requested scroll to 0,
triggering the jump to top in the UI process.

There's existing code to prevent this from happening if we know that rubberbanding is
happening; this patch makes isRubberBandInProgress() work for iOS WK2. It does so
by having updateVisibleContentRects() push information about rubberbanding nodes onto
RemoteScrollingCoordinator.

We remove an unnecessary shouldUpdateScrollLayerPositionSynchronously() check in
FrameView::isRubberBandInProgress() - if it's true, then the scrolling coordinator
won't see any rubberbanding nodes anyway.

* UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
* WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm:
(WebKit::RemoteScrollingCoordinator::addNodeWithActiveRubberBanding):
(WebKit::RemoteScrollingCoordinator::removeNodeWithActiveRubberBanding):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::updateVisibleContentRects):

Tools:

Add test infrastructure to allow UIScriptController::scrollToOffset() and
UIScriptController::immediateScrollToOffset() to take an options argument with
a 'unconstrained' property, which allows scrolling to unstable offset to simulate
rubberbanding.

* DumpRenderTree/ios/UIScriptControllerIOS.h:
* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::contentOffsetBoundedIfNecessary):
(WTR::UIScriptControllerIOS::scrollToOffset):
(WTR::UIScriptControllerIOS::immediateScrollToOffset):
(WTR::contentOffsetBoundedInValidRange): Deleted.
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.h:
(WTR::UIScriptController::scrollToOffset):
(WTR::UIScriptController::immediateScrollToOffset):
* TestRunnerShared/UIScriptContext/UIScriptControllerShared.cpp:
(WTR::toScrollToOptions):
* WebKitTestRunner/ios/UIScriptControllerIOS.h:
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::contentOffsetBoundedIfNecessary):
(WTR::UIScriptControllerIOS::scrollToOffset):
(WTR::UIScriptControllerIOS::immediateScrollToOffset):
(WTR::contentOffsetBoundedInValidRange): Deleted.

LayoutTests:

Add test infrastructure to allow UIScriptController::scrollToOffset() and
UIScriptController::immediateScrollToOffset() to take an options argument with
a 'unconstrained' property, which allows scrolling to unstable offset to simulate
rubberbanding.

* fast/scrolling/ios/content-size-change-during-rubberband-expected.txt: Added.
* fast/scrolling/ios/content-size-change-during-rubberband.html: Added.
* resources/ui-helper.js:
(window.UIHelper.scrollTo.return.new.Promise.):
(window.UIHelper.scrollTo.return.new.Promise):
(window.UIHelper.scrollTo):
(window.UIHelper.immediateScrollTo):
(window.UIHelper.immediateUnstableScrollTo):

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