WebKit-https.git
6 weeks ago[GLIB] Unreviewed test gardening. Update test expectations after r263734.
dpino@igalia.com [Tue, 30 Jun 2020 09:29:29 +0000 (09:29 +0000)]
[GLIB] Unreviewed test gardening. Update test expectations after r263734.

* platform/glib/TestExpectations:

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

6 weeks agoUnreviewed, reverting r263724.
commit-queue@webkit.org [Tue, 30 Jun 2020 09:26:57 +0000 (09:26 +0000)]
Unreviewed, reverting r263724.
https://bugs.webkit.org/show_bug.cgi?id=213781

Reverted changeset:

"Make _WKWebsiteDataStoreConfiguration SPI for HSTS storage to
replace _WKProcessPoolConfiguration.hstsStorageDirectory"
https://bugs.webkit.org/show_bug.cgi?id=213048
https://trac.webkit.org/changeset/263724

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

6 weeks ago[GTK] Unreviewed test gardening. Update expectations after r263733.
dpino@igalia.com [Tue, 30 Jun 2020 08:20:08 +0000 (08:20 +0000)]
[GTK] Unreviewed test gardening. Update expectations after r263733.

* platform/glib/TestExpectations:
* platform/gtk/TestExpectations:

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

6 weeks agoAdd VP9 WebRTC codec runtime flag
youenn@apple.com [Tue, 30 Jun 2020 07:19:59 +0000 (07:19 +0000)]
Add VP9 WebRTC codec runtime flag
https://bugs.webkit.org/show_bug.cgi?id=213724

Reviewed by Eric Carlson.

Source/ThirdParty/libwebrtc:

Update WebKit binding code to switch on/off VP9 encoder/decoder.
We still use vp9_noop for now, so encoder/decoder is not functional.

* Configurations/libwebrtc.iOS.exp:
* Configurations/libwebrtc.iOSsim.exp:
* Configurations/libwebrtc.mac.exp:
* Configurations/libwebrtc.xcconfig:
* Configurations/libwebrtcpcrtc.xcconfig:
* Source/webrtc/modules/video_coding/codecs/vp9/vp9_noop.cc:
* Source/webrtc/sdk/WebKit/WebKitDecoder.mm:
(webrtc::createWebKitDecoderFactory):
* Source/webrtc/sdk/WebKit/WebKitEncoder.mm:
(webrtc::createWebKitEncoderFactory):
(webrtc::setH264HardwareEncoderAllowed):
(webrtc::isH264HardwareEncoderAllowed):
* Source/webrtc/sdk/WebKit/WebKitUtilities.h:
* Source/webrtc/sdk/WebKit/WebKitUtilities.mm:
* Source/webrtc/sdk/objc/api/video_codec/RTCVideoDecoderVP9.h:
* Source/webrtc/sdk/objc/api/video_codec/RTCVideoEncoderVP9.h:
* Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.h:
* Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.m:
(-[RTCDefaultVideoDecoderFactory initWithH265:vp9:]):
(-[RTCDefaultVideoDecoderFactory supportedCodecs]):
* Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoEncoderFactory.h:
* Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoEncoderFactory.m:
(-[RTCDefaultVideoEncoderFactory initWithH265:vp9:]):
(-[RTCDefaultVideoEncoderFactory supportedCodecs]):
* libwebrtc.xcodeproj/project.pbxproj:

Source/WebCore:

Add binding code to switch on/off VP9 in WebRTC factories based on runtime flag.

Test: webrtc/vp9.html

* page/Page.cpp:
(WebCore::m_shouldRelaxThirdPartyCookieBlocking):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::webRTCVP9CodecEnabled const):
(WebCore::RuntimeEnabledFeatures::setWebRTCVP9CodecEnabled):
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:
* platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
(WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
(WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
* testing/Internals.cpp:
(WebCore::Internals::setWebRTCH265Support):
(WebCore::Internals::setWebRTCVP9Support):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit:

* Shared/WebPreferences.yaml:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

LayoutTests:

* webrtc/h265.html:
* webrtc/vp9-expected.txt: Added.
* webrtc/vp9.html: Added.

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

6 weeks ago[GLIB] Unreviewed test gardening. Add more OffscreenCanvas flaky failures.
dpino@igalia.com [Tue, 30 Jun 2020 07:18:42 +0000 (07:18 +0000)]
[GLIB] Unreviewed test gardening. Add more OffscreenCanvas flaky failures.

* platform/glib/TestExpectations:

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

6 weeks ago[GLIB] Unreviewed test gardening. Move WPE and GTK OffscreenCanvas failures to GLIB.
dpino@igalia.com [Tue, 30 Jun 2020 07:09:28 +0000 (07:09 +0000)]
[GLIB] Unreviewed test gardening. Move WPE and GTK OffscreenCanvas failures to GLIB.

* platform/glib/TestExpectations:
* platform/gtk/TestExpectations:
* platform/wpe/TestExpectations:

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

6 weeks ago[GTK] Unreviewed test gardening. Failures happening in the EWS GTK-WK2 queue.
dpino@igalia.com [Tue, 30 Jun 2020 06:17:28 +0000 (06:17 +0000)]
[GTK] Unreviewed test gardening. Failures happening in the EWS GTK-WK2 queue.

* platform/glib/TestExpectations:
* platform/gtk/TestExpectations:

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

6 weeks ago[GTK] Unreviewed test gardening. Dump JS output of several canvas tests in stderr.
dpino@igalia.com [Tue, 30 Jun 2020 05:59:02 +0000 (05:59 +0000)]
[GTK] Unreviewed test gardening. Dump JS output of several canvas tests in stderr.

* platform/gtk/TestExpectations:

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

6 weeks ago[Web Animations] REGRESSION: Bootstrap Carousel component v4.1 regressed with Web...
graouts@webkit.org [Tue, 30 Jun 2020 05:56:53 +0000 (05:56 +0000)]
[Web Animations] REGRESSION: Bootstrap Carousel component v4.1 regressed with Web Animations
https://bugs.webkit.org/show_bug.cgi?id=213376
<rdar://problem/64531242>

Reviewed by Dean Jackson.

Source/WebCore:

An older version of the Bootstrap CSS and JS library had a rather odd way to implement a completion callback
for a transition: it would register a "transitionend" event but also set a timeout of the transition's duration
and use whichever came first as a callback to run completion tasks for the transition.

Additionally, in that callback, it would set the transitioned value to the same computed value but using a different
specified value, for instance setting the "transform" CSS property to "translateX(0)" instead of "translateY(0)".

In our implementation this would make the completed transition repeat. Indeed, we would first incorrectly assume that
the transition was still "running" and not "finished", per the CSS Transitions spec terminology as we only update
that status when we update animations under Page::updateRendering(). We now update an existing transition's
status first in AnimationTimeline::updateCSSTransitionsForElementAndProperty().

Another issue is that when we considered the existing transition to be running, even though it was finished, we would
use the "timeline time at creation" to compute its current progress, which would yield situations where we computed
the before-change style to be the existing transition's current computed value, except that transition's progress was
0 since the "timeline time at creation" happens before the transition's resolved start time. We now only use the
"timeline time at creation" in the situations it was designed to be used: either when the transition has not yet had
a resolved start time, or its resolved start time is the current timeline time (ie. it was just set).

To be able to compare the transition's resolved start time and the current timeline time, we also updated the internal
start time getter and setter methods to use Seconds instead of double which is only needed for the JS bindings.

Test: webanimations/css-transition-retargeting-to-same-value-upon-completion-with-timeout.html

* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::updateCSSTransitionsForElementAndProperty):
* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::bindingsStartTime const):
(WebCore::DeclarativeAnimation::setBindingsStartTime):
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::bindingsStartTime const):
(WebCore::WebAnimation::setBindingsStartTime):
(WebCore::WebAnimation::setStartTime):
(WebCore::WebAnimation::startTime const): Deleted.
* animation/WebAnimation.h:
(WebCore::WebAnimation::startTime const):
(WebCore::WebAnimation::bindingsStartTime const): Deleted.

LayoutTests:

Add a test that uses a timeout instead of a "transitionend" event to retarget a transition upon completion
to the same computed value but not the same specified value to check that we generate a transition that has
no visual effect.

* webanimations/css-transition-retargeting-to-same-value-upon-completion-with-timeout-expected.txt: Added.
* webanimations/css-transition-retargeting-to-same-value-upon-completion-with-timeout.html: Added.

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

6 weeks agoREGRESSION (r263624): http/tests/quicklook/submit-form-blocked.html fails consistently
wenson_hsieh@apple.com [Tue, 30 Jun 2020 05:55:14 +0000 (05:55 +0000)]
REGRESSION (r263624): http/tests/quicklook/submit-form-blocked.html fails consistently
https://bugs.webkit.org/show_bug.cgi?id=213767
<rdar://problem/64893698>

Reviewed by Tim Horton.

This test loads a Word document (`.docx`) in an iframe, and then taps a JavaScript link in the Word document
that creates a new `form` element and attempts to submit it. The test requires a particular error message to be
logged to the console in order to pass (i.e. "Blocked form submission to '<URL>' because the form's frame is
sandboxed and the 'allow-forms' permission is not set.").

After r263624, this message is no longer logged, because the `form` element created by the Word document's
JavaScript link is disconnected from the DOM, and so we bail immediately in `HTMLFormElement::submit` without
ever getting to the security check.

To fix this and make it exercise what it was originally intended to test, we tweak the JavaScript link contained
within the Word document, such that it additionally appends the newly created form element to the document. This
is the modified (percent-decoded) JavaScript URL:

```
(function() {
    var form = document.createElement("form");
    document.body.appendChild(form);
    form.action = "fail.html";
    form.innerHTML = '<input type="hidden" name="secret" value="webkit">';
    form.submit();
})();
```

This patch simply adds the third line (with the call to `document.body.appendChild`).

* http/tests/quicklook/resources/submit-form-blocked.docx:
* http/tests/quicklook/submit-form-blocked.html:

Make sure we also hit-test to the link in the Word document by making the link much bigger, and adjusting the
touch location offset to match.

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

6 weeks agoJavaScript cannot be injected into iframes
beidson@apple.com [Tue, 30 Jun 2020 05:43:19 +0000 (05:43 +0000)]
JavaScript cannot be injected into iframes
<rdar://problem/54168946> and https://bugs.webkit.org/show_bug.cgi?id=213556

Reviewed by Geoff Garen.
Source/WebCore:

Covered by API tests.

* bindings/js/ExceptionDetails.h: Start a collection of "exception types" that will grow quickly,
  beginning with the specialized "missing frame" type.

Source/WebKit:

This adds a few mechanisms:
- Allows for WKUserScripts to have a target content world
- Allows "evaluateJavaScript" and "callAsyncJavaScript" to target a specific frame
- Allows for the completion handlers of those methods to be able to distinguish
  failure-due-to-missing-frame.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<ExceptionDetails>::encode):
(IPC::ArgumentCoder<ExceptionDetails>::decode):
* Shared/WebCoreArgumentCoders.h:

* UIProcess/API/Cocoa/WKError.h:
* UIProcess/API/Cocoa/WKError.mm:
(localizedDescriptionForErrorCode):

* UIProcess/API/Cocoa/WKUserScript.h:
* UIProcess/API/Cocoa/WKUserScript.mm:
(-[WKUserScript initWithSource:injectionTime:forMainFrameOnly:]):
(-[WKUserScript initWithSource:injectionTime:forMainFrameOnly:inContentWorld:]):
* UIProcess/API/Cocoa/WKWebView.h:

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView evaluateJavaScript:inFrame:inContentWorld:completionHandler:]):
(-[WKWebView callAsyncJavaScript:arguments:inFrame:inContentWorld:completionHandler:]):
(nsErrorFromExceptionDetails):
(-[WKWebView _evaluateJavaScript:asAsyncFunction:withSourceURL:withArguments:forceUserGesture:inFrame:inWorld:completionHandler:]):
(-[WKWebView callAsyncJavaScript:arguments:inContentWorld:completionHandler:]): Deleted.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::runJavaScript):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/AsyncFunction.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitCocoa/UserContentController.mm:
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/WKURLSchemeHandler-1.mm:
* TestWebKitAPI/Tests/WebKitCocoa/WKWebViewEvaluateJavaScript.mm:
(TEST):
(-[FramesMessageHandler userContentController:didReceiveScriptMessage:]):
* TestWebKitAPI/cocoa/TestWKWebView.mm:
(-[WKWebView objectByCallingAsyncFunction:withArguments:error:]):

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

6 weeks agoUnreviewed, rolling out an accidental change from r263723.
ggaren@apple.com [Tue, 30 Jun 2020 05:33:36 +0000 (05:33 +0000)]
Unreviewed, rolling out an accidental change from r263723.

* wtf/cf/RunLoopCF.cpp:
(WTF::RunLoop::TimerBase::timerFired):

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

6 weeks ago[GLIB] Unreviewed test gardening. Update baseline after r263673.
dpino@igalia.com [Tue, 30 Jun 2020 05:10:38 +0000 (05:10 +0000)]
[GLIB] Unreviewed test gardening. Update baseline after r263673.

* platform/glib/accessibility/aria-hidden-negates-no-visibility-expected.txt:

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

6 weeks agoMake _WKWebsiteDataStoreConfiguration SPI for HSTS storage to replace _WKProcessPoolC...
commit-queue@webkit.org [Tue, 30 Jun 2020 04:39:50 +0000 (04:39 +0000)]
Make _WKWebsiteDataStoreConfiguration SPI for HSTS storage to replace _WKProcessPoolConfiguration.hstsStorageDirectory
https://bugs.webkit.org/show_bug.cgi?id=213048

Patch by Alex Christensen <achristensen@webkit.org> on 2020-06-29
Reviewed by Youenn Fablet.

Source/WebCore/PAL:

* pal/spi/cf/CFNetworkSPI.h:

Source/WebKit:

This uses CFNetwork SPI introduced in rdar://problem/50109631 to allow HSTS storage per NSURLSession.
To be complete, I also deprecated our UI process HSTS state removal attempt SPIs, WKContextResetHSTSHosts and
WKContextResetHSTSHostsAddedAfterDate, which had their last use removed in rdar://problem/64220838.

