WebKit-https.git
3 months agoUnreviewed, rolling out r245401.
commit-queue@webkit.org [Fri, 17 May 2019 17:30:22 +0000 (17:30 +0000)]
Unreviewed, rolling out r245401.
https://bugs.webkit.org/show_bug.cgi?id=197990

Causing internal build failures (Requested by ShawnRoberts on
#webkit).

Reverted changeset:

"Add SPI to set a list of hosts to which to send custom header
fields cross-origin"
https://bugs.webkit.org/show_bug.cgi?id=197397
https://trac.webkit.org/changeset/245401

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

3 months agoSVGElement should detach itself from all its properties before it is deleted
said@apple.com [Fri, 17 May 2019 17:26:05 +0000 (17:26 +0000)]
SVGElement should detach itself from all its properties before it is deleted
https://bugs.webkit.org/show_bug.cgi?id=197954

Reviewed by Simon Fraser.

Source/WebCore:

Before deleting the SVGElement node, SVGElement::detachAllProperties()
needs to be called. This will make the properties be detached objects
which means no change will be committed unless these properties are
attached to another owner.

Test: svg/dom/svg-properties-detach-change.html

* dom/Node.cpp:
(WebCore::Node::removedLastRef):
* svg/SVGElement.h:
(WebCore::SVGElement::detachAllProperties):

LayoutTests:

* svg/dom/svg-properties-detach-change-expected.txt: Added.
* svg/dom/svg-properties-detach-change.html : Added.

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

3 months agoUnreviewed, rolling out r245418.
commit-queue@webkit.org [Fri, 17 May 2019 17:22:40 +0000 (17:22 +0000)]
Unreviewed, rolling out r245418.
https://bugs.webkit.org/show_bug.cgi?id=197989

New API test causing crashes on Mojave testers (Requested by
ShawnRoberts on #webkit).

Reverted changeset:

"Add a unit test for client certificate authentication"
https://bugs.webkit.org/show_bug.cgi?id=197800
https://trac.webkit.org/changeset/245418

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

3 months agoAllow sequential playback of media files when initial playback started with a user...
eric.carlson@apple.com [Fri, 17 May 2019 16:39:09 +0000 (16:39 +0000)]
Allow sequential playback of media files when initial playback started with a user gesture
https://bugs.webkit.org/show_bug.cgi?id=197959
<rdar://problem/50655207>

Reviewed by Youenn Fablet.

Source/WebCore:

Test: media/playlist-inherits-user-gesture.html

* dom/Document.cpp:
(WebCore::Document::processingUserGestureForMedia const): Return true if it is within
one second of the last HTMLMediaElement 'ended' event.
* dom/Document.h:
(WebCore::Document::mediaFinishedPlaying):

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseAttribute): removeBehaviorsRestrictionsAfterFirstUserGesture ->
removeBehaviorRestrictionsAfterFirstUserGesture.
(WebCore::HTMLMediaElement::load): Ditto. Don't call removeBehaviorsRestrictionsAfterFirstUserGesture,
it will be done in prepareForLoad.
(WebCore::HTMLMediaElement::prepareForLoad): removeBehaviorsRestrictionsAfterFirstUserGesture ->
removeBehaviorRestrictionsAfterFirstUserGesture.
(WebCore::HTMLMediaElement::audioTrackEnabledChanged): Ditto.
(WebCore::HTMLMediaElement::play): Ditto.
(WebCore::HTMLMediaElement::pause): Ditto.
(WebCore::HTMLMediaElement::setVolume): Ditto.
(WebCore::HTMLMediaElement::setMuted): Ditto.
(WebCore::HTMLMediaElement::webkitShowPlaybackTargetPicker): Ditto.
(WebCore::HTMLMediaElement::dispatchEvent): Call document().mediaFinishedPlaying()
when dispatching the 'ended' event.
(WebCore::HTMLMediaElement::removeBehaviorRestrictionsAfterFirstUserGesture): Rename. Set
m_removedBehaviorRestrictionsAfterFirstUserGesture.
(WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture): Deleted.
* html/HTMLMediaElement.h:

* html/HTMLVideoElement.cpp:
(WebCore:HTMLVideoElement::nativeImageForCurrentTime): Convert to runtime logging.
(WebCore:HTMLVideoElement::webkitEnterFullscreen): Ditto.
(WebCore:HTMLVideoElement::webkitSetPresentationMode): Ditto.
(WebCore:HTMLVideoElement::fullscreenModeChanged): Ditto.

* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::removeBehaviorRestriction): Update log message.

LayoutTests:

* media/media-fullscreen.js: Insert a pause between tests to clear the user gesture
used in the first test.
* media/playlist-inherits-user-gesture-expected.txt: Added.
* media/playlist-inherits-user-gesture.html: Added.

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

3 months agoUnmark several skipped tests in wk2
tsavell@apple.com [Fri, 17 May 2019 16:27:34 +0000 (16:27 +0000)]
Unmark several skipped tests in wk2
https://bugs.webkit.org/show_bug.cgi?id=197987

Unreviewed test gardening

* platform/wk2/TestExpectations:

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

3 months ago[iOS] Respect scrolling="no" on composited frames
antti@apple.com [Fri, 17 May 2019 16:14:06 +0000 (16:14 +0000)]
[iOS] Respect scrolling="no" on composited frames
https://bugs.webkit.org/show_bug.cgi?id=197972
<rdar://problem/50252398>

Reviewed by Simon Fraser.

Source/WebKit:

* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):

Disallow scrolling based on canHaveScrollbars, similar to main frame.

(WebKit::ScrollingTreeScrollingNodeDelegateIOS::repositionScrollingLayers):
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollView const):

Factor into a function.

LayoutTests:

* fast/scrolling/ios/body-overflow-hidden-frame-expected.html:
* fast/scrolling/ios/body-overflow-hidden-frame.html:

Also fix overflow:hidden test so that the frame content forces composition.

* fast/scrolling/ios/frame-scrolling-no-expected.html: Added.
* fast/scrolling/ios/frame-scrolling-no.html: Added.

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

3 months agoHardening: Prevent FrameLoader crash due to SetForScope
bfulgham@apple.com [Fri, 17 May 2019 16:03:36 +0000 (16:03 +0000)]
Hardening: Prevent FrameLoader crash due to SetForScope
https://bugs.webkit.org/show_bug.cgi?id=197458
<rdar://problem/50368338>

Reviewed by Chris Dumez.

Since SetForScope takes action during a function returns, it might cause
a crash if its scope is broader than the value it is resetting.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadDifferentDocumentItem):

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

3 months agoUnreviewed. Fix variations shown in GTK emoji chooser after r245460.
carlosgc@webkit.org [Fri, 17 May 2019 15:07:14 +0000 (15:07 +0000)]
Unreviewed. Fix variations shown in GTK emoji chooser after r245460.

We are tno showing the variations in the sub-popover because of a missing parameter in
webkitEmojiChooserAddEmoji() call.

* UIProcess/API/gtk/WebKitEmojiChooser.cpp:
(webkitEmojiChooserShowVariations): Pass prepend parameter to webkitEmojiChooserAddEmoji().

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

3 months ago[ews-build] Add build step to Transfer archive to S3
aakash_jain@apple.com [Fri, 17 May 2019 14:32:17 +0000 (14:32 +0000)]
[ews-build] Add build step to Transfer archive to S3
https://bugs.webkit.org/show_bug.cgi?id=197922

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/steps.py:
(TransferToS3):
(TransferToS3.finished): Invoke triggers after transfer is successful.
(TransferToS3.getResultSummary): Create more readable failure string.
(UploadBuiltProduct.finished): Deleted. Moved the trigger invocation after TransferToS3.
* BuildSlaveSupport/ews-build/steps_unittest.py: Added unit-tests.

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

3 months ago[GTK] Need WebKitContextMenuItemType to open emoji picker
carlosgc@webkit.org [Fri, 17 May 2019 12:39:30 +0000 (12:39 +0000)]
[GTK] Need WebKitContextMenuItemType to open emoji picker
https://bugs.webkit.org/show_bug.cgi?id=176760

Reviewed by Michael Catanzaro.

Source/WebCore:

Add a new context menu item to insert an emoji.

* loader/EmptyClients.cpp: Empty implementation of ContextMenuClient::insertEmoji().
* page/ContextMenuClient.h: Add insertEmoji for GTK port.
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::contextMenuItemSelected): Handle insert emoji action.
(WebCore::ContextMenuController::populate): Add insert emoji item after select all.
(WebCore::ContextMenuController::checkOrEnableIfNeeded const): Handle insert emoji action.
* platform/ContextMenuItem.h: Add insert emoji action.
* platform/LocalizedStrings.h:
* platform/gtk/LocalizedStringsGtk.cpp:
(WebCore::contextMenuItemTagInsertEmoji):

Source/WebCore/platform/gtk/po:

* POTFILES.in: Add WebKitEmojiChooser.cpp.

Source/WebKit:

Add a default implementation to show the emoji chooser when requested by the application, either using the
context menu or keyboard shortcuts. GtkEmojiChooser is private in GTK, so we include our own copy, adapted to
the WebKit coding style. The emoji chooser is always shown by default when using GTK >= 3.24 for any editable
content. I'm going to add public API in a follow up patch to be able to use your own chooser, or even prevent
the default chooser from being shown, similar to what we do for other UI elements like file chooser, color
chooser, print dialog, etc.

* Shared/API/glib/WebKitContextMenuActions.cpp:
(webkitContextMenuActionGetActionTag): Handle insert emoji action.
(webkitContextMenuActionGetForContextMenuItem): Ditto.
(webkitContextMenuActionGetLabel): Ditto.
* SourcesGTK.txt:
* UIProcess/API/gtk/WebKitContextMenuActions.h:
* UIProcess/API/gtk/WebKitEmojiChooser.cpp: Added.
(webkitEmojiChooserAddEmoji):
(webkitEmojiChooserAddRecentItem):
(emojiActivated):
(emojiDataHasVariations):
(webkitEmojiChooserShowVariations):
(emojiLongPressed):
(emojiPressed):
(emojiPopupMenu):
(verticalAdjustmentChanged):
(webkitEmojiChooserSetupSectionBox):
(scrollToSection):
(webkitEmojiChooserSetupSectionButton):
(webkitEmojiChooserSetupRecent):
(webkitEmojiChooserEnsureEmptyResult):
(webkitEmojiChooserSearchChanged):
(webkitEmojiChooserSetupFilters):
(webkitEmojiChooserInitializeEmojiMaxWidth):
(webkitEmojiChooserConstructed):
(webkitEmojiChooserShow):
(webkit_emoji_chooser_class_init):
(webkitEmojiChooserNew):
* UIProcess/API/gtk/WebKitEmojiChooser.h: Added.
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(_WebKitWebViewBasePrivate::_WebKitWebViewBasePrivate): Add a timer to release the emoji chooser if not used
after 2 minutes.
(_WebKitWebViewBasePrivate::releaseEmojiChooserTimerFired): Destroy the emoji chooser.
(emojiChooserEmojiPicked): Complete the operation using the given emoji text.
(emojiChooserClosed): Complete the operation if needed using an empty string.
(webkitWebViewBaseShowEmojiChooser): Create the emoji chooser if needed and show it.
* UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
* UIProcess/WebPageProxy.h: Add showEmojiPicker().
* UIProcess/WebPageProxy.messages.in: Add ShowEmojiPicker message.
* UIProcess/gtk/KeyBindingTranslator.cpp:
(WebKit::insertEmojiCallback): Add GtkInsertEmoji command.
(WebKit::KeyBindingTranslator::KeyBindingTranslator): Connect to insert-emoji signal.
* UIProcess/gtk/WebPageProxyGtk.cpp:
(WebKit::WebPageProxy::showEmojiPicker): Call webkitWebViewBaseShowEmojiChooser().
* WebProcess/WebCoreSupport/WebContextMenuClient.h: Override insertEmoji() for GTK port.
* WebProcess/WebCoreSupport/WebEditorClient.h: Add insertEmoji() for GTK port.
* WebProcess/WebCoreSupport/gtk/WebContextMenuClientGtk.cpp:
(WebKit::WebContextMenuClient::insertEmoji): Call WebPage::showEmojiPicker().
* WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
(WebKit::WebEditorClient::handleGtkEditorCommand): Call WebPage::showEmojiPicker() if command is GtkInsertEmoji.
(WebKit::WebEditorClient::executePendingEditorCommands): Handle Gtk specific commands.
(WebKit::WebEditorClient::handleKeyboardEvent): Use a reference instead of a pointer for Frame.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/gtk/WebPageGtk.cpp:
(WebKit::WebPage::showEmojiPicker): Send ShowEmojiPicker message to the UI process.

Tools:

Update context menu test to check insert emoji action is included in default context menu for editable content.

* TestWebKitAPI/Tests/WebKitGtk/TestContextMenu.cpp:

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

3 months ago[ews-build] Download archives from S3
aakash_jain@apple.com [Fri, 17 May 2019 04:30:32 +0000 (04:30 +0000)]
[ews-build] Download archives from S3
https://bugs.webkit.org/show_bug.cgi?id=197949

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/steps.py:
(DownloadBuiltProduct): Updated to use S3 URL.
(DownloadBuiltProduct.getResultSummary): Method to display custom failure string.
* BuildSlaveSupport/ews-build/steps_unittest.py: Updated unit-tests.

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

3 months agoWasm should cage the memory base pointers in structs
keith_miller@apple.com [Fri, 17 May 2019 02:21:51 +0000 (02:21 +0000)]
Wasm should cage the memory base pointers in structs
https://bugs.webkit.org/show_bug.cgi?id=197620

Reviewed by Saam Barati.

Source/bmalloc:

Fix signature to take Gigacage::Kind, which matches GIGACAGE_ENABLED build.

* bmalloc/Gigacage.h:
(Gigacage::isEnabled):

Source/JavaScriptCore:

Currently, we use cageConditionally; this only matters for API
users since the web content process cannot disable primitive
gigacage. This patch also adds a set helper for union/intersection
of RegisterSets.

* assembler/CPU.h:
(JSC::isARM64E):
* jit/RegisterSet.h:
(JSC::RegisterSet::set):
* wasm/WasmAirIRGenerator.cpp:
(JSC::Wasm::AirIRGenerator::restoreWebAssemblyGlobalState):
(JSC::Wasm::AirIRGenerator::addCallIndirect):
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::restoreWebAssemblyGlobalState):
(JSC::Wasm::B3IRGenerator::addCallIndirect):
* wasm/WasmBinding.cpp:
(JSC::Wasm::wasmToWasm):
* wasm/WasmInstance.h:
(JSC::Wasm::Instance::cachedMemory const):
(JSC::Wasm::Instance::updateCachedMemory):
* wasm/WasmMemory.cpp:
(JSC::Wasm::Memory::grow):
* wasm/WasmMemory.h:
(JSC::Wasm::Memory::memory const):
* wasm/js/JSToWasm.cpp:
(JSC::Wasm::createJSToWasmWrapper):
* wasm/js/WebAssemblyFunction.cpp:
(JSC::WebAssemblyFunction::jsCallEntrypointSlow):

Source/WTF:

Rename reauthenticate to recage.

* wtf/CagedPtr.h:
(WTF::CagedPtr::recage):
(WTF::CagedPtr::reauthenticate): Deleted.

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

3 months agoREGRESSION (r15133): Fix leak of JSStringRef in minidom
ddkilzer@apple.com [Fri, 17 May 2019 01:17:47 +0000 (01:17 +0000)]
REGRESSION (r15133): Fix leak of JSStringRef in minidom
<https://webkit.org/b/197968>
<rdar://problem/50872430>

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* API/tests/minidom.c:
(print): Call JSStringRelease() to fix the leak.

Tools:

