WebKit-https.git
2 years ago[WebIDL] PutForwards is not implemented to spec as illustrated by the WPT WebIDL...
weinig@apple.com [Wed, 7 Jun 2017 18:57:26 +0000 (18:57 +0000)]
[WebIDL] PutForwards is not implemented to spec as illustrated by the WPT WebIDL/ecmascript-binding/put-forwards.html
https://bugs.webkit.org/show_bug.cgi?id=172956

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

Update results to show we now implement [PutForwards] correctly.

* web-platform-tests/WebIDL/ecmascript-binding/put-forwards-expected.txt:

Source/WebCore:

Implements step 3.5.9 of https://heycam.github.io/webidl/#dfn-attribute-setter.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateAttributeSetterDefinition):
Implement [PutForwards] to spec, which involves using JSC get/set rather than calling
directly into the implementation.

* bindings/scripts/test/JS/JSTestCEReactions.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
Update test results.

LayoutTests:

* http/tests/security/xss-DENIED-contentWindow-eval-expected.txt:
Update results to show that we now throw a type error, because the action now requires
an explicit get of the location object, which does not work in the context.

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

2 years ago[CMake] Only force response files for Ninja with CMake < 3.2 on Linux
commit-queue@webkit.org [Wed, 7 Jun 2017 18:41:09 +0000 (18:41 +0000)]
[CMake] Only force response files for Ninja with CMake < 3.2 on Linux
https://bugs.webkit.org/show_bug.cgi?id=173066

Patch by Loïc Yhuel <loic.yhuel@softathome.com> on 2017-06-07
Reviewed by Michael Catanzaro.

CMake automatically uses response files when needed, but the limit was
wrong on Linux before 3.2.

* Source/cmake/OptionsCommon.cmake:

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

2 years agoClean-up: RenderElement.h includes headers it doesn't use
jer.noble@apple.com [Wed, 7 Jun 2017 17:44:45 +0000 (17:44 +0000)]
Clean-up: RenderElement.h includes headers it doesn't use
https://bugs.webkit.org/show_bug.cgi?id=173046

Reviewed by Andy Estes.

Source/WebCore:

Remove a couple of unneeded includes from RenderElement.h, and then clean up all the
follow-on compile errors that causes. Mostly, these errors are fixed by including the
correct headers at the point of use; otherwise, they're solved by forward-declaring types
and in one case by moving default constructors implementation to the cpp file from the header.

* css/parser/SizesAttributeParser.cpp:
* editing/cocoa/EditorCocoa.mm:
* platform/mac/PasteboardMac.mm:
* rendering/InlineIterator.h:
(WebCore::embedCharFromDirection):
* rendering/RenderBoxModelObject.h:
* rendering/RenderElement.cpp:
* rendering/RenderElement.h:
* rendering/RenderIterator.h:
* rendering/RenderLineBreak.cpp:
* rendering/RenderQuote.cpp:
* rendering/RenderText.h:
* rendering/SimpleLineLayoutPagination.cpp:
* rendering/SimpleLineLayoutTextFragmentIterator.cpp:
* rendering/TextAutoSizing.cpp:
* rendering/style/RenderStyle.cpp:
* rendering/style/RenderStyle.h:
* style/RenderTreeUpdater.cpp:
* style/StyleResolveForDocument.cpp:
* style/StyleTreeResolver.cpp:

Source/WebKit/mac:

* WebView/WebImmediateActionController.mm:

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

2 years agoRebaseline and enable media/modern-media-controls/controls-visibility-support
graouts@webkit.org [Wed, 7 Jun 2017 17:40:43 +0000 (17:40 +0000)]
Rebaseline and enable media/modern-media-controls/controls-visibility-support
https://bugs.webkit.org/show_bug.cgi?id=173060
<rdar://problem/32616840>

Reviewed by Eric Carlson.

We only check the "visible" property on the MediaControls instance which is the only thing being
set by this class now. We also fix entering fullscreen by not using a <button> element which has
some default styles set by the Button class. Finally, we make some videoTracks.length assertions
asynchronous to avoid timing issues.

* media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-off-audio-expected.txt:
* media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-off-audio.html:
* media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-off-expected.txt:
* media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-off.html:
* media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-on-audio-expected.txt:
* media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-on-audio.html:
* media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-on-expected.txt:
* media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-on.html:
* media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-toggle-expected.txt:
* media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-toggle.html:
* media/modern-media-controls/controls-visibility-support/controls-visibility-support-fullscreen-on-parent-element-expected.txt:
* media/modern-media-controls/controls-visibility-support/controls-visibility-support-fullscreen-on-parent-element.html:
* media/modern-media-controls/controls-visibility-support/controls-visibility-support-fullscreen-on-video-expected.txt:
* media/modern-media-controls/controls-visibility-support/controls-visibility-support-fullscreen-on-video.html:

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

2 years agoRebaseline and enable media/modern-media-controls/buttons-container
graouts@webkit.org [Wed, 7 Jun 2017 17:37:58 +0000 (17:37 +0000)]
Rebaseline and enable media/modern-media-controls/buttons-container
https://bugs.webkit.org/show_bug.cgi?id=173059
<rdar://problem/32616156>

Reviewed by Eric Carlson.

The only change is the default margin for a ButtonsContainer.

* media/modern-media-controls/buttons-container/buttons-container-constructor-expected.txt:
* media/modern-media-controls/buttons-container/buttons-container-constructor.html:
* platform/ios-simulator/TestExpectations:
* platform/mac/TestExpectations:

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

2 years agoRebaseline and enable media/modern-media-controls/button
graouts@webkit.org [Wed, 7 Jun 2017 17:36:51 +0000 (17:36 +0000)]
Rebaseline and enable media/modern-media-controls/button
https://bugs.webkit.org/show_bug.cgi?id=173058
<rdar://problem/32615846>

Reviewed by Eric Carlson.

The IconButton class was removed and merged into its superclass Button, so we merge those tests
in a single directory. A couple tests no longer applied as we do not have a focused state for
buttons anymore, nor do we deal with changes in layout traits since there is no such thing as
a compact mode anymore.

* media/modern-media-controls/button/button-active-state-expected.txt: Added.
* media/modern-media-controls/button/button-active-state.html: Renamed from LayoutTests/media/modern-media-controls/icon-button/icon-button-active-state.html.
* media/modern-media-controls/button/button-icon-name-expected.txt: Added.
* media/modern-media-controls/button/button-icon-name.html: Added.
* media/modern-media-controls/button/button-on-expected.txt: Added.
* media/modern-media-controls/button/button-on.html: Renamed from LayoutTests/media/modern-media-controls/icon-button/icon-button-on.html.
* media/modern-media-controls/button/button.html:
* media/modern-media-controls/icon-button/icon-button-active-state-expected.txt: Removed.
* media/modern-media-controls/icon-button/icon-button-change-layout-traits-expected.txt: Removed.
* media/modern-media-controls/icon-button/icon-button-change-layout-traits.html: Removed.
* media/modern-media-controls/icon-button/icon-button-expected.txt: Removed.
* media/modern-media-controls/icon-button/icon-button-focus-state-expected.txt: Removed.
* media/modern-media-controls/icon-button/icon-button-focus-state.html: Removed.
* media/modern-media-controls/icon-button/icon-button-on-expected.txt: Removed.
* media/modern-media-controls/icon-button/icon-button.html: Removed.
* platform/ios-simulator/TestExpectations:
* platform/mac/TestExpectations:

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

2 years agoRemove TestExpectation for fast/backgrounds/background-repeat-x-y-parse.html.
ryanhaddad@apple.com [Wed, 7 Jun 2017 17:13:34 +0000 (17:13 +0000)]
Remove TestExpectation for fast/backgrounds/background-repeat-x-y-parse.html.
https://bugs.webkit.org/show_bug.cgi?id=167428

Unreviewed test gardening.

* TestExpectations:

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

2 years agoAdd WebRTC stats logging
commit-queue@webkit.org [Wed, 7 Jun 2017 16:55:09 +0000 (16:55 +0000)]
Add WebRTC stats logging
https://bugs.webkit.org/show_bug.cgi?id=173045

Patch by Youenn Fablet <youenn@apple.com> on 2017-06-07
Reviewed by Eric Carlson.

Source/ThirdParty/libwebrtc:

* Source/webrtc/api/stats/rtcstats.h: Exporting RTCStats ToString.

Source/WebCore:

No change of behavior.

Do release logging of WebRTC stats once remote description is set.
Do logging every second for the first 30 seconds.
After 30 seconds, do release logging of these stats every 5 seconds.

* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
(WebCore::LibWebRTCMediaEndpoint::stop):
(WebCore::LibWebRTCMediaEndpoint::gatherStatsForLogging):
(WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
(WebCore::LibWebRTCMediaEndpoint::startLoggingStats):
(WebCore::LibWebRTCMediaEndpoint::stopLoggingStats):
(WebCore::LibWebRTCPeerConnectionBackend::doSetRemoteDescription):

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

2 years ago[JSC] has_generic_property never accepts non-String
utatane.tea@gmail.com [Wed, 7 Jun 2017 16:54:05 +0000 (16:54 +0000)]
[JSC] has_generic_property never accepts non-String
https://bugs.webkit.org/show_bug.cgi?id=173057

Reviewed by Darin Adler.

We never pass non-String value to has_generic_property bytecode.

* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):

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

2 years agoSupport removal of authentication data through the Website data store API.
pvollan@apple.com [Wed, 7 Jun 2017 16:51:24 +0000 (16:51 +0000)]
Support removal of authentication data through the Website data store API.
https://bugs.webkit.org/show_bug.cgi?id=171217
Source/WebCore:

Reviewed by Brady Eidson.

Add support to remove and fetch credential data through the Website data store API.

Test: http/tests/loading/basic-auth-remove-credentials.html

* platform/network/CredentialStorage.h:
(WebCore::CredentialStorage::originsWithCredentials):

Source/WebKit2:

<rdar://problem/29522573>

Reviewed by Brady Eidson.

Add support to remove and fetch credential data through the Website data store API.
Credential data is removed and fetched from both the network process and web process.
Authentication data stored in the keychain will not be cleared.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::fetchWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteData):
* Shared/WebsiteData/WebsiteData.cpp:
(WebKit::WebsiteData::encode):
(WebKit::WebsiteData::decode):
* Shared/WebsiteData/WebsiteData.h:
* Shared/WebsiteData/WebsiteDataType.h:
* UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
* UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
(dataTypesToString):
* UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
(WebKit::toWebsiteDataType):
(WebKit::toWKWebsiteDataTypes):
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(+[WKWebsiteDataStore allWebsiteDataTypes]):
* UIProcess/WebsiteData/WebsiteDataRecord.cpp:
(WebKit::WebsiteDataRecord::addOriginWithCredential):
* UIProcess/WebsiteData/WebsiteDataRecord.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::fetchData):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::fetchWebsiteData):
(WebKit::WebProcess::deleteWebsiteData):

Tools:

Reviewed by Brady Eidson.

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::didReceiveMessageToPage):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::removeAllSessionCredentials):
(WTR::TestRunner::callDidRemoveAllSessionCredentialsCallback):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):
(WTR::TestInvocation::didRemoveAllSessionCredentials):
* WebKitTestRunner/TestInvocation.h:
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::removeAllSessionCredentials):

LayoutTests:

Reviewed by Brady Eidson.

* TestExpectations:
* http/tests/loading/basic-auth-remove-credentials-expected.txt: Added.
* http/tests/loading/basic-auth-remove-credentials.html: Added.
* platform/mac-wk2/TestExpectations:

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

2 years agoUpdate the design of the WebKit Feature Status page
jond@apple.com [Wed, 7 Jun 2017 16:04:37 +0000 (16:04 +0000)]
Update the design of the WebKit Feature Status page
https://bugs.webkit.org/show_bug.cgi?id=173036

Reviewed by Simon Fraser.

* wp-content/themes/webkit/functions.php: Fixed a bad function call.
* wp-content/themes/webkit/status.php: Implemented redesign with saved search.
* wp-content/themes/webkit/style.css:
(.feature-header:after):
(@media only screen and (max-width: 920px)):
(@media only screen and (max-width: 600px)):
(.feature-filters): Deleted.
(.feature-filters.opened): Deleted.
(.feature-filters:after): Deleted.
(.feature-filters.opened:after): Deleted.

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

2 years ago[iOS WK1 WebThread] Do not call out to the main thread for device orientation.
zalan@apple.com [Wed, 7 Jun 2017 15:48:18 +0000 (15:48 +0000)]
[iOS WK1 WebThread] Do not call out to the main thread for device orientation.
https://bugs.webkit.org/show_bug.cgi?id=173044
<rdar://problem/32449338>

Reviewed by Tim Horton.

Source/WebKit/ios:

On iOS WK1 we could end up with an inconsistent state, where the web thread is inside
the Document's constructor waiting on a delegate callback on the main thread
while the main thread executes a pending task that assumes a valid Document.
This patch ensures that we don't call out to the main thread from the Document's constructor.

* WebCoreSupport/WebChromeClientIOS.mm:
(WebChromeClientIOS::deviceOrientation): Caches deviceOrientation on the WebView so that we
don't have to lift the WebThread lock.

Source/WebKit/mac:

Cache the current device orientation so that we don't have to lift the WebThread lock
to collect it.

* WebView/WebFrame.mm:
(-[WebFrame deviceOrientationChanged]):
* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
(-[WebView _setDeviceOrientation:]):
(-[WebView _deviceOrientation]):
* WebView/WebViewData.h:
* WebView/WebViewInternal.h:

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

2 years agoAdd Charlie Turner as contributor
commit-queue@webkit.org [Wed, 7 Jun 2017 15:08:14 +0000 (15:08 +0000)]
Add Charlie Turner as contributor
https://bugs.webkit.org/show_bug.cgi?id=173055

Patch by Charlie Turner <cturner@igalia.com> on 2017-06-07
Reviewed by Carlos Alberto Lopez Perez.

I also ran the Tools/Scripts/validate-committer-lists --canonicalize command at the suggestion
of webkit-patch upload, which reordered some fields and removed a newline.

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

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

2 years agoRebaseline and enable media/modern-media-controls/background-tint
commit-queue@webkit.org [Wed, 7 Jun 2017 15:07:25 +0000 (15:07 +0000)]
Rebaseline and enable media/modern-media-controls/background-tint
https://bugs.webkit.org/show_bug.cgi?id=173056
<rdar://problem/32614607>

Patch by Antoine Quint <graouts@apple.com> on 2017-06-07
Reviewed by Eric Carlson.

Update the background-color and filter properties for backdrops to match
the latest implementation and specs.

* media/modern-media-controls/background-tint/background-tint-expected.txt:
* media/modern-media-controls/background-tint/background-tint.html:
* platform/ios-simulator/TestExpectations:
* platform/mac/TestExpectations:

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

2 years agoUnreviewed GTK expectations gardening
alex@webkit.org [Wed, 7 Jun 2017 13:24:19 +0000 (13:24 +0000)]
Unreviewed GTK expectations gardening

Mark the mediacapturefromelement tests as skipped, we need canvas
captureStreams support.

* platform/gtk/TestExpectations:

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