I manually verified that this new SPI puts HSTS data in the specified location, and I also verified that HSTS
state querying and removal works with the new CFNetwork SPI as it did with the old one.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::fetchWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
(WebKit::NetworkProcess::deleteAndRestrictWebsiteDataForRegistrableDomains):
(WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkSessionCreationParameters.cpp:
(WebKit::NetworkSessionCreationParameters::encode const):
(WebKit::NetworkSessionCreationParameters::decode):
* NetworkProcess/NetworkSessionCreationParameters.h:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::hostNamesWithHSTSCache const):
(WebKit::NetworkProcess::deleteHSTSCacheForHostNames):
(WebKit::NetworkProcess::clearHSTSCache):
(WebKit::NetworkProcess::getHostNamesWithHSTSCache): Deleted.
* NetworkProcess/cocoa/NetworkSessionCocoa.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::hstsStorage const):
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
* NetworkProcess/soup/NetworkProcessSoup.cpp:
(WebKit::NetworkProcess::hostNamesWithHSTSCache const):
(WebKit::NetworkProcess::deleteHSTSCacheForHostNames):
(WebKit::NetworkProcess::clearHSTSCache):
(WebKit::NetworkProcess::getHostNamesWithHSTSCache): Deleted.
* UIProcess/API/C/mac/WKContextPrivateMac.h:
* UIProcess/API/C/mac/WKContextPrivateMac.mm:
(WKContextResetHSTSHosts):
(WKContextResetHSTSHostsAddedAfterDate):
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
(-[_WKWebsiteDataStoreConfiguration hstsStorageDirectory]):
(-[_WKWebsiteDataStoreConfiguration setHSTSStorageDirectory:]):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::privateBrowsingSession): Deleted.
(WebKit::WebProcessPool::resetHSTSHosts): Deleted.
(WebKit::WebProcessPool::resetHSTSHostsAddedAfterDate): Deleted.
* UIProcess/WebProcessPool.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
(WebKit::WebsiteDataStore::parameters):
* UIProcess/WebsiteData/WebsiteDataStore.h:
(WebKit::WebsiteDataStore::resolvedHSTSStorageDirectory const):
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
(WebKit::WebsiteDataStoreConfiguration::copy const):
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:

Source/WTF:

* wtf/PlatformHave.h:

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

6 weeks ago[GTK] [Win] Build callOnMainThread on WTF::RunLoop rather than on a timer
ggaren@apple.com [Tue, 30 Jun 2020 04:25:52 +0000 (04:25 +0000)]
[GTK] [Win] Build callOnMainThread on WTF::RunLoop rather than on a timer
https://bugs.webkit.org/show_bug.cgi?id=213694

Reviewed by Carlos Garcia Campos.

As of https://bugs.webkit.org/show_bug.cgi?id=213063, Darwin platforms
use the RunLoop. Let's match them for consistency, and to delete some
code.

* wtf/generic/MainThreadGeneric.cpp:
(WTF::scheduleDispatchFunctionsOnMainThread):
(WTF::MainThreadDispatcher::MainThreadDispatcher): Deleted.
(WTF::MainThreadDispatcher::schedule): Deleted.
(WTF::MainThreadDispatcher::fired): Deleted.
* wtf/glib/RunLoopSourcePriority.h:
* wtf/win/MainThreadWin.cpp:
(WTF::initializeMainThreadPlatform):
(WTF::scheduleDispatchFunctionsOnMainThread):
(WTF::ThreadingWindowWndProc): Deleted.

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

6 weeks agoConvert AppCache manifest parser over to using StringParsingBuffer
weinig@apple.com [Tue, 30 Jun 2020 03:52:16 +0000 (03:52 +0000)]
Convert AppCache manifest parser over to using StringParsingBuffer
https://bugs.webkit.org/show_bug.cgi?id=213680

Reviewed by Darin Adler.

- Renames parseManifest to parseApplicationCacheManifest to differentiate between the manifest
  for the application cache and the "application manifest", which is a different thing entirely.
  Also renames the container struct from being called Manifest to ApplicationCacheManifest.
  (The file should be renamed as well, but will do that in a seperate pass).
- Update parser to return an Optional<ApplicationCacheManifest> rather than using bool + out
  parameter.
- Adopt readCharactersForParsing to replace unnecessary call to StringView::upconvertedCharacters().
- Adopt StringParsingBuffer and ParsingUtilities along with some refinements to the code
  to make the intent more clear.

* html/parser/ParsingUtilities.h:
(WebCore::skipUntil):
Fix formatting, putting the whole signature on one line.

* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::didFinishLoadingManifest):
Update for new parser function name and Optional return type.

* loader/appcache/ManifestParser.cpp:
(WebCore::isManifestWhitespace):
(WebCore::isManifestNewline):
(WebCore::isManifestWhitespaceOrNewline):
(WebCore::makeManifestURL):
(WebCore::parseApplicationCacheManifest):
* loader/appcache/ManifestParser.h:
Update parsing logic to use readCharactersForParsing (to avoid upconvesion) and rework
using StringParsingBuffer/ParsingUtilities to make things more clear.

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

6 weeks agoAdopt adjusted symbol image names
timothy_horton@apple.com [Tue, 30 Jun 2020 03:35:59 +0000 (03:35 +0000)]
Adopt adjusted symbol image names
https://bugs.webkit.org/show_bug.cgi?id=213768
<rdar://problem/64472257>

Reviewed by Andy Estes.

* UIProcess/API/Cocoa/_WKElementAction.mm:
(+[_WKElementAction imageForElementActionType:]):

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

6 weeks ago[LFC][TFC] Adjust baseline when the table cell itself establishes an IFC
zalan@apple.com [Tue, 30 Jun 2020 03:04:28 +0000 (03:04 +0000)]
[LFC][TFC] Adjust baseline when the table cell itself establishes an IFC
https://bugs.webkit.org/show_bug.cgi?id=213735

Reviewed by Antti Koivisto.

Source/WebCore:

Test: fast/layoutformattingcontext/table-cell-baseline-offset-simple2.html

* layout/tableformatting/TableFormattingContextGeometry.cpp:
(WebCore::Layout::TableFormattingContext::Geometry::usedBaselineForCell):

LayoutTests:

* fast/layoutformattingcontext/table-cell-baseline-offset-simple2-expected.html: Added.
* fast/layoutformattingcontext/table-cell-baseline-offset-simple2.html: Added.

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

6 weeks ago[LFC][TFC] Adjust baseline offset for continuation
zalan@apple.com [Tue, 30 Jun 2020 02:32:54 +0000 (02:32 +0000)]
[LFC][TFC] Adjust baseline offset for continuation
https://bugs.webkit.org/show_bug.cgi?id=213732

Reviewed by Antti Koivisto.

Source/WebCore:

Skip empty IFC generated for the "pre" part of the continuation (e.g. <span><div>text content</div></span>).

Test: fast/layoutformattingcontext/table-cell-baseline-offset-simple.html

* layout/tableformatting/TableFormattingContextGeometry.cpp:
(WebCore::Layout::TableFormattingContext::Geometry::usedBaselineForCell):

LayoutTests:

* fast/layoutformattingcontext/table-cell-baseline-offset-simple-expected.html: Added.
* fast/layoutformattingcontext/table-cell-baseline-offset-simple.html: Added.

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

6 weeks agoAdding Experimental Feature Flags for CoreImage backed SVG/CSS Filters
commit-queue@webkit.org [Tue, 30 Jun 2020 01:59:29 +0000 (01:59 +0000)]
Adding Experimental Feature Flags for CoreImage backed SVG/CSS Filters
https://bugs.webkit.org/show_bug.cgi?id=213578

Patch by Guowei Yang <guowei_yang@apple.com> on 2020-06-29
.:

Reviewed by Darin Adler, Simon Fraser, Myles C. Maxfield.

Preparing to implement CoreImage backed filter rendering
Needs Compiler guards and experimental feature guard.

* Source/cmake/WebKitFeatures.cmake: added definition of
  CoreImage-accelerated filter rendering feature flag,
  ENABLE_CORE_IMAGE_ACCELERATED_FILTER_RENDER

Source/WebCore:

Reviewed by Darin Adler, Simon Fraser, Myles C. Maxfield.

Preparing to implement CoreImage backed filter rendering
Needs Compiler guards and experimental feature guard.

No tests are required because this is just a feature flag set up

* page/Settings.yaml: added default settings for the feature flag.
  Default value of the feature switch is off

Source/WebKit:

Reviewed by Darin Adler, Simon Fraser, Myles C. Maxfield.

Preparing to implement CoreImage backed filter rendering
Needs Compiler guards and experimental feature guard.

* Shared/WebPreferences.yaml: added feature flag definition

Source/WTF:

Reviewed by Darin Adler, Simon Fraser, Myles C. Maxfield.

Preparing to implement CoreImage backed filter rendering
Needs Compiler guards and experimental feature guard.

* wtf/PlatformEnableCocoa.h: Added definition of a feature flag,
  ENABLE_CORE_IMAGE_ACCELERATED_FILTER_RENDER
* wtf/PlatformUse.h:  Added compiler guard #define USE_CORE_IMAGE 1
  to indicate whether CoreImage code is visible to the compiler

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

6 weeks agoFix build when !ENABLE(ACCESSIBILITY) after r263673
stephan.szabo@sony.com [Tue, 30 Jun 2020 01:49:46 +0000 (01:49 +0000)]
Fix build when !ENABLE(ACCESSIBILITY) after r263673
https://bugs.webkit.org/show_bug.cgi?id=213759

Reviewed by Chris Fleizach.

No new tests, build fix.

* accessibility/AXObjectCache.h:

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

6 weeks ago[TestExpectations] Remove --csv option
jbedard@apple.com [Tue, 30 Jun 2020 01:33:14 +0000 (01:33 +0000)]
[TestExpectations] Remove --csv option
https://bugs.webkit.org/show_bug.cgi?id=213762
<rdar://problem/64913762>

Reviewed by Alexey Proskuryakov.

* Scripts/webkitpy/layout_tests/models/test_expectations.py:
(TestExpectationLine.to_csv): Deleted.
* Scripts/webkitpy/tool/commands/queries.py:
(PrintExpectations.__init__): Remove --csv option.
(PrintExpectations._format_lines): Ditto.
(PrintBaselines.__init__): Ditto.
(PrintBaselines.execute): Ditto.
(PrintBaselines._print_baselines): Ditto.
* Scripts/webkitpy/tool/commands/queries_unittest.py:
(PrintExpectationsTest.run_test):
(PrintExpectationsTest.test_include):
(PrintBaselinesTest.test_basic):
(PrintBaselinesTest.test_multiple):
(PrintExpectationsTest.test_csv): Deleted.
(PrintBaselinesTest.test_csv): Deleted.

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

6 weeks agoSimplify Color's interface by removing isDark()
weinig@apple.com [Tue, 30 Jun 2020 01:32:01 +0000 (01:32 +0000)]
Simplify Color's interface by removing isDark()
https://bugs.webkit.org/show_bug.cgi?id=213707

Reviewed by Darin Adler.

- Move Color::isDark to RenderThemeIOS.mm, its one client and rename it
  to useConvexGradient() to indicate what it is actually determining.

* platform/graphics/Color.cpp:
(WebCore::Color::isDark const): Deleted.
* platform/graphics/Color.h:
* rendering/RenderThemeIOS.mm:
(WebCore::useConvexGradient):
(WebCore::RenderThemeIOS::paintPushButtonDecorations):
(WebCore::RenderThemeIOS::paintFileUploadIconDecorations):

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

6 weeks agoNew API benchmark
tzagallo@apple.com [Tue, 30 Jun 2020 01:12:31 +0000 (01:12 +0000)]
New API benchmark
https://bugs.webkit.org/show_bug.cgi?id=213750

Reviewed by Saam Barati.

APIBench is a new benchmark suite to measure the performance of the JavaScriptCore API. It has 4 benchmarks:
- RichardsJS: This is imported from Octane and used as a reference so we know how fast the pure JS implementation runs.
- RichardsSwift: a Swift port of the benchmark, also used as reference for how fast the pure Swift implementation is.
- RichardsMostlyJS: As the name suggests, mostly the same the as the JS benchmark, but here the WorkerTask
  is implemented in Swift. The API is used to write to the packet being processed and talking to the scheduler.
- RichardsMostlySwift: inverse of the above. Mostly the same code from the Swift benchark, but here the WorkerTask is
  implemented in JavaScript. The API is used to run the JS version of the task and marshaling the Packet by using JSExport.

The benchmark can be built and run using the api-bench script, as following:

PerformanceTests/APIBench/api-bench WebKitBuild/Release

By default, it will build each of the benchmarks and run 5 iterations.
The score is calculated as 5000 / geomean([avg of RichardsMostlySwift, avg of RichardsMostlyJS]).
The script prints the average for the references and tests and the final score:

Results for /Volumes/Data/wk2/OpenSource/WebKitBuild/Release (5 iterations)
================================================================================

References:
----------------------------------------
RichardsJS: 14ms
RichardsSwift: 29ms

Tests:
----------------------------------------
RichardsMostlyJS: 218ms
RichardsMostlySwift: 315ms

Score: 19.0804