* TestWebKitAPI/Tests/WebKitObjC/UserContentTest.mm:
(expectScriptValueIsString): Drive-by fix to use adopt() instead
of JSRetainPtr<JSStringRef> string(Adopt, JSValueToStringCopy(...)).

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

3 months agoAX: Unship some ARIA string reflectors that are to-be-replaced by element reflection
commit-queue@webkit.org [Fri, 17 May 2019 00:07:44 +0000 (00:07 +0000)]
AX: Unship some ARIA string reflectors that are to-be-replaced by element reflection
https://bugs.webkit.org/show_bug.cgi?id=197764
<rdar://problem/50649689>

Patch by Greg Doolittle <gr3g@apple.com> on 2019-05-16
Reviewed by Chris Fleizach.

Specifically these:
- ariaActiveDescendant
- ariaControls
- ariaDescribedBy
- ariaDetails
- ariaErrorMessage
- ariaFlowTo
- ariaLabelledBy
- ariaOwns

Source/WebCore:

Test: LayoutTests/accessibility/ARIA-reflections.html (updated)

* accessibility/AriaAttributes.idl:

LayoutTests:

* accessibility/ARIA-reflection-expected.txt: Updated.
* accessibility/ARIA-reflection.html: Updated.

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

3 months agoStorage Access API: Call completion handlers in NetworkConnectionToWebProcess::hasSto...
wilander@apple.com [Thu, 16 May 2019 23:33:39 +0000 (23:33 +0000)]
Storage Access API: Call completion handlers in NetworkConnectionToWebProcess::hasStorageAccess() and NetworkConnectionToWebProcess::requestStorageAccess() when feature is off
https://bugs.webkit.org/show_bug.cgi?id=197967
<rdar://problem/50753129>

Reviewed by Brent Fulgham.

Source/WebKit:

NetworkConnectionToWebProcess::hasStorageAccess() and NetworkConnectionToWebProcess::requestStorageAccess()
should call their completion handlers when there is no Resource Load Statistics object, i.e. when Resource
Load Statistics is off. This happens for ephemeral sessions which made code for federated login providers
hang, waiting for the result to document.hasStorageAccess().

The existing layout test case was augmented to use an ephemeral session.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::hasStorageAccess):
(WebKit::NetworkConnectionToWebProcess::requestStorageAccess):

LayoutTests:

* http/tests/storageAccess/has-storage-access-true-if-feature-off.html:
* platform/mac-wk2/TestExpectations:
    Test case marked as [ Pass ].

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

3 months agoREGRESSION (r84160): Leak of OpaqueJSString under WTR::JSTestRunner::pathToLocalResou...
ddkilzer@apple.com [Thu, 16 May 2019 23:24:10 +0000 (23:24 +0000)]
REGRESSION (r84160): Leak of OpaqueJSString under WTR::JSTestRunner::pathToLocalResource (32 bytes) in com.apple.WebKit.WebContent running layout tests
<https://webkit.org/b/197965>

Reviewed by Joseph Pecoraro.

* WebKitTestRunner/InjectedBundle/mac/TestRunnerMac.mm:
(WTR::TestRunner::pathToLocalResource): Don't call
JSStringRetain() here because the JSRetainPtr<JSStringRef>
return type will increment the retain count for us.

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

3 months agoAdd a unit test for client certificate authentication
commit-queue@webkit.org [Thu, 16 May 2019 23:08:46 +0000 (23:08 +0000)]
Add a unit test for client certificate authentication
https://bugs.webkit.org/show_bug.cgi?id=197800

Patch by Alex Christensen <achristensen@webkit.org> on 2019-05-16
Reviewed by Youenn Fablet.

Source/WebKit:

* Shared/cf/ArgumentCodersCF.cpp:
Move SPI declarations to SecuritySPI.h.

Source/WTF:

* wtf/spi/cocoa/SecuritySPI.h:
Move declarations from ArgumentCodersCF.cpp so they can be shared.

Tools:

Make better abstractions for reading and writing from/to TCPServer.
Add a unit test that causes a client certificate authentication challenge to happen.

* TestWebKitAPI/TCPServer.cpp:
(TestWebKitAPI::TCPServer::TCPServer):
(TestWebKitAPI::TCPServer::read):
(TestWebKitAPI::TCPServer::write):
(TestWebKitAPI::TCPServer::respondWithChallengeThenOK):
(TestWebKitAPI::TCPServer::respondWithOK):
* TestWebKitAPI/TCPServer.h:
* TestWebKitAPI/Tests/WebKitCocoa/Challenge.mm:
(credentialWithIdentity):
(-[ChallengeDelegate webView:didReceiveAuthenticationChallenge:completionHandler:]):
(TEST):
(-[ClientCertificateDelegate webView:didFinishNavigation:]):
(-[ClientCertificateDelegate webView:didReceiveAuthenticationChallenge:completionHandler:]):
(-[ClientCertificateDelegate challengeCount]):
(TestWebKitAPI::TEST):
(respondWithChallengeThenOK): Deleted.
(credentialWithIdentityAndKeychainPath): Deleted.
* TestWebKitAPI/Tests/WebKitCocoa/PDFLinkReferrer.mm:
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/Proxy.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitCocoa/WKNavigationResponse.mm:
(TEST):
(readRequest): Deleted.
(writeResponse): Deleted.
* TestWebKitAPI/Tests/WebKitCocoa/WKWebsiteDatastore.mm:
(TestWebKitAPI::TEST):
(TestWebKitAPI::respondWithChallengeThenOK): Deleted.

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

3 months agoCoreAudioCaptureSource should be marked as an audio capture track
youenn@apple.com [Thu, 16 May 2019 21:50:05 +0000 (21:50 +0000)]
CoreAudioCaptureSource should be marked as an audio capture track
https://bugs.webkit.org/show_bug.cgi?id=197953
<rdar://problem/50552007>

Reviewed by Eric Carlson.

Manually tested.

* platform/mediastream/mac/CoreAudioCaptureSource.h:
Mark it as microphone so that it can get muted properly.

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

3 months ago[JSC] Invalid AssignmentTargetType should be an early error.
ross.kirsling@sony.com [Thu, 16 May 2019 20:08:22 +0000 (20:08 +0000)]
[JSC] Invalid AssignmentTargetType should be an early error.
https://bugs.webkit.org/show_bug.cgi?id=197603

Reviewed by Keith Miller.

JSTests:

* test262/expectations.yaml:
Update expectations to reflect new SyntaxErrors.
(Ideally, these should all be viewed as passing in the near future.)

* stress/async-await-basic.js:
* stress/big-int-literals.js:
Update tests to reflect new SyntaxErrors.

* ChakraCore.yaml:
* ChakraCore/test/EH/try6.baseline-jsc:
* ChakraCore/test/Error/variousErrors3.baseline-jsc: Added.
Update baselines to reflect new SyntaxErrors.

Source/JavaScriptCore:

Since ES6, expressions like 0++, ++0, 0 = 0, and 0 += 0 are all specified as early errors:
  https://tc39.github.io/ecma262/#sec-update-expressions-static-semantics-early-errors
  https://tc39.github.io/ecma262/#sec-assignment-operators-static-semantics-early-errors

We currently throw late ReferenceErrors for these -- let's turn them into early SyntaxErrors.
(This is based on the expectation that https://github.com/tc39/ecma262/pull/1527 will be accepted;
if that doesn't come to pass, we can subsequently introduce early ReferenceError and revise these.)

* bytecompiler/NodesCodegen.cpp:
(JSC::PostfixNode::emitBytecode): Add an assert for "function call LHS" case.
(JSC::PrefixNode::emitBytecode): Add an assert for "function call LHS" case.

* parser/ASTBuilder.h:
(JSC::ASTBuilder::isLocation): Added.
(JSC::ASTBuilder::isAssignmentLocation): Fix misleading parameter name.
(JSC::ASTBuilder::isFunctionCall): Added.
(JSC::ASTBuilder::makeAssignNode): Add an assert for "function call LHS" case.
* parser/SyntaxChecker.h:
(JSC::SyntaxChecker::isLocation): Added.
(JSC::SyntaxChecker::isAssignmentLocation): Fix incorrect definition and align with ASTBuilder.
(JSC::SyntaxChecker::isFunctionCall): Added.
* parser/Nodes.h:
(JSC::ExpressionNode::isFunctionCall const): Added.
Ensure that the parser can check whether an expression node is a function call.

* parser/Parser.cpp:
(JSC::Parser<LexerType>::isSimpleAssignmentTarget): Added.
(JSC::Parser<LexerType>::parseAssignmentExpression):
(JSC::Parser<LexerType>::parseUnaryExpression): See below.
* parser/Parser.h:
Throw SyntaxError whenever an assignment or update expression's target is invalid.
Unfortunately, it seems that web compatibility obliges us to exempt the "function call LHS" case in sloppy mode.
(https://github.com/tc39/ecma262/issues/257#issuecomment-195106880)

Additional cleanup items:
  - Make use of `semanticFailIfTrue` for `isMetaProperty` checks, as it's equivalent.
  - Rename `requiresLExpr` to `hasPrefixUpdateOp` since it's now confusing,
    and get rid of `modifiesExpr` since it refers to the exact same condition.
  - Stop setting `lastOperator` near the end -- one case was incorrect and regardless neither is used.

LayoutTests:

* fast/events/window-onerror4-expected.txt:
* ietestcenter/Javascript/11.13.1-1-1-expected.txt:
* ietestcenter/Javascript/11.13.1-1-2-expected.txt:
* ietestcenter/Javascript/11.13.1-1-3-expected.txt:
* ietestcenter/Javascript/11.13.1-1-4-expected.txt:
* js/basic-strict-mode-expected.txt:
* js/dom/assign-expected.txt:
* js/dom/line-column-numbers-expected.txt:
* js/dom/line-column-numbers.html:
* js/dom/postfix-syntax-expected.txt:
* js/dom/prefix-syntax-expected.txt:
* js/dom/script-tests/line-column-numbers.js:
* js/function-toString-parentheses-expected.txt:
* js/parser-syntax-check-expected.txt:
* js/parser-xml-close-comment-expected.txt:
* js/script-tests/function-toString-parentheses.js:
* js/script-tests/parser-syntax-check.js:
Update tests & expectations to reflect new SyntaxErrors.

* js/script-tests/toString-prefix-postfix-preserve-parens.js:
* js/toString-prefix-postfix-preserve-parens-expected.txt:
None of the prefix/postfix tests make sense here now that they're all SyntaxErrors;
remove them and just leave the typeof tests.

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

3 months agoLayout Test http/wpt/cache-storage/cache-quota-add.any.html is a flaky failure
youenn@apple.com [Thu, 16 May 2019 18:31:23 +0000 (18:31 +0000)]
Layout Test http/wpt/cache-storage/cache-quota-add.any.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=197952
<rdar://problem/50859168>

Unreviewed.

* platform/ios-simulator-wk2/TestExpectations:
Mark test as slow as per flakiness dashboard.

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

3 months agoAdd SPI to set a list of hosts to which to send custom header fields cross-origin
commit-queue@webkit.org [Thu, 16 May 2019 18:08:30 +0000 (18:08 +0000)]
Add SPI to set a list of hosts to which to send custom header fields cross-origin
https://bugs.webkit.org/show_bug.cgi?id=197397

Patch by Alex Christensen <achristensen@webkit.org> on 2019-05-16
Reviewed by Geoff Garen.

Source/WebCore:

In r223001 I added the ability to send custom headers, but with a restriction that they will not be sent except to the origin of the main document.
We need the ability to specify what origins to send these headers to even if they are not first party requests.
We get this information in a list of strings which are the hosts to send the headers to.  Some of the strings have an asterisk at the beginning,
indicating that the headers are to be sent to all subdomains.

I repurposed some ObjC SPI that was never adopted, but I keep testing the C API that was to verify no regression.
I also added some new API tests for the new behavior.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* loader/CustomHeaderFields.cpp: Added.
(WebCore::CustomHeaderFields::thirdPartyDomainsMatch const):
* loader/CustomHeaderFields.h: Added.
(WebCore::CustomHeaderFields::encode const):
(WebCore::CustomHeaderFields::decode):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::setCustomHeaderFields): Deleted.
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::setCustomHeaderFields):
(WebCore::DocumentLoader::customHeaderFields const):
(WebCore::DocumentLoader::customHeaderFields): Deleted.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):

Source/WebKit:

* Shared/API/APIObject.h:
* Shared/Cocoa/APIObject.mm:
(API::Object::newObject):
* Shared/WebsitePoliciesData.cpp:
(WebKit::WebsitePoliciesData::decode):
* Shared/WebsitePoliciesData.h:
* SourcesCocoa.txt:
* UIProcess/API/APICustomHeaderFields.h: Added.
* UIProcess/API/APIWebsitePolicies.cpp:
(API::WebsitePolicies::WebsitePolicies):
(API::WebsitePolicies::copy const):
(API::WebsitePolicies::data):
* UIProcess/API/APIWebsitePolicies.h:
* UIProcess/API/C/WKWebsitePolicies.cpp:
(WKWebsitePoliciesCopyCustomHeaderFields):
(WKWebsitePoliciesSetCustomHeaderFields):
* UIProcess/API/Cocoa/WKWebpagePreferences.mm:
(-[WKWebpagePreferences _customHeaderFields]):
(-[WKWebpagePreferences _setCustomHeaderFields:]):
* UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h:
* UIProcess/API/Cocoa/_WKCustomHeaderFields.h: Added.
* UIProcess/API/Cocoa/_WKCustomHeaderFields.mm: Added.
(-[_WKCustomHeaderFields init]):
(-[_WKCustomHeaderFields dealloc]):
(-[_WKCustomHeaderFields fields]):
(-[_WKCustomHeaderFields setFields:]):
(-[_WKCustomHeaderFields thirdPartyDomains]):
(-[_WKCustomHeaderFields setThirdPartyDomains:]):
(-[_WKCustomHeaderFields _apiObject]):
* UIProcess/API/Cocoa/_WKCustomHeaderFieldsInternal.h: Added.
* UIProcess/API/Cocoa/_WKWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
(-[_WKWebsitePolicies customHeaderFields]): Deleted.
(-[_WKWebsitePolicies setCustomHeaderFields:]): Deleted.
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::takeFocus):
(WebKit::WebViewImpl::accessibilityAttributeValue):
* WebKit.xcodeproj/project.pbxproj:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm:
(TEST):
(expectLegacyHeaders):
(expectHeaders):
(-[CustomHeaderFieldsDelegate webView:decidePolicyForNavigationAction:preferences:decisionHandler:]):
(-[CustomHeaderFieldsDelegate webView:startURLSchemeTask:]):
(-[CustomHeaderFieldsDelegate _webView:decidePolicyForNavigationAction:decisionHandler:]): Deleted.

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

3 months ago[iOS] Unable to commit search on MSN.com, qq.com, or sina.com.cn using enter key...
dbates@webkit.org [Thu, 16 May 2019 17:31:01 +0000 (17:31 +0000)]
[iOS] Unable to commit search on MSN.com, qq.com, or sina.com.cn using enter key (hardware or software keyboard)
https://bugs.webkit.org/show_bug.cgi?id=197632
<rdar://problem/47902054>

Add missing file that was inadvertently omitted from the patch.

* fast/events/ios/resources/submit-form-target-blank-using-return-key.html: Added.

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

3 months ago[iOS] Select all with existing range selection replaces range instead of selecting...
dbates@webkit.org [Thu, 16 May 2019 17:27:55 +0000 (17:27 +0000)]
[iOS] Select all with existing range selection replaces range instead of selecting all text
https://bugs.webkit.org/show_bug.cgi?id=197950
<rdar://problem/50245131>

Add missing file that was inadvertently omitted from the patch.

* fast/events/ios/resources/submit-form-target-blank-using-return-key.html: Added.

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

