WebKit-https.git
3 days agoWebKit does not generate an ESC key event for CMD+.
commit-queue@webkit.org [Wed, 22 May 2019 20:58:32 +0000 (20:58 +0000)]
WebKit does not generate an ESC key event for CMD+.
https://bugs.webkit.org/show_bug.cgi?id=198137
<rdar://problem/51038641>

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

This patch maps the Command + '.' keystroke to the 'Escape'. This also requires a change to UIKit to properly pass
the key state to WebKit (see <rdar://problem/46431552>).

* platform/ios/WebEvent.mm:
(-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:withInputManagerHint:keyCode:isTabKey:]):

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

3 days agoDon't clear PropertyNameArray in Proxy code
ysuzuki@apple.com [Wed, 22 May 2019 20:34:55 +0000 (20:34 +0000)]
Don't clear PropertyNameArray in Proxy code
https://bugs.webkit.org/show_bug.cgi?id=197691

Reviewed by Saam Barati.

JSTests:

* stress/proxy-get-own-property-names-should-not-clear-previous-results.js: Added.
(shouldBe):
(opt):

Source/JavaScriptCore:

ProxyObject::performGetOwnPropertyNames clears the given PropertyNameArray to filter out non-enumerable keys.
But this does not assume that PropertyNameArray already contains the keys collected in the different objects.
We have an assumption that PropertyNameArray is always increasing, and JSPropertyNameEnumerator relies on this.
Since ProxyObject::performGetOwnPropertyNames clears the passed PropertyNameArray which contained the other
keys collected at some point of prototype hierarchy, this breaks JSPropertyNameEnumerator. Let's see the example.

var object = { __proto__: someProxy, someKey: 42 };
// Here, we first collect "someKey" in object. And using the same PropertyNameArray to add more keys from __proto__.
// But Proxy accidentally clears the passed PropertyNameArray, so "someKey" becomes missing.
for (var key in object);

This patch fixes ProxyObject::performGetOwnPropertyNames. Using separate PropertyNameArray to collect keys, and
filtering and adding them to the passed PropertyNameArray later. We also remove PropertyNameArray::reset method
since this breaks JSPropertyNameEnumerator's assumption.

We also fix the issue by changing seenKeys' HashSet<UniquedStringImpl*> to HashSet<RefPtr<UniquedStringImpl>>.
They can be deallocated if it is not added to trapResult later and it is toString-ed result from 'toPropertyKey()'.

* runtime/PropertyNameArray.h:
(JSC::PropertyNameArray::reset): Deleted.
* runtime/ProxyObject.cpp:
(JSC::ProxyObject::performGetOwnPropertyNames):

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

3 days agoIntersection Observer: bounding client rect is wrong for an inline element
ajuma@chromium.org [Wed, 22 May 2019 20:22:44 +0000 (20:22 +0000)]
Intersection Observer: bounding client rect is wrong for an inline element
https://bugs.webkit.org/show_bug.cgi?id=198009

Reviewed by Simon Fraser.

LayoutTests/imported/w3c:

Import test added upstream in
https://github.com/web-platform-tests/wpt/commit/cf40205c68f739ae23429439de13d125e3df9f7a

* web-platform-tests/intersection-observer/inline-with-block-child-client-rect-expected.txt: Added.
* web-platform-tests/intersection-observer/inline-with-block-child-client-rect.html: Added.

Source/WebCore:

Make target rect computation for inline elements share logic with the computation
of bounding client rects.

Test: imported/w3c/web-platform-tests/intersection-observer/inline-with-block-child-client-rect.html

* dom/Document.cpp:
(WebCore::computeIntersectionState):
* dom/Element.cpp:
(WebCore::Element::boundingAbsoluteRectWithoutLayout):
(WebCore::Element::boundingClientRect):
* dom/Element.h:

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

3 days ago[iOS] Compatibility mouse events aren't prevented by calling preventDefault() on...
graouts@webkit.org [Wed, 22 May 2019 19:58:15 +0000 (19:58 +0000)]
[iOS] Compatibility mouse events aren't prevented by calling preventDefault() on pointerdown
https://bugs.webkit.org/show_bug.cgi?id=198124
<rdar://problem/50410863>

Reviewed by Tim Horton.

LayoutTests/imported/w3c:

We add basic support to run a test that wasn't specifically designed for a touch-based interaction such that the test
at imported/w3c/web-platform-tests/pointerevents/pointerevent_suppress_compat_events_on_click.html may run on iOS. The
trick here is to add a pause after a touch ends to avoid the likelihood or two tap gestures triggering a double tap.

* web-platform-tests/resources/testdriver-vendor.js:

Source/WebCore:

This fix builds atop the one made for wkb.ug/198072 which fixes this bug on macOS alone.

In order to correctly prevent "compatibility" mouse events from being dispatched when the initial "pointerdown" event had preventDefault()
called while handled, we need to pass the PointerID for the touch that triggered a tap gesture in the UI process down in the Web process
and into the resulting PlatformMouseEvent. This will allow upon dispatch of a PlatformMouseEvent to call into PointerCaptureController
to identify if the dispatch of mouse events is allowed for the event's PointerID.

To support this, some refactoring was required. The PointerID header is now under platform/ such that PlatformMouseEvent may safely use it.
Additionally, PointerEvent::defaultMousePointerIdentifier() is now a global mousePointerID defined in PointerID.h.

Finally, PointerCaptureController::touchEndedOrWasCancelledForIdentifier() has been renamed to PointerCaptureController::touchWithIdentifierWasRemoved() and
has WEBCORE_EXPORT such that it may be called from WebKit as the indication that a pointer is no longer active will now be initiated in WebKit
on the UI process side.

Testing is covered by the pre-existing imported/w3c/web-platform-tests/pointerevents/pointerevent_suppress_compat_events_on_click.html
which will now run on iOS through a change to WebKitAdditions.

* Headers.cmake:
* WebCore.xcodeproj/project.pbxproj:
* dom/Element.cpp:
(WebCore::Element::dispatchMouseEvent): When dealing with a mouse event on iOS, check whether the mouse event's PointerID allows for compatibility
mouse events to be dispatched using PointerCaptureController::preventsCompatibilityMouseEventsForIdentifier(). The "click" event is not a compatibility
mouse event.
* dom/PointerEvent.h:
* page/PointerCaptureController.cpp:
(WebCore::PointerCaptureController::PointerCaptureController):
(WebCore::PointerCaptureController::touchWithIdentifierWasRemoved):
(WebCore::PointerCaptureController::touchEndedOrWasCancelledForIdentifier): Deleted.
* page/PointerCaptureController.h:
* platform/PlatformMouseEvent.h:
(WebCore::PlatformMouseEvent::PlatformMouseEvent):
(WebCore::PlatformMouseEvent::pointerId const):
* platform/PointerID.h: Renamed from Source/WebCore/dom/PointerID.h.
(WebCore::mousePointerID):

Source/WebKit:

In order to correctly prevent "compatibility" mouse events from being dispatched when the initial "pointerdown" event had preventDefault()
called while handled, we need to pass the PointerID for the touch that triggered a tap gesture in the UI process down in the Web process
and into the resulting PlatformMouseEvent.

This means we need to identify the touch identifier, which is the same as the PointerID used for Pointer Events, in the single tap gesture
recognizer, an instance of WKSyntheticTapGestureRecognizer. To do this, we subclass the -[UIResponder touchesEnded:withEvent:] method and
track the touch identifier as the lastActiveTouchIdentifier, a new public property of WKSyntheticTapGestureRecognizer. To allow for this,
we need the support of the content view's UIWebTouchEventsGestureRecognizer which is exposed to the WKSyntheticTapGestureRecognizer as its
supportingWebTouchEventsGestureRecognizer property. This lastActiveTouchIdentifier property is cleared as the gesture recognizer is reset.

This allows the content view to pass the PointerID down to the Web process starting from -[WKContentView _singleTapRecognized:], going
through WebPageProxy::commitPotentialTap() and eventually WebPage::completeSyntheticClick().

While we used to tell the PointerCaptureController that a PointerID was no longer active when a given touch ended or was canceled (in
WebKitAdditions code), we can no longer do this as the dispatch of a synthetic tap is performed asynchronously and will happen past the
dispatch of "pointerup" and "pointercancel" Pointer Events. To clear inactive PointerIDs from the PointerCaptureController, we add a new
touchWithIdentifierWasRemoved() method on the WebPage and its proxy. When the WKSyntheticTapGestureRecognizer resets and -[WKContentView _singleTapDidReset:]
is called, we call that method which allows for only active PointerIDs to be tracked by the PointerCaptureController.

* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView cleanupInteraction]):
(-[WKContentView _singleTapDidReset:]):
(-[WKContentView _singleTapRecognized:]):
* UIProcess/ios/WKSyntheticTapGestureRecognizer.h:
* UIProcess/ios/WKSyntheticTapGestureRecognizer.m:
(-[WKSyntheticTapGestureRecognizer reset]):
(-[WKSyntheticTapGestureRecognizer touchesEnded:withEvent:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::touchWithIdentifierWasRemoved):
(WebKit::WebPageProxy::commitPotentialTap):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::dispatchSyntheticMouseMove):
(WebKit::WebPage::handleSyntheticClick):
(WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
(WebKit::WebPage::completeSyntheticClick):
(WebKit::WebPage::commitPotentialTap):
(WebKit::WebPage::touchWithIdentifierWasRemoved):

LayoutTests:

We're adding an iOS-specific expectation since this test prints out the pointer type detected while it runs, which is "touch"
on iOS and "mouse" in the expectation that already exists for macOS.

* platform/ios/imported/w3c/web-platform-tests/pointerevents/pointerevent_suppress_compat_events_on_click-expected.txt: Added.

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

4 days ago[WebAuthN] Support Attestation Conveyance Preference
jiewen_tan@apple.com [Wed, 22 May 2019 19:27:49 +0000 (19:27 +0000)]
[WebAuthN] Support Attestation Conveyance Preference
https://bugs.webkit.org/show_bug.cgi?id=192722
<rdar://problem/49939647>

Reviewed by Brent Fulgham.

Source/WebCore:

This patch implements https://www.w3.org/TR/webauthn/#enumdef-attestationconveyancepreference, together with
Step 20 with regard to AttestationConveyancePreference of https://www.w3.org/TR/webauthn/#createCredential.
Few notes with regard to Step 20: 1) We treat indirect attestation as direct attestation as we don't MITM
the attestation process; 2) We won't distinguish self attestation and return it to keep consistency between
the response and the request. If callers want none attestation, they will very likely ignore fmt and attStmt
of the attestation object, and therefore it is meaningless to return self attestation.

Covered by new tests within existing files.

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Headers.cmake:
* Modules/webauthn/AttestationConveyancePreference.h: Copied from Source/WebCore/Modules/webauthn/WebAuthenticationUtils.h.
* Modules/webauthn/AttestationConveyancePreference.idl: Copied from Source/WebCore/Modules/webauthn/WebAuthenticationUtils.h.
* Modules/webauthn/PublicKeyCredentialCreationOptions.h:
(WebCore::PublicKeyCredentialCreationOptions::encode const):
(WebCore::PublicKeyCredentialCreationOptions::decode):
* Modules/webauthn/PublicKeyCredentialCreationOptions.idl:
* Modules/webauthn/WebAuthenticationConstants.h:
* Modules/webauthn/WebAuthenticationUtils.cpp:
(WebCore::buildAttestationObject):
* Modules/webauthn/WebAuthenticationUtils.h:
* Modules/webauthn/fido/DeviceResponseConverter.cpp:
(fido::readCTAPMakeCredentialResponse):
* Modules/webauthn/fido/DeviceResponseConverter.h:
* Modules/webauthn/fido/FidoConstants.h:
noneAttestationValue is moved to WebAuthenticationConstants.h.
* Modules/webauthn/fido/U2fResponseConverter.cpp:
(fido::readU2fRegisterResponse):
* Modules/webauthn/fido/U2fResponseConverter.h:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

Source/WebKit:

* UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
(WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested):
* UIProcess/WebAuthentication/fido/CtapHidAuthenticator.cpp:
(WebKit::CtapHidAuthenticator::continueMakeCredentialAfterResponseReceived const):
* UIProcess/WebAuthentication/fido/U2fHidAuthenticator.cpp:
(WebKit::U2fHidAuthenticator::continueRegisterCommandAfterResponseReceived):

Tools:

* TestWebKitAPI/Tests/WebCore/CtapRequestTest.cpp:
(TestWebKitAPI::TEST):
Updates the test with AttestationConveyancePreference.

LayoutTests:

* http/wpt/webauthn/public-key-credential-create-success-hid.https-expected.txt:
* http/wpt/webauthn/public-key-credential-create-success-hid.https.html:
* http/wpt/webauthn/public-key-credential-create-success-local.https-expected.txt:
* http/wpt/webauthn/public-key-credential-create-success-local.https.html:
* http/wpt/webauthn/public-key-credential-create-success-u2f.https-expected.txt:
* http/wpt/webauthn/public-key-credential-create-success-u2f.https.html:

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

4 days ago[Paste] Add support for preferred presentation size when pasting an image
zalan@apple.com [Wed, 22 May 2019 19:13:34 +0000 (19:13 +0000)]
[Paste] Add support for preferred presentation size when pasting an image
https://bugs.webkit.org/show_bug.cgi?id=198132
<rdar://problem/50886917>

Reviewed by Wenson Hsieh.

Source/WebCore:

Set the pasted <img> width/height attributes when the preferred presentation size is available.

* editing/WebContentReader.h:
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::createFragmentForImageAttachment):
(WebCore::WebContentReader::readImage):
* editing/markup.cpp:
(WebCore::createFragmentForImageAndURL):
* editing/markup.h:
* platform/Pasteboard.h:
(WebCore::PasteboardWebContentReader::readImage):
* platform/PasteboardItemInfo.h:
(WebCore::PasteboardItemInfo::encode const):
(WebCore::PasteboardItemInfo::decode):
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::readPasteboardWebContentDataForType):
(WebCore::Pasteboard::read):
(WebCore::Pasteboard::readRespectingUTIFidelities):
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::informationForItemAtIndex):

Source/WebKit:

* UIProcess/API/Cocoa/_WKElementAction.mm:
(addToReadingList):
* UIProcess/ios/WKActionSheetAssistant.mm:
(-[WKActionSheetAssistant defaultActionsForLinkSheet:]):
(-[WKActionSheetAssistant defaultActionsForImageSheet:]):

Tools:

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

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

4 days agoHide MediaCapabilities.encodingInfo() when the platform does not support it.
jer.noble@apple.com [Wed, 22 May 2019 19:10:05 +0000 (19:10 +0000)]
Hide MediaCapabilities.encodingInfo() when the platform does not support it.
https://bugs.webkit.org/show_bug.cgi?id=197476

Reviewed by Eric Carlson.

Source/WebCore:

Test: platform/mac/media/mediacapabilities/mediacapabilities-encodingInfo-undefined.html

Add a new IDL attribute, CustomEnabled, which allows non Settings-based enabling of attributes and objects.

* Modules/mediacapabilities/MediaCapabilities.idl:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSMediaCapabilitiesCustom.h: Copied from Source/WebCore/Modules/mediacapabilities/MediaCapabilities.idl.
(WebCore::JSMediaCapabilitiesEncodingInfoIsEnabled):
* bindings/scripts/CodeGeneratorJS.pm:
(NeedsRuntimeCheck):
(GenerateRuntimeEnableConditionalString):
* bindings/scripts/IDLAttributes.json:
* bindings/scripts/preprocess-idls.pl:
(GenerateConstructorAttributes):
* platform/mediacapabilities/MediaEngineConfigurationFactory.cpp:
(WebCore::MediaEngineConfigurationFactory::hasDecodingConfigurationFactory):
(WebCore::MediaEngineConfigurationFactory::hasEncodingConfigurationFactory):
* platform/mediacapabilities/MediaEngineConfigurationFactory.h:

LayoutTests:

* platform/ios/media/mediacapabilities/mediacapabilities-encodingInfo-undefined-expected.txt: Added.
* platform/ios/media/mediacapabilities/mediacapabilities-encodingInfo-undefined.html: Added.
* platform/ios/media/mediacapabilities/mediacapabilities-types-expected.txt: Added.
* platform/mac/media/mediacapabilities/mediacapabilities-encodingInfo-undefined-expected.txt: Added.
* platform/mac/media/mediacapabilities/mediacapabilities-encodingInfo-undefined.html: Added.
* platform/mac/media/mediacapabilities/mediacapabilities-types-expected.txt: Added.

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

4 days agoUse a different variable when testing for Xcode context in generate-xcfilelists
krollin@apple.com [Wed, 22 May 2019 19:09:30 +0000 (19:09 +0000)]
Use a different variable when testing for Xcode context in generate-xcfilelists
https://bugs.webkit.org/show_bug.cgi?id=198130
<rdar://problem/51032752>

Reviewed by Jonathan Bedard.

The generate-xcfilelists script can run stand-alone or in the context
of Xcode. There are a couple of places where it helps to know which
context is current. To determine the context, genreate-xfilelists
checks an environment variable that should be defined only when Xcode
is running. The variable chosen was XCODE_INSTALL_PATH. It turns out
that this variable is not always defined. Therefore, switch to
checking XCODE_PRODUCT_BUILD_VERSION.

* Scripts/webkitpy/generate_xcfilelists_lib/util.py:
(subprocess_run):
(is_running_under_xcode):

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

4 days ago[ESNext] Implement support for Numeric Separators
ross.kirsling@sony.com [Wed, 22 May 2019 19:06:03 +0000 (19:06 +0000)]
[ESNext] Implement support for Numeric Separators
https://bugs.webkit.org/show_bug.cgi?id=196351

Reviewed by Keith Miller.

JSTests:

* stress/numeric-literal-separators.js: Added.
Add tests for feature.

* test262/expectations.yaml:
Mark 60 test cases as passing.

Source/JavaScriptCore:

Implement the following proposal, which is now Stage 3:
  https://github.com/tc39/proposal-numeric-separator

Specifically, this allows `_` to be used as a separator in numeric literals.
It may be inserted arbitrarily without semantic effect, but it may not occur:
  - multiple times in a row
  - at the beginning or end of the literal
  - adjacent to `0x`, `0b`, `0o`, `.`, `e`, or `n`
  - after a leading zero (e.g. `0_123`), even in sloppy mode

* parser/Lexer.cpp:
(JSC::isASCIIDigitOrSeparator): Added.
(JSC::isASCIIHexDigitOrSeparator): Added.
(JSC::isASCIIBinaryDigitOrSeparator): Added.
(JSC::isASCIIOctalDigitOrSeparator): Added.
(JSC::Lexer<T>::parseHex):
(JSC::Lexer<T>::parseBinary):
(JSC::Lexer<T>::parseOctal):
(JSC::Lexer<T>::parseDecimal):
(JSC::Lexer<T>::parseNumberAfterDecimalPoint):
(JSC::Lexer<T>::parseNumberAfterExponentIndicator):
(JSC::Lexer<T>::lexWithoutClearingLineTerminator):
* parser/Lexer.h:

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

4 days agoImplement Feature policy self/none/* parsing
youenn@apple.com [Wed, 22 May 2019 17:38:42 +0000 (17:38 +0000)]
Implement Feature policy self/none/* parsing
https://bugs.webkit.org/show_bug.cgi?id=198078

Reviewed by Eric Carlson.

LayoutTests/imported/w3c:

* web-platform-tests/mediacapture-streams/MediaStream-feature-policy-none.https-expected.txt: Added.
* web-platform-tests/mediacapture-streams/MediaStream-feature-policy-none.https.html: Added.

Source/WebCore:

Start to implement https://w3c.github.io/webappsec-feature-policy/#algo-parse-policy-directive
'src' is not supported yet.
Apply the rules to getUserMedia.
Update getDisplayMedia keyword from 'display' to 'display-capture' as per spec.

Test: imported/w3c/web-platform-tests/mediacapture-streams/MediaStream-feature-policy-none.https.html

* Headers.cmake:
* Modules/mediastream/UserMediaController.cpp:
(WebCore::isSecure):
(WebCore::isAllowedByFeaturePolicy):
(WebCore::isAllowedToUse):
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* html/FeaturePolicy.cpp: Added.
(WebCore::isAllowedByFeaturePolicy):
(WebCore::processOriginItem):
(WebCore::updateList):
(WebCore::FeaturePolicy::parse):
(WebCore::FeaturePolicy::allows const):
* html/FeaturePolicy.h: Added.
* html/HTMLIFrameElement.cpp:
(WebCore::HTMLIFrameElement::featurePolicy const):
* html/HTMLIFrameElement.h:

Source/WebKit:

Fix a case where completion handler might not always be called.

* WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
(WebKit::UserMediaPermissionRequestManager::userMediaAccessWasGranted):

LayoutTests:

* http/tests/media/media-stream/get-display-media-iframe-allow-attribute-expected.txt:
* http/tests/media/media-stream/get-display-media-iframe-allow-attribute.html:

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

4 days ago[GTK] Unreviewed test gardening
aboya@igalia.com [Wed, 22 May 2019 17:25:25 +0000 (17:25 +0000)]
[GTK] Unreviewed test gardening
https://bugs.webkit.org/show_bug.cgi?id=198128

* TestExpectations:
* platform/gtk/TestExpectations:
* platform/gtk/fast/forms/input-align-expected.png:
* platform/gtk/fast/forms/input-align-expected.txt:
* platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt:
* platform/gtk/js/dom/dom-static-property-for-in-iteration-expected.txt:
* platform/gtk/media/controls-after-reload-expected.txt:
* platform/gtk/printing/page-with-10mm-left-margin-expected.txt:
* platform/gtk/printing/page-with-zero-margin-expected.txt:
* platform/wpe/js/dom/dom-static-property-for-in-iteration-expected.txt:

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

4 days ago[JSC] ArrayBufferContents::tryAllocate signs the pointer with allocation size and...
ysuzuki@apple.com [Wed, 22 May 2019 17:21:19 +0000 (17:21 +0000)]
[JSC] ArrayBufferContents::tryAllocate signs the pointer with allocation size and authenticates it with sizeInBytes
https://bugs.webkit.org/show_bug.cgi?id=198101

Reviewed by Michael Saboff.

JSTests:

* stress/zero-sized-array-buffer-pointer-should-be-signed-with-zero.js: Added.
(shouldBe):

Source/JavaScriptCore:

When we allocate 0-length ArrayBuffer, we allocate 1 byte storage instead because we would like to ensure that
non-neutered ArrayBuffer always have non nullptr. While we allocate a 1 byte storage, this ArrayBuffer says
sizeInBytes = 0. However, we accidentally configure the vector pointer with this 1 byte size in the constructor.
In ARM64E device, we sign the vector pointer with modifier = 1 (1 byte size), and later we authenticate this
pointer with modifier = 0 (sizeInBytes), and fail to authenticate the pointer.

In this patch, we sign the pointer with sizeInBytes so that we correctly authenticate the 0 bytes vector pointer.

* runtime/ArrayBuffer.cpp:
(JSC::ArrayBufferContents::tryAllocate):

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

4 days agoLayout Test http/wpt/cache-storage/cache-put-stream.https.any.html is a flaky failure
youenn@apple.com [Wed, 22 May 2019 17:18:21 +0000 (17:18 +0000)]
Layout Test http/wpt/cache-storage/cache-put-stream.https.any.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=181107
<rdar://problem/36188028>

Unreviewed.

* platform/mac-wk2/TestExpectations:
Marking more tests as slow.

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

4 days agoUnreviewed fix for non-unified build after r245320.
ross.kirsling@sony.com [Wed, 22 May 2019 16:55:50 +0000 (16:55 +0000)]
Unreviewed fix for non-unified build after r245320.

* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::convertRectFromFrameClientToRootView):
(WebKit::convertPointFromFrameClientToRootView):
(WebKit::WebAutomationSessionProxy::computeElementLayout):

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

4 days agoLayout Test http/tests/security/showModalDialog-sync-cross-origin-page-load2.html...
pvollan@apple.com [Wed, 22 May 2019 14:23:31 +0000 (14:23 +0000)]
Layout Test http/tests/security/showModalDialog-sync-cross-origin-page-load2.html is failing
https://bugs.webkit.org/show_bug.cgi?id=198112

Unreviewed test gardening.

* platform/win/TestExpectations:

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

4 days agoUnreviewed. Fix WPE unit tests after r245565
carlosgc@webkit.org [Wed, 22 May 2019 10:41:11 +0000 (10:41 +0000)]
Unreviewed. Fix WPE unit tests after r245565

Backend creation is failing when the a11y bus is not running because atk produces warning messages. We should
not make warnings fatal during backend creation.

* TestWebKitAPI/Tests/WebKitGLib/TestAutomationSession.cpp:
(testAutomationSessionRequestSession):
* TestWebKitAPI/Tests/WebKitGLib/TestUIClient.cpp:
(testWebViewGeolocationPermissionRequests):
* TestWebKitAPI/glib/WebKitGLib/TestMain.h:
(Test::createWebViewBackend):
(Test::addLogFatalFlag):
(Test::removeLogFatalFlag):

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

4 days agoUnreviewed. Fix GTK unit tests after r245565
carlosgc@webkit.org [Wed, 22 May 2019 08:37:30 +0000 (08:37 +0000)]
Unreviewed. Fix GTK unit tests after r245565

* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseDispose): Null check accessible before calling webkitWebViewAccessibleSetWebView().

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

4 days agoPerf dashboard erroneously rejects a build request to build owned components when...
dewei_zhu@apple.com [Wed, 22 May 2019 06:15:58 +0000 (06:15 +0000)]
Perf dashboard erroneously rejects a build request to build owned components when there are no patches.
https://bugs.webkit.org/show_bug.cgi?id=197928

Reviewed by Ryosuke Niwa.

Fix a bug that build type build request that only builds owned components failed to pass sanity check when there
is no repository accepts patch in triggerable repository group.
Add a sanity check to throw an error when build request type is build but there is no repository group template.

* tools/js/buildbot-syncer.js:
(BuildbotSyncer.prototype._propertiesForBuildRequest): Changed sanity check the always requires repository accepts patch when there is a build to make it also works for build request only builds owned components.
(BuildbotSyncer._parseRepositoryGroup): Added check for repository group templates not null  when build requiest type is build.
* unit-tests/buildbot-syncer-tests.js: Added unit tests for this change.
* unit-tests/resources/mock-v3-models.js: Added mock date for unit tests.

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

4 days agoMedia controls don't show in WK2 video fullscreen sometimes
jer.noble@apple.com [Wed, 22 May 2019 05:37:17 +0000 (05:37 +0000)]
Media controls don't show in WK2 video fullscreen sometimes
https://bugs.webkit.org/show_bug.cgi?id=198094
<rdar://problem/50970661>

Reviewed by Tim Horton.

Ensure that the WebAVPlayerLayer never allows hit testing, as this keeps touches from reaching
AVKit's controls.

* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerLayer init]):

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

4 days agoWHLSL: Add an AST dumper
sbarati@apple.com [Wed, 22 May 2019 03:18:03 +0000 (03:18 +0000)]
WHLSL: Add an AST dumper
https://bugs.webkit.org/show_bug.cgi?id=198059

Reviewed by Myles Maxfield.

This patch makes it so we can dump the WHLSL program's AST.
This will become useful when we're debugging passes that
transform the AST.

The dumper mostly prints in a style where the dump is almost
valid WHLSL code. E.g, this WHLSL program:
```
int foo(int arg) {
    return arg + 1;
}
```

gets dumped as:
```
int foo(int arg) {
   return operator+(arg, 1);
}
```

This patch also adds a way to dump between each pass, after
parsing, or at the end of all passes. Currently, this is controlled
by a static variable. I'll make these runtime configurable in a follow
up: https://bugs.webkit.org/show_bug.cgi?id=198097

No new tests because this is used for logging.

* Modules/webgpu/WHLSL/AST/WHLSLAST.h: Added.
* Modules/webgpu/WHLSL/AST/WHLSLAddressSpace.h:
(WebCore::WHLSL::AST::toString):
* Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h:
(WebCore::WHLSL::AST::BuiltInSemantic::toString const):
* Modules/webgpu/WHLSL/AST/WHLSLEntryPointType.h:
(WebCore::WHLSL::AST::toString):
* Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.h:
(WebCore::WHLSL::AST::ResourceSemantic::toString):
* Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
(WebCore::WHLSL::Metal::toString): Deleted.
* Modules/webgpu/WHLSL/WHLSLASTDumper.cpp: Added.
(WebCore::WHLSL::ASTDumper::visit):
* Modules/webgpu/WHLSL/WHLSLASTDumper.h: Added.
(WebCore::WHLSL::ASTDumper::toString):
(WebCore::WHLSL::ASTDumper::Indent::Indent):
(WebCore::WHLSL::ASTDumper::bumpIndent):
(WebCore::WHLSL::toString):
(WebCore::WHLSL::dumpAST):
* Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
(WebCore::WHLSL::dumpASTIfNeeded):
(WebCore::WHLSL::dumpASTAfterParsingIfNeeded):
(WebCore::WHLSL::dumpASTBetweenEachPassIfNeeded):
(WebCore::WHLSL::dumpASTAtEndIfNeeded):
(WebCore::WHLSL::prepareShared):
* Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

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

4 days agoWHLSL: Parsing negative int literals parses the positive value instead
sbarati@apple.com [Wed, 22 May 2019 03:05:35 +0000 (03:05 +0000)]
WHLSL: Parsing negative int literals parses the positive value instead
https://bugs.webkit.org/show_bug.cgi?id=198096

Reviewed by Dean Jackson.

I also made the code around < INT_MIN a bit easier to follow along with.

No new tests because we haven't imported WHLSL test suite yet.
Verified this works using the AST dumper.

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

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

4 days ago[PlayStation] Don't call fcntl.
ross.kirsling@sony.com [Wed, 22 May 2019 00:54:40 +0000 (00:54 +0000)]
[PlayStation] Don't call fcntl.
https://bugs.webkit.org/show_bug.cgi?id=197961

Reviewed by Fujii Hironori.

Source/JavaScriptCore:

* inspector/remote/socket/posix/RemoteInspectorSocketPOSIX.cpp:
(Inspector::Socket::setup):
Use WTF::setCloseOnExec and WTF::setNonBlock.

Source/WebKit:

* Platform/IPC/unix/ConnectionUnix.cpp:
(IPC::Connection::open):
Use WTF::setNonBlock.

Source/WTF:

* wtf/PlatformGTK.cmake:
* wtf/PlatformJSCOnly.cmake:
* wtf/PlatformPlayStation.cmake:
* wtf/PlatformWPE.cmake:
* wtf/UniStdExtras.h:
* wtf/playstation/UniStdExtrasPlayStation.cpp: Added.
(WTF::setCloseOnExec):
(WTF::dupCloseOnExec):
(WTF::setNonBlock):
* wtf/unix/UniStdExtrasUnix.cpp: Renamed from Source/WTF/wtf/UniStdExtras.cpp.
(WTF::setNonBlock):
Move UniStdExtras to unix/, add a PlayStation version that doesn't use fcntl, add an abstraction for O_NONBLOCK.

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

4 days ago[ews-build] Use custom templates for Buildbot (follow-up fix)
aakash_jain@apple.com [Wed, 22 May 2019 00:43:37 +0000 (00:43 +0000)]
[ews-build] Use custom templates for Buildbot (follow-up fix)
https://bugs.webkit.org/show_bug.cgi?id=198076

Unreviewed minor follow-up fix.

* BuildSlaveSupport/ews-build/templates/build.jade:

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

4 days agoFix branch build.
achristensen@apple.com [Wed, 22 May 2019 00:38:26 +0000 (00:38 +0000)]
Fix branch build.
<rdar://problem/50625279>

* TestWebKitAPI/Tests/WebKitCocoa/Challenge.mm:
We need to explicitly include WebKit.h on the branch.

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

4 days ago[ews-build] Use custom templates for Buildbot
aakash_jain@apple.com [Wed, 22 May 2019 00:34:15 +0000 (00:34 +0000)]
[ews-build] Use custom templates for Buildbot
https://bugs.webkit.org/show_bug.cgi?id=198076

Rubber-stamped by Jonathan Bedard.

* BuildSlaveSupport/ews-build/master.cfg:
* BuildSlaveSupport/ews-build/templates: Added.
* BuildSlaveSupport/ews-build/templates/build.jade: Copied from https://github.com/buildbot/buildbot/blob/v1.7.0/www/base/src/app/builders/builds/build.tpl.jade

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

4 days agoLayer flashing and poor perf during scrolling of message list on gmail.com and hotmai...
simon.fraser@apple.com [Wed, 22 May 2019 00:12:49 +0000 (00:12 +0000)]
Layer flashing and poor perf during scrolling of message list on gmail.com and hotmail.com - overlap testing needs to constrained to clipping scopes
https://bugs.webkit.org/show_bug.cgi?id=198091
<rdar://problem/49403082>

Reviewed by Antti Koivisto.
Source/WebCore:

When overflow:scroll is scrolled asynchronously, we need to have already created compositing layers where necessary
for clipped-out layers in the scrolled content so that we have something to reveal. We also have ensure
that layers inside the scroller (but scrolled out of view) don't trigger overlap with layers outside the scroller.
All this has to work when the containing block hierarchy (clipping/scrolling) doesn't match the paint order hierarchy (structure
of the z-order and compositing trees).

Overlap testing previously simply used a list of rectangles per compositing container (OverlapMapContainer). This is
a series of layer bounds, built up as we traver the layer tree in z-order. Layers contribute to container N-2, and test
against container N-1.

To handle overlap with non-stacking-context scrollers, introduce the concept of a ClippingScope, which encompasses
a set of layers sharing the same composited-scrolling containing-block ancestor. Within a ClippingScope, layer bounds
are computed unclipped. Between them, bounds are tested clipped.

Conceptually, each OverlapMapContainer has a tree of ClippingScopes (reflecting the containing-block order tree of
composited overflow scroll), and rects are added to the appropriate ClippingScope. This tree is currently always
root-relative; the root node is the RenderView's RenderLayer, and will accumulate the bounds of layers not inside
composited overflow scroll (just like the old code).

When a OverlapMapContainer is popped, the list of rectangles in its ClippingScope tree is merged with that of the previous
container.

Tests: compositing/layer-creation/clipping-scope/nested-scroller-overlap.html
       compositing/layer-creation/clipping-scope/overlap-constrained-inside-scroller.html
       compositing/layer-creation/clipping-scope/overlap-constrained-inside-stacking-context-scroller.html
       compositing/layer-creation/clipping-scope/scroller-with-negative-z-children.html
       compositing/layer-creation/clipping-scope/shared-layers-in-scroller.html

* rendering/LayerOverlapMap.cpp:
(WebCore::operator<<):
(WebCore::OverlapMapContainer::OverlapMapContainer):
(WebCore::OverlapMapContainer::ClippingScope::ClippingScope):
(WebCore::OverlapMapContainer::ClippingScope::childWithLayer const):
(WebCore::OverlapMapContainer::ClippingScope::addChildWithLayerAndBounds):
(WebCore::OverlapMapContainer::ClippingScope::addChild):
(WebCore::OverlapMapContainer::ClippingScope::appendRect):
(WebCore::OverlapMapContainer::clippingScopeContainingLayerChildRecursive):
(WebCore::OverlapMapContainer::scopeContainingLayer const):
(WebCore::OverlapMapContainer::rootScope const):
(WebCore::OverlapMapContainer::rootScope):
(WebCore::OverlapMapContainer::add):
(WebCore::OverlapMapContainer::overlapsLayers const):
(WebCore::OverlapMapContainer::mergeClippingScopesRecursive):
(WebCore::OverlapMapContainer::append):
(WebCore::OverlapMapContainer::ensureClippingScopeForLayers):
(WebCore::OverlapMapContainer::findClippingScopeForLayers const):
(WebCore::OverlapMapContainer::recursiveOutputToStream const):
(WebCore::OverlapMapContainer::dump const):
(WebCore::LayerOverlapMap::LayerOverlapMap):
(WebCore::LayerOverlapMap::add):
(WebCore::LayerOverlapMap::overlapsLayers const):
(WebCore::LayerOverlapMap::pushCompositingContainer):
(WebCore::LayerOverlapMap::popCompositingContainer):
(WebCore::OverlapMapContainer::unite): Deleted.
(WebCore::OverlapMapContainer::rectList const): Deleted.
* rendering/LayerOverlapMap.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::BackingSharingState::appendSharingLayer):
(WebCore::RenderLayerCompositor::BackingSharingState::updateBeforeDescendantTraversal):
(WebCore::RenderLayerCompositor::updateCompositingLayers):
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
(WebCore::RenderLayerCompositor::computeExtent const):
(WebCore::createsClippingScope):
(WebCore::enclosingClippingScopes):
(WebCore::RenderLayerCompositor::addToOverlapMap const):
(WebCore::RenderLayerCompositor::updateOverlapMap const):
(WebCore::RenderLayerCompositor::layerOverlaps const):
* rendering/RenderLayerCompositor.h:

Source/WebCore/../../LayoutTests:

* TestExpectations:
* compositing/layer-creation/clipping-scope/nested-scroller-overlap-expected.txt: Added.
* compositing/layer-creation/clipping-scope/nested-scroller-overlap.html: Added.
* compositing/layer-creation/clipping-scope/overlap-constrained-inside-scroller-expected.txt: Added.
* compositing/layer-creation/clipping-scope/overlap-constrained-inside-scroller.html: Added.
* compositing/layer-creation/clipping-scope/overlap-constrained-inside-stacking-context-scroller-expected.txt: Added.
* compositing/layer-creation/clipping-scope/overlap-constrained-inside-stacking-context-scroller.html: Added.
* compositing/layer-creation/clipping-scope/scroller-with-negative-z-children-expected.txt: Added.
* compositing/layer-creation/clipping-scope/scroller-with-negative-z-children.html: Added.
* compositing/layer-creation/clipping-scope/shared-layers-in-scroller-expected.txt: Added.
* compositing/layer-creation/clipping-scope/shared-layers-in-scroller.html: Added.
* platform/ios-wk2/TestExpectations:
* platform/ios-wk2/compositing/layer-creation/clipping-scope/nested-scroller-overlap-expected.txt: Added.
* platform/ios-wk2/compositing/layer-creation/clipping-scope/overlap-constrained-inside-scroller-expected.txt: Added.
* platform/ios-wk2/compositing/layer-creation/clipping-scope/overlap-constrained-inside-stacking-context-scroller-expected.txt: Added.
* platform/ios-wk2/compositing/layer-creation/clipping-scope/scroller-with-negative-z-children-expected.txt: Added.
* platform/ios-wk2/compositing/layer-creation/clipping-scope/shared-layers-in-scroller-expected.txt: Added.
* platform/mac-wk2/TestExpectations:

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

4 days ago[PSON] Assertion hit when navigating back after a process swap forced by the client
cdumez@apple.com [Tue, 21 May 2019 23:44:16 +0000 (23:44 +0000)]
[PSON] Assertion hit when navigating back after a process swap forced by the client
https://bugs.webkit.org/show_bug.cgi?id=198006

Reviewed by Alex Christensen.

Source/WebKit:

After r245198, we construct a SuspendedPageProxy when a process-swap is forced by the client
and we delay to closing of the WebPage in the old WebProcess until it is safe to do so without
flashing (by calling SuspendedPageProxy::closeWithoutFlashing()). The issue is that our logic
deciding if we should reuse a SuspendedPageProxy's WebPage relied on the SuspendedPageProxy's
m_suspensionState not being set to FailedToSuspend. In the case of a process-swap forced by the
client with delayed page closing, the suspended state may be suspended but is still not usable
because it is about to get closed. We would wrongly believe there is a WebPage to be reused so
the ProvisionalPageProxy would construct a proxy for the main frame in its constructor, we would
then hit the ASSERT(!m_mainFrame) assertion in ProvisionalPageProxy::didCreateMainFrame() when
the WebContent process would unexpectedly create a main frame.

To address the issue, stop relying on the suspended state to determine if we can reuse a WebPage
or not and introduce a new pageIsClosedOrClosing() getter on the SuspendedPageProxy instead
which indicates if the WebPage in the WebContent process has been closed or is about to be.

* UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::pageEnteredAcceleratedCompositingMode):
(WebKit::SuspendedPageProxy::pageIsClosedOrClosing const):
(WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
* UIProcess/SuspendedPageProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

4 days ago[PlayStation] Update initializer for changed port options
stephan.szabo@sony.com [Tue, 21 May 2019 23:42:42 +0000 (23:42 +0000)]
[PlayStation] Update initializer for changed port options
https://bugs.webkit.org/show_bug.cgi?id=198057

Reviewed by Ross Kirsling.

* shell/playstation/Initializer.cpp:
(initializer): Remove loading of shared JavaScriptCore
library.

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

4 days agoSandbox violation is making the WebContent process crash
pvollan@apple.com [Tue, 21 May 2019 23:30:48 +0000 (23:30 +0000)]
Sandbox violation is making the WebContent process crash
https://bugs.webkit.org/show_bug.cgi?id=198089
<rdar://problem/50999499>

Reviewed by Brent Fulgham.

A new syscall rule needs to be added to the sandbox on iOS and macOS.

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

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

4 days agofont-optical-sizing applies the wrong variation value
mmaxfield@apple.com [Tue, 21 May 2019 23:20:49 +0000 (23:20 +0000)]
font-optical-sizing applies the wrong variation value
https://bugs.webkit.org/show_bug.cgi?id=197528
<rdar://problem/50152854>

Reviewed by Antti Koivisto.

Source/WebCore:

The OpenType spec says in
https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxistag_opsz

"Scale interpretation: Values can be interpreted as text size, in points."

It turns out that it means "typographic point size" which is equal to CSS pixels, not
CSS points.

There are two parts of the font that are sensitive to optical sizing: variation values and
the trak table. We don't want to set the variation value directly because then the trak table
won't be affected. Instead, we can use kCTFontOpticalSizeAttribute to set both of them together.
We will only do this when the CSS says text-rendering:optimizeLegibility or when the font has
an opsz axis but no STAT table. Otherwise, we won't do anything special, which lets CoreText
handle the default behavior for us. This gives us the same default behavior as the rest of the
system.

Tests: fast/text/variations/optical-sizing-trak-2.html
       fast/text/variations/optical-sizing-trak.html
       fast/text/variations/optical-sizing-units.html
       fast/text/variations/optical-sizing-units-2.html

* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontType::FontType):
(WebCore::preparePlatformFont):
(WebCore::fontWithFamily):
(WebCore::FontCache::systemFallbackForCharacters):
* platform/graphics/cocoa/FontCacheCoreText.h:
* platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
(WebCore::FontFamilySpecificationCoreText::fontRanges const):
* platform/graphics/mac/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::fontPlatformData):

LayoutTests:

* fast/text/variations/optical-sizing-trak-2-expected-mismatch.html: Added.
* fast/text/variations/optical-sizing-trak-2.html: Added.
* fast/text/variations/optical-sizing-trak-expected.html: Added.
* fast/text/variations/optical-sizing-trak.html: Added.
* fast/text/variations/optical-sizing-units-2-expected-mismatch.html: Added.
* fast/text/variations/optical-sizing-units-2.html: Added.
* fast/text/variations/optical-sizing-units-expected.html: Added.
* fast/text/variations/optical-sizing-units.html: Added.
* fast/text/variations/resources/Amstelvar/Amstelvar-Roman-VF104.ttf: Added.
This font havariations/s been approved by the lawyers to add for layout tests.
* fast/text/variations/resources/Amstelvar/COPYRIGHT.md: Added.
* fast/text/variations/resources/Amstelvar/OFL.txt: Added.

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

4 days agoMark WKUIDelegate webView:shouldPreviewElement: and webView:previewingViewControllerF...
commit-queue@webkit.org [Tue, 21 May 2019 22:02:53 +0000 (22:02 +0000)]
Mark WKUIDelegate webView:shouldPreviewElement: and webView:previewingViewControllerForElement:defaultActions: as deprecated
https://bugs.webkit.org/show_bug.cgi?id=198083
<rdar://problem/50735687>

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

* UIProcess/API/Cocoa/WKUIDelegate.h:

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

4 days agoFix IOSMAC build
commit-queue@webkit.org [Tue, 21 May 2019 22:01:16 +0000 (22:01 +0000)]
Fix IOSMAC build
https://bugs.webkit.org/show_bug.cgi?id=198082
<rdar://problem/50939725>

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

* Misc/WebDownload.h:

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

4 days agoThe cost of WebViewImpl::hasMarkedTextWithCompletionHandler should not increase with...
wenson_hsieh@apple.com [Tue, 21 May 2019 21:54:05 +0000 (21:54 +0000)]
The cost of WebViewImpl::hasMarkedTextWithCompletionHandler should not increase with document size
https://bugs.webkit.org/show_bug.cgi?id=198075
<rdar://problem/37560103>

Reviewed by Tim Horton.

* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::hasMarkedTextWithCompletionHandler):

Refactor hasMarkedTextWithCompletionHandler to use Editor::hasComposition, instead of computing the actual
marked text range. The latter is more expensive and unnecessary, since it uses TextIterator from the document
root to find editing offsets. This makes the cost of determining whether there is marked text proportional to
the document size.

This matches behavior in legacy WebKit, as well as iOS.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::hasMarkedText):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::hasMarkedText):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

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

4 days agoFix production build after r245564
tzagallo@apple.com [Tue, 21 May 2019 20:30:14 +0000 (20:30 +0000)]
Fix production build after r245564
https://bugs.webkit.org/show_bug.cgi?id=197898

Reviewed by Keith Miller.

The production configuration should not set CODE_SIGN_IDENTITY.

* Configurations/ToolExecutable.xcconfig:

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

4 days agoUnreviewed, add mistakenly ommited initializer.
keith_miller@apple.com [Tue, 21 May 2019 20:01:35 +0000 (20:01 +0000)]
Unreviewed, add mistakenly ommited initializer.

* runtime/RegExpInlines.h:

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

5 days ago[WebAuthN] Make WebAuthN default on only on macOS
jiewen_tan@apple.com [Tue, 21 May 2019 19:03:57 +0000 (19:03 +0000)]
[WebAuthN] Make WebAuthN default on only on macOS
https://bugs.webkit.org/show_bug.cgi?id=198068
<rdar://problem/50971874>

Reviewed by Brent Fulgham.

* Shared/WebPreferences.yaml:
* Shared/WebPreferencesDefaultValues.h:

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

5 days agoUnreviewed build fix add UNUSED_PARAM.
keith_miller@apple.com [Tue, 21 May 2019 18:27:04 +0000 (18:27 +0000)]
Unreviewed build fix add UNUSED_PARAM.

* runtime/RegExpInlines.h:
(JSC::PatternContextBufferHolder::PatternContextBufferHolder):

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

5 days agoUndefined reference platformCloseFrontendPageAndWindow() linking against libWPEWebKit...
psaavedra@igalia.com [Tue, 21 May 2019 17:57:44 +0000 (17:57 +0000)]
Undefined reference platformCloseFrontendPageAndWindow() linking against libWPEWebKit-1.0.so after r245536
https://bugs.webkit.org/show_bug.cgi?id=198069

Reviewed by Ross Kirsling.

* UIProcess/RemoteWebInspectorProxy.cpp:

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

5 days agoCleanup Yarr regexp code around paren contexts.
keith_miller@apple.com [Tue, 21 May 2019 17:57:11 +0000 (17:57 +0000)]
Cleanup Yarr regexp code around paren contexts.
https://bugs.webkit.org/show_bug.cgi?id=198063

Reviewed by Yusuke Suzuki.

JSTests:

* stress/regexp-many-named-sequential-capture-groups.js: Added.
(i.s):
* stress/regexp-many-unnamed-sequential-capture-groups.js: Added.

Source/JavaScriptCore:

There are three refactoring changes around paren contexts:
1. Make EncodedMatchResult the same type as MatchResult on X86_64 and arm64 and uint64_t elsewhere.
2. All function pointer types for Yarr JIT generated code reserve space for paren contexts.
3. initParenContextFreeList should bail based on VM::patternContextBufferSize as that's the buffer size anyway.

* runtime/MatchResult.h:
(JSC::MatchResult::MatchResult):
* runtime/RegExpInlines.h:
(JSC::PatternContextBufferHolder::PatternContextBufferHolder):
(JSC::PatternContextBufferHolder::~PatternContextBufferHolder):
(JSC::PatternContextBufferHolder::size):
(JSC::RegExp::matchInline):
* runtime/VM.h:
* yarr/YarrJIT.cpp:
(JSC::Yarr::YarrGenerator::initParenContextFreeList):
* yarr/YarrJIT.h:
(JSC::Yarr::YarrCodeBlock::execute):

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

5 days ago[macOS] Compatibility mouse events aren't prevented by calling preventDefault() on...
graouts@webkit.org [Tue, 21 May 2019 17:50:37 +0000 (17:50 +0000)]
[macOS] Compatibility mouse events aren't prevented by calling preventDefault() on pointerdown
https://bugs.webkit.org/show_bug.cgi?id=198072
<rdar://problem/50983361>

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Mark the WPT test progression after fixing this bug.

* web-platform-tests/pointerevents/pointerevent_suppress_compat_events_on_click-expected.txt:

Source/WebCore:

The Pointer Events spec says that "compatibility" mouse events, which means all mouse events save for "click",
should not be dispatched for a given pointer if preventDefault() was called during the dispatch of the "pointerdown"
event. Additionally, calling preventDefault() during the dispatch of "pointerup" has no effect.

* dom/Element.cpp:
(WebCore::Element::dispatchMouseEvent):
* page/PointerCaptureController.cpp:
(WebCore::PointerCaptureController::preventsCompatibilityMouseEventsForIdentifier):
(WebCore::PointerCaptureController::pointerEventWasDispatched):
* page/PointerCaptureController.h:

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

5 days ago[Pointer Events] Do not dispatch pointermove events when the pointer is not down...
graouts@webkit.org [Tue, 21 May 2019 17:49:28 +0000 (17:49 +0000)]
[Pointer Events] Do not dispatch pointermove events when the pointer is not down in WPT testdriver
https://bugs.webkit.org/show_bug.cgi?id=198071

Reviewed by Dean Jackson.

WPT actions sequences may move the pointer prior to pressing it down. In this case, we need to make sure we don't
end up queuing a "moved" touch and instead save the pointer position for when the pointer is pressed. It's important
to also generate a different touch id for each time we pause or end a touch sequence. This allows a few more WPT
touch tests to pass without any source change in our Pointer Events implementation.

* web-platform-tests/pointerevents/pointerevent_pointerleave_after_pointercancel_touch-expected.txt:
* web-platform-tests/pointerevents/pointerevent_pointerout_after_pointercancel_touch-expected.txt:
* web-platform-tests/pointerevents/pointerevent_touch-action-auto-css_touch-expected.txt:
* web-platform-tests/pointerevents/pointerevent_touch-action-inherit_highest-parent-none_touch-expected.txt:
* web-platform-tests/pointerevents/pointerevent_touch-action-pan-x-pan-y_touch-expected.txt:
* web-platform-tests/resources/testdriver-vendor.js:

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

5 days agoREGRESSION(r245540): ASSERTION FAILED: identifier.isNull() || RunLoop::isMain()
sihui_liu@apple.com [Tue, 21 May 2019 17:07:57 +0000 (17:07 +0000)]
REGRESSION(r245540): ASSERTION FAILED: identifier.isNull() || RunLoop::isMain()
https://bugs.webkit.org/show_bug.cgi?id=198074

Reviewed by Youenn Fablet.

* NetworkProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
(WebKit::LocalStorageDatabaseTracker::databasePath const):

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

5 days agoRTL/overflow scroll tests fail with async overflow enabled
antti@apple.com [Tue, 21 May 2019 15:53:40 +0000 (15:53 +0000)]
RTL/overflow scroll tests fail with async overflow enabled
https://bugs.webkit.org/show_bug.cgi?id=196013
<rdar://problem/49066649>

Reviewed by Simon Fraser.

Source/WebCore:

Test: compositing/ios/rtl-overflow-scrolling-2.html

This patch makes the basic RTL cases work in the scrolling tree.

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::minimumScrollPosition const):
(WebCore::ScrollingTreeScrollingNode::maximumScrollPosition const):

Add missing scroll offset <-> scroll position conversions.

Source/WebKit:

Add missing scroll offset <-> scroll position conversions.

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

LayoutTests:

* compositing/ios/rtl-overflow-scrolling-2-expected.html: Added.
* compositing/ios/rtl-overflow-scrolling-2.html: Added.

Add a reftest version for better coverage.

* compositing/rtl/rtl-overflow-scrolling.html:
* platform/ios-wk1/TestExpectations:
* platform/ios-wk2/TestExpectations:
* platform/ios-wk2/compositing/rtl/rtl-overflow-scrolling-expected.txt: Added.

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

5 days ago[WinCairo] Build WebDriver
don.olmstead@sony.com [Tue, 21 May 2019 13:10:52 +0000 (13:10 +0000)]
[WinCairo] Build WebDriver
https://bugs.webkit.org/show_bug.cgi?id=198056

Reviewed by Carlos Garcia Campos.

.:

Add ENABLE_WEBDRIVER as an experimental feature for WinCairo.

* Source/cmake/OptionsWin.cmake:

Source/WebDriver:

Add the platform and source files to get WinCairo to compile a WebDriver executable.

* CMakeLists.txt:
* PlatformWin.cmake: Added.
* Session.cpp:
(WebDriver::Session::go):
(WebDriver::Session::getCurrentURL):
(WebDriver::Session::back):
(WebDriver::Session::forward):
(WebDriver::Session::refresh):
(WebDriver::Session::getTitle):
(WebDriver::Session::switchToFrame):
(WebDriver::Session::switchToParentFrame):
(WebDriver::Session::setWindowRect):
(WebDriver::Session::maximizeWindow):
(WebDriver::Session::minimizeWindow):
(WebDriver::Session::fullscreenWindow):
(WebDriver::Session::findElements):
(WebDriver::Session::getActiveElement):
(WebDriver::Session::isElementSelected):
(WebDriver::Session::getElementText):
(WebDriver::Session::getElementTagName):
(WebDriver::Session::getElementRect):
(WebDriver::Session::isElementEnabled):
(WebDriver::Session::isElementDisplayed):
(WebDriver::Session::getElementAttribute):
(WebDriver::Session::getElementProperty):
(WebDriver::Session::getElementCSSValue):
(WebDriver::Session::elementClick):
(WebDriver::Session::elementClear):
(WebDriver::Session::elementSendKeys):
(WebDriver::Session::executeScript):
(WebDriver::Session::getAllCookies):
(WebDriver::Session::addCookie):
(WebDriver::Session::deleteCookie):
(WebDriver::Session::deleteAllCookies):
(WebDriver::Session::performActions):
(WebDriver::Session::takeScreenshot):
With nested lambdas MSVC believes the this pointer is for the enclosing lambda. Use a
protectedThis in the enclosing lambda and then use protectedThis.copyRef() in the nested
lambda.

* socket/HTTPServerSocket.cpp: Added.
(WebDriver::HTTPServer::listen):
(WebDriver::HTTPServer::disconnect):
Add stubs for HTTPServer when using a raw socket.

* socket/SessionHostSocket.cpp: Added.
(WebDriver::SessionHost::~SessionHost):
(WebDriver::SessionHost::connectToBrowser):
(WebDriver::SessionHost::isConnected const):
(WebDriver::SessionHost::startAutomationSession):
(WebDriver::SessionHost::sendMessageToBackend):
Add stubs for SessionHost when using a raw socket.

* win/WebDriverServiceWin.cpp: Added.
(WebDriver::WebDriverService::platformCapabilities):
(WebDriver::WebDriverService::platformCompareBrowserVersions):
(WebDriver::WebDriverService::platformValidateCapability const):
(WebDriver::WebDriverService::platformMatchCapability const):
(WebDriver::WebDriverService::platformParseCapabilities const):
Add stubs for WebDriverService on Windows.

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

5 days agoUnreviewed. Fix the build with HAVE(ACCESSIBILITY) disabled
carlosgc@webkit.org [Tue, 21 May 2019 12:53:59 +0000 (12:53 +0000)]
Unreviewed. Fix the build with HAVE(ACCESSIBILITY) disabled

* WebKitTestRunner/InjectedBundle/AccessibilityController.cpp:
(WTR::AccessibilityController::elementAtPoint):
* WebKitTestRunner/InjectedBundle/AccessibilityController.h:
(WTR::AccessibilityController::rootElement):
(WTR::AccessibilityController::focusedElement):

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

5 days ago[WPE] Add initial accessibility support using ATK
carlosgc@webkit.org [Tue, 21 May 2019 12:45:08 +0000 (12:45 +0000)]
[WPE] Add initial accessibility support using ATK
https://bugs.webkit.org/show_bug.cgi?id=197413

Reviewed by Michael Catanzaro.

.:

Add ENABLE_ACCESSIBILITY public option to WPE.

* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsWPE.cmake:

Source/WebCore:

Use USE(ATK) instead of PLATFORM(GTK) for ATK related code and use ATK when available for WPE port too.

* PlatformWPE.cmake:
* SourcesWPE.txt:
* accessibility/AXObjectCache.h:
* accessibility/AccessibilityList.cpp:
(WebCore::AccessibilityList::childHasPseudoVisibleListItemMarkers):
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::canSetValueAttribute const):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::textIteratorBehaviorForTextRange const):
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityObjectInterface.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::indexForVisiblePosition const):
(WebCore::AccessibilityRenderObject::shouldNotifyActiveDescendant const):
* accessibility/AccessibilityTableColumn.cpp:
(WebCore::AccessibilityTableColumn::computeAccessibilityIsIgnored const):
* accessibility/AccessibilityTableHeaderContainer.cpp:
(WebCore::AccessibilityTableHeaderContainer::computeAccessibilityIsIgnored const):
* accessibility/atk/WebKitAccessible.cpp:
(webkitAccessibleGetAttributes):
* accessibility/wpe/AXObjectCacheWPE.cpp: Removed.
* accessibility/wpe/AccessibilityObjectWPE.cpp: Removed.
* editing/FrameSelection.h:

Source/WebKit:

Rename WebKitWebViewBaseAccessible as WebKitWebViewAccessible and move it to glib removing its dependency on
GTK. WPEView now implements get_accessible to return its associated WebKitWebViewAccessible.

* PlatformWPE.cmake:
* SourcesGTK.txt:
* SourcesWPE.txt:
* UIProcess/API/glib/WebKitWebViewAccessible.cpp: Added.
(webkitWebViewAccessibleInitialize):
(webkitWebViewAccessibleRefStateSet):
(webkitWebViewAccessibleGetIndexInParent):
(webkit_web_view_accessible_class_init):
(webkitWebViewAccessibleNew):
(webkitWebViewAccessibleSetWebView):
* UIProcess/API/glib/WebKitWebViewAccessible.h: Added.
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseDispose):
(webkitWebViewBaseGetAccessible):
* UIProcess/API/gtk/WebKitWebViewBaseAccessible.cpp: Removed.
* UIProcess/API/gtk/WebKitWebViewBaseAccessible.h: Removed.
* UIProcess/API/wpe/PageClientImpl.cpp:
(WebKit::PageClientImpl::accessible):
* UIProcess/API/wpe/PageClientImpl.h:
* UIProcess/API/wpe/WPEView.cpp:
(WKWPE::m_backend):
(WKWPE::View::~View):
(WKWPE::View::accessible):
* UIProcess/API/wpe/WPEView.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/wpe/WebPageProxyWPE.cpp:
(WebKit::WebPageProxy::bindAccessibilityTree): Call atk_socket_embed() with the given plug ID.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/wpe/WebPageWPE.cpp:
(WebKit::WebPage::platformInitialize): Create the WebKitWebPageAccessibilityObject and send
BindAccessibilityTree message to the UI process.
* WebProcess/wpe/WebProcessMainWPE.cpp:
(WebKit::initializeAccessibility): Implement AtkUtil interface and initialize the atk bridge.

Tools:

Add accessibility support in MiniBrowser and backends used by MiniBrowser and tests.

* MiniBrowser/wpe/CMakeLists.txt:
* MiniBrowser/wpe/main.cpp:
(main):
* TestWebKitAPI/PlatformWPE.cmake:
* WebKitTestRunner/InjectedBundle/AccessibilityController.cpp:
* WebKitTestRunner/InjectedBundle/AccessibilityController.h:
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
* WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp:
(WTR::AccessibilityNotificationHandler::setNotificationFunctionCallback):
(WTR::AccessibilityNotificationHandler::removeAccessibilityNotificationHandler):
* WebKitTestRunner/InjectedBundle/wpe/AccessibilityControllerWPE.cpp: Removed.
* WebKitTestRunner/InjectedBundle/wpe/AccessibilityUIElementWPE.cpp: Removed.
* WebKitTestRunner/PlatformWPE.cmake:
* wpe/backends/CMakeLists.txt:
* wpe/backends/HeadlessViewBackend.cpp:
(WPEToolingBackends::HeadlessViewBackend::HeadlessViewBackend):
* wpe/backends/ViewBackend.cpp:
(WPEToolingBackends::addKeyEventListener):
(WPEToolingBackends::removeKeyEventListener):
(WPEToolingBackends::notifyAccessibilityKeyEventListeners):
(WPEToolingBackends::ViewBackend::initialize):
(WPEToolingBackends::ViewBackend::initializeAccessibility):
(WPEToolingBackends::ViewBackend::updateAccessibilityState):
(WPEToolingBackends::ViewBackend::setAccessibleChild):
(WPEToolingBackends::ViewBackend::addActivityState):
(WPEToolingBackends::ViewBackend::removeActivityState):
(WPEToolingBackends::ViewBackend::dispatchInputKeyboardEvent):
* wpe/backends/ViewBackend.h:
* wpe/backends/WebKitAccessibleApplication.cpp: Added.
(webkitAccessibleApplicationWindowInterfaceInit):
(webkitAccessibleApplicationFinalize):
(webkitAccessibleApplicationInitialize):
(webkitAccessibleApplicationGetNChildren):
(webkitAccessibleApplicationRefChild):
(webkitAccessibleApplicationGetName):
(webkit_accessible_application_class_init):
(webkit_accessible_application_init):
(webkitAccessibleApplicationNew):
(webkitAccessibleApplicationSetChild):
* wpe/backends/WebKitAccessibleApplication.h: Added.
* wpe/backends/WindowViewBackend.cpp:
(WPEToolingBackends::WindowViewBackend::WindowViewBackend):
* wpe/jhbuild.modules:

LayoutTests:

Unskip accessibility tests that are passing now and add platform specific results.

* platform/wpe/TestExpectations:
* platform/wpe/accessibility/add-children-pseudo-element-expected.txt: Added.
* platform/wpe/accessibility/aria-fallback-roles-expected.txt: Added.
* platform/wpe/accessibility/aria-hidden-negates-no-visibility-expected.txt: Added.
* platform/wpe/accessibility/aria-label-on-label-element-expected.txt: Added.
* platform/wpe/accessibility/aria-labelledby-overrides-aria-label-expected.txt: Added.
* platform/wpe/accessibility/aria-labelledby-overrides-label-expected.txt: Added.
* platform/wpe/accessibility/aria-option-role-expected.txt: Added.
* platform/wpe/accessibility/aria-roledescription-expected.txt: Added.
* platform/wpe/accessibility/aria-switch-sends-notification-expected.txt: Added.
* platform/wpe/accessibility/aria-tab-roles-expected.txt: Added.
* platform/wpe/accessibility/aria-table-attributes-expected.txt: Added.
* platform/wpe/accessibility/aria-table-content-expected.txt: Added.
* platform/wpe/accessibility/aria-toggle-button-with-title-expected.txt: Added.
* platform/wpe/accessibility/auto-fill-crash-expected.txt: Added.
* platform/wpe/accessibility/button-with-aria-haspopup-role-expected.txt: Added.
* platform/wpe/accessibility/color-well-expected.txt: Added.
* platform/wpe/accessibility/deleting-iframe-destroys-axcache-expected.txt: Added.
* platform/wpe/accessibility/dimensions-include-descendants-expected.txt: Added.
* platform/wpe/accessibility/double-nested-inline-element-missing-from-tree-expected.txt: Added.
* platform/wpe/accessibility/empty-image-with-title-expected.txt: Added.
* platform/wpe/accessibility/file-upload-button-stringvalue-expected.txt: Added.
* platform/wpe/accessibility/help-text-expected.txt: Added.
* platform/wpe/accessibility/image-link-expected.txt: Added.
* platform/wpe/accessibility/image-map1-expected.txt: Added.
* platform/wpe/accessibility/image-map2-expected.txt: Added.
* platform/wpe/accessibility/inline-continuations-expected.txt: Added.
* platform/wpe/accessibility/label-with-pseudo-elements-expected.txt: Added.
* platform/wpe/accessibility/list-detection-expected.txt: Added.
* platform/wpe/accessibility/lists-expected.txt: Added.
* platform/wpe/accessibility/math-multiscript-attributes-expected.txt: Added.
* platform/wpe/accessibility/media-emits-object-replacement-expected.txt: Added.
* platform/wpe/accessibility/menu-list-crash2-expected.txt: Added.
* platform/wpe/accessibility/minimal-table-with-aria-is-data-table-expected.txt: Added.
* platform/wpe/accessibility/press-targets-center-point-expected.txt: Added.
* platform/wpe/accessibility/radio-button-title-label-expected.txt: Added.
* platform/wpe/accessibility/render-counter-text-expected.txt: Added.
* platform/wpe/accessibility/roles-computedRoleString-expected.txt: Added.
* platform/wpe/accessibility/roles-exposed-expected.txt: Added.
* platform/wpe/accessibility/set-selected-text-range-contenteditable-expected.txt: Added.
* platform/wpe/accessibility/svg-remote-element-expected.txt: Added.
* platform/wpe/accessibility/tabindex-elements-are-accessible-expected.txt: Added.
* platform/wpe/accessibility/table-attributes-expected.txt: Added.
* platform/wpe/accessibility/table-cell-spans-expected.txt: Added.
* platform/wpe/accessibility/table-cells-expected.txt: Added.
* platform/wpe/accessibility/table-cells-roles-expected.txt: Added.
* platform/wpe/accessibility/table-column-headers-with-captions-expected.txt: Added.
* platform/wpe/accessibility/table-one-cell-expected.txt: Added.
* platform/wpe/accessibility/table-roles-hierarchy-expected.txt: Added.
* platform/wpe/accessibility/table-sections-expected.txt: Added.
* platform/wpe/accessibility/table-with-rules-expected.txt: Added.
* platform/wpe/accessibility/text-alternative-calculation-hidden-nodes-expected.txt: Added.
* platform/wpe/accessibility/transformed-element-expected.txt: Added.

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

5 days agoOnly cache bytecode for API clients in data vaults
tzagallo@apple.com [Tue, 21 May 2019 06:52:17 +0000 (06:52 +0000)]
Only cache bytecode for API clients in data vaults
https://bugs.webkit.org/show_bug.cgi?id=197898
Source/JavaScriptCore:

<rdar://problem/45945449>

Reviewed by Keith Miller.

Enforce that API clients only store cached bytecode in data vaults. This prevents
another process from compromising the current one by tampering with the bytecode.

* API/JSScript.mm:
(validateBytecodeCachePath):
(+[JSScript scriptOfType:withSource:andSourceURL:andBytecodeCache:inVirtualMachine:error:]):
(+[JSScript scriptOfType:memoryMappedFromASCIIFile:withSourceURL:andBytecodeCache:inVirtualMachine:error:]):
* API/tests/testapi.mm:
(cacheFileInDataVault):
(testModuleBytecodeCache):
(testProgramBytecodeCache):
(testBytecodeCacheWithSyntaxError):
(testBytecodeCacheWithSameCacheFileAndDifferentScript):
(testCacheFileFailsWhenItsAlreadyCached):
(testCanCacheManyFilesWithTheSameVM):
(testIsUsingBytecodeCacheAccessor):
(testBytecodeCacheValidation):
(testObjectiveCAPI):
* Configurations/ToolExecutable.xcconfig:
* JavaScriptCore.xcodeproj/project.pbxproj:
* testapi.entitlements: Added.

Source/WTF:

Reviewed by Keith Miller.

Add SPI to check if a filesystem path is restricted as a data vault.

* WTF.xcodeproj/project.pbxproj:
* wtf/spi/darwin/DataVaultSPI.h: Added.

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

5 days agoFix 32-bit btyecode cache crashes
tzagallo@apple.com [Tue, 21 May 2019 06:31:06 +0000 (06:31 +0000)]
Fix 32-bit btyecode cache crashes
https://bugs.webkit.org/show_bug.cgi?id=198035
<rdar://problem/49905560>

Reviewed by Michael Saboff.

There were 2 32-bit issues with the bytecode cache:
- UnlinkedFunctionExecutable::m_cachedCodeBlockForConstructOffset was not initialized.
  The code was relying on the other member of the union, `m_unlinkedCodeBlockForConstruct`,
  initializing both m_cachedCodeBlockForCallOffset and m_cachedCodeBlockForConstructOffset.
  This is undefined behavior and is also incorrect in 32-bit. Since m_unlinkedCodeBlockForConstruct
  is 32-bit, it only initializes the first member of the struct.
- Encoder::Page was not aligned at the end. This lead to unaligned allocations on subsequent
  pages, since the start of the following page would not be aligned.

* runtime/CachedTypes.cpp:
(JSC::Encoder::release):
(JSC::Encoder::Page::alignEnd):
(JSC::Encoder::allocateNewPage):
(JSC::VariableLengthObject::buffer const):
(JSC::VariableLengthObject::allocate):
(JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable):

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

5 days agoRevert r245501
achristensen@apple.com [Tue, 21 May 2019 05:31:25 +0000 (05:31 +0000)]
Revert r245501
https://bugs.webkit.org/show_bug.cgi?id=198007

That change did not fix <rdar://problem/49808949> but it caused <rdar://problem/50967271> so out it goes.

* Shared/API/Cocoa/WKMain.h: Added.
* Shared/API/Cocoa/WKMain.mm: Added.
(WKXPCServiceMain):
* Shared/EntryPointUtilities/Cocoa/AuxiliaryProcessMain.cpp: Added.
(main):
* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
(main): Deleted.
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::ProcessLauncher::launchProcess):
* WebKit.xcodeproj/project.pbxproj:

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

5 days ago[iOS] Layout viewport size on google.com increases after rotating to landscape and...
wenson_hsieh@apple.com [Tue, 21 May 2019 05:01:54 +0000 (05:01 +0000)]
[iOS] Layout viewport size on google.com increases after rotating to landscape and back
https://bugs.webkit.org/show_bug.cgi?id=198062
<rdar://problem/50547895>

Reviewed by Maciej Stachowiak.

Source/WebKit:

During an animated resize (e.g. when rotating the device on iOS), we currently immediately trigger the new
shrink-to-fit content size heuristic in the middle of dynamicViewportSizeUpdate, after the new view layout size
has been applied to the viewport configuration but before we've issued a resize event to the page.

Thus, on pages that use listen to the resize event and adjust their content accordingly to fit within the new
layout width, we prematurely declare that the page has horizontally overflowed, and try to lay out at a larger
width and scale down. This causes the page to unnecessarily shrink after rotating to landscale orientation and
back.

To fix this, we simply move the call to shrink-to-fit-content to the end of the dynamic viewport size update,
such that the page has had a chance to adjust to the new layout size.

Test: fast/events/ios/rotation/do-not-shrink-to-fit-content-after-rotation.html

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

LayoutTests:

Add a UIHelper method to simulate device rotation to a given orientation, and use it in a new layout test that
simulates rotation to and from landscape orientation, and verifies that the initial scale did not change from
its expected value of 1.

* fast/events/ios/rotation/do-not-shrink-to-fit-content-after-rotation-expected.txt: Added.
* fast/events/ios/rotation/do-not-shrink-to-fit-content-after-rotation.html: Added.
* resources/ui-helper.js:
(window.UIHelper.rotateDevice.return.new.Promise.):
(window.UIHelper.rotateDevice):
(window.UIHelper):

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

5 days agoPruning old file logic should not stop after removing 10 files if there are more...
dewei_zhu@apple.com [Tue, 21 May 2019 01:56:17 +0000 (01:56 +0000)]
Pruning old file logic should not stop after removing 10 files if there are more files to be removed.
https://bugs.webkit.org/show_bug.cgi?id=197870

Reviewed by Ryosuke Niwa.

Pruning old file logic should keep removing removable files to make enough space for a new file upload.
It should only attempt to remve the files that have not been removed.

* public/include/uploaded-file-helpers.php: Modified 'prune_old_files' to allow to remove more than 10 files.
Fixed a bug that a removed file keep getting removed but never free up new space.
* server-tests/privileged-api-upload-file-tests.js:
(makeRandomAlnumStringForLength): Helper function to generate random content for a given length.
* server-tests/resources/test-server.js: Update total file size limit for this change.
(TestServer.prototype.testConfig):

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

5 days agorun-webkit-tests not gathering crash logs on Cygwin Python and Windows Python
Hironori.Fujii@sony.com [Tue, 21 May 2019 01:52:52 +0000 (01:52 +0000)]
run-webkit-tests not gathering crash logs on Cygwin Python and Windows Python
https://bugs.webkit.org/show_bug.cgi?id=179828

Reviewed by Jonathan Bedard.

ServerProcess should store its Windows PID for Cygwin before
process crashing because the Windows PID is required to get a
correct CrashLog.

CrashLog format has been changed. CrashLogs.GLOBAL_PID_REGEX
should accept the new format.

* Scripts/webkitpy/common/system/crashlogs.py:
(CrashLogs.GLOBAL_PID_REGEX): Accept any words between 'Global' and 'PID:'.

* Scripts/webkitpy/port/driver.py:
(Driver.has_crashed):
(Driver._check_for_driver_crash_or_unresponsiveness):
(Driver._read_block):
Store server_process.system_pid() to self._crashed_pid instead of server_process.pid().

* Scripts/webkitpy/port/server_process.py:
(ServerProcess.__init__):
(ServerProcess.system_pid): Added.
(ServerProcess._find_system_pid): Added.
(ServerProcess._start): Set self._system_pid.
* Scripts/webkitpy/port/win.py:
(WinPort._get_crash_log): Removed broken old code converting Cygwin pid to Windows pid.

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

5 days agoMake lossy LayoutUnit constructors explicit
ross.kirsling@sony.com [Tue, 21 May 2019 01:36:11 +0000 (01:36 +0000)]
Make lossy LayoutUnit constructors explicit
https://bugs.webkit.org/show_bug.cgi?id=191811

Reviewed by Antti Koivisto.

Source/WebCore:

* platform/LayoutUnit.h:
Make lossy unary constructors explicit.
For ergonomics, give float overloads to copy constructor and round/floor/ceil functions.

* css/LengthFunctions.h:
* platform/graphics/LayoutPoint.h:
* platform/graphics/LayoutRect.h:
* platform/graphics/LayoutSize.h:
* rendering/RenderBox.h:
* rendering/RenderElement.h:
Templatize common functions to allow LayoutUnit itself to dictate which types it allows.

* html/shadow/SliderThumbElement.cpp:
* page/FrameView.cpp:
* page/Page.cpp:
* page/SpatialNavigation.cpp:
* page/scrolling/AxisScrollSnapOffsets.cpp:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
* layout/FormattingContextGeometry.cpp:
* layout/FormattingContextQuirks.cpp:
* layout/LayoutState.cpp:
* layout/displaytree/DisplayBox.h:
* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
* layout/layouttree/LayoutReplaced.cpp:
* platform/animation/AnimationUtilities.h:
* platform/cocoa/ScrollSnapAnimatorState.mm:
* rendering/BorderEdge.cpp:
* rendering/EllipsisBox.cpp:
* rendering/FixedTableLayout.cpp:
* rendering/InlineBox.cpp:
* rendering/InlineFlowBox.cpp:
* rendering/InlineFlowBox.h:
* rendering/InlineTextBox.cpp:
* rendering/RenderBlock.cpp:
* rendering/RenderBlockFlow.cpp:
* rendering/RenderBlockLineLayout.cpp:
* rendering/RenderBox.cpp:
* rendering/RenderBoxModelObject.cpp:
* rendering/RenderBoxModelObject.h:
* rendering/RenderDeprecatedFlexibleBox.cpp:
* rendering/RenderElement.cpp:
* rendering/RenderImage.cpp:
* rendering/RenderInline.cpp:
* rendering/RenderLineBreak.cpp:
* rendering/RenderListMarker.cpp:
* rendering/RenderMultiColumnSet.cpp:
* rendering/RenderMultiColumnSet.h:
* rendering/RenderObject.cpp:
* rendering/RenderReplaced.cpp:
* rendering/RenderTable.cpp:
* rendering/RenderTableCell.cpp:
* rendering/RenderTableSection.cpp:
* rendering/RenderText.cpp:
* rendering/RenderTextControlMultiLine.cpp:
* rendering/RenderThemeMac.mm:
* rendering/RenderVTTCue.cpp:
* rendering/RenderView.cpp:
* rendering/RootInlineBox.cpp:
* rendering/SimpleLineLayoutFunctions.cpp:
* rendering/SimpleLineLayoutPagination.cpp:
* rendering/SimpleLineLayoutResolver.cpp:
* rendering/line/LineWidth.cpp:
* rendering/mathml/MathOperator.cpp:
* rendering/mathml/RenderMathMLBlock.cpp:
* rendering/mathml/RenderMathMLBlock.h:
* rendering/mathml/RenderMathMLFencedOperator.h:
* rendering/mathml/RenderMathMLFraction.cpp:
* rendering/mathml/RenderMathMLMenclose.cpp:
* rendering/mathml/RenderMathMLOperator.cpp:
* rendering/mathml/RenderMathMLRoot.cpp:
* rendering/mathml/RenderMathMLScripts.cpp:
* rendering/mathml/RenderMathMLToken.cpp:
* rendering/shapes/BoxShape.cpp:
* rendering/shapes/ShapeOutsideInfo.cpp:
* rendering/style/CollapsedBorderValue.h:
* rendering/style/NinePieceImage.cpp:
* rendering/style/NinePieceImage.h:
* rendering/style/RenderStyle.cpp:
* rendering/style/RenderStyle.h:
* rendering/svg/RenderSVGText.cpp:
* rendering/svg/SVGInlineTextBox.cpp:
Make usage of LayoutUnit(float) and LayoutUnit(double) explicit where needed.

Source/WebKit:

* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/ios/WebPageIOS.mm:
Make usage of LayoutUnit(float) explicit.

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

5 days ago[iOS] WebKit crash loop
pvollan@apple.com [Tue, 21 May 2019 01:09:44 +0000 (01:09 +0000)]
[iOS] WebKit crash loop
https://bugs.webkit.org/show_bug.cgi?id=198061
<rdar://problem/50967271>

Reviewed by Brent Fulgham.

A new syscall rule needs to be added to the sandbox on iOS.

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

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

5 days agoWindows 10 test results missing on flakiness dashboard
aakash_jain@apple.com [Tue, 21 May 2019 00:12:23 +0000 (00:12 +0000)]
Windows 10 test results missing on flakiness dashboard
https://bugs.webkit.org/show_bug.cgi?id=198058

Rubber-stamped by Alexey Proskuryakov.

* TestResultServer/static-dashboards/flakiness_dashboard.js:

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

5 days agoMove Web Storage to Network Process
sihui_liu@apple.com [Tue, 21 May 2019 00:07:39 +0000 (00:07 +0000)]
Move Web Storage to Network Process
https://bugs.webkit.org/show_bug.cgi?id=197636
Source/WebKit:

Reviewed by Youenn Fablet.

* CMakeLists.txt:
* DerivedSources.make:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
(WebKit::NetworkConnectionToWebProcess::didReceiveSyncMessage):
(WebKit::NetworkConnectionToWebProcess::didClose):
(WebKit::NetworkConnectionToWebProcess::webPageWasAdded):
(WebKit::NetworkConnectionToWebProcess::webPageWasRemoved):
(WebKit::NetworkConnectionToWebProcess::webProcessSessionChanged):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::networkSessionByConnection const):
(WebKit::NetworkProcess::hasLocalStorage):
(WebKit::NetworkProcess::fetchWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
(WebKit::filterForRegistrableDomains):
(WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
(WebKit::NetworkProcess::webPageWasAdded):
(WebKit::NetworkProcess::webPageWasRemoved):
(WebKit::NetworkProcess::webProcessWasDisconnected):
(WebKit::NetworkProcess::webProcessSessionChanged):
(WebKit::NetworkProcess::getLocalStorageOriginDetails):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::NetworkSession):
(WebKit::NetworkSession::~NetworkSession):
* NetworkProcess/NetworkSession.h:
(WebKit::NetworkSession::storageManager):
* NetworkProcess/NetworkSessionCreationParameters.cpp:
(WebKit::NetworkSessionCreationParameters::privateSessionParameters):
(WebKit::NetworkSessionCreationParameters::encode const):
(WebKit::NetworkSessionCreationParameters::decode):
* NetworkProcess/NetworkSessionCreationParameters.h:
* NetworkProcess/WebStorage/LocalStorageDatabase.cpp: Renamed from Source/WebKit/UIProcess/WebStorage/LocalStorageDatabase.cpp.
(WebKit::LocalStorageDatabase::create):
(WebKit::LocalStorageDatabase::LocalStorageDatabase):
(WebKit::LocalStorageDatabase::~LocalStorageDatabase):
(WebKit::LocalStorageDatabase::openDatabase):
(WebKit::LocalStorageDatabase::tryToOpenDatabase):
(WebKit::LocalStorageDatabase::migrateItemTableIfNeeded):
(WebKit::LocalStorageDatabase::importItems):
(WebKit::LocalStorageDatabase::setItem):
(WebKit::LocalStorageDatabase::removeItem):
(WebKit::LocalStorageDatabase::clear):
(WebKit::LocalStorageDatabase::close):
(WebKit::LocalStorageDatabase::itemDidChange):
(WebKit::LocalStorageDatabase::scheduleDatabaseUpdate):
(WebKit::LocalStorageDatabase::updateDatabase):
(WebKit::LocalStorageDatabase::updateDatabaseWithChangedItems):
(WebKit::LocalStorageDatabase::databaseIsEmpty):
* NetworkProcess/WebStorage/LocalStorageDatabase.h: Renamed from Source/WebKit/UIProcess/WebStorage/LocalStorageDatabase.h.
* NetworkProcess/WebStorage/LocalStorageDatabaseTracker.cpp: Renamed from Source/WebKit/UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp.
(WebKit::LocalStorageDatabaseTracker::create):
(WebKit::LocalStorageDatabaseTracker::LocalStorageDatabaseTracker):
(WebKit::LocalStorageDatabaseTracker::~LocalStorageDatabaseTracker):
(WebKit::LocalStorageDatabaseTracker::databasePath const):
(WebKit::LocalStorageDatabaseTracker::didOpenDatabaseWithOrigin):
(WebKit::LocalStorageDatabaseTracker::deleteDatabaseWithOrigin):
(WebKit::LocalStorageDatabaseTracker::deleteAllDatabases):
(WebKit::LocalStorageDatabaseTracker::databasesModifiedSince):
(WebKit::LocalStorageDatabaseTracker::origins const):
(WebKit::LocalStorageDatabaseTracker::originDetails):
* NetworkProcess/WebStorage/LocalStorageDatabaseTracker.h: Renamed from Source/WebKit/UIProcess/WebStorage/LocalStorageDatabaseTracker.h.
* NetworkProcess/WebStorage/StorageManager.cpp: Renamed from Source/WebKit/UIProcess/WebStorage/StorageManager.cpp.
(WebKit::StorageManager::StorageArea::securityOrigin const):
(WebKit::StorageManager::StorageArea::isSessionStorage const):
(WebKit::StorageManager::LocalStorageNamespace::storageManager const):
(WebKit::StorageManager::TransientLocalStorageNamespace::create):
(WebKit::StorageManager::TransientLocalStorageNamespace::~TransientLocalStorageNamespace):
(WebKit::StorageManager::TransientLocalStorageNamespace::getOrCreateStorageArea):
(WebKit::StorageManager::TransientLocalStorageNamespace::origins const):
(WebKit::StorageManager::TransientLocalStorageNamespace::clearStorageAreasMatchingOrigin):
(WebKit::StorageManager::TransientLocalStorageNamespace::clearAllStorageAreas):
(WebKit::StorageManager::TransientLocalStorageNamespace::TransientLocalStorageNamespace):
(WebKit::StorageManager::StorageArea::create):
(WebKit::StorageManager::StorageArea::StorageArea):
(WebKit::StorageManager::StorageArea::~StorageArea):
(WebKit::StorageManager::StorageArea::addListener):
(WebKit::StorageManager::StorageArea::removeListener):
(WebKit::StorageManager::StorageArea::hasListener const):
(WebKit::StorageManager::StorageArea::clone const):
(WebKit::StorageManager::StorageArea::setItem):
(WebKit::StorageManager::StorageArea::removeItem):
(WebKit::StorageManager::StorageArea::clear):
(WebKit::StorageManager::StorageArea::items const):
(WebKit::StorageManager::StorageArea::openDatabaseAndImportItemsIfNeeded const):
(WebKit::StorageManager::StorageArea::dispatchEvents const):
(WebKit::StorageManager::LocalStorageNamespace::create):
(WebKit::StorageManager::LocalStorageNamespace::LocalStorageNamespace):
(WebKit::StorageManager::LocalStorageNamespace::~LocalStorageNamespace):
(WebKit::StorageManager::LocalStorageNamespace::getOrCreateStorageArea):
(WebKit::StorageManager::LocalStorageNamespace::didDestroyStorageArea):
(WebKit::StorageManager::LocalStorageNamespace::clearStorageAreasMatchingOrigin):
(WebKit::StorageManager::LocalStorageNamespace::clearAllStorageAreas):
(WebKit::StorageManager::SessionStorageNamespace::isEmpty const):
(WebKit::StorageManager::SessionStorageNamespace::allowedConnections const):
(WebKit::StorageManager::SessionStorageNamespace::origins const):
(WebKit::StorageManager::SessionStorageNamespace::clearStorageAreasMatchingOrigin):
(WebKit::StorageManager::SessionStorageNamespace::clearAllStorageAreas):
(WebKit::StorageManager::SessionStorageNamespace::create):
(WebKit::StorageManager::SessionStorageNamespace::SessionStorageNamespace):
(WebKit::StorageManager::SessionStorageNamespace::~SessionStorageNamespace):
(WebKit::StorageManager::SessionStorageNamespace::addAllowedConnection):
(WebKit::StorageManager::SessionStorageNamespace::removeAllowedConnection):
(WebKit::StorageManager::SessionStorageNamespace::getOrCreateStorageArea):
(WebKit::StorageManager::SessionStorageNamespace::cloneTo):
(WebKit::StorageManager::create):
(WebKit::StorageManager::StorageManager):
(WebKit::StorageManager::~StorageManager):
(WebKit::StorageManager::createSessionStorageNamespace):
(WebKit::StorageManager::destroySessionStorageNamespace):
(WebKit::StorageManager::addAllowedSessionStorageNamespaceConnection):
(WebKit::StorageManager::removeAllowedSessionStorageNamespaceConnection):
(WebKit::StorageManager::cloneSessionStorageNamespace):
(WebKit::StorageManager::processWillOpenConnection):
(WebKit::StorageManager::processDidCloseConnection):
(WebKit::StorageManager::getSessionStorageOrigins):
(WebKit::StorageManager::deleteSessionStorageOrigins):
(WebKit::StorageManager::deleteSessionStorageEntriesForOrigins):
(WebKit::StorageManager::getLocalStorageOrigins):
(WebKit::StorageManager::getLocalStorageOriginDetails):
(WebKit::StorageManager::deleteLocalStorageEntriesForOrigin):
(WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
(WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
(WebKit::StorageManager::createLocalStorageMap):
(WebKit::StorageManager::createTransientLocalStorageMap):
(WebKit::StorageManager::createSessionStorageMap):
(WebKit::StorageManager::destroyStorageMap):
(WebKit::StorageManager::getValues):
(WebKit::StorageManager::setItem):
(WebKit::StorageManager::removeItem):
(WebKit::StorageManager::clear):
(WebKit::StorageManager::applicationWillTerminate):
(WebKit::StorageManager::findStorageArea const):
(WebKit::StorageManager::getOrCreateLocalStorageNamespace):
(WebKit::StorageManager::getOrCreateTransientLocalStorageNamespace):
* NetworkProcess/WebStorage/StorageManager.h: Renamed from Source/WebKit/UIProcess/WebStorage/StorageManager.h.
* NetworkProcess/WebStorage/StorageManager.messages.in: Renamed from Source/WebKit/UIProcess/WebStorage/StorageManager.messages.in.
* NetworkProcess/WebStorage/ios/LocalStorageDatabaseTrackerIOS.mm: Copied from Source/WebKit/UIProcess/WebStorage/ios/LocalStorageDatabaseTrackerIOS.mm.
(WebKit::LocalStorageDatabaseTracker::platformMaybeExcludeFromBackup const):
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
* NetworkProcess/curl/NetworkSessionCurl.cpp:
(WebKit::NetworkSessionCurl::NetworkSessionCurl):
* NetworkProcess/soup/NetworkSessionSoup.cpp:
(WebKit::NetworkSessionSoup::NetworkSessionSoup):
* PlatformMac.cmake:
* PlatformWin.cmake:
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* Shared/WebsiteData/WebsiteData.cpp:
(WebKit::WebsiteData::ownerProcess):
* Sources.txt:
* SourcesCocoa.txt:
* UIProcess/API/C/WKKeyValueStorageManager.cpp:
(WKKeyValueStorageManagerGetKeyValueStorageOrigins):
(WKKeyValueStorageManagerGetStorageDetailsByOrigin):
(WKKeyValueStorageManagerDeleteEntriesForOrigin):
(WKKeyValueStorageManagerDeleteAllEntries):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::hasLocalStorage):
(WebKit::NetworkProcessProxy::getLocalStorageDetails):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::createNewPage):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):
(WebKit::WebsiteDataStore::platformInitialize):
(WebKit::WebsiteDataStore::platformDestroy):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::WebsiteDataStore):
(WebKit::computeNetworkProcessAccessTypeForDataFetch):
(WebKit::WebsiteDataStore::fetchDataAndApply):
(WebKit::WebsiteDataStore::removeData):
(WebKit::WebsiteDataStore::hasLocalStorageForTesting const):
(WebKit::WebsiteDataStore::parameters):
(WebKit::WebsiteDataStore::getLocalStorageDetails):
(WebKit::m_client): Deleted.
(WebKit::WebsiteDataStore::cloneSessionData): Deleted.
(WebKit::WebsiteDataStore::webPageWasAdded): Deleted.
(WebKit::WebsiteDataStore::webPageWasInvalidated): Deleted.
(WebKit::WebsiteDataStore::webProcessWillOpenConnection): Deleted.
(WebKit::WebsiteDataStore::webPageWillOpenConnection): Deleted.
(WebKit::WebsiteDataStore::webPageDidCloseConnection): Deleted.
(WebKit::WebsiteDataStore::webProcessDidCloseConnection): Deleted.
* UIProcess/WebsiteData/WebsiteDataStore.h:
(WebKit::WebsiteDataStore::resolvedLocalStorageDirectory const):
(WebKit::WebsiteDataStore::storageManager): Deleted.
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::setPrivateBrowsingEnabled):
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::didReceiveMessage):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::createWindow):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::close):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::createWebPage):
(WebKit::WebProcess::removeWebPage):
(WebKit::WebProcess::ensureNetworkProcessConnection):
(WebKit::WebProcess::networkProcessConnectionClosed):
(WebKit::WebProcess::registerStorageAreaMap):
(WebKit::WebProcess::unregisterStorageAreaMap):
(WebKit::WebProcess::storageAreaMap const):
(WebKit::WebProcess::enablePrivateBrowsingForTesting):
* WebProcess/WebProcess.h:
* WebProcess/WebStorage/StorageAreaMap.cpp:
(WebKit::StorageAreaMap::StorageAreaMap):
(WebKit::StorageAreaMap::~StorageAreaMap):
(WebKit::StorageAreaMap::setItem):
(WebKit::StorageAreaMap::removeItem):
(WebKit::StorageAreaMap::clear):
(WebKit::StorageAreaMap::loadValuesIfNeeded):
(WebKit::StorageAreaMap::connect):
(WebKit::StorageAreaMap::disconnect):
* WebProcess/WebStorage/StorageAreaMap.h:
(WebKit::StorageAreaMap::identifier const):

Tools:

Reviewed by Youenn Fablet.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/LocalStorageDatabaseTracker.mm: Remove the wait for database file update.
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/LocalStoragePersistence.mm: Add a test for network process crash recovery.
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm: Fix a typo and add a test case to cover it.
* TestWebKitAPI/Tests/WebKitCocoa/local-storage-process-crashes.html: Added.

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

5 days agoProvide an explicit UIModalPresentation style when creating an AVPlayerViewController...
jer.noble@apple.com [Mon, 20 May 2019 23:06:43 +0000 (23:06 +0000)]
Provide an explicit UIModalPresentation style when creating an AVPlayerViewController for fullscreen.
https://bugs.webkit.org/show_bug.cgi?id=198052

Reviewed by Tim Horton.

Make sure AVPlayerViewController has an "overFullScreen" modal style.

* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerViewController initWithFullscreenInterface:]):

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

5 days agoFix security check in ScriptController::canAccessFromCurrentOrigin()
cdumez@apple.com [Mon, 20 May 2019 22:53:03 +0000 (22:53 +0000)]
Fix security check in ScriptController::canAccessFromCurrentOrigin()
https://bugs.webkit.org/show_bug.cgi?id=196730
<rdar://problem/49731231>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Fix security check in ScriptController::canAccessFromCurrentOrigin() when there is no
current JS exec state. Instead of returning true unconditionally, we now fall back to
using the accessing document's origin for the security check. The new behavior is
aligned with Blink:
https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/html/html_frame_element_base.cc?rcl=d3f22423d512b45466f1694020e20da9e0c6ee6a&l=62

This fix is based on a patch from Sergei Glazunov <glazunov@google.com>.

Test: http/tests/security/showModalDialog-sync-cross-origin-page-load2.html

* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::canAccessFromCurrentOrigin):
* bindings/js/ScriptController.h:
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::isURLAllowed const):

LayoutTests:

Add layout test coverage.

* http/tests/security/showModalDialog-sync-cross-origin-page-load2-expected.txt: Added.
* http/tests/security/showModalDialog-sync-cross-origin-page-load2.html: Added.

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

5 days ago[WinCairo] Implement Remote Web Inspector Client.
ross.kirsling@sony.com [Mon, 20 May 2019 21:17:02 +0000 (21:17 +0000)]
[WinCairo] Implement Remote Web Inspector Client.
https://bugs.webkit.org/show_bug.cgi?id=197434

Reviewed by Don Olmstead.

.:

* Source/cmake/OptionsWin.cmake:
* Source/cmake/OptionsWinCairo.cmake:

Source/JavaScriptCore:

* inspector/remote/socket/RemoteInspectorConnectionClient.cpp:
(Inspector::RemoteInspectorConnectionClient::didAccept): Deleted.
* inspector/remote/socket/RemoteInspectorConnectionClient.h:
(Inspector::RemoteInspectorConnectionClient::didAccept):
* inspector/remote/socket/RemoteInspectorServer.cpp:
(Inspector::RemoteInspectorServer::dispatchMap):

Source/WebKit:

* PlatformWin.cmake:
* UIProcess/RemoteWebInspectorProxy.cpp:
* UIProcess/RemoteWebInspectorProxy.h:
* UIProcess/socket/RemoteInspectorClient.cpp: Added.
* UIProcess/socket/RemoteInspectorClient.h: Added.
* UIProcess/socket/RemoteInspectorProtocolHandler.cpp: Added.
* UIProcess/socket/RemoteInspectorProtocolHandler.h: Added.
* UIProcess/win/RemoteWebInspectorProxyWin.cpp: Added.
* UIProcess/win/WebView.cpp:
(WebKit::WebView::WebView):

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

5 days agoWeb Inspector: Storage tab crashes easily when adding new local/session storage entries.
drousso@apple.com [Mon, 20 May 2019 20:45:22 +0000 (20:45 +0000)]
Web Inspector: Storage tab crashes easily when adding new local/session storage entries.
https://bugs.webkit.org/show_bug.cgi?id=198004

Reviewed by Ross Kirsling.

* UserInterface/Views/DataGrid.js:
(WI.DataGrid.prototype._startEditingNodeAtColumnIndex):
Force a layout in the case that a new `PlaceholderDataGridNode` was added to the end of the
`DataGrid` as part of the `editCallback`. Web Inspector won't crash without this, but it
won't properly select/focus the next row when tabbing from the last column to the next row.

(WI.DataGrid.prototype._editingCommitted):
Save the new value of the column before removing the editing styles, as that refreshes the
`DataGridNode`. If the new value isn't saved, the old value is used during the refresh.

(WI.DataGrid.prototype._keyDown):
Drive-by: use `get element` instead of using the member variable directly, as the underlying
value might not have been initialized yet.

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

5 days agoRange getBoundingClientRect returning zero rect on simple text node with <br> before it
commit-queue@webkit.org [Mon, 20 May 2019 20:32:35 +0000 (20:32 +0000)]
Range getBoundingClientRect returning zero rect on simple text node with <br> before it
https://bugs.webkit.org/show_bug.cgi?id=182181

Patch by Gabe Giosia <giosia@google.com> on 2019-05-20
Reviewed by Antti Koivisto.

Source/WebCore:

Correct rect of RenderText in a block element when used in a Range
over a line break element. The end offset was miscalculated.

Addded line-break case to fast/dom/Range/getBoundingClientRect.html

* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::collectAbsoluteQuadsForRange):
* rendering/SimpleLineLayoutResolver.cpp:
(WebCore::SimpleLineLayout::RunResolver::rangeForRendererWithOffsets const):

LayoutTests:

Test getBoundingClientRect with a Range that contains a line break.

* fast/dom/Range/getBoundingClientRect-expected.txt:
* fast/dom/Range/getBoundingClientRect.html:

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

6 days ago[macOS] STP can't launch any WebContent processes
pvollan@apple.com [Mon, 20 May 2019 19:18:42 +0000 (19:18 +0000)]
[macOS] STP can't launch any WebContent processes
https://bugs.webkit.org/show_bug.cgi?id=198045
<rdar://problem/50931110>

Reviewed by Brent Fulgham.

This is caused by a syscall sandbox violation.

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

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

6 days agogenerate-xcfilelists is stranding temporary files
krollin@apple.com [Mon, 20 May 2019 18:24:43 +0000 (18:24 +0000)]
generate-xcfilelists is stranding temporary files
https://bugs.webkit.org/show_bug.cgi?id=198008
<rdar://problem/50893659>

Reviewed by Jonathan Bedard.

generate-xcfilelists makes use of temporary files on disk. These files
are opened with the OS's "temporary" bit set, causing them to get
deleted when closed or the process exists. However, these temporary
files actually end up persisting after the script exists. This is
because `sed` is used to process the files, and is done so in a way
that causes the "temporary" bit to get cleared.

Address this issue by no longer using `sed` and instead performing the
equivalent processing the file content in-memory.

* Scripts/webkitpy/generate_xcfilelists_lib/generators.py:
(BaseGenerator._generate_derived):
(BaseGenerator._generate_unified):
(BaseGenerator._replace):
(BaseGenerator._unexpand):
(BaseGenerator._find_added_lines.get_lines):
(BaseGenerator._find_added_lines):

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

6 days agoUnreviewed test gardening after r245482.
ryanhaddad@apple.com [Mon, 20 May 2019 17:51:55 +0000 (17:51 +0000)]
Unreviewed test gardening after r245482.

* platform/mac/TestExpectations: Explicitly mark webgl/2.0.0/conformance2/textures/misc/copy-texture-image-luma-format.html
as slow for High Sierra.

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

6 days agoAllow WebContent mach-lookup AGXCompilerService
commit-queue@webkit.org [Mon, 20 May 2019 17:41:16 +0000 (17:41 +0000)]
Allow WebContent mach-lookup AGXCompilerService
https://bugs.webkit.org/show_bug.cgi?id=198031
<rdar://problem/50552974>

Patch by Zhifei Fang <zhifei_fang@apple.com> on 2019-05-20
Reviewed by Per Arne Vollan.

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

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

6 days agoHitpoint for link which spans two lines in web content is incorrect
commit-queue@webkit.org [Mon, 20 May 2019 17:24:20 +0000 (17:24 +0000)]
Hitpoint for link which spans two lines in web content is incorrect
https://bugs.webkit.org/show_bug.cgi?id=197511
<rdar://problem/49971483>

Patch by Andres Gonzalez <andresg_22@apple.com> on 2019-05-20
Reviewed by Chris Fleizach.

* accessibility/ios-simulator/links-activation.html:
* accessibility/links-activation-expected.txt:
* accessibility/links-activation.html:

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

6 days ago[ Mac WK2 iOS Sim] Layout Test http/tests/resourceLoadStatistics/website-data-removal...
sihui_liu@apple.com [Mon, 20 May 2019 17:14:33 +0000 (17:14 +0000)]
[ Mac WK2 iOS Sim] Layout Test http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=196307
<rdar://problem/49345360>

Reviewed by Alex Christensen.

Source/WebKit:

Delay dumping statistics if there is data being removed.

* NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
(WebKit::ResourceLoadStatisticsStore::removeDataRecords):
* NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
(WebKit::ResourceLoadStatisticsStore::dataRecordsBeingRemoved const):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::dumpResourceLoadStatistics):
(WebKit::WebResourceLoadStatisticsStore::tryDumpResourceLoadStatistics):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:

LayoutTests:

* platform/ios-simulator-wk2/TestExpectations:
* platform/mac-wk2/TestExpectations:

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

6 days ago[WPE][Qt] Use C++17 instead of C++14
commit-queue@webkit.org [Mon, 20 May 2019 14:50:54 +0000 (14:50 +0000)]
[WPE][Qt] Use C++17 instead of C++14
https://bugs.webkit.org/show_bug.cgi?id=197415

Patch by Ludovico de Nittis <ludovico.denittis@collabora.com> on 2019-05-20
Reviewed by Philippe Normand.

There was a regression introduced with the commit https://bugs.webkit.org/show_bug.cgi?id=197131
The WPE Qt port was not updated to C++17 and this leaded to a compilation error.

Source/WebKit:

* PlatformWPE.cmake:

Tools:

* TestWebKitAPI/glib/CMakeLists.txt:

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

6 days ago[Flatpak][Qt] Meson: Unknown type feature for gstreamer
commit-queue@webkit.org [Mon, 20 May 2019 14:49:46 +0000 (14:49 +0000)]
[Flatpak][Qt] Meson: Unknown type feature for gstreamer
https://bugs.webkit.org/show_bug.cgi?id=197408

Patch by Ludovico de Nittis <ludovico.denittis@collabora.com> on 2019-05-20
Reviewed by Philippe Normand.

This is a regression that has been introduced when
GStreamer was updated to version 1.16.0
https://bugs.webkit.org/show_bug.cgi?id=197157

Now GStreamer requires meson >= 0.47.0
Updating the Kde runtime to version 5.12 we fulfill
this requirement.

* flatpak/org.webkit.WPEQT.yaml:

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

6 days ago[GLIB] Crash when instantiating a js object registered with jsc_context_register_clas...
carlosgc@webkit.org [Mon, 20 May 2019 13:48:04 +0000 (13:48 +0000)]
[GLIB] Crash when instantiating a js object registered with jsc_context_register_class on window object cleared
https://bugs.webkit.org/show_bug.cgi?id=198037

Reviewed by Michael Catanzaro.

Source/JavaScriptCore:

This happens because JSCClass is keeping a pointer to the JSCContext used when the class is registered, and the
context can be destroyed before the class. We can't a reference to the context, because we don't really want to
keep it alive. The life of the JSCClass is not attached to the JSCContext, but to its wrapped global context, so
we can keep a pointer to the JSGlobalContextRef instead and create a new JSCContext wrapping it when
needed. This patch is also making the context property of JSCClass non-readable, which was always the intention,
that's why there isn't a public getter in the API.

* API/glib/JSCCallbackFunction.cpp:
(JSC::JSCCallbackFunction::construct): Pass the context to jscClassGetOrCreateJSWrapper().
* API/glib/JSCClass.cpp:
(jscClassGetProperty): Remove the getter for context property.
(jscClassSetProperty): Get the JSGlobalContextRef from the given JSCContext.
(jsc_class_class_init): Make context writable only.
(jscClassCreate): Use the passed in context instead of the member.
(jscClassGetOrCreateJSWrapper): It receives now the context as parameter.
(jscClassCreateContextWithJSWrapper): Ditto.
(jscClassCreateConstructor): Get or create a JSCContext for our JSGlobalContextRef.
(jscClassAddMethod): Ditto.
(jsc_class_add_property): Ditto.
* API/glib/JSCClassPrivate.h:
* API/glib/JSCContext.cpp:
(jsc_context_evaluate_in_object): Pass the context to jscClassCreateContextWithJSWrapper().
* API/glib/JSCValue.cpp:
(jsc_value_new_object): Pass the context to jscClassGetOrCreateJSWrapper().

Tools:

Add a test case to check the crash is fixed.

* TestWebKitAPI/Tests/WebKitGLib/TestWebExtensions.cpp:
(testWebExtensionWindowObjectCleared):
* TestWebKitAPI/Tests/WebKitGLib/WebExtensionTest.cpp:
(windowObjectCleared):

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

6 days ago[GTK] Use a repeating timer to populate emoji chooser
carlosgc@webkit.org [Mon, 20 May 2019 08:15:27 +0000 (08:15 +0000)]
[GTK] Use a repeating timer to populate emoji chooser
https://bugs.webkit.org/show_bug.cgi?id=197984

Reviewed by Michael Catanzaro.

It ensures the emoji chooser popover is shown as soon as it's requested.

* UIProcess/API/gtk/WebKitEmojiChooser.cpp:
(webkitEmojiChooserSetupSectionBox):
(webkitEmojiChooserSetupRecent):
(webkitEmojiChooserSetupEmojiSections):
(webkitEmojiChooserConstructed):

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

6 days ago[GLIB] Repeating timer is not stopped when stop is called from the callback
carlosgc@webkit.org [Mon, 20 May 2019 08:10:57 +0000 (08:10 +0000)]
[GLIB] Repeating timer is not stopped when stop is called from the callback
https://bugs.webkit.org/show_bug.cgi?id=197986

Reviewed by Michael Catanzaro.

Source/WTF:

In case of repeating timers we always update the ready time to fire interval after the user callback is called.

* wtf/glib/RunLoopGLib.cpp:
(WTF::RunLoop::TimerBase::stop): Reset m_fireInterval and m_isRepeating.

Tools:

Check the timer is no longer active after it has been stopped.

* TestWebKitAPI/Tests/WTF/RunLoop.cpp:
(TestWebKitAPI::TEST):

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

6 days agoAdd support for %pid in dumpJITMemoryPath
tzagallo@apple.com [Mon, 20 May 2019 06:08:47 +0000 (06:08 +0000)]
Add support for %pid in dumpJITMemoryPath
https://bugs.webkit.org/show_bug.cgi?id=198026

Reviewed by Saam Barati.

This is necessary when using dumpJITMemory with Safari. Otherwise, multiple WebContent
processes will try to write to the same file at the same time, which will crash since
the file is open with exclusive locking.

* jit/ExecutableAllocator.cpp:
(JSC::dumpJITMemory):

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

6 days agoUnreviewed build fix after r245508.
bfulgham@apple.com [Mon, 20 May 2019 03:40:24 +0000 (03:40 +0000)]
Unreviewed build fix after r245508.

* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: Don't use
an 'import' directive in a C++ file.

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

6 days agoWait to get frame until after layout has been run
bfulgham@apple.com [Mon, 20 May 2019 03:15:30 +0000 (03:15 +0000)]
Wait to get frame until after layout has been run
https://bugs.webkit.org/show_bug.cgi?id=197999
<rdar://problem/50800345>

Reviewed by Alex Christensen.

Source/WebCore:

The current frame can change when layout runs, so don't bother retrieving
the frame until the final layout pass is complete.

Test: fast/dom/window-inner-width-crash.html

* page/DOMWindow.cpp:
(WebCore::DOMWindow::innerHeight const): Move frame access past the
layout operation.
(WebCore::DOMWindow::innerWidth const): Ditto.
(WebCore::DOMWindow::scrollX const): Ditto.
(WebCore::DOMWindow::scrollY const): Ditto.

LayoutTests:

* fast/dom/window-inner-width-crash-expected.txt: Added.
* fast/dom/window-inner-width-crash.html: Added.

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

6 days agoUnreviewed build fix
bfulgham@apple.com [Mon, 20 May 2019 00:48:59 +0000 (00:48 +0000)]
Unreviewed build fix

Attempting to build with only Open Source sources on shipping software with
ASan enabled triggers build failures due to missing includes. This patch adds
the necessary includes to cleanly build WebCore.

* Modules/applepay/ApplePaySession.cpp:
* Modules/applepay/PaymentSession.cpp:
* Modules/mediastream/UserMediaController.cpp:
* bindings/js/ScriptController.cpp:
* contentextensions/ContentExtensionsBackend.cpp:
* dom/Document.cpp:
* dom/ScriptedAnimationController.cpp:
* editing/cocoa/EditorCocoa.mm:
* editing/cocoa/HTMLConverter.mm:
* editing/cocoa/WebContentReaderCocoa.mm:
* editing/markup.cpp:
* history/CachedFrame.cpp:
* html/HTMLDocument.cpp:
* html/HTMLHtmlElement.cpp:
* html/HTMLMediaElement.cpp:
* html/ImageDocument.cpp:
* html/MediaDocument.cpp:
* html/PluginDocument.cpp:
* html/parser/HTMLDocumentParser.cpp:
* html/parser/XSSAuditor.cpp:
* inspector/InspectorInstrumentation.cpp:
* inspector/agents/InspectorApplicationCacheAgent.cpp:
* inspector/agents/InspectorNetworkAgent.cpp:
* inspector/agents/InspectorPageAgent.cpp:
* inspector/agents/page/PageNetworkAgent.cpp:
* loader/ApplicationManifestLoader.cpp:
* loader/FrameLoader.cpp:
* loader/LoadTiming.cpp:
* loader/NetscapePlugInStreamLoader.cpp:
* loader/ResourceLoader.cpp:
* loader/SubresourceLoader.cpp:
* loader/appcache/ApplicationCacheHost.cpp:
* loader/archive/cf/LegacyWebArchive.cpp:
* loader/icon/IconLoader.cpp:
* page/ContextMenuController.cpp:
* page/FrameView.cpp:
* page/Page.cpp:
* page/Performance.cpp:
* page/PerformanceNavigation.cpp:
* page/Quirks.cpp:
* page/UserContentProvider.cpp:
* page/csp/ContentSecurityPolicy.cpp:
* page/mac/PageMac.mm:
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
* svg/graphics/SVGImage.cpp:
* testing/Internals.cpp:

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

6 days ago[Pointer Events] Listening to a "pointerover", "pointerenter", "pointerout" or "point...
graouts@webkit.org [Sun, 19 May 2019 21:43:58 +0000 (21:43 +0000)]
[Pointer Events] Listening to a "pointerover", "pointerenter", "pointerout" or "pointerleave" event alone does not fire the event on iOS
https://bugs.webkit.org/show_bug.cgi?id=197882
<rdar://problem/50769116>

Reviewed by Dean Jackson.

Source/WebCore:

Tests: pointerevents/ios/pointerenter-alone.html
       pointerevents/ios/pointerleave-alone.html
       pointerevents/ios/pointerout-alone.html
       pointerevents/ios/pointerover-alone.html

* dom/EventNames.h:
(WebCore::EventNames::isTouchRelatedEventType const):
(WebCore::EventNames::touchRelatedEventNames const):
(WebCore::EventNames::extendedTouchRelatedEventNames const):

Source/WebKit:

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::updateTouchEventTracking):

LayoutTests:

Add new tests that check that adding a "pointerover", "pointerenter", "pointerout" or "pointerleave" event listener alone dispatches the
event as expected.

* pointerevents/ios/pointerenter-alone-expected.txt: Added.
* pointerevents/ios/pointerenter-alone.html: Added.
* pointerevents/ios/pointerleave-alone-expected.txt: Added.
* pointerevents/ios/pointerleave-alone.html: Added.
* pointerevents/ios/pointerout-alone-expected.txt: Added.
* pointerevents/ios/pointerout-alone.html: Added.
* pointerevents/ios/pointerover-alone-expected.txt: Added.
* pointerevents/ios/pointerover-alone.html: Added.

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

6 days ago[Pointer Events] The pointerup, pointerout and pointerleave events may be fired twice
graouts@webkit.org [Sun, 19 May 2019 21:37:44 +0000 (21:37 +0000)]
[Pointer Events] The pointerup, pointerout and pointerleave events may be fired twice
https://bugs.webkit.org/show_bug.cgi?id=198028
<rdar://problem/50769425>

Reviewed by Dean Jackson.

Add a new test that checks that we're firing a "pointermove" event when the touch pressure
changes, even when the touch is stationary, and that a single "pointerup" event is fired
as the touch ends and the pressure changes. The relevant code change is done in WebKitAdditions.

* pointerevents/ios/pressure-change-expected.txt: Added.
* pointerevents/ios/pressure-change.html: Added.
* pointerevents/utils.js:
(prototype._handlePointerEvent):
(prototype.stationary):
(prototype._action):

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

6 days ago[Pointer Events] A pointer should be marked as primary for all of its events
graouts@webkit.org [Sun, 19 May 2019 21:34:24 +0000 (21:34 +0000)]
[Pointer Events] A pointer should be marked as primary for all of its events
https://bugs.webkit.org/show_bug.cgi?id=197909
<rdar://problem/50801608>

Reviewed by Dean Jackson.

Source/WebCore:

Add an ivar for EventHandler which we'll use in WebKitAdditions code to track the touch identifier
of the very first touch to start in a given sequence.

* page/EventHandler.h:

LayoutTests:

Update tests to match expectations that only the first touch of a sequence is the primary pointer,
which applies to all of its events, even after the even is no longer touching the digitizer.

* pointerevents/ios/over-enter-out-leave.html:
* pointerevents/ios/pointer-event-order.html:
* pointerevents/ios/pointer-events-implicit-capture.html:
* pointerevents/ios/pointer-events-is-primary-expected.txt:
* pointerevents/ios/pointer-events-is-primary.html:

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

7 days agoChange String::number to use "shortest" instead of "fixed precision 6 digits"
darin@apple.com [Sun, 19 May 2019 18:17:40 +0000 (18:17 +0000)]
Change String::number to use "shortest" instead of "fixed precision 6 digits"
https://bugs.webkit.org/show_bug.cgi?id=178319

Reviewed by Sam Weinig.

Source/WebCore:

* accessibility/atk/WebKitAccessibleInterfaceValue.cpp:
(webkitAccessibleSetNewValue): Use String::numberToStringFixedPrecision
instead of String::number to be explicit about the fact that it's fixed precision.
* page/linux/ResourceUsageOverlayLinux.cpp:
(gcTimerString): Ditto.

* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(printTransform): Use appendFixedPrecisionNumber instead of appendNumber
to be explicit about the fact that it's fixed precision.
(printLayer): Ditto.
(WebCore::PlatformCALayerWin::layerTreeAsString const): Ditto.
* platform/graphics/freetype/FontCacheFreeType.cpp:
(buildVariationSettings): Ditto.

* svg/SVGNumberList.h: Use appendFixedPrecisionNumber instead of appendNumber
to be explicit about the fact that it's fixed precision. We'll consider moving
to shortest later.

* svg/SVGPathUtilities.cpp:
(WebCore::buildStringFromPath): Use appendNumberShortest instead of
appendNumberECMAScript since these are single-precision.

* svg/SVGPointList.h: Use appendFixedPrecisionNumber instead of appendNumber
to be explicit about the fact that it's fixed precision. We'll consider moving
to shortest later.
* svg/SVGTransformValue.h: Ditto.

Source/WTF:

* wtf/text/StringBuilder.h: Delete appendNumber for floating point and
appendECMAScriptNumber for single-precision.

* wtf/text/WTFString.h: Delete String::number for floating point and
numberToStringECMAScript for single-precision.

Tools:

* TestWebKitAPI/Tests/WTF/WTFString.cpp:
(TestWebKitAPI::testStringNumberFixedPrecision): Use String::numberToStringFixedPrecision.

* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(attributesOfElement): Use appendFixedPrecisionNumber.

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

7 days agoWeb Inspector: Decrease spacing before and after tooltip paragraphs
nvasilyev@apple.com [Sun, 19 May 2019 17:12:04 +0000 (17:12 +0000)]
Web Inspector: Decrease spacing before and after tooltip paragraphs
https://bugs.webkit.org/show_bug.cgi?id=198024

Reviewed by Joseph Pecoraro.

* UserInterface/Views/Popover.css:
(.popover p): Added.
(.popover p + p): Added.

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

7 days agoLayers painting into shared backing need to contribute to overlap
simon.fraser@apple.com [Sun, 19 May 2019 14:01:15 +0000 (14:01 +0000)]
Layers painting into shared backing need to contribute to overlap
https://bugs.webkit.org/show_bug.cgi?id=198021

Reviewed by Zalan Bujtas.
Source/WebCore:

Layers that paint into a composited (non-root) layer get added to the overlap map so
that later layers correct overlap them; this is done via the test against currentState.compositingAncestor.

We need the same logic for layers that paint into shared backing; they need to behave
the same way in terms of how they contribute to overlap. We already had currentState.backingSharingAncestor
which was unused, but now use it for this, and correctly null it out when a layer composites.

Bug was noticed during testing, and not known to affect any websites (though it probably does).

Also move the overlap container popping into updateOverlapMap() so the two callers can
share the code, and more explicitly track whether a container was pushed.

Test: compositing/shared-backing/sharing-child-contributes-to-overlap.html

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
(WebCore::RenderLayerCompositor::updateOverlapMap const):
* rendering/RenderLayerCompositor.h:

LayoutTests:

* compositing/shared-backing/sharing-child-contributes-to-overlap-expected.html: Added.
* compositing/shared-backing/sharing-child-contributes-to-overlap.html: Added.

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

7 days agoRevert r240956
commit-queue@webkit.org [Sun, 19 May 2019 07:46:45 +0000 (07:46 +0000)]
Revert r240956
https://bugs.webkit.org/show_bug.cgi?id=198007
<rdar://problem/49808949>

Patch by Alex Christensen <achristensen@webkit.org> on 2019-05-19
Reviewed by Alexey Proskuryakov.

r240956 made SafariForWebKitDevelopment crash when using WebKit nightly builds.
Since it's not needed and the binary reduction wasn't too big, just revert that revision.

* Shared/API/Cocoa/WKMain.h: Removed.
* Shared/API/Cocoa/WKMain.mm: Removed.
* Shared/EntryPointUtilities/Cocoa/AuxiliaryProcessMain.cpp: Removed.
* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
(main):
* SourcesCocoa.txt:
* WebKit.xcodeproj/project.pbxproj:

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

7 days ago[WebAuthN] Allow authenticators that support both CTAP and U2F to try U2F if CTAP...
jiewen_tan@apple.com [Sun, 19 May 2019 00:42:16 +0000 (00:42 +0000)]
[WebAuthN] Allow authenticators that support both CTAP and U2F to try U2F if CTAP fails in authenticatorGetAssertion
https://bugs.webkit.org/show_bug.cgi?id=197974
<rdar://problem/50879746>

Reviewed by Brent Fulgham.

Source/WebKit:

Authenticators that support both CTAP and U2F protocols can be used in a U2F enabled browser to create a credential in
U2F format. When such authenticator is used to login in WebKit, it will be treated as a CTAP authenticator. Since the
previous credential is in U2F format, the authenticator will not consider that as a valid credential when CTAP requests
come along for that U2F credential. Therefore the previous created U2F credential will not be asked at all, and users
will not be able to login. This situation is not well documented in the CTAP/WebAuthN spec yet.

To workaround the above issue, an authenticator that supports both protocols will be downgraded to a U2F authenticator
to ask a potential U2F credential once a valid error is returned regarding to the first CTAP request.

* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetWebAuthenticationMockConfiguration):
* UIProcess/WebAuthentication/Authenticator.h:
* UIProcess/WebAuthentication/AuthenticatorManager.cpp:
(WebKit::AuthenticatorManager::downgrade):
* UIProcess/WebAuthentication/AuthenticatorManager.h:
* UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
(WebKit::MockHidConnection::parseRequest):
(WebKit::MockHidConnection::feedReports):
* UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h:
* UIProcess/WebAuthentication/fido/CtapHidAuthenticator.cpp:
(WebKit::CtapHidAuthenticator::makeCredential):
(WebKit::CtapHidAuthenticator::getAssertion):
(WebKit::CtapHidAuthenticator::continueGetAssertionAfterResponseReceived):
(WebKit::CtapHidAuthenticator::tryDowngrade):
(WebKit::CtapHidAuthenticator::continueGetAssertionAfterResponseReceived const): Deleted.
* UIProcess/WebAuthentication/fido/CtapHidAuthenticator.h:

Tools:

Add a canDowngrade option for mock hid devices to simulate the situation.

* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setWebAuthenticationMockConfiguration):

LayoutTests:

* http/wpt/webauthn/public-key-credential-get-failure-hid-silent.https-expected.txt:
* http/wpt/webauthn/public-key-credential-get-failure-hid-silent.https.html:
* http/wpt/webauthn/public-key-credential-get-failure-hid.https-expected.txt:
* http/wpt/webauthn/public-key-credential-get-failure-hid.https.html:
* http/wpt/webauthn/public-key-credential-get-success-u2f.https-expected.txt:
* http/wpt/webauthn/public-key-credential-get-success-u2f.https.html:
* http/wpt/webauthn/resources/util.js:

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

8 days agoAdd extra information to dumpJITMemory
tzagallo@apple.com [Sat, 18 May 2019 07:12:17 +0000 (07:12 +0000)]
Add extra information to dumpJITMemory
https://bugs.webkit.org/show_bug.cgi?id=197998

Reviewed by Saam Barati.

Source/JavaScriptCore:

Add ktrace events around the memory dump and mach_absolute_time to link the
events with the entries in the dump. Additionally, add a background queue
to flush on a configurable interval, since the atexit callback does not work
in every situation.

* jit/ExecutableAllocator.cpp:
(JSC::dumpJITMemory):
* runtime/Options.h:

Source/WTF:

Add a new trace point code for JSC::dumpJITMemory

* wtf/SystemTracing.h:

Tools:

Add description for the new dumpJITMemory trace point code.

* Tracing/SystemTracePoints.plist:

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

8 days agoWeb Inspector: Timelines: CPU/memory timeline bars sometimes don't draw correctly...
drousso@apple.com [Sat, 18 May 2019 05:27:06 +0000 (05:27 +0000)]
Web Inspector: Timelines: CPU/memory timeline bars sometimes don't draw correctly and jump around on scrolling
https://bugs.webkit.org/show_bug.cgi?id=197440
<rdar://problem/46886315>

Reviewed by Joseph Pecoraro.

When drawing the Memory/CPU graphs, we need to know about the record immediately before/after
what's overlapping the visible range so that the graph correctly slopes off the screen.

* UserInterface/Models/Timeline.js:
(WI.Timeline.prototype.recordsInTimeRange):
(WI.Timeline.prototype.recordsOverlappingTimeRange): Deleted.
Merge `recordsOverlappingTimeRange` into `recordsInTimeRange` by accepting an options object
that determines whether to include the record before/after the first/last record that are
at all overlapping the range.

* UserInterface/Models/CPUTimelineRecord.js:
(WI.CPUTimelineRecord):
(WI.CPUTimelineRecord.get samplingRatePerSecond): Added.
(WI.CPUTimelineRecord.prototype.adjustStartTimeToLastRecord): Added.
* UserInterface/Models/MemoryTimelineRecord.js:
(WI.MemoryTimelineRecord):
(WI.MemoryTimelineRecord.get samplingRatePerSecond): Added.
(WI.MemoryTimelineRecord.prototype.adjustStartTimeToLastRecord): Added.
Adjust the `startTime` of the record by the sampling rate (which is 500ms).

* UserInterface/Models/CPUTimeline.js: Added.
(WI.CPUTimeline.prototype.addRecord):
* UserInterface/Models/MemoryTimeline.js:
(WI.MemoryTimeline.prototype.addRecord): Added.
Adjust the `startTime` of the new record to be equal to the `endTime` of the last record.

* UserInterface/Views/TimelineOverview.js:
(WI.TimelineOverview.prototype._recordSelected):
* UserInterface/Views/CPUTimelineView.js:
(WI.CPUTimelineView.prototype.layout):
(WI.CPUTimelineView.prototype._computeStatisticsData):
(WI.CPUTimelineView.prototype._attemptSelectIndicatatorTimelineRecord):
* UserInterface/Views/CPUTimelineOverviewGraph.js:
(WI.CPUTimelineOverviewGraph.prototype.layout):
(WI.CPUTimelineOverviewGraph.prototype._handleChartClick):
(WI.CPUTimelineOverviewGraph.prototype.get samplingRatePerSecond): Deleted.
(WI.CPUTimelineOverviewGraph.prototype.layout.yScaleForRecord): Deleted.

* UserInterface/Views/MemoryTimelineView.js:
(WI.MemoryTimelineView.prototype.layout):
* UserInterface/Views/MemoryTimelineOverviewGraph.js:
(WI.MemoryTimelineOverviewGraph.prototype.layout):

* UserInterface/Main.html:
* UserInterface/Test.html:

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

8 days agoWeb Inspector: Audit: make it easier to jump to any returned DOM node in the Elements tab
drousso@apple.com [Sat, 18 May 2019 05:10:30 +0000 (05:10 +0000)]
Web Inspector: Audit: make it easier to jump to any returned DOM node in the Elements tab
https://bugs.webkit.org/show_bug.cgi?id=197470
<rdar://problem/50466774>

Reviewed by Joseph Pecoraro.

Right now, the only way to jump to the Elements tab for any DOM nodes returned by an audit
is to context menu and "Reveal in DOM Tree". Providing a more visible/discoverable way to
jump to the Elements tab will help developers diagnose issues easier.

* UserInterface/Views/AuditTestCaseContentView.js:
(WI.AuditTestCaseContentView.prototype.layout):
* UserInterface/Views/AuditTestCaseContentView.css:
(.content-view.audit-test-case > section table):

* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement):
(WI.DOMTreeElement.prototype.set showGoToArrow): Added.
(WI.DOMTreeElement.prototype._buildTagDOM):
(WI.DOMTreeElement.prototype._nodeTitleInfo):
Provide a way to insert a go-to arrow right after the:
 - open tag, if the close tag is rendered on a separate line
 - close tag, if the close tag is rendered on the same line

* UserInterface/Views/DOMTreeOutline.js:
(WI.DOMTreeOutline):
Allow `DOMTreeOutline` to be non-selectable.

* UserInterface/Views/DOMTreeOutline.css:
(.tree-outline.dom:not(.non-selectable):focus li:matches(.selected, .hovered) .selection-area): Added.
(.tree-outline.dom:not(.non-selectable) li.hovered:not(.selected) .selection-area): Added.
(.tree-outline.dom li .html-tag ~ .go-to-arrow): Added.
(.tree-outline.dom li:not(.hovered) .html-tag ~ .go-to-arrow): Added.
(.tree-outline.dom:focus li:matches(.selected, .hovered) .selection-area): Deleted.
(.tree-outline.dom li.hovered:not(.selected) .selection-area): Deleted.
Ensure that hovering a non-selectable node doesn't change the background color.

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

8 days ago[WASM-References] Add support for Anyref in parameters and return types, Ref.null...
justin_michaud@apple.com [Sat, 18 May 2019 04:58:36 +0000 (04:58 +0000)]
[WASM-References] Add support for Anyref in parameters and return types, Ref.null and Ref.is_null for Anyref values.
https://bugs.webkit.org/show_bug.cgi?id=197969

JSTests:

Reviewed by Keith Miller.

Support the anyref type in Builder.js, plus add some extra error logging.
Add new folder for wasm references tests.

* wasm.yaml:
* wasm/Builder.js:
(const._isValidValue):
* wasm/references/anyref_modules.js: Added.
(Call.3.RefIsNull.End.End.WebAssembly.js.ident):
(Call.3.RefIsNull.End.End.WebAssembly.js.make_null):
(Call.3.RefIsNull.End.End.WebAssembly):
(undefined):
* wasm/references/is_null.js: Added.
* wasm/references/is_null_error.js: Added.
* wasm/spec-harness/index.js:
* wasm/wasm.json:

Source/JavaScriptCore:

Reviewed by Keith Miller.

Add a new runtime option for wasm references.
Add support for Anyref as a value type.
Add support for Anyref in parameters and return types of Wasm functions. JSValues are marshalled into/out of wasm Anyrefs
        as a black box, except null which becomes a Nullref value. Nullref is not expressible in the bytecode or in the js API.
Add Ref.null and Ref.is_null for Anyref values. Support for these functions with funcrefs is out of scope.

* runtime/Options.h:
* wasm/WasmAirIRGenerator.cpp:
(JSC::Wasm::AirIRGenerator::tmpForType):
(JSC::Wasm::AirIRGenerator::AirIRGenerator):
(JSC::Wasm::AirIRGenerator::addConstant):
(JSC::Wasm::AirIRGenerator::addRefIsNull):
(JSC::Wasm::AirIRGenerator::addReturn):
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::addRefIsNull):
* wasm/WasmCallingConvention.h:
(JSC::Wasm::CallingConventionAir::marshallArgument const):
(JSC::Wasm::CallingConventionAir::setupCall const):
* wasm/WasmFormat.h:
(JSC::Wasm::isValueType):
* wasm/WasmFunctionParser.h:
(JSC::Wasm::FunctionParser<Context>::FunctionParser):
(JSC::Wasm::FunctionParser<Context>::parseExpression):
(JSC::Wasm::FunctionParser<Context>::parseUnreachableExpression):
* wasm/WasmValidate.cpp:
(JSC::Wasm::Validate::addRefIsNull):
* wasm/generateWasmOpsHeader.py:
(bitSet):
* wasm/js/JSToWasm.cpp:
(JSC::Wasm::createJSToWasmWrapper):
* wasm/js/WasmToJS.cpp:
(JSC::Wasm::wasmToJS):
* wasm/js/WebAssemblyFunction.cpp:
(JSC::callWebAssemblyFunction):
(JSC::WebAssemblyFunction::jsCallEntrypointSlow):
* wasm/wasm.json:

Tools:

Run wasm tests additionally with wasmBBQUsesAir=0.

Reviewed by Keith Miller.

* Scripts/run-jsc-stress-tests:

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

8 days agoWeb Inspector: Elements: context menu items in DOM tree should work when not clicking...
drousso@apple.com [Sat, 18 May 2019 04:44:34 +0000 (04:44 +0000)]
Web Inspector: Elements: context menu items in DOM tree should work when not clicking directly on the node representation
https://bugs.webkit.org/show_bug.cgi?id=197541

Reviewed by Timothy Hatcher.

* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype.populateDOMNodeContextMenu): Added.
(WI.DOMTreeElement.prototype._populateTagContextMenu): Deleted.
(WI.DOMTreeElement.prototype._populateTextContextMenu): Deleted.
(WI.DOMTreeElement.prototype._populateNodeContextMenu): Deleted.
* UserInterface/Views/DOMTreeOutline.js:
(WI.DOMTreeOutline.prototype.populateContextMenu):
* UserInterface/Views/ContextMenuUtilities.js:
(WI.appendContextMenuItemsForDOMNode):

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

8 days agoImplement CSS `display: flow-root` (modern clearfix)
commit-queue@webkit.org [Sat, 18 May 2019 04:29:48 +0000 (04:29 +0000)]
Implement CSS `display: flow-root` (modern clearfix)
https://bugs.webkit.org/show_bug.cgi?id=165603

Patch by Joonghun Park <pjh0718@gmail.com> on 2019-05-17
Reviewed by Zalan Bujtas.

This change follows https://drafts.csswg.org/css-display-3/#valdef-display-flow-root as below.

'display: flow-root' generates a block container box, and lays out its contents using flow layout.
It always establishes a new block formatting context for its contents.

Source/WebCore:

* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
* css/CSSValueKeywords.in:
* css/StyleResolver.cpp:
(WebCore::equivalentBlockDisplay):
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::createsNewFormattingContext const):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::createFor):
* rendering/style/RenderStyleConstants.h:

Source/WebInspectorUI:

* UserInterface/External/CodeMirror/css.js:

LayoutTests:

* TestExpectations:

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

8 days ago[CMake] Use builtin FindICU
don.olmstead@sony.com [Sat, 18 May 2019 02:38:38 +0000 (02:38 +0000)]
[CMake] Use builtin FindICU
https://bugs.webkit.org/show_bug.cgi?id=197934

Reviewed by Michael Catanzaro.

.:

Update CMake minimum required to 3.7. 3.7 has a FindICU module so the WebKit one
is removed. For non-Apple ports this just requires adding individual components of
ICU to find_package(ICU). For Apple ports the module does not work so the targets
created in FindICU are mirrored in target/icu.cmake.

* CMakeLists.txt:
* Source/cmake/FindICU.cmake: Removed.
* Source/cmake/OptionsAppleWin.cmake:
* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsJSCOnly.cmake:
* Source/cmake/OptionsMac.cmake:
* Source/cmake/OptionsPlayStation.cmake:
* Source/cmake/OptionsWPE.cmake:
* Source/cmake/OptionsWin.cmake:
* Source/cmake/OptionsWinCairo.cmake:
* Source/cmake/target/icu.cmake: Added.

Source/JavaScriptCore:

Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES.

* CMakeLists.txt:
* PlatformWin.cmake:

Source/WebCore:

Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES.

* CMakeLists.txt:
* PlatformPlayStation.cmake:
* PlatformWPE.cmake:

Source/WebCore/PAL:

Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES.

* pal/CMakeLists.txt:

Source/WebDriver:

Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES.

* PlatformWPE.cmake:

Source/WebKit:

Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES.

* CMakeLists.txt:

Source/WebKitLegacy:

Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES.

* CMakeLists.txt:
* PlatformWin.cmake:

Source/WTF:

Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES. Use ICU:: targets which end
up propagating to all consumers of WTF.

* wtf/CMakeLists.txt:
* wtf/PlatformPlayStation.cmake:

Tools:

Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES.

* TestWebKitAPI/PlatformMac.cmake:
* TestWebKitAPI/PlatformPlayStation.cmake:
* TestWebKitAPI/PlatformWin.cmake:
* WebKitTestRunner/CMakeLists.txt:

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

8 days agoEnable legacy EME for iOS WKWebView
commit-queue@webkit.org [Sat, 18 May 2019 02:12:13 +0000 (02:12 +0000)]
Enable legacy EME for iOS WKWebView
https://bugs.webkit.org/show_bug.cgi?id=197964
<rdar://problem/50625666>

Patch by Alex Christensen <achristensen@webkit.org> on 2019-05-17
Reviewed by Wenson Hsieh.

Source/WebCore:

This was attempted unsuccessfully in r230169.
Verified manually that it works as desired.

* page/RuntimeEnabledFeatures.h:

Source/WebKit:

* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]):

Tools:

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

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

8 days agoREGRESSION (r245170): gmail.com inbox table header flickers
simon.fraser@apple.com [Sat, 18 May 2019 01:32:03 +0000 (01:32 +0000)]
REGRESSION (r245170): gmail.com inbox table header flickers
https://bugs.webkit.org/show_bug.cgi?id=198005
<rdar://problem/50907718>

Reviewed by Antti Koivisto.

Source/WebCore:

When a layer started as painting into shared backing, but then became independently
composited (e.g. by having to clip composited children), it wouldn't have the "overlap"
indirect compositing reason. This allowed requiresOwnBackingStore() to say that it
could paint into some ancestor, but this breaks overlap. So in this code path,
put IndirectCompositingReason::Overlap back on the layer which restores the previous
behavior.

Make some logging changes to help diagnose things like this.

Test: compositing/shared-backing/overlap-after-end-sharing.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects const):
(WebCore::outputPaintOrderTreeLegend):
(WebCore::outputPaintOrderTreeRecursive):
* rendering/RenderLayer.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::updateBacking):
(WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
(WebCore::RenderLayerCompositor::reasonsForCompositing const):
(WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
* rendering/RenderLayerCompositor.h:

LayoutTests:

* compositing/shared-backing/overlap-after-end-sharing-expected.html: Added.
* compositing/shared-backing/overlap-after-end-sharing.html: Added.

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

8 days ago[ews-build] Add clickable url in UI for uploaded S3 archive
aakash_jain@apple.com [Fri, 17 May 2019 23:45:38 +0000 (23:45 +0000)]
[ews-build] Add clickable url in UI for uploaded S3 archive
https://bugs.webkit.org/show_bug.cgi?id=197996

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/steps.py:

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

8 days agoASSERTION FAILED: !m_backingStore in WebCore::IDBServer::UniqueIDBDatabase::didDelete...
sihui_liu@apple.com [Fri, 17 May 2019 23:44:23 +0000 (23:44 +0000)]
ASSERTION FAILED: !m_backingStore in WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore(uint64_t)
https://bugs.webkit.org/show_bug.cgi?id=197741
<rdar://problem/50625006>

Reviewed by Youenn Fablet.

If an open request is made before a delete request, open task should be performed before delete task on the
database thread. After r242911, open request needs to wait decision of StorageQuotaManager before posting task
to database thread, while delete request needs not. This makes deletion happen before open.

We need to make sure tasks are in correct order by not starting next open or delete request when database is in
the middle of open or deletion.

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation):
(WebCore::IDBServer::UniqueIDBDatabase::handleDatabaseOperations):

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

8 days ago[ews-app] Status bubble should not turn orange when any build step has warnings
aakash_jain@apple.com [Fri, 17 May 2019 23:41:47 +0000 (23:41 +0000)]
[ews-app] Status bubble should not turn orange when any build step has warnings
https://bugs.webkit.org/show_bug.cgi?id=198000

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-app/ews/views/statusbubble.py:
(StatusBubble._does_build_contains_any_failed_step):

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

8 days agoREGRESSION(r244350): Web Inspector: Storage tab data grids aren't editable.
ross.kirsling@sony.com [Fri, 17 May 2019 23:11:02 +0000 (23:11 +0000)]
REGRESSION(r244350): Web Inspector: Storage tab data grids aren't editable.
https://bugs.webkit.org/show_bug.cgi?id=198003

Reviewed by Devin Rousso.

* UserInterface/Views/DOMStorageContentView.js:
(WI.DOMStorageContentView):
Fix typo.

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

8 days agoWeb Inspector: Dark Mode: Fix colors in network table waterfall container
commit-queue@webkit.org [Fri, 17 May 2019 23:07:21 +0000 (23:07 +0000)]
Web Inspector: Dark Mode: Fix colors in network table waterfall container
https://bugs.webkit.org/show_bug.cgi?id=197955

Patch by Jamal Nasser <jamaln@mail.com> on 2019-05-17
Reviewed by Devin Rousso.

* UserInterface/Views/NetworkTableContentView.css:
(.network-table :not(.header) .cell.waterfall .waterfall-container > .dom-event):
(.network-table :not(.header) .cell.waterfall .waterfall-container > .dom-activity):
(.network-table :not(.header) .cell.waterfall .waterfall-container > .area.dom-fullscreen):

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

8 days agoAdd a website policy to disable the legacy -webkit-overflow-scrolling:touch behavior
graouts@webkit.org [Fri, 17 May 2019 22:05:07 +0000 (22:05 +0000)]
Add a website policy to disable the legacy -webkit-overflow-scrolling:touch behavior
https://bugs.webkit.org/show_bug.cgi?id=197943
<rdar://problem/49078202>

Reviewed by Brent Fulgham.

Source/WebCore:

Tests: fast/scrolling/ipad/overflow-scrolling-touch-enabled-stacking-modern-compatibility-mode.html
       platform/ipad/fast/css/webkit-overflow-scrolling-parsing-modern-compatibility-mode.html

* css/parser/CSSParserContext.cpp:
(WebCore::CSSParserContext::CSSParserContext):
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::legacyOverflowScrollingTouchPolicy const):
(WebCore::DocumentLoader::setLegacyOverflowScrollingTouchPolicy):

Source/WebKit:

* Shared/WebsiteLegacyOverflowScrollingTouchPolicy.h: Added.
* Shared/WebsitePoliciesData.cpp:
(WebKit::WebsitePoliciesData::encode const):
(WebKit::WebsitePoliciesData::decode):
(WebKit::WebsitePoliciesData::applyToDocumentLoader):
* Shared/WebsitePoliciesData.h:
* UIProcess/API/APIWebsitePolicies.cpp:
(API::WebsitePolicies::copy const):
(API::WebsitePolicies::data):
* UIProcess/API/APIWebsitePolicies.h:
* WebKit.xcodeproj/project.pbxproj:

LayoutTests:

* fast/scrolling/ipad/overflow-scrolling-touch-enabled-stacking-modern-compatibility-mode-expected.html: Added.
* fast/scrolling/ipad/overflow-scrolling-touch-enabled-stacking-modern-compatibility-mode.html: Added.
* platform/ipad/fast/css/webkit-overflow-scrolling-parsing-modern-compatibility-mode-expected.txt: Added.
* platform/ipad/fast/css/webkit-overflow-scrolling-parsing-modern-compatibility-mode.html: Added.
* platform/ios/TestExpectations: Skip the new tests since they depend on code in WebKitAdditions.

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

8 days agoUnreviewed test gardening for macOS.
ryanhaddad@apple.com [Fri, 17 May 2019 21:55:11 +0000 (21:55 +0000)]
Unreviewed test gardening for macOS.

* platform/mac/TestExpectations: Land test expectations for rdar://problem/46000736.

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