* APIBench/RichardsJS/RichardsJS.js: Added.
(runRichards):
(Scheduler):
(Scheduler.prototype.addIdleTask):
(Scheduler.prototype.addWorkerTask):
(Scheduler.prototype.addHandlerTask):
(Scheduler.prototype.addDeviceTask):
(Scheduler.prototype.addRunningTask):
(Scheduler.prototype.addTask):
(Scheduler.prototype.schedule):
(Scheduler.prototype.release):
(Scheduler.prototype.holdCurrent):
(Scheduler.prototype.suspendCurrent):
(Scheduler.prototype.queue):
(TaskControlBlock):
(TaskControlBlock.prototype.setRunning):
(TaskControlBlock.prototype.markAsNotHeld):
(TaskControlBlock.prototype.markAsHeld):
(TaskControlBlock.prototype.isHeldOrSuspended):
(TaskControlBlock.prototype.markAsSuspended):
(TaskControlBlock.prototype.markAsRunnable):
(TaskControlBlock.prototype.run):
(TaskControlBlock.prototype.checkPriorityAdd):
(TaskControlBlock.prototype.toString):
(IdleTask):
(IdleTask.prototype.run):
(IdleTask.prototype.toString):
(DeviceTask):
(DeviceTask.prototype.run):
(DeviceTask.prototype.toString):
(WorkerTask):
(WorkerTask.prototype.run):
(WorkerTask.prototype.toString):
(HandlerTask):
(HandlerTask.prototype.run):
(HandlerTask.prototype.toString):
(Packet):
(Packet.prototype.addTo):
(Packet.prototype.toString):
* APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/project.pbxproj: Added.
* APIBench/RichardsMostlyJS/RichardsMostlyJS.xcodeproj/xcshareddata/xcschemes/RichardsMostlyJS.xcscheme: Added.
* APIBench/RichardsMostlyJS/RichardsMostlyJS/main.swift: Added.
(run(_:)):
(toString):
(WorkerTask.toString):
(WorkerTask.run(_:)):
* APIBench/RichardsMostlyJS/RichardsMostlyJS/richards.js: Added.
(runRichards):
(Scheduler):
(Scheduler.prototype.addIdleTask):
(Scheduler.prototype.addWorkerTask):
(Scheduler.prototype.addHandlerTask):
(Scheduler.prototype.addDeviceTask):
(Scheduler.prototype.addRunningTask):
(Scheduler.prototype.addTask):
(Scheduler.prototype.schedule):
(Scheduler.prototype.release):
(Scheduler.prototype.holdCurrent):
(Scheduler.prototype.suspendCurrent):
(Scheduler.prototype.queue):
(TaskControlBlock):
(TaskControlBlock.prototype.setRunning):
(TaskControlBlock.prototype.markAsNotHeld):
(TaskControlBlock.prototype.markAsHeld):
(TaskControlBlock.prototype.isHeldOrSuspended):
(TaskControlBlock.prototype.markAsSuspended):
(TaskControlBlock.prototype.markAsRunnable):
(TaskControlBlock.prototype.run):
(TaskControlBlock.prototype.checkPriorityAdd):
(TaskControlBlock.prototype.toString):
(IdleTask):
(IdleTask.prototype.run):
(IdleTask.prototype.toString):
(DeviceTask):
(DeviceTask.prototype.run):
(DeviceTask.prototype.toString):
(HandlerTask):
(HandlerTask.prototype.run):
(HandlerTask.prototype.toString):
(Packet):
(Packet.prototype.addTo):
(Packet.prototype.toString):
* APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj: Added.
* APIBench/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme: Added.
* APIBench/RichardsMostlySwift/RichardsMostlySwift/DeviceTask.swift: Added.
(DeviceTask.create(_:device:priority:)):
(DeviceTask.run(_:)):
* APIBench/RichardsMostlySwift/RichardsMostlySwift/HandlerTask.swift: Added.
(HandlerTask.device):
(HandlerTask.create(_:device:priority:queue:)):
(HandlerTask.run(_:)):
* APIBench/RichardsMostlySwift/RichardsMostlySwift/IdleTask.swift: Added.
(IdleTask.create(_:priority:)):
(IdleTask.run(_:)):
* APIBench/RichardsMostlySwift/RichardsMostlySwift/Packet.swift: Added.
(Packet.addTo(_:)):
* APIBench/RichardsMostlySwift/RichardsMostlySwift/Scheduler.swift: Added.
(waitCurrent):
(handle(_:)):
(Scheduler.schedule):
(Scheduler.add(_:)):
(Scheduler.release_(_:)):
(holdCurrent):
(queue(_:)):
(queueImpl(_:packet:)):
* APIBench/RichardsMostlySwift/RichardsMostlySwift/Task.swift: Added.
(Task.run(_:)):
(Task.release_):
(Task.hold):
(Task.wait):
(Task.resume):
(Task.takePacket):
(Task.checkPriorityAdd(_:packet:)):
* APIBench/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift: Added.
(WorkerTask.create(_:priority:queue:)):
(WorkerTask.run(_:)):
* APIBench/RichardsMostlySwift/RichardsMostlySwift/main.swift: Added.
* APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.js: Added.
(return.prototype.run):
* APIBench/RichardsMostlySwift/RichardsMostlySwift/richards.swift: Added.
(runRichards):
* APIBench/RichardsSwift/RichardsSwift.xcodeproj/project.pbxproj: Added.
* APIBench/RichardsSwift/RichardsSwift.xcodeproj/xcshareddata/xcschemes/RichardsSwift.xcscheme: Added.
* APIBench/RichardsSwift/RichardsSwift/DeviceTask.swift: Added.
(DeviceTask.create(_:device:priority:)):
(DeviceTask.run(_:)):
* APIBench/RichardsSwift/RichardsSwift/HandlerTask.swift: Added.
(HandlerTask.device):
(HandlerTask.create(_:device:priority:queue:)):
(HandlerTask.run(_:)):
* APIBench/RichardsSwift/RichardsSwift/IdleTask.swift: Added.
(IdleTask.create(_:priority:)):
(IdleTask.run(_:)):
* APIBench/RichardsSwift/RichardsSwift/Packet.swift: Added.
(Packet.addTo(_:)):
* APIBench/RichardsSwift/RichardsSwift/Scheduler.swift: Added.
(Scheduler.schedule):
(Scheduler.add(_:)):
(Scheduler.release(_:)):
(holdCurrent):
(waitCurrent):
(queue(_:)):
(handle(_:)):
(queueImpl(_:packet:)):
* APIBench/RichardsSwift/RichardsSwift/Task.swift: Added.
(Task.run(_:)):
(Task.release):
(Task.hold):
(Task.wait):
(Task.resume):
(Task.takePacket):
(Task.checkPriorityAdd(_:packet:)):
* APIBench/RichardsSwift/RichardsSwift/WorkerTask.swift: Added.
(WorkerTask.create(_:priority:queue:)):
(WorkerTask.run(_:)):
* APIBench/RichardsSwift/RichardsSwift/main.swift: Added.
* APIBench/RichardsSwift/RichardsSwift/richards.swift: Added.
(runRichards):
* APIBench/api-bench: Added.

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

6 weeks agoRemove expectation for imported/w3c/web-platform-tests/css/css-ui/text-overflow-005...
commit-queue@webkit.org [Tue, 30 Jun 2020 01:06:25 +0000 (01:06 +0000)]
Remove expectation for imported/w3c/web-platform-tests/css/css-ui/text-overflow-005.html as it is passing.
https://bugs.webkit.org/show_bug.cgi?id=175290

Unreviewed test gardening.

Patch by Karl Rackler <rackler@apple.com> on 2020-06-29

* TestExpectations:

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

6 weeks agoRemove expectation for svg/batik/text/textEffect3.svg as they are passing.
commit-queue@webkit.org [Tue, 30 Jun 2020 00:55:23 +0000 (00:55 +0000)]
Remove expectation for svg/batik/text/textEffect3.svg as they are passing.
https://bugs.webkit.org/show_bug.cgi?id=213760

Unreviewed test gardening.

Patch by Karl Rackler <rackler@apple.com> on 2020-06-29

* platform/mac/TestExpectations:

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

6 weeks ago[iOS 14] A couple of tests in editing/selection/ios fail after <rdar://problem/60978283>
wenson_hsieh@apple.com [Mon, 29 Jun 2020 23:58:59 +0000 (23:58 +0000)]
[iOS 14] A couple of tests in editing/selection/ios fail after <rdar://problem/60978283>
https://bugs.webkit.org/show_bug.cgi?id=213746
More work towards <rdar://problem/64808138>

Reviewed by Devin Rousso.

The UIKit change in <rdar://problem/60978283> adjusts text interaction behaviors such that a long press gesture
while editing makes a new caret selection, rather than a new word-granularity selection. Tweak a couple of
layout tests in editing/selection/ios that currently assume that long presses while editing will select a word.

* editing/selection/ios/select-text-in-existing-selection-expected.txt:
* editing/selection/ios/select-text-in-existing-selection.html:

This test verifies that the selection can be changed by making a long press inside an existing selection.
However, it now fails after the changes in <rdar://problem/60978283> because it expects the selected text to be
"jumped", but instead, the selection ends up being a caret inside the word "jumped". Tweak this test to verify
that the selection anchors' common ancestor node is the text node with the text "jumped" instead, to handle both
possibilities (where a long press selects a word vs. sets a caret selection).

* editing/selection/ios/selection-extends-into-overflow-area.html:

This test verifies the position and size of a ranged selection made inside content that visibly overflows its
parent container. It now fails because it tries to long press the word to make a selection; instead, use a
double tap gesture to make the word selection.

* resources/ui-helper.js:
(window.UIHelper.doubleTapElement):

Add a new helper method that double taps in the middle of the given element.

(window.UIHelper.callFunctionAndWaitForEvent):

Adjust this helper method to wait for the given function to resolve, if the given function returns a Promise.

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

6 weeks agoVideo spills over PiP screen a little when using Picture in Picture
peng.liu6@apple.com [Mon, 29 Jun 2020 23:32:18 +0000 (23:32 +0000)]
Video spills over PiP screen a little when using Picture in Picture
https://bugs.webkit.org/show_bug.cgi?id=213658

Reviewed by Eric Carlson.

Source/WebCore:

We need to provide video content dimensions instead of video element sizes to
AVPlayerController to make sure that the Picture-in-Picture window will have
the correct aspect ratio.

Test: media/picture-in-picture/picture-in-picture-window-aspect-ratio.html

* platform/ios/VideoFullscreenInterfaceAVKit.h:
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(VideoFullscreenInterfaceAVKit::setupFullscreen):
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(VideoFullscreenControllerContext::setUpFullscreen):

Source/WebKit:

Add the video content dimensions to the IPC message VideoFullscreenManagerProxy::SetupFullscreenWithID.

* UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
* UIProcess/Cocoa/VideoFullscreenManagerProxy.messages.in:
* UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
(WebKit::VideoFullscreenManagerProxy::setupFullscreenWithID):
(WebKit::VideoFullscreenManagerProxy::setVideoDimensions):
(WebKit::VideoFullscreenManagerProxy::enterFullscreen):
* WebProcess/cocoa/VideoFullscreenManager.mm:
(WebKit::VideoFullscreenManager::enterVideoFullscreenForVideoElement):

LayoutTests:

* media/picture-in-picture/picture-in-picture-window-aspect-ratio-expected.txt: Added.
* media/picture-in-picture/picture-in-picture-window-aspect-ratio.html: Added.

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

6 weeks agoRemove expectation for svg/W3C-SVG-1.1/fonts-elem-01-t.svg and svg/W3C-SVG-1.1/fonts...
commit-queue@webkit.org [Mon, 29 Jun 2020 23:31:45 +0000 (23:31 +0000)]
Remove expectation for svg/W3C-SVG-1.1/fonts-elem-01-t.svg and svg/W3C-SVG-1.1/fonts-elem-02-t.svg and svg/W3C-SVG-1.1/fonts-elem-03-b.svg and svg/W3C-SVG-1.1/fonts-elem-07-b.svg as they are passing.
https://bugs.webkit.org/show_bug.cgi?id=188729

Unreviewed test gardening.

Patch by Karl Rackler <rackler@apple.com> on 2020-06-29

* platform/mac/TestExpectations:

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

6 weeks agoUnreviewed, reverting r262004.
cdumez@apple.com [Mon, 29 Jun 2020 22:55:51 +0000 (22:55 +0000)]
Unreviewed, reverting r262004.
<rdar://problem/64540215>

Revert r262004 as it is not OK to have a data vault in
TMPDIR.

Reverted changeset:

"[WK2] WebKit abandons compiled sandbox profiles"
https://bugs.webkit.org/show_bug.cgi?id=212177
https://trac.webkit.org/changeset/262004

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

6 weeks agoRemove expectation for media/media-source/media-source-abort-resets-parser.html as...
commit-queue@webkit.org [Mon, 29 Jun 2020 22:47:53 +0000 (22:47 +0000)]
Remove expectation for media/media-source/media-source-abort-resets-parser.html as it is passing.
https://bugs.webkit.org/show_bug.cgi?id=213755

Unreviewed test gardening.

Patch by Karl Rackler <rackler@apple.com> on 2020-06-29

* platform/mac/TestExpectations:

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

6 weeks ago[iOS] webanimations/accelerated-animation-with-easing.html is a flaky failure
ryanhaddad@apple.com [Mon, 29 Jun 2020 22:42:55 +0000 (22:42 +0000)]
[iOS] webanimations/accelerated-animation-with-easing.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=213758

Unreviewed test gardening.

* platform/ios/TestExpectations: Mark test as flaky to speed up EWS.

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

6 weeks agoRemove ENABLE_STREAMS_API compilation flag
commit-queue@webkit.org [Mon, 29 Jun 2020 22:40:20 +0000 (22:40 +0000)]
Remove ENABLE_STREAMS_API compilation flag
https://bugs.webkit.org/show_bug.cgi?id=213728

Patch by Tetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com> on 2020-06-29
Reviewed by Sam Weinig.

.:

* Source/cmake/OptionsFTW.cmake:
* Source/cmake/OptionsMac.cmake:
* Source/cmake/OptionsWin.cmake:
* Source/cmake/WebKitFeatures.cmake:
* Source/cmake/tools/vsprops/FeatureDefines.props:

Source/JavaScriptCore:

test cases under Scripts/tests/builtins/ does not uses
this removed compilation flag. So we don't have to touch them in this change.

But they are confusable so I plan to fix them in bug 213733.

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:
* Modules/fetch/FetchBody.cpp:
* Modules/fetch/FetchBody.h:
* Modules/fetch/FetchBodyOwner.cpp:
(WebCore::FetchBodyOwner::isDisturbed const):
(WebCore::FetchBodyOwner::isDisturbedOrLocked const):
(WebCore::FetchBodyOwner::blobLoadingSucceeded):
(WebCore::FetchBodyOwner::blobLoadingFailed):
(WebCore::FetchBodyOwner::blobChunk):
* Modules/fetch/FetchBodyOwner.h:
(WebCore::FetchBodyOwner::cancel):
* Modules/fetch/FetchBodySource.cpp:
* Modules/fetch/FetchBodySource.h:
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::BodyLoader::didSucceed):
(WebCore::FetchResponse::BodyLoader::didFail):
(WebCore::FetchResponse::BodyLoader::didReceiveData):
* Modules/fetch/FetchResponse.h:
* Modules/streams/ByteLengthQueuingStrategy.idl:
* Modules/streams/ByteLengthQueuingStrategy.js:
* Modules/streams/CountQueuingStrategy.idl:
* Modules/streams/CountQueuingStrategy.js:
* Modules/streams/ReadableByteStreamController.idl:
* Modules/streams/ReadableByteStreamController.js:
* Modules/streams/ReadableByteStreamInternals.js:
* Modules/streams/ReadableStream.idl:
* Modules/streams/ReadableStream.js:
* Modules/streams/ReadableStreamBYOBReader.idl:
* Modules/streams/ReadableStreamBYOBReader.js:
* Modules/streams/ReadableStreamBYOBRequest.idl:
* Modules/streams/ReadableStreamBYOBRequest.js:
* Modules/streams/ReadableStreamDefaultController.idl:
* Modules/streams/ReadableStreamDefaultController.js:
* Modules/streams/ReadableStreamDefaultReader.idl:
* Modules/streams/ReadableStreamDefaultReader.js:
* Modules/streams/ReadableStreamInternals.js:
* Modules/streams/ReadableStreamSink.cpp:
* Modules/streams/ReadableStreamSink.h:
* Modules/streams/ReadableStreamSink.idl:
* Modules/streams/ReadableStreamSource.cpp:
* Modules/streams/ReadableStreamSource.h:
* Modules/streams/ReadableStreamSource.idl:
* Modules/streams/StreamInternals.js:
* Modules/streams/WritableStream.idl:
* Modules/streams/WritableStream.js:
* Modules/streams/WritableStreamInternals.js:
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::isReadableByteStreamAPIEnabled):
(WebCore::JSDOMGlobalObject::addBuiltinGlobals):
* bindings/js/JSReadableStreamSourceCustom.cpp:
* bindings/js/ReadableStreamDefaultController.cpp:
* bindings/js/ReadableStreamDefaultController.h:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::writableStreamAPIEnabled const):
* testing/Internals.cpp:
* testing/Internals.h:
* testing/Internals.idl:

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