3 months ago[IntersectionObserver] Regression: No initial observation when nothing else triggers...
ajuma@chromium.org [Thu, 16 May 2019 13:54:56 +0000 (13:54 +0000)]
[IntersectionObserver] Regression: No initial observation when nothing else triggers rendering
https://bugs.webkit.org/show_bug.cgi?id=197891

Reviewed by Simon Fraser.

Source/WebCore:

Schedule a rendering update whenever a new IntersectionObserver target is added.

Test: intersection-observer/initial-observation.html

* page/IntersectionObserver.cpp:
(WebCore::IntersectionObserver::observe):

LayoutTests:

Add a test where other timers that can schedule rendering updates are disabled,
in order to verify that IntersectionObserver is scheduling rendering updates
itself.

* intersection-observer/initial-observation.html: Added.

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

3 months agoFix memcpy() call for big endian
commit-queue@webkit.org [Thu, 16 May 2019 13:38:10 +0000 (13:38 +0000)]
Fix memcpy() call for big endian
https://bugs.webkit.org/show_bug.cgi?id=197945

Patch by Eike Rathke <erack@redhat.com> on 2019-05-16
Reviewed by Michael Catanzaro.

* wtf/Packed.h:
(WTF::alignof):

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

3 months ago[WPE] Rendering on a HiDPI display looks scaled up instead of rendered at 2x
commit-queue@webkit.org [Thu, 16 May 2019 11:48:52 +0000 (11:48 +0000)]
[WPE] Rendering on a HiDPI display looks scaled up instead of rendered at 2x
https://bugs.webkit.org/show_bug.cgi?id=185764

Patch by Ryan Walklin <ryan@testtoast.com> on 2019-05-16
Reviewed by Carlos Garcia Campos.

Add a function to the wpe_view_backend_client struct which accepts a device scale factor
configured through wpe_view_backend_dispatch_set_device_scale_factor() and calls
setIntrinsicDeviceScaleFactor for the the current View.Page object. The
function definition has been added in libwpe 1.3.

* UIProcess/API/wpe/WPEView.cpp:
(WKWPE::m_backend): Add set_device_scale_factor implementation declared by libwpe.

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

3 months ago[FreeType] Some character sequences with a variation selector are not rendered
carlosgc@webkit.org [Thu, 16 May 2019 09:31:16 +0000 (09:31 +0000)]
[FreeType] Some character sequences with a variation selector are not rendered
https://bugs.webkit.org/show_bug.cgi?id=197838

Reviewed by Michael Catanzaro.

We get the invalid glyph instead. See http://mts.io/2015/04/21/unicode-symbol-render-text-emoji/. In the table at
the end the Emoji and Text columns are not correctly rendered. It happens also when copying an emoji from
GtkEmojiChooser and pasting in WebKit text field, because GTK appends U+FE0F to all emojis to force the emoji
style. We need to take into account the variation selector when checking if a font can render a combining
sequence, using FT_Face_GetCharVariantIndex to get the right glyph in case of variation character present.

* platform/graphics/Font.cpp:
(WebCore::Font::platformSupportsCodePoint const): Add optional variation parameter.
(WebCore::Font::canRenderCombiningCharacterSequence const): Take into account variation selector characters
* platform/graphics/Font.h:
* platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
(WebCore::FontCascade::fontForCombiningCharacterSequence const): Check variation selectors 0xFE0E and 0xFE0F to
decide whether to use the emoji or text style.
* platform/graphics/cocoa/FontCocoa.mm:
(WebCore::Font::platformSupportsCodePoint const): Return false when a variation character is passed so that
characters are checked individually.
* platform/graphics/freetype/SimpleFontDataFreeType.cpp:
(WebCore::Font::platformSupportsCodePoint const): Use FT_Face_GetCharVariantIndex when a variation character is
passed.
* platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
(WebCore::harfBuzzFontFunctions): Do not return true when FT_Face_GetCharVariantIndex returns 0.

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

3 months agoUpdated screenHasInvertedColors to use AppKit when available
commit-queue@webkit.org [Thu, 16 May 2019 09:22:22 +0000 (09:22 +0000)]
Updated screenHasInvertedColors to use AppKit when available
https://bugs.webkit.org/show_bug.cgi?id=197935
<rdar://problem/50834405>

Patch by Greg Hughes <ghughes@apple.com> on 2019-05-16
Reviewed by Chris Fleizach.

* platform/mac/PlatformScreenMac.mm:
(WebCore::collectScreenProperties):
(WebCore::screenHasInvertedColors):

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

3 months agoAvoid a recursive descendants layer walk sometimes
simon.fraser@apple.com [Thu, 16 May 2019 05:41:08 +0000 (05:41 +0000)]
Avoid a recursive descendants layer walk sometimes
https://bugs.webkit.org/show_bug.cgi?id=197939

Reviewed by Zalan Bujtas.

If a layer got composited post-descendants because it needs to clip, for example, we'd do a recursive
descendant tree walk to add layers to the overlap map. However, all the descendants would already
have contributed to the overlap map if some non-root ancestor was already composited. So we can
skip the addDescendantsToOverlapMapRecursive() if we know, before descendants, whether there's
a non-root composited ancestor.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::CompositingState::hasNonRootCompositedAncestor const):
(WebCore::RenderLayerCompositor::computeCompositingRequirements):

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

3 months agoClean up code related to compositing overlap map maintenance
simon.fraser@apple.com [Thu, 16 May 2019 04:07:37 +0000 (04:07 +0000)]
Clean up code related to compositing overlap map maintenance
https://bugs.webkit.org/show_bug.cgi?id=197936

Reviewed by Zalan Bujtas.

Clarify the logic around updating the overlap map:

When a layer becomes composited, or paints into a non-root composited layer, we add it to the overlap map
after traversing descendants (since it only affets layers later in traversal).

If a layer became composited after traversing descendants, we need to go back and add all the descendants
to the overlap map with a recursive traversal.

We can do all this near the end of computeCompositingRequirements/traverseUnchangedSubtree because
we only check overlap when we enter this function on later layers.

Add a CompositingOverlap log channel and use it to log the state of the overlap map.

* platform/Logging.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
(WebCore::RenderLayerCompositor::addToOverlapMap const):
(WebCore::RenderLayerCompositor::addDescendantsToOverlapMapRecursive const):
(WebCore::RenderLayerCompositor::updateOverlapMap const):
(WebCore::RenderLayerCompositor::addToOverlapMap): Deleted.
(WebCore::RenderLayerCompositor::addToOverlapMapRecursive): Deleted.
* rendering/RenderLayerCompositor.h:

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

3 months agoClean up RenderLayerCompositor::computeCompositingRequirements() and traverseUnchange...
simon.fraser@apple.com [Thu, 16 May 2019 02:51:15 +0000 (02:51 +0000)]
Clean up RenderLayerCompositor::computeCompositingRequirements() and traverseUnchangedSubtree()
https://bugs.webkit.org/show_bug.cgi?id=197931

Reviewed by Zalan Bujtas.

These functions have grown and become hard to maintain, so try to undo some technical debt.

Rename "childState" to "currentState" since it's the state we pass to children, but also
is state we change when the current layer becomes composited.

Separate the layerWillComposite() lambda from layerWillCompositePostDescendants().

Group the chunks of code at end of the functions into:
    - updating bits on RenderLayer
    - updating compositingState with changes from children and our state
    - doing post-traversal work on overlapMap and backingSharingState

Code shared between the two functions is pushed into CompositingState::updateWithDescendantStateAndLayer().

This moves code around but should not cause any behavior change.

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateConfiguration):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::OverlapExtent::knownToBeHaveExtentUncertainty const):
(WebCore::RenderLayerCompositor::CompositingState::updateWithDescendantStateAndLayer):
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
(WebCore::RenderLayerCompositor::clipsCompositingDescendants):
(WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildren): Deleted.
(WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildrenForUnchangedSubtree): Deleted.
(WebCore::RenderLayerCompositor::clipsCompositingDescendants const): Deleted.
* rendering/RenderLayerCompositor.h:

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

3 months agoMake LayerOverlapMap able to output to a TextStream
simon.fraser@apple.com [Thu, 16 May 2019 02:51:12 +0000 (02:51 +0000)]
Make LayerOverlapMap able to output to a TextStream
https://bugs.webkit.org/show_bug.cgi?id=197923

Reviewed by Zalan Bujtas.

Make it possible output LayerOverlapMap to a TextStream for logging.

* rendering/LayerOverlapMap.cpp:
(WebCore::OverlapMapContainer::rectList const):
(WebCore::operator<<):
* rendering/LayerOverlapMap.h:
(WebCore::LayerOverlapMap::overlapStack const):

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

3 months ago[PlayStation] WTFCrash should preserve register state.
ross.kirsling@sony.com [Thu, 16 May 2019 01:30:18 +0000 (01:30 +0000)]
[PlayStation] WTFCrash should preserve register state.
https://bugs.webkit.org/show_bug.cgi?id=197932

Reviewed by Don Olmstead.

* wtf/Assertions.cpp:
* wtf/Assertions.h:
Let r196397 apply to PlayStation port as well.

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

3 months agoREGRESSION (r245072): Missing code in Document::styleColorOptions to propagate StyleC...
timothy@apple.com [Wed, 15 May 2019 23:50:34 +0000 (23:50 +0000)]
REGRESSION (r245072): Missing code in Document::styleColorOptions to propagate StyleColor::Options::UseInactiveAppearance
https://bugs.webkit.org/show_bug.cgi?id=197930
rdar://problem/49833954

Reviewed by Wenson Hsieh and Megan Gardner.

Add some code that was missing from Document in my original patch for r245072.

* dom/Document.cpp:
(WebCore::Document::useSystemAppearance const): Drive-by fix code style.
(WebCore::Document::useInactiveAppearance const): Added.
(WebCore::Document::styleColorOptions const): Add StyleColor::Options::UseInactiveAppearance.
* dom/Document.h: Added useInactiveAppearance().

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

3 months agoWeb Inspector: user gesture toggle should also force user interaction flag
drousso@apple.com [Wed, 15 May 2019 22:42:00 +0000 (22:42 +0000)]
Web Inspector: user gesture toggle should also force user interaction flag
https://bugs.webkit.org/show_bug.cgi?id=197269

Reviewed by Joseph Pecoraro.

Source/WebCore:

Test: inspector/runtime/evaluate-userGestureEmulation-userIsInteracting.html

* inspector/agents/page/PageRuntimeAgent.cpp:
(WebCore::PageRuntimeAgent::evaluate):

* page/ChromeClient.h:
(WebCore::ChromeClient::userIsInteracting const): Added.
(WebCore::ChromeClient::setUserIsInteracting): Added.

* testing/Internals.idl:
* testing/Internals.h:
* testing/Internals.cpp:
(WebCore::Internals::userIsInteracting): Added.

Source/WebKit:

* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::userIsInteracting const): Added.
(WebKit::WebChromeClient::setUserIsInteracting): Added.

* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::userIsInteracting const): Added.
(WebKit::WebPage::setUserIsInteracting): Added.

LayoutTests:

* inspector/runtime/evaluate-userGestureEmulation-userIsInteracting.html: Added.
* inspector/runtime/evaluate-userGestureEmulation-userIsInteracting-expected.txt: Added.

* TestExpectations:
* platform/wk2/TestExpectations:
Only enable the above test on WK2, as the user interaction state is only supported by WK2.

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

3 months agoReplace double-quotes with single quotes in steps.py
aakash_jain@apple.com [Wed, 15 May 2019 22:41:59 +0000 (22:41 +0000)]
Replace double-quotes with single quotes in steps.py
https://bugs.webkit.org/show_bug.cgi?id=197921

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/steps.py:

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

3 months agoRewrite generate-xcfilelists in Python
krollin@apple.com [Wed, 15 May 2019 22:39:57 +0000 (22:39 +0000)]
Rewrite generate-xcfilelists in Python
https://bugs.webkit.org/show_bug.cgi?id=197622
<rdar://problem/50508222>

Reviewed by Jonathan Bedard, Alex Christensen.

For a number of reasons, rewrite generate-xcfilelists in Python:

- The previous bash script was large and unmaintainable.
- We have more internal expertise with Python than with bash.
- The bash script used temporary files in /tmp that got stranded and
  were owned by root, making them awkward to clear out.
  <rdar://problem/49490262>
- We needed to complete support for engineers that built with Xcode
  rather than the command line.
- There are some bugs leading to mildly corrupted .xcfilelist files.
  It's not apparent the source of the bugs, but one general reason
  might be due to approaches born of using bash. Rewriting in Python
  may clear these up.

* Scripts/generate-xcfilelists:
* Scripts/webkitpy/common/attribute_saver.py: Added.
(AttributeSaver):
(AttributeSaver.__init__):
(AttributeSaver.__enter__):
(AttributeSaver.__exit__):
* Scripts/webkitpy/common/attribute_saver_unittest.py: Added.
(AttributeSaverTest):
(AttributeSaverTest.SimpleTestClass):
(AttributeSaverTest.SimpleTestClass.__init__):
(AttributeSaverTest.test_class):
(AttributeSaverTest.test_normal_default):
(AttributeSaverTest.test_normal_value):
(AttributeSaverTest.test_normal_value_on_exception):
(AttributeSaverTest.test_normal_value_on_normal_exit):
(AttributeSaverTest.test_normal_value_with_finally_on_exception):
(AttributeSaverTest.test_normal_value_with_finally_on_normal_exit):
(AttributeSaverTest.test_normal_value_with_else_on_exception):
(AttributeSaverTest.test_normal_value_with_else_on_normal_exit):
* Scripts/webkitpy/generate_xcfilelists_lib/__init__.py: Added.
* Scripts/webkitpy/generate_xcfilelists_lib/application.py: Added.
(Application):
(Application.__init__):
(Application.run):
(Application._initialize):
(Application._initialize.collect_attributes):
(Application._create_parser):
(_validate_args):
(_cmd_generate):
(_cmd_check):
(_cmd_subgenerate):
(_cmd_help):
(_do_generate):
(_do_merge):
(_report_results):
(_report_merge_results):
(_report_remediation_steps):
(_report_remediation_steps.add_to_message):
(_any_have_errors):
(_any_have_actions):
(_log_progress):
(_log_results):
(get_generate_xcfilelists_script_path):
(_get_root_dir):
(get_opensource_dir):
(get_build_scripts_dir):
(get_extract_dependencies_from_makefile_script):
(get_xcode_built_products_dir):
(_getenv):
* Scripts/webkitpy/generate_xcfilelists_lib/generators.py: Added.
(BaseGenerator):
(BaseGenerator.__init__):
(BaseGenerator.__str__):
(BaseGenerator.generate):
(BaseGenerator._sublaunch_under_xcode):
(BaseGenerator.subgenerate):
(BaseGenerator.merge):
(BaseGenerator.pickle_to_file):
(BaseGenerator.has_action):
(BaseGenerator.has_error):
(BaseGenerator.is_valid):
(BaseGenerator.report_error):
(BaseGenerator._generate_derived):
(BaseGenerator._merge_derived):
(BaseGenerator._generate_unified):
(BaseGenerator._merge_unified):
(BaseGenerator._replace):
(BaseGenerator._unexpand):
(BaseGenerator._find_added_lines):
(BaseGenerator._merge_added_lines):
(BaseGenerator._get_file_lines):
(BaseGenerator._getenv):
(BaseGenerator._get_project_file_path):
(BaseGenerator._get_project_dir):
(BaseGenerator._get_project_file_name):
(BaseGenerator._get_project_name):
(BaseGenerator._get_sym_root):
(BaseGenerator._get_obj_root):
(BaseGenerator._get_shared_precomps_dir):
(BaseGenerator._get_build_dirs):
(BaseGenerator._get_build_dirs.define_xcode_build_dirs):
(BaseGenerator._get_build_dirs.define_xcode_build_dirs.read_xcode_user_default):
(BaseGenerator._get_build_dirs.define_command_line_build_dirs):
(BaseGenerator._get_derived_sources_dir):
(BaseGenerator._get_xcfilelist_dir):
(BaseGenerator._get_input_derived_xcfilelist_project_path):
(BaseGenerator._get_output_derived_xcfilelist_project_path):
(BaseGenerator._get_input_unified_xcfilelist_project_path):
(BaseGenerator._get_output_unified_xcfilelist_project_path):
(BaseGenerator._get_generate_derived_sources_script):
(BaseGenerator._get_generate_unified_sources_script):
(JavaScriptCoreGenerator):
(JavaScriptCoreGenerator._get_project_file_path):
(JavaScriptCoreGenerator._get_generate_derived_sources_script):
(JavaScriptCoreGenerator._get_generate_unified_sources_script):
(WebCoreGenerator):
(WebCoreGenerator._get_project_file_path):
(WebCoreGenerator._get_generate_derived_sources_script):
(WebCoreGenerator._get_generate_unified_sources_script):
(WebKitGenerator):
(WebKitGenerator._get_project_file_path):
(WebKitGenerator._get_derived_sources_dir):
(WebKitGenerator._get_generate_derived_sources_script):
(WebKitGenerator._get_generate_unified_sources_script):
(DumpRenderTreeGenerator):
(DumpRenderTreeGenerator._get_project_file_path):
(DumpRenderTreeGenerator._get_generate_derived_sources_script):
(WebKitTestRunnerGenerator):
(WebKitTestRunnerGenerator._get_project_file_path):
(WebKitTestRunnerGenerator._get_generate_derived_sources_script):
* Scripts/webkitpy/generate_xcfilelists_lib/util.py: Added.
(debug_log):
(LogEntryHelper):
(LogEntryHelper.__init__):
(LogEntryHelper.log_entry):
(LogEntryHelper.log_result):
(LogEntryHelper.log_exception):
(LogEntryHelper._print):
(LogEntryExit):
(LogEntryExit._show_debug_logging):
(LogEntryExitClass):
(LogEntryExitClass._show_debug_logging):
(LogEntryExitGlobal):
(LogEntryExitGlobal._show_debug_logging):
(subprocess_run):
(is_running_under_xcode):
(CheckValidItemAction):
(CheckValidItemAction.__init__):
(CheckValidItemAction.__call__):
(CheckValidItemAction.validate_item):
(CheckCommandAction):
(CheckCommandAction.__call__):
(InvalidCommandError):
(InvalidArgumentError):
(InvalidConfigurationError):
(CalledProcessError):
(CalledProcessError.__str__):
* Scripts/webkitpy/xcode/__init__.py:
(xcode_hash_for_path):
(xcode_hash_for_path.convert_to_string):
* Scripts/webkitpy/xcode/sdk.py: Added.
(SDK):
(SDK.__init__):
(SDK.__repr__):
(SDK.as_xcode_specification):
(SDK.get_preferred_sdk_for_platform):
(SDK._parse_sdk):
* Scripts/webkitpy/xcode/sdk_unittest.py: Added.
(SDKTest):

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