2 years ago[mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html...
graouts@webkit.org [Wed, 7 Jun 2017 12:29:36 +0000 (12:29 +0000)]
[mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=168409

Unreviewed test gardening. This test has started timing out again on WK1.

* platform/mac-wk1/TestExpectations:

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

2 years agoUnreviewed GTK+ gardening.
zandobersek@gmail.com [Wed, 7 Jun 2017 11:50:02 +0000 (11:50 +0000)]
Unreviewed GTK+ gardening.

Add test baselines that expect RSA-PSS and HKDF tests running successfully.
Also mark tests under imported/w3c/web-platform-tests/WebCryptoAPI as slow,
giving them enough time to run properly and avoid timeouts.

* platform/gtk/TestExpectations:
* platform/gtk/crypto: Added.
* platform/gtk/crypto/subtle: Added.
* platform/gtk/crypto/subtle/rsa-generate-key-malformed-parameters-expected.txt: Added.
* platform/gtk/crypto/subtle/rsa-import-key-malformed-parameters-expected.txt: Added.
* platform/gtk/imported/w3c/web-platform-tests/WebCryptoAPI: Added.
* platform/gtk/imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys: Added.
* platform/gtk/imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/hkdf.worker-expected.txt: Added.
* platform/gtk/imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/test_hkdf.https-expected.txt: Added.
* platform/gtk/imported/w3c/web-platform-tests/WebCryptoAPI/generateKey: Added.
* platform/gtk/imported/w3c/web-platform-tests/WebCryptoAPI/generateKey/failures.worker-expected.txt: Added.
* platform/gtk/imported/w3c/web-platform-tests/WebCryptoAPI/generateKey/failures_RSA-PSS.worker-expected.txt: Added.
* platform/gtk/imported/w3c/web-platform-tests/WebCryptoAPI/generateKey/successes_RSA-PSS.worker-expected.txt: Added.
* platform/gtk/imported/w3c/web-platform-tests/WebCryptoAPI/generateKey/test_failures.https-expected.txt: Added.
* platform/gtk/imported/w3c/web-platform-tests/WebCryptoAPI/generateKey/test_failures_RSA-PSS.https-expected.txt: Added.
* platform/gtk/imported/w3c/web-platform-tests/WebCryptoAPI/generateKey/test_successes_RSA-PSS.https-expected.txt: Added.

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

2 years agoAudioSourceProviderAVFObjC::m_tap member access is not thread safe.
pvollan@apple.com [Wed, 7 Jun 2017 10:57:23 +0000 (10:57 +0000)]
AudioSourceProviderAVFObjC::m_tap member access is not thread safe.
https://bugs.webkit.org/show_bug.cgi?id=172263

Reviewed by Darin Adler.

It it possible that the main thread will modify the m_tap member by calling
AudioSourceProviderAVFObjC::destroyMix(), while m_tap is being read on a secondary
thread under AudioSourceProviderAVFObjC::processCallback(). Instead of accessing
the m_tap member on the secondary thread, we can use the same MTAudioProcessingTapRef
provided by MediaToolbox in the callback. We assume the tap ref is retained by
MediaToolbox, so it should be safe to use even if the the m_tap member is set to null.

Covered by existing tests.

* platform/graphics/avfoundation/AudioSourceProviderAVFObjC.h:
* platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
(WebCore::AudioSourceProviderAVFObjC::processCallback):
(WebCore::AudioSourceProviderAVFObjC::process):

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

2 years ago[GCrypt] RSA-PSS support
zandobersek@gmail.com [Wed, 7 Jun 2017 09:16:03 +0000 (09:16 +0000)]
[GCrypt] RSA-PSS support
https://bugs.webkit.org/show_bug.cgi?id=172856

Reviewed by Jiewen Tan.

.:

* Source/cmake/OptionsGTK.cmake: Set and expose the USE_GCRYPT preprocessor macro when
SUBTLE_CRYPTO is enabled.
* Source/cmake/OptionsWPE.cmake: Match the GTK+ port in demanding at least version 1.7.0
of libgcrypt. Also set and expose the USE_GCRYPT preprocessor macro.

Source/WebCore:

Implement RSA-PSS support for Web Crypto API in ports that use libgcrypt.

For the signing operation, the digest algorithm is determined and used to
compute the hash of the passed-in data. The given salt length and hash results
are embedded into a data s-expression, specifying PSS as the preferred type of
padding. This s-expression and the provided key are then passed to the
gcry_pk_sign() call which computes the signature. The MPI data of this signature
is retrieved and its size validated before being passed to the success callback.

For the verification operation, the hash of the passed-in data is computed as
before, embedding it into a data s-expression along with the specified salt
length. The passed-in signature data is embedded into a sig-val s-expression.
The two s-expressions are passed to the gcry_pk_verify() call along with the
key. If the returned error code for this operation is GPG_ERR_NO_ERROR the
verification is deemed successful, while in case of any other error code (which
might indicate a verification failure or an operation error) we simply signal
that the verification step failed (and not that it possibly errored out).

No new tests -- covered by existing tests.

* PlatformGTK.cmake: Add the new build targets.
* PlatformWPE.cmake: Ditto.
* crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp: Added.
(WebCore::gcryptSign):
(WebCore::gcryptVerify):
(WebCore::CryptoAlgorithmRSA_PSS::platformSign):
(WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
* crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp:
(WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms): Register the RSA-PSS algorithm.

Source/WTF:

* wtf/Platform.h: Define HAVE_RSA_PSS to 1 for USE(GCRYPT). Support for RSA-PSS
is provided by default through the libgcrypt library.

LayoutTests:

* platform/gtk/TestExpectations: Enable RSA-PSS tests that we pass. The remaining
disabled tests rely on SPKI or PKCS#8 support that hasn't landed yet.

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

2 years agoMerge TreeScopeAdopter into TreeScope
rniwa@webkit.org [Wed, 7 Jun 2017 08:02:46 +0000 (08:02 +0000)]
Merge TreeScopeAdopter into TreeScope
https://bugs.webkit.org/show_bug.cgi?id=173040

Reviewed by Antti Koivisto.

Merged TreeScopeAdopter into TreeScope since it's used by TreeScope::adoptIfNeeded.

Most of code changes are for didMoveToNewDocument taking the new document as an argument,
which is used by ShadowRoot::didMoveToNewDocument to update its document scope.

No new tests since there should be no behavioral change.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/Element.cpp:
(WebCore::Element::didMoveToNewDocument):
* dom/Element.h:
* dom/Node.cpp:
(WebCore::Node::didMoveToNewDocument): Moved the code to moves the node lists and node iterators here
from TreeScopeAdopter::moveNodeToNewDocument.
* dom/Node.h:
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::didMoveToNewDocument): Moved the code to update the document scope here
from TreeScopeAdopter::moveNodeToNewDocument.
* dom/ShadowRoot.h:
* dom/TreeScope.cpp:
(WebCore::TreeScope::adoptIfNeeded):
(WebCore::TreeScope::moveTreeToNewScope): Moved from TreeScopeAdopter. Now takes the old tree scope and
the new tree scope as arguments (they used to be members of TreeScopeAdopter). Also merged updateTreeScope
into this function.
(WebCore::TreeScope::ensureDidMoveToNewDocumentWasCalled): Moved from TreeScopeAdopter.
(WebCore::TreeScope::moveNodeToNewDocument): Ditto. The code to adopt node lists and node iterators have
been moved to Node::didMoveToNewDocument.
(WebCore::TreeScope::moveShadowTreeToNewDocument): Moved from TreeScopeAdopter.
* dom/TreeScope.h:
(WebCore::TreeScope::ensureDidMoveToNewDocumentWasCalled):
* dom/TreeScopeAdopter.cpp: Removed.
* dom/TreeScopeAdopter.h: Removed.
* html/HTMLFieldSetElement.cpp:
(WebCore::HTMLFieldSetElement::didMoveToNewDocument):
* html/HTMLFieldSetElement.h:
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::didMoveToNewDocument):
* html/HTMLFormControlElement.h:
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::didMoveToNewDocument):
* html/HTMLFormElement.h:
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::didMoveToNewDocument):
* html/HTMLImageElement.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::didMoveToNewDocument): Grouped related function calls on new/old documents.
* html/HTMLInputElement.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::didMoveToNewDocument):
* html/HTMLMediaElement.h:
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::didMoveToNewDocument):
* html/HTMLObjectElement.h:
* html/HTMLPictureElement.cpp:
(WebCore::HTMLPictureElement::didMoveToNewDocument):
* html/HTMLPictureElement.h:
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::didMoveToNewDocument):
* html/HTMLPlugInImageElement.h:
* html/HTMLTemplateElement.cpp:
(WebCore::HTMLTemplateElement::didMoveToNewDocument):
* html/HTMLTemplateElement.h:
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::didMoveToNewDocument):
* html/HTMLVideoElement.h:
* html/ImageDocument.cpp:
(WebCore::ImageDocumentElement::didMoveToNewDocument):
* svg/SVGImageElement.cpp:
(WebCore::SVGImageElement::didMoveToNewDocument):
* svg/SVGImageElement.h:
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::didMoveToNewDocument):
* svg/SVGSVGElement.h:

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

2 years agoUse a dedicated node flag to identify a Document node
rniwa@webkit.org [Wed, 7 Jun 2017 06:49:51 +0000 (06:49 +0000)]
Use a dedicated node flag to identify a Document node
https://bugs.webkit.org/show_bug.cgi?id=173037

Reviewed by Chris Dumez.

Use a Node flag to identify a Document node instead of checking this == document() which loads TreeScope.

* dom/Document.h:
(WebCore::Node::isDocumentNode): Deleted.
* dom/Node.h:
(WebCore::Node::isDocumentNode):

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

2 years ago[Win][x86-64] Some callee saved registers aren't preserved
commit-queue@webkit.org [Wed, 7 Jun 2017 04:19:52 +0000 (04:19 +0000)]
[Win][x86-64] Some callee saved registers aren't preserved
https://bugs.webkit.org/show_bug.cgi?id=171266

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-06-06
Reviewed by Saam Barati.

* jit/RegisterSet.cpp:
(JSC::RegisterSet::calleeSaveRegisters): Added edi and esi for X86_64 Windows.

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

2 years agoFixed building with the macOS 10.13 Apple Internal SDK when targeting macOS 10.12.
mitz@apple.com [Wed, 7 Jun 2017 04:12:25 +0000 (04:12 +0000)]
Fixed building with the macOS 10.13 Apple Internal SDK when targeting macOS 10.12.

Source/WebCore:

* platform/spi/cocoa/PassKitSPI.h:

Source/WebKit2:

* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didAuthorizePayment:handler:]):
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:handler:]):
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:handler:]):
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:handler:]):

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

2 years agoUnreviewed, rolling out r214974.
cdumez@apple.com [Wed, 7 Jun 2017 03:46:57 +0000 (03:46 +0000)]
Unreviewed, rolling out r214974.

Causes some tabs to start using a huge amount of CPU after 8
minutes in the background

Reverted changeset:

"Make inactive web processes behave as though under memory
pressure."
https://bugs.webkit.org/show_bug.cgi?id=170042
http://trac.webkit.org/changeset/214974

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

2 years ago[WK2][Cocoa] Allow network process to bind addresses without webrtc extension
bfulgham@apple.com [Wed, 7 Jun 2017 03:25:12 +0000 (03:25 +0000)]
[WK2][Cocoa] Allow network process to bind addresses without webrtc extension
https://bugs.webkit.org/show_bug.cgi?id=173032
<rdar://problem/32597426>

Reviewed by Youenn Fablet.

Remove the unnecessary WebRTC sandbox extension handle and conditional sandbox rules, since we've
decided that all WebKit clients should be able to use the WebRTC protocol.

* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode): Remove unused sandbox extension from serialization.
(WebKit::NetworkProcessCreationParameters::decode): Ditto.
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): We no longer send the sandbox extension,
so don't attempt to consume it.
* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: Remove check for 'com.apple.webkit.webrtc'
extension. Make rules conditional on building with WEB_RTC feature enabled.
* Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: Remove check for 'com.apple.webkit.webrtc'
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeNetworkProcess): Do not create unnecessary sandbox extension
handle.

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

2 years agoCrash trying to drag the entire text of a long book out of Mail compose view
timothy_horton@apple.com [Wed, 7 Jun 2017 02:17:27 +0000 (02:17 +0000)]
Crash trying to drag the entire text of a long book out of Mail compose view
https://bugs.webkit.org/show_bug.cgi?id=173042
<rdar://problem/32382059>

Reviewed by Simon Fraser.

Source/WebCore:

Creating a TextIndicator that is hundreds of thousands of pixels tall
is not a good idea. We introduced TextIndicatorOptionDoNotClipToVisibleRect
so that (for example) an image that overhangs the edge of the page would
contain the entire image, instead of just the visible fragment.
Instead, rename this option to ExpandClipBeyondVisibleRect, and make it
not unclip *entirely*, but expand the clip significantly (50% in each direction)
beyond the bounds of the current visible rect. Also, make use of exposed
area information for this clipping; otherwise, clients with very large views
inside scrollable areas (like Mail) would still try to create large TextIndicators.

* page/TextIndicator.cpp:
(WebCore::initializeIndicator):
* page/TextIndicator.h:

Source/WebKit2:

* WebProcess/WebPage/ios/FindControllerIOS.mm:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::didConcludeEditDataInteraction):
Adapt to the new name.

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

2 years agoContiguous storage butterfly length should not exceed MAX_STORAGE_VECTOR_LENGTH.
mark.lam@apple.com [Wed, 7 Jun 2017 00:28:47 +0000 (00:28 +0000)]
Contiguous storage butterfly length should not exceed MAX_STORAGE_VECTOR_LENGTH.
https://bugs.webkit.org/show_bug.cgi?id=173035
<rdar://problem/32554593>

Reviewed by Geoffrey Garen and Filip Pizlo.

JSTests:

* stress/regress-173035.js: Added.

Source/JavaScriptCore:

Also added and fixed up some assertions.

* runtime/ArrayConventions.h:
* runtime/JSArray.cpp:
(JSC::JSArray::setLength):
* runtime/JSObject.cpp:
(JSC::JSObject::createInitialIndexedStorage):
(JSC::JSObject::ensureLengthSlow):
(JSC::JSObject::reallocateAndShrinkButterfly):
* runtime/JSObject.h:
(JSC::JSObject::ensureLength):
* runtime/RegExpObject.cpp:
(JSC::collectMatches):
* runtime/RegExpPrototype.cpp:
(JSC::regExpProtoFuncSplitFast):

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

2 years agoMarked workers/bomb.html as flaky on iOS.
jlewis3@apple.com [Tue, 6 Jun 2017 23:45:44 +0000 (23:45 +0000)]
Marked workers/bomb.html as flaky on iOS.
https://bugs.webkit.org/show_bug.cgi?id=167757

Unreviewed test gardening.

* platform/ios-wk2/TestExpectations:

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

2 years agoRELEASE_ASSERT(static_cast<size_t>(enumerationValue) < WTF_ARRAY_LENGTH(values))...
cdumez@apple.com [Tue, 6 Jun 2017 23:31:25 +0000 (23:31 +0000)]
RELEASE_ASSERT(static_cast<size_t>(enumerationValue) < WTF_ARRAY_LENGTH(values)) hit in convertEnumerationToJS<WebCore::History::ScrollRestoration>()
https://bugs.webkit.org/show_bug.cgi?id=173033
<rdar://problem/32591099>

Reviewed by Simon Fraser.

Source/WebCore:

History::scrollRestoration() was returning a bad value because HistoryItem::m_shouldRestoreScrollPosition
was initialized from FrameState::shouldRestoreScrollPosition member, which was not initialized when
restored from the legacy session restore API.

Tests: WebKit2.RestoreSessionStateContainingScrollRestoration* API tests.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateEnumerationImplementationContent):
Drop the RELEASE_ASSERT that was added to debug this and use the regular debug ASSERT.

* history/HistoryItem.cpp:
(WebCore::HistoryItem::setShouldRestoreScrollPosition):
Make sure we notify that the HistoryItem has changed when setShouldRestoreScrollPosition()
is called.

Source/WebKit2:

* Shared/SessionState.h:
Make sure FrameState::shouldRestoreScrollPosition and other struct members are always
intialized.

* UIProcess/mac/LegacySessionStateCoding.cpp:
(WebKit::encodeFrameStateNode):
(WebKit::decodeBackForwardTreeNode):
Make sure FrameState::shouldRestoreScrollPosition is properly encoded / decoded.

Tools:

Add API test coverage to make sure History's scrollRestoration is properly saved / restored via the
WKPageCopySessionState() / WKPageRestoreFromSessionState() C API.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/RestoreSessionState.cpp: Added.
(TestWebKitAPI::didFinishLoadForFrame):
(TestWebKitAPI::setPageLoaderClient):
(TestWebKitAPI::createSessionStateDataContainingScrollRestoration):
(TestWebKitAPI::TEST):

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

2 years agoMake sure we restore SP when doing calls that could be to JS
sbarati@apple.com [Tue, 6 Jun 2017 23:06:12 +0000 (23:06 +0000)]
Make sure we restore SP when doing calls that could be to JS
https://bugs.webkit.org/show_bug.cgi?id=172946
<rdar://problem/32579026>

Reviewed by JF Bastien.

JSTests:

* wasm/function-tests/many-args-tail-call-sp-restored.js: Added.
(import.Builder.from.string_appeared_here.import.as.assert.from.string_appeared_here.f1):
(import.Builder.from.string_appeared_here.import.as.assert.from.string_appeared_here.end):
(import.Builder.from.string_appeared_here.import.as.assert.from.string_appeared_here.f2):
(import.Builder.from.string_appeared_here.import.as.assert.from.string_appeared_here.let.instance.new.WebAssembly.Instance.new.WebAssembly.Module.builder.WebAssembly):

Source/JavaScriptCore:

I was worried that there was a bug where we'd call JS, JS would tail call,
and we'd end up with a bogus SP. However, this bug does not exist since wasm
always calls to JS through a stub, and the stub treats SP as a callee save.

I wrote a test for this, and also made a note that this is the needed ABI.

* wasm/WasmBinding.cpp:
(JSC::Wasm::wasmToJs):

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

2 years agoREGRESSION (r199558): WKWebView upload file which name contains Chinese character...
aestes@apple.com [Tue, 6 Jun 2017 23:04:48 +0000 (23:04 +0000)]
REGRESSION (r199558): WKWebView upload file which name contains Chinese character results in garbled code
https://bugs.webkit.org/show_bug.cgi?id=172849
<rdar://problem/32567454>

Reviewed by Darin Adler.

Source/WebKit2:

This is the Mac equivalent of what was fixed in r208295. This time we use -[NSURL path] to
construct a WTF::String instead of calling String::fromUTF8() on -[NSURL fileSystemRepresentation].

* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::UIClient::runOpenPanel):

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/RunOpenPanel.mm: Added.
(-[RunOpenPanelUIDelegate webView:runOpenPanelWithParameters:initiatedByFrame:completionHandler:]):
(TestWebKitAPI::TEST):

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