* Configurations/FeatureDefines.xcconfig:
* Shared/WebPreferences.yaml:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WTF:

* wtf/PlatformEnable.h:

Tools:

* Scripts/webkitperl/FeatureList.pm:
* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

6 weeks ago[iOS] Temporarily open up sandbox for mapping of Launch Services database
pvollan@apple.com [Mon, 29 Jun 2020 22:31:15 +0000 (22:31 +0000)]
[iOS] Temporarily open up sandbox for mapping of Launch Services database
https://bugs.webkit.org/show_bug.cgi?id=213756
<rdar://problem/64707000>

Reviewed by Brent Fulgham.

Address review comments.

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

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

6 weeks ago[iOS] Temporarily open up sandbox for mapping of Launch Services database
pvollan@apple.com [Mon, 29 Jun 2020 22:25:04 +0000 (22:25 +0000)]
[iOS] Temporarily open up sandbox for mapping of Launch Services database
https://bugs.webkit.org/show_bug.cgi?id=213756
<rdar://problem/64707000>

Reviewed by Brent Fulgham.

Temporarily open up sandbox for mapping of Launch Services database in the WebContent process on iOS.
This is just a short term fix, and access to the service will be closed again soon.

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

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

6 weeks agoRemove expectation for media/fullscreen-api-enabled-media-with-presentation-mode...
commit-queue@webkit.org [Mon, 29 Jun 2020 21:42:06 +0000 (21:42 +0000)]
Remove expectation for media/fullscreen-api-enabled-media-with-presentation-mode.html as they are passing.
https://bugs.webkit.org/show_bug.cgi?id=172998

Unreviewed test gardening.

Patch by Karl Rackler <rackler@apple.com> on 2020-06-29

* platform/mac-wk2/TestExpectations:

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

6 weeks agoUnreviewed, rebaseline messages.py tests.
cdumez@apple.com [Mon, 29 Jun 2020 21:41:09 +0000 (21:41 +0000)]
Unreviewed, rebaseline messages.py tests.

* Scripts/MessageNames.cpp:
(IPC::description):
(IPC::receiverName):
(IPC::isValidMessageName):
* Scripts/MessageNames.h:
(WTF::isValidEnum):
* Scripts/test-superclassMessagesReplies.h:

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

6 weeks agoCrash in NetworkProcessProxy::getNetworkProcessConnection() lambda due to missing...
ddkilzer@apple.com [Mon, 29 Jun 2020 21:39:07 +0000 (21:39 +0000)]
Crash in NetworkProcessProxy::getNetworkProcessConnection() lambda due to missing Optional<> value check
<https://webkit.org/b/213700>
<rdar://problem/64852903>

Reviewed by Darin Adler.

* UIProcess/GPU/GPUProcessProxy.cpp:
(WebKit::GPUProcessProxy::getGPUProcessConnection):
- Rename `connectionIdentifier` to `identifier`.
- Return early from the lamba if `identifier` does not contain a
  value.
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::getNetworkProcessConnection):
- Ditto.

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

6 weeks ago[iOS] editing/selection/ios/select-text-after-changing-focus.html sometimes fails
wenson_hsieh@apple.com [Mon, 29 Jun 2020 21:26:11 +0000 (21:26 +0000)]
[iOS] editing/selection/ios/select-text-after-changing-focus.html sometimes fails
https://bugs.webkit.org/show_bug.cgi?id=213745
Work towards <rdar://problem/64808138>

Reviewed by Tim Horton.

Source/WebKit:

This test first taps an input field to focus it, taps a button below the input field to focus the button and
dismiss the keyboard, and finally long presses to select a word below the button. On recent iOS 14 builds, this
test occasionally fails due to recent changes in UIKit that may cause the callout bar appearance callback to
fire after focusing the input field. If this happens, we end up showing the callout bar with a single option to
"Select All" (despite the field being empty), and the subsequent tap that's intended to hit the button instead
hit-tests to this callout bar item. The tests subsequently times out waiting for the keyboard to dismiss, which
never happens because the input field remains focused.

Showing the "Select All" callout bar option in empty text fields is inconsistent with the rest of the platform
(iOS), and appears to have been unintentionally introduced in iOS 12 by <https://trac.webkit.org/r231726>. While
it's still unknown which exact system changes caused this test to begin timing out, we can at least fix it by
addressing this existing regression in behavior.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView canPerformActionForWebView:withSender:]):

Check `-hasContent` here, instead of just checking if the selection is a caret. Note that we don't need to check
whether the selection is none separately, since `-hasContent` will always return `NO` if there is no selection.

Tools:

See WebKit/ChangeLog for more details. If this test happens to be run after another test that has written
something to the pasteboard, it will still fail due to the callout menu showing up with the option to paste.
Mitigate this by clearing the contents of the system pasteboard between tests, such that content copied from
previous tests doesn't change the behavior of subsequent tests.

* WebKitTestRunner/ios/TestControllerIOS.mm:
(WTR::TestController::platformResetStateToConsistentValues):

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

6 weeks agoRemove expectation for imported/w3c/web-platform-tests/html/semantics/forms/the-form...
commit-queue@webkit.org [Mon, 29 Jun 2020 20:51:23 +0000 (20:51 +0000)]
Remove expectation for imported/w3c/web-platform-tests/html/semantics/forms/the-form-element/form-elements-filter.html as it is passing.
https://bugs.webkit.org/show_bug.cgi?id=177319

Unreviewed test gardening.

Patch by Karl Rackler <rackler@apple.com> on 2020-06-29

* platform/mac/TestExpectations:

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

6 weeks agoRemove expectation for imported/w3c/web-platform-tests/webrtc/getstats.html as it...
commit-queue@webkit.org [Mon, 29 Jun 2020 20:48:02 +0000 (20:48 +0000)]
Remove expectation for imported/w3c/web-platform-tests/webrtc/getstats.html as it is passing.
https://bugs.webkit.org/show_bug.cgi?id=172521

Unreviewed test gardening.

Patch by Karl Rackler <rackler@apple.com> on 2020-06-29

* TestExpectations:

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

6 weeks agoRemove remaining makeSimpleColorFrom* variants
weinig@apple.com [Mon, 29 Jun 2020 20:31:18 +0000 (20:31 +0000)]
Remove remaining makeSimpleColorFrom* variants
https://bugs.webkit.org/show_bug.cgi?id=213706

Reviewed by Darin Adler.

Source/WebCore:

Removed makeSimpleColorFromFloats and makeSimpleColorFromCMYKA.
- Updated callers that need to pass floats to use makeSimpleColor(SRGBA { ... });
- Updated callers that don't need to pass floats, mostly compile time constant
  SimpleColors to use makeSimpleColor(...), passing in 0-255 based component
  values.
- Updated callers of makeSimpleColorFromCMYKA to use makeSimpleColor(toSRGBA(CMYKA { ... })).
  This required adding CMYKA type to ColorTypes.h and moving conversion SRGBA to
  ColorUtilities with the other color conversion code.
- Added deduction guides for color types to allow component type deduction. This allows
  us to write:

       function(SRGBA { redFloat, greenFloat, blueFloat, alphaFloat })

  reather than the more cumbersome:

       function(SRGBA<float> { redFloat, greenFloat, blueFloat, alphaFloat })

- Added operator==/operator!= for each color type. Only used by CMYKA at the moment,
  but generally useful, so added for all of them. For all types convertable to ColorComponents,
  the implementation uses the conversion to ColorComponents to avoid redundancy.

* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::setStrokeColor):
(WebCore::CanvasRenderingContext2DBase::setFillColor):
Update to call new typed color based CanvasStyle functions.
(WebCore::CanvasRenderingContext2DBase::setShadow):
Use makeSimpleColor rather than makeSimpleColorFromFloats/makeSimpleColorFromCMYKA.

* html/canvas/CanvasStyle.cpp:
(WebCore::CanvasStyle::CanvasStyle):
Replace constructors taking raw floats with ones taking typed colors (SRGBA<float>/CMYKA<float>)
to make it more clear what the parameters mean.
(WebCore::CanvasStyle::isEquivalentColor const):
Compare the cmyka components using new operator== implementation for CMYKA<float>.
(WebCore::CanvasStyle::isEquivalent const):
(WebCore::CanvasStyle::isEquivalentRGBA const): Deleted.
(WebCore::CanvasStyle::isEquivalentCMYKA const): Deleted.
Replace isEquivalentRGBA/isEquivalentCMYKA with overloaded isEquivalent.
(WebCore::CanvasStyle::applyStrokeColor const):
(WebCore::CanvasStyle::applyFillColor const):
Update for new names of CMYKA members.
* html/canvas/CanvasStyle.h:
Use SRGBA<float> and CMYKA<float> to simplify interfaces

* page/DebugPageOverlays.cpp:
* page/linux/ResourceUsageOverlayLinux.cpp:
(WebCore::ResourceUsageOverlay::platformInitialize):
Use makeSimpleColor rather than makeSimpleColorFromFloats, allowing for
constant expression creation of SimpleColors.

* platform/graphics/Color.cpp:
(WebCore::Color::lightened const):
(WebCore::Color::darkened const):
Use makeSimpleColor(SRGBA { ... }) rather than makeSimpleColorFromFloats.

(WebCore::Color::luminance const):
Fix comment.

(WebCore::blendWithoutPremultiply):
Use makeSimpleColor(...) rather than makeSimpleColorFromFloats.

* platform/graphics/ColorTypes.h:
(WebCore::operator==):
(WebCore::operator!=):
- Add deduction guides and operator==/operator!= for each color type.
- Add CMYKA type. No conversion to ColorComponents yet, as ColorComponents
  only works with 4 component colors, not ones with 5 like CMYKA.

* platform/graphics/ColorUtilities.cpp:
(WebCore::toSRGBA):
Move conversion from CMYKA to SRGBA from makeSimpleColorFromCMYKA to here.

* platform/graphics/ColorUtilities.h:
(WebCore::convertPrescaledToComponentByte):
(WebCore::convertToComponentByte):
Use std::round rather than std::lroundf, since it will have the same result
and it reads nicer.

* platform/graphics/SimpleColor.cpp:
(WebCore::makeSimpleColorFromCMYKA): Deleted.
* platform/graphics/SimpleColor.h:
(WebCore::makeSimpleColor):
(WebCore::makeSimpleColorFromFloats): Deleted.
- Removed makeSimpleColorFromFloats and makeSimpleColorFromCMYKA.
- Added constexpr overload of makeSimpleColor taking a const SRGBA<uint8_t>&.
- Fixed forward declaration of makeSimpleColor that was taking ColorComponents
  to actually take an SRGBA<float>, which is what the inline implementation actually
  takes.

* platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
(WebCore::makeSimpleColorFromARGBCFArray):
* platform/graphics/cairo/GradientCairo.cpp:
(WebCore::interpolateColorStop):
* platform/graphics/cg/ColorCG.cpp:
(WebCore::makeSimpleColorFromCGColor):
* platform/graphics/win/PlatformContextDirect2D.cpp:
(WebCore::PlatformContextDirect2D::brushWithColor):
Use makeSimpleColor(SRGBA { ... }) rather than makeSimpleColorFromFloats.

* platform/graphics/mac/ColorMac.mm:
(WebCore::makeSimpleColorFromNSColor):
* platform/ios/ColorIOS.mm:
(WebCore::colorFromUIColor):
Use makeSimpleColor(SRGBA { ... }) rather than makeSimpleColorFromFloats. Casting to
float is needed, as the input types are CGFloat which is double in 64-bit environments
and won't automatically narrow with the new types.

* platform/ios/LegacyTileCache.mm:
(WebCore::LegacyTileCache::colorForGridTileBorder const):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::beginTransparencyLayers):
Use makeSimpleColor rather than makeSimpleColorFromFloats, allowing for
constant expression creation of SimpleColors.

* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::paintCheckboxDecorations):
(WebCore::RenderThemeIOS::paintRadioDecorations):
(WebCore::RenderThemeIOS::paintMenuListButtonDecorations):
(WebCore::RenderThemeIOS::paintSystemPreviewBadge):
Use Color::black/Color::white.colorWithAlpha(...) rather than makeSimpleColorFromFloats,
allowing for constant expression creation of SimpleColors.

Source/WebKit:

* UIProcess/API/wpe/WebKitColor.cpp:
(webkitColorToWebCoreColor):
Use makeSimpleColor(SRGBA { ... }) rather than makeSimpleColorFromFloats.

* WebProcess/Inspector/WebInspectorClient.cpp:
(WebKit::WebInspectorClient::showPaintRect):
* WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::drawRect):
Use makeSimpleColor rather than makeSimpleColorFromFloats, allowing for
constant expression creation of SimpleColors.

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

6 weeks agoRemove expectation for imported/w3c/web-platform-tests/css/css-values/ch-unit-004...
commit-queue@webkit.org [Mon, 29 Jun 2020 20:24:56 +0000 (20:24 +0000)]
Remove expectation for imported/w3c/web-platform-tests/css/css-values/ch-unit-004.html and imported/w3c/web-platform-tests/css/css-values/ch-unit-012.html as they are passing.
https://bugs.webkit.org/show_bug.cgi?id=203333

Unreviewed test gardening.

Patch by Karl Rackler <rackler@apple.com> on 2020-06-29

* TestExpectations:

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

6 weeks ago[Win] run-webkit-tests is failing to run DRT and WTR without --architecture x86_64
Hironori.Fujii@sony.com [Mon, 29 Jun 2020 20:09:19 +0000 (20:09 +0000)]
[Win] run-webkit-tests is failing to run DRT and WTR without --architecture x86_64
https://bugs.webkit.org/show_bug.cgi?id=213688

Reviewed by Jonathan Bedard.

* Scripts/webkitpy/port/win.py:
(WinPort._port_flag_for_scripts):
(WinPort._build_path):
(WinPort._ntsd_location):
Replaced self.get_option('architecture') with self.architecture().

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

6 weeks agoRemove expectation for imported/w3c/web-platform-tests/css/css-text/white-space/break...
commit-queue@webkit.org [Mon, 29 Jun 2020 19:38:30 +0000 (19:38 +0000)]
Remove expectation for imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-010.html as they are passing.
https://bugs.webkit.org/show_bug.cgi?id=213737