3 months agoREGRESSION (r240644): Layout Test inspector/page/overrideSetting-ICECandidateFilterin...
drousso@apple.com [Wed, 15 May 2019 22:37:12 +0000 (22:37 +0000)]
REGRESSION (r240644): Layout Test inspector/page/overrideSetting-ICECandidateFilteringEnabled.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=194437
<rdar://problem/48008005>

Reviewed by Joseph Pecoraro.

* inspector/page/overrideSetting-ICECandidateFilteringEnabled.html:
* inspector/page/overrideSetting-ICECandidateFilteringEnabled-expected.txt:

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

3 months agoREGRESSION (r242741) [Mac WK1 Debug] Layout Test inspector/timeline/exception-in...
drousso@apple.com [Wed, 15 May 2019 22:36:34 +0000 (22:36 +0000)]
REGRESSION (r242741) [Mac WK1 Debug] Layout Test inspector/timeline/exception-in-injected-script-while-recording.html is a flaky crash
https://bugs.webkit.org/show_bug.cgi?id=197442
<rdar://problem/50354090>

Reviewed by Joseph Pecoraro.

Ever since r198774, we don't allow a timeline recording to be active at the same time as the
debugger being paused. As such, these tests are unnecessary.

* inspector/timeline/debugger-paused-while-recording.html: Removed.
* inspector/timeline/debugger-paused-while-recording-expected.txt: Removed.
* inspector/timeline/exception-in-injected-script-while-recording.html: Removed.
* inspector/timeline/exception-in-injected-script-while-recording-expected.txt: Removed.
* inspector/timeline/resources/timeline-helper.js: Removed.
* TestExpectations:

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

3 months agoDo not create a shape object outside of the layout context
zalan@apple.com [Wed, 15 May 2019 22:34:09 +0000 (22:34 +0000)]
Do not create a shape object outside of the layout context
https://bugs.webkit.org/show_bug.cgi?id=197926
<rdar://problem/50627858>

Reviewed by Simon Fraser.

Source/WebCore:

ShapeOutside objects are used to compute line constrains during layout (in a strict sense, they are part of the layout context and should only be mutated during layout).
If we don't create one during layout, we probably don't need to know its geometry during paint (or any other non-layout activity) either.

Test: fast/block/float/float-with-shape-outside-crash.html

* rendering/FloatingObjects.cpp:
(WebCore::ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatLeft>::updateOffsetIfNeeded):
(WebCore::ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatRight>::updateOffsetIfNeeded):
* rendering/shapes/ShapeOutsideInfo.cpp:
(WebCore::ShapeOutsideInfo::computeDeltasForContainingBlockLine):

LayoutTests:

* fast/block/float/float-with-shape-outside-crash-expected.txt: Added.
* fast/block/float/float-with-shape-outside-crash.html: Added.

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

3 months agoRevise sandbox to allow IOKit properties needed by Metal and LaunchServices
bfulgham@apple.com [Wed, 15 May 2019 22:27:09 +0000 (22:27 +0000)]
Revise sandbox to allow IOKit properties needed by Metal and LaunchServices
https://bugs.webkit.org/show_bug.cgi?id=197924
<rdar://problem/50823976>

Reviewed by Per Arne Vollan.

Update sandbox to allow access to some IOKit properties to avoid sandbox violations that could
lower performance or increase launch times:

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

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

3 months ago[ews-build] Enabling uploading EWS archives to S3
aakash_jain@apple.com [Wed, 15 May 2019 22:21:24 +0000 (22:21 +0000)]
[ews-build] Enabling uploading EWS archives to S3
https://bugs.webkit.org/show_bug.cgi?id=197914

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/Shared: Added.
* BuildSlaveSupport/Shared/transfer-archive-to-s3: Moved from Tools/BuildSlaveSupport/build.webkit.org-config/transfer-archive-to-s3.
(archiveExists): Replace tab with space.
(main): Added main method.
* BuildSlaveSupport/build.webkit.org-config/steps.py:
(TransferToS3): Updated path to the script.
* BuildSlaveSupport/build.webkit.org-config/transfer-archive-to-s3: Moved to Shared folder.

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

3 months agoMark beacon and ping loads as low priority
youenn@apple.com [Wed, 15 May 2019 21:28:57 +0000 (21:28 +0000)]
Mark beacon and ping loads as low priority
https://bugs.webkit.org/show_bug.cgi?id=197919
<rdar://problem/50818286>

Reviewed by Alex Christensen.

No JS observable change of behavior.

* Modules/beacon/NavigatorBeacon.cpp:
(WebCore::NavigatorBeacon::sendBeacon):
* loader/PingLoader.cpp:
(WebCore::PingLoader::sendPing):

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

3 months agoUnreviewed, fix assertion introduced in r245339.
cdumez@apple.com [Wed, 15 May 2019 21:14:33 +0000 (21:14 +0000)]
Unreviewed, fix assertion introduced in r245339.

* UIProcess/WebProcessCache.cpp:
(WebKit::WebProcessCache::CachedProcess::CachedProcess):

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

3 months agoBound liveness of SetArgumentMaybe nodes when maximal flush insertion phase is enabled
sbarati@apple.com [Wed, 15 May 2019 20:30:16 +0000 (20:30 +0000)]
Bound liveness of SetArgumentMaybe nodes when maximal flush insertion phase is enabled
https://bugs.webkit.org/show_bug.cgi?id=197855
<rdar://problem/50236506>

Reviewed by Michael Saboff.

JSTests:

* stress/set-argument-maybe-maximal-flush-should-not-extend-liveness-2.js: Added.
(f0):
(bar):
(foo):
* stress/set-argument-maybe-maximal-flush-should-not-extend-liveness.js: Added.
(f1):
(f2):
(foo):

Source/JavaScriptCore:

Maximal flush insertion phase assumes it can extend the live range of
variables. However, this is not true with SetArgumentMaybe nodes, because
they are not guaranteed to demarcate the birth of a variable in the way
that SetArgumentDefinitely does. This caused things to break in SSA conversion
when we wanted to use the result of a SetArgumentMaybe node. To obviate this,
when we're done inlining something with SetArgumentMaybes, we SetLocal(undefined)
to the same set of locals. This caps the live range of the SetArgumentMaybe
and makes it so that extending the live range of the SetLocal is valid.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleVarargsInlining):

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

3 months agoLayout tests http/wpt/webauthn/public-key-credential-create-success-hid.https.html
sroberts@apple.com [Wed, 15 May 2019 19:56:40 +0000 (19:56 +0000)]
Layout tests http/wpt/webauthn/public-key-credential-create-success-hid.https.html
http/wpt/webauthn/public-key-credential-get-success-hid.https.html are flaky crashes
https://bugs.webkit.org/show_bug.cgi?id=197917

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations: Skipping tests on Debug

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

3 months agoAdd assertions to help diagnose crash at WebProcessProxy::processPool()
sihui_liu@apple.com [Wed, 15 May 2019 19:50:54 +0000 (19:50 +0000)]
Add assertions to help diagnose crash at WebProcessProxy::processPool()
https://bugs.webkit.org/show_bug.cgi?id=197856
<rdar://problem/49341366>

Reviewed by Chris Dumez.

* UIProcess/WebProcessCache.cpp:
(WebKit::WebProcessCache::CachedProcess::CachedProcess):
* UIProcess/WebProcessLifetimeObserver.cpp:
(WebKit::WebProcessLifetimeObserver::addWebPage):
(WebKit::WebProcessLifetimeObserver::removeWebPage):
* UIProcess/WebProcessLifetimeObserver.h:
(WebKit::WebProcessLifetimeObserver::hasProcess const):

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

3 months agoinputmode="numeric" should show a number pad with digits 0-9, instead of the numeric...
wenson_hsieh@apple.com [Wed, 15 May 2019 19:24:16 +0000 (19:24 +0000)]
inputmode="numeric" should show a number pad with digits 0-9, instead of the numeric keyplane
https://bugs.webkit.org/show_bug.cgi?id=197916
<rdar://problem/50815427>

Reviewed by Timothy Hatcher.

Source/WebKit:

Use UIKeyboardTypeNumberPad instead of UIKeyboardTypeNumbersAndPunctuation when presenting a keyboard for a
field with inputmode="numeric". While the WhatWG specification merely requires the UA to display a keyboard
"capable of numeric input", it suggests that the keyboard should be "useful for PIN entry", which loosely
implies a number pad.

This is also generally in line with feedback from web developers.

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

Tools:

Re-enable this previously flaky test, and rebaseline the result to to expect UIKeyboardTypeNumberPad for
inputmode="numeric".

* TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm:
(TestWebKitAPI::TEST):

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

3 months agoAdd USE(LIBWPE) for AcceleratedSurface
don.olmstead@sony.com [Wed, 15 May 2019 19:06:06 +0000 (19:06 +0000)]
Add USE(LIBWPE) for AcceleratedSurface
https://bugs.webkit.org/show_bug.cgi?id=197918

Reviewed by Michael Catanzaro.

Renamed AcceleratedSurfaceWPE to AcceleratedSurfaceLibWPE since it just uses the
libwpe APIs.

* PlatformWPE.cmake:
* SourcesWPE.txt:
* WebProcess/WebPage/AcceleratedSurface.cpp:
(WebKit::AcceleratedSurface::create):
* WebProcess/WebPage/libwpe/AcceleratedSurfaceLibWPE.cpp: Renamed from Source/WebKit/WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp.
(WebKit::AcceleratedSurfaceLibWPE::create):
(WebKit::AcceleratedSurfaceLibWPE::AcceleratedSurfaceLibWPE):
(WebKit::AcceleratedSurfaceLibWPE::~AcceleratedSurfaceLibWPE):
(WebKit::AcceleratedSurfaceLibWPE::initialize):
(WebKit::AcceleratedSurfaceLibWPE::finalize):
(WebKit::AcceleratedSurfaceLibWPE::window const):
(WebKit::AcceleratedSurfaceLibWPE::surfaceID const):
(WebKit::AcceleratedSurfaceLibWPE::clientResize):
(WebKit::AcceleratedSurfaceLibWPE::willRenderFrame):
(WebKit::AcceleratedSurfaceLibWPE::didRenderFrame):
* WebProcess/WebPage/libwpe/AcceleratedSurfaceLibWPE.h: Renamed from Source/WebKit/WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.h.

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

3 months agoMake LOG_WITH_STREAM more efficient
simon.fraser@apple.com [Wed, 15 May 2019 18:53:45 +0000 (18:53 +0000)]
Make LOG_WITH_STREAM more efficient
https://bugs.webkit.org/show_bug.cgi?id=197905

Reviewed by Alex Christensen.
Source/WebCore:

No longer need to conditionalize ClipRects logging on the channel being enabled
since LOG_WITH_STREAM fix the performance problem.

Convert some RenderLayerCompositor logging to use LOG_WITH_STREAM.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects const):
(WebCore::clipRectsLogEnabled): Deleted.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::traverseUnchangedSubtree):

Source/WebCore/PAL:

Make the LOG_WITH_STREAM macro check that the log channel is enabled before
building the stream.

* pal/LogMacros.h:

Source/WTF:

Add a streamable Repeat() class that can be used to output a series of characters.
This is useful for indenting output.

* wtf/text/TextStream.h:
(WTF::TextStream::repeat::repeat):
(WTF::TextStream::operator<<):

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

3 months agogetUserMedia sandbox extensions should not be revoked when a getUserMedia allowed...
youenn@apple.com [Wed, 15 May 2019 18:44:36 +0000 (18:44 +0000)]
getUserMedia sandbox extensions should not be revoked when a getUserMedia allowed request is being processed
https://bugs.webkit.org/show_bug.cgi?id=197851

Reviewed by Alex Christensen.

Source/WebCore:

Add a completion handler to create a new capture stream.
This is used by WK2 layer to acknowledge the pending capture request is completed.
Just after the completion handler, make sure to update the document media state.
This is done to ensure that, should capture failing, the UIProcess
knows about it and can manage proper sandbox extension revocation.

Test: fast/mediastream/gum-stop-track.html

* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::allow):
(WebCore::UserMediaRequest::PendingActivationMediaStream::PendingActivationMediaStream):
(WebCore::UserMediaRequest::PendingActivationMediaStream::~PendingActivationMediaStream):
* Modules/mediastream/UserMediaRequest.h:
(WebCore::UserMediaRequest::PendingActivationMediaStream::create):
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::MockRealtimeMediaSourceCenter::mockRealtimeMediaSourceCenterEnabled):
* platform/mock/MockRealtimeMediaSourceCenter.h:

Source/WebKit:

Before the patch, stopping capture in a document and quickly triggering a new capture
might fail as the UIProcess would grant access and revoke sandbox access based on the fact
the page is no longer capturing.
To fix that issue, keep a state in the UIProcess to not revoke sandbox extensions in case of
capture being started.
Add an IPC message back to tell UIProcess when an allowed capture is finished.
Just after doing that, make sure the document is updating the media state to UIProcess, which will trigger proper sandbox extension handling.