2 years agoUpdate to slightly stricter rules for custom element names from more recent standard...
darin@apple.com [Tue, 6 Jun 2017 22:38:27 +0000 (22:38 +0000)]
Update to slightly stricter rules for custom element names from more recent standard draft
https://bugs.webkit.org/show_bug.cgi?id=173019

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/interfaces-expected.txt: Expect more PASS.

Source/WebCore:

* bindings/js/JSCustomElementRegistryCustom.cpp:
(WebCore::validateCustomElementNameAndThrowIfNeeded): Add more error strings for various error cases.

* dom/Document.cpp:
(WebCore::isPotentialCustomElementNameCharacter): Added. Implements the PCENChar production
from the standard by listing all the ranges exactly as they appear in the standard.
(WebCore::Document::validateCustomElementName): Added a check that the first character is
a lowercase ASCII letter. Added a check that all characters are potential custom element
name characters.

* dom/Document.h: Update the CustomElementNameValidationStatus with new values for
the various new error cases.  Not sure that validateCustomElementName really belongs
in the Document class in the first place. Also seems that the error strings could be
in validateCustomElementName rather than in a separate bindings function, obviating
the need for the enum.

LayoutTests:

* platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interfaces-expected.txt: Expect more PASS.
* platform/ios/imported/w3c/web-platform-tests/html/semantics/interfaces-expected.txt: Ditto.

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

2 years ago[preload] Conditional support for media preloading and align media `as` values.
yoav@yoav.ws [Tue, 6 Jun 2017 22:36:27 +0000 (22:36 +0000)]
[preload] Conditional support for media preloading and align media `as` values.
https://bugs.webkit.org/show_bug.cgi?id=172501

Reviewed by Dean Jackson.

Source/WebCore:

As discussed at https://bugs.webkit.org/show_bug.cgi?id=171720#c11 media preloading may not work
since the backend may not reuse such resources properly.
This patch makes support for media preloading conditional on a setting, in order to avoid double downloads in these cases.
It also aligns the media `as` values to the spec, and splitting them into "video" and "audio".

No new tests but related tests were modified to remove media preloading tests as the setting is off by default.

* loader/LinkLoader.cpp:
(WebCore::LinkLoader::resourceTypeFromAsAttribute): Make handling of MediaResource conditional on setting. Align `as` values to spec.
(WebCore::createLinkPreloadResourceClient): Make handling of MediaResource conditional on setting.
(WebCore::LinkLoader::isSupportedType): Make handling of MediaResource conditional on setting.
* page/RuntimeEnabledFeatures.h: Added a media preloading preference.
(WebCore::RuntimeEnabledFeatures::setMediaPreloadingEnabled):
(WebCore::RuntimeEnabledFeatures::mediaPreloadingEnabled):
* page/Settings.in: Added a media preloading preference.

Source/WebKit:

Add media preloading preference and hook it up to runtime enabled features.

* mac/WebView/WebPreferenceKeysPrivate.h: Added a media preloading preference.
* mac/WebView/WebPreferences.mm:
(WebKit::WebPreferences::setMediaPreloadingEnabled):
(WebKit::WebPreferences::mediaPreloadingEnabled):
* mac/WebView/WebPreferencesPrivate.h:
(WebKit::WebPreferences::setMediaPreloadingEnabled):
(WebKit::WebPreferences::mediaPreloadingEnabled):
* mac/WebView/WebView.mm: Set runtime enabled feature based on preference.
* win/Interfaces/IWebPreferencesPrivate.idl: define mediaPreloadEnabled and setMediaPreloadingEnabled
* win/WebPreferences.cpp: Initialize media preloading as false and define setter and getter.
(WebKit::WebPreferences::setMediaPreloadingEnabled):
(WebKit::WebPreferences::mediaPreloadingEnabled):
* win/WebPreferences.h:
* win/WebPreferenceKeysPrivate.h:
* win/WebView.cpp: Set runtime enabled feature based on preference.

Source/WebKit2:

Add media preloading preference and hook it up to runtime enabled features.

* Shared/WebPreferencesDefinitions.h: Added a macro defining media preloading preference.
* UIProcess/API/C/WKPreferences.cpp:
(WebKit2::WKPreferences::WKPreferencesSetMediaPreloadingEnabled):
(WebKit2::WKPreferences::WKPreferencesGetMediaPreloadingEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* WebProcess/WebPage/WebPage.cpp: Set runtime enabled feature based on preference.

Tools:

Turn on media preloading preference for tests.

* DumpRenderTree/mac/DumpRenderTree.mm: Turn on media preloading preference.
* DumpRenderTree/win/DumpRenderTree.cpp: Turn on media preloading preference.
* WebKitTestRunner/TestController.cpp: Turn on media preloading preference.

LayoutTests:

Tests checking media resources preloading support were removed.

* http/tests/preload/download_resources.html: Replaced "media" with "video".
* http/tests/preload/download_resources_from_header_iframe-expected.txt: Changed expectation due to added "audio" test.
* http/tests/preload/onload_event.html: Replaced "media" with "video".
* http/tests/preload/preloadscanner_download_resources.html: Replaced "media" with "video".
* http/tests/preload/resources/download_resources_from_header.php: Replaced "media" with "video" and "audio".
* http/tests/preload/resources/nph-invalid_resources_from_header.pl: Replaced "media" with "video".
* http/tests/preload/single_download_preload.html: Replaced "media" with "video" and "audio".
* http/tests/preload/single_download_preload_headers.php: Replaced "media" with "video" and "audio".
* http/tests/preload/single_download_preload_headers_charset.php: Replaced "media" with "video" and "audio".

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

2 years ago[WebCore] Enable REQUEST_ANIMATION_FRAME_TIMER for all ports
commit-queue@webkit.org [Tue, 6 Jun 2017 22:29:45 +0000 (22:29 +0000)]
[WebCore] Enable REQUEST_ANIMATION_FRAME_TIMER for all ports
https://bugs.webkit.org/show_bug.cgi?id=172780

Patch by Don Olmstead <don.olmstead@am.sony.com> on 2017-06-06
Reviewed by Alex Christensen.

Source/WebCore:

No new tests. No change in behavior.

* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::ScriptedAnimationController):
(WebCore::ScriptedAnimationController::addThrottlingReason):
(WebCore::ScriptedAnimationController::removeThrottlingReason):
(WebCore::ScriptedAnimationController::isThrottled):
(WebCore::ScriptedAnimationController::interval):
(WebCore::ScriptedAnimationController::scheduleAnimation):
(WebCore::ScriptedAnimationController::displayRefreshFired):
* dom/ScriptedAnimationController.h:
* loader/EmptyClients.h:
* page/Chrome.cpp:
(WebCore::Chrome::scheduleAnimation): Deleted.
* page/Chrome.h:
* page/ChromeClient.h:
* platform/Curl.cmake: Added.
* platform/ScrollAnimationSmooth.cpp:
(WebCore::ScrollAnimationSmooth::ScrollAnimationSmooth):
(WebCore::ScrollAnimationSmooth::stop):
(WebCore::ScrollAnimationSmooth::animationTimerFired):
(WebCore::ScrollAnimationSmooth::startNextTimer):
(WebCore::ScrollAnimationSmooth::animationTimerActive):
(WebCore::ScrollAnimationSmooth::serviceAnimation): Deleted.
* platform/ScrollAnimationSmooth.h:

Source/WebKit2:

* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::scheduleAnimation): Deleted.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
(WebKit::CompositingCoordinator::syncDisplayState):

Source/WTF:

* wtf/Platform.h:

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

2 years agoOMG tier up checks should be a patchpoint
keith_miller@apple.com [Tue, 6 Jun 2017 22:20:16 +0000 (22:20 +0000)]
OMG tier up checks should be a patchpoint
https://bugs.webkit.org/show_bug.cgi?id=172944

Reviewed by Saam Barati.

Tier up checks in BBQ should be done as a patchpoint rather than individual B3 opcodes.
In order to reduce code generated out of line in each function. We generate a single stub
that pushes all the callee-saves. This looks like a 5-10% compile time speedup.

* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::B3IRGenerator):
(JSC::Wasm::B3IRGenerator::emitTierUpCheck):
(JSC::Wasm::B3IRGenerator::addLoop):
* wasm/WasmThunks.cpp:
(JSC::Wasm::triggerOMGTierUpThunkGenerator):
* wasm/WasmThunks.h:

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

2 years agoCut down use of WTF_ARRAY_LENGTH
darin@apple.com [Tue, 6 Jun 2017 22:09:44 +0000 (22:09 +0000)]
Cut down use of WTF_ARRAY_LENGTH
https://bugs.webkit.org/show_bug.cgi?id=172997

Reviewed by Chris Dumez.

Source/JavaScriptCore:

* parser/Lexer.cpp:
(JSC::singleEscape): Use WTF_ARRAY_LENGTH instead of ARRAY_SIZE.

* runtime/NumberPrototype.cpp:
(JSC::toStringWithRadix): Use std::end instead of WTF_ARRAY_LENGTH.

Source/WebCore:

* contentextensions/NFAToDFA.cpp: Remove unused SetTransitions class.

* dom/Document.cpp:
(WebCore::Document::~Document): Use modern for loop instead of WTF_ARRAY_LENGTH.
* dom/make_names.pl:
(printDefinitions): Ditto.
(printFactoryCppFile): Ditto.
(printWrapperFactoryCppFile): Ditto.

* platform/URL.cpp:
(WebCore::portAllowed): Use std::is_sorted, std::begin, and std::end
in sort assertion to greatly streamline it and eliminate use of WTF_ARRAY_LENGTH.
Also allow the sort assertion to run every time; slightly optimizing debug builds
was not worth having the code be messy.

* platform/URLParser.cpp:
(WebCore::URLParser::appendNumberToASCIIBuffer): Use std::end instead of
WTF_ARRAY_LENGTH.

* platform/graphics/FontCascade.cpp: Make fontFamiliesWithInvalidCharWidth be
a constant array rather than a non-constant array to constant strings.
(WebCore::FontCascade::hasValidAverageCharWidth): Streamline the hash table
initialization to avoid heap allocation and use a modern for loop instead of
WTF_ARRAY_LENGTH.

* platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
(WebCore::disableComponentsOnce): Use a modern for loop instead of WTF_ARRAY_LENGTH.
* platform/network/CacheValidation.cpp:
(WebCore::shouldUpdateHeaderAfterRevalidation): Ditto. Also use the
startsWithIgnoringASCIICase function rather than the version that folds
arbitrary Unicode case.

* platform/text/TextEncodingRegistry.cpp:
(WebCore::pruneBlacklistedCodecs): Use modern for loops to make the code considerably
easier to read and avoid WTF_ARRAY_LENGTH.

* platform/text/mac/LocaleMac.mm:
(WebCore::LocaleMac::monthLabels): Use modern for loop instead of WTF_ARRAY_LENGTH.
(WebCore::LocaleMac::shortMonthLabels): Ditto.
* rendering/RenderCombineText.cpp:
(WebCore::RenderCombineText::combineText): Ditto.

Source/WTF:

* wtf/DateMath.cpp:
(WTF::equalLettersIgnoringASCIICase): Added helper function template.
(WTF::parseDateFromNullTerminatedCharacters): Use a modern for loop instead of
WTF_ARRAY_LENGTH. Use startsWithLettersIgnoringASCIICase and
equalLettersIgnoringASCIICase instead of strncasecmp.

* wtf/text/IntegerToStringConversion.h:
(WTF::numberToStringImpl): Use std::end instead of WTF_ARRAY_LENGTH.
(WTF::writeNumberToBufferImpl): Ditto.

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

2 years agoAllow FileReader to open files multiple times
commit-queue@webkit.org [Tue, 6 Jun 2017 22:04:19 +0000 (22:04 +0000)]
Allow FileReader to open files multiple times

If multiple file readers open files they are prevented by default due to
Windows' file locking.

Allow FileReader to open multiple files for reading at the same time on wincairo
https://bugs.webkit.org/show_bug.cgi?id=172632

Patch by Isaac Devine <isaac@devinesystems.co.nz> on 2017-06-06
Reviewed by Darin Adler.

* platform/win/FileSystemWin.cpp:
(WebCore::openFile): Use the appropriate sharing options to allow multiple opens

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

2 years agoNetflix seeking quirk should also apply to Now Playing, and should always use the
bdakin@apple.com [Tue, 6 Jun 2017 21:46:29 +0000 (21:46 +0000)]
Netflix seeking quirk should also apply to Now Playing, and should always use the
livestream UI
https://bugs.webkit.org/show_bug.cgi?id=173030
-and corresponding-
rdar://problem/32228660

Reviewed by Darin Adler.

Source/WebCore:

This patch rolls out much of https://trac.webkit.org/changeset/217791/webkit in
favor of an approach that can be used to apply the quirk to Now Playing in
addition to Touch Bar. This patch also changes the UI in both Touch Bar and Now
Playing to match live stream UI, which means there is no playhead. This hopefully
makes it less confusing that taps on the timeline will have no effect.

supportsSeeking() should return false for Netflix. That function needs to be
public now.
* html/HTMLMediaElement.cpp:
(WebCore::needsSeekingSupportQuirk):
(WebCore::HTMLMediaElement::supportsSeeking):
* html/HTMLMediaElement.h:

Here is where we get the desired result in Now Playing. Make sure the
currentSession supportsSeeking() before relying on the time and duration info for
the sake of Now Playing.
* platform/audio/mac/MediaSessionManagerMac.mm:
(WebCore::MediaSessionManagerMac::updateNowPlayingInfo):

We can roll out allowsTouchBarScrubbing() and rely on supportsSeeking().
* platform/cocoa/WebPlaybackSessionModel.h:
(WebCore::WebPlaybackSessionModelClient::mutedChanged):
(WebCore::WebPlaybackSessionModelClient::allowsTouchBarScrubbingChanged): Deleted.
* platform/cocoa/WebPlaybackSessionModelMediaElement.h:
* platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
(WebCore::WebPlaybackSessionModelMediaElement::updateForEventName):

And here is where we get the desired result for Touch Bar. Make sure the the media
element supportsSeeking() before relying on the duration.
(WebCore::WebPlaybackSessionModelMediaElement::duration):

We can roll out allowsTouchBarScrubbing() and rely on supportsSeeking().
(WebCore::WebPlaybackSessionModelMediaElement::allowsTouchBarScrubbing): Deleted.
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
* platform/mac/WebPlaybackControlsManager.h:

Currently the Touch Bar live stream UI lets you seek, which results in broken
behavior on real live streams and on Netflix. Prevent that by preventing scrubbing
for NaN and infinite durations.
* platform/mac/WebPlaybackControlsManager.mm:
(-[WebPlaybackControlsManager canBeginTouchBarScrubbing]):

We can roll out allowsTouchBarScrubbing() and rely on supportsSeeking().
* platform/mac/WebPlaybackSessionInterfaceMac.h:
* platform/mac/WebPlaybackSessionInterfaceMac.mm:
(WebCore::WebPlaybackSessionInterfaceMac::setPlayBackControlsManager):
(WebCore::WebPlaybackSessionInterfaceMac::allowsTouchBarScrubbingChanged): Deleted.

Source/WebKit2:

See WebCore ChangeLog for more details. We can roll out allowsTouchBarScrubbing()
and rely on supportsSeeking().

* UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h:
* UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in:
* UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm:
(WebKit::WebPlaybackSessionModelContext::setAllowsTouchBarScrubbing): Deleted.
(WebKit::WebPlaybackSessionManagerProxy::setAllowsTouchBarScrubbing): Deleted.
* WebProcess/cocoa/WebPlaybackSessionManager.h:
* WebProcess/cocoa/WebPlaybackSessionManager.mm:
(WebKit::WebPlaybackSessionInterfaceContext::allowsTouchBarScrubbingChanged): Deleted.
(WebKit::WebPlaybackSessionManager::allowsTouchBarScrubbingChanged): Deleted.

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

2 years agoMark imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/hkdf.worker.html...
ryanhaddad@apple.com [Tue, 6 Jun 2017 21:27:28 +0000 (21:27 +0000)]
Mark imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/hkdf.worker.html as flaky on mac.
https://bugs.webkit.org/show_bug.cgi?id=170907

Unreviewed test gardening.

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

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

2 years agowebkitpy: Return correct process names from SimulatorProcess
jbedard@apple.com [Tue, 6 Jun 2017 21:02:55 +0000 (21:02 +0000)]
webkitpy: Return correct process names from SimulatorProcess
https://bugs.webkit.org/show_bug.cgi?id=172940

Reviewed by Aakash Jain.

* Scripts/webkitpy/port/darwin.py:
(DarwinPort.plist_data_from_bundle): Share plist access code for accessing different plist entries.
(DarwinPort.app_identifier_from_bundle): Use plist_data_from_bundle.
(DarwinPort.app_executable_from_bundle): Access name of app executable from provided app bundle.
* Scripts/webkitpy/port/driver.py:
(Driver.has_crashed): Use _server_process.process_name() instead of _server_process.name() since
_server_process.name() will not return the correct process name for iOS.
(Driver._check_for_driver_crash_or_unresponsiveness): Ditto.
(Driver._read_block): Ditto.
* Scripts/webkitpy/port/driver_unittest.py:
(DriverTest.test_check_for_driver_crash.FakeServerProcess.process_name): Update since Driver uses
process_name() instead of name().
* Scripts/webkitpy/port/server_process.py:
(ServerProcess._start): Use process_name() instead of name().
(ServerProcess.stop): Ditto.
(ServerProcess.name): Deleted.
* Scripts/webkitpy/port/simulator_process.py:
(SimulatorProcess.process_name): Check the provided bundle for the process name.

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