Unreviewed test gardening.

Patch by Karl Rackler <rackler@apple.com> on 2020-06-29

* platform/mac/TestExpectations:

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

6 weeks agoRemove expectation for imported/w3c/web-platform-tests/css/css-ui/outline-019.html...
ryanhaddad@apple.com [Mon, 29 Jun 2020 19:28:17 +0000 (19:28 +0000)]
Remove expectation for imported/w3c/web-platform-tests/css/css-ui/outline-019.html as they are passing.
https://bugs.webkit.org/show_bug.cgi?id=175288

Unreviewed test gardening.

Patch by Karl Rackler <rackler@apple.com> on 2020-06-29

* TestExpectations:

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

6 weeks agoConservativeRoots should mark any cell it finds an interior pointer to
keith_miller@apple.com [Mon, 29 Jun 2020 19:07:25 +0000 (19:07 +0000)]
ConservativeRoots should mark any cell it finds an interior pointer to
https://bugs.webkit.org/show_bug.cgi?id=213686

Reviewed by Yusuke Suzuki.

Currently, if ConserativeRoots finds an interior pointer to a cell
it will only mark that cell if it's a butterfly of some
kind. However, this can cause problems if the C++ or B3 compilers
pre-compute the offset of some cell member they want to load from
after a call. If this happens and that interior pointer is the
only reference to the cell it can get collected while it is still
"alive".

A naive patch that doesn't return from
findGCObjectPointersForMarking after finding a live non-interior,
non-butterfly cell was a 2% regression on Speedometer2 and
JetStream2. So, this patch immediately returns after
marking some non-butterfly cell, which appears to have fixed the
regression locally. Given this was such a big regression (likely
from running MarkedBlock::isLive) more than once there's possibly
an optimization opportunity here. I filed
https://bugs.webkit.org/show_bug.cgi?id=213687 to investigate
further.

* heap/HeapCell.cpp:
(WTF::printInternal):
* heap/HeapCell.h:
(JSC::isJSCellKind):
(JSC::mayHaveIndexingHeader):
(JSC::hasInteriorPointers): Deleted.
* heap/HeapUtil.h:
(JSC::HeapUtil::findGCObjectPointersForMarking):
* heap/SlotVisitor.cpp:
(JSC::SlotVisitor::appendJSCellOrAuxiliary):
* runtime/VM.cpp:
(JSC::VM::VM):

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

6 weeks agoAX: aria-modal nodes wrapped in aria-hidden are not honored
cfleizach@apple.com [Mon, 29 Jun 2020 18:54:16 +0000 (18:54 +0000)]
AX: aria-modal nodes wrapped in aria-hidden are not honored
https://bugs.webkit.org/show_bug.cgi?id=212849
<rdar://problem/64047019>

Reviewed by Zalan Bujtas.

Source/WebCore:

Test: accessibility/aria-modal-in-aria-hidden.html

If aria-modal was wrapped inside aria-hidden, we were still processing that as the modal node.
Fixing that uncovered a host of very finicky issues related to aria-modal.
1. We were processing modal status immediately instead of after a delay, so visibility requirements were not correct.
2. In handleModalChange: We were processing multiple modal nodes perhaps incorrectly (the spec doesn't account for multiple modal nodes).
     - had to update a test to turn off modal status before adding a new modal node
3. Changed the modal node to a WeakPtr
4. In isNodeAriaVisible: We stopped processing for visibile with aria-hidden as soon as we hit a renderable block, but that means it won't account
   for nodes higher in the tree with aria-hidden.
5. In handleAttributeChange: if aria-hidden changes, we should update modal status if needed.
6. In focusModalNodeTimerFired: we need to verify the element is still live, otherwise it can lead to a crash.

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::AXObjectCache):
(WebCore::AXObjectCache::findModalNodes):
(WebCore::AXObjectCache::currentModalNode):
(WebCore::AXObjectCache::modalNode):
(WebCore::AXObjectCache::remove):
(WebCore::AXObjectCache::deferModalChange):
(WebCore::AXObjectCache::focusModalNodeTimerFired):
(WebCore::AXObjectCache::handleAttributeChange):
(WebCore::AXObjectCache::handleModalChange):
(WebCore::AXObjectCache::prepareForDocumentDestruction):
(WebCore::AXObjectCache::performDeferredCacheUpdate):
(WebCore::isNodeAriaVisible):
* accessibility/AXObjectCache.h:
(WebCore::AXObjectCache::handleModalChange):
(WebCore::AXObjectCache::deferModalChange):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::firstChild const):
(WebCore::AccessibilityRenderObject::lastChild const):

LayoutTests:

* accessibility/aria-hidden-negates-no-visibility-expected.txt:
* accessibility/aria-hidden-negates-no-visibility.html:
* accessibility/aria-modal-in-aria-hidden-expected.txt: Added.
* accessibility/aria-modal-in-aria-hidden.html: Added.
* accessibility/aria-modal.html:
* accessibility/mac/aria-modal-auto-focus.html:

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

6 weeks agoRemove expectation for imported/w3c/web-platform-tests/css/css-transitions/before...
commit-queue@webkit.org [Mon, 29 Jun 2020 18:48:07 +0000 (18:48 +0000)]
Remove expectation for imported/w3c/web-platform-tests/css/css-transitions/before-load-001.html as it is passing.
https://bugs.webkit.org/show_bug.cgi?id=203416

Unreviewed test gardening.

Patch by Karl Rackler <rackler@apple.com> on 2020-06-29

* platform/mac/TestExpectations:

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

6 weeks agoSupport MediaRecorder.onstart
youenn@apple.com [Mon, 29 Jun 2020 18:32:10 +0000 (18:32 +0000)]
Support MediaRecorder.onstart
https://bugs.webkit.org/show_bug.cgi?id=213720

Reviewed by Darin Adler.

Source/WebCore:

Fire start event if MediaRecorder.start is successful.
Do some WebIDL clean-up, in particular change timeSlice from long to unsigned long, as per spec.
Covered by added test.

* Modules/mediarecorder/MediaRecorder.cpp:
(WebCore::MediaRecorder::startRecording):
* Modules/mediarecorder/MediaRecorder.h:
* Modules/mediarecorder/MediaRecorder.idl:

LayoutTests:

* http/wpt/mediarecorder/MediaRecorder-start-timeSlice-expected.txt:
* http/wpt/mediarecorder/MediaRecorder-start-timeSlice.html:

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

6 weeks agoSend WebRTC packets received from network process to web process from a background...
youenn@apple.com [Mon, 29 Jun 2020 18:27:54 +0000 (18:27 +0000)]
Send WebRTC packets received from network process to web process from a background thread
https://bugs.webkit.org/show_bug.cgi?id=213548

Reviewed by Eric Carlson.

Make LibWebRTCSocketClient take a ref to an IPC connection at creation time.
Use this connection from the RTC network thread to send received packets to improve performances.
Covered by existing tests.

* NetworkProcess/webrtc/LibWebRTCSocketClient.cpp:
(WebKit::LibWebRTCSocketClient::LibWebRTCSocketClient):
(WebKit::LibWebRTCSocketClient::signalReadPacket):
(WebKit::LibWebRTCSocketClient::signalSentPacket):
(WebKit::LibWebRTCSocketClient::signalAddressReady):
(WebKit::LibWebRTCSocketClient::signalConnect):
(WebKit::LibWebRTCSocketClient::signalClose):
* NetworkProcess/webrtc/LibWebRTCSocketClient.h:
* NetworkProcess/webrtc/NetworkRTCProvider.cpp:
(WebKit::NetworkRTCProvider::createSocket):
(WebKit::NetworkRTCProvider::createUDPSocket):
(WebKit::NetworkRTCProvider::createServerTCPSocket):
(WebKit::NetworkRTCProvider::createClientTCPSocket):
(WebKit::NetworkRTCProvider::wrapNewTCPConnection):
* NetworkProcess/webrtc/NetworkRTCProvider.h:

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

6 weeks agoRemove expectation for imported/w3c/web-platform-tests/css/css-scoping/stylesheet...
commit-queue@webkit.org [Mon, 29 Jun 2020 18:08:58 +0000 (18:08 +0000)]
Remove expectation for imported/w3c/web-platform-tests/css/css-scoping/stylesheet-title-001.html as they are passing.
https://bugs.webkit.org/show_bug.cgi?id=213736

Unreviewed test gardening.

Patch by Karl Rackler <rackler@apple.com> on 2020-06-29

* TestExpectations:

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

6 weeks ago[GTK] Unreviewed test gardening. Garden tests failing on the EWS GTK-WK2 queue.
dpino@igalia.com [Mon, 29 Jun 2020 17:53:12 +0000 (17:53 +0000)]
[GTK] Unreviewed test gardening. Garden tests failing on the EWS GTK-WK2 queue.

* platform/gtk/TestExpectations:

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

6 weeks agoREGRESSION(r263626): 2 imported/w3c/web-platform-tests/cors/ tests failing constantly
ryanhaddad@apple.com [Mon, 29 Jun 2020 17:51:26 +0000 (17:51 +0000)]
REGRESSION(r263626): 2 imported/w3c/web-platform-tests/cors/ tests failing constantly
https://bugs.webkit.org/show_bug.cgi?id=213729

Unreviewed test gardening.

Add baselines for Mojave.

* platform/mac-mojave/imported/w3c/web-platform-tests/cors/credentials-flag-expected.txt: Added.
* platform/mac-mojave/imported/w3c/web-platform-tests/cors/origin-expected.txt: Added.

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

6 weeks agoRemove expectation for imported/w3c/web-platform-tests/css/css-lists/counter-incremen...
commit-queue@webkit.org [Mon, 29 Jun 2020 17:30:15 +0000 (17:30 +0000)]
Remove expectation for imported/w3c/web-platform-tests/css/css-lists/counter-increment-inside-display-contents.html and imported/w3c/web-platform-tests/css/css-lists/counter-reset-inside-display-contents.html as they are passing.
https://bugs.webkit.org/show_bug.cgi?id=213734

Unreviewed test gardening.

Patch by Karl Rackler <rackler@apple.com> on 2020-06-29

* TestExpectations:

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

6 weeks ago[WTF] Add more StringView / ASCIILiteral helper functions and add ICUDeleter
ysuzuki@apple.com [Mon, 29 Jun 2020 17:23:27 +0000 (17:23 +0000)]
[WTF] Add more StringView / ASCIILiteral helper functions and add ICUDeleter
https://bugs.webkit.org/show_bug.cgi?id=209774

Reviewed by Ross Kirsling and Darin Adler.

Add ICUDeleter for cleaner ICU object deletion.
Add ICU::majorVersion and ICU::minorVersion to switch the skeleton string in Intl.NumberFormat.
Add more features for ASCIILiteral.

This patch is part of https://bugs.webkit.org/show_bug.cgi?id=209774. I land it separately from
Intl.NumberFormat change to unlock the further Intl implementations using ICUDeleter.

* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/text/ASCIILiteral.h:
* wtf/text/StringView.cpp:
(WTF::codePointCompare):
* wtf/text/StringView.h:
(WTF::StringView::StringView):
* wtf/unicode/icu/ICUHelpers.cpp: Copied from Source/WTF/wtf/text/ASCIILiteral.h.
(WTF::ICU::version):
(WTF::ICU::majorVersion):
(WTF::ICU::minorVersion):
* wtf/unicode/icu/ICUHelpers.h:
(WTF::ICUDeleter::operator()):

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

6 weeks agoRemove expectation for imported/w3c/web-platform-tests/css/css-display/display-conten...
commit-queue@webkit.org [Mon, 29 Jun 2020 17:21:51 +0000 (17:21 +0000)]
Remove expectation for imported/w3c/web-platform-tests/css/css-display/display-contents-button.html as they are passing.
https://bugs.webkit.org/show_bug.cgi?id=213731

Unreviewed test gardening.

Patch by Karl Rackler <rackler@apple.com> on 2020-06-29

* TestExpectations:

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

6 weeks agoRemove expectation for imported/w3c/web-platform-tests/cors/preflight-failure.htm...
commit-queue@webkit.org [Mon, 29 Jun 2020 16:37:00 +0000 (16:37 +0000)]
Remove expectation for imported/w3c/web-platform-tests/cors/preflight-failure.htm and imported/w3c/web-platform-tests/cors/status-async.htm as they are passing.
https://bugs.webkit.org/show_bug.cgi?id=213730

Unreviewed test gardening.

Patch by Karl Rackler <rackler@apple.com> on 2020-06-29

* TestExpectations:

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

6 weeks agoOn load from back/forward cache, call checkCompleted() for ALL frames inside FrameLoa...
cdumez@apple.com [Mon, 29 Jun 2020 16:32:33 +0000 (16:32 +0000)]
On load from back/forward cache, call checkCompleted() for ALL frames inside FrameLoader::commitProvisionalLoad()
https://bugs.webkit.org/show_bug.cgi?id=213657

Reviewed by Youenn Fablet.

On load from back/forward cache, call checkCompleted() for ALL frames inside FrameLoader::commitProvisionalLoad().
Previously, we were doing it for the main frame in FrameLoader::commitProvisionalLoad() and for subframes in
FrameLoader::open(). Doing it all in one place results in more understandable code and is less error-prone.

Note that calling checkCompleted() for subframes was new in r262221 and is covered by:
fast/history/multiple-back-forward-navigations.html

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::commitProvisionalLoad):
(WebCore::FrameLoader::open):

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

6 weeks agoREGRESSION(r263626): 2 imported/w3c/web-platform-tests/cors/ tests failing constantly
cdumez@apple.com [Mon, 29 Jun 2020 14:38:16 +0000 (14:38 +0000)]
REGRESSION(r263626): 2 imported/w3c/web-platform-tests/cors/ tests failing constantly
https://bugs.webkit.org/show_bug.cgi?id=213729

Unreviewed, rebaseline a couple of cors tests after upstream resync in r263626.

* web-platform-tests/cors/credentials-flag-expected.txt:
* web-platform-tests/cors/origin-expected.txt:

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

6 weeks agorun-javascriptcore-tests: Support Apple Silicon running x86 processes
jbedard@apple.com [Mon, 29 Jun 2020 14:22:05 +0000 (14:22 +0000)]
run-javascriptcore-tests: Support Apple Silicon running x86 processes
https://bugs.webkit.org/show_bug.cgi?id=213487
<rdar://problem/64606667>

Unreviewed infrastructure fix.

* Scripts/webkitdirs.pm:
(architecturesForProducts): Return architecutre(), not determineArchitecture().

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