This should also trigger the case of an allowed getUserMedia call that fails to start for some reason.
In that case, the patch will automatically trigger a document media state refresh which will trigger a sandbox revokation.

Covered by added test that exercise a newly added debug assertion.
This assertion ensures that we revoke extensions while a document is not capturing.

* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
(WebKit::UserMediaPermissionRequestManagerProxy::grantAccess):
(WebKit::UserMediaPermissionRequestManagerProxy::captureStateChanged):
* UIProcess/UserMediaPermissionRequestManagerProxy.h:
* UIProcess/UserMediaProcessManager.cpp:
(WebKit::UserMediaProcessManager::willCreateMediaStream):
(WebKit::UserMediaProcessManager::revokeSandboxExtensionsIfNeeded):
* UIProcess/UserMediaProcessManager.h:
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::isCapturingAudio const):
(WebKit::WebPageProxy::isCapturingVideo const):
* WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
(WebKit::UserMediaPermissionRequestManager::userMediaAccessWasGranted):
* WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::userMediaAccessWasGranted):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebProcess.cpp:
(WebKit::checkDocumentsCaptureStateConsistency):
(WebKit::WebProcess::revokeUserMediaDeviceSandboxExtensions):

LayoutTests:

* fast/mediastream/gum-stop-track-expected.txt: Added.
* fast/mediastream/gum-stop-track.html: Added.

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

3 months ago[WK2][iOS] UIProcess may get killed because it is taking too long to release its...
cdumez@apple.com [Wed, 15 May 2019 18:29:40 +0000 (18:29 +0000)]
[WK2][iOS] UIProcess may get killed because it is taking too long to release its background task after expiration
https://bugs.webkit.org/show_bug.cgi?id=197893
<rdar://problem/50234105>

Reviewed by Alex Christensen.

The UIProcess may get killed because it is taking too long to release its background task after its expiration handler
was called. The reason is that the background task's expiration handler was sequentially sending a ProcessWillSuspendImminently
synchronous IPC to each of its child processes and only then ends the background task. By the time we receive the response from
all child processes, it may be too late and we get killed.

To address the issue, we now:
1. Send the ProcessWillSuspendImminently asynchronously so that all processes can do their processing in parallel
2. After 2 seconds, the UIProcess releases the background task (We get killed after ~5 seconds)

Also, to make sure that the UIProcess supends promptly, we now make sure we never start a new background task *after*
the app has been backgrounded. The intention of our background task is too finish critical work (like releasing locked
files) after the app gets backgrounded, not to start new work and delay process suspension.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::processWillSuspendImminently):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::sendProcessWillSuspendImminently):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::sendProcessWillSuspendImminently):
* UIProcess/ios/ProcessAssertionIOS.mm:
(-[WKProcessAssertionBackgroundTaskManager init]):
(-[WKProcessAssertionBackgroundTaskManager _scheduleReleaseTask]):
(-[WKProcessAssertionBackgroundTaskManager _cancelPendingReleaseTask]):
(-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::didReceiveSyncMessage):
(WebKit::WebProcess::processWillSuspendImminently):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

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

3 months ago[WebAuthN] Make WebAuthN default on
jiewen_tan@apple.com [Wed, 15 May 2019 18:01:17 +0000 (18:01 +0000)]
[WebAuthN] Make WebAuthN default on
https://bugs.webkit.org/show_bug.cgi?id=197805
<rdar://problem/50683699>

Reviewed by Darin Adler.

* Shared/WebPreferences.yaml:

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

3 months agoReuse existing WebPageProxy quota handler for NetworkProcessProxy quota requests
youenn@apple.com [Wed, 15 May 2019 17:40:01 +0000 (17:40 +0000)]
Reuse existing WebPageProxy quota handler for NetworkProcessProxy quota requests
https://bugs.webkit.org/show_bug.cgi?id=197463
<rdar://problem/47403621>

Reviewed by Alex Christensen.

Source/WebKit:

Add a getter to know whether websitedatastore client implements the quota delegate.
If not, find the most visible page that is the same origin as the quota request
and reuse the existing exceededDatabasQuota delegate.
This approach allows to call the delegate even if the quota request comes from a service worker.
If no such page is found, the quota will not be increased.

Refactoring to make sure we are calling the delegate once a previous call to that delegate is completed.
Covered by API test.

* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::requestStorageSpace):
* UIProcess/WebPageProxy.cpp:
(WebKit::StorageRequests::add):
(WebKit::StorageRequests::processNext):
(WebKit::StorageRequests::areBeingProcessed const):
(WebKit::StorageRequests::setAreBeingProcessed):
(WebKit::StorageRequests::StorageRequests):
(WebKit::StorageRequests::~StorageRequests):
(WebKit::StorageRequests::singleton):
(WebKit::WebPageProxy::forMostVisibleWebPageIfAny):
(WebKit::WebPageProxy::didChangeMainDocument):
(WebKit::WebPageProxy::exceededDatabaseQuota):
(WebKit::WebPageProxy::requestStorageSpace):
(WebKit::WebPageProxy::makeStorageSpaceRequest):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::forWebPages):
* UIProcess/WebProcessProxy.h:
* UIProcess/WebsiteData/WebsiteDataStoreClient.h:
(WebKit::WebsiteDataStoreClient::implementsRequestStorageSpaceHandler const):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/StorageQuota.mm: Added.
(-[QuotaDelegate init]):
(-[QuotaDelegate _webView:decideDatabaseQuotaForSecurityOrigin:currentQuota:currentOriginUsage:currentDatabaseUsage:expectedUsage:decisionHandler:]):
(-[QuotaDelegate quotaDelegateCalled]):
(-[QuotaDelegate grantQuota]):
(-[StorageSchemes webView:startURLSchemeTask:]):
(-[StorageSchemes webView:stopURLSchemeTask:]):
(-[QuotaMessageHandler userContentController:didReceiveScriptMessage:]):
(doTest):

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

3 months agoConstant crashes under WebPage::isThrottleable() after r245299
youenn@apple.com [Wed, 15 May 2019 16:35:58 +0000 (16:35 +0000)]
Constant crashes under WebPage::isThrottleable() after r245299
https://bugs.webkit.org/show_bug.cgi?id=197902
<rdar://problem/50793796>

Reviewed by Alex Christensen.

Source/WebKit:

Update throttle state after a run loop iteration when page state changes to make sure the pageMap does not have null pages.
Add appNapEnabled preference that is used by added API test.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updateThrottleState):
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _setAppNapEnabled:]):
(-[WKPreferences _appNapEnabled]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:

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

3 months agoMove RenderLayerCompositor's OverlapMap to its own file
simon.fraser@apple.com [Wed, 15 May 2019 15:59:21 +0000 (15:59 +0000)]
Move RenderLayerCompositor's OverlapMap to its own file
https://bugs.webkit.org/show_bug.cgi?id=197915

Reviewed by Alex Christensen.

Move OverlapMap to its own file.
Make use of RectList, which was in the file but unused!
Allocate OverlapMapContainer on the heap both to avoid header pollution of internals,
and because they will get bigger in future.

No behavior change.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* rendering/LayerOverlapMap.cpp: Added.
(WebCore::RectList::append):
(WebCore::RectList::intersects const):
(WebCore::OverlapMapContainer::add):
(WebCore::OverlapMapContainer::overlapsLayers const):
(WebCore::OverlapMapContainer::unite):
(WebCore::LayerOverlapMap::LayerOverlapMap):
(WebCore::LayerOverlapMap::add):
(WebCore::LayerOverlapMap::overlapsLayers const):
(WebCore::LayerOverlapMap::pushCompositingContainer):
(WebCore::LayerOverlapMap::popCompositingContainer):
* rendering/LayerOverlapMap.h: Added.
(WebCore::LayerOverlapMap::isEmpty const):
(WebCore::LayerOverlapMap::geometryMap const):
(WebCore::LayerOverlapMap::geometryMap):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingLayers):
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
(WebCore::RenderLayerCompositor::computeExtent const):
(WebCore::RenderLayerCompositor::addToOverlapMap):
(WebCore::RenderLayerCompositor::addToOverlapMapRecursive):
(WebCore::OverlapMapContainer::add): Deleted.
(WebCore::OverlapMapContainer::overlapsLayers const): Deleted.
(WebCore::OverlapMapContainer::unite): Deleted.
(WebCore::RenderLayerCompositor::OverlapMap::OverlapMap): Deleted.
(WebCore::RenderLayerCompositor::OverlapMap::add): Deleted.
(WebCore::RenderLayerCompositor::OverlapMap::overlapsLayers const): Deleted.
(WebCore::RenderLayerCompositor::OverlapMap::isEmpty const): Deleted.
(WebCore::RenderLayerCompositor::OverlapMap::pushCompositingContainer): Deleted.
(WebCore::RenderLayerCompositor::OverlapMap::popCompositingContainer): Deleted.
(WebCore::RenderLayerCompositor::OverlapMap::geometryMap const): Deleted.
(WebCore::RenderLayerCompositor::OverlapMap::geometryMap): Deleted.
(WebCore::RenderLayerCompositor::OverlapMap::RectList::append): Deleted.
(WebCore::RenderLayerCompositor::OverlapMap::RectList::intersects const): Deleted.
* rendering/RenderLayerCompositor.h:

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

3 months agocompilation failure with clang 9
commit-queue@webkit.org [Wed, 15 May 2019 15:13:02 +0000 (15:13 +0000)]
compilation failure with clang 9
https://bugs.webkit.org/show_bug.cgi?id=197911

Patch by Víctor Manuel Jáquez Leal <vjaquez@igalia.com> on 2019-05-15
Reviewed by Alex Christensen.

Use std namespace for nullptr_t in tagArrayPtr templates.

* wtf/PtrTag.h:
(WTF::tagArrayPtr):

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

3 months ago[GTK][jhbuild] misc cleanups and bumps
commit-queue@webkit.org [Wed, 15 May 2019 15:03:23 +0000 (15:03 +0000)]
[GTK][jhbuild] misc cleanups and bumps
https://bugs.webkit.org/show_bug.cgi?id=197913

Patch by Philippe Normand <pnormand@igalia.com> on 2019-05-15
Reviewed by Xabier Rodriguez-Calvar.

* gstreamer/jhbuild.modules: Bump to libva 2.4.1 and switch to Meson.
* gtk/jhbuild.modules: Bump to Brotli 1.0.5 and Wayland 1.16.

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

3 months agoFlaky API Test: TestWebKitAPI.ProcessSwap.NumberOfCachedProcesses
cdumez@apple.com [Wed, 15 May 2019 15:00:09 +0000 (15:00 +0000)]
Flaky API Test: TestWebKitAPI.ProcessSwap.NumberOfCachedProcesses
https://bugs.webkit.org/show_bug.cgi?id=195102
<rdar://problem/48456786>

Reviewed by Alex Christensen.

Try to wait longer for the number of processes to reach the expected number
and before failing.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

3 months agoAllow NSFileCoordinator to be called from WebContent process
commit-queue@webkit.org [Wed, 15 May 2019 14:55:11 +0000 (14:55 +0000)]
Allow NSFileCoordinator to be called from WebContent process
https://bugs.webkit.org/show_bug.cgi?id=197895
<rdar://problem/50107679>

Patch by Alex Christensen <achristensen@webkit.org> on 2019-05-15
Reviewed by Brent Fulgham.

Source/WebKit:

* WebProcess/com.apple.WebProcess.sb.in:
Expand sandbox to allow use of com.apple.FileCoordination mach service like we do on iOS.

Tools:

Add a unit test that verifies calling the block succeeds.

* TestWebKitAPI/Tests/WebKitCocoa/AdditionalReadAccessAllowedURLsPlugin.mm:
(-[AdditionalReadAccessAllowedURLsPlugIn webProcessPlugIn:didCreateBrowserContextController:]):

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

3 months agoUnreviewed test gardening for WinCairo
Hironori.Fujii@sony.com [Wed, 15 May 2019 10:22:47 +0000 (10:22 +0000)]
Unreviewed test gardening for WinCairo

* platform/wincairo-wk1/TestExpectations: Moved accessibility
expectations to this file.
* platform/wincairo/TestExpectations: Skip accessibility because
WinCairo WK2 doesn't support it yet. Skip
http/tests/resourceLoadStatistics for WK2 because all tests are
timing out.

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

3 months agoWeb Automation: elements larger than the viewport have incorrect in-view center point
drousso@apple.com [Wed, 15 May 2019 08:37:02 +0000 (08:37 +0000)]
Web Automation: elements larger than the viewport have incorrect in-view center point
https://bugs.webkit.org/show_bug.cgi?id=195696
<rdar://problem/48737122>

Reviewed by Simon Fraser.

Original patch by Brian Burg <bburg@apple.com>.

Source/WebCore:

Some conversion methods do not exist for `FloatRect`/`FloatPoint`. Fill them in as needed,
and export some symbols used by WebDriver code to compute an element's in-view center point
in various coordinate systems.

* dom/TreeScope.h:
* dom/TreeScope.cpp:
(WebCore::TreeScope::elementsFromPoint): Added.
* page/FrameView.h:
* page/FrameView.cpp:
(WebCore::FrameView::absoluteToLayoutViewportPoint const): Added.
(WebCore::FrameView::layoutViewportToAbsoluteRect const): Added.
(WebCore::FrameView::absoluteToLayoutViewportRect const): Added.
* platform/ScrollView.h:
* platform/ScrollView.cpp:
(WebCore::ScrollView::viewToContents const): Added.
(WebCore::ScrollView::contentsToView const): Added.
(WebCore::ScrollView::contentsToRootView const): Added.
* platform/Widget.h:
* platform/Widget.cpp:
(WebCore::Widget::convertToRootView const): Added.
(WebCore::Widget::convertFromRootView const): Added.
(WebCore::Widget::convertToContainingView const): Added.
(WebCore::Widget::convertFromContainingView const): Added.

Source/WebKit:

This seems to be an omission in the specification. While it does mention that the in-view
center point (IVCP) must be within the viewport, the algorithm never intersects the element
bounding box with the viewport rect.

* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::WebAutomationSessionProxy::computeElementLayout):
This code is incorrect. For `CoordinateSystem::LayoutViewport`, coordinates should be in
root view coordinates so that it can be later converted to screen and synthesized as a HID
event in screen coordinates. Intersect the element rect and the viewport rect before finding
the center point of the part of the element that's visible in the viewport.

(WebKit::convertRectFromFrameClientToRootView): Added.
(WebKit::convertPointFromFrameClientToRootView): Added.
Added helpers to properly account for scroll contents position on iOS.

* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::viewportInViewCenterPointOfElement):
Now that we determine whether the element is inside the viewport much earlier, if the
element has no `inViewCenterPoint`, we can return a `TargetOutOfBounds` instead of a more
"generic" `ElementNotInteractable`.

(WebKit::WebAutomationSession::simulateMouseInteraction):
Rename `locationInView` -> `locationInViewport`.

(WebKit::WebAutomationSession::simulateTouchInteraction):
This code is incorrect. The `unobscuredContentRect` is in screen coordinates, but
we are trying to see if (x, y) is outside the size of the viewport assumed to be at (0, 0).
Grab the visual viewport rect and see if the location exceeds the viewport size.

* UIProcess/Automation/ios/WebAutomationSessionIOS.mm:
(WebKit::operator<<):
Add logging helper for `TouchInteraction` enum.

(WebKit::WebAutomationSession::platformSimulateTouchInteraction):
Move local variable.