2 years agotest-webkitpy: stop forking unsafely from within a spawned process
commit-queue@webkit.org [Tue, 6 Jun 2017 20:39:08 +0000 (20:39 +0000)]
test-webkitpy: stop forking unsafely from within a spawned process
https://bugs.webkit.org/show_bug.cgi?id=172774

Patch by Dean Johnson <dean_johnson@apple.com> on 2017-06-06
Reviewed by Darin Adler.

* Scripts/webkitpy/common/net/buildbot/buildbot.py:
(Builder.__init__): We don't use mechanize.Browser() as part of testing, so only initialize it when
it's going to be used.
(Builder.force_build):

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

2 years agoUnreviewed GTK+ gardening.
zandobersek@gmail.com [Tue, 6 Jun 2017 20:28:34 +0000 (20:28 +0000)]
Unreviewed GTK+ gardening.

* platform/gtk/TestExpectations: Clean up the Web Crypto API test expectations.
Unskip the crypto/subtle/, crypto/workers/subtle/ and
imported/w3c/web-platform-tests/WebCryptoAPI/ directories and add expectations
that skip the remaining failing layout tests, instead of skipping those
directories and maintaining expectations for the passing tests.

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

2 years agowebkitpy: Process crash-logs for iOS devices
jbedard@apple.com [Tue, 6 Jun 2017 20:25:15 +0000 (20:25 +0000)]
webkitpy: Process crash-logs for iOS devices
https://bugs.webkit.org/show_bug.cgi?id=171976
<rdar://problem/32134551>

Reviewed by David Kilzer.

When running layout tests on an iOS device, crash logs should be processed.
Implement crash log searching and parsing for iOS devices.

* Scripts/webkitpy/common/system/crashlogs.py:
(CrashLogs): Moved process regular expression for Darwin to class variable.
(CrashLogs.__init__): Accept optional list of crash logs to ignore.
(CrashLogs.find_newest_log): Add iOS as a potential platform.
(CrashLogs.find_all_logs): Ditto.
(CrashLogs._parse_darwin_crash_log): Share code for parsing of Darwin crash logs.
Do not assume that a Darwin crash log starts with the process.
(CrashLogs._find_newest_log_darwin): Remove .app in process name for iOS, use
shared code for parsing Darwin crash logs.
(CrashLogs._find_newest_log_darwin.is_crash_log): Skip crash logs passed into this
object so that crash logs already on the system before testing are not parsed.
(CrashLogs._find_newest_log_win.is_crash_log): Ditto.
(CrashLogs._find_all_logs_darwin.is_crash_log): Ditto.
(CrashLogs._find_all_logs_darwin): Use shared code for parsing Darwin crash logs.
* Scripts/webkitpy/common/system/crashlogs_unittest.py:
(make_mock_crash_report_darwin): Crash logs may not have their process on the first line.
* Scripts/webkitpy/common/system/systemhost.py:
(SystemHost.symbolicate_crash_log_if_needed): The symbolicated crash log for most
systems is just the crashlog, use this behavior by default.
* Scripts/webkitpy/common/system/systemhost_mock.py:
(MockSystemHost.symbolicate_crash_log_if_needed): The symbolicated crash log for most
systems is just the crashlog, use this behavior by default.
* Scripts/webkitpy/port/apple.py:
(ApplePort): Add a dictionary mapping hosts to a list of crash logs to be skipped.
(ApplePort.setup_test_run): Set the list of crash logs to be skipped to the crash logs on
the system before testing begins
* Scripts/webkitpy/port/base.py:
(Port._get_crash_log): Pass optional target host when getting crash logs.
* Scripts/webkitpy/port/darwin.py:
(DarwinPort._look_for_all_crash_logs_in_log_dir): Pass list of crash logs to be skipped to
CrashLogs object.
(DarwinPort._get_crash_log): Pass optional target host when getting crash logs, pass list of crash
logs to be skipped to CrashLogs object.
* Scripts/webkitpy/port/darwin_testcase.py:
(DarwinTest.test_get_crash_log): Removed unused local function.
(DarwinTest.test_get_crash_log.fake_time_cb): Deleted.
* Scripts/webkitpy/port/device.py:
(Device.symbolicate_crash_log_if_needed): If the platform device has a function with this
name, call it. Otherwise, assume the default behavior and read the file at the provided path.
* Scripts/webkitpy/port/driver.py:
(Driver._get_crash_log): Pass optional target host when getting crash logs.
* Scripts/webkitpy/port/gtk.py:
(GtkPort._get_crash_log): Pass optional target host when getting crash logs.
* Scripts/webkitpy/port/ios.py: Ditto.
(IOSPort.setup_test_run): Each device is treated as an independent host. Set the list of crash logs
to be skipped for each host.
* Scripts/webkitpy/port/ios_device.py:
(IOSDevicePort.path_to_crash_logs): Consult apple_additions for the path to crash logs.
(IOSDevicePort._look_for_all_crash_logs_in_log_dir): Search every connected device for
crash logs and pass list of crash logs to ignore to each instance of CrashLogs.
(IOSDevicePort._get_crash_log): Search the specified target host for a crash log if a target
host is specified. Else, search all connected devices for the specified crash-log.
(IOSDevicePort.look_for_new_crash_logs): Deleted.
* Scripts/webkitpy/port/ios_device_unittest.py:
(IOSDeviceTest.test_crashlog_path): Without apple_additions, an exception should be raised.
(IOSDeviceTest.test_get_crash_log): Ditto.
* Scripts/webkitpy/port/simulator_process.py:
(SimulatorProcess.process_name): Check the provided bundle for the process name.
* Scripts/webkitpy/port/win.py:
(WinPort._get_crash_log): Pass optional target host when getting crash logs, pass list of crash
logs to be skipped to CrashLogs object.
* Scripts/webkitpy/port/wpe.py:
(WPEPort._get_crash_log): Pass optional target host when getting crash logs.

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

2 years agoAdd missing <functional> includes
annulen@yandex.ru [Tue, 6 Jun 2017 20:10:03 +0000 (20:10 +0000)]
Add missing <functional> includes
https://bugs.webkit.org/show_bug.cgi?id=173017

Patch by Thiago Macieira <thiago.macieira@intel.com>
Reviewed by Yusuke Suzuki.

This patch fixes compilation with GCC 7.

Source/JavaScriptCore:

* inspector/InspectorBackendDispatcher.h:

Source/WebCore:

No new tests needed.

* css/CSSValue.h:
* css/StyleSheetContents.h:
* loader/NetscapePlugInStreamLoader.h:
* loader/ResourceLoader.h:

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

2 years agoMove storage/websql/alter-to-info-table.html failure expectation.
jbedard@apple.com [Tue, 6 Jun 2017 20:06:57 +0000 (20:06 +0000)]
Move storage/websql/alter-to-info-table.html failure expectation.
https://bugs.webkit.org/show_bug.cgi?id=156718

Unreviewed test gardening

storage/websql/alter-to-info-table.html fails on iOS-simulator,
but passes on device.

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

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

2 years agoMark media/fullscreen-api-enabled-media-with-presentation-mode.html is failing.
ryanhaddad@apple.com [Tue, 6 Jun 2017 19:52:48 +0000 (19:52 +0000)]
Mark media/fullscreen-api-enabled-media-with-presentation-mode.html is failing.
https://bugs.webkit.org/show_bug.cgi?id=172998

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

2 years agoFix compilation with !ENABLE(SVG_FONTS)
annulen@yandex.ru [Tue, 6 Jun 2017 19:51:04 +0000 (19:51 +0000)]
Fix compilation with !ENABLE(SVG_FONTS)
https://bugs.webkit.org/show_bug.cgi?id=172731

Reviewed by Darin Adler.

No new tests needed.

* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::load):

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

2 years agoSafari doesn't load newest The Order of the Stick comic.
zalan@apple.com [Tue, 6 Jun 2017 19:35:56 +0000 (19:35 +0000)]
Safari doesn't load newest The Order of the Stick comic.
https://bugs.webkit.org/show_bug.cgi?id=172949
<rdar://problem/32389730>

Reviewed by Antti Koivisto.

Source/WebCore:

As part of the table layout, RenderTableSection::layoutRows calls the RenderTableCell's layout() directly
(skipping the RenderTableRow parent). If during this call the RenderTableCell (or any of its descendant) marks the ancestor
chain dirty, this dirty flag on the RenderTableRows will never be cleared and we'll end up early returning from RenderTableSection::paint.
For certain type of float objects, we need to invalidate the line layout path during layout (and we mark the ancestors dirty).
This patch takes a conservative approach and marks the ancestors dirty only when the renderer is not dirty yet, but
as part of webkit.org/b/172947 we should revisit and validate whether the setNeedsLayout() is required at all.

Test: fast/table/floating-table-sibling-is-invisible.html

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::invalidateLineLayoutPath):

LayoutTests:

* fast/table/floating-table-sibling-is-invisible-expected.html: Added.
* fast/table/floating-table-sibling-is-invisible.html: Added.

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

2 years agoMove WTF_ATTRIBUTE_PRINTF() from implementation to declaration
ddkilzer@apple.com [Tue, 6 Jun 2017 18:45:24 +0000 (18:45 +0000)]
Move WTF_ATTRIBUTE_PRINTF() from implementation to declaration
<https://webkit.org/b/172804>

Reviewed by Darin Adler.

WTF_ATTRIBUTE_PRINTF() only works outside the current
compilation unit if it's on the declaration, not the
implementation, of a function or class method.

* DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp:
* DumpRenderTree/TestNetscapePlugIn/PluginObject.h:
* DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp:
* DumpRenderTree/TestNetscapePlugIn/PluginTest.h:
- Move WTF_ATTRIBUTE_PRINTF() macro to declaration.
* DumpRenderTree/TestNetscapePlugIn/main.cpp:
- Remove redundant CRASH() macro definition.  Use the one from
  <wtf/Assertions.h> instead.

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

2 years agoUnreviewed, fix 32-bit build.
fpizlo@apple.com [Tue, 6 Jun 2017 18:35:41 +0000 (18:35 +0000)]
Unreviewed, fix 32-bit build.

* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_unreachable):

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

2 years ago[Cocoa] Set defaults for mediaContentTypesRequiringHardwareSupport setting
jer.noble@apple.com [Tue, 6 Jun 2017 18:28:55 +0000 (18:28 +0000)]
[Cocoa] Set defaults for mediaContentTypesRequiringHardwareSupport setting
https://bugs.webkit.org/show_bug.cgi?id=173008

Reviewed by Eric Carlson.

Source/WebKit/mac:

Add a private preference (with default) for the mediaContentTypesRequiringHardwareSupport WebCore setting.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences mediaUserGestureInheritsFromDocument]):
(-[WebPreferences setMediaUserGestureInheritsFromDocument:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKit2:

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

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

2 years ago[css-conditional] The one-string version of CSS.supports should be wrapped in implied...
commit-queue@webkit.org [Tue, 6 Jun 2017 18:27:53 +0000 (18:27 +0000)]
[css-conditional] The one-string version of CSS.supports should be wrapped in implied parentheses.
https://bugs.webkit.org/show_bug.cgi?id=172906

Patch by Emilio Cobos Álvarez <ecobos@igalia.com> on 2017-06-06
Reviewed by Darin Adler.

Source/WebCore:

From https://drafts.csswg.org/css-conditional/#the-css-interface:

> When invoked with a single conditionText argument, it must return
> true if conditionText, when either parsed and evaluated as a
> supports_condition or parsed as a declaration, wrapped in implied
> parentheses, and evaluated as a supports_condition, would return
> true.

Note the "wrapped in implied parentheses" bit.

Gecko is fixing it in https://bugzil.la/1338486, and Blink in
https://crbug.com/729403.

Tests: css3/supports-dom-api.html
       imported/w3c/web-platform-tests/cssom/CSS.html

* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseSupportsCondition):
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::consumeSupportsRule):
* css/parser/CSSSupportsParser.cpp:
(WebCore::CSSSupportsParser::supportsCondition):
* css/parser/CSSSupportsParser.h:

LayoutTests:

* css3/supports-dom-api-expected.txt:
* css3/supports-dom-api.html: Added test

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

2 years agoUnreviewed rollout r217807. Caused a test to crash.
joepeck@webkit.org [Tue, 6 Jun 2017 18:15:31 +0000 (18:15 +0000)]
Unreviewed rollout r217807. Caused a test to crash.

JSTests:

* heapProfiler/class-names.js: Removed.
* heapProfiler/driver/driver.js:
(CheapHeapSnapshotNode):
(CheapHeapSnapshot):
(createCheapHeapSnapshot):
(HeapSnapshot):
(createHeapSnapshot):
* typeProfiler/inheritance.js:
(wrapper.A):
(wrapper.B):
(wrapper.C):
(wrapper):

Source/JavaScriptCore:

* heap/HeapSnapshotBuilder.cpp:
(JSC::HeapSnapshotBuilder::buildSnapshot):
(JSC::HeapSnapshotBuilder::json):
(): Deleted.
* heap/HeapSnapshotBuilder.h:
* runtime/JSObject.cpp:
(JSC::JSObject::calculatedClassName):

Source/WebInspectorUI:

* UserInterface/Proxies/HeapSnapshotNodeProxy.js:
(WebInspector.HeapSnapshotNodeProxy):
(WebInspector.HeapSnapshotNodeProxy.deserialize):
* UserInterface/Views/HeapSnapshotClassDataGridNode.js:
(WebInspector.HeapSnapshotClassDataGridNode.prototype.createCellContent):
* UserInterface/Views/HeapSnapshotClusterContentView.js:
(WebInspector.HeapSnapshotClusterContentView.iconStyleClassNameForClassName):
* UserInterface/Views/HeapSnapshotDataGridTree.js:
(WebInspector.HeapSnapshotInstancesDataGridTree.prototype.populateTopLevel):
* UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
(WebInspector.HeapSnapshotInstanceDataGridNode.prototype.createCellContent):
(WebInspector.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler.appendPathRow):
* UserInterface/Workers/HeapSnapshot/HeapSnapshot.js:
(HeapSnapshot):
(HeapSnapshot.updateCategoriesAndMetadata):
(HeapSnapshot.prototype.serializeNode):
(HeapSnapshot.prototype._gcRootPathes.visitNode):
(HeapSnapshot.prototype._gcRootPathes):

LayoutTests:

* inspector/unit-tests/heap-snapshot-expected.txt:
* inspector/unit-tests/heap-snapshot.html:

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

2 years agoAdd a WebGPU test to the experimental features test page
joepeck@webkit.org [Tue, 6 Jun 2017 18:11:21 +0000 (18:11 +0000)]
Add a WebGPU test to the experimental features test page
https://bugs.webkit.org/show_bug.cgi?id=172953

Reviewed by Darin Adler.

* experimental-features.html:

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

2 years agoMove Resource Timing / User Timing from experimental features into main preferences
joepeck@webkit.org [Tue, 6 Jun 2017 18:11:19 +0000 (18:11 +0000)]
Move Resource Timing / User Timing from experimental features into main preferences
https://bugs.webkit.org/show_bug.cgi?id=172950

Reviewed by Darin Adler.

Source/WebCore:

* features.json:
Graduate some features from In Development to Supported.

Source/WebKit2:

* Shared/WebPreferencesDefinitions.h:
Move Resource Timing and User Timing out of the Experimental Features section.

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(enableExperimentalFeatures):
(resetWebPreferencesToConsistentValues):
* DumpRenderTree/win/DumpRenderTree.cpp:
(enableExperimentalFeatures):
(resetWebPreferencesToConsistentValues):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):
Move out no longer experimental features to the main list.

Websites/webkit.org:

* experimental-features.html:
Remove no longer experimental features.

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

2 years agoindex out of bound in bytecodebasicblock
fpizlo@apple.com [Tue, 6 Jun 2017 18:08:17 +0000 (18:08 +0000)]
index out of bound in bytecodebasicblock
https://bugs.webkit.org/show_bug.cgi?id=172963

Reviewed by Saam Barati and Mark Lam.
JSTests:

* stress/dfg-call-class-constructor.js: Added.
(Foo):
(i.catch):

Source/JavaScriptCore:

We were leaving an unterminated basic block when generating CodeForCall for a class
constructor. This was mostly benign since that unterminated block was not reachable, but it
does cause an ASSERT.

This fixes the issue by appending op_unreachable to that block. I added op_unreachable because
this really is the cleanest and most idiomatic way to solve this problem, so even though it
makes the change bigger it's probabably worth it.

* bytecode/BytecodeDumper.cpp:
(JSC::BytecodeDumper<Block>::dumpBytecode):
* bytecode/BytecodeList.json:
* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):
* bytecode/Opcode.h:
(JSC::isTerminal):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::generate):
(JSC::BytecodeGenerator::emitUnreachable):
* bytecompiler/BytecodeGenerator.h:
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGCapabilities.cpp:
(JSC::DFG::capabilityLevel):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileUnreachable):
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
* jit/JIT.h:
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_unreachable):
* llint/LowLevelInterpreter.asm:
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/CommonSlowPaths.h:

Source/WTF:

* wtf/Assertions.h:
(UNREACHABLE_FOR_PLATFORM):

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

2 years agoRebaseline and enable media/modern-media-controls/audio
graouts@webkit.org [Tue, 6 Jun 2017 17:41:44 +0000 (17:41 +0000)]
Rebaseline and enable media/modern-media-controls/audio
https://bugs.webkit.org/show_bug.cgi?id=172996
<rdar://problem/32590725>

Reviewed by Eric Carlson.

The new controls design switches the AirPlay and mute button order around.

* media/modern-media-controls/audio/audio-controls-buttons-expected.txt:
* media/modern-media-controls/audio/audio-controls-buttons.html:
* platform/ios-simulator/TestExpectations:
* platform/mac/TestExpectations:

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

2 years ago[GTK][Wayland] Do not pass value of $DISPLAY to wl_display_connect()
aperez@igalia.com [Tue, 6 Jun 2017 17:13:00 +0000 (17:13 +0000)]
[GTK][Wayland] Do not pass value of $DISPLAY to wl_display_connect()
https://bugs.webkit.org/show_bug.cgi?id=172993

Reviewed by Žan Doberšek.

No new tests needed.

* platform/graphics/wayland/PlatformDisplayWayland.cpp:
(WebCore::PlatformDisplayWayland::create): Instead of using the "DISPLAY" environment variable (meant for X11),
pass a null pointer to "wl_display_connect()". This function checks the value of the "WAYLAND_DISPLAY" environment
variable itself and therefore we do not need to pass it ourselves.

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

2 years agoAdd an option to disable getUserMedia prompt in case of mock capture sources
commit-queue@webkit.org [Tue, 6 Jun 2017 16:53:55 +0000 (16:53 +0000)]
Add an option to disable getUserMedia prompt in case of mock capture sources
https://bugs.webkit.org/show_bug.cgi?id=172981
<rdar://problem/32580325>

Patch by Youenn Fablet <youenn@apple.com> on 2017-06-06
Reviewed by Eric Carlson.

Source/WebKit/mac:

Defining the option, getter and setter.

* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences mockCaptureDevicesPromptEnabled]):
(-[WebPreferences setMockCaptureDevicesPromptEnabled:]):
* WebView/WebPreferencesPrivate.h:

Source/WebKit2:

Adding mockCaptureDevicesPromptEnabled option.
Allowing any getUserMedia request if mock is on and prompt is off.

Renaming UserMediaProcessManager::willEnableMediaStreamInPage to muteCaptureMediaStreamsExceptIn.
This eases reading the code.
Making sure that a page for which a new getUserMedia MediaStream will be created is capture-unmuted.

* Shared/WebPreferencesDefinitions.h:
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
* UIProcess/UserMediaProcessManager.cpp:
(WebKit::UserMediaProcessManager::muteCaptureMediaStreamsExceptIn):
(WebKit::UserMediaProcessManager::willCreateMediaStream):
* UIProcess/UserMediaProcessManager.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setMuted):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::activateMediaStreamCaptureInPage):

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

2 years agoRebaseline and enable media/modern-media-controls/airplay-support
graouts@webkit.org [Tue, 6 Jun 2017 16:29:20 +0000 (16:29 +0000)]
Rebaseline and enable media/modern-media-controls/airplay-support
https://bugs.webkit.org/show_bug.cgi?id=172980
Source/WebCore:

Reviewed by Eric Carlson.

Fixing a small issue in the modern media controls code which would yield
an error when manually creating a MediaController without a MediaControlsHost.

* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype.get isAudio):

LayoutTests:

<rdar://problem/32589074>

Reviewed by Eric Carlson.

The test passes as-is on macOS, but needs to be skipped on iOS since we can't test AirPlay.

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

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

2 years agoRebaseline and enable media/modern-media-controls/airplay-placard
graouts@webkit.org [Tue, 6 Jun 2017 16:27:38 +0000 (16:27 +0000)]
Rebaseline and enable media/modern-media-controls/airplay-placard
https://bugs.webkit.org/show_bug.cgi?id=172977
<rdar://problem/32588681>

Reviewed by Eric Carlson.

These two tests work fine as-is, we just need to enable them.

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

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

2 years agoRebaseline and enable media/modern-media-controls/airplay-button
graouts@webkit.org [Tue, 6 Jun 2017 16:26:03 +0000 (16:26 +0000)]
Rebaseline and enable media/modern-media-controls/airplay-button
https://bugs.webkit.org/show_bug.cgi?id=172975
<rdar://problem/32588422>

Reviewed by Eric Carlson.

* media/modern-media-controls/airplay-button/airplay-button-expected.txt:
* media/modern-media-controls/airplay-button/airplay-button-on.html: Remove some unnecessary
code, the path to the icon directory is provided directly by media-controls-loader.js.
* media/modern-media-controls/airplay-button/airplay-button.html: Remove the test for the "icon"
CSS class since buttons no longer carry this class. We also update the assumptions to use SVG
assets.
* platform/ios-simulator/TestExpectations:
* platform/mac/TestExpectations:

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

2 years agoUnreviewed, rolling out r217812.
ryanhaddad@apple.com [Tue, 6 Jun 2017 16:16:13 +0000 (16:16 +0000)]
Unreviewed, rolling out r217812.

This change caused test failures on arm64.

Reverted changeset:

"OMG tier up checks should be a patchpoint"
https://bugs.webkit.org/show_bug.cgi?id=172944
http://trac.webkit.org/changeset/217812

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

2 years ago[WPE] Enable remote inspector
carlosgc@webkit.org [Tue, 6 Jun 2017 15:19:59 +0000 (15:19 +0000)]
[WPE] Enable remote inspector
https://bugs.webkit.org/show_bug.cgi?id=172971

Reviewed by Žan Doberšek.

.:

Add private option for remote inspector enabled by default.

* Source/cmake/OptionsWPE.cmake:

Source/JavaScriptCore:

We can just build the current glib remote inspector, without adding a frontend implementation and using a
WebKitGTK+ browser as frontend for now.

* PlatformWPE.cmake: Add remote inspector files to compilation.
* inspector/remote/glib/RemoteInspectorUtils.cpp:
(Inspector::backendCommands): Load the inspector resources library.

Source/WebKit2:

Initialize the remote inpector if needed.

* UIProcess/wpe/WebProcessPoolWPE.cpp:
(WebKit::initializeRemoteInspectorServer):
(WebKit::WebProcessPool::platformInitialize):

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

2 years ago[GLIB] Make remote inspector DBus protocol common to all glib based ports
carlosgc@webkit.org [Tue, 6 Jun 2017 15:16:50 +0000 (15:16 +0000)]
[GLIB] Make remote inspector DBus protocol common to all glib based ports
https://bugs.webkit.org/show_bug.cgi?id=172970

Reviewed by Žan Doberšek.

Source/JavaScriptCore:

We are currently using "webkitgtk" in the names of DBus interfaces and object paths inside an ifdef with the
idea that other ports could use their own names. However, the protocol is the same, so we could use the same
names and make all glib based ports compatible to each other. This way we could use the GTK+ MiniBrowser to
debug WPE, without having to implement the frontend part in WPE yet.

* inspector/remote/glib/RemoteInspectorGlib.cpp: Use webkit instead of webkitgtk and reomve platform idfeds.
* inspector/remote/glib/RemoteInspectorServer.cpp: Ditto.

Source/WebKit2:

Use webkit instead of webkitgtk and reomve platform idfeds.

* UIProcess/glib/RemoteInspectorClient.cpp:

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

2 years ago[GTK] Web Process deadlock when closing the remote inspector frontend
carlosgc@webkit.org [Tue, 6 Jun 2017 15:15:10 +0000 (15:15 +0000)]
[GTK] Web Process deadlock when closing the remote inspector frontend
https://bugs.webkit.org/show_bug.cgi?id=172973

Reviewed by Žan Doberšek.

We are taking the remote inspector mutex twice. First close message is received, and receivedCloseMessage()
takes the mutex. Then RemoteConnectionToTarget::close() is called that, when connected, calls
PageDebuggable::disconnect() that ends up calling RemoteInspector::updateTarget() that also takes the remote
inspector mutex. We should release the mutex before calling RemoteConnectionToTarget::close().

* inspector/remote/glib/RemoteInspectorGlib.cpp:
(Inspector::RemoteInspector::receivedCloseMessage):

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

2 years agostruct does not accept initializer-form if member has initializers in GCC 4.9
utatane.tea@gmail.com [Tue, 6 Jun 2017 14:53:57 +0000 (14:53 +0000)]
struct does not accept initializer-form if member has initializers in GCC 4.9
https://bugs.webkit.org/show_bug.cgi?id=172974

Reviewed by Carlos Garcia Campos.

struct cannot accept initializer-form constructor (like, `ListNode<T> t { ... }`) if
the member of the struct has a default initializer.
Here is a simple snippet.

template<typename T>
struct Pair {
    T* prev { nullptr };
    T* next { nullptr };
};

Pair<int> pair { nullptr, nullptr };  // compile erorr in GCC 4.9.

Instead, we define a default constructor (to invoke default initializers) and a constructor
to accept the above initialization.

* bmalloc/List.h:
(bmalloc::ListNode::ListNode):
(bmalloc::List::iterator::iterator):

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

2 years ago[WPE] Don't disable Web security preference by default
zandobersek@gmail.com [Tue, 6 Jun 2017 14:46:45 +0000 (14:46 +0000)]
[WPE] Don't disable Web security preference by default
https://bugs.webkit.org/show_bug.cgi?id=172964

Reviewed by Carlos Garcia Campos.

* UIProcess/API/wpe/WPEView.cpp:
(WKWPE::View::View): Don't disable Web security by default.

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

2 years agoTry to fix the GTK build.
ggaren@apple.com [Tue, 6 Jun 2017 14:39:51 +0000 (14:39 +0000)]
Try to fix the GTK build.

Unreviewed.

* bmalloc/List.h:
(bmalloc::List::List):

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

2 years agoUpdate modern media controls testing utilities
graouts@webkit.org [Tue, 6 Jun 2017 14:30:47 +0000 (14:30 +0000)]
Update modern media controls testing utilities
https://bugs.webkit.org/show_bug.cgi?id=172976
<rdar://problem/32588432>

Reviewed by Eric Carlson.

Source/WebCore:

Stop logging an error when we're not able to load UI Strings since UI strings
are not defined in the majority of modern-media-controls tests as we load the
code directly from the modern-media-controls module and can't reach into the
English.lproj directory, nor is it necessary.

* Modules/modern-media-controls/main.js:
(UIString):

LayoutTests:

Update the list of CSS files to load to match the current list of
existing CSS files in the modern-media-controls module.

* media/modern-media-controls/resources/media-controls-loader.js:

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

2 years ago[WPE] Add an install-dependencies script
clopez@igalia.com [Tue, 6 Jun 2017 11:46:31 +0000 (11:46 +0000)]
[WPE] Add an install-dependencies script
https://bugs.webkit.org/show_bug.cgi?id=172948

Reviewed by Žan Doberšek.

It is based on the gtk/install-dependencies script.
Includes support for Debian based distrubutions, Fedora and Arch.
It has been tested on a minimal Debian 9 chroot.

* wpe/install-dependencies: Added.

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

2 years ago[GStreamer] Use the same draw timer and mutex when AC disabled or building without...
carlosgc@webkit.org [Tue, 6 Jun 2017 09:01:12 +0000 (09:01 +0000)]
[GStreamer] Use the same draw timer and mutex when AC disabled or building without OpenGL
https://bugs.webkit.org/show_bug.cgi?id=172923

Reviewed by Michael Catanzaro.