6 weeks ago[css-flexbox] WebKit mistakenly lets pointer events (click/hover/etc) pass through...
svillar@igalia.com [Mon, 29 Jun 2020 12:15:06 +0000 (12:15 +0000)]
[css-flexbox] WebKit mistakenly lets pointer events (click/hover/etc) pass through flex items, if they have negative margin
https://bugs.webkit.org/show_bug.cgi?id=185771

Reviewed by Javier Fernandez.

LayoutTests/imported/w3c:

* web-platform-tests/css/css-flexbox/hittest-overlapping-margin-expected.txt: Replaced FAIL by PASS expectation.
* web-platform-tests/css/css-flexbox/hittest-overlapping-order-expected.txt: Ditto.

Source/WebCore:

When multiple child elements of a flexbox overlap (for example, due to negative margins), the element drawn in the
foreground may not actually capture the hit if the element underneath it is hit-tested despite being occluded.
This is because painting of flexbox children is done in order modified document order instead of raw document order.

In order to achieve this we should inspect flex items in reverse order modified document order. As the OrderIterator
cannot go backwards, we cache the reverse order of items when doing the layout in order to have fast hit testing in
flexbox containers.

As this behaviour is different to the one implemented in RenderBlock a new virtual method to perform hit testing of children
was extracted from RenderBlock:nodeAtPoint() to a new method called RenderBlock::hitTestChildren. The RenderBlock
implementation is identical to the current one but flexbox containers overwrite it.

Two WPT flexbox hittests are passing now thanks to this patch.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::hitTestChildren): Implementation of the new virtual method extracted from nodeAtPoint.
(WebCore::RenderBlock::nodeAtPoint): Moved code to hit test children to hitTestChildren()
* rendering/RenderBlock.h: Added hitTestChildren new virtual method.
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::hitTestChildren): Implemented.
(WebCore::RenderFlexibleBox::layoutFlexItems): Cache the reverse of the order iterator to be used by hit testing.
* rendering/RenderFlexibleBox.h: Added hitTestChildren.

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

6 weeks ago[GStreamer] imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback...
calvaris@igalia.com [Mon, 29 Jun 2020 12:06:44 +0000 (12:06 +0000)]
[GStreamer] imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-setMediaKeys-immediately.https.html is a flaky crash
https://bugs.webkit.org/show_bug.cgi?id=213385

Reviewed by Philippe Normand.

Source/WebCore:

Add a way to release the decryption resources when the player
private is destroyed. That way we can release the secure memory
allocated by libgcrypt and allow for more tests to get, which
caused the crash.

Tests: imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-setMediaKeys-immediately.https.html.

* platform/encryptedmedia/CDMProxy.h:
(WebCore::CDMProxy::releaseDecryptionResources):
(WebCore::CDMInstanceSessionProxy::releaseDecryptionResources):
(WebCore::CDMInstanceProxy::releaseDecryptionResources):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
* platform/graphics/gstreamer/eme/CDMProxyClearKey.cpp:
(WebCore::CDMProxyClearKey::~CDMProxyClearKey):
(WebCore::CDMProxyClearKey::releaseDecryptionResources):
(WebCore::CDMProxyClearKey::closeGCryptHandle):
* platform/graphics/gstreamer/eme/CDMProxyClearKey.h:

LayoutTests:

* platform/glib/TestExpectations: Removed test from expectations.

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

6 weeks ago[webkitpy] PHP7.4 support on Debian platforms
calvaris@igalia.com [Mon, 29 Jun 2020 12:06:01 +0000 (12:06 +0000)]
[webkitpy] PHP7.4 support on Debian platforms
https://bugs.webkit.org/show_bug.cgi?id=213721

Reviewed by Carlos Garcia Campos.

Tools:

* Scripts/webkitpy/port/base.py:
(Port._debian_php_version):

LayoutTests:

* http/conf/debian-httpd-2.4-php7.4.conf: Added.

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

6 weeks ago[MSE][GStreamer] Rename MediaSourceGStreamer to MediaSourcePrivateGStreamer
aboya@igalia.com [Mon, 29 Jun 2020 11:50:21 +0000 (11:50 +0000)]
[MSE][GStreamer] Rename MediaSourceGStreamer to MediaSourcePrivateGStreamer
https://bugs.webkit.org/show_bug.cgi?id=213722

Reviewed by Xabier Rodriguez-Calvar.

It's about time to remove this FIXME:

// FIXME: Should this be called MediaSourcePrivateGStreamer?

Yes, it should. Because it's a MediaSourcePrivate, and that is an
important fact. The MSE class diagram is confusing enough already,
let's fix this.

To rebase commits after this change use `git format-patch` first to
get them in a patch format and then run:

sed -i 's|\<MediaSourceGStreamer\>|MediaSourcePrivateGStreamer|g' *.patch

This patch is a refactor that produces no behavior changes.

* platform/GStreamer.cmake:
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::sourceSetup):
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
* platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.cpp: Renamed from Source/WebCore/platform/graphics/gstreamer/mse/MediaSourceGStreamer.cpp.
(WebCore::MediaSourcePrivateGStreamer::open):
(WebCore::MediaSourcePrivateGStreamer::MediaSourcePrivateGStreamer):
(WebCore::MediaSourcePrivateGStreamer::~MediaSourcePrivateGStreamer):
(WebCore::MediaSourcePrivateGStreamer::addSourceBuffer):
(WebCore::MediaSourcePrivateGStreamer::removeSourceBuffer):
(WebCore::MediaSourcePrivateGStreamer::durationChanged):
(WebCore::MediaSourcePrivateGStreamer::markEndOfStream):
(WebCore::MediaSourcePrivateGStreamer::unmarkEndOfStream):
(WebCore::MediaSourcePrivateGStreamer::readyState const):
(WebCore::MediaSourcePrivateGStreamer::setReadyState):
(WebCore::MediaSourcePrivateGStreamer::waitForSeekCompleted):
(WebCore::MediaSourcePrivateGStreamer::seekCompleted):
(WebCore::MediaSourcePrivateGStreamer::sourceBufferPrivateDidChangeActiveState):
(WebCore::MediaSourcePrivateGStreamer::buffered):
(WebCore::MediaSourcePrivateGStreamer::logChannel const):
* platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.h: Renamed from Source/WebCore/platform/graphics/gstreamer/mse/MediaSourceGStreamer.h.
* platform/graphics/gstreamer/mse/PlaybackPipeline.h:
* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
(WebCore::SourceBufferPrivateGStreamer::create):
(WebCore::SourceBufferPrivateGStreamer::SourceBufferPrivateGStreamer):
* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h:
* platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:

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

6 weeks agoRTCDataChannel.bufferedAmount should stay the same even if channel is closed
youenn@apple.com [Mon, 29 Jun 2020 11:50:04 +0000 (11:50 +0000)]
RTCDataChannel.bufferedAmount should stay the same even if channel is closed
https://bugs.webkit.org/show_bug.cgi?id=213698

Reviewed by Darin Adler.

Source/WebCore:

bufferedAmount was set back to zero when closing.
Instead, we should keep the value in RTCDataChannel and update it either when sending data
or being notified or some data getting sent.

Test: webrtc/datachannel/bufferedAmount-afterClose.html

* Modules/mediastream/RTCDataChannel.cpp:
(WebCore::RTCDataChannel::bufferedAmountIsDecreasing):
* platform/mock/RTCDataChannelHandlerMock.h:

LayoutTests:

* webrtc/datachannel/bufferedAmount-afterClose-expected.txt: Added.
* webrtc/datachannel/bufferedAmount-afterClose.html: Added.

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

6 weeks agochecked overflow in WebCore::findClosestFont
antti@apple.com [Mon, 29 Jun 2020 11:31:10 +0000 (11:31 +0000)]
checked overflow in WebCore::findClosestFont
https://bugs.webkit.org/show_bug.cgi?id=213719
<rdar://47765225>

Reviewed by David Kilzer.

* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::findClosestFont):

If indexOfBestCapabilities doesn't find anything it returns notFound and indexing to the vector overflows.

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

6 weeks agoREGRESSION (r262776): Leak of NSMutableURLRequest in -[WebCoreResourceHandleAsOperati...
ddkilzer@apple.com [Mon, 29 Jun 2020 10:54:34 +0000 (10:54 +0000)]
REGRESSION (r262776): Leak of NSMutableURLRequest in -[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]
<https://webkit.org/b/213690>
<rdar://problem/64853619>

Reviewed by Anders Carlsson.

* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
- Use RetainPtr<> for the mutable copy and autorelease the
  return value.

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

6 weeks ago[GTK] Dark mode for GTK themes that end with -Dark
commit-queue@webkit.org [Mon, 29 Jun 2020 10:19:10 +0000 (10:19 +0000)]
[GTK] Dark mode for GTK themes that end with -Dark
https://bugs.webkit.org/show_bug.cgi?id=213465

Patch by Elliot <CheeseEBoi@mailo.com> on 2020-06-29
Reviewed by Carlos Garcia Campos.

WebKitGtk has support for automatic detection of dark mode when it comes to GTK themes with the "-dark" and
":dark" suffixes. However, when using GTK themes that end with "-Dark" or ":Dark", this is not the case. This
affects many themes like "Arc" and "Flat-Remix".

* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::effectiveAppearanceIsDark const):
(WebKit::PageClientImpl::themeName const):

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

6 weeks agoMediaRecorder.start() Method is Ignoring the "timeslice" Parameter
youenn@apple.com [Mon, 29 Jun 2020 10:10:01 +0000 (10:10 +0000)]
MediaRecorder.start() Method is Ignoring the "timeslice" Parameter
https://bugs.webkit.org/show_bug.cgi?id=202233
<rdar://problem/55720555>

Reviewed by Eric Carlson.

Source/WebCore:

Use a timer to implement timeSlice parameter.
Schedule timer either when start is called or as part of requestData callback.
This should ensure that, if requestData is called by the application, the timer will be rescheduled appropriately.

Test: http/wpt/mediarecorder/MediaRecorder-start-timeSlice.html

* Modules/mediarecorder/MediaRecorder.cpp:
(WebCore::MediaRecorder::MediaRecorder):
(WebCore::MediaRecorder::startRecording):
(WebCore::MediaRecorder::requestData):
* Modules/mediarecorder/MediaRecorder.h:

LayoutTests:

* http/wpt/mediarecorder/MediaRecorder-start-timeSlice-expected.txt: Added.
* http/wpt/mediarecorder/MediaRecorder-start-timeSlice.html: Added.

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

6 weeks agoUnreviewed WPE gardening. Addressing some timeouts and flaky failures.
zandobersek@gmail.com [Mon, 29 Jun 2020 09:50:28 +0000 (09:50 +0000)]
Unreviewed WPE gardening. Addressing some timeouts and flaky failures.

* platform/wpe/TestExpectations:

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

6 weeks agoREGRESSION(r263625): [WPE][GTK] MiniBrowser output no longer includes stderr and...
commit-queue@webkit.org [Mon, 29 Jun 2020 09:38:13 +0000 (09:38 +0000)]
REGRESSION(r263625): [WPE][GTK] MiniBrowser output no longer includes stderr and stdout
https://bugs.webkit.org/show_bug.cgi?id=213696

Patch by Philippe Normand <pnormand@igalia.com> on 2020-06-29
Reviewed by Žan Doberšek.

This patch adds a new optional argument to Executive.run_command() to control stdout output.
By default the subprocess.PIPE value is used, to keep backward compatibility. Set the stdout
argument to None to display the output on the terminal tty.

The GTK and WPE run_minibrowser() implementations now use this new argument, along with
setting return_stderr to False to indicate we also want stderr displayed on the terminal
tty.

* Scripts/webkitpy/common/system/abstractexecutive.py:
(AbstractExecutive.run_command):
* Scripts/webkitpy/common/system/executive.py:
(Executive.run_command):
* Scripts/webkitpy/common/system/executive_mock.py:
(MockExecutive.run_command):
* Scripts/webkitpy/port/gtk.py:
(GtkPort.run_minibrowser):
* Scripts/webkitpy/port/wpe.py:
(WPEPort.run_minibrowser):

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

6 weeks agoREGRESSION(r263625): run-minibrowser --debug/--release options gone
commit-queue@webkit.org [Mon, 29 Jun 2020 09:32:52 +0000 (09:32 +0000)]
REGRESSION(r263625): run-minibrowser --debug/--release options gone
https://bugs.webkit.org/show_bug.cgi?id=213697

Patch by Philippe Normand <pnormand@igalia.com> on 2020-06-29
Reviewed by Žan Doberšek.

* Scripts/webkitpy/minibrowser/run_webkit_app.py:
(main): Explicitely skip the --target option. Previous code was also skipping --release and
--debug options because their `dest` is the same as with the --target option.

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

6 weeks agowindow.location.replace with invalid urls should throw
commit-queue@webkit.org [Mon, 29 Jun 2020 08:04:12 +0000 (08:04 +0000)]
window.location.replace with invalid urls should throw
https://bugs.webkit.org/show_bug.cgi?id=153121

Patch by Rob Buis <rbuis@igalia.com> on 2020-06-29
Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Add a subtest to verify that location.replace throws SyntaxError if
the resulting url is not valid.

* web-platform-tests/html/browsers/history/the-location-interface/location_replace-expected.txt:
* web-platform-tests/html/browsers/history/the-location-interface/location_replace.html:

Source/WebCore:

Throw SyntaxError if the url resulting from the
location.replace operation is not valid.

Behavior matches Firefox and Chrome.

Tests: imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location_replace.html

[1] https://html.spec.whatwg.org/multipage/history.html#dom-location-replace

* page/Location.cpp:
(WebCore::Location::replace):
* page/Location.h:
* page/Location.idl:

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

6 weeks agoAdd a new Web Platform Test in LayoutTest/imported/w3c/web-platform-tests/dom/ranges
commit-queue@webkit.org [Mon, 29 Jun 2020 08:00:26 +0000 (08:00 +0000)]
Add a new Web Platform Test in LayoutTest/imported/w3c/web-platform-tests/dom/ranges
https://bugs.webkit.org/show_bug.cgi?id=213667

Patch by Pinki Gyanchandani <pgyanchandani@apple.com> on 2020-06-29
Reviewed by Darin Adler.

Adding a Web Platfotm Test to test the handling of Ranges, when range is associated with a parentless node, and this parentless node moves to
new document.

This test has been provided by Darin Adler.

* web-platform-tests/dom/ranges/Range-adopt-test-expected.txt: Added.
* web-platform-tests/dom/ranges/Range-adopt-test.html: Added.

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

6 weeks ago[GTK][WPE] Add webkit_authentication_request_get_security_origin
carlosgc@webkit.org [Mon, 29 Jun 2020 07:39:36 +0000 (07:39 +0000)]
[GTK][WPE] Add webkit_authentication_request_get_security_origin
https://bugs.webkit.org/show_bug.cgi?id=213596