* UIProcess/Automation/SimulatedInputDispatcher.cpp:
(WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
Fix a typo in logging.

* UIProcess/Automation/Automation.json:
Simplify enum name.

* Platform/Logging.h:
Add logging channel to dump fully resolved interaction details.

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

3 months agoMissing cursor/caret showing in search field on google.com
wenson_hsieh@apple.com [Wed, 15 May 2019 04:57:56 +0000 (04:57 +0000)]
Missing cursor/caret showing in search field on google.com
https://bugs.webkit.org/show_bug.cgi?id=197862
<rdar://problem/50291989>

Reviewed by Simon Fraser.

Source/WebCore:

In this bug, the search field is inside of a fixed position container, which is inside of an empty "overflow:
hidden" form element (the new layout test demonstrates a simple version of this). The layer of the fixed
position container's renderer has an overflow clipping layer of itself, and its clipping rect is non-empty, so
the heuristic initially identifies the layer as not fully clipped. However, as the heuristic ascends the
RenderLayer tree, it then finds the layer for the "overflow: hidden" form element's renderer; this layer is
completely clipped, which causes the heuristic to incorrectly believe that the editable element is completely
clipped.

To fix the bug, this patch reworks the clipping portion of the heuristic, such that we no longer need to ascend
the layer tree. Instead of computing the clip rect relative to the nearest ancestor that has an overflow clip
and then walking up the layer tree repeating this process, simply compute the clip rect relative to RenderView's
layer, and then walk up to the parent frame and repeat if necessary.

Test: editing/selection/ios/do-not-hide-selection-in-visible-field.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::isTransparentOrFullyClippedRespectingParentFrames const):

LayoutTests:

Add a new layout test that represents a reduced test case version of google.com's search field.

* editing/selection/ios/do-not-hide-selection-in-visible-field.html: Added.

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

3 months agoFix flakey test fast/events/autoscroll-when-input-is-offscreen.html
megan_gardner@apple.com [Wed, 15 May 2019 04:00:05 +0000 (04:00 +0000)]
Fix flakey test fast/events/autoscroll-when-input-is-offscreen.html
https://bugs.webkit.org/show_bug.cgi?id=197897
<rdar://problem/50306931>

Reviewed by Wenson Hsieh.

Programmatic scrolls are included in the transaction and we want to
ensure that they've been applied. Then we can be sure that the page
has finished scrolling and it's appropriate to test the page offset.

* fast/events/autoscroll-when-input-is-offscreen.html:

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

3 months agostorage/indexeddb/modern/deletedatabase-2-private.html is a flaky failure
sroberts@apple.com [Tue, 14 May 2019 22:55:20 +0000 (22:55 +0000)]
storage/indexeddb/modern/deletedatabase-2-private.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=196445

Unreviewed test gardening.

* platform/ios-simulator-wk2/TestExpectations: Not flaky on iOS
* platform/mac-wk2/TestExpectations: Updating expectations for Mac

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

3 months ago[Apple Pay] Payment APIs should be completely disabled in web views into which client...
aestes@apple.com [Tue, 14 May 2019 22:50:21 +0000 (22:50 +0000)]
[Apple Pay] Payment APIs should be completely disabled in web views into which clients have injected user scripts
https://bugs.webkit.org/show_bug.cgi?id=197751
<rdar://problem/50631563>

Reviewed by Alex Christensen.

Source/WebCore:

In r243324, when a document has had user agent scripts injected into it, payment APIs were
disabled at runtime by having all entry points return falsy values or throw exceptions
(e.g., ApplePaySession.canMakePayments() returns false).

In the case of user scripts in particular (e.g., WKUserScript), since we know whether these
exist at the time we create a document's DOMWindow, we can do better than r243324 by
completely disabling the payment APIs in the presence of user scripts.

To achieve this, this change introduces the 'EnabledByContext' extended attribute for
interfaces, which instructs the bindings generator to add a conjunct to the payment API
constructors that asks the interface's implementation class whether it should be enabled for
a given ScriptExecutionContext. The PaymentRequest and ApplePaySession interfaces adopt this
new extended attribute to implement the new user script check.

Added new API tests.

* Modules/applepay/ApplePaySession.idl:
* Modules/applepay/PaymentCoordinator.cpp:
(WebCore::PaymentCoordinator::shouldEnableApplePayAPIs const):
* Modules/applepay/PaymentCoordinator.h:
* Modules/applepay/PaymentSession.cpp:
(WebCore::PaymentSession::enabledForContext):
* Modules/applepay/PaymentSession.h:
* Modules/paymentrequest/PaymentHandler.cpp:
(WebCore::PaymentHandler::enabledForContext):
* Modules/paymentrequest/PaymentHandler.h:
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::enabledForContext):
* Modules/paymentrequest/PaymentRequest.h:
* Modules/paymentrequest/PaymentRequest.idl:
* bindings/scripts/CodeGeneratorJS.pm:
(NeedsRuntimeCheck):
(GenerateRuntimeEnableConditionalString):
* bindings/scripts/IDLAttributes.json:
* bindings/scripts/preprocess-idls.pl:
(GenerateConstructorAttributes):
* bindings/scripts/test/JS/JSTestEnabledForContext.cpp: Added.
* bindings/scripts/test/JS/JSTestEnabledForContext.h: Added.
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
(WebCore::JSTestGlobalObject::finishCreation):
(WebCore::jsTestGlobalObjectTestEnabledForContextConstructorGetter):
(WebCore::jsTestGlobalObjectTestEnabledForContextConstructor):
(WebCore::setJSTestGlobalObjectTestEnabledForContextConstructorSetter):
(WebCore::setJSTestGlobalObjectTestEnabledForContextConstructor):
* bindings/scripts/test/TestEnabledForContext.idl: Added.

Tools:

Added new API tests.

* TestWebKitAPI/Tests/WebKitCocoa/ApplePay.mm:
(-[TestApplePayScriptMessageHandler initWithAPIsAvailableExpectation:canMakePaymentsExpectation:]):
(-[TestApplePayScriptMessageHandler userContentController:didReceiveScriptMessage:]):
(TestWebKitAPI::TEST):
(-[TestApplePayScriptMessageHandler initWithExpectation:]): Deleted.
* TestWebKitAPI/Tests/WebKitCocoa/apple-pay-availability.html:

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

3 months agoFix issue with byteOffset on ARM64E
keith_miller@apple.com [Tue, 14 May 2019 22:44:26 +0000 (22:44 +0000)]
Fix issue with byteOffset on ARM64E
https://bugs.webkit.org/show_bug.cgi?id=197884

Reviewed by Saam Barati.

JSTests:

We didn't have any tests that run with non-byte/non-zero offset
typed arrays.

* stress/ftl-gettypedarrayoffset-wasteful.js:

Source/JavaScriptCore:

We forgot to remove the tag from the ArrayBuffer's data
pointer. This corrupted data when computing the offset.  We didn't
catch this because we didn't run any with a non-zero byteOffset in
the JITs.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileGetTypedArrayByteOffset):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileGetTypedArrayByteOffset):
(JSC::FTL::DFG::LowerDFGToB3::untagArrayPtr):
(JSC::FTL::DFG::LowerDFGToB3::removeArrayPtrTag):
(JSC::FTL::DFG::LowerDFGToB3::speculateTypedArrayIsNotNeutered):
* jit/IntrinsicEmitter.cpp:
(JSC::IntrinsicGetterAccessCase::emitIntrinsicGetter):

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

3 months ago[WHLSL] parseEffectfulSuffix() is never called
rmorisset@apple.com [Tue, 14 May 2019 21:49:54 +0000 (21:49 +0000)]
[WHLSL] parseEffectfulSuffix() is never called
https://bugs.webkit.org/show_bug.cgi?id=195864
<rdar://problem/50746278>

Reviewed by Myles C. Maxfield.

The fix is trivial: when parseEffectfulPrefix does not see a ++ or --, it must call parseEffectfulSuffix.

No test yet, as it is not testable until the property resolver is finished.
It will be tested with the rest of the compiler, when we port the testsuite from the js implementation (it already covers this case).

* Modules/webgpu/WHLSL/WHLSLParser.cpp:
(WebCore::WHLSL::Parser::parseEffectfulPrefix):

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

3 months agoREGRESSION (r245249): ASSERTION FAILED: !m_needExceptionCheck seen with stress/proxy...
tzagallo@apple.com [Tue, 14 May 2019 21:38:12 +0000 (21:38 +0000)]
REGRESSION (r245249): ASSERTION FAILED: !m_needExceptionCheck seen with stress/proxy-delete.js and stress/proxy-property-descriptor.js
https://bugs.webkit.org/show_bug.cgi?id=197885
<rdar://problem/50770190>

Reviewed by Yusuke Suzuki.

In r245249 we added a throw scope to JSObject::getOwnPropertyDescriptor and its
callers now need to check for exceptions.

* runtime/ProxyObject.cpp:
(JSC::performProxyGet):
(JSC::ProxyObject::performDelete):

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

3 months ago[IntersectionObserver] Update expectations for tests that are no longer flaky
ajuma@chromium.org [Tue, 14 May 2019 20:38:43 +0000 (20:38 +0000)]
[IntersectionObserver] Update expectations for tests that are no longer flaky

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

3 months agoRebaseline inspector/model/remote-object.html after r245288
tsavell@apple.com [Tue, 14 May 2019 20:36:46 +0000 (20:36 +0000)]
Rebaseline inspector/model/remote-object.html after r245288
https://bugs.webkit.org/show_bug.cgi?id=197833

Unreviewed test gardening.

* inspector/model/remote-object-expected.txt:

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

3 months ago[WHLSL] parseEffectfulAssignment should not call parseCallExpression directly
rmorisset@apple.com [Tue, 14 May 2019 20:35:32 +0000 (20:35 +0000)]
[WHLSL] parseEffectfulAssignment should not call parseCallExpression directly
https://bugs.webkit.org/show_bug.cgi?id=197890

Reviewed by Myles Maxfield.

callExpression already appears in effSuffix which is in effPrefix which is in effAssignment, so having it directly in effAssignment as well is useless (and ambiguous).
I've already fixed the grammar (https://github.com/gpuweb/WHLSL/commit/a07005f4d692fe3370618dca5db218992b362049), the grammar was always good, this patch is fixing the parser.

* Modules/webgpu/WHLSL/WHLSLParser.cpp:
(WebCore::WHLSL::Parser::parseEffectfulAssignment):

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

3 months agoUnreviewed restoration of non-unified build.
ross.kirsling@sony.com [Tue, 14 May 2019 20:30:38 +0000 (20:30 +0000)]
Unreviewed restoration of non-unified build.

Source/JavaScriptCore:

* dfg/DFGMinifiedID.h:
* runtime/ObjectToStringAdaptiveStructureWatchpoint.cpp:

Source/WebCore:

* Modules/cache/DOMCache.cpp:
* bindings/js/JSLazyEventListener.h:
* loader/NavigationScheduler.h:
* page/Quirks.cpp:
* page/Quirks.h:
* rendering/ClipRect.cpp:

Source/WebKit:

* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
* NetworkProcess/cache/NetworkCacheFileSystem.cpp:
* UIProcess/WebProcessProxy.cpp:

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

3 months agoDo not try to issue repaint while the render tree is being destroyed.
zalan@apple.com [Tue, 14 May 2019 20:03:46 +0000 (20:03 +0000)]
Do not try to issue repaint while the render tree is being destroyed.
https://bugs.webkit.org/show_bug.cgi?id=197461
<rdar://problem/50368992>

Reviewed by Simon Fraser.

Source/WebCore:

Test: http/tests/svg/crash-on-reload-with-filter.html

We don't need to compute repaint rects when the render tree is getting torn down. We'll issue a full repaint at some point.
Also during full render tree destruction the inline tree state is undefined. We should avoid accessing it.

* rendering/svg/RenderSVGResourceContainer.cpp:
(WebCore::RenderSVGResourceContainer::markAllClientLayersForInvalidation):

LayoutTests:

* http/tests/svg/crash-on-reload-with-filter-expected.txt: Added.
* http/tests/svg/crash-on-reload-with-filter.html: Added.
* http/tests/svg/resources/finishTest.html: Added.

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

3 months agoA service worker process should app nap when all its clients app nap
youenn@apple.com [Tue, 14 May 2019 19:48:51 +0000 (19:48 +0000)]
A service worker process should app nap when all its clients app nap
https://bugs.webkit.org/show_bug.cgi?id=185626
<rdar://problem/46785908>

Reviewed by Alex Christensen.

Source/WebCore:

Update RegistrableDomain to work with SecurityOriginData.
Add internal API to enable accessing to service worker process throttle state.

Test: http/wpt/service-workers/mac/processSuppression.https.html

* platform/RegistrableDomain.h:
(WebCore::RegistrableDomain::RegistrableDomain):
(WebCore::RegistrableDomain::matches const):
(WebCore::RegistrableDomain::registrableDomainFromHost):
* testing/ServiceWorkerInternals.cpp:
(WebCore::ServiceWorkerInternals::isThrottleable const):
* testing/ServiceWorkerInternals.h:
* testing/ServiceWorkerInternals.idl:
* workers/service/SWClientConnection.h:
* workers/service/context/SWContextManager.cpp:
* workers/service/context/SWContextManager.h:
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::serverToContextConnectionCreated):
* workers/service/server/SWServer.h:
(WebCore::SWServer::Connection::server const):
(WebCore::SWServer::connections const):
* workers/service/server/SWServerToContextConnection.h:

Source/WebKit:

Compute whether a given web process can be throttled on every page throttling change.
Send that information to network process which stores that information in WebSWServerConnection.
Every WebSWServerToContextConnection throttle state is then computed based on all WebSWServerConnection
that have a client that matches the registrable domain of the context connection.

* NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::registerServiceWorkerClient):
(WebKit::WebSWServerConnection::unregisterServiceWorkerClient):
(WebKit::WebSWServerConnection::hasMatchingClient const):
(WebKit::WebSWServerConnection::computeThrottleState const):
(WebKit::WebSWServerConnection::setThrottleState):
(WebKit::WebSWServerConnection::updateThrottleState):
(WebKit::WebSWServerConnection::serverToContextConnectionCreated):
* NetworkProcess/ServiceWorker/WebSWServerConnection.h:
(WebKit::WebSWServerConnection::isThrottleable const):
* NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in:
* NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
(WebKit::WebSWServerToContextConnection::setThrottleState):
* NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
(WebKit::WebSWServerToContextConnection::isThrottleable const):
* UIProcess/ServiceWorkerProcessProxy.cpp:
* UIProcess/ServiceWorkerProcessProxy.h:
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::WebSWClientConnection):
(WebKit::WebSWClientConnection::updateThrottleState):
* WebProcess/Storage/WebSWClientConnection.h:
* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::setThrottleState):
(WebKit::WebSWContextManagerConnection::isThrottleable const):
* WebProcess/Storage/WebSWContextManagerConnection.h:
* WebProcess/Storage/WebSWContextManagerConnection.messages.in:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updateUserActivity):
(WebKit::WebPage::isThrottleable const):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::arePagesThrottleable const):
* WebProcess/WebProcess.h:

Tools:

Allow to enable app nap through test header.

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):
(WTR::updateTestOptionsFromTestHeader):
* WebKitTestRunner/TestOptions.h:
(WTR::TestOptions::hasSameInitializationOptions const):

LayoutTests:

* http/wpt/service-workers/mac/throttleable-worker.js: Added.
* http/wpt/service-workers/mac/throttleable.https-expected.txt: Added.
* http/wpt/service-workers/mac/throttleable.https.html: Added.
* platform/ios-wk2/TestExpectations:

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

3 months agoCrash under WebKit::WebProcessProxy::didBecomeUnresponsive()
cdumez@apple.com [Tue, 14 May 2019 19:48:09 +0000 (19:48 +0000)]
Crash under WebKit::WebProcessProxy::didBecomeUnresponsive()
https://bugs.webkit.org/show_bug.cgi?id=197883
<rdar://problem/50665984>

Reviewed by Alex Christensen.