We have two different paths to do the same. When building without OpenGL, the VideoRenderRequestScheduler has
its own timer and we need to add ifdefs to handle that. But when building with OpenGL we still support
non-accelerated rendering that does the same than the VideoRenderRequestScheduler timer, but using the media
player timer instead. We can simplify the code and remove more ifdefs by using the media player timer and mutex
in all cases for non-accelerated rendering.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
(WebCore::MediaPlayerPrivateGStreamerBase::repaint):
(WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
(WebCore::MediaPlayerPrivateGStreamerBase::cancelRepaint):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
(VideoRenderRequestScheduler::start):
(VideoRenderRequestScheduler::stop):
(VideoRenderRequestScheduler::requestRender):
(VideoRenderRequestScheduler::VideoRenderRequestScheduler): Deleted.
(VideoRenderRequestScheduler::render): Deleted.

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

2 years agoUpdate media controls to match latest design specs
graouts@webkit.org [Tue, 6 Jun 2017 08:10:39 +0000 (08:10 +0000)]
Update media controls to match latest design specs
https://bugs.webkit.org/show_bug.cgi?id=172932

Reviewed by Dean Jackson.

Source/WebCore:

The media controls specs have changed and we now implement them. The main controls bar now
appears to be floating, with a rounded corners and a margin around it. Some of the controls
it used to contain now may appear outside of it. Specifically, the fullscreen and
picture-in-picture buttons now are displayed in a dedicated controls bar in the top-left
corner and the mute button, on iOS (where we don't support changing the volume when inline),
is displayed in the top right corner.

Another small UI improvement is that we display an activity indicator when we are waiting
for data to initiate or resume playback instead of showing the elapsed time label. We also
make displaying the scrubber more important than displaying other controls, except for the
play/pause button, when width becomes scarce. Finally, we no longer use a speci layer type
for the controls bar backgrounds, we now use the same "backdrop-filter" and tint overlay
on both macOS and iOS.

Since this work had previously been done through WebKitAdditions, we remove the specific
build phase code that we added for this purpose and are now only ever looking for media
controls code in the WebCore source tree.

* Modules/modern-media-controls/controls/activity-indicator.css: Added.
(.activity-indicator):
(.activity-indicator > div):
(.activity-indicator > .ne):
(.activity-indicator > .e):
(.activity-indicator > .se):
(.activity-indicator > .s):
(.activity-indicator > .sw):
(.activity-indicator > .w):
(.activity-indicator > .nw):
(@keyframes activity-indicator-pulse):
(to):
* Modules/modern-media-controls/controls/airplay-button.js:
* Modules/modern-media-controls/controls/auto-hide-controller.js: Added.
(AutoHideController):
(AutoHideController.prototype.get fadesWhileIdle):
(AutoHideController.prototype.set fadesWhileIdle):
(AutoHideController.prototype.handleEvent):
(AutoHideController.prototype.gestureRecognizerStateDidChange):
(AutoHideController.prototype.mediaControlsFadedStateDidChange):
(AutoHideController.prototype.mediaControlsBecameInvisible):
(AutoHideController.prototype._cancelNonEnforcedAutoHideTimer):
(AutoHideController.prototype._cancelAutoHideTimer):
(AutoHideController.prototype._resetAutoHideTimer):
(AutoHideController.prototype._autoHideTimerFired):
* Modules/modern-media-controls/controls/background-click-delegate-notifier.js: Added.
(BackgroundClickDelegateNotifier):
(BackgroundClickDelegateNotifier.prototype.handleEvent):
* Modules/modern-media-controls/controls/background-tint.css:
(.background-tint,):
(.background-tint > .blur):
(.background-tint > .tint):
* Modules/modern-media-controls/controls/button.css:
(button):
(button > picture):
(button.skip-back > picture,):
(button.on > picture):
(button:active > picture):
(button.corner):
(button.center,):
(button.center):
(button.small-center):
(button.center > .background-tint,):
(button.center > picture,):
(button.center:active > picture,):
* Modules/modern-media-controls/controls/button.js:
(Button.prototype.get iconName):
(Button.prototype.set iconName):
(Button.prototype.get on):
(Button.prototype.set on):
(Button.prototype.get style):
(Button.prototype.set style):
(Button.prototype.get scaleFactor):
(Button.prototype.set scaleFactor):
(Button.prototype.handleEvent):
(Button.prototype.commit):
(Button.prototype._loadImage):
(Button.prototype._imageSourceDidLoad):
(Button.prototype._updateImage):
(Button.prototype._updateImageMetrics):
(Button):
* Modules/modern-media-controls/controls/buttons-container.css:
(.buttons-container):
(.ios .buttons-container button):
* Modules/modern-media-controls/controls/buttons-container.js:
* Modules/modern-media-controls/controls/controls-bar.css:
(.controls-bar):
(.controls-bar.faded): Deleted.
* Modules/modern-media-controls/controls/controls-bar.js:
(ControlsBar.prototype.get children):
(ControlsBar.prototype.set children):
(ControlsBar.prototype.commitProperty):
(ControlsBar.prototype.get userInteractionEnabled): Deleted.
(ControlsBar.prototype.set userInteractionEnabled): Deleted.
(ControlsBar.prototype.get fadesWhileIdle): Deleted.
(ControlsBar.prototype.set fadesWhileIdle): Deleted.
(ControlsBar.prototype.get visible): Deleted.
(ControlsBar.prototype.set visible): Deleted.
(ControlsBar.prototype.get faded): Deleted.
(ControlsBar.prototype.set faded): Deleted.
(ControlsBar.prototype.handleEvent): Deleted.
(ControlsBar.prototype.gestureRecognizerStateDidChange): Deleted.
(ControlsBar.prototype._cancelNonEnforcedAutoHideTimer): Deleted.
(ControlsBar.prototype._cancelAutoHideTimer): Deleted.
(ControlsBar.prototype._resetAutoHideTimer): Deleted.
(ControlsBar.prototype._autoHideTimerFired): Deleted.
* Modules/modern-media-controls/controls/fullscreen-button.js:
* Modules/modern-media-controls/controls/icon-button.css: Removed.
* Modules/modern-media-controls/controls/icon-button.js: Removed.
* Modules/modern-media-controls/controls/icon-service.js:
(const.iconService.new.IconService.prototype.imageForIconAndLayoutTraits):
(const.iconService.new.IconService.prototype._fileNameAndPlatformForIconAndLayoutTraits):
(const.iconService.new.IconService):
(const.iconService.new.IconService.prototype.imageForIconNameAndLayoutTraits): Deleted.
(const.iconService.new.IconService.prototype._fileNameAndPlatformForIconNameAndLayoutTraits): Deleted.
* Modules/modern-media-controls/controls/inline-layout-support.js: Removed.
* Modules/modern-media-controls/controls/inline-media-controls.css: Added.
(.media-controls.inline > .controls-bar):
(.media-controls.inline > .controls-bar.top-left):
(.media-controls.inline.audio > .controls-bar):
(.media-controls.inline > .controls-bar > *):
(.media-controls.inline > button.mute):
(.media-controls.inline > button.play-pause.corner):
(.media-controls.inline.audio > button.play-pause.corner):
(.media-controls.inline > .controls-bar button):
(.media-controls.inline button.start.center > picture,):
(.media-controls.inline button.start.small-center > picture,):
(.media-controls.inline .time-control,):
* Modules/modern-media-controls/controls/inline-media-controls.js: Added.
(InlineMediaControls):
(InlineMediaControls.prototype.set shouldUseAudioLayout):
(InlineMediaControls.prototype.set shouldUseSingleBarLayout):
(InlineMediaControls.prototype.get showsStartButton):
(InlineMediaControls.prototype.set showsStartButton):
(InlineMediaControls.prototype.showPlacard):
(InlineMediaControls.prototype.hidePlacard):
(InlineMediaControls.prototype.layout):
(InlineMediaControls.prototype.commitProperty):
(InlineMediaControls.prototype.get preferredMuteButtonStyle):
(InlineMediaControls.prototype._topLeftContainerButtons):
(InlineMediaControls.prototype._leftContainerButtons):
(InlineMediaControls.prototype._rightContainerButtons):
(InlineMediaControls.prototype._droppableButtons):
* Modules/modern-media-controls/controls/ios-inline-media-controls.css: Removed.
* Modules/modern-media-controls/controls/ios-inline-media-controls.js:
(IOSInlineMediaControls.prototype.get showsStartButton):
(IOSInlineMediaControls.prototype.set showsStartButton):
(IOSInlineMediaControls.prototype.gestureRecognizerStateDidChange):
(IOSInlineMediaControls.prototype._pinchGestureRecognizerStateDidChange):
(IOSInlineMediaControls.prototype._tapGestureRecognizerStateDidChange):
(IOSInlineMediaControls):
(IOSInlineMediaControls.prototype.layout): Deleted.
(IOSInlineMediaControls.prototype.layoutTraitsDidChange): Deleted.
* Modules/modern-media-controls/controls/layout-item.js:
* Modules/modern-media-controls/controls/layout-node.js:
(LayoutNode.prototype.commitProperty):
* Modules/modern-media-controls/controls/macos-compact-inline-media-controls.css: Removed.
* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css:
(.media-controls.mac.fullscreen .buttons-container.left):
(.media-controls.mac.fullscreen .buttons-container.center):
(.media-controls.mac.fullscreen .time-control):
(.media-controls.mac.fullscreen > .controls-bar .status-label):
(.media-controls.mac.fullscreen > .controls-bar > .background-tint > div): Deleted.
(.media-controls.mac.fullscreen .volume.slider): Deleted.
(.media-controls.mac.fullscreen button.volume-down): Deleted.
(.media-controls.mac.fullscreen button.volume-up): Deleted.
(.media-controls.mac.fullscreen button.rewind): Deleted.
(.media-controls.mac.fullscreen button.play-pause): Deleted.
(.media-controls.mac.fullscreen button.forward): Deleted.
(.media-controls.mac.fullscreen .time-label): Deleted.
(.media-controls.mac.fullscreen .scrubber): Deleted.
* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
(MacOSFullscreenMediaControls.prototype.handleEvent):
(MacOSFullscreenMediaControls.prototype.layout):
(MacOSFullscreenMediaControls.prototype._handleMousedown):
(MacOSFullscreenMediaControls.prototype._handleMousemove):
* Modules/modern-media-controls/controls/macos-inline-media-controls.css:
(.media-controls.mac.inline .volume-slider-container):
(.media-controls.mac.inline.audio .volume-slider-container):
(.media-controls.mac.inline .volume-slider-container > .background-tint):
(.media-controls.mac.inline .volume-slider-container > .background-tint > div):
(.media-controls.mac.inline .volume-slider-container > .slider):
(.media-controls.mac.inline > .controls-bar): Deleted.
(.media-controls.mac.inline > .controls-bar > *): Deleted.
(.media-controls.mac.inline > button.start > div): Deleted.
(.media-controls.mac.inline > .controls-bar button): Deleted.
(.media-controls.mac.inline button.play-pause): Deleted.
(.media-controls.mac.inline button.skip-back): Deleted.
(.media-controls.mac.inline .scrubber.slider): Deleted.
(.media-controls.mac.inline button.mute): Deleted.
(.media-controls.mac.inline button.airplay): Deleted.
(.media-controls.mac.inline button.pip): Deleted.
(.media-controls.mac.inline button.tracks): Deleted.
(.media-controls.mac.inline button.fullscreen): Deleted.
(.media-controls.mac.inline .time-label,): Deleted.
(.media-controls.mac.inline .volume.slider): Deleted.
* Modules/modern-media-controls/controls/macos-inline-media-controls.js:
(MacOSInlineMediaControls.prototype.layout):
(MacOSInlineMediaControls.prototype.get preferredMuteButtonStyle):
(MacOSInlineMediaControls.prototype.handleEvent):
(MacOSInlineMediaControls.prototype.layoutTraitsDidChange): Deleted.
* Modules/modern-media-controls/controls/macos-media-controls.js: Removed.
* Modules/modern-media-controls/controls/media-controls.css:
(:host(audio)):
(*):
(:host(audio), *):
(.media-controls-container):
(.media-controls):
(.media-controls > *):
(.media-controls.shows-tracks-panel > .controls-bar,):
(.media-controls.faded > *:not(.placard)):
(.media-controls .time-label,):
* Modules/modern-media-controls/controls/media-controls.js:
(MediaControls.prototype.get visible):
(MediaControls.prototype.set visible):
(MediaControls.prototype.get faded):
(MediaControls.prototype.set faded):
(MediaControls.prototype.showTracksPanel):
(MediaControls.prototype.hideTracksPanel):
(MediaControls.prototype.isPointInControls):
(MediaControls.prototype.handleEvent):
(MediaControls.prototype.commitProperty):
(MediaControls.prototype.get layoutTraits): Deleted.
(MediaControls.prototype.set layoutTraits): Deleted.
(MediaControls.prototype.get showsStartButton): Deleted.
(MediaControls.prototype.set showsStartButton): Deleted.
(MediaControls.prototype.get placard): Deleted.
(MediaControls.prototype.get showsPlacard): Deleted.
(MediaControls.prototype.showPlacard): Deleted.
(MediaControls.prototype.hidePlacard): Deleted.
(MediaControls.prototype.controlsBarVisibilityDidChange): Deleted.
(MediaControls.prototype.controlsBarFadedStateDidChange): Deleted.
(MediaControls.prototype.layoutTraitsDidChange): Deleted.
(MediaControls.prototype.layout): Deleted.
(MediaControls.prototype._invalidateChildren): Deleted.
* Modules/modern-media-controls/controls/media-document.css:
(:host(.media-document)):
(:host(.media-document.audio.mac)):
* Modules/modern-media-controls/controls/mute-button.js:
* Modules/modern-media-controls/controls/pip-button.js:
* Modules/modern-media-controls/controls/placard.css:
(.placard):
(.placard .container):
(.placard button):
(.placard button > picture):
(.placard .icon): Deleted.
* Modules/modern-media-controls/controls/placard.js:
(Placard.):
(Placard.prototype.layout):
* Modules/modern-media-controls/controls/play-pause-button.js:
(PlayPauseButton):
(PlayPauseButton.prototype.commit):
* Modules/modern-media-controls/controls/scheduler.js:
(const.scheduler.new.prototype.scheduleLayout):
(const.scheduler.new.prototype.unscheduleLayout):
(const.scheduler.new.prototype._requestFrameIfNeeded):
(const.scheduler.new.prototype._frameDidFire):
(const.scheduler.new.prototype._layout):
* Modules/modern-media-controls/controls/scrubber.js: Removed.
* Modules/modern-media-controls/controls/seek-button.js:
* Modules/modern-media-controls/controls/skip-back-button.js:
* Modules/modern-media-controls/controls/skip-forward-button.js: Added.
(SkipForwardButton):
* Modules/modern-media-controls/controls/slider.css:
(.slider):
(.slider > .custom-slider,):
(.slider > .custom-slider):
(.slider > .custom-slider > *):
(.slider > .custom-slider > .fill):
(.slider > .custom-slider > .track):
(.slider > .custom-slider > .primary):
(.slider > .custom-slider > .secondary):
(.slider > .custom-slider > .knob):
(.slider > input):
(.slider > input::-webkit-slider-thumb):
(.slider.disabled > input,):
(.ios .slider > input):
(.ios .slider > input::-webkit-slider-runnable-track):
(.ios .slider > input::-webkit-slider-thumb):
(.slider > canvas,): Deleted.
(.slider > canvas): Deleted.
* Modules/modern-media-controls/controls/slider.js:
(Slider.prototype.set inputAccessibleLabel):
(Slider.prototype.get disabled):
(Slider.prototype.set disabled):
(Slider.prototype.get secondaryValue):
(Slider.prototype.set secondaryValue):
(Slider.prototype._formatTime):
(Slider.prototype.commitProperty):
(Slider.prototype.commit):
(Slider.prototype.draw): Deleted.
(addRoundedRect): Deleted.
* Modules/modern-media-controls/controls/start-button.css: Removed.
* Modules/modern-media-controls/controls/start-button.js: Removed.
* Modules/modern-media-controls/controls/status-label.css:
(.status-label):
* Modules/modern-media-controls/controls/status-label.js:
(StatusLabel.prototype.get enabled):
(StatusLabel.prototype.set enabled): Deleted.
* Modules/modern-media-controls/controls/text-tracks.css:
(video::-webkit-media-text-track-container):
(video::-webkit-media-text-track-container.visible-controls-bar):
(video::-webkit-media-text-track-container.visible-controls-bar.compact-controls-bar): Deleted.
* Modules/modern-media-controls/controls/time-control.js:
(TimeControl.prototype.set duration):
(TimeControl.prototype.set currentTime):
(TimeControl.prototype.get loading):
(TimeControl.prototype.set loading):
(TimeControl.prototype.get minimumWidth):
(TimeControl.prototype.get idealMinimumWidth):
(TimeControl.prototype.layout):
(TimeControl.prototype._performIdealLayout):
(TimeControl.prototype.get useSixDigitsForTimeLabels): Deleted.
(TimeControl.prototype.set useSixDigitsForTimeLabels): Deleted.
(TimeControl.prototype.get isSufficientlyWide): Deleted.
* Modules/modern-media-controls/controls/time-label.css:
(.time-label):
* Modules/modern-media-controls/controls/time-label.js:
(TimeLabel.prototype.setValueWithNumberOfDigits):
(TimeLabel.prototype.commitProperty):
(TimeLabel.prototype._formattedTime):
(doubleDigits):
(TimeLabel.prototype.set value): Deleted.
* Modules/modern-media-controls/controls/tracks-button.js:
* Modules/modern-media-controls/controls/tracks-panel.css:
(.tracks-panel > .scrollable-container):
(.tracks-panel section):
(.tracks-panel section > h3):
(.tracks-panel > .background-tint > div,): Deleted.
* Modules/modern-media-controls/controls/volume-down-button.js:
* Modules/modern-media-controls/controls/volume-slider.css: Removed.
* Modules/modern-media-controls/controls/volume-slider.js: Removed.
* Modules/modern-media-controls/controls/volume-up-button.js:
* Modules/modern-media-controls/gesture-recognizers/gesture-recognizer.js:
(GestureRecognizer.prototype.gestureBegan):
(GestureRecognizer.prototype._removeTrackingListeners):
* Modules/modern-media-controls/gesture-recognizers/tap.js:
(TapGestureRecognizer.prototype.touchesMoved):
* Modules/modern-media-controls/images/iOS/Airplay.svg: Added.
* Modules/modern-media-controls/images/iOS/EnterFullscreen.svg: Added.
* Modules/modern-media-controls/images/iOS/MediaSelector.svg: Added.
* Modules/modern-media-controls/images/iOS/MiniPipIn.svg: Added.
* Modules/modern-media-controls/images/iOS/Mute.svg: Added.
* Modules/modern-media-controls/images/iOS/Pause.svg: Added.
* Modules/modern-media-controls/images/iOS/PipIn.svg: Added.
* Modules/modern-media-controls/images/iOS/Play.svg: Added.
* Modules/modern-media-controls/images/iOS/SkipBack15.svg: Added.
* Modules/modern-media-controls/images/iOS/SkipForward15.svg: Added.
* Modules/modern-media-controls/images/iOS/VolumeHi.svg: Added.
* Modules/modern-media-controls/images/iOS/airplay@1x.png: Removed.
* Modules/modern-media-controls/images/iOS/airplay@2x.png: Removed.
* Modules/modern-media-controls/images/iOS/enter-fullscreen@1x.png: Removed.
* Modules/modern-media-controls/images/iOS/enter-fullscreen@2x.png: Removed.
* Modules/modern-media-controls/images/iOS/enter-fullscreen@3x.png: Removed.
* Modules/modern-media-controls/images/iOS/interval-skip-back@1x.png: Removed.
* Modules/modern-media-controls/images/iOS/interval-skip-back@2x.png: Removed.
* Modules/modern-media-controls/images/iOS/interval-skip-back@3x.png: Removed.
* Modules/modern-media-controls/images/iOS/pause@1x.png: Removed.
* Modules/modern-media-controls/images/iOS/pause@2x.png: Removed.
* Modules/modern-media-controls/images/iOS/pause@3x.png: Removed.
* Modules/modern-media-controls/images/iOS/pip-in@1x.png: Removed.
* Modules/modern-media-controls/images/iOS/pip-in@2x.png: Removed.
* Modules/modern-media-controls/images/iOS/pip-in@3x.png: Removed.
* Modules/modern-media-controls/images/iOS/play@1x.png: Removed.
* Modules/modern-media-controls/images/iOS/play@2x.png: Removed.
* Modules/modern-media-controls/images/iOS/play@3x.png: Removed.
* Modules/modern-media-controls/images/iOS/slider-thumb@2x.png: Removed.
* Modules/modern-media-controls/images/iOS/start@1x.png: Removed.
* Modules/modern-media-controls/images/iOS/start@2x.png: Removed.
* Modules/modern-media-controls/images/iOS/start@3x.png: Removed.
* Modules/modern-media-controls/images/macOS/Airplay-fullscreen.svg: Added.
* Modules/modern-media-controls/images/macOS/Airplay.svg: Added.
* Modules/modern-media-controls/images/macOS/EnterFullscreen.svg: Added.
* Modules/modern-media-controls/images/macOS/ExitFullscreen.svg: Added.
* Modules/modern-media-controls/images/macOS/Forward.svg: Added.
* Modules/modern-media-controls/images/macOS/MediaSelector-fullscreen.svg: Added.
* Modules/modern-media-controls/images/macOS/MediaSelector.svg: Added.
* Modules/modern-media-controls/images/macOS/Mute.svg: Added.
* Modules/modern-media-controls/images/macOS/Pause.svg: Added.
* Modules/modern-media-controls/images/macOS/PipIn-fullscreen.svg: Added.
* Modules/modern-media-controls/images/macOS/PipIn.svg: Added.
* Modules/modern-media-controls/images/macOS/Play.svg: Added.
* Modules/modern-media-controls/images/macOS/Rewind.svg: Added.
* Modules/modern-media-controls/images/macOS/SkipBack15.svg: Added.
* Modules/modern-media-controls/images/macOS/SkipForward15.svg: Added.
* Modules/modern-media-controls/images/macOS/VolumeHi.svg: Added.
* Modules/modern-media-controls/images/macOS/VolumeLo.svg: Added.
* Modules/modern-media-controls/images/macOS/airplay-compact@1x.png: Removed.
* Modules/modern-media-controls/images/macOS/airplay-compact@2x.png: Removed.
* Modules/modern-media-controls/images/macOS/airplay-fullscreen@1x.png: Removed.
* Modules/modern-media-controls/images/macOS/airplay-fullscreen@2x.png: Removed.
* Modules/modern-media-controls/images/macOS/airplay@1x.png: Removed.
* Modules/modern-media-controls/images/macOS/airplay@2x.png: Removed.
* Modules/modern-media-controls/images/macOS/enter-fullscreen-compact@1x.png: Removed.
* Modules/modern-media-controls/images/macOS/enter-fullscreen-compact@2x.png: Removed.
* Modules/modern-media-controls/images/macOS/enter-fullscreen@1x.png: Removed.
* Modules/modern-media-controls/images/macOS/enter-fullscreen@2x.png: Removed.
* Modules/modern-media-controls/images/macOS/exit-fullscreen@1x.png: Removed.
* Modules/modern-media-controls/images/macOS/exit-fullscreen@2x.png: Removed.
* Modules/modern-media-controls/images/macOS/forward@1x.png: Removed.
* Modules/modern-media-controls/images/macOS/forward@2x.png: Removed.
* Modules/modern-media-controls/images/macOS/interval-skip-back-compact@1x.png: Removed.
* Modules/modern-media-controls/images/macOS/interval-skip-back-compact@2x.png: Removed.
* Modules/modern-media-controls/images/macOS/interval-skip-back@1x.png: Removed.
* Modules/modern-media-controls/images/macOS/interval-skip-back@2x.png: Removed.
* Modules/modern-media-controls/images/macOS/media-selection-compact@1x.png: Removed.
* Modules/modern-media-controls/images/macOS/media-selection-compact@2x.png: Removed.
* Modules/modern-media-controls/images/macOS/media-selection-fullscreen@1x.png: Removed.
* Modules/modern-media-controls/images/macOS/media-selection-fullscreen@2x.png: Removed.
* Modules/modern-media-controls/images/macOS/media-selection@1x.png: Removed.
* Modules/modern-media-controls/images/macOS/media-selection@2x.png: Removed.
* Modules/modern-media-controls/images/macOS/pause-compact@1x.png: Removed.
* Modules/modern-media-controls/images/macOS/pause-compact@2x.png: Removed.
* Modules/modern-media-controls/images/macOS/pause-fullscreen@1x.png: Removed.
* Modules/modern-media-controls/images/macOS/pause-fullscreen@2x.png: Removed.
* Modules/modern-media-controls/images/macOS/pause@1x.png: Removed.
* Modules/modern-media-controls/images/macOS/pause@2x.png: Removed.
* Modules/modern-media-controls/images/macOS/pip-in-compact@1x.png: Removed.
* Modules/modern-media-controls/images/macOS/pip-in-compact@2x.png: Removed.
* Modules/modern-media-controls/images/macOS/pip-in-fullscreen@1x.png: Removed.
* Modules/modern-media-controls/images/macOS/pip-in-fullscreen@2x.png: Removed.
* Modules/modern-media-controls/images/macOS/pip-in@1x.png: Removed.
* Modules/modern-media-controls/images/macOS/pip-in@2x.png: Removed.
* Modules/modern-media-controls/images/macOS/play-compact@1x.png: Removed.
* Modules/modern-media-controls/images/macOS/play-compact@2x.png: Removed.
* Modules/modern-media-controls/images/macOS/play-fullscreen@1x.png: Removed.
* Modules/modern-media-controls/images/macOS/play-fullscreen@2x.png: Removed.
* Modules/modern-media-controls/images/macOS/play@1x.png: Removed.
* Modules/modern-media-controls/images/macOS/play@2x.png: Removed.
* Modules/modern-media-controls/images/macOS/rewind@1x.png: Removed.
* Modules/modern-media-controls/images/macOS/rewind@2x.png: Removed.
* Modules/modern-media-controls/images/macOS/scale-to-fill@1x.png: Removed.
* Modules/modern-media-controls/images/macOS/scale-to-fill@2x.png: Removed.
* Modules/modern-media-controls/images/macOS/scale-to-fit@1x.png: Removed.
* Modules/modern-media-controls/images/macOS/scale-to-fit@2x.png: Removed.
* Modules/modern-media-controls/images/macOS/start@1x.png: Removed.
* Modules/modern-media-controls/images/macOS/start@2x.png: Removed.
* Modules/modern-media-controls/images/macOS/volume-compact@1x.png: Removed.
* Modules/modern-media-controls/images/macOS/volume-compact@2x.png: Removed.
* Modules/modern-media-controls/images/macOS/volume-down-fullscreen@1x.png: Removed.
* Modules/modern-media-controls/images/macOS/volume-down-fullscreen@2x.png: Removed.
* Modules/modern-media-controls/images/macOS/volume-mute-compact@1x.png: Removed.
* Modules/modern-media-controls/images/macOS/volume-mute-compact@2x.png: Removed.
* Modules/modern-media-controls/images/macOS/volume-mute@1x.png: Removed.
* Modules/modern-media-controls/images/macOS/volume-mute@2x.png: Removed.
* Modules/modern-media-controls/images/macOS/volume-up-fullscreen@1x.png: Removed.
* Modules/modern-media-controls/images/macOS/volume-up-fullscreen@2x.png: Removed.
* Modules/modern-media-controls/images/macOS/volume@1x.png: Removed.
* Modules/modern-media-controls/images/macOS/volume@2x.png: Removed.
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/main.js:
(UIString):
(formatTimeByUnit):
* Modules/modern-media-controls/media/audio-support.js: Added.
(AudioSupport.prototype.get control):
(AudioSupport.prototype.get mediaEvents):
(AudioSupport.prototype.get tracksToMonitor):
(AudioSupport.prototype.syncControl):
(AudioSupport):
* Modules/modern-media-controls/media/controls-visibility-support.js:
(ControlsVisibilitySupport.prototype._updateControls):
(ControlsVisibilitySupport):
* Modules/modern-media-controls/media/fullscreen-support.js:
(FullscreenSupport.prototype.buttonWasPressed):
(FullscreenSupport.prototype.syncControl):
(FullscreenSupport):
(FullscreenSupport.prototype.iOSInlineMediaControlsRecognizedPinchInGesture): Deleted.
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
(MediaController.prototype.get isAudio):
(MediaController.prototype.get isYouTubeEmbedWithTitle):
(MediaController.prototype.get isFullscreen):
(MediaController.prototype.get layoutTraits):
(MediaController.prototype.iOSInlineMediaControlsRecognizedTapGesture):
(MediaController.prototype.iOSInlineMediaControlsRecognizedPinchInGesture):
(MediaController.prototype._updateControlsIfNeeded):
(MediaController.prototype._updateTextTracksClassList):
(MediaController.prototype.controlsBarFadedStateDidChange): Deleted.
* Modules/modern-media-controls/media/media-document-controller.js:
(MediaDocumentController.prototype._mediaDocumentHasMetadata):
* Modules/modern-media-controls/media/placard-support.js:
(PlacardSupport.prototype._updatePlacard):
(PlacardSupport):
* Modules/modern-media-controls/media/scrubbing-support.js:
(ScrubbingSupport.prototype.get mediaEvents):
(ScrubbingSupport.prototype.syncControl):
(ScrubbingSupport):
* Modules/modern-media-controls/media/skip-back-support.js:
* Modules/modern-media-controls/media/skip-forward-support.js: Added.
(SkipForwardSupport.prototype.get control):
(SkipForwardSupport.prototype.get mediaEvents):
(SkipForwardSupport.prototype.buttonWasPressed):
(SkipForwardSupport.prototype.syncControl):
(SkipForwardSupport):
* Modules/modern-media-controls/media/start-support.js:
(StartSupport):
(StartSupport.prototype.handleEvent):
(StartSupport.prototype._shouldShowStartButton):
(StartSupport.prototype.get control): Deleted.
(StartSupport.prototype.syncControl): Deleted.
* Modules/modern-media-controls/media/status-support.js:
(StatusSupport.prototype.get mediaEvents):
(StatusSupport.prototype.syncControl):
(StatusSupport):
* Modules/modern-media-controls/media/time-control-support.js: Renamed from Source/WebCore/Modules/modern-media-controls/media/time-labels-support.js.
(TimeControlSupport.prototype.syncControl):
(TimeControlSupport):
* Modules/modern-media-controls/media/tracks-support.js:
(TracksSupport.prototype.syncControl):
* WebCore.xcodeproj/project.pbxproj:

LayoutTests:

Update test expectations to make a few of the tests we had already rebaselined pass.

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

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

2 years agoAdd a version number to ARES-6
sbarati@apple.com [Tue, 6 Jun 2017 07:57:45 +0000 (07:57 +0000)]
Add a version number to ARES-6
https://bugs.webkit.org/show_bug.cgi?id=172962

Reviewed by Yusuke Suzuki.

* ARES-6/glue.js:
(driver.reportResult):

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

2 years agoRebaseline fast/mediacapturefromelement/CanvasCaptureMediaStream-2d-events.html and...
ryanhaddad@apple.com [Tue, 6 Jun 2017 06:30:49 +0000 (06:30 +0000)]
Rebaseline fast/mediacapturefromelement/CanvasCaptureMediaStream-2d-events.html and update TestExpectations.

Unreviewed test gardening.

* fast/mediacapturefromelement/CanvasCaptureMediaStream-2d-events-expected.txt:

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

2 years agoSkip storage/domstorage/sessionstorage/set-item-synchronous-keydown.html on iOS.
ryanhaddad@apple.com [Tue, 6 Jun 2017 05:44:03 +0000 (05:44 +0000)]
Skip storage/domstorage/sessionstorage/set-item-synchronous-keydown.html on iOS.
https://bugs.webkit.org/show_bug.cgi?id=172943

Unreviewed test gardening.

* platform/ios/TestExpectations:

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

2 years agoTry to fix features.json by adding an ESNext section.
sbarati@apple.com [Tue, 6 Jun 2017 04:53:35 +0000 (04:53 +0000)]
Try to fix features.json by adding an ESNext section.

Unreviewed.

* features.json:

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

2 years agoRefactor -[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:] to check...
wenson_hsieh@apple.com [Tue, 6 Jun 2017 04:47:39 +0000 (04:47 +0000)]
Refactor -[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:] to check readable types
https://bugs.webkit.org/show_bug.cgi?id=172891
<rdar://problem/32204540>

Reviewed by Darin Adler.

Source/WebCore:

Tweaks some logic in PlatformPasteboardIOS and WebItemProviderPasteboard to correctly construct objects in
-valuesForPasteboardType:inItemSet:. Previously, we have a hard-coded map of UTI type to Class in the form of
static helpers titled is{RichText, String, URL, Image, Color}Type in WebItemProviderPasteboard. We would use
these functions to determine whether an NSAttributedString, NSString, NSURL, UIImage or UIColor should be
constructed using the loaded item provider data. This is incorrect for some UTIs, such as public.html, which
cannot actually be used to construct an NSAttributedString -- this caused -valuesForPasteboardType:inItemSet: to
always return nil when attempting to create an object corresponding to public.html.

To fix this, we refactor -valuesForPasteboardType:inItemSet: to instead iterate through UIItemProviderReading-
conformant classes in search for a class that can be created for the given UTI type. If no such class exists, we
then fall back to custom WebKit handling of the dropped UTI type, which so far only includes reading an NSString
with public.plain-text if the UTI is public.html (i.e. reading the HTML source from loaded item provider data).

Covered by 2 new API tests:
DataInteractionTests.ExternalSourceHTMLToContentEditable
DataInteractionTests.ExternalSourceAttributedStringToContentEditable

* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::stringForType):
(WebCore::PlatformPasteboard::readString):

In some cases, -[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:] may now return an
NSAttributedString when an NSString was previously created. This adjusts for that possibility by returning just
the plain text, -[NSAttributedString string], if the read object was an NSAttributedString.

* platform/ios/WebItemProviderPasteboard.mm:
(allLoadableClasses):
(classForTypeIdentifier):
(-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]):