Reviewed by Michael Catanzaro.

Source/WebKit:

Returns the security origin for the authentication protection space.

* UIProcess/API/glib/WebKitAuthenticationRequest.cpp:
(webkit_authentication_request_get_security_origin):
* UIProcess/API/gtk/WebKitAuthenticationRequest.h:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
* UIProcess/API/wpe/WebKitAuthenticationRequest.h:
* UIProcess/API/wpe/docs/wpe-1.0-sections.txt:

Tools:

Update the unit tests to check the new API.

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

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

6 weeks ago[GTK4] Context menu is misaligned
commit-queue@webkit.org [Mon, 29 Jun 2020 07:23:53 +0000 (07:23 +0000)]
[GTK4] Context menu is misaligned
https://bugs.webkit.org/show_bug.cgi?id=213703

Patch by Alexander Mikhaylenko <alexm@gnome.org> on 2020-06-29
Reviewed by Carlos Garcia Campos.

Set halign on the context menu popover to the same value other context menus in GTK use,
like in GtkEntry.

* UIProcess/gtk/WebContextMenuProxyGtk.cpp:
(WebKit::createMenuWidget): Set halign for the context menu to 'start'.

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

6 weeks ago[GTK][WPE] Add baseline for imported/w3c/web-platform-tests/cors/credentials-flag.htm
lmoura@igalia.com [Mon, 29 Jun 2020 03:48:26 +0000 (03:48 +0000)]
[GTK][WPE] Add baseline for imported/w3c/web-platform-tests/cors/credentials-flag.htm

Unreviewed test gardening.

The current baseline seems to be based on the Mojave results, where
the last two test cases fail. Let's add a glib baseline with a Pass
expectation with a link to the bug discussing the main expectation.

The added baseline mirrors the current WebKitGTK results from wpt.fyi,
with the two cookie failures.

* platform/glib/TestExpectations:
* platform/glib/imported/w3c/web-platform-tests/cors/credentials-flag-expected.txt: Added.

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

6 weeks ago[GTK][WPE] Merge crypto expectations
lmoura@igalia.com [Mon, 29 Jun 2020 02:15:15 +0000 (02:15 +0000)]
[GTK][WPE] Merge crypto expectations

Unreviwed test gardening.

* platform/glib/TestExpectations:
* platform/gtk/TestExpectations:
* platform/wpe/TestExpectations:

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

6 weeks ago[GTK][WPE] Move WebCryptoAPI expectations to glib
lmoura@igalia.com [Mon, 29 Jun 2020 01:16:32 +0000 (01:16 +0000)]
[GTK][WPE] Move WebCryptoAPI expectations to glib

Unreviewed test gardening.

Some expectations in the glib file were being overriden by the generic
gtk one marking the tests as Slow.

* platform/glib/TestExpectations:
* platform/gtk/TestExpectations:
* platform/wpe/TestExpectations:

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

6 weeks ago[LFC][TFC] Adjust table content vertical position to match vertical-align
zalan@apple.com [Mon, 29 Jun 2020 00:03:24 +0000 (00:03 +0000)]
[LFC][TFC] Adjust table content vertical position to match vertical-align
https://bugs.webkit.org/show_bug.cgi?id=213692

Reviewed by Antti Koivisto.

Source/WebCore:

Child boxes (and runs) are always in the coordinate system of the containing block's border box.
The content box (where the child content lives) is inside the padding box, which is inside the border box.
In order to compute the child box top/left position, we need to know both the padding and the border offsets.

<div style="border: 2px solid green; padding-top: 10px;"><div></div></div>
The inner div's top left position is at [12px, 2px] (let's ignore margin collapsing for now).

Normally by the time we start positioning the child content, we already have computed borders and paddings for the containing block.
This is different with table cells where the final padding offset depends on the content height as we use
the padding box to vertically align the table cell content.

Let's adjust the child boxes and runs to match the new content box position.

Test: fast/layoutformattingcontext/table-cell-vertical-alignment-simple.html

* layout/displaytree/DisplayLineBox.h:
(WebCore::Display::LineBox::moveVertically):
* layout/displaytree/DisplayRun.h:
(WebCore::Display::Run::moveVertically):
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::setUsedGeometryForCells):

LayoutTests:

* fast/layoutformattingcontext/table-cell-vertical-alignment-simple-expected.html: Added.
* fast/layoutformattingcontext/table-cell-vertical-alignment-simple.html: Added.

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

6 weeks ago[LFC][Painting] Use the table section as the paint container for table cells
zalan@apple.com [Mon, 29 Jun 2020 00:00:58 +0000 (00:00 +0000)]
[LFC][Painting] Use the table section as the paint container for table cells
https://bugs.webkit.org/show_bug.cgi?id=213693

Reviewed by Antti Koivisto.

The cell's containing block is the table box (skipping both the row and the section),
but it's positioned relative to the table section.

Let's skip the row and go right to the section box when painting the cells.

* layout/displaytree/DisplayPainter.cpp:
(WebCore::Display::absoluteDisplayBox):

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

6 weeks agoImprove error message for primitive callback interfaces
shvaikalesh@gmail.com [Sun, 28 Jun 2020 22:49:40 +0000 (22:49 +0000)]
Improve error message for primitive callback interfaces
https://bugs.webkit.org/show_bug.cgi?id=213684

Reviewed by Darin Adler.

Source/WebCore:

This patch rewords TypeError message for non-object callback interfaces
because apart from function, an object with certain method is also allowed.
New error message matches Chrome and Firefox.

Tests: fast/dom/createNodeIterator-parameters.html
       fast/dom/createTreeWalker-parameters.html