Protect |this| in didBecomeUnresponsive() and didExceedCPULimit() since we call client
delegates and those may cause |this| to get destroyed.

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::didBecomeUnresponsive):
(WebKit::WebProcessProxy::didExceedCPULimit):

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

3 months agoThe network process tries to take a process assertion when NetworkProcess::processWil...
cdumez@apple.com [Tue, 14 May 2019 19:32:17 +0000 (19:32 +0000)]
The network process tries to take a process assertion when NetworkProcess::processWillSuspendImminently() is called
https://bugs.webkit.org/show_bug.cgi?id=197888

Reviewed by Geoffrey Garen.

When actualPrepareToSuspend() in the Network process is called set the 'IsSuspended' flag on the SQLite database tracker and unset
the flag when the process resume. This is consistent with what we already do in the WebProcess and makes sure that
the network process does not try and take on a new assertion due to locked files when getting notified it is about to get
suspended.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::actualPrepareToSuspend):
(WebKit::NetworkProcess::processWillSuspendImminently):
(WebKit::NetworkProcess::resume):

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

3 months agogetUserMedia capture changes on iOS after homing out
youenn@apple.com [Tue, 14 May 2019 19:30:19 +0000 (19:30 +0000)]
getUserMedia capture changes on iOS after homing out
https://bugs.webkit.org/show_bug.cgi?id=197707

Reviewed by Eric Carlson.

In case of muting an AVVideoCaptureSource on iOS, the session is cleared.
We need to store the preset information, to setup the new session on unnmuting correctly.
Manually tested.

* platform/mediastream/mac/AVVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset):
(WebCore::AVVideoCaptureSource::setSessionSizeAndFrameRate):
(WebCore::AVVideoCaptureSource::setupCaptureSession):

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

3 months ago[css-grid] Update grid when changing auto repeat type
obrufau@igalia.com [Tue, 14 May 2019 19:06:23 +0000 (19:06 +0000)]
[css-grid] Update grid when changing auto repeat type
https://bugs.webkit.org/show_bug.cgi?id=197849

Reviewed by Javier Fernandez.

LayoutTests/imported/w3c:

Import WPT test.

* web-platform-tests/css/css-grid/grid-definition/grid-change-auto-repeat-tracks-expected.txt: Added.
* web-platform-tests/css/css-grid/grid-definition/grid-change-auto-repeat-tracks.html: Added.
* web-platform-tests/css/css-grid/grid-definition/w3c-import.log:

Source/WebCore:

Test: imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-change-auto-repeat-tracks.html

This patch makes two 'repeat()' values for 'grid-template' be considered
to be different if one uses 'auto-fill' and the other 'auto-fit'.

Previously, they were considered to be equal if the repeated values
were the same, without comparing the repeat type. Therefore, the grid
was not updated when setting both values one after the other.

* css/CSSGridAutoRepeatValue.cpp:
(WebCore::CSSGridAutoRepeatValue::equals const):
* css/CSSGridAutoRepeatValue.h:

LayoutTests:

Remove the test which has been upstreamed to WPT.

* fast/css-grid-layout/grid-change-auto-repeat-tracks-expected.txt: Removed.
* fast/css-grid-layout/grid-change-auto-repeat-tracks.html: Removed.

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

3 months agoUpdate TBA macros for API / SPI that has already shipped
cdumez@apple.com [Tue, 14 May 2019 18:52:44 +0000 (18:52 +0000)]
Update TBA macros for API / SPI that has already shipped
https://bugs.webkit.org/show_bug.cgi?id=197841
<rdar://problem/50698499>

Reviewed by Geoffrey Garen.

* Configurations/WebKit.xcconfig:
Disable header postprocessing when building for macOS Mojave

* Shared/API/Cocoa/_WKRenderingProgressEvents.h:
* UIProcess/API/C/WKPage.h:
* UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h:
* UIProcess/API/Cocoa/WKBrowsingContextController.h:
* UIProcess/API/Cocoa/WKBrowsingContextGroup.h:
* UIProcess/API/Cocoa/WKBrowsingContextHistoryDelegate.h:
* UIProcess/API/Cocoa/WKBrowsingContextLoadDelegate.h:
* UIProcess/API/Cocoa/WKBrowsingContextPolicyDelegate.h:
* UIProcess/API/Cocoa/WKConnection.h:
* UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* UIProcess/API/Cocoa/WKProcessGroup.h:
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/API/Cocoa/WKTypeRefWrapper.h:
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/API/Cocoa/WKView.h:
(WK_CLASS_DEPRECATED_WITH_REPLACEMENT):
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/API/Cocoa/_WKAttachment.h:
* UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.h:
* UIProcess/API/Cocoa/_WKDownload.h:
* UIProcess/API/Cocoa/_WKFormInputSession.h:
* UIProcess/API/Cocoa/_WKInspector.h:
* UIProcess/API/Cocoa/_WKInternalDebugFeature.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.h:
* WebProcess/API/Cocoa/WKWebProcess.h:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandlePrivate.h:

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

3 months agoEvent region computation should respect transforms
antti@apple.com [Tue, 14 May 2019 18:28:11 +0000 (18:28 +0000)]
Event region computation should respect transforms
https://bugs.webkit.org/show_bug.cgi?id=197836
<rdar://problem/50762971>

Reviewed by Darin Adler.

Source/WebCore:

* platform/graphics/transforms/AffineTransform.cpp:
(WebCore::AffineTransform::mapRegion const):

Add support for transforming regions. Non-rectlinear results use enclosing rects.

* platform/graphics/transforms/AffineTransform.h:
* rendering/EventRegion.cpp:
(WebCore::EventRegionContext::EventRegionContext):
(WebCore::EventRegionContext::pushTransform):
(WebCore::EventRegionContext::popTransform):
(WebCore::EventRegionContext::unite):
(WebCore::EventRegionContext::contains const):

Add a context object that holds the current transform.

* rendering/EventRegion.h:
(WebCore::EventRegion::makeContext):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paint):
* rendering/PaintInfo.h:

Replace the region object with the context.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintObject):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintLayerByApplyingTransform):

Apply transforms to regions if needed.

(WebCore::RenderLayer::collectEventRegionForFragments):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateEventRegion):
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::paintFlow):

LayoutTests:

* fast/scrolling/ios/event-region-scale-transform-shared-expected.txt:
* fast/scrolling/ios/event-region-translate-transform-shared-expected.txt:

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

3 months agoUnreviewed: fix test failures after r245280.
said@apple.com [Tue, 14 May 2019 18:27:14 +0000 (18:27 +0000)]
Unreviewed: fix test failures after r245280.

* platform/mac-wk2/TestExpectations:
Animating HEICS images is supported only on post macOS Mojave. So these
tests should be skipped in WebKit for now.

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

3 months agoUnreviewed, rolling out r245281.
commit-queue@webkit.org [Tue, 14 May 2019 18:10:25 +0000 (18:10 +0000)]
Unreviewed, rolling out r245281.
https://bugs.webkit.org/show_bug.cgi?id=197887

Broke API Test TestWebKitAPI.Challenge.ClientCertificate
(Requested by aakashjain on #webkit).

Reverted changeset:

"Add a unit test for client certificate authentication"
https://bugs.webkit.org/show_bug.cgi?id=197800
https://trac.webkit.org/changeset/245281

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

3 months agoVideo frame resizing should be using Trim
youenn@apple.com [Tue, 14 May 2019 17:43:19 +0000 (17:43 +0000)]
Video frame resizing should be using Trim
https://bugs.webkit.org/show_bug.cgi?id=197722
<rdar://problem/50602188>

Reviewed by Eric Carlson.

Source/WebCore:

Move from letter box to trim mode for resizing.
This ensures no black stripes are present when rendering the stream.

Test: fast/mediastream/resize-trim.html

* platform/cocoa/VideoToolboxSoftLink.cpp:
* platform/cocoa/VideoToolboxSoftLink.h:
* platform/graphics/cv/ImageTransferSessionVT.mm:
(WebCore::ImageTransferSessionVT::ImageTransferSessionVT):

LayoutTests:

* fast/mediastream/resize-trim-expected.txt: Renamed from LayoutTests/fast/mediastream/resize-letterbox-expected.txt.
* fast/mediastream/resize-trim.html: Renamed from LayoutTests/fast/mediastream/resize-letterbox.html.
* platform/gtk/TestExpectations:

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

3 months ago[JSC] Shrink sizeof(UnlinkedFunctionExecutable) more
ysuzuki@apple.com [Tue, 14 May 2019 17:31:53 +0000 (17:31 +0000)]
[JSC] Shrink sizeof(UnlinkedFunctionExecutable) more
https://bugs.webkit.org/show_bug.cgi?id=197833

Reviewed by Darin Adler.

JSTests:

* stress/generator-name.js: Added.
(shouldBe):
(gen):
(catch):

Source/JavaScriptCore:

It turns out that Gmail creates so many JSFunctions, FunctionExecutables, and UnlinkedFunctionExecutables.
So we should shrink size of them to save memory. As a first step, this patch reduces the sizeof(UnlinkedFunctionExecutable) more by 16 bytes.

1. We reorder some fields to get 8 bytes. And we use 31 bits for xxx offset things since their maximum size should be within 31 bits due to
   String's length & int32_t representation in our parser.

2. We drop m_inferredName and prefer m_ecmaName. The inferred name is used to offer better function name when the function expression lacks
   the name, but now ECMAScript has a specified semantics to name those functions with intuitive names. We should use ecmaName consistently,
   and should not eat 8 bytes for inferred names in UnlinkedFunctionExecutable.

We also fix generator ecma name.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::inferredName const):
* bytecode/InlineCallFrame.cpp:
(JSC::InlineCallFrame::inferredName const):
* bytecode/UnlinkedFunctionExecutable.cpp:
(JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable):
* bytecode/UnlinkedFunctionExecutable.h:
* parser/ASTBuilder.h:
(JSC::ASTBuilder::createAssignResolve):
(JSC::ASTBuilder::createGeneratorFunctionBody):
(JSC::ASTBuilder::createGetterOrSetterProperty):
(JSC::ASTBuilder::createProperty):
(JSC::ASTBuilder::tryInferNameInPatternWithIdentifier):
(JSC::ASTBuilder::makeAssignNode):
* parser/Nodes.cpp:
(JSC::FunctionMetadataNode::operator== const):
(JSC::FunctionMetadataNode::dump const):
* parser/Nodes.h:
* runtime/CachedTypes.cpp:
(JSC::CachedFunctionExecutable::ecmaName const):
(JSC::CachedFunctionExecutable::encode):
(JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable):
(JSC::CachedFunctionExecutable::inferredName const): Deleted.
* runtime/FunctionExecutable.h:
* runtime/FunctionExecutableDump.cpp:
(JSC::FunctionExecutableDump::dump const):
* runtime/JSFunction.cpp:
(JSC::JSFunction::calculatedDisplayName):
(JSC::getCalculatedDisplayName):
* runtime/SamplingProfiler.cpp:
(JSC::SamplingProfiler::StackFrame::displayName):
(JSC::SamplingProfiler::StackFrame::displayNameForJSONTests):

Source/WebCore:

* testing/Internals.cpp:
(WebCore::Internals::parserMetaData):

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

3 months agoAdd support for webkit-test-runner options to WPT importer
youenn@apple.com [Tue, 14 May 2019 17:03:18 +0000 (17:03 +0000)]
Add support for webkit-test-runner options to WPT importer
https://bugs.webkit.org/show_bug.cgi?id=197826

Reviewed by Alex Christensen.

In case of overwriting an existing test, check if the existing test
contains a <!-- webkit-test-runner --> comment and insert it back if
needed in the new test.

For exporter, forbid creating a WPT PR if there are changes containing
the webkit-test-runner string.

* Scripts/webkitpy/w3c/test_converter.py:
(convert_for_webkit):
(_W3CTestConverter.__init__):
(_W3CTestConverter.add_webkit_test_runner_options_if_needed):
(_W3CTestConverter.handle_starttag):
(_W3CTestConverter.handle_comment):
(_W3CTestConverter.handle_decl):
(_W3CTestConverter.handle_pi):
* Scripts/webkitpy/w3c/test_exporter.py:
(WebPlatformTestExporter.write_git_patch_file):
(WebPlatformTestExporter.make_pull_request):
* Scripts/webkitpy/w3c/test_importer.py:
(TestImporter.webkit_test_runner_options):
(TestImporter):
(TestImporter.add_webkit_test_runner_options_to_content):
(TestImporter.copy_html_file):
(TestImporter.write_html_template):
(TestImporter.write_html_files_for_templated_js_tests):
(TestImporter.import_tests):
* Scripts/webkitpy/w3c/test_importer_unittest.py:
(test_manual_slow_test):
(test_webkit_test_runner_options):

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

3 months ago[Pointer Events] The pointerenter and pointerleave events target the wrong element...
commit-queue@webkit.org [Tue, 14 May 2019 16:50:37 +0000 (16:50 +0000)]
[Pointer Events] The pointerenter and pointerleave events target the wrong element on iOS
https://bugs.webkit.org/show_bug.cgi?id=197881
<rdar://problem/50187657>

Patch by Antoine Quint <graouts@apple.com> on 2019-05-14
Reviewed by Dean Jackson.

Source/WebCore:

Test: pointerevents/ios/enter-leave-target.html

The "pointerenter" and "pointerleave" should target the element on which the event listener was added and not
the element that would otherwise hit test. This matches the behavior of "mouseenter" and "mouseleave" on macOS.

* page/PointerCaptureController.cpp:
(WebCore::PointerCaptureController::dispatchEventForTouchAtIndex):

LayoutTests:

Add a test where we tap an element that is the child of another element where the parent is the element with the "pointerenter"
and "pointerleave" events registered. The test shows that we correctly set the target to the parent element and not the child.

* pointerevents/ios/enter-leave-target-expected.txt: Added.
* pointerevents/ios/enter-leave-target.html: Added.

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

3 months ago[iOS] Cannot scroll to beginning of document after scrolling to end of document and...
commit-queue@webkit.org [Tue, 14 May 2019 16:43:51 +0000 (16:43 +0000)]
[iOS] Cannot scroll to beginning of document after scrolling to end of document and vice versa via key commands
https://bugs.webkit.org/show_bug.cgi?id=197848
<rdar://problem/49523065>

Patch by Daniel Bates <dabates@apple.com> on 2019-05-14
Reviewed by Brent Fulgham.

Source/WebKit:

Following the fix for <rdar://problem/49523065>, UIKit no longer emits a keyup event for a Command-
modified key. This breaks WebKit's own implementation of key command handling for scrolling to the
beginning or end of the document (triggered using Command + Arrow Up and Command + Arrow Down,
respectively) because it watches for keyup events to reset state after initiating a scroll. If state
is not reset then the scroll key command logic becomes confused and may not perform a subsequent scroll.
It seems like we can actually get away with supporting these key commands and future Command modified
commands by preemptively reseting state on keydown if the Command modifier is held down. If this does
not work out then we can do something more complicated.

* UIProcess/ios/WKKeyboardScrollingAnimator.mm:
(-[WKKeyboardScrollingAnimator handleKeyEvent:]):

LayoutTests:

Add a test to ensure that key commands can be used to scroll to the end of the page and then
to the beginning of the page.

* fast/scrolling/ios/scroll-to-beginning-and-end-of-document-expected.txt: Added.
* fast/scrolling/ios/scroll-to-beginning-and-end-of-document.html: Added.
* resources/ui-helper.js:
(window.UIHelper.callFunctionAndWaitForScrollToFinish): Added. Convenience function that invokes the
specified function and returns a Promise that is resolved once the page has finished scrolling. To know
if the page has finished scrolling we listen for DOM scroll events and repeatedly reset a 300ms timer.
The delay of 300ms was chosen to be > 250ms (to give some margin of error), which is the upper bound
delay between scroll event firings, last I recall. When the timer expires we assume that page has
finished scrolling.
(window.UIHelper):

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