See description above for more details.

(isRichTextType): Deleted.
(isStringType): Deleted.
(isURLType): Deleted.
(isColorType): Deleted.
(isImageType): Deleted.

Removes these heuristics that attempt to "guess" the best UIItemProviderReading class to try and load for a
given UTI type.

* rendering/RenderText.cpp:
(WebCore::RenderText::draggedContentRangesBetweenOffsets):

Adds a nil check to fix a debug assertion hit when running DataInteractionTests.

Tools:

Adds 2 new API tests to exercise data interaction of HTML data and an attributed string into a rich
contenteditable. See WebCore ChangeLog for more details.

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

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

2 years agoUnreviewed GTK expectations gardening
mcatanzaro@igalia.com [Tue, 6 Jun 2017 04:00:37 +0000 (04:00 +0000)]
Unreviewed GTK expectations gardening

Mark a few tests as crashing.

* platform/gtk/TestExpectations:

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

2 years agoFollow-up: Update JSC's features.json
ddkilzer@apple.com [Tue, 6 Jun 2017 03:51:15 +0000 (03:51 +0000)]
Follow-up: Update JSC's features.json
https://bugs.webkit.org/show_bug.cgi?id=172942

Rubber-stamped by Jon Davis.

* features.json: Change "Supported in preview" to
"Supported" to try to fix <https://webkit.org/status/>.

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

2 years agoTry to fix the GTK build.
ggaren@apple.com [Tue, 6 Jun 2017 03:22:19 +0000 (03:22 +0000)]
Try to fix the GTK build.

Unreviewed.

* bmalloc/List.h:

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

2 years agoWe don't properly parse init_expr when the opcode is an unexpected opcode
sbarati@apple.com [Tue, 6 Jun 2017 02:59:54 +0000 (02:59 +0000)]
We don't properly parse init_expr when the opcode is an unexpected opcode
https://bugs.webkit.org/show_bug.cgi?id=172945

Reviewed by JF Bastien.

The bug is a simple typo. It should use the constant
`true` instead of `false` when invoking the WASM_PARSER_FAIL_IF
macro. This failure is already caught by spec tests that fail
on arm64 devices.

* wasm/WasmModuleParser.cpp:

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

2 years agoASSERTION FAILED: RunLoop::isMain() in com.apple.WebKit: IPC::Connection::sendSyncMes...
cdumez@apple.com [Tue, 6 Jun 2017 02:59:05 +0000 (02:59 +0000)]
ASSERTION FAILED: RunLoop::isMain() in com.apple.WebKit: IPC::Connection::sendSyncMessage + 128
https://bugs.webkit.org/show_bug.cgi?id=172943
<rdar://problem/31288058>

Reviewed by Alexey Proskuryakov.

Make test clean a little bit more robust.

* storage/domstorage/sessionstorage/set-item-synchronous-keydown.html:

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

2 years agoOMG tier up checks should be a patchpoint
keith_miller@apple.com [Tue, 6 Jun 2017 02:34:52 +0000 (02:34 +0000)]
OMG tier up checks should be a patchpoint
https://bugs.webkit.org/show_bug.cgi?id=172944

Reviewed by Saam Barati.

Tier up checks in BBQ should be done as a patchpoint rather than individual B3 opcodes.
In order to reduce code generated out of line in each function. We generate a single stub
that pushes all the callee-saves. This looks like a 5-10% compile time speedup.

* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::B3IRGenerator):
(JSC::Wasm::B3IRGenerator::emitTierUpCheck):
(JSC::Wasm::B3IRGenerator::addLoop):
* wasm/WasmThunks.cpp:
(JSC::Wasm::triggerOMGTierUpThunkGenerator):
* wasm/WasmThunks.h:

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

2 years agobmalloc: Small and large objects should share memory
ggaren@apple.com [Tue, 6 Jun 2017 02:21:11 +0000 (02:21 +0000)]
bmalloc: Small and large objects should share memory
https://bugs.webkit.org/show_bug.cgi?id=172880
<rdar://problem/31494732>

Reviewed by Sam Weinig.

This reduces our high water mark memory usage on JetStream on macOS
by 10%-20%. It also has the nice side effect that we can free small
object metadata after returning from a high water mark.

No change in throughput.

Our old algorithm allocated small object chunks and large objects in
segregated virtual memory and never recycled addresses between them.
This provided a slight security benefit because we could apply guard
pages between the segregated ranges and we would never reuse the same
virtual address for object and metadata memory.

Our new algorithm allocates small object chunks from the large object
allocator. This naturally recycles memory between small chunks and large
objects, and between small chunks of different page classes. This allows
us to shift memory between allocation types as a program moves between
different phases of allocation, and to delete small object chunk metadata
when a program shrinks back from a high water mark.

Two intuitions I had about memory use turned out to be backwards in
this context:

(1) I thought that this optimization would work because it allowed you to
allocate and free a 4MB object and then reuse that large allocation to
service small allocations. In practice, the common benefit seems to be
the opposite: After you allocate and free many small objects, you can
stitch them together to allocate a large object without growing the heap.

(2) I thought that it would be more memory-efficient to allocate
fine-grained pages from the large object allocator. In practice, giving
the large object allocator too many arbitrarily-sized ranges to manage
leads to fragmentation. Meanwhile, segregated fit is a powerful memory
optimization. So, it's best to return small object memory to the large
allocator only when a whole small object chunk is free.