* bindings/js/JSDOMExceptionHandling.cpp:
(WebCore::throwArgumentMustBeObjectError):
* bindings/js/JSDOMExceptionHandling.h:
* bindings/scripts/CodeGeneratorJS.pm:
(GetArgumentExceptionFunction):
* bindings/scripts/test/*: Updated.

LayoutTests:

* fast/dom/createNodeIterator-parameters-expected.txt:
* fast/dom/createNodeIterator-parameters.html:
* fast/dom/createTreeWalker-parameters-expected.txt:
* fast/dom/createTreeWalker-parameters.html:

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

6 weeks agoSetting url.search="??" (two questionmarks) has incorrect behavior
commit-queue@webkit.org [Sun, 28 Jun 2020 21:36:05 +0000 (21:36 +0000)]
Setting url.search="??" (two questionmarks) has incorrect behavior
https://bugs.webkit.org/show_bug.cgi?id=170452

Patch by Rob Buis <rbuis@igalia.com> on 2020-06-28
Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Update improved test result.

* web-platform-tests/url/url-setters-expected.txt:

Source/WebCore:

There is no need to strip leading "?" character since
URLParser expects it to be there. This differs from the
specification algorithm [1], which relies on state override,
which URLParser does not support.

Behavior matches Firefox and Chrome.

Test: imported/w3c/web-platform-tests/url/url-setters.html

[1] https://url.spec.whatwg.org/#dom-url-search

* html/URLDecomposition.cpp:
(WebCore::URLDecomposition::setSearch):

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

6 weeks agoFix thread-safety issue in webProcessPoolHighDynamicRangeDidChangeCallback()
cdumez@apple.com [Sun, 28 Jun 2020 21:34:20 +0000 (21:34 +0000)]
Fix thread-safety issue in webProcessPoolHighDynamicRangeDidChangeCallback()
https://bugs.webkit.org/show_bug.cgi?id=213689
<rdar://problem/64443996>

Reviewed by Darin Adler.

webProcessPoolHighDynamicRangeDidChangeCallback() gets called on a background thread so we
need to make sure we dispatch to the main thread before we iterate over the process pools.

* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::webProcessPoolHighDynamicRangeDidChangeCallback):

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

6 weeks agoRename initializeThreading to initialize
ggaren@apple.com [Sun, 28 Jun 2020 20:55:08 +0000 (20:55 +0000)]
Rename initializeThreading to initialize
https://bugs.webkit.org/show_bug.cgi?id=213674

Reviewed by Mark Lam.

Source/JavaScriptCore:

* API/JSClassRef.cpp:
* API/JSContextRef.cpp:
(JSContextGroupCreate):
(JSGlobalContextCreate):
(JSGlobalContextCreateInGroup):
* API/JSObjectRef.cpp:
(JSClassCreate):
* API/JSStringRef.cpp:
(JSStringCreateWithCharacters):
(JSStringCreateWithUTF8CString):
(JSStringCreateWithCharactersNoCopy):
* API/JSStringRefCF.cpp:
(JSStringCreateWithCFString):
* API/tests/CompareAndSwapTest.cpp:
(testCompareAndSwap):
* API/tests/ExecutionTimeLimitTest.cpp:
(testExecutionTimeLimit):
* API/tests/FunctionOverridesTest.cpp:
(testFunctionOverrides):
* API/tests/MultithreadedMultiVMExecutionTest.cpp:
(startMultithreadedMultiVMExecutionTest):
* API/tests/PingPongStackOverflowTest.cpp:
(testPingPongStackOverflow):
* JavaScriptCore.order:
* assembler/testmasm.cpp:
(JSC::run):
* b3/air/testair.cpp:
(main):
* b3/testb3_1.cpp:
(main):
* dfg/testdfg.cpp:
(main):
* dynbench.cpp:
(main):
* inspector/remote/cocoa/RemoteInspectorCocoa.mm:
(Inspector::RemoteInspector::singleton):
* jsc.cpp:
(main):
(jscmain):
* runtime/InitializeThreading.cpp:
(JSC::initialize):
(JSC::initializeThreading): Deleted.
* runtime/InitializeThreading.h:
* runtime/JSCConfig.h:
* shell/playstation/TestShell.cpp:
(setupTestRun):
* testRegExp.cpp:
(main):

Source/WebCore:

* Modules/webdatabase/DatabaseManager.cpp:
(WebCore::DatabaseManager::openDatabase):
* WebCore.order:
* bindings/js/CommonVM.cpp:
(WebCore::commonVMSlow):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::initializeMainThread):
(WebCore::ScriptController::initializeThreading): Deleted.
* bindings/js/ScriptController.h:
* bridge/objc/WebScriptObject.mm:
(+[WebScriptObject initialize]):
* platform/cocoa/SharedBufferCocoa.mm:
(+[WebCoreSharedBufferData initialize]):
* platform/ios/wak/WebCoreThread.mm:
(RunWebThread):

Source/WebKit:

* Shared/API/c/WKString.cpp:
(WKStringCopyJSString):
* Shared/Cocoa/WebKit2InitializeCocoa.mm:
(WebKit::runInitializationCode):
* Shared/WebKit2Initialize.cpp:
(WebKit::InitializeWebKit2):

Source/WebKitLegacy/mac:

* History/WebBackForwardList.mm:
(+[WebBackForwardList initialize]):
* History/WebHistoryItem.mm:
(+[WebHistoryItem initialize]):
* Misc/WebCache.mm:
(+[WebCache initialize]):
* Misc/WebElementDictionary.mm:
(+[WebElementDictionary initialize]):
* Misc/WebIconDatabase.mm:
* Misc/WebStringTruncator.mm:
(+[WebStringTruncator initialize]):
* Plugins/Hosted/WebHostedNetscapePluginView.mm:
(+[WebHostedNetscapePluginView initialize]):
* Plugins/WebBaseNetscapePluginView.mm:
* Plugins/WebBasePluginPackage.mm:
(+[WebBasePluginPackage initialize]):
* Plugins/WebNetscapePluginView.mm:
(+[WebNetscapePluginView initialize]):
* WebCoreSupport/WebEditorClient.mm:
(+[WebUndoStep initialize]):
* WebCoreSupport/WebFrameLoaderClient.mm:
(+[WebFramePolicyListener initialize]):
* WebView/WebArchive.mm:
(+[WebArchivePrivate initialize]):
* WebView/WebDataSource.mm:
(+[WebDataSource initialize]):
* WebView/WebHTMLView.mm:
(+[WebHTMLViewPrivate initialize]):
(+[WebHTMLView initialize]):
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
* WebView/WebResource.mm:
(+[WebResourcePrivate initialize]):
* WebView/WebTextIterator.mm:
(+[WebTextIteratorPrivate initialize]):
* WebView/WebView.mm:
(+[WebView initialize]):
* WebView/WebViewData.mm:
(+[WebViewPrivate initialize]):

Source/WebKitLegacy/win:

* WebKitClassFactory.cpp:
(WebKitClassFactory::WebKitClassFactory):
* WebView.cpp:
(WebView::WebView):

Source/WTF:

Reasons:

(1) You need to call it even if you don't use threads.

(2) It initializes things unrelated to threads (like the PRNG).

(3) People seem to get confused about the relationship between
initializeThreading() and initializeMainThread(), and sometimes think
initializeThreading() is a superset. The opposite is true! I think the
confusion may come from "threading" being read as "all threading".

Some filenames still use the legacy name. We can fix that in post.

* benchmarks/ConditionSpeedTest.cpp:
(main):
* benchmarks/HashSetDFGReplay.cpp:
(main):
* benchmarks/LockFairnessTest.cpp:
(main):
* benchmarks/LockSpeedTest.cpp:
(main):
* wtf/MainThread.cpp:
(WTF::initializeMainThread):
* wtf/Threading.cpp:
(WTF::Thread::create):
(WTF::initialize):
(WTF::initializeThreading): Deleted.
* wtf/Threading.h:
(WTF::Thread::current):

Tools:

* TestWebKitAPI/Tests/WebCore/ApplicationManifestParser.cpp:
(ApplicationManifestParserTest::SetUp):
* TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp:
(TestWebKitAPI::ComplexTextControllerTest::SetUp):
* TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:
(TestWebKitAPI::ContentExtensionTest::SetUp):
* TestWebKitAPI/Tests/WebCore/StringUtilities.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebCore/cocoa/WebCoreNSURLSession.mm:
(TestWebKitAPI::WebCoreNSURLSessionTest::SetUp):
* TestWebKitAPI/glib/WebKitGLib/WebKitTestServer.cpp:
(WebKitTestServer::WebKitTestServer):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::initialize):

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

6 weeks ago[iOS] Clean up visible position comparisons in WebPage::requestDocumentEditingContext()
dbates@webkit.org [Sun, 28 Jun 2020 19:16:05 +0000 (19:16 +0000)]
[iOS] Clean up visible position comparisons in WebPage::requestDocumentEditingContext()
https://bugs.webkit.org/show_bug.cgi?id=213701

Reviewed by Geoffrey Garen.

Use std::min and std::max when the result needs to be copied instead of doing the comparison
by hand to make the code a tiny bit more clear. Also, don't copy a VisiblePosition when doing
the min/max in-place. Both of these things are unlikely to effect code generation. If they do,
the latter makes things a tiny bit more efficient.

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

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

6 weeks agoMediaRecorder stopRecorder() returns empty Blob after first use
youenn@apple.com [Sun, 28 Jun 2020 15:11:59 +0000 (15:11 +0000)]
MediaRecorder stopRecorder() returns empty Blob after first use
https://bugs.webkit.org/show_bug.cgi?id=212274
<rdar://problem/63601298>

Reviewed by Eric Carlson.

Source/WebCore:

Refactor code to create/destroy MediaRecorderPrivate on MediaRecorder start/stop.
This allows reusing a MediaRecorder after a stop and restarting with a clean state.

We introduce MediaRecorderPrivate::startRecording to do the initialization,
which allows to fix a potential ref cycle as part of the error callback handling.

Make some improvements to the platform implementation, in particular add default initialization to all fields.
Align the code using AudioConverterRef to what is done in AudioSampleDataSource.
Also call VTCompressionSessionInvalidate when destroying the VideoSampleBufferCompressor.

Test: http/wpt/mediarecorder/MediaRecorder-multiple-start-stop.html

* Modules/mediarecorder/MediaRecorder.cpp:
(WebCore::MediaRecorder::create):
(WebCore::MediaRecorder::MediaRecorder):
(WebCore::MediaRecorder::startRecording):
(WebCore::MediaRecorder::stopRecording):
(WebCore::MediaRecorder::requestData):
* Modules/mediarecorder/MediaRecorder.h:
* platform/mediarecorder/MediaRecorderPrivateMock.cpp:
(WebCore::MediaRecorderPrivateMock::fetchData):
* platform/mediarecorder/MediaRecorderPrivate.h:
(WebCore::MediaRecorderPrivate::startRecording):
* platform/mediarecorder/cocoa/AudioSampleBufferCompressor.h:
* platform/mediarecorder/cocoa/AudioSampleBufferCompressor.mm:
(WebCore::AudioSampleBufferCompressor::~AudioSampleBufferCompressor):
(WebCore::AudioSampleBufferCompressor::initAudioConverterForSourceFormatDescription):
(WebCore::AudioSampleBufferCompressor::attachPrimingTrimsIfNeeded):
(WebCore::AudioSampleBufferCompressor::gradualDecoderRefreshCount):
(WebCore::AudioSampleBufferCompressor::sampleBufferWithNumPackets):
(WebCore::AudioSampleBufferCompressor::processSampleBuffersUntilLowWaterTime):
* platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h:
* platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
(WebCore::MediaRecorderPrivateWriter::stopRecording):
* platform/mediarecorder/cocoa/VideoSampleBufferCompressor.mm:
(WebCore::VideoSampleBufferCompressor::~VideoSampleBufferCompressor):

Source/WebKit:

Update implementation to do initialization as part of startRecording.

* GPUProcess/webrtc/RemoteMediaRecorderManager.cpp:
(WebKit::RemoteMediaRecorderManager::releaseRecorder):
Remove ASSERT as recorder creation in WebProcess is always ok while creation in GPUProcess may fail and m_recorders may not be populated.
* WebProcess/GPU/webrtc/MediaRecorderPrivate.cpp:
(WebKit::MediaRecorderPrivate::MediaRecorderPrivate):
(WebKit::MediaRecorderPrivate::startRecording):
* WebProcess/GPU/webrtc/MediaRecorderPrivate.h:

LayoutTests:

* http/wpt/mediarecorder/MediaRecorder-multiple-start-stop-expected.txt: Added.
* http/wpt/mediarecorder/MediaRecorder-multiple-start-stop.html: Added.

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

6 weeks agoUnreviewed GTK/WPE Debug build fix after r263589.
philn@webkit.org [Sun, 28 Jun 2020 11:49:47 +0000 (11:49 +0000)]
Unreviewed GTK/WPE Debug build fix after r263589.

* Platform/Logging.h: Define a log category for Memory Pressure.

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

6 weeks ago[LFC][IFC] Replaced inline boxes sit on the baseline with their margins
zalan@apple.com [Sun, 28 Jun 2020 05:26:28 +0000 (05:26 +0000)]
[LFC][IFC] Replaced inline boxes sit on the baseline with their margins
https://bugs.webkit.org/show_bug.cgi?id=213679

Reviewed by Antti Koivisto.

Source/WebCore:

Take the margin box into account when computing the top position of a baseline aligned replaced inline box.

Test: fast/layoutformattingcontext/replaced-box-with-margin-on-baseline.html

* layout/inlineformatting/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::alignContentVertically):

LayoutTests:

* fast/layoutformattingcontext/replaced-box-with-margin-on-baseline-expected.html: Added.
* fast/layoutformattingcontext/replaced-box-with-margin-on-baseline.html: Added.

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

6 weeks agoRevert r262654 because it caused <rdar://problem/64664156>.
dbates@webkit.org [Sat, 27 Jun 2020 22:59:30 +0000 (22:59 +0000)]
Revert r262654 because it caused <rdar://problem/64664156>.
Moreover it is no longer necessary as the embedding client
changes selection through a different SPI after focusing.

Source/WebKit:

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView cleanUpInteraction]):
(-[WKContentView _didCommitLoadForMainFrame]):
(-[WKContentView _focusTextInputContext:placeCaretAt:completionHandler:]):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/RequestTextInputContext.mm:
(TestWebKitAPI::TEST):

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

6 weeks agocompare-results should be able to parse multiple JSONs at once by merging them
keith_miller@apple.com [Sat, 27 Jun 2020 22:18:41 +0000 (22:18 +0000)]
compare-results should be able to parse multiple JSONs at once by merging them
https://bugs.webkit.org/show_bug.cgi?id=213685

Reviewed by Saam Barati.

This patch improves the compare-results script to enable it to
merge JSON output files. This is handy when running scripts by
hand where you'll get many a and b JSONs.  To do the merging this
patch moves the logic of merge-result-jsons into a shared library.

compare-results can take multiple files sequentally or by passing
the '-a'/'-b' flags multiple times. e.g. `/compare-results -a
OG-1.json -a OG-2.json -a OG-3.json -a OG-4.json -b MC-1.json
MC-2.json MC-3.json MC-4.json` will behave as you'd expect;
combining all the OG JSONs and the MC JSONs before computing the
result.

Lastly, the benchmark_results script now can handle duplicates of
an aggregator in the aggregator list. This is useful because
otherwise the logic of merging JSONs is significantly more
complicated.

* Scripts/compare-results:
(getOptions):
(main):
* Scripts/merge-result-jsons:
(readJSONFile):
(deepAppend): Deleted.
(mergeJSONs): Deleted.
* Scripts/webkitpy/benchmark_runner/benchmark_json_merge.py: Copied from Tools/Scripts/merge-result-jsons.
(deepAppend):
(mergeJSONs):
* Scripts/webkitpy/benchmark_runner/benchmark_results.py:
(BenchmarkResults._aggregate_results_for_test):
(BenchmarkResults._lint_subtest_results):
* Scripts/webkitpy/benchmark_runner/benchmark_results_unittest.py:

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

6 weeks agoFix missing exception check in createIDBKeyFromValue().
mark.lam@apple.com [Sat, 27 Jun 2020 22:14:05 +0000 (22:14 +0000)]
Fix missing exception check in createIDBKeyFromValue().
https://bugs.webkit.org/show_bug.cgi?id=213681
<rdar://problem/64804893>

Reviewed by Chris Dumez.

Source/WebCore:

Test: storage/indexeddb/missing-exception-check-in-IDBKey.html

Also fixed up miscellaneous other exception check related code to enable the
new test to run with exception check validation.

* bindings/js/IDBBindingUtilities.cpp:
(WebCore::createIDBKeyFromValue):
* bindings/js/JSDOMBindingSecurity.cpp:
(WebCore::BindingSecurity::shouldAllowAccessToDOMWindow):
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::updateDocument):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::put):
(WebCore::JSDOMWindow::defineOwnProperty):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::initScriptForWindowProxy):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateAttributeGetterBodyDefinition):
(GenerateAttributeSetterBodyDefinition):
(GenerateOperationBodyDefinition):
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
(WebCore::jsTestActiveDOMObjectExcitingAttrGetter):
(WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunctionBody):
(WebCore::jsTestActiveDOMObjectPrototypeFunctionOverloadedMethodOverloadDispatcher):
* bridge/objc/WebScriptObject.mm:
(-[WebScriptObject _isSafeScript]):
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::injectInternalsObject):

LayoutTests:

* storage/indexeddb/missing-exception-check-in-IDBKey-expected.txt: Added.
* storage/indexeddb/missing-exception-check-in-IDBKey.html: Added.

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

6 weeks agoiOS Safari incorrectly reports "AppleCoreMedia" as UA string
jer.noble@apple.com [Sat, 27 Jun 2020 19:31:17 +0000 (19:31 +0000)]
iOS Safari incorrectly reports "AppleCoreMedia" as UA string
https://bugs.webkit.org/show_bug.cgi?id=213245
<rdar://problem/64471582>

Reviewed by Youenn Fablet.

Source/WebCore:

Tests: TestWebKitAPI.MediaLoading.UserAgentStringCRABS
       TestWebKitAPI.MediaLoading.UserAgentStringHLS

* platform/network/cocoa/WebCoreNSURLSession.mm:
(-[WebCoreNSURLSessionDataTask initWithSession:identifier:request:]):

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/MediaLoading.mm: Added.
(TestWebKitAPI::parseUserAgent):
(TestWebKitAPI::TEST):

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

7 weeks agoUpdate web-platform-tests/cors from upstream
cdumez@apple.com [Sat, 27 Jun 2020 17:36:43 +0000 (17:36 +0000)]
Update web-platform-tests/cors from upstream
https://bugs.webkit.org/show_bug.cgi?id=213668

Reviewed by Sam Weinig.

Update web-platform-tests/cors from upstream b076c305a256e7.

LayoutTests/imported/w3c:

* web-platform-tests/cors/*: Updated.

LayoutTests:

* tests-options.json:

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

7 weeks agoMigrate run-minibrowser to webkitpy
commit-queue@webkit.org [Sat, 27 Jun 2020 17:00:49 +0000 (17:00 +0000)]
Migrate run-minibrowser to webkitpy
https://bugs.webkit.org/show_bug.cgi?id=213431

Patch by Philippe Normand <pnormand@igalia.com> on 2020-06-27
Reviewed by Jonathan Bedard.

The perl version was renamed to old-run-minibrowser and remains used by the Mac ports.
run-minibrowser is now a Python script hooking into webkitpy and the Port infrastructure.
Both WPE and GTK ports will now use the pure python implementation.

* Scripts/old-run-minibrowser: Copied from Tools/Scripts/run-minibrowser.
* Scripts/run-minibrowser:
* Scripts/webkitpy/minibrowser/run_minibrowser.py: Added.
(main):
(parse_args):
* Scripts/webkitpy/port/base.py:
(Port.run_minibrowser_arguments):
(Port):
(Port.run_minibrowser):
* Scripts/webkitpy/port/darwin.py:
(DarwinPort.environment_for_api_tests):
(DarwinPort):
(DarwinPort.run_minibrowser_arguments):
* Scripts/webkitpy/port/gtk.py:
(GtkPort.show_results_html_file):
(GtkPort.configuration_for_upload):
(GtkPort):
(GtkPort.run_minibrowser):
* Scripts/webkitpy/port/wpe.py:
(WPEPort.show_results_html_file):
(WPEPort.configuration_for_upload):
(WPEPort):
(WPEPort.run_minibrowser):

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

7 weeks agoRequire <form> to be connected
commit-queue@webkit.org [Sat, 27 Jun 2020 16:44:03 +0000 (16:44 +0000)]
Require <form> to be connected
https://bugs.webkit.org/show_bug.cgi?id=177356

Patch by Rob Buis <rbuis@igalia.com> on 2020-06-27
Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

Update improved test result.

* web-platform-tests/html/semantics/forms/form-submission-0/submission-checks.window-expected.txt:

Source/WebCore:

Implement step 1 of [1], i.e. do not submit form if it
is not connected.

Test: imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/submission-checks.html

[1] https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#concept-form-submit

* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::submit):

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

7 weeks agoLog capture device information in case of getUserMedia failing to select a device
youenn@apple.com [Sat, 27 Jun 2020 16:20:26 +0000 (16:20 +0000)]
Log capture device information in case of getUserMedia failing to select a device
https://bugs.webkit.org/show_bug.cgi?id=213643

Reviewed by Eric Carlson.

Log constraints and device in case of a failing getUserMedia call.
No obserable change, logging addition.

* platform/mediastream/mac/CoreAudioCaptureDevice.cpp:
(WebCore::getDeviceInfo):
(WebCore::CoreAudioCaptureDevice::deviceClock):
* platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp:
(WebCore::isValidCaptureDevice):
* platform/mediastream/MediaConstraints.cpp:
(WebCore::MediaConstraint::log const):
(WebCore::BooleanConstraint::logAsBoolean const):
(WebCore::DoubleConstraint::logAsDouble const):
(WebCore::IntConstraint::logAsInt const):
* platform/mediastream/MediaConstraints.h:
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::supportsSizeAndFrameRate):
(WebCore::RealtimeMediaSource::selectSettings):
* platform/mediastream/RealtimeMediaSourceCenter.cpp:
(WebCore::RealtimeMediaSourceCenter::validateRequestConstraints):
* platform/mediastream/RealtimeVideoCaptureSource.cpp:
(WebCore::RealtimeVideoCaptureSource::bestSupportedSizeAndFrameRate):
* platform/mediastream/VideoPreset.h:
(WebCore::VideoPreset::log const):

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

7 weeks agoProtect SWServer::claim from a registration without active worker
youenn@apple.com [Sat, 27 Jun 2020 16:13:56 +0000 (16:13 +0000)]
Protect SWServer::claim from a registration without active worker
https://bugs.webkit.org/show_bug.cgi?id=213597

Reviewed by Chris Dumez.

SWServerWorker might be active while being terminated.
If terminated as part of SWServerRegistration::clear, the registration no longer has a service worker.
SWServer::claim should therefore check for registration active worker.
This is difficult to test as one needs to claim at the time the service worker is being terminated but not yet terminated.

* workers/service/server/SWServer.cpp:
(WebCore::SWServer::claim):

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

7 weeks agoUpdate web-platform-tests/common from upstream
cdumez@apple.com [Sat, 27 Jun 2020 16:08:59 +0000 (16:08 +0000)]
Update web-platform-tests/common from upstream
https://bugs.webkit.org/show_bug.cgi?id=213665

Reviewed by Sam Weinig.

Update web-platform-tests/common from upstream b076c305a256e7fb7.

* web-platform-tests/common/*: Updated.

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