3 months agoProtect current WebFrame during form submission
bfulgham@apple.com [Tue, 14 May 2019 16:36:39 +0000 (16:36 +0000)]
Protect current WebFrame during form submission
https://bugs.webkit.org/show_bug.cgi?id=197459
<rdar://problem/50368618>

Reviewed by Alex Christensen.

The 'continueWillSubmitForm' method calls a completion handler that
might affect the state of the current frame. Ensure the frame is valid
for the scope of the function.

* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::continueWillSubmitForm):

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

3 months ago[iOS] Cannot tab or shift + tab out of address bar on google.com
commit-queue@webkit.org [Tue, 14 May 2019 16:22:32 +0000 (16:22 +0000)]
[iOS] Cannot tab or shift + tab out of address bar on google.com
https://bugs.webkit.org/show_bug.cgi?id=197859
<rdar://problem/46651565>

Patch by Daniel Bates <dabates@apple.com> on 2019-05-14
Reviewed by Darin Adler.

Non-editable elements can participate in tab cycling via the HTML tabindex attribute.
We should allow setting the initial focus to such an element when transitioning from
the chrome (e.g. address bar) to the web page.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]):

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

3 months ago[ews-app] Status bubble should turn orange when any build step fails
aakash_jain@apple.com [Tue, 14 May 2019 16:18:24 +0000 (16:18 +0000)]
[ews-app] Status bubble should turn orange when any build step fails
https://bugs.webkit.org/show_bug.cgi?id=197812

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-app/ews/views/statusbubble.py:
(StatusBubble._build_bubble): Turn status-bubble orange if there is any failed step in the on-going build.
(StatusBubble._does_build_contains_any_failed_step): Method to check if build contains any failed step.

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

3 months agoAdd a unit test for client certificate authentication
commit-queue@webkit.org [Tue, 14 May 2019 15:49:35 +0000 (15:49 +0000)]
Add a unit test for client certificate authentication
https://bugs.webkit.org/show_bug.cgi?id=197800

Patch by Alex Christensen <achristensen@webkit.org> on 2019-05-14
Reviewed by Youenn Fablet.

Source/WebKit:

* Shared/cf/ArgumentCodersCF.cpp:
Move SPI declarations to SecuritySPI.h.

Source/WTF:

* wtf/spi/cocoa/SecuritySPI.h:
Move declarations from ArgumentCodersCF.cpp so they can be shared.

Tools:

Make better abstractions for reading and writing from/to TCPServer.
Add a unit test that causes a client certificate authentication challenge to happen.

* TestWebKitAPI/TCPServer.cpp:
(TestWebKitAPI::TCPServer::TCPServer):
(TestWebKitAPI::TCPServer::read):
(TestWebKitAPI::TCPServer::write):
(TestWebKitAPI::TCPServer::respondWithChallengeThenOK):
(TestWebKitAPI::TCPServer::respondWithOK):
* TestWebKitAPI/TCPServer.h:
* TestWebKitAPI/Tests/WebKitCocoa/Challenge.mm:
(credentialWithIdentity):
(-[ChallengeDelegate webView:didReceiveAuthenticationChallenge:completionHandler:]):
(TEST):
(-[ClientCertificateDelegate webView:didFinishNavigation:]):
(-[ClientCertificateDelegate webView:didReceiveAuthenticationChallenge:completionHandler:]):
(-[ClientCertificateDelegate challengeCount]):
(TestWebKitAPI::TEST):
(respondWithChallengeThenOK): Deleted.
(credentialWithIdentityAndKeychainPath): Deleted.
* TestWebKitAPI/Tests/WebKitCocoa/PDFLinkReferrer.mm:
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/Proxy.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitCocoa/WKNavigationResponse.mm:
(TEST):
(readRequest): Deleted.
(writeResponse): Deleted.
* TestWebKitAPI/Tests/WebKitCocoa/WKWebsiteDatastore.mm:
(TestWebKitAPI::TEST):
(TestWebKitAPI::respondWithChallengeThenOK): Deleted.

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

3 months ago[CG] Adding support for HEIF-sequence ('public.heics') images
commit-queue@webkit.org [Tue, 14 May 2019 15:13:50 +0000 (15:13 +0000)]
[CG] Adding support for HEIF-sequence ('public.heics') images
https://bugs.webkit.org/show_bug.cgi?id=197384

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-05-14
Reviewed by Simon Fraser.

Source/WebCore:

-- Get the image repetitionCount and the frame duration.
-- Add a new function setAdditionalSupportedImageTypesForTesting() which
   takes a delimited String.
-- Add internal APIs to retrive the image frame count and the frame
   duration.

Tests: fast/images/animated-heics-draw.html
       fast/images/animated-heics-verify.html

* platform/graphics/ImageSource.h:
* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::animationPropertiesFromProperties):
(WebCore::animationHEICSPropertiesFromProperties):
(WebCore::ImageDecoderCG::repetitionCount const):
(WebCore::ImageDecoderCG::frameDurationAtIndex const):
* platform/graphics/cg/UTIRegistry.cpp:
(WebCore::setAdditionalSupportedImageTypesForTesting):
* platform/graphics/cg/UTIRegistry.h:
* testing/Internals.cpp:
(WebCore::Internals::imageFrameCount):
(WebCore::Internals::imageFrameDurationAtIndex):
* testing/Internals.h:
* testing/Internals.idl:
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::setAdditionalSupportedImageTypesForTesting):
* testing/js/WebCoreTestSupport.h:

Tools:

* DumpRenderTree/TestOptions.cpp:
(TestOptions::TestOptions):
* DumpRenderTree/TestOptions.h:
* DumpRenderTree/mac/DumpRenderTree.mm:
(resetWebViewToConsistentStateBeforeTesting):
Parse the new webkit-test-runner paramter: additionalSupportedImageTypes.
Make DRT call setAdditionalSupportedImageTypesForTesting() before starting
the test.

* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::stringForKey):
(WTR::InjectedBundle::beginTesting):
* WebKitTestRunner/InjectedBundle/InjectedBundle.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetStateToConsistentValues):
(WTR::updateTestOptionsFromTestHeader):
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::createTestSettingsDictionary):
* WebKitTestRunner/TestOptions.h:
(WTR::TestOptions::hasSameInitializationOptions const):
Parse the new webkit-test-runner paramter: additionalSupportedImageTypes.
Make WTR call setAdditionalSupportedImageTypesForTesting() before starting
the test.

LayoutTests:

Disable the tests for all ports and enable it only for [ Mojave+ WK2]
because of <rdar://problem/42625657>.

* TestExpectations:
* fast/images/animated-heics-draw-expected.txt: Added.
* fast/images/animated-heics-draw.html: Added.
* fast/images/animated-heics-verify-expected.txt: Added.
* fast/images/animated-heics-verify.html: Added.
* fast/images/resources/sea_animation.heics: Added.
* fast/images/resources/sticker.heics: Added.
* platform/mac-wk2/TestExpectations:

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

3 months ago[css-grid] Use max size to compute auto repeat tracks
rego@igalia.com [Tue, 14 May 2019 15:08:46 +0000 (15:08 +0000)]
[css-grid] Use max size to compute auto repeat tracks
https://bugs.webkit.org/show_bug.cgi?id=197854

Reviewed by Javier Fernandez.

LayoutTests/imported/w3c:

Imported WPT tests for this bug.

* web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-max-size-001-expected.txt: Added.
* web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-max-size-001.html: Added.
* web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-max-size-002-expected.txt: Added.
* web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-max-size-002.html: Added.
* web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-max-size-001-expected.txt: Added.
* web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-max-size-001.html: Added.
* web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-size-001-expected.txt: Added.
* web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-size-001.html: Added.
* web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-size-002-expected.txt: Added.
* web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-size-002.html: Added.
* web-platform-tests/css/css-grid/grid-definition/w3c-import.log:

Source/WebCore:

When available size is indefinite we should use max size to compute the number of auto repeat tracks.

The spec text is very clear (https://drafts.csswg.org/css-grid/#auto-repeat):
> When auto-fill is given as the repetition number, if the grid container
> has a definite size or **max size** in the relevant axis...

So far we were not doing that for widths, in this patch we modify RenderGrid::computeAutoRepeatTracksCount()
to do the same than for heights.

We also take advantage to fix problems related to min|max sizes and box-sizing property,
that were inconsistent for columns and rows.

Tests: imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-max-size-001.html
       imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-max-size-002.html
       imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-max-size-001.html
       imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-size-001.html
       imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-size-002.html

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::computeAutoRepeatTracksCount const):

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

3 months agoREGRESSION(r245088): [GTK] Several WebGL tests failing
magomez@igalia.com [Tue, 14 May 2019 15:07:19 +0000 (15:07 +0000)]
REGRESSION(r245088): [GTK] Several WebGL tests failing
https://bugs.webkit.org/show_bug.cgi?id=197880

Reviewed by Carlos Garcia Campos.

Enable GLSL compiler output for WebKitGTK.

* PlatformGTK.cmake: Added.

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

3 months ago[Win10] Some tests are failing only on specific machines
pvollan@apple.com [Tue, 14 May 2019 15:02:21 +0000 (15:02 +0000)]
[Win10] Some tests are failing only on specific machines
https://bugs.webkit.org/show_bug.cgi?id=197509

Unreviewed test gardening.

* platform/win/TestExpectations:

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

3 months agoImplement page-break-* and -webkit-column-break-* as legacy-shorthands.
jh718.park@samsung.com [Tue, 14 May 2019 14:02:50 +0000 (14:02 +0000)]
Implement page-break-* and -webkit-column-break-* as legacy-shorthands.
https://bugs.webkit.org/show_bug.cgi?id=197656

LayoutTests/imported/w3c:

Reviewed by Darin Adler.

According to https://drafts.csswg.org/css-cascade-4/#legacy-shorthand,
implement page-break-* and -webkit-column-break-* as legacy-shorthands for break-*.

This change also serialize page-break-* properties
to CSSStyleDeclaration,
per https://drafts.csswg.org/css-break/#page-break-properties.

* web-platform-tests/css/cssom/serialize-values-expected.txt:

Source/WebCore:

Reviewed by Darin Adler.

According to https://drafts.csswg.org/css-cascade-4/#legacy-shorthand,
implement page-break-* and -webkit-column-break-* as legacy-shorthands for break-*.

This change also serialize page-break-* properties
to CSSStyleDeclaration,
per https://drafts.csswg.org/css-break/#page-break-properties.

* css/CSSProperties.json:
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertFontSynthesis):
(WebCore::StyleBuilderConverter::convertPageBreakBetween): Deleted.
(WebCore::StyleBuilderConverter::convertPageBreakInside): Deleted.
(WebCore::StyleBuilderConverter::convertColumnBreakBetween): Deleted.
(WebCore::StyleBuilderConverter::convertColumnBreakInside): Deleted.
* css/StyleProperties.cpp:
(WebCore::StyleProperties::getPropertyValue const):
(WebCore::StyleProperties::pageBreakPropertyValue const):
* css/StyleProperties.h:
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseValueStart):
(WebCore::mapFromPageBreakBetween):
(WebCore::CSSPropertyParser::parseShorthand):
(WebCore::isLegacyBreakProperty): Deleted.

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

3 months agoImplement "line-break: anywhere"
jfernandez@igalia.com [Tue, 14 May 2019 13:20:54 +0000 (13:20 +0000)]
Implement "line-break: anywhere"
https://bugs.webkit.org/show_bug.cgi?id=181169
<rdar://problem/48507088>

Reviewed by Myles C. Maxfield.

LayoutTests/imported/w3c:

New tests to verify the new line-break: anywhere feature and how
it behaves different to 'word-break: break-all'.

* web-platform-tests/css/css-text/line-break/line-break-anywhere-001.html:
* web-platform-tests/css/css-text/line-break/line-break-anywhere-002.html:
* web-platform-tests/css/css-text/line-break/line-break-anywhere-003-expected.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-003.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-004-expected.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-004.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-005-expected.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-005.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-006-expected.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-006.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-007-expected.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-007.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-008-expected.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-008.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-009-expected.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-009.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-010-expected.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-010.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-011-expected.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-011.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-012-expected.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-012.html: Added.
* web-platform-tests/css/css-text/parsing/line-break-valid-expected.txt:
* web-platform-tests/css/css-text/word-break/word-break-break-all-016-expected.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-016.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-017-expected.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-017.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-018-expected.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-018.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-019-expected.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-019.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-021-expected.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-021.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-022-expected.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-022.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-023-expected.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-023.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-024-expected.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-024.html: Added.

Source/WebCore:

The CSS WG resolved [1] to add a new value 'anywhere' to the 'line-break'
CSS property in order to allow additional breaking opportunities not
considered in the definition of the 'word-break: break-all'.

[1] https://github.com/w3c/csswg-drafts/issues/1171

Tests: imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-003.html
       imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-004.html
       imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-005.html
       imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-006.html
       imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-007.html
       imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-008.html
       imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-009.html
       imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-010.html
       imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-011.html
       imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-012.html
       imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-016.html
       imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-017.html
       imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-018.html
       imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-019.html
       imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-021.html
       imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-022.html
       imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-023.html
       imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-024.html

* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator LineBreak const):
* css/CSSProperties.json:
* css/CSSValueKeywords.in:
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
* rendering/BreakLines.h:
(WebCore::nextBreakablePositionBreakCharacter):
(WebCore::isBreakable):
* rendering/RenderText.cpp:
(WebCore::mapLineBreakToIteratorMode):
(WebCore::RenderText::computePreferredLogicalWidths):
* rendering/line/BreakingContext.h:
(WebCore::BreakingContext::handleText):
* rendering/style/RenderStyleConstants.h:

LayoutTests:

Some of the new tests added to verify the new 'line-break:
anywhere' feature and its different behavior to what 'word-break:
break-all' may provide, fail due to several bugs present in
current WebKit's trunk.

* TestExpectations:
  - webkit.org/b/197409
  - webkit.org/b/197411
  - webkit.org/b/197411
  - webkit.org/b/197430

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

3 months agoFollowup to r245267: fix some more deprecated uses of -[UIApplication interfaceOrient...
wenson_hsieh@apple.com [Tue, 14 May 2019 04:14:59 +0000 (04:14 +0000)]
Followup to r245267: fix some more deprecated uses of -[UIApplication interfaceOrientation]
https://bugs.webkit.org/show_bug.cgi?id=197867
<rdar://problem/50743963>

Reviewed by Simon Fraser.

Add a helper method on WKContentView that asks the view's window's scene for an interface orientation; then,
use this helper from various places in WebKit instead of invoking -[UIApplication interfaceOrientation]
directly. No change in behavior.

* UIProcess/ios/WKContentView.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView interfaceOrientation]):
* UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm:
(-[WKDataListSuggestionsPicker initWithInformation:inView:]):
* UIProcess/ios/forms/WKFormColorPicker.mm:
(-[WKColorPicker initWithView:]):
* UIProcess/ios/forms/WKFormInputControl.mm:
(-[WKDateTimePicker initWithView:datePickerMode:]):
* UIProcess/ios/forms/WKFormSelectPicker.mm:
(-[WKMultipleSelectPicker initWithView:]):
* UIProcess/ios/forms/WKFormSelectPopover.mm:
(-[WKSelectPopover initWithView:hasGroups:]):

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

3 months agoIndexSet::isEmpty should use BitVector::isEmpty() instead of size()
rmorisset@apple.com [Tue, 14 May 2019 03:38:13 +0000 (03:38 +0000)]
IndexSet::isEmpty should use BitVector::isEmpty() instead of size()
https://bugs.webkit.org/show_bug.cgi?id=197857

Reviewed by Darin Adler.

* wtf/IndexSet.h:
(WTF::IndexSet::isEmpty const):

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