* bmalloc/Chunk.h:
(bmalloc::Chunk::ref):
(bmalloc::Chunk::deref):
(bmalloc::Chunk::refCount):
(bmalloc::Chunk::freePages): We keep a free list per chunk and refcount
each chunk so we can notice when a chunk becomes empty, and return it
to the large allocator.

(bmalloc::forEachPage): A new helper function for iterating the pages
in a Chunk.

(bmalloc::Chunk::Chunk): Use forEachPage instead of manual iteration.
Use { } initialization because we don't get zero-initialized by the OS
anymore.

* bmalloc/Heap.cpp:
(bmalloc::Heap::Heap):
(bmalloc::Heap::concurrentScavenge):
(bmalloc::Heap::scavenge): Don't bother unlocking while scavenging. I
wasn't able to show it to be a consistent speedup. A more promising
approach, if we find a motivating example, is for the scavenger to give
up and return early if any other client is waiting on the lock.

(bmalloc::Heap::allocateSmallChunk): New helper function for allocating
a small chunk. It allocates through the large allocator to facilitate
sharing. We still allocate a chunk at a time instead of a page at a time.
Surprisingly, more precise page-at-a-time allocation is worse for memory
use because of fragmentation. Segregated fit is a powerful optimization.

(bmalloc::Heap::deallocateSmallChunk): New helper function for deallocating
a small chunk.

(bmalloc::Heap::allocateSmallPage): Updated for new APIs.

(bmalloc::Heap::deallocateSmallLine):  Updated for new APIs. Note that
we cache one free chunk per page class. This avoids churn in the large
allocator when you free(malloc(X)).

(bmalloc::Heap::allocateSmallBumpRangesByMetadata):
(bmalloc::Heap::allocateSmallBumpRangesByObject):
(bmalloc::Heap::tryAllocateLarge):
(bmalloc::Heap::scavengeSmallPages): Deleted.
(bmalloc::Heap::scavengeLargeObjects): Deleted.
* bmalloc/Heap.h:

* bmalloc/LargeMap.h:
(bmalloc::LargeMap::begin):
(bmalloc::LargeMap::end): Added iteration helpers for scavenging.

* bmalloc/LargeRange.h:
(bmalloc::LargeRange::physicalSize): Added a comment about something
that I confused myself about in this patch.

* bmalloc/List.h:
(bmalloc::List::iterator::operator*):
(bmalloc::List::iterator::operator->):
(bmalloc::List::iterator::operator!=):
(bmalloc::List::iterator::operator++):
(bmalloc::List::begin):
(bmalloc::List::end):
(bmalloc::List::pushFront):
(bmalloc::List::remove):
(bmalloc::ListNode::ListNode): Deleted. Added iteration helpers for
scavenging. Changed the default state of a Node to null pointers instead
of self pointers to distinguish the null node from the empty node for
easier debugging.

* bmalloc/Sizes.h: Changed the chunk size to 1MB to increase the chances
of a chunk becoming free and recyclable.

* bmalloc/SmallPage.h:
(bmalloc::SmallPage::hasPhysicalPages):
(bmalloc::SmallPage::setHasPhysicalPages): Track physical state by page
instead of implicitly by which list a page is in. It's simpler not
to have to move chunks and pages between physical vs virtual lists.

(bmalloc::SmallPage::SmallPage): Deleted.

* bmalloc/VMHeap.cpp:
(bmalloc::VMHeap::tryAllocateLargeChunk):
(bmalloc::VMHeap::allocateSmallChunk): Deleted.
* bmalloc/VMHeap.h:
(bmalloc::VMHeap::allocateSmallPage): Deleted.
(bmalloc::VMHeap::deallocateSmallPage): Deleted. Small chunk allocation
just forwards to the large allocator now.

* bmalloc/bmalloc.h:
(bmalloc::api::scavenge):

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

2 years agoASSERTION FAILED: RunLoop::isMain() in com.apple.WebKit: IPC::Connection::sendSyncMes...
cdumez@apple.com [Tue, 6 Jun 2017 02:03:29 +0000 (02:03 +0000)]
ASSERTION FAILED: RunLoop::isMain() in com.apple.WebKit: IPC::Connection::sendSyncMessage + 128
https://bugs.webkit.org/show_bug.cgi?id=172943
<rdar://problem/31288058>

Reviewed by Alexey Proskuryakov.

Source/WebKit2:

In Connection::sendMessage(), make sure we only ever transform asynchronous messages into synchronous
ones if sendMessage() is called on the main thread. This is necessary because we no longer support
sending synchronous messages from a background thread since r205125.

* Platform/IPC/Connection.cpp:
(IPC::Connection::sendMessage):
(IPC::Connection::sendSyncMessage):

LayoutTests:

Add better test coverage.

* storage/domstorage/sessionstorage/set-item-synchronous-keydown-expected.txt: Added.
* storage/domstorage/sessionstorage/set-item-synchronous-keydown.html: Added.

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

2 years agoRevert r217405, this headerpad increase is no longer needed.
joepeck@webkit.org [Tue, 6 Jun 2017 00:03:55 +0000 (00:03 +0000)]
Revert r217405, this headerpad increase is no longer needed.

Rubber-stamped by Dan Bernstein.

* Configurations/BaseXPCService.xcconfig:

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

2 years agoRemove unused VM members
joepeck@webkit.org [Tue, 6 Jun 2017 00:03:53 +0000 (00:03 +0000)]
Remove unused VM members
https://bugs.webkit.org/show_bug.cgi?id=172941

Reviewed by Mark Lam.

* runtime/HashMapImpl.h:
(JSC::HashMapImpl::selectStructure): Deleted.
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:

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

2 years agoWeb Inspector: Improve ES6 Class instances in Heap Snapshot instances view
commit-queue@webkit.org [Mon, 5 Jun 2017 23:52:25 +0000 (23:52 +0000)]
Web Inspector: Improve ES6 Class instances in Heap Snapshot instances view
https://bugs.webkit.org/show_bug.cgi?id=172848
<rdar://problem/25709212>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-06-05
Reviewed by Saam Barati.

JSTests:

* typeProfiler/inheritance.js:
Rewrite the test slightly for clarity. The hoisting was confusing.

* heapProfiler/class-names.js: Added.
(MyES5Class):
(MyES6Class):
(MyES6Subclass):
Test object types and improved class names.

* heapProfiler/driver/driver.js:
(CheapHeapSnapshotNode):
(CheapHeapSnapshot):
(createCheapHeapSnapshot):
(HeapSnapshot):
(createHeapSnapshot):
Update snapshot parsing from version 1 to version 2.

Source/JavaScriptCore:

* heap/HeapSnapshotBuilder.h:
* heap/HeapSnapshotBuilder.cpp:
Update the snapshot version. Change the node's 0 | 1 internal value
to be a 32bit bit flag. This is nice in that it is both compatible
with the previous snapshot version and the same size. We can use more
flags in the future.

(JSC::HeapSnapshotBuilder::json):
In cases where the classInfo gives us "Object" check for a better
class name by checking (o).__proto__.constructor.name. We avoid this
check in cases where (o).hasOwnProperty("constructor") which is the
case for most Foo.prototype objects. Otherwise this would get the
name of the Foo superclass for the Foo.prototype object.

* runtime/JSObject.cpp:
(JSC::JSObject::calculatedClassName):
Handle some possible edge cases that were not handled before. Such
as a JSObject without a GlobalObject, and an object which doesn't
have a default getPrototype. Try to make the code a little clearer.

Source/WebInspectorUI:

* UserInterface/Workers/HeapSnapshot/HeapSnapshot.js:
(HeapSnapshot):
Support the new snapshot version. The only thing that changes are the
node flags, and its actually completely compatible with version 1.

(HeapSnapshot.updateCategoriesAndMetadata):
List the count of object type instances in each class category.

(HeapSnapshot.prototype.serializeNode):
Include whether or not the node is an object type.

* UserInterface/Proxies/HeapSnapshotNodeProxy.js:
(WebInspector.HeapSnapshotNodeProxy):
(WebInspector.HeapSnapshotNodeProxy.deserialize):
Add a new Node isObjectType property based on the new data.

* UserInterface/Views/HeapSnapshotClassDataGridNode.js:
(WebInspector.HeapSnapshotClassDataGridNode.prototype.createCellContent):
* UserInterface/Views/HeapSnapshotClusterContentView.js:
(WebInspector.HeapSnapshotClusterContentView.iconStyleClassNameForClassName):
If a class contains 50% or more object type instances then it as such
instead of defaulting to native.

* UserInterface/Views/HeapSnapshotDataGridTree.js:
(WebInspector.HeapSnapshotInstancesDataGridTree.prototype.populateTopLevel):
* UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
(WebInspector.HeapSnapshotInstanceDataGridNode.prototype.createCellContent):
We can be more specific than the default if the individual instance is
known to be an object type.

LayoutTests:

* inspector/unit-tests/heap-snapshot-expected.txt:
* inspector/unit-tests/heap-snapshot.html:
Update for the new node flag.

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

2 years agoBuild fix for macOS 10.12
mitz@apple.com [Mon, 5 Jun 2017 23:51:12 +0000 (23:51 +0000)]
Build fix for macOS 10.12

* platform/spi/cocoa/AVKitSPI.h:

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

2 years agoUpdate JSC's features.json
sbarati@apple.com [Mon, 5 Jun 2017 23:32:27 +0000 (23:32 +0000)]
Update JSC's features.json
https://bugs.webkit.org/show_bug.cgi?id=172942

Rubber stamped by Mark Lam.

* features.json:

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

2 years agoTried to fix the build when targrting macOS 10.12 using the macOS 10.13 developer...
mitz@apple.com [Mon, 5 Jun 2017 23:15:43 +0000 (23:15 +0000)]
Tried to fix the build when targrting macOS 10.12 using the macOS 10.13 developer beta SDK.

Source/WebCore:

* platform/mac/WebPlaybackControlsManager.h:
* platform/mac/WebPlaybackControlsManager.mm:
(-[WebPlaybackControlsManager togglePictureInPicture]):

Source/WebKit2:

* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::mediaPlaybackControlsView):

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

2 years agoTried to fix the build when targrting macOS 10.12 using the macOS 10.13 developer...
mitz@apple.com [Mon, 5 Jun 2017 23:04:12 +0000 (23:04 +0000)]
Tried to fix the build when targrting macOS 10.12 using the macOS 10.13 developer beta SDK.

Source/WebCore:

* platform/spi/cocoa/AVKitSPI.h:

Source/WebKit/mac:

* WebView/WebView.mm:
(-[WebView updateMediaTouchBar]):
* WebView/WebViewData.h:

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

2 years agowebkitpy: Abstract Executive class
dbates@webkit.org [Mon, 5 Jun 2017 23:01:21 +0000 (23:01 +0000)]
webkitpy: Abstract Executive class
https://bugs.webkit.org/show_bug.cgi?id=172928
<rdar://problem/32569531>

Reviewed by Ryosuke Niwa.

Adds an AbstractExecutive class and makes Executive extend AbstractExecutive.
This will make it straightforward to create additional derived classes that
adhere to the same interface, say for iOS on-device testing.

* Scripts/webkitpy/common/system/abstractexecutive.py: Added.
(AbstractExecutive):
(AbstractExecutive.run_and_throw_if_fail):
(AbstractExecutive.cpu_count):
(AbstractExecutive.interpreter_for_script):
(AbstractExecutive.shell_command_for_script):
(AbstractExecutive.kill_process):
(AbstractExecutive.check_running_pid):
(AbstractExecutive.running_pids):
(AbstractExecutive.wait_newest):
(AbstractExecutive.wait_limited):
(AbstractExecutive.interrupt):
(AbstractExecutive.default_error_handler):
(AbstractExecutive.ignore_error):
(AbstractExecutive._stringify_args):
(AbstractExecutive.command_for_printing):
(AbstractExecutive.run_command):
(AbstractExecutive.popen):
(AbstractExecutive.run_in_parallel):
* Scripts/webkitpy/common/system/executive.py:
(Executive):
(Executive.cpu_count):
(Executive.running_pids):
(Executive.kill_all):
(Executive._compute_stdin):
(Executive.interpreter_for_script): Deleted.
(Executive.shell_command_for_script): Deleted.
(Executive.wait_newest): Deleted.
(Executive.wait_limited): Deleted.
(Executive.default_error_handler): Deleted.
(Executive.ignore_error): Deleted.
(Executive.command_for_printing): Deleted.

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

2 years agoUnreviewed, fix missing semicolon in r217795
annulen@yandex.ru [Mon, 5 Jun 2017 22:41:42 +0000 (22:41 +0000)]
Unreviewed, fix missing semicolon in r217795

* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::calculateNaturalSize):

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

2 years agoAllow clients to specify a list of codecs which should require hardware decode support.
jer.noble@apple.com [Mon, 5 Jun 2017 22:40:30 +0000 (22:40 +0000)]
Allow clients to specify a list of codecs which should require hardware decode support.
https://bugs.webkit.org/show_bug.cgi?id=172787

Reviewed by Alex Christensen.

Source/WebCore:

Add a new setting, checked by HTMLMediaElement, which allows MediaPlayerPrivate implementation
to require that the specified codecs have hardware support. This requirement will be supported
in the normal media loading path and the MSE path on Cocoa ports.

* WebCore.xcodeproj/project.pbxproj:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaCodecsRequiringHardwareSupport):
* html/HTMLMediaElement.h:
* page/Settings.cpp:
(WebCore::Settings::setMediaCodecsRequiringHardwareSupport):
* page/Settings.h:
(WebCore::Settings::mediaCodecsRequiringHardwareSupport):
* platform/cocoa/VideoToolboxSoftLink.cpp:
* platform/cocoa/VideoToolboxSoftLink.h:
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerClient::mediaCodecsRequiringHardwareSupport):
* platform/graphics/avfoundation/objc/AVAssetTrackUtilities.h: Added.
* platform/graphics/avfoundation/objc/AVAssetTrackUtilities.mm: Added.
(WebCore::assetTrackMeetsHardwareDecodeRequirements):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::checkPlayability):
(WebCore::MediaPlayerPrivateAVFoundationObjC::assetStatus):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):

Source/WebKit2:

Add a WKWebPageConfiguration (and associated WebPreferences and WKPreferencesRef) properties
allowing clients to require specified codecs have hardware decode support. Also open up the
sandbox on Cocoa ports to services required to check for hardware decode availability.

* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetMediaCodecsRequiringHardwareSupport):
(WKPreferencesCopyMediaCodecsRequiringHardwareSupport):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration copyWithZone:]):
(-[WKWebViewConfiguration _mediaCodecsRequiringHardwareSupport]):
(-[WKWebViewConfiguration _setMediaCodecsRequiringHardwareSupport:]):
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
* WebProcess/com.apple.WebProcess.sb.in:

Source/WTF:

Add a couple of convenience methods:
- a String::split() that returns a vector (rather than taking an out-reference to a vector).
- A Vector::map() template which takes a Callable and returns a Vector of a different type.

* wtf/Vector.h:
(WTF::Vector::map):
* wtf/text/WTFString.h:
(WTF::String::split):

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

2 years agoTried to fix the build when targrting macOS 10.12 using the macOS 10.13 developer...
mitz@apple.com [Mon, 5 Jun 2017 22:28:03 +0000 (22:28 +0000)]
Tried to fix the build when targrting macOS 10.12 using the macOS 10.13 developer beta SDK.

* platform/mac/WebPlaybackControlsManager.mm:
(-[WebPlaybackControlsManager togglePictureInPicture]):

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

2 years agoTried to fix the build when targrting macOS 10.12 using the macOS 10.13 developer...
mitz@apple.com [Mon, 5 Jun 2017 22:12:57 +0000 (22:12 +0000)]
Tried to fix the build when targrting macOS 10.12 using the macOS 10.13 developer beta SDK.

* platform/spi/mac/AVFoundationSPI.h:

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

2 years agoTried to fix the build when targrting macOS 10.12 using the macOS 10.13 developer...
mitz@apple.com [Mon, 5 Jun 2017 21:54:06 +0000 (21:54 +0000)]
Tried to fix the build when targrting macOS 10.12 using the macOS 10.13 developer beta SDK.

* platform/spi/cocoa/IOSurfaceSPI.h:

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

2 years agoFix MediaPlayerPrivateMediaFoundation::naturalSize
annulen@yandex.ru [Mon, 5 Jun 2017 21:45:28 +0000 (21:45 +0000)]
Fix MediaPlayerPrivateMediaFoundation::naturalSize
https://bugs.webkit.org/show_bug.cgi?id=172908

Reviewed by Alex Christensen.

MediaPlayerPrivateMediaFoundation::naturalSize should return size of
video frame corrected by PAR, not size of video element.

No new tests needed.

* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::MediaPlayerPrivateMediaFoundation::load):
(WebCore::MediaPlayerPrivateMediaFoundation::naturalSize):
(WebCore::MediaPlayerPrivateMediaFoundation::setNaturalSize):
(WebCore::calculateNaturalSize):
(WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::setMediaType):
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:

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