WebKit-https.git
3 years agoImage should clear its ImageObserver* when CachedImage releases the last reference...
commit-queue@webkit.org [Fri, 9 Jun 2017 18:38:39 +0000 (18:38 +0000)]
Image should clear its ImageObserver* when CachedImage releases the last reference to its RefCounted<ImageObserver>
https://bugs.webkit.org/show_bug.cgi?id=173077

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2017-06-09
Reviewed by Simon Fraser.

Before dereferencing ImageObserver, CachedImage::clearImage() should check
whether it is the only object that holds a reference to this ImageObserver.
And if this is true, m_image have to clear its raw pointer to the deleted
ImageObserver by calling m_image->setImageObserver(nullptr).

* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::setBodyDataFrom):
(WebCore::CachedImage::CachedImageObserver::CachedImageObserver):
(WebCore::CachedImage::clearImage):
* loader/cache/CachedImage.h:

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

3 years agoAvoid some ref counting churn in WebResourceLoadStatisticsStore
cdumez@apple.com [Fri, 9 Jun 2017 18:32:08 +0000 (18:32 +0000)]
Avoid some ref counting churn in WebResourceLoadStatisticsStore
https://bugs.webkit.org/show_bug.cgi?id=173168

Reviewed by Brent Fulgham.

Move the protectedThis around instead of ref'ing it every time we capture it
in a lambda. Also add a missing protectedThis in WebResourceLoadStatisticsStore::removeDataRecords()
which likely fixes crashes.

* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
(WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):

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

3 years ago[ios-sim] Cleaning-up timeouts WebKit1
jbedard@apple.com [Fri, 9 Jun 2017 18:28:37 +0000 (18:28 +0000)]
[ios-sim] Cleaning-up timeouts WebKit1
https://bugs.webkit.org/show_bug.cgi?id=173169

Unreviewed test gardening.

The intention of this change is to allow the iOS WK1 bots to finish their
test runs. Because these tests are being gardened based on the output of
bots, there will likely be follow-up fixes.

* platform/ios-wk1/TestExpectations: Skip tests timing out in iOS WK1.

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

3 years agoAdd flag allow-popups-to-escape-sandbox to iframe sandbox
commit-queue@webkit.org [Fri, 9 Jun 2017 17:59:18 +0000 (17:59 +0000)]
Add flag allow-popups-to-escape-sandbox to iframe sandbox
https://bugs.webkit.org/show_bug.cgi?id=158875

Patch by Frederic Wang <fwang@igalia.com> on 2017-06-09
Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

Update expected results for iframe popup escaping tests.

* web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-1-expected.txt: This test passes.
* web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-2-expected.txt: This test passes.
* web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-3-expected.txt: Remove error message from text expectation.

Source/WebCore:

This patch adds support for the iframe@allow-popups-to-escape-sandbox attribute.
This allows to pass more W3C Web Platform tests.

Tests: imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-1.html
       imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-2.html

* dom/SecurityContext.cpp: Add allow-popups-to-escape-sandbox flag.
(WebCore::SecurityContext::isSupportedSandboxPolicy):
(WebCore::SecurityContext::parseSandboxPolicy):
* dom/SecurityContext.h: Ditto.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::continueLoadAfterNewWindowPolicy): Do not force sandbox flags when we have allow-popups-to-escape-sandbox.
(WebCore::createWindow): Ditto.

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

3 years ago[iOS] Video occasionally mixes with other system audio instead of interrupting
jer.noble@apple.com [Fri, 9 Jun 2017 17:57:06 +0000 (17:57 +0000)]
[iOS] Video occasionally mixes with other system audio instead of interrupting
https://bugs.webkit.org/show_bug.cgi?id=173127

Reviewed by Eric Carlson.

Source/WebCore:

Tests: platform/mac/audio-session-category-video-track-change.html

When an HTMLMediaElement's tracks change their enabled state, make sure to update
the PlatformMediaElement, for canProduceAudio() may have changed.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
* platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
(PlatformMediaSessionManager::updateSessionState):

The rest of the changes in this revision are to allow the above to be testable.

* page/Settings.cpp:
* page/Settings.h:
* platform/audio/AudioSession.h:
* platform/audio/mac/AudioSessionMac.cpp:
(WebCore::AudioSession::category):
(WebCore::AudioSession::setCategory):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setShouldManageAudioSessionCategory):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:
* testing/Internals.cpp:
(WebCore::Internals::audioSessionCategory):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* platform/mac/media/audio-session-category-video-track-change-expected.txt: Added.
* platform/mac/media/audio-session-category-video-track-change.html: Added.

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

3 years agoUpdate WorkQueue::concurrentApply() to take a WTF::Function instead of an std::function
cdumez@apple.com [Fri, 9 Jun 2017 17:54:16 +0000 (17:54 +0000)]
Update WorkQueue::concurrentApply() to take a WTF::Function instead of an std::function
https://bugs.webkit.org/show_bug.cgi?id=173165

Reviewed by Saam Barati.

Update WorkQueue::concurrentApply() to take a WTF::Function instead of an std::function
as std::function has issues with regards to thread safety.

* wtf/WorkQueue.h:
* wtf/cocoa/WorkQueueCocoa.cpp:
(WTF::WorkQueue::concurrentApply):

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

3 years agoCSS transitions added while page is not visible do not start when the page becomes...
cdumez@apple.com [Fri, 9 Jun 2017 17:52:42 +0000 (17:52 +0000)]
CSS transitions added while page is not visible do not start when the page becomes visible
https://bugs.webkit.org/show_bug.cgi?id=173166
<rdar://problem/32250351>

Reviewed by Darin Adler.

Source/WebCore:

CSS transitions added while page is not visible would not start when the page becomes
visible. The issue was that when CompositeAnimation::updateTransitions() was called
while the page is hidden (and animations are therefore suspended), it would not
populate m_transations with ImplicitAnimation objects. We would therefore have later
no transitions to resume when the page becomes visible later on. This patch updates
CompositeAnimation::updateTransitions() to properly populate m_transitions and instead
pause the ImplicitAnimation it creates if animations are currently suspended. This
behavior is more consistent with the one of CompositeAnimation::updateKeyframeAnimations().

I also needed to update ImplicitAnimation::animate() to not restart a paused animation
if the animation is currently paused. This is similar to what is done in
KeyframeAnimation::animate(). Without this, the paused ImplicitAnimation we add to
m_transition would incorrectly get unpaused while the page is still hidden and the
animations are still supposed to be suspended. This issue was showing when running the
test I am adding in this patch.

Test: fast/animation/css-animation-resuming-when-visible.html

* page/animation/CompositeAnimation.cpp:
(WebCore::CompositeAnimation::updateTransitions):
* page/animation/ImplicitAnimation.cpp:
(WebCore::ImplicitAnimation::animate):
(WebCore::ImplicitAnimation::reset):
* page/animation/ImplicitAnimation.h:

LayoutTests:

Add layout test coverage.

* fast/animation/css-animation-resuming-when-visible-expected.txt: Added.
* fast/animation/css-animation-resuming-when-visible.html: Added.

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

3 years agoAdd SubresourceIntegrity as an experimental feature
commit-queue@webkit.org [Fri, 9 Jun 2017 17:48:05 +0000 (17:48 +0000)]
Add SubresourceIntegrity as an experimental feature
https://bugs.webkit.org/show_bug.cgi?id=173164

Patch by Sam Weinig <sam@webkit.org> on 2017-06-09
Reviewed by Darin Adler.

* Shared/WebPreferencesDefinitions.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
Add SubresourceIntegrity to the list of experimental features. Also, sort the experimental features
as requested by the comment above it.

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

3 years ago[JSC] FTL does not require dlfcn
utatane.tea@gmail.com [Fri, 9 Jun 2017 17:44:30 +0000 (17:44 +0000)]
[JSC] FTL does not require dlfcn
https://bugs.webkit.org/show_bug.cgi?id=173143

Reviewed by Darin Adler.

We no longer use LLVM library. Thus, dlfcn.h is not necessary.
Also, ProcessID is not used in FTLLowerDFGToB3.cpp.

* ftl/FTLLowerDFGToB3.cpp:

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

3 years agoUnreviewed, Use FALLTHROUGH
utatane.tea@gmail.com [Fri, 9 Jun 2017 17:01:17 +0000 (17:01 +0000)]
Unreviewed, Use FALLTHROUGH

* loader/LinkLoader.cpp:
(WebCore::createLinkPreloadResourceClient):

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

3 years ago[DFG] Add --verboseDFGFailure
utatane.tea@gmail.com [Fri, 9 Jun 2017 16:55:20 +0000 (16:55 +0000)]
[DFG] Add --verboseDFGFailure
https://bugs.webkit.org/show_bug.cgi?id=173155

Reviewed by Sam Weinig.

Similar to verboseFTLFailure, JSC should have verboseDFGFailure flag to show DFG failures quickly.

* dfg/DFGCapabilities.cpp:
(JSC::DFG::verboseCapabilities):
(JSC::DFG::debugFail):
* runtime/Options.cpp:
(JSC::recomputeDependentOptions):
* runtime/Options.h:

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

3 years agoMake sure |this| is protected in lambda capture in WebResourceLoadStatisticsStore...
cdumez@apple.com [Fri, 9 Jun 2017 16:38:37 +0000 (16:38 +0000)]
Make sure |this| is protected in lambda capture in WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData()
https://bugs.webkit.org/show_bug.cgi?id=173163

Reviewed by Brent Fulgham.

Make sure |this| is protected in lambda capture in WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData()
or it may end up getting destroyed before the lambda executing and crash when calling m_statisticsQueue->dispatch().

* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):

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

3 years ago[Win64] Build error when compiling PaintHooks.asm.
pvollan@apple.com [Fri, 9 Jun 2017 16:19:06 +0000 (16:19 +0000)]
[Win64] Build error when compiling PaintHooks.asm.
https://bugs.webkit.org/show_bug.cgi?id=173132

Reviewed by Brent Fulgham.

There seems to be too many include paths on the command line for ml64. According to the documentation,
a maximum of 10 /I options is allowed. Create a separate static library for asm files, in order to
avoid all the include paths.

* PlatformWin.cmake:

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

3 years agofast/mediastream/MediaStream-page-muted.html times out and asserts
eric.carlson@apple.com [Fri, 9 Jun 2017 16:14:27 +0000 (16:14 +0000)]
fast/mediastream/MediaStream-page-muted.html times out and asserts
https://bugs.webkit.org/show_bug.cgi?id=170355
<rdar://problem/31376041>

Source/WebCore:

MediaStream and MediaStreamTrack need to prevent JS wrapper collection while it is possible
to fire an event or event listeners won't be notified.

Reviewed by Chris Dumez.

Test: fast/mediastream/media-stream-wrapper-collected.html

* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::MediaStream): Initialize ActiveDOMObject.
(WebCore::MediaStream::stop): New.
(WebCore::MediaStream::activeDOMObjectName): Ditto.
(WebCore::MediaStream::canSuspendForDocumentSuspension): Ditto.
(WebCore::MediaStream::hasPendingActivity): Ditto, prevent collection if there
are registered event listeners.
(WebCore::MediaStream::contextDestroyed): Deleted.
* Modules/mediastream/MediaStream.h:
* Modules/mediastream/MediaStream.idl:

* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::hasPendingActivity): Prevent collection if there
are registered event listeners.
* Modules/mediastream/MediaStreamTrack.h:

* testing/Internals.cpp:
(WebCore::Internals::removeMediaStreamTrack): stream.removeTrack doesn't generate a 'removetrack'
event, so call private method that does.
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

Reviewed by Chris Dumez.

* fast/mediastream/media-stream-wrapper-collected-expected.txt: Added.
* fast/mediastream/media-stream-wrapper-collected.html: Added.

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

3 years ago[CoordinatedGraphics] Remove unneeded interfaces in PageClient
commit-queue@webkit.org [Fri, 9 Jun 2017 16:13:34 +0000 (16:13 +0000)]
[CoordinatedGraphics] Remove unneeded interfaces in PageClient
https://bugs.webkit.org/show_bug.cgi?id=173149

Patch by Daewoong Jang <daewoong.jang@navercorp.com> on 2017-06-09
Reviewed by Michael Catanzaro.

* UIProcess/PageClient.h:

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

3 years ago[GTK] Fix test linter reported errors
commit-queue@webkit.org [Fri, 9 Jun 2017 16:11:32 +0000 (16:11 +0000)]
[GTK] Fix test linter reported errors
https://bugs.webkit.org/show_bug.cgi?id=173160

Unreviewed gardening.

webrtc/audio-peer-connection-webaudio.html failed ambiguity checks, it typically fails
   in release and times out in debug, but it could have bother outcomes in both build
   configurations, so removing the first instance seems like the right approach.
   See: https://bugs.webkit.org/show_bug.cgi?id=169110
https://bugs.webkit.org/show_bug.cgi?id=131218 no longer crashing
https://bugs.webkit.org/show_bug.cgi?id=131216 no longer crashing
https://bugs.webkit.org/show_bug.cgi?id=119255 no longer flaky, stablized at r195130.

Linter is now quiet, aside from non-existent path errors,
which I think is tracked by https://bugs.webkit.org/show_bug.cgi?id=172471

Patch by Charlie Turner <cturner@igalia.com> on 2017-06-09

* platform/gtk/TestExpectations:

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

3 years ago[JSC] Drop OS(DARWIN) for VM_TAG_FOR_WEBASSEMBLY_MEMORY
utatane.tea@gmail.com [Fri, 9 Jun 2017 15:00:04 +0000 (15:00 +0000)]
[JSC] Drop OS(DARWIN) for VM_TAG_FOR_WEBASSEMBLY_MEMORY
https://bugs.webkit.org/show_bug.cgi?id=173147

Reviewed by JF Bastien.

Because this value becomes -1 in non-Darwin environments.
Thus, we do not need to use OS(DARWIN) here.

* wasm/WasmMemory.cpp:

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

3 years ago[GTK] Add baseline for media/media-fullscreen-inline-expected.html
csaavedra@igalia.com [Fri, 9 Jun 2017 12:53:26 +0000 (12:53 +0000)]
[GTK] Add baseline for media/media-fullscreen-inline-expected.html

Unreviewed gardening.

mediaElement.webkitSupportsPresentationMode is only present with
VIDEO_PRESENTATION_MODE enabled, and this option is only enabled
for Cocoa builds. Add a baseline without this property.
* platform/gtk/media/media-fullscreen-inline-expected.txt: Added.

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

3 years agoUse WTF::Function instead of std::function in SpeculativeLoadManager::ExpiringEntry
cdumez@apple.com [Fri, 9 Jun 2017 12:18:32 +0000 (12:18 +0000)]
Use WTF::Function instead of std::function in SpeculativeLoadManager::ExpiringEntry
https://bugs.webkit.org/show_bug.cgi?id=173125

Reviewed by Antti Koivisto.

* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
(WebKit::NetworkCache::SpeculativeLoadManager::ExpiringEntry::ExpiringEntry):
(WebKit::NetworkCache::SpeculativeLoadManager::PreloadedEntry::PreloadedEntry):

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

3 years ago[WPE] Unskip passing userscripts tests
csaavedra@igalia.com [Fri, 9 Jun 2017 11:44:18 +0000 (11:44 +0000)]
[WPE] Unskip passing userscripts tests

Unreviewed gardening.

* platform/wpe/TestExpectations:

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

3 years ago[cURL] Remove a call to Windows API
commit-queue@webkit.org [Fri, 9 Jun 2017 11:00:12 +0000 (11:00 +0000)]
[cURL] Remove a call to Windows API
https://bugs.webkit.org/show_bug.cgi?id=172079

Patch by Daewoong Jang <daewoong.jang@navercorp.com> on 2017-06-09
Reviewed by Yusuke Suzuki.

* platform/network/curl/CurlDownload.cpp:
(WebCore::CurlDownload::moveFileToDestination):
* platform/win/FileSystemWin.cpp:
(WebCore::moveFile):

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

3 years ago[GTK][WPE] Fix alpha premultiplying when using cairo to draw the video frames
magomez@igalia.com [Fri, 9 Jun 2017 10:52:21 +0000 (10:52 +0000)]
[GTK][WPE] Fix alpha premultiplying when using cairo to draw the video frames
https://bugs.webkit.org/show_bug.cgi?id=173097

Reviewed by Carlos Garcia Campos.

We need to premultiply alpha when creating a cairo surface from a GStreamer video frame, if the frame
has an alpha component. Currently this is wrongly done in VideoSinkGStreamer, as it assumes that every
frame is going to be rendered with cairo, which is not the case when using accelerated compositing.
The premultiply must happen inside ImageGStreamerCairo, which is where we know that the frame is
going to be rendered with cairo, and where the premultiply can be performed when gstreamer-gl is
enabled as well.

Covered by existent tests.

* platform/graphics/gstreamer/ImageGStreamerCairo.cpp:
(ImageGStreamer::ImageGStreamer):
* platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
(webkitVideoSinkRequestRender):

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

3 years agoUse WTF::getCurrentProcessID() instead of getpid()
commit-queue@webkit.org [Fri, 9 Jun 2017 10:39:55 +0000 (10:39 +0000)]
Use WTF::getCurrentProcessID() instead of getpid()
https://bugs.webkit.org/show_bug.cgi?id=173130

Patch by Daewoong Jang <daewoong.jang@navercorp.com> on 2017-06-09
Reviewed by Tim Horton.

* UIProcess/API/APIProcessPoolConfiguration.h:

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

3 years agostruct does not accept initializer-form if member has initializers in GCC 4.9
csaavedra@igalia.com [Fri, 9 Jun 2017 09:59:37 +0000 (09:59 +0000)]
struct does not accept initializer-form if member has initializers in GCC 4.9

Unreviewed speculative build fix.

Remove the default initializers for DeniedRequest struct,
since it's only initialized in one place, to keep gcc 4.9
happy.
* UIProcess/UserMediaPermissionRequestManagerProxy.h:

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

3 years ago[WPE] Enable ENCRYPTED_MEDIA for build-webkit builds
zandobersek@gmail.com [Fri, 9 Jun 2017 09:09:15 +0000 (09:09 +0000)]
[WPE] Enable ENCRYPTED_MEDIA for build-webkit builds
https://bugs.webkit.org/show_bug.cgi?id=173103

Reviewed by Xabier Rodriguez-Calvar.

.:

* Source/cmake/OptionsWPE.cmake: Expose the ENABLE_ENCRYPTED_MEDIA
configuration option, keeping it disabled by default.

LayoutTests/imported/w3c:

* web-platform-tests/encrypted-media/idlharness-expected.txt:
Update the idlharness.html baseline. All the test cases pass.

Source/WebCore:

* Modules/encryptedmedia/CDM.cpp:
(WebCore::CDM::getSupportedCapabilitiesForAudioVideoType):
Pass the ParsedContentType's mime type string to the explicit ContentType
constructor and assign that to the MediaEngineSupportParameters' type
member.

Tools:

* Scripts/webkitperl/FeatureList.pm: Enable ENCRYPTED_MEDIA flag
when building the WPE port through build-webkit.

LayoutTests:

Enable the imported W3C tests covering Encrypted Media API for the WPE port,
but only tests that use the ClearKey key system. WPE-specific baselines for
those tests are also added, despite the test cases universally failing. This
will allow us to spot any change in behavior that's introduced.

* platform/wpe/TestExpectations: Skip tests that test PlayReady or Widevine key systems.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-check-initdata-type-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-events-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-events-session-closed-event-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-generate-request-disallowed-input-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-invalid-license-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-keystatuses-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-keystatuses-multiple-sessions-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-destroy-persistent-license-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-persistent-license-events-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-persistent-license-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-persistent-usage-record-events-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-persistent-usage-record-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-retrieve-destroy-persistent-license-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-retrieve-persistent-license-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-retrieve-persistent-usage-record-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-clear-encrypted-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-encrypted-clear-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-encrypted-clear-sources-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-events-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multikey-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multikey-sequential-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multikey-sequential-readyState-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multisession-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-setMediaKeys-after-src-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-setMediaKeys-after-update-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-setMediaKeys-immediately-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-setMediaKeys-onencrypted-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-two-videos-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-waitingforkey-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-requestmediakeysystemaccess-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-reset-src-after-setmediakeys-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys-again-after-playback-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys-again-after-resetting-src-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys-at-same-time-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys-multiple-times-with-different-mediakeys-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys-multiple-times-with-the-same-mediakeys-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys-to-multiple-video-elements-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-syntax-mediakeys-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-syntax-mediakeysession-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-syntax-mediakeysystemaccess-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-unique-origin-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-update-disallowed-input-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-waiting-for-a-key-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-not-callable-after-createsession-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-update-non-ascii-input-expected.txt: Added.

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

3 years agoMove TreeScope::adoptIfNeeded to Node and rename it to setTreeScopeRecursively
rniwa@webkit.org [Fri, 9 Jun 2017 08:59:22 +0000 (08:59 +0000)]
Move TreeScope::adoptIfNeeded to Node and rename it to setTreeScopeRecursively
https://bugs.webkit.org/show_bug.cgi?id=173129

Reviewed by Antti Koivisto.

Renamed TreeScope::adoptIfNeeded to setTreeScopeRecursively and moved to Node.

The old name was really confusing because due to the existence of Document::adoptNode, a DOM API,
which removes the adopted node from its parent if there was one before adopting the node.
Most confusingly, this function called TreeScope::adoptIfNeeded.

Also inlined the tree scope check to avoid calling to moveTreeToNewScope when there is nothing to do.

This patch effectively reverts r104528.

No new tests. Existing tests cover this.

* dom/Attr.cpp:
(WebCore::Attr::detachFromElementWithValue):
(WebCore::Attr::attachToElement):
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::takeAllChildrenFrom):
(WebCore::ContainerNode::insertBefore):
(WebCore::ContainerNode::replaceChild):
(WebCore::ContainerNode::removeBetween):
(WebCore::ContainerNode::replaceAllChildren):
(WebCore::ContainerNode::appendChildWithoutPreInsertionValidityCheck):
(WebCore::ContainerNode::parserAppendChild):
* dom/ContainerNodeAlgorithms.cpp:
(WebCore::addChildNodesToDeletionQueue):
* dom/Document.cpp:
(WebCore::Document::adoptNode):
* dom/Element.cpp:
(WebCore::Element::ensureAttr):
* dom/Node.cpp:
(WebCore::DidMoveToNewDocumentAssertionScope): Added. The old assertion wasn't sufficient when
HTMLTemplateElement made a recursive call to setTreeScopeRecursively.
(WebCore::DidMoveToNewDocumentAssertionScope::DidMoveToNewDocumentAssertionScope):
(WebCore::DidMoveToNewDocumentAssertionScope::~DidMoveToNewDocumentAssertionScope):
(WebCore::DidMoveToNewDocumentAssertionScope::didRecieveCall):
(WebCore::moveNodeToNewDocument): Moved from TreeScope. Calls to incrementReferencingNodeCount
and decrementReferencingNodeCount to Node::didMoveToNewDocument. This function is now eliminated
in a release build.
(WebCore::moveShadowTreeToNewDocument): Moved from TreeScope.
(WebCore::Node::moveTreeToNewScope): Ditto.
(WebCore::Node::didMoveToNewDocument): See the description for moveNodeToNewDocument above.
* dom/Node.h:
(WebCore::Node::isParsingChildrenFinished): Moved to avoid having its own protected section.
(WebCore::Node::setIsParsingChildrenFinished): Ditto.
(WebCore::Node::clearIsParsingChildrenFinished): Ditto.
(WebCore::Node::setTreeScopeRecursively): Moved from TreeScope::adoptIfNeeded.
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::~ShadowRoot):
* dom/TreeScope.cpp:
(WebCore::TreeScope::adoptIfNeeded): Deleted.
(WebCore::TreeScope::moveTreeToNewScope): Deleted.
(WebCore::TreeScope::ensureDidMoveToNewDocumentWasCalled): Deleted.
(WebCore::TreeScope::moveNodeToNewDocument): Deleted.
(WebCore::TreeScope::moveShadowTreeToNewDocument): Deleted.
* dom/TreeScope.h:
* html/HTMLTemplateElement.cpp:
(WebCore::HTMLTemplateElement::didMoveToNewDocument):

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

3 years ago[GTK] Add kinetic scrolling
utatane.tea@gmail.com [Fri, 9 Jun 2017 08:58:30 +0000 (08:58 +0000)]
[GTK] Add kinetic scrolling
https://bugs.webkit.org/show_bug.cgi?id=155750

Patch by Adrien Plazas <aplazas@igalia.com> on 2017-06-09
Reviewed by Carlos Garcia Campos.

Patch by Adrien Plazas and Yusuke Suzuki.

Source/WebCore:

Add the ScrollAnimationKinetic scrolling animation allowing to perform momentum scrolling; it is based on GTK+'s
GtkKineticScrolling type.

Add the notion of phase, momentum phase and swipe velocity to PlatformWheelEvent.

Depending on whether the scrolling ended normally or triggered a swipe, the scroll animator will either compute
the swipe velocity from the previous scrolling events or use the one from the swipe gesture to initiate the
momentum scrolling.

* PlatformGTK.cmake:
* platform/PlatformWheelEvent.h:
(WebCore::PlatformWheelEvent::setHasPreciseScrollingDeltas):
(WebCore::PlatformWheelEvent::phase):
(WebCore::PlatformWheelEvent::momentumPhase):
(WebCore::PlatformWheelEvent::isTransitioningToMomentumScroll):
* platform/ScrollAnimation.h:
(WebCore::ScrollAnimation::scroll):
(WebCore::ScrollAnimation::updateVisibleLengths):
(WebCore::ScrollAnimation::setCurrentPosition):
* platform/ScrollAnimationKinetic.cpp: Added.
(WebCore::ScrollAnimationKinetic::PerAxisData::PerAxisData):
(WebCore::ScrollAnimationKinetic::PerAxisData::animateScroll):
(WebCore::ScrollAnimationKinetic::ScrollAnimationKinetic):
(WebCore::ScrollAnimationKinetic::~ScrollAnimationKinetic):
(WebCore::ScrollAnimationKinetic::stop):
(WebCore::ScrollAnimationKinetic::start):
(WebCore::ScrollAnimationKinetic::animationTimerFired):
* platform/ScrollAnimationKinetic.h: Copied from Source/WebCore/platform/ScrollAnimation.h.
* platform/gtk/PlatformWheelEventGtk.cpp:
(WebCore::PlatformWheelEvent::PlatformWheelEvent):
(WebCore::PlatformWheelEvent::swipeVelocity):
* platform/gtk/ScrollAnimatorGtk.cpp:
(WebCore::ScrollAnimatorGtk::ScrollAnimatorGtk):
(WebCore::ScrollAnimatorGtk::ensureSmoothScrollingAnimation):
(WebCore::ScrollAnimatorGtk::scroll):
(WebCore::ScrollAnimatorGtk::scrollToOffsetWithoutAnimation):
(WebCore::ScrollAnimatorGtk::computeVelocity):
(WebCore::ScrollAnimatorGtk::handleWheelEvent):
(WebCore::ScrollAnimatorGtk::willEndLiveResize):
(WebCore::ScrollAnimatorGtk::updatePosition):
(WebCore::ScrollAnimatorGtk::didAddVerticalScrollbar):
(WebCore::ScrollAnimatorGtk::didAddHorizontalScrollbar):
* platform/gtk/ScrollAnimatorGtk.h:

Source/WebKit2:

Add the notion of phase and momentum phase to WebWheelEvent.

Make WebWheelEvent manage the 'is_stop' attribute of GdkEventScroll to create the corresponding WebWheelEvent
with the correct phases and deltas.

Make GestureController manage swipes to create the corresponding WebWheelEvent with the correct phases and
deltas.

* Shared/NativeWebWheelEvent.h:
* Shared/WebEvent.h:
* Shared/WebEventConversion.cpp:
(WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent):
* Shared/WebWheelEvent.cpp:
(WebKit::WebWheelEvent::WebWheelEvent):
(WebKit::WebWheelEvent::encode):
(WebKit::WebWheelEvent::decode):
* Shared/gtk/NativeWebWheelEventGtk.cpp:
(WebKit::NativeWebWheelEvent::NativeWebWheelEvent):
* Shared/gtk/WebEventFactory.cpp:
(WebKit::WebEventFactory::createWebWheelEvent):
* Shared/gtk/WebEventFactory.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::handleWheelEvent):
(WebKit::WebPageProxy::shouldProcessWheelEventNow):
* UIProcess/WebPageProxy.h:
* UIProcess/gtk/GestureController.cpp:
(WebKit::GestureController::GestureController):
(WebKit::GestureController::handleEvent):
(WebKit::GestureController::isProcessingGestures):
(WebKit::createScrollEvent):
(WebKit::GestureController::DragGesture::startDrag):
(WebKit::GestureController::DragGesture::handleDrag):
(WebKit::GestureController::DragGesture::begin):
(WebKit::GestureController::DragGesture::end):
(WebKit::GestureController::SwipeGesture::startMomentumScroll):
(WebKit::GestureController::SwipeGesture::swipe):
(WebKit::GestureController::SwipeGesture::SwipeGesture):
* UIProcess/gtk/GestureController.h:

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

3 years ago[WPE] Enable MEDIA_SOURCE for build-webkit builds
zandobersek@gmail.com [Fri, 9 Jun 2017 08:49:02 +0000 (08:49 +0000)]
[WPE] Enable MEDIA_SOURCE for build-webkit builds
https://bugs.webkit.org/show_bug.cgi?id=173136

Reviewed by Xabier Rodriguez-Calvar.

Tools:

* Scripts/webkitperl/FeatureList.pm: Enable the MEDIA_SOURCE feature for WPE.

LayoutTests:

* platform/wpe/TestExpectations: Enable the media/media-source/ layout tests
for the WPE port, adding half a dozen failure or timeout expectations for
tests that are currently failing.

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

3 years ago[GCrypt] ECDSA signing results can be smaller than the EC key size
zandobersek@gmail.com [Fri, 9 Jun 2017 08:47:43 +0000 (08:47 +0000)]
[GCrypt] ECDSA signing results can be smaller than the EC key size
https://bugs.webkit.org/show_bug.cgi?id=171535

Reviewed by Jiewen Tan.

The libgcrypt-based implementation of the ECDSA signing operation does not
properly address the resulting `r` and `s` integers that do not potentially
match the EC key in terms of size.

To address that, the retrieved MPI data for both integers is handled depending
on the size of said data. Strictly requiring an amount of bytes that matches
the key data size N, we simply take the last N bytes if the MPI data is equal
or larger than N in size. If smaller, we first append enough zero bytes to the
output Vector object before attaching the MPI data in whole so that the amount
of appended bytes matches N.

No new tests -- covers an implementation detail that is not trivial to test,
but can rely sufficiently on existing tests.

* crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp:
(WebCore::extractECDSASignatureInteger):
(WebCore::gcryptSign):

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

3 years agoReduce compiler warnings
commit-queue@webkit.org [Fri, 9 Jun 2017 08:21:17 +0000 (08:21 +0000)]
Reduce compiler warnings
https://bugs.webkit.org/show_bug.cgi?id=172078

Patch by Daewoong Jang <daewoong.jang@navercorp.com> on 2017-06-09
Reviewed by Yusuke Suzuki.

Source/JavaScriptCore:

* runtime/IntlDateTimeFormat.h:

Source/WebCore:

* platform/network/curl/CookieJarCurl.cpp:
(WebCore::addMatchingCurlCookie):
(WebCore::getHostnamesWithCookies):
(WebCore::deleteCookiesForHostnames):
(WebCore::deleteCookiesForHostname): Deleted.
* platform/network/curl/CurlDownload.cpp:
(WebCore::CurlDownloadManager::downloadThread):
(WebCore::CurlDownload::didReceiveHeader):
* platform/network/curl/CurlDownload.h:
(WebCore::CurlDownloadListener::didReceiveDataOfLength):
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::WebCoreSynchronousLoader::didReceiveResponse):
(WebCore::ResourceHandle::platformLoadResourceSynchronously):
* platform/network/curl/SocketStreamHandleImplCurl.cpp:
(WebCore::createCopy):
(WebCore::SocketStreamHandleImpl::readData):

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

3 years agoCrash in -[WKWebView _initializeWithConfiguration:]
jer.noble@apple.com [Fri, 9 Jun 2017 08:05:32 +0000 (08:05 +0000)]
Crash in -[WKWebView _initializeWithConfiguration:]
https://bugs.webkit.org/show_bug.cgi?id=173126

Reviewed by Antti Koivisto.

Crash occurs when passing an autoreleased NSString into _setMediaContentTypesRequiringHardwareSupport.
The ivar should be a RetainPtr rather than a bare NSString *.

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

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

3 years ago[GStreamer][EME] Remove the legacy code that was not even official and is deprecated
calvaris@igalia.com [Fri, 9 Jun 2017 08:03:47 +0000 (08:03 +0000)]
[GStreamer][EME] Remove the legacy code that was not even official and is deprecated
https://bugs.webkit.org/show_bug.cgi?id=173096

Reviewed by Žan Doberšek.

.:

* Source/cmake/OptionsWPE.cmake: Remove LEGACY_ENCRYPTED_MEDIA support

Source/WebCore:

We are removing the LEGACY_ENCRYPTED_MEDIA code that we was not
official, is deprecated and we are not planning to support it
anymore in any way.

This also helps implementing current ENCRYPTED_MEDIA in a cleaner
way.

* platform/GStreamer.cmake:
* platform/graphics/gstreamer/GStreamerUtilities.cpp:
* platform/graphics/gstreamer/GStreamerUtilities.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::registerWebKitGStreamerElements):
(WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
(WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
(WebCore::extractEventsAndSystemsFromMessage): Deleted.
(WebCore::MediaPlayerPrivateGStreamerBase::needKey): Deleted.
(WebCore::MediaPlayerPrivateGStreamerBase::setCDMSession): Deleted.
(WebCore::MediaPlayerPrivateGStreamerBase::keyAdded): Deleted.
(WebCore::MediaPlayerPrivateGStreamerBase::handleProtectionEvent): Deleted.
(WebCore::MediaPlayerPrivateGStreamerBase::receivedGenerateKeyRequest): Deleted.
(WebCore::keySystemIdToUuid): Deleted.
(WebCore::MediaPlayerPrivateGStreamerBase::createSession): Deleted.
(WebCore::MediaPlayerPrivateGStreamerBase::dispatchDecryptionKey): Deleted.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.h:
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h:
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::AppendPipeline):
(WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
(WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
(WebCore::AppendPipeline::disconnectDemuxerSrcPadFromAppsinkFromAnyThread):
(WebCore::appendPipelineElementMessageCallback): Deleted.
(WebCore::AppendPipeline::dispatchPendingDecryptionKey): Deleted.
(WebCore::AppendPipeline::dispatchDecryptionKey): Deleted.
(WebCore::AppendPipeline::handleElementMessage): Deleted.
* platform/graphics/gstreamer/mse/AppendPipeline.h:
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::dispatchDecryptionKey): Deleted.
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:

LayoutTests:

* platform/gtk/TestExpectations: Mark legacy tests as deprecated

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

3 years agoAX: Media Controls: Missing labels for the Time Labels.
commit-queue@webkit.org [Fri, 9 Jun 2017 08:02:04 +0000 (08:02 +0000)]
AX: Media Controls: Missing labels for the Time Labels.
https://bugs.webkit.org/show_bug.cgi?id=171715
<rdar://problem/32009214>

Patch by Aaron Chu <aaron_chu@apple.com> on 2017-06-09
Reviewed by Antoine Quint.

Source/WebCore:

Added aria-label to describe time labels in media controls.

* Modules/modern-media-controls/controls/slider.js:
(Slider.prototype.set inputAccessibleLabel):
(Slider.prototype._formatTime): Deleted.
* Modules/modern-media-controls/controls/time-label.js:
(TimeLabel.prototype.commitProperty):
* Modules/modern-media-controls/main.js:
(formatTimeToString):

LayoutTests:

Modified existing test case to accommodate testing for time label description.

* media/modern-media-controls/time-label/time-label.html:

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

3 years agoUnreviewed. Fix unused parameter warning after r217955.
carlosgc@webkit.org [Fri, 9 Jun 2017 06:12:51 +0000 (06:12 +0000)]
Unreviewed. Fix unused parameter warning after r217955.

* platform/graphics/FontFamilySpecificationNull.h:
(WebCore::FontFamilySpecificationNull::fontRanges):

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

3 years ago[GTK] Use API::FormClient instead of the C API in WebKitFormClient
carlosgc@webkit.org [Fri, 9 Jun 2017 05:26:41 +0000 (05:26 +0000)]
[GTK] Use API::FormClient instead of the C API in WebKitFormClient
https://bugs.webkit.org/show_bug.cgi?id=173098

Reviewed by Žan Doberšek.

Source/WebKit2:

* UIProcess/API/gtk/WebKitFormClient.cpp:
(attachFormClientToView):
(willSubmitForm): Deleted.
* UIProcess/API/gtk/WebKitFormSubmissionRequest.cpp:
(webkitFormSubmissionRequestCreate):
(webkit_form_submission_request_get_text_fields):
* UIProcess/API/gtk/WebKitFormSubmissionRequestPrivate.h:
* WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
(webkitWebPageCreate):

Tools:

Fix memory leak and runtime warning when running /webkit2/WebKitWebView/submit-form. The web extension is
assuming that all tests containing forms define ids for the form elements like
/webkit2/WebKitWebExtension/form-controls-associated-signal does.

* TestWebKitAPI/Tests/WebKit2Gtk/WebExtensionTest.cpp:
(formControlsAssociatedCallback):

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

3 years ago[preload] Mandatory `as` value and related spec alignments
yoav@yoav.ws [Fri, 9 Jun 2017 05:25:02 +0000 (05:25 +0000)]
[preload] Mandatory `as` value and related spec alignments
https://bugs.webkit.org/show_bug.cgi?id=173047

Reviewed by Dean Jackson.

Source/WebCore:

Align preload's implementation according to latest spec changes: `as` is mandatory and "fetch" replaces the previous empty `as` value,
onerror no longer fires for invalid `as` values, and the IDL for `as` reflects only valid values, to enable feature detection.

Related standard discussions:
https://github.com/w3c/preload/issues/80
https://github.com/whatwg/fetch/pull/547
https://github.com/whatwg/fetch/pull/549
https://github.com/whatwg/html/pull/2588

No new tests but modified existing ones as well as their expectations.

* html/HTMLLinkElement.cpp: Add "enumerated attribute" reflection methods to `as`.
(WebCore::HTMLLinkElement::setAs):
(WebCore::HTMLLinkElement::as):
* html/HTMLLinkElement.h:
* html/HTMLLinkElement.idl:
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::loadLinksFromHeader): preloadIfNeeded signature change.
(WebCore::LinkLoader::resourceTypeFromAsAttribute): Replace the empty value by "fetch".
(WebCore::LinkLoader::preloadIfNeeded): Change the signature, as a LinkLoaderClient is no longer needed, since we don't fire error
events from inside the function.
(WebCore::LinkLoader::loadLink): preloadIfNeeded signature change.
* loader/LinkLoader.h: preloadIfNeeded signature change.

LayoutTests:

Fix tests and expectations to this patch's changes: `as` is mandatory and "fetch" replaces the previous empty `as` value,
onerror no longer fires for invalid `as` values, and the IDL for `as` reflects only valid values, to enable feature detection.

* http/tests/fetch/redirectmode-and-preload.html:
* http/tests/preload/download_resources-expected.txt:
* http/tests/preload/download_resources.html:
* http/tests/preload/download_resources_from_header_iframe-expected.txt:
* http/tests/preload/onerror_event-expected.txt:
* http/tests/preload/onerror_event.html:
* http/tests/preload/onload_event-expected.txt:
* http/tests/preload/onload_event.html:
* http/tests/preload/preloadscanner_download_resources.html:
* http/tests/preload/resources/download_resources_from_header.php:
* http/tests/preload/resources/nph-invalid_resources_from_header.pl:
* http/tests/preload/single_download_preload.html:
* http/tests/preload/single_download_preload_headers.php:
* imported/w3c/web-platform-tests/html/dom/reflection-metadata-expected.txt: PProgressions related to correct reflection.

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

3 years ago[GTK] Use API::Findclient instead of the C API in WebKitFindController
carlosgc@webkit.org [Fri, 9 Jun 2017 05:24:32 +0000 (05:24 +0000)]
[GTK] Use API::Findclient instead of the C API in WebKitFindController
https://bugs.webkit.org/show_bug.cgi?id=173095

Reviewed by Žan Doberšek.

* UIProcess/API/gtk/WebKitFindController.cpp:
(getPage):
(webkitFindControllerDispose):
(webkitFindControllerConstructed):
(webkit_find_controller_class_init):

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

3 years ago[GTK] Get rid of custom marshallers of signals
carlosgc@webkit.org [Fri, 9 Jun 2017 05:22:40 +0000 (05:22 +0000)]
[GTK] Get rid of custom marshallers of signals
https://bugs.webkit.org/show_bug.cgi?id=173094

Reviewed by Žan Doberšek.

Use g_cclosure_marshal_generic instead.

* PlatformGTK.cmake:
* UIProcess/API/gtk/WebKitBackForwardList.cpp:
* UIProcess/API/gtk/WebKitDownload.cpp:
(webkit_download_class_init):
* UIProcess/API/gtk/WebKitFaviconDatabase.cpp:
(webkit_favicon_database_class_init):
* UIProcess/API/gtk/WebKitWebInspector.cpp:
(webkit_web_inspector_class_init):
* UIProcess/API/gtk/WebKitWebResource.cpp:
(webkit_web_resource_class_init):
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkit_web_view_class_init):
* UIProcess/API/gtk/webkit2marshal.list: Removed.
* WebProcess/InjectedBundle/API/gtk/WebKitScriptWorld.cpp:
* WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
(webkit_web_page_class_init):

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

3 years ago[iOS] LowPowerModeNotifier notifies client on non-main thread
cdumez@apple.com [Fri, 9 Jun 2017 02:59:41 +0000 (02:59 +0000)]
[iOS] LowPowerModeNotifier notifies client on non-main thread
https://bugs.webkit.org/show_bug.cgi?id=173115
<rdar://problem/32644703>

Reviewed by Ryosuke Niwa.

Update iOS's implementation of the LowPowerModeNotifier to make sure
we notify the client of low power mode changes on the main thread.

* platform/ios/LowPowerModeNotifierIOS.mm:
(-[WebLowPowerModeObserver _didReceiveLowPowerModeChange]):

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

3 years agoCrash inside InsertNodeBeforeCommand via InsertParagraphSeparatorCommand
rniwa@webkit.org [Fri, 9 Jun 2017 02:13:06 +0000 (02:13 +0000)]
Crash inside InsertNodeBeforeCommand via InsertParagraphSeparatorCommand
https://bugs.webkit.org/show_bug.cgi?id=173085
Source/WebCore:

<rdar://problem/32575059>

Reviewed by Wenson Hsieh.

The crash was caused by the condition to check for special cases failing when visiblePos is null.
Exit early in these extreme cases.

Also replaced the use of deprecatedNode and deprecatedEditingOffset to modern idioms.

Test: editing/inserting/insert-horizontal-rule-in-empty-document-crash.html

* editing/InsertParagraphSeparatorCommand.cpp:
(WebCore::InsertParagraphSeparatorCommand::doApply):

LayoutTests:

Reviewed by Wenson Hsieh.

Added a regresion test.

* editing/inserting/insert-horizontal-rule-in-empty-document-crash-expected.txt: Added.
* editing/inserting/insert-horizontal-rule-in-empty-document-crash.html: Added.

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

3 years agoThe tree scope of an Attr node inside a shadow tree does not updated upon detach.
rniwa@webkit.org [Fri, 9 Jun 2017 02:09:39 +0000 (02:09 +0000)]
The tree scope of an Attr node inside a shadow tree does not updated upon detach.
https://bugs.webkit.org/show_bug.cgi?id=173122

Reviewed by Chris Dumez.

Source/WebCore:

The crash was caused by the tree scope of an Attr detached from an element inside a shadow root
not getting updated.

Test: fast/dom/detaching-attr-node-in-shadow-tree-crash.html

* dom/Attr.cpp:
(WebCore::Attr::~Attr): Added assertions.
(WebCore::Attr::detachFromElementWithValue): Fixed the bug by adopting Attr to Document.
(WebCore::Attr::attachToElement): Moved the adoptIfNeeded call here from attachAttributeNodeIfNeeded.
* dom/Element.cpp:
(WebCore::Element::attachAttributeNodeIfNeeded):

LayoutTests:

Added a regression test which hits the newly added assertion.

* fast/dom/detaching-attr-node-in-shadow-tree-crash-expected.txt: Added.
* fast/dom/detaching-attr-node-in-shadow-tree-crash.html: Added.

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

3 years agoCrash under -[WKWebView _updateVisibleContentRects]
simon.fraser@apple.com [Fri, 9 Jun 2017 00:46:38 +0000 (00:46 +0000)]
Crash under -[WKWebView _updateVisibleContentRects]
https://bugs.webkit.org/show_bug.cgi?id=173123
rdar://problem/32650112

Reviewed by Tim Horton.

Make sure the WKWebView is valid in places where we dispatch_async or use
a pre-commit handler.

Speculative fix for a rare crasher.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _isValid]):
(-[WKWebView _addUpdateVisibleContentRectPreCommitHandler]):
(-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]):

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

3 years ago[Cocoa] Expand system-ui to include every item in the Core Text cascade list
mmaxfield@apple.com [Fri, 9 Jun 2017 00:31:17 +0000 (00:31 +0000)]
[Cocoa] Expand system-ui to include every item in the Core Text cascade list
https://bugs.webkit.org/show_bug.cgi?id=173043
<rdar://problem/21125708>

Reviewed by Simon Fraser.

Source/WebCore:

The concept of the system font on Cocoa platforms represents the entire Core Text cascade list.
However, previously, WebKit only represented system-ui by pulling out the first item in the Core
Text cascade list. Instead, we should make all text rendered with "system-ui" match what the
platform would natively render.

Previously, we walked through the strings in the font-family property and looked them up one by
one. However, now we want to abstract this idea of a font family to possibly hold a
CTFontDescriptorRef instead of a string. This way, we expand a font-family list of ["fontA",
"system-ui", "fontB"] to ["fontA", ... a bunch of CTFontDescriptorRefs ..., "FontB"]. We can
then modify the consumer of this object to have two codepaths: the old string-based codepath,
and a new, platform-specific codepath which simply embeds the CTFontDesriptorRefs inside a Font
object.

We don't want to simply pull out the family name from each item in the Core Text fallback list
because that is a lossy translation. There is more information in these font descriptors which
cannot be represented by CSS. Therefore, we must keep the descriptors alive and add the new
codepath for them.

We also don't want to run the CSS font matching algorithm on each member of the Core Text
fallback list because it may yield different results from Core Text's font matching algorithm.
Our goal is to draw text as closely as possible to the system APIs. If we ran it, we may find
a font which is closer to the requested traits, but it would look out of place on the system.

Tests: fast/text/system-font-fallback-emoji.html
       fast/text/system-font-fallback.html

* WebCore.xcodeproj/project.pbxproj:
* page/MemoryRelease.cpp:
(WebCore::releaseNoncriticalMemory):
* platform/graphics/FontCascadeFonts.cpp:
(WebCore::realizeNextFallback): The consumer of our new data type. Now uses WTF::visit().
(WebCore::FontCascadeFonts::realizeFallbackRangesAt): Now that the number of items to test
against the current character is larger than the number of strings in the font-family list,
we need to update the existing code to use the correct value.
* platform/graphics/FontDescription.cpp: Default implementation for non-Cocoa ports.
(WebCore::FontDescription::invalidateCaches):
(WebCore::FontCascadeDescription::effectiveFamilyCount):
(WebCore::FontCascadeDescription::effectiveFamilyAt):
* platform/graphics/FontDescription.h: Our new data type is a Variant of AtomicString and a
platform-specific class. Cocoa uses a class that holds a CTFontDescriptorRef and other ports
use an empty non-constructable class.
* platform/graphics/FontFamilySpecificationNull.h: Added. The empty non-constructable
class.
(WebCore::FontFamilySpecificationNull::fontRanges):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontCache::platformInit): Changing the system language will change the system font
fallback list, so we need to listen to this notification. This also matters for
FontCache::systemFallbackForCharacters(), so we should build off the same callback we are
already using for font installation.
(WebCore::invalidateFontCache):
* platform/graphics/cocoa/FontDescriptionCocoa.cpp: Added. The platform-specific creation of
our CTFontDescriptorRefs. We hold them cached in a SystemFontDatabase.
(WebCore::SystemFontDatabase::CoreTextCascadeListParameters::CoreTextCascadeListParameters):
(WebCore::SystemFontDatabase::CoreTextCascadeListParameters::isHashTableDeletedValue):
(WebCore::SystemFontDatabase::CoreTextCascadeListParameters::operator==):
(WebCore::SystemFontDatabase::CoreTextCascadeListParameters::hash):
(WebCore::SystemFontDatabase::singleton):
(WebCore::SystemFontDatabase::systemFontCascadeList):
(WebCore::SystemFontDatabase::clear):
(WebCore::SystemFontDatabase::SystemFontDatabase):
(WebCore::SystemFontDatabase::applyWeightAndItalics):
(WebCore::SystemFontDatabase::computeCascadeList):
(WebCore::SystemFontDatabase::CoreTextCascadeListParametersHash::hash):
(WebCore::SystemFontDatabase::CoreTextCascadeListParametersHash::equal):
(WebCore::isSystemFontString):
(WebCore::systemFontParameters):
(WebCore::FontDescription::invalidateCaches):
(WebCore::FontCascadeDescription::effectiveFamilyCount): We don't store the result of this
because it would probably be a bad idea to increase the size of every single FontCascade just
in case it might ask for the system font. Most fonts never mention system-ui. Because it's so
rare, we can just recalculate the result of this as necessary. This shouldn't be slow because
the results are cached.
(WebCore::FontCascadeDescription::effectiveFamilyAt):
* platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp: Added.
(WebCore::FontFamilySpecificationCoreText::fontRanges): Create a FontRanges from a
CTFontDescriptorRef.
* platform/graphics/cocoa/FontFamilySpecificationCoreText.h: Added.
(WebCore::FontFamilySpecificationCoreText::FontFamilySpecificationCoreText):
* platform/graphics/ios/FontCacheIOS.mm: Delete the old handling for system-ui.
(WebCore::platformFontWithFamilySpecialCase):
(WebCore::baseSystemFontDescriptor): Deleted.
(WebCore::systemFontModificationAttributes): Deleted.
(WebCore::systemFontDescriptor): Deleted.
* platform/graphics/mac/FontCacheMac.mm: Ditto.
(WebCore::platformFontWithFamilySpecialCase):
(WebCore::toNSFontWeight): Deleted.

LayoutTests:

Rebaseline tests which use non-English text in form controls

* fast/text/system-font-fallback-emoji-expected.txt: Added.
* fast/text/system-font-fallback-emoji.html: Added.
* fast/text/system-font-fallback-expected.html: Added.
* fast/text/system-font-fallback.html: Added.
* platform/mac-elcapitan/fast/forms/listbox-bidi-align-expected.png: Added.
* platform/mac-elcapitan/fast/forms/listbox-bidi-align-expected.txt:
* platform/mac-elcapitan/fast/forms/search-rtl-expected.png: Added.
* platform/mac-elcapitan/fast/forms/search-rtl-expected.txt:
* platform/mac-elcapitan/fast/forms/searchfield-heights-expected.png: Added.
* platform/mac-elcapitan/fast/forms/searchfield-heights-expected.txt:
* platform/mac-elcapitan/fast/forms/visual-hebrew-text-field-expected.txt:
* platform/mac-elcapitan/fast/text/drawBidiText-expected.png: Added.
* platform/mac-elcapitan/fast/text/drawBidiText-expected.txt:
* platform/mac-elcapitan/fast/text/international/pop-up-button-text-alignment-and-direction-expected.png: Added.
* platform/mac-elcapitan/fast/text/international/pop-up-button-text-alignment-and-direction-expected.txt:
* platform/mac/TestExpectations:
* platform/mac/fast/css/rtl-ordering-expected.png:
* platform/mac/fast/css/rtl-ordering-expected.txt:
* platform/mac/fast/forms/listbox-bidi-align-expected.png:
* platform/mac/fast/forms/listbox-bidi-align-expected.txt:
* platform/mac/fast/forms/listbox-hit-test-zoomed-expected.png:
* platform/mac/fast/forms/listbox-hit-test-zoomed-expected.txt:
* platform/mac/fast/forms/search-rtl-expected.png:
* platform/mac/fast/forms/search-rtl-expected.txt:
* platform/mac/fast/forms/searchfield-heights-expected.txt:
* platform/mac/fast/forms/select-visual-hebrew-expected.png:
* platform/mac/fast/forms/select-visual-hebrew-expected.txt:
* platform/mac/fast/forms/visual-hebrew-text-field-expected.png:
* platform/mac/fast/forms/visual-hebrew-text-field-expected.txt:
* platform/mac/fast/text/drawBidiText-expected.png:
* platform/mac/fast/text/drawBidiText-expected.txt:
* platform/mac/fast/text/international/pop-up-button-text-alignment-and-direction-expected.png:
* platform/mac/fast/text/international/pop-up-button-text-alignment-and-direction-expected.txt:
* platform/mac/fast/text/updateNewFont-expected.png:
* platform/mac/fast/text/updateNewFont-expected.txt:

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

3 years agoUpdate Timer to take a WTF::Function instead of a std::function
cdumez@apple.com [Thu, 8 Jun 2017 23:05:06 +0000 (23:05 +0000)]
Update Timer to take a WTF::Function instead of a std::function
https://bugs.webkit.org/show_bug.cgi?id=173113

Reviewed by Brady Eidson.

Update Timer to take a WTF::Function instead of a std::function as we prefer
to use WTF::Function in WebKit.

* platform/GenericTaskQueue.cpp:
(WebCore::TaskDispatcher<Timer>::sharedTimer):
* platform/Timer.h:
(WebCore::Timer::Timer):
(WebCore::DeferrableOneShotTimer::DeferrableOneShotTimer):

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

3 years ago[WebRTC] enableMockMediaEndpoint() is only used for the OpenWebRTC backend.
clopez@igalia.com [Thu, 8 Jun 2017 22:36:46 +0000 (22:36 +0000)]
[WebRTC] enableMockMediaEndpoint() is only used for the OpenWebRTC backend.
https://bugs.webkit.org/show_bug.cgi?id=173108

Reviewed by Eric Carlson.

Covered by existing tests.

* testing/Internals.cpp:
(WebCore::Internals::Internals):
(WebCore::Internals::enableMockMediaEndpoint):
* testing/Internals.h:

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

3 years ago[Cocoa] JSWrapperMap leaks for all JSContexts
commit-queue@webkit.org [Thu, 8 Jun 2017 22:24:11 +0000 (22:24 +0000)]
[Cocoa] JSWrapperMap leaks for all JSContexts
https://bugs.webkit.org/show_bug.cgi?id=173110
<rdar://problem/32602198>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-06-08
Reviewed by Geoffrey Garen.

* API/JSContext.mm:
(-[JSContext ensureWrapperMap]):
Ensure this allocation gets released.

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

3 years agoUse initializers in WebPageProxy
simon.fraser@apple.com [Thu, 8 Jun 2017 22:17:20 +0000 (22:17 +0000)]
Use initializers in WebPageProxy
https://bugs.webkit.org/show_bug.cgi?id=173073

Reviewed by Tim Horton.

Initialize the member variables the modern way.

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

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

3 years agoREGRESSION: fast/images/animated-gif-webkit-transform.html is flaky
cdumez@apple.com [Thu, 8 Jun 2017 22:12:32 +0000 (22:12 +0000)]
REGRESSION: fast/images/animated-gif-webkit-transform.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=170410
<rdar://problem/31409381>

Reviewed by Simon Fraser.

Fix flakiness and unskip test.

* fast/images/animated-gif-webkit-transform-expected.txt:
* fast/images/animated-gif-webkit-transform.html:
* platform/mac-wk2/TestExpectations:

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

3 years ago[iOS] Buttons in top-left and bottom media controls bar are positioned too high
commit-queue@webkit.org [Thu, 8 Jun 2017 22:03:00 +0000 (22:03 +0000)]
[iOS] Buttons in top-left and bottom media controls bar are positioned too high
https://bugs.webkit.org/show_bug.cgi?id=173111
<rdar://problem/32650615>

Patch by Antoine Quint <graouts@apple.com> on 2017-06-08
Reviewed by Jon Lee.

Source/WebCore:

Test: media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-button-padding.html

Since we use flex box to vertically center buttons in a buttons container, there is no
need to offset the button due to padding in the y-axis.

* Modules/modern-media-controls/controls/buttons-container.css:
(.ios .buttons-container button):

LayoutTests:

Add a test that checks that the appropriate styles as set in buttons-container.css
are applied to a button in a buttons container on iOS.

* media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-button-padding-expected.txt: Added.
* media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-button-padding.html: Added.
* platform/ios-simulator/TestExpectations:

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

3 years agoImplement additional AVPlayerController interfaces for minTime and maxTime.
commit-queue@webkit.org [Thu, 8 Jun 2017 21:47:39 +0000 (21:47 +0000)]
Implement additional AVPlayerController interfaces for minTime and maxTime.
https://bugs.webkit.org/show_bug.cgi?id=172396
rdar://problem/30737452

Patch by Jeremy Jones <jeremyj@apple.com> on 2017-06-08
Reviewed by Jer Noble.

Source/WebCore:

No new tests because no change to DOM.

Add support for new HLS UI in AVKit.

This adds new properties (seekableTimeRangesLastModifiedTime, liveUpdateInterval, minTiming, maxTiming) to WebAVPlayerController.
Plumb these properties from AVPlayer up to AVKit.

Switch WebPlaybackSessionModelMediaElement from updating seekableRangesChanged using timeupdate event to using progress event.

Enable progress events on iOS.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
(WebCore::HTMLMediaElement::loadResource):
(WebCore::HTMLMediaElement::seekableTimeRangesLastModifiedTime):
(WebCore::HTMLMediaElement::liveUpdateInterval):
* html/HTMLMediaElement.h:
* platform/cf/CoreMediaSoftLink.cpp:
* platform/cf/CoreMediaSoftLink.h:
* platform/cocoa/WebPlaybackSessionModel.h:
(WebCore::WebPlaybackSessionModelClient::seekableRangesChanged):
* platform/cocoa/WebPlaybackSessionModelMediaElement.h:
* platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
(WebCore::WebPlaybackSessionModelMediaElement::updateForEventName):
(WebCore::WebPlaybackSessionModelMediaElement::observedEventNames):
(WebCore::WebPlaybackSessionModelMediaElement::seekableTimeRangesLastModifiedTime):
(WebCore::WebPlaybackSessionModelMediaElement::liveUpdateInterval):
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::seekableTimeRangesLastModifiedTime):
(WebCore::MediaPlayer::liveUpdateInterval):
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::seekableTimeRangesLastModifiedTime):
(WebCore::MediaPlayerPrivateInterface::liveUpdateInterval):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::seekableTimeRangesLastModifiedTime):
(WebCore::MediaPlayerPrivateAVFoundationObjC::liveUpdateInterval):
* platform/ios/WebAVPlayerController.h:
* platform/ios/WebAVPlayerController.mm:
(-[WebAVPlayerController init]):
(-[WebAVPlayerController dealloc]):
(-[WebAVPlayerController observeValueForKeyPath:ofObject:change:context:]):
(-[WebAVPlayerController updateMinMaxTiming]):
(-[WebAVPlayerController hasSeekableLiveStreamingContent]):
(+[WebAVPlayerController keyPathsForValuesAffectingHasSeekableLiveStreamingContent]):
(-[WebAVPlayerController resetMediaState]):
* platform/ios/WebPlaybackSessionInterfaceAVKit.h:
* platform/ios/WebPlaybackSessionInterfaceAVKit.mm:
(WebCore::WebPlaybackSessionInterfaceAVKit::WebPlaybackSessionInterfaceAVKit):
(WebCore::WebPlaybackSessionInterfaceAVKit::resetMediaState):
(WebCore::WebPlaybackSessionInterfaceAVKit::seekableRangesChanged):
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(WebVideoFullscreenControllerContext::seekableRangesChanged):
(WebVideoFullscreenControllerContext::seekableTimeRangesLastModifiedTime):
(WebVideoFullscreenControllerContext::liveUpdateInterval):
* platform/mac/WebPlaybackSessionInterfaceMac.h:
* platform/mac/WebPlaybackSessionInterfaceMac.mm:
(WebCore::WebPlaybackSessionInterfaceMac::seekableRangesChanged):
* platform/spi/cocoa/AVKitSPI.h:
* platform/spi/mac/AVFoundationSPI.h:

Source/WebKit2:

Add support for new HLS UI in AVKit.

Plumb seekableTimeRangesLastModifiedTime and liveUpdateInterval across process boundaries.

* UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h:
* UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in:
* UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm:
(WebKit::WebPlaybackSessionModelContext::setSeekableRanges):
(WebKit::WebPlaybackSessionManagerProxy::setSeekableRangesVector):
* WebProcess/cocoa/WebPlaybackSessionManager.h:
* WebProcess/cocoa/WebPlaybackSessionManager.mm:
(WebKit::WebPlaybackSessionInterfaceContext::seekableRangesChanged):
(WebKit::WebPlaybackSessionManager::seekableRangesChanged):

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

3 years agoUse WTF::Function more in SpeculativeLoadManager
cdumez@apple.com [Thu, 8 Jun 2017 21:37:50 +0000 (21:37 +0000)]
Use WTF::Function more in SpeculativeLoadManager
https://bugs.webkit.org/show_bug.cgi?id=173109

Reviewed by Antti Koivisto.

Use WTF::Function more in SpeculativeLoadManager.

* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
(WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::create):
(WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::PendingFrameLoad):
(WebKit::NetworkCache::SpeculativeLoadManager::registerLoad):
(WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry):
* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:

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

3 years agowebkitpy: Run sample/spindump on iOS devices
jbedard@apple.com [Thu, 8 Jun 2017 20:39:00 +0000 (20:39 +0000)]
webkitpy: Run sample/spindump on iOS devices
https://bugs.webkit.org/show_bug.cgi?id=171881
<rdar://problem/32084602>

Reviewed by Daniel Bates.

* Scripts/webkitpy/port/darwin.py:
(DarwinPort.sample_process): Only add sudo prefix if the platform is Mac, which
requires sudo to run spindump.
* Scripts/webkitpy/port/ios_device.py:
(IOSDevicePort.look_for_new_samples): Deleted.
(IOSDevicePort.sample_process): Deleted.
* Scripts/webkitpy/port/ios_device_unittest.py:
(IOSDeviceTest): iOS devices use 'ios' and their os_name.
(IOSDeviceTest.test_spindump):
(IOSDeviceTest.test_sample_process):
(IOSDeviceTest.test_sample_process_exception):
* Scripts/webkitpy/port/ios_simulator_unittest.py:
(IOSSimulatorTest): iOS Simulators run on Mac and use 'mac' as their os_name.

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

3 years agogetUserMedia should not be prompted again if user denied access
commit-queue@webkit.org [Thu, 8 Jun 2017 20:37:49 +0000 (20:37 +0000)]
getUserMedia should not be prompted again if user denied access
https://bugs.webkit.org/show_bug.cgi?id=173104

Patch by Youenn Fablet <youenn@apple.com> on 2017-06-08
Reviewed by Geoff Garen.

Source/WebKit2:

Store denied requests to be able to replay them.
If mic is denied, user might be prompted for camera, not for mic and camera.
Same principle applies to the case of denied camera.
Clearing the stored denied requests when reloading/navigating away.

* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied):
(WebKit::UserMediaPermissionRequestManagerProxy::resetAccess):
(WebKit::UserMediaPermissionRequestManagerProxy::isRequestDenied):
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
* UIProcess/UserMediaPermissionRequestManagerProxy.h:

LayoutTests:

Splitting grant test due to remembering deny decisions.

* fast/mediastream/getUserMedia-deny-persistency-expected.txt: Added.
* fast/mediastream/getUserMedia-deny-persistency-reload-expected.txt: Added.
* fast/mediastream/getUserMedia-deny-persistency-reload.html: Added.
* fast/mediastream/getUserMedia-deny-persistency.html: Added.
* fast/mediastream/getUserMedia-deny-persistency2-expected.txt: Added.
* fast/mediastream/getUserMedia-deny-persistency2.html: Added.
* fast/mediastream/getUserMedia-deny-persistency3-expected.txt: Added.
* fast/mediastream/getUserMedia-deny-persistency3.html: Added.
* fast/mediastream/getUserMedia-grant-persistency-expected.txt:
* fast/mediastream/getUserMedia-grant-persistency.html:
* fast/mediastream/getUserMedia-grant-persistency2-expected.txt: Added.
* fast/mediastream/getUserMedia-grant-persistency2.html: Added.
* fast/mediastream/getUserMedia-grant-persistency3-expected.txt: Added.
* fast/mediastream/getUserMedia-grant-persistency3.html: Added.

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

3 years agoREGRESSION: js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps...
fpizlo@apple.com [Thu, 8 Jun 2017 20:08:24 +0000 (20:08 +0000)]
REGRESSION: js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-5.html has a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=161156

Reviewed by Saam Barati.

Source/JavaScriptCore:

Since LLInt does not register impure property watchpoints for self property accesses, it
shouldn't try to cache accesses that require a watchpoint.

This manifested as a flaky failure because the test would fire the watchpoint after we had
usually already tiered up. Without concurrent JIT, we would have always tiered up before
getting to the bad case. With concurrent JIT, we would sometimes not tier up by that time. This
also adds a test that deterministically failed in LLInt without this change; it does so by just
running a lot shorter.

* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):

LayoutTests:

Add a version of the test that's guaranteed to fail if the problem it's testing for manifests
in the LLInt.

* js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-5-short.html: Added.

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

3 years agoLaili restaurant menu page does not display full menu
hyatt@apple.com [Thu, 8 Jun 2017 20:06:44 +0000 (20:06 +0000)]
Laili restaurant menu page does not display full menu
https://bugs.webkit.org/show_bug.cgi?id=173062
rdar://problem/32436486

Reviewed by Simon Fraser.

Source/WebCore:

Percentage heights inside auto containing blocks were handled correctly by
hasReplacedLogicalHeight, which checked hasAutoHeightOrContainingBlockWithAutoHeight
properly. min-max-height were not handled properly though and need to do the same check.

There is also now a quirk for iBooks to preserve the old behavior, since they depend
on the old behavior to constrain the height of images to a page.

Test: fast/replaced/max-height-percent-inside-auto-block.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::replacedMinMaxLogicalHeightComputesAsNone):
Add a new helper that resolves min and max logical height values to none for
replaced elements with percentage min/max heights inside auto containing blocks.

(WebCore::RenderBox::computeReplacedLogicalHeightRespectingMinMaxHeight):
Change the min/max-height constraint function for replaced elements to call the
new helper function.

* rendering/RenderBox.h:
* rendering/RenderBoxModelObject.h:
Move a function from private to protected so that RenderBox can access it.

LayoutTests:

* fast/hidpi/percent-height-image-nested-expected.html:
* fast/hidpi/percent-height-image-nested.html:
* fast/multicol/pagination/RightToLeft-max-width.html:
* fast/replaced/max-height-percent-inside-auto-block-expected.html: Added.
* fast/replaced/max-height-percent-inside-auto-block.html: Added.
* platform/mac/fast/multicol/pagination/RightToLeft-max-width-expected.txt:

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

3 years agoWebAssembly: We should only create wrappers for functions that can be exported
keith_miller@apple.com [Thu, 8 Jun 2017 19:13:53 +0000 (19:13 +0000)]
WebAssembly: We should only create wrappers for functions that can be exported
https://bugs.webkit.org/show_bug.cgi?id=173088

Reviewed by Saam Barati.

JSTests:

Remove a bunch of old tests that are actually duplicates of the spec-tests and rely
on the old testWasmModuleFunctions api, which has been removed.

* wasm/function-tests/copysign.js: Removed.
* wasm/function-tests/ctz.js: Removed.
* wasm/function-tests/drop.js: Removed.
* wasm/function-tests/dumb-eq-if-then-else.js: Removed.
* wasm/function-tests/dumb-less-than-fallthrough.js: Removed.
* wasm/function-tests/dumb-less-than-ite.js: Removed.
* wasm/function-tests/eqz.js: Removed.
* wasm/function-tests/i32-trunc-s-f32.js: Removed.
* wasm/function-tests/i32-trunc-s-f64.js: Removed.
* wasm/function-tests/i32-trunc-u-f32.js: Removed.
* wasm/function-tests/i32-trunc-u-f64.js: Removed.
* wasm/function-tests/i64-trunc-s-f32.js: Removed.
* wasm/function-tests/i64-trunc-s-f64.js: Removed.
* wasm/function-tests/i64-trunc-u-f32.js: Removed.
* wasm/function-tests/i64-trunc-u-f64.js: Removed.
* wasm/function-tests/if-then-else-fallthrough.js: Removed.
* wasm/function-tests/if-then-fallthrough.js: Removed.
* wasm/function-tests/int-to-floating-point.js: Removed.
* wasm/function-tests/loop-mult.js:
* wasm/function-tests/loop-sum.js:
* wasm/function-tests/max.js: Removed.
* wasm/function-tests/min.js: Removed.
* wasm/function-tests/nearest.js: Removed.
* wasm/function-tests/nop.js: Removed.
* wasm/function-tests/popcnt.js: Removed.
* wasm/function-tests/ret5.js:
* wasm/function-tests/select.js: Removed.
* wasm/function-tests/tee-local.js: Removed.
* wasm/function-tests/trunc.js: Removed.

Source/JavaScriptCore:

This patch makes it so we only create wrappers for WebAssembly functions that
can actually be exported. It appears to be a ~2.5% speedup on WasmBench compile times.

This patch also removes most of the old testWasmModuleFunctions api from the jsc CLI.
Most of the tests were duplicates of ones in the spec-tests directory. The others I
have converted to use the normal API.

* jsc.cpp:
(GlobalObject::finishCreation):
(valueWithTypeOfWasmValue): Deleted.
(box): Deleted.
(callWasmFunction): Deleted.
(functionTestWasmModuleFunctions): Deleted.
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::B3IRGenerator):
(JSC::Wasm::createJSToWasmWrapper):
(JSC::Wasm::parseAndCompile):
* wasm/WasmB3IRGenerator.h:
* wasm/WasmBBQPlan.cpp:
(JSC::Wasm::BBQPlan::prepare):
(JSC::Wasm::BBQPlan::compileFunctions):
(JSC::Wasm::BBQPlan::complete):
* wasm/WasmBBQPlan.h:
* wasm/WasmBBQPlanInlines.h:
(JSC::Wasm::BBQPlan::initializeCallees):
* wasm/WasmCodeBlock.cpp:
(JSC::Wasm::CodeBlock::CodeBlock):
* wasm/WasmCodeBlock.h:
(JSC::Wasm::CodeBlock::jsEntrypointCalleeFromFunctionIndexSpace):
* wasm/WasmFormat.h:
* wasm/WasmOMGPlan.cpp:
(JSC::Wasm::OMGPlan::work):

Tools:

Add quick mode for wasm tests.

* Scripts/run-jsc-stress-tests:

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

3 years agoRebaseline and enable media/modern-media-controls/fullscreen-button
graouts@webkit.org [Thu, 8 Jun 2017 18:56:17 +0000 (18:56 +0000)]
Rebaseline and enable media/modern-media-controls/fullscreen-button
https://bugs.webkit.org/show_bug.cgi?id=173101

Reviewed by Dean Jackson.

Update the test to check an SVG asset now that we use those.

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

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

3 years agoRebaseline and enable media/modern-media-controls/forward-button
graouts@webkit.org [Thu, 8 Jun 2017 18:54:43 +0000 (18:54 +0000)]
Rebaseline and enable media/modern-media-controls/forward-button
https://bugs.webkit.org/show_bug.cgi?id=173100

Reviewed by Dean Jackson.

Update the test to check an SVG asset now that we use those.

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

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

3 years agoLayout Test media/modern-media-controls/button/button-icon-name.html is a flaky failure
graouts@webkit.org [Thu, 8 Jun 2017 18:53:53 +0000 (18:53 +0000)]
Layout Test media/modern-media-controls/button/button-icon-name.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=173099

Reviewed by Dean Jackson.

Rewrite the test to use asynchronous assertions, the number of frames running is immaterial to this test.

* media/modern-media-controls/button/button-icon-name-expected.txt:
* media/modern-media-controls/button/button-icon-name.html:

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

3 years agoWTF tests have incorrect RefLogger lifetimes making it impossible to test with Addres...
darin@apple.com [Thu, 8 Jun 2017 18:27:59 +0000 (18:27 +0000)]
WTF tests have incorrect RefLogger lifetimes making it impossible to test with Address Sanitizer
https://bugs.webkit.org/show_bug.cgi?id=173106

Reviewed by Sam Weinig.

* TestWebKitAPI/Tests/WTF/HashCountedSet.cpp: Define RefLogger objects first, so they are
destroyed last.
* TestWebKitAPI/Tests/WTF/HashMap.cpp: Ditto.
* TestWebKitAPI/Tests/WTF/HashSet.cpp: Ditto.

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

3 years agoAdd a borderless mode to <attachment>, and make it respect its layout size
timothy_horton@apple.com [Thu, 8 Jun 2017 18:08:48 +0000 (18:08 +0000)]
Add a borderless mode to <attachment>, and make it respect its layout size
https://bugs.webkit.org/show_bug.cgi?id=173079
<rdar://problem/32491584>

Reviewed by Simon Fraser.

Source/WebCore:

Tests: fast/attachment/attachment-borderless.html
       fast/attachment/attachment-respects-css-size.html

* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
* css/CSSValueKeywords.in:
* platform/ThemeTypes.h:
* rendering/RenderAttachment.cpp:
(WebCore::RenderAttachment::shouldDrawBorder):
* rendering/RenderAttachment.h:
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::adjustStyle):
(WebCore::RenderTheme::paint):
Add "-webkit-appearance: borderless-attachment;" in addition to "attachment",
so clients can specify the borderless appearance. This isn't specified as a
CSS border because it's a very custom appearance that isn't achievable that way.

* rendering/RenderThemeIOS.mm:
(WebCore::AttachmentInfo::AttachmentInfo):
Use the layout size of the attachment, not the fixed size; we use the fixed
size as our intrinsic size, so most attachments will still be that size,
but if a client specifies a different size, we'll lay out correctly.

LayoutTests:

* TestExpectations:
* platform/ios/TestExpectations:
* fast/attachment/attachment-borderless-expected-mismatch.html: Added.
* fast/attachment/attachment-borderless.html: Added.
* fast/attachment/attachment-respects-css-size-expected-mismatch.html: Added.
* fast/attachment/attachment-respects-css-size.html: Added.
Add mismatch tests ensuring that CSS width/height and borderless-attachment
have *some* kind of impact on rendering.

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

3 years agoYouTube audio stutters when page changes visibility.
jer.noble@apple.com [Thu, 8 Jun 2017 17:57:08 +0000 (17:57 +0000)]
YouTube audio stutters when page changes visibility.
https://bugs.webkit.org/show_bug.cgi?id=173102

Reviewed by Eric Carlson.

Don't change renderers when the visibility changes; only use the decompression session
when we were explicitly asked to paint into an accelerated surface.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::acceleratedRenderingStateChanged):

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

3 years agoClients of the WK2 C-API don't have their mediaContentTypesRequiringHardwareSupport...
jer.noble@apple.com [Thu, 8 Jun 2017 17:51:47 +0000 (17:51 +0000)]
Clients of the WK2 C-API don't have their mediaContentTypesRequiringHardwareSupport setting initialized correctly.
https://bugs.webkit.org/show_bug.cgi?id=173091

Reviewed by Eric Carlson.

Source/WebCore:

Add a new default setting value, defined separately in Settings and SettingsCocoa.

* page/Settings.cpp:
(WebCore::Settings::defaultMediaContentTypesRequiringHardwareSupport):
* page/Settings.h:
* page/cocoa/SettingsCocoa.mm:
(WebCore::Settings::defaultMediaContentTypesRequiringHardwareSupport):

Source/WebKit/mac:

* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):

Source/WebKit2:

Rather than add yet a third way of setting this preference, centralize everything by moving the
definition of the default value into WebCore.

* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

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

3 years ago[WK2] mediaContentTypesRequiringHardwareSupport setting not being propogated
jer.noble@apple.com [Thu, 8 Jun 2017 17:26:27 +0000 (17:26 +0000)]
[WK2] mediaContentTypesRequiringHardwareSupport setting not being propogated
https://bugs.webkit.org/show_bug.cgi?id=173090

Reviewed by Eric Carlson.

Passing a NSString* into the WebPreferencesStore::Value constructor would rather cast the NSString*
into a bool than a const String&. So explicitly cast the NSString* into a String before passing.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):

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

3 years agoTake the mediaContentTypesRequiringHardwareSupport Setting into account when answerin...
jer.noble@apple.com [Thu, 8 Jun 2017 17:23:53 +0000 (17:23 +0000)]
Take the mediaContentTypesRequiringHardwareSupport Setting into account when answering HTMLMediaElement::canPlayType()
https://bugs.webkit.org/show_bug.cgi?id=173092

Reviewed by Eric Carlson.

Pass the value of mediaContentTypesRequiringHardwareSupport into the MediaPlayer when querying canPlayType().
Then, use the existing code in AVAssetTrackUtilities to know whether to bail out early from the codec check.

Drive-by fix: FourCC was converting String -> FourCC in reverse.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::canPlayType):
* platform/graphics/FourCC.cpp:
(WebCore::FourCC::fromString):
* platform/graphics/avfoundation/objc/AVAssetTrackUtilities.h:
* platform/graphics/avfoundation/objc/AVAssetTrackUtilities.mm:
(WebCore::contentTypesToCodecs):
(WebCore::codecsMeetHardwareDecodeRequirements):
(WebCore::contentTypeMeetsHardwareDecodeRequirements):
(WebCore::assetTrackMeetsHardwareDecodeRequirements):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType):

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

3 years agoASSERTION FAILED: !m_isolatedWorld->isNormal() || m_wrapper || !m_jsFunction on webrt...
cdumez@apple.com [Thu, 8 Jun 2017 17:13:16 +0000 (17:13 +0000)]
ASSERTION FAILED: !m_isolatedWorld->isNormal() || m_wrapper || !m_jsFunction on webrtc/ephemeral-certificates-and-cnames.html
https://bugs.webkit.org/show_bug.cgi?id=173039
<rdar://problem/32600412>

Reviewed by Youenn Fablet.

RTCPeerConnection was an ActiveDOMObject but failed to override ActiveDOMObject::hasPendingActivity()
to make sure its JS wrapper stays alive as long as it needs to. In this patch, we override
ActiveDOMObject::hasPendingActivity() and have it return true if !m_isStopped. I believe this is
the right thing to do to keep the wrapper alive as long as the connection is not closed.
RTCPeerConnection::close() closes the connection and then posts a task to call
RTCPeerConnection::doStop(), setting m_isStopped to true.

No new tests, already covered by webrtc/ephemeral-certificates-and-cnames.html which
was a flaky crash.

* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::canSuspendForDocumentSuspension):
(WebCore::RTCPeerConnection::hasPendingActivity):
* Modules/mediastream/RTCPeerConnection.h:

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

3 years agoModify security test to avoid spacing differences.
commit-queue@webkit.org [Thu, 8 Jun 2017 17:01:50 +0000 (17:01 +0000)]
Modify security test to avoid spacing differences.
https://bugs.webkit.org/show_bug.cgi?id=141709

Patch by Marcos Chavarría Teijeiro <chavarria1991@gmail.com> on 2017-06-08
Reviewed by Carlos Alberto Lopez Perez.

* http/tests/security/XFrameOptions/x-frame-options-deny-multiple-clients-expected.txt:
* http/tests/security/XFrameOptions/x-frame-options-deny-multiple-clients.html:
* http/tests/security/cross-frame-access-callback-explicit-domain-ALLOW-expected.txt:
* http/tests/security/cross-frame-access-callback-explicit-domain-ALLOW.html:
* platform/gtk/TestExpectations:

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

3 years agogetUserMedia request should not be allowed for background tabs unless the tab is...
commit-queue@webkit.org [Thu, 8 Jun 2017 16:28:40 +0000 (16:28 +0000)]
getUserMedia request should not be allowed for background tabs unless the tab is already capturing
https://bugs.webkit.org/show_bug.cgi?id=172989

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

Source/WebKit2:

Covered by updated test and manual testing.

In case a getUserMedia can be granted, we check for visbility of the view.
If the view is visible, the getUserMedia request is allowed and promise is resolved.
Otherwise we store the pregranted request and will allow it when the view gets visible.
Pregranted requests will be cleared if the document of the view is changed.

Pregranted requests will not be used when capture page is muted.
In that case, a prompt will appear.

* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::removeGrantedAccess):
(WebKit::allowRequest):
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
(WebKit::UserMediaPermissionRequestManagerProxy::processPregrantedRequests):
* UIProcess/UserMediaPermissionRequestManagerProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::dispatchActivityStateChange):
(WebKit::WebPageProxy::viewIsBecomingVisible):
* UIProcess/WebPageProxy.h:

LayoutTests:

* fast/mediastream/getUserMedia-grant-persistency-expected.txt:
* fast/mediastream/getUserMedia-grant-persistency.html: Using testRunner.setPageVisibility so that UIProcess is made aware of the change.
Removing test about capture muted page since there is no API for setting a page as muted right now.
This test should be readded later on.

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

3 years ago[GTK] Test gardening
commit-queue@webkit.org [Thu, 8 Jun 2017 13:24:26 +0000 (13:24 +0000)]
[GTK] Test gardening
https://bugs.webkit.org/show_bug.cgi?id=173093

Unreviewed GTK gardening.

r147201 added a crash expectation for the following test, but did so in a manner
that failed linter checks:

LayoutTests/platform/gtk/TestExpectations:1302 More specific entry for
   http/tests/security/XFrameOptions/x-frame-options-deny-multiple-clients.html on line
   LayoutTests/platform/gtk/TestExpectations:992 overrides line LayoutTests/platform/gtk/TestExpectations:1302.
   http/tests/security/XFrameOptions/x-frame-options-deny-multiple-clients.html

Furthermore, this test no longer crashes in Debug builds, it fails due to whitespace
oddities that are addressed by webkit.org/b/141709 (unreviewed)

Patch by Charlie Turner <cturner@igalia.com> on 2017-06-08

* platform/gtk/TestExpectations:

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

3 years agoMediaTime class has rounding issues in different platforms
calvaris@igalia.com [Thu, 8 Jun 2017 13:10:51 +0000 (13:10 +0000)]
MediaTime class has rounding issues in different platforms
https://bugs.webkit.org/show_bug.cgi?id=172640

Reviewed by Jer Noble.

Source/WTF:

The way a timescale is set when creating a MediaTime from a double
can create rounding issues in different platforms because in some
rounding is made and in others, it truncates. This way we ensure a
common behavior.

Dumping MediaTimes is also confusing and by the output you don't
know if it's containing a double or a fraction. Now, if it
contains a double, it only prints the double because printing the
fraction is misleading (it currently prints the double read as an
integer) and if it contains a fraction it shows the fraction and
its double representation separated by an = instead of a ,.

* wtf/MediaTime.cpp:
(WTF::MediaTime::createWithDouble): When creating MediaTime from
double, we round instead of leaving it to the cast operation.
(WTF::MediaTime::dump):

LayoutTests:

Update expectations because the MediaTime printing changed, but
results are the same.

* media/media-source/media-source-overlapping-append-expected.txt:
* media/media-source/media-source-overlapping-decodetime-expected.txt:
* media/media-source/media-source-seek-back-expected.txt:
* media/media-source/media-source-sequence-timestamps-expected.txt:
* media/media-source/media-source-timeoffset-expected.txt:

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

3 years ago[GTK][WPE][GSTREAMER_GL] Change the colorspace used by the video frames provided...
magomez@igalia.com [Thu, 8 Jun 2017 10:16:39 +0000 (10:16 +0000)]
[GTK][WPE][GSTREAMER_GL] Change the colorspace used by the video frames provided by GStreamer
https://bugs.webkit.org/show_bug.cgi?id=173050

Reviewed by Žan Doberšek.

We are currently requesting RGBA as the color format of the video frames to gstreamer. This is a problem
because when those frames are rendered with the CPU, the R and B components are swapped as cairo expects
ARGB and GStreamer delivers ABGR.

In order to fix this without performing color conversions on the CPU, what we do is change the format
used by GStreamer for the video frames. We do that taking into account the endianness used. So with
little endian we will use BGRx or BGRA and with big endian xRGB or ARGB. Thanks to this, when downloading
the frames to the CPU they will automatically be turned into the ARGB expected by cairo. Also, when
rendering the frames using OpenGL, we indicate that the color space needs to be converted to the RGBA
expected by the destination texture (but this color conversion is performed by the GPU so there's no
penalty).

Covered by existent tests.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::GstVideoFrameHolder::GstVideoFrameHolder):
(WebCore::MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture):
(WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):
(WebCore::MediaPlayerPrivateGStreamerBase::createVideoSinkGL):
* platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
(WebCore::VideoTextureCopierGStreamer::VideoTextureCopierGStreamer):
(WebCore::VideoTextureCopierGStreamer::updateColorConversionMatrix):
(WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture):
* platform/graphics/gstreamer/VideoTextureCopierGStreamer.h:
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::colorSpaceMatrixForFlags):
* platform/graphics/texmap/TextureMapperGL.h:

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

3 years agoIsInShadowTreeFlag does not get updated for a non-container node
rniwa@webkit.org [Thu, 8 Jun 2017 07:30:37 +0000 (07:30 +0000)]
IsInShadowTreeFlag does not get updated for a non-container node
https://bugs.webkit.org/show_bug.cgi?id=173084

Reviewed by Antti Koivisto.

.:

* WebKit.xcworkspace/xcshareddata/xcschemes/All Source.xcscheme:

Source/WebCore:

insertedInto and removedFrom were only called on ContainerNode nodes when they're not connected to a document.
As a result IsInShadowTreeFlag could have gotten out-of-date when a node was inserted or removed from a shadow root
which is not connected to a document.

Fixed this inconsistency by always falling insertedInto and removedFrom on all nodes.

* dom/ContainerNodeAlgorithms.cpp:
(WebCore::notifyNodeInsertedIntoDocument): Merged notifyDescendantInsertedIntoDocument. Now takes a Node instead
of a ContainerNode.
(WebCore::notifyNodeInsertedIntoTree): Merged notifyDescendantInsertedIntoTree. Now takes a Node instead of
a ContainerNode.
(WebCore::notifyChildNodeInserted): Always call notifyNodeInsertedIntoTree on an inserted node.
(WebCore::notifyNodeRemovedFromDocument): Now takes a Node instead of a ContainerNode.
(WebCore::notifyNodeRemovedFromTree): Ditto.
(WebCore::notifyChildNodeRemoved): Always call notifyNodeRemovedFromTree on an inserted node.
(WebCore::addChildNodesToDeletionQueue): Directly call adoptIfNeeded on document() since onwerDocument() only returns
nullptr on a Document node but this function is never called on a root node and Document can only be a root node.
Also assert that a node not put into the deletion queue is no longer in a document or a shadow tree.

* dom/Node.cpp:
(WebCore::Node::insertedInto): Removed the assertion that's no longer true.
(WebCore::Node::removedFrom): Ditto.

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

3 years ago[WPE] Enable resource usage
carlosgc@webkit.org [Thu, 8 Jun 2017 06:48:22 +0000 (06:48 +0000)]
[WPE] Enable resource usage
https://bugs.webkit.org/show_bug.cgi?id=173054

Reviewed by Žan Doberšek.

.:

Add private option for resource usage enabled by default.

* Source/cmake/OptionsWPE.cmake:

Source/WebCore:

Add resource usage linux files to the compilation.

* PlatformWPE.cmake:

Source/WebKit2:

Enable/disable the resources overlay with CTRL + Shift + G.

* UIProcess/API/wpe/WPEView.cpp:
(WKWPE::m_compositingManagerProxy):

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

3 years agoRemove legacy INSPECTOR_SERVER implementation
carlosgc@webkit.org [Thu, 8 Jun 2017 06:46:21 +0000 (06:46 +0000)]
Remove legacy INSPECTOR_SERVER implementation
https://bugs.webkit.org/show_bug.cgi?id=172966

Reviewed by Žan Doberšek.

.:

* Source/PlatformWin.cmake:

Source/WebInspectorUI:

Remove InspectorFrontendHostStub and thr web sockets initialization.

* UserInterface/Base/InspectorFrontendHostStub.js: Removed.
* UserInterface/Base/Main.js:
(WebInspector.loaded):
* UserInterface/Main.html:
* UserInterface/Test.html:
* WebInspectorUI.vcxproj/WebInspectorUI.vcxproj:
* WebInspectorUI.vcxproj/WebInspectorUI.vcxproj.filters:

Source/WebKit2:

* CMakeLists.txt:
* Platform/Logging.h:
* PlatformWPE.cmake:
* UIProcess/InspectorServer/HTTPRequest.cpp: Removed.
* UIProcess/InspectorServer/HTTPRequest.h: Removed.
* UIProcess/InspectorServer/WebInspectorServer.cpp: Removed.
* UIProcess/InspectorServer/WebInspectorServer.h: Removed.
* UIProcess/InspectorServer/WebSocketServer.cpp: Removed.
* UIProcess/InspectorServer/WebSocketServer.h: Removed.
* UIProcess/InspectorServer/WebSocketServerClient.h: Removed.
* UIProcess/InspectorServer/WebSocketServerConnection.cpp: Removed.
* UIProcess/InspectorServer/WebSocketServerConnection.h: Removed.
* UIProcess/InspectorServer/front-end/inspectorPageIndex.html: Removed.
* UIProcess/InspectorServer/soup/WebSocketServerSoup.cpp: Removed.
* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::invalidate):
* UIProcess/WebInspectorProxy.h:
* UIProcess/WebInspectorProxy.messages.in:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::initializeWebPage):
(WebKit::WebPageProxy::preferencesDidChange):
* UIProcess/wpe/WebProcessPoolWPE.cpp:
* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::sendMessageToFrontend):
* WebProcess/WebPage/WebInspector.h:
* WebProcess/WebPage/WebInspector.messages.in:

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

3 years agoSource/WebKit2:
mitz@apple.com [Thu, 8 Jun 2017 05:02:48 +0000 (05:02 +0000)]
Source/WebKit2:
[Cocoa] additionalReadAccessAllowedURLs doesn’t preserve non-Latin-1 paths
https://bugs.webkit.org/show_bug.cgi?id=173086

Reviewed by Andy Estes.

We were incorrectly passing the fileSystemRepresentation of an NSURL into the WTF::String
constructor that expects a Latin-1 string. However, in general, fileSystemRepresentation is
not Latin-1.

* UIProcess/API/APIProcessPoolConfiguration.h: Changed m_additionalReadAccessAllowedPaths
  from a Vector<WTF::String> into a Vector<WTF::CString>.

* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration additionalReadAccessAllowedURLs]): Updated for the change.
(-[_WKProcessPoolConfiguration setAdditionalReadAccessAllowedURLs:]): Ditto.

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::resolvePathsForSandboxExtensions): Ditto.

Tools:
[Cocoa] additionalReadAccessAllowedURLs doesn’t preserve non-Latin1 paths
https://bugs.webkit.org/show_bug.cgi?id=173086

Reviewed by Andy Estes.

* TestWebKitAPI/Tests/WebKit2Cocoa/AdditionalReadAccessAllowedURLs.mm:
(TEST):

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

3 years agoAdd High Sierra support to WebKit tools
ap@apple.com [Thu, 8 Jun 2017 04:46:34 +0000 (04:46 +0000)]
Add High Sierra support to WebKit tools
https://bugs.webkit.org/show_bug.cgi?id=173080

Rubber-stamped by Daniel Bates.

Tools:

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Images/HighSierra.png: Added.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Images/HighSierra@2x.png: Added.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Dashboard.js:
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Styles/Main.css:
Added dashboard support.

* BuildSlaveSupport/build.webkit.org-config/wkbuild.py:
* BuildSlaveSupport/build.webkit.org-config/wkbuild_unittest.py:
Trigger the right build queues on check-in.

* Scripts/webkitpy/common/system/platforminfo.py:
* Scripts/webkitpy/common/system/platforminfo_unittest.py:
* Scripts/webkitpy/layout_tests/models/test_expectations.py:
* Scripts/webkitpy/port/mac.py:
* Scripts/webkitpy/port/mac_unittest.py:
* TestResultServer/static-dashboards/flakiness_dashboard.js:
Added cases for Sierra, and updated tests for new baseline search paths.

LayoutTests:

* platform/mac-sierra: Added an empty directory to avoid breaking scripts.

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

3 years agoWebAssembly: test imports and exports with 16-bit characters
jfbastien@apple.com [Thu, 8 Jun 2017 04:43:51 +0000 (04:43 +0000)]
WebAssembly: test imports and exports with 16-bit characters
https://bugs.webkit.org/show_bug.cgi?id=165977
<rdar://problem/29760130>

Reviewed by Saam Barati.

JSTests:

The output for import failure was improved, so many tests need to
be updated here. Only one has new tests as noted below.

* wasm/function-tests/memory-import-and-grow.js:
* wasm/js-api/Instance.imports.exports.unicode.js: Added. Main new test.
(idxModule):
* wasm/js-api/global-error.js:
(new.Number):
(assert.throws):
* wasm/js-api/table.js:
(assert.throws):
(new.WebAssembly.Table):
* wasm/js-api/test_memory.js:
(test):
* wasm/js-api/wasm-to-wasm-bad-signature.js:
(BadSignatureDropStartParams.):
(BadSignatureDropStartParams):
(BadSignatureDropEndParams.):
(BadSignatureSwapParam.):
(BadSignatureRet.):
* wasm/js-api/web-assembly-instantiate.js:
(assert.asyncTest.async.test):
(assert.asyncTest):
* wasm/js-api/wrapper-function.js:
(return.new.WebAssembly.Module):

Source/JavaScriptCore:

Add the missing UTF-8 conversions. Improve import failure error
messages, otherwise it's hard to figure out which import is wrong.

* wasm/js/JSWebAssemblyInstance.cpp:
(JSC::JSWebAssemblyInstance::create):
* wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::WebAssemblyModuleRecord::finishCreation):
(JSC::WebAssemblyModuleRecord::link):

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

3 years agoAdd High Sierra support to WebKit tools
ap@apple.com [Thu, 8 Jun 2017 04:42:46 +0000 (04:42 +0000)]
Add High Sierra support to WebKit tools
https://bugs.webkit.org/show_bug.cgi?id=173080

Rubber-stamped by Daniel Bates.

Tools:

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Images/HighSierra.png: Added.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Images/HighSierra@2x.png: Added.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Dashboard.js:
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Styles/Main.css:
Added dashboard support.

* BuildSlaveSupport/build.webkit.org-config/wkbuild.py:
* BuildSlaveSupport/build.webkit.org-config/wkbuild_unittest.py:
Trigger the right build queues on check-in.

* Scripts/webkitpy/common/system/platforminfo.py:
* Scripts/webkitpy/common/system/platforminfo_unittest.py:
* Scripts/webkitpy/layout_tests/models/test_expectations.py:
* Scripts/webkitpy/port/mac.py:
* Scripts/webkitpy/port/mac_unittest.py:
* TestResultServer/static-dashboards/flakiness_dashboard.js:
Added cases for Sierra, and updated tests for new baseline search paths.

LayoutTests:

* platform/mac-sierra: Added an empty directory to avoid breaking scripts.

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

3 years ago[Web Audio] createScriptProcessor throws IndexSizeError for valid arguments
jer.noble@apple.com [Thu, 8 Jun 2017 04:31:31 +0000 (04:31 +0000)]
[Web Audio] createScriptProcessor throws IndexSizeError for valid arguments
https://bugs.webkit.org/show_bug.cgi?id=173022

Reviewed by Sam Weinig.

Source/WebCore:

Updated test: webaudio/javascriptaudionode.html

The Web Audio spec (<https://webaudio.github.io/web-audio-api/>, 06 June 2017) defines a default behavior when
clients pass in a value of 0 for bufferSize to the createScriptProcessor() method.

* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::createScriptProcessor):
* Modules/webaudio/AudioContext.idl:
* Modules/webaudio/ScriptProcessorNode.cpp:
(WebCore::ScriptProcessorNode::create):
* Modules/webaudio/ScriptProcessorNode.h:

LayoutTests:

* webaudio/javascriptaudionode-expected.txt:
* webaudio/javascriptaudionode.html:

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

3 years agobmalloc: memory APIs don't need to be heap members
ggaren@apple.com [Thu, 8 Jun 2017 04:05:43 +0000 (04:05 +0000)]
bmalloc: memory APIs don't need to be heap members
https://bugs.webkit.org/show_bug.cgi?id=173076

Reviewed by Sam Weinig.

Asking the OS about memory use is unrelated to the state of bmalloc's
heap, so it's a better separation of concerns if related code is not
part of the heap.

* bmalloc/AvailableMemory.cpp:
(bmalloc::memoryStatus):
* bmalloc/AvailableMemory.h:
(bmalloc::MemoryStatus::MemoryStatus):
(bmalloc::isUnderMemoryPressure):
(bmalloc::memoryFootprint):
(bmalloc::percentAvailableMemoryInUse):
* bmalloc/Heap.cpp:
(bmalloc::Heap::Heap):
(bmalloc::Heap::updateMemoryInUseParameters): Deleted.
* bmalloc/Heap.h:
(bmalloc::Heap::isUnderMemoryPressure): Deleted.
(bmalloc::Heap::memoryFootprint): Deleted.
(bmalloc::Heap::percentAvailableMemoryInUse): Deleted.

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

3 years agoCSSStyleRule.style / CSSPageRule.style / CSSKeyframeRule.style should be settable
cdumez@apple.com [Thu, 8 Jun 2017 03:32:21 +0000 (03:32 +0000)]
CSSStyleRule.style / CSSPageRule.style / CSSKeyframeRule.style should be settable
https://bugs.webkit.org/show_bug.cgi?id=164537
<rdar://problem/29181773>

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

* web-platform-tests/cssom/CSSKeyframeRule-expected.txt:
* web-platform-tests/cssom/CSSKeyframeRule.html:
* web-platform-tests/cssom/CSSStyleRule-expected.txt:
* web-platform-tests/cssom/CSSStyleRule.html:
Re-sync web-platform tests after:
- https://github.com/w3c/web-platform-tests/pull/6181
- https://github.com/w3c/web-platform-tests/pull/6184
This extends test coverage.

* web-platform-tests/cssom/interfaces-expected.txt:
Rebaseline now that more checks are passing.

Source/WebCore:

CSSStyleRule.style / CSSPageRule.style / CSSKeyframeRule.style should be settable
as per:
- https://drafts.csswg.org/cssom/#the-cssstylerule-interface
- https://drafts.csswg.org/cssom/#the-csspagerule-interface
- https://drafts.csswg.org/css-animations/#interface-csskeyframerule

Tests:
http/wpt/cssom/CSSPageRule.html
imported/w3c/web-platform-tests/cssom/CSSKeyframeRule.html
imported/w3c/web-platform-tests/cssom/CSSStyleRule.html
imported/w3c/web-platform-tests/cssom/interfaces.html

* css/CSSKeyframeRule.idl:
* css/CSSPageRule.idl:
* css/CSSStyleRule.idl:

LayoutTests:

Add better test coverage for CSSPageRule. This test is being upstreamed via:
- https://github.com/w3c/web-platform-tests/pull/6183

* http/wpt/cssom/CSSPageRule-expected.txt: Added.
* http/wpt/cssom/CSSPageRule.html: Added.

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

3 years ago[WebIDL] Split up attribute generation to match operation generation
commit-queue@webkit.org [Thu, 8 Jun 2017 03:25:06 +0000 (03:25 +0000)]
[WebIDL] Split up attribute generation to match operation generation
https://bugs.webkit.org/show_bug.cgi?id=173072

Patch by Sam Weinig <sam@webkit.org> on 2017-06-07
Reviewed by Chris Dumez.

* bindings/js/JSDOMAttribute.h:
(WebCore::IDLAttribute::setStatic):
(WebCore::IDLAttribute::getStatic):
Add static variants of get/set matching the one in IDLOperation.

* bindings/scripts/CodeGeneratorJS.pm:
(GetFullyQualifiedImplementationCallName):
Factor out duplicate code to compute the qualified name for a function call.

(AddAdditionalArgumentsForImplementationCall):
Factor out duplicate code to compute the some standard arguments for a function
call. We may want to merge this with GenerateCallWith.

(GenerateHeader):
Update for new signature of HasCustom... subroutines.

(GenerateImplementation):
Pass @implContent to more helper generators to continue propagating the idiom.

(GenerateAttributeGetterBodyDefinition):
(GenerateAttributeGetterTrampolineDefinition):
(GenerateAttributeGetterDefinition):
(GenerateAttributeSetterBodyDefinition):
(GenerateAttributeSetterTrampolineDefinition):
(GenerateAttributeSetterDefinition):
Split attribute getter and setter generation up by having separate subroutines
to generate the trampoline and body. Also, make all attributes, even static ones
use a trampoline to simplify the code. Static attributes got through a no-op
trampoline, that gets compiled away. Also adopt GetFullyQualifiedImplementationCallName
and AddAdditionalArgumentsForImplementationCall to reduce duplication.

(GenerateOperationBodyDefinition):
(GenerateOperationDefinition):
Adopt $outputArray idiom and adopt GetFullyQualifiedImplementationCallName
and AddAdditionalArgumentsForImplementationCall to reduce duplication

(GenerateParametersCheck):
Adopt GetFullyQualifiedImplementationCallName and AddAdditionalArgumentsForImplementationCall
to reduce duplication.

(HasCustomGetter):
(HasCustomSetter):
(HasCustomMethod):
Convert HasCustom... subroutines to take an IDLAttribute rather than the extended
attributes, matching other predicates

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

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

3 years agoRTCTrackEvent.track should be found in RTCTrackEvent.streams[0]
commit-queue@webkit.org [Thu, 8 Jun 2017 03:12:47 +0000 (03:12 +0000)]
RTCTrackEvent.track should be found in RTCTrackEvent.streams[0]
https://bugs.webkit.org/show_bug.cgi?id=173074

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

Source/WebCore:

Covered by updated test.

* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::addTrackFromPlatform):

LayoutTests:

* webrtc/video.html:

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

3 years agoCrash inside WebKit::PluginView::getAuthenticationInfo
rniwa@webkit.org [Thu, 8 Jun 2017 03:10:43 +0000 (03:10 +0000)]
Crash inside WebKit::PluginView::getAuthenticationInfo
https://bugs.webkit.org/show_bug.cgi?id=173083

Reviewed by Chris Dumez.

Added a null pointer check. The content document may have went away by the time we get there from IPC.

* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::getAuthenticationInfo):

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

3 years agoUnreviewed, rolling out r217902.
ryanhaddad@apple.com [Thu, 8 Jun 2017 00:51:11 +0000 (00:51 +0000)]
Unreviewed, rolling out r217902.

This change appears to have caused imported/w3c/web-platform-
tests/fetch/api/cors tests to fail on El Capitan.

Reverted changeset:

"Teach run-webkit-tests how to run HTTPS Web Platform Tests"
https://bugs.webkit.org/show_bug.cgi?id=172930
http://trac.webkit.org/changeset/217902

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

3 years agoWeb Inspector: Add ContextMenu item to log WebSocket object to console
drousso@apple.com [Thu, 8 Jun 2017 00:05:55 +0000 (00:05 +0000)]
Web Inspector: Add ContextMenu item to log WebSocket object to console
https://bugs.webkit.org/show_bug.cgi?id=172878

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/protocol/Network.json:
Add resolveWebSocket command.

Source/WebCore:

Test: http/tests/websocket/tests/hybi/inspector/resolveWebSocket.html

* inspector/InspectorNetworkAgent.h:
* inspector/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::InspectorNetworkAgent):
(WebCore::InspectorNetworkAgent::webSocketForRequestId):
(WebCore::webSocketAsScriptValue):
(WebCore::InspectorNetworkAgent::resolveWebSocket):
Loops over the static allActiveWebSockets to find one with the given requestId. If found, it
will create a RemoteObject wrapper for it and send it back to the inspector.

Source/WebInspectorUI:

* Localizations/en.lproj/localizedStrings.js:

* UserInterface/Protocol/RemoteObject.js:
(WebInspector.RemoteObject.resolveWebSocket):

* UserInterface/Views/ResourceTreeElement.js:
(WebInspector.ResourceTreeElement.prototype.populateContextMenu):

LayoutTests:

* http/tests/websocket/tests/hybi/inspector/resolveWebSocket-expected.txt: Added.
* http/tests/websocket/tests/hybi/inspector/resolveWebSocket.html: Added.

* http/tests/websocket/tests/hybi/inspector/before-load-expected.txt:
* http/tests/websocket/tests/hybi/inspector/before-load.html:
* http/tests/websocket/tests/hybi/inspector/before-load_wsh.py: Removed.
* http/tests/websocket/tests/hybi/inspector/client-close.html:
* http/tests/websocket/tests/hybi/inspector/client-close_wsh.py: Removed.
* http/tests/websocket/tests/hybi/inspector/send-and-receive.html:
* http/tests/websocket/tests/hybi/inspector/send-and-receive_wsh.py: Removed.
* http/tests/websocket/tests/hybi/inspector/echo.py: Added.
(web_socket_do_extra_handshake):
(web_socket_transfer_data):
Unified common configurations for Inspector WebSocket tests.

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

3 years agoWeb Inspector: Allow user to choose stylesheet when creating new rules
drousso@apple.com [Wed, 7 Jun 2017 23:53:10 +0000 (23:53 +0000)]
Web Inspector: Allow user to choose stylesheet when creating new rules
https://bugs.webkit.org/show_bug.cgi?id=172487

Reviewed by Joseph Pecoraro.

Source/WebCore:

New test: inspector/css/add-rule.html

* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyleSheet::addRule):
Reparse the content when a new rule is added to a non-inspector origin stylesheet.

Source/WebInspectorUI:

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Models/DOMNodeStyles.js:
(WebInspector.DOMNodeStyles.prototype.addRule.inspectorStyleSheetAvailable):
(WebInspector.DOMNodeStyles.prototype.addRule):
* UserInterface/Views/CSSStyleDetailsSidebarPanel.js:
(WebInspector.CSSStyleDetailsSidebarPanel.prototype.initialLayout):
(WebInspector.CSSStyleDetailsSidebarPanel.prototype._newRuleButtonContextMenu):
* UserInterface/Views/RulesStyleDetailsPanel.js:
(WebInspector.RulesStyleDetailsPanel.prototype.newRuleButtonClicked):
(WebInspector.RulesStyleDetailsPanel.prototype.newRuleButtonContextMenu):
* UserInterface/Views/VisualStyleSelectorSection.js:
(WebInspector.VisualStyleSelectorSection):
(WebInspector.VisualStyleSelectorSection.prototype._addNewRuleContextMenu):
(WebInspector.VisualStyleSelectorSection.prototype._addNewRule): Renamed _addNewRuleClick.

LayoutTests:

* inspector/css/add-rule-expected.html: Added.
* inspector/css/add-rule.html: Added.

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

3 years agogetUserMedia is prompting too often
commit-queue@webkit.org [Wed, 7 Jun 2017 23:27:14 +0000 (23:27 +0000)]
getUserMedia is prompting too often
https://bugs.webkit.org/show_bug.cgi?id=172859
<rdar://problem/32589950>

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

Source/WebCore:

Tests: fast/mediastream/getUserMedia-grant-persistency-reload.html
       fast/mediastream/getUserMedia-grant-persistency.html

* loader/FrameLoaderClient.h:
* page/Frame.cpp:
(WebCore::Frame::setDocument): Allows notifying of change of main frame document.
UIProcess will use that to remove unneeded previously granted gum permission.

Source/WebKit2:

Introduce a storage of granted requests to skip prompting when needed.
This is a partial implementation as granted requests should not happen for background tabs.
This will be covered in a follow-up patch.
Covered by manual tests.

A granted request keeps its mainFrameID.
Whenever the document of the main frame changes, the granted requests for that mainFrameID will be removed.
This handles the case of navigating, reloading... while still supporting the case of granting getUserMedia after in page navigation.

* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::createRequest):
(WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
(WebKit::UserMediaPermissionRequestManagerProxy::removeGrantedAccess):
(WebKit::UserMediaPermissionRequestManagerProxy::searchForGrantedRequest):
(WebKit::UserMediaPermissionRequestManagerProxy::grantAccess):
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
* UIProcess/UserMediaPermissionRequestManagerProxy.h:
* UIProcess/UserMediaPermissionRequestProxy.cpp:
(WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy):
* UIProcess/UserMediaPermissionRequestProxy.h:
(WebKit::UserMediaPermissionRequestProxy::create):
(WebKit::UserMediaPermissionRequestProxy::mainFrameID):
(WebKit::UserMediaPermissionRequestProxy::frameID):
(WebKit::UserMediaPermissionRequestProxy::userMediaDocumentSecurityOrigin):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didChangeMainDocument):
(WebKit::WebPageProxy::backForwardGoToItem):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidChangeMainDocument):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:

LayoutTests:

* fast/mediastream/getUserMedia-grant-persistency-expected.txt: Added.
* fast/mediastream/getUserMedia-grant-persistency-reload-expected.txt: Added.
* fast/mediastream/getUserMedia-grant-persistency-reload.html: Added.
* fast/mediastream/getUserMedia-grant-persistency.html: Added.
* http/tests/media/media-stream/get-user-media-prompt-expected.txt:
* http/tests/media/media-stream/get-user-media-prompt.html: Last gum does not need a prompt anymore.

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

3 years agoRestrict the regress-173035.js test to only run on Darwin x86-64.
mark.lam@apple.com [Wed, 7 Jun 2017 22:39:06 +0000 (22:39 +0000)]
Restrict the regress-173035.js test to only run on Darwin x86-64.
https://bugs.webkit.org/show_bug.cgi?id=173075

Reviewed by Saam Barati.

This is because the 32-bit x86 build will fail to mmap the 0x3f900000 bytes that
this test will require to succeed.  Here's an example of this failure:
https://build.webkit.org/builders/Apple%20Sierra%2032-bit%20JSC%20%28BuildAndTest%29/builds/866/steps/webkit-32bit-jsc-test/logs/stdio

Since the issue is due to allocation of a very large amount of memory, the test
will probably fail on iOS and other platforms as well.  Hence, we should just
skip this test for any platforms that is not Darwin x86-64.

* stress/regress-173035.js:

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

3 years ago[Cocoa] additionalReadAccessAllowedURLs should be consumed before loading the injecte...
mitz@apple.com [Wed, 7 Jun 2017 22:26:48 +0000 (22:26 +0000)]
[Cocoa] additionalReadAccessAllowedURLs should be consumed before loading the injected bundle
https://bugs.webkit.org/show_bug.cgi?id=173078

Reviewed by Anders Carlsson.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess): Changed the order.

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

3 years agoAlign <col span>/<colgroup span> limits with the latest HTML specification
cdumez@apple.com [Wed, 7 Jun 2017 22:21:30 +0000 (22:21 +0000)]
Align <col span>/<colgroup span> limits with the latest HTML specification
https://bugs.webkit.org/show_bug.cgi?id=173049

Reviewed by Daniel Bates.

LayoutTests/imported/w3c:

Resync web-platform-tests after:
https://github.com/w3c/web-platform-tests/pull/6172

This helps gain coverage for the change in this patch.

* resources/import-expectations.json:
* web-platform-tests/html/dom/elements-tabular.js:
* web-platform-tests/html/dom/reflection-tabular-expected.txt:
* web-platform-tests/html/semantics/tabular-data/processing-model-1/col-span-limits-expected.txt: Added.
* web-platform-tests/html/semantics/tabular-data/processing-model-1/col-span-limits.html: Added.
* web-platform-tests/html/semantics/tabular-data/processing-model-1/w3c-import.log:

Source/WebCore:

Align <col span>/<colgroup span> limits with the latest HTML specification after:
- https://github.com/whatwg/html/issues/2705
- https://github.com/whatwg/html/pull/2734

In particular, col / colspan's span attribute is now clamped to the [1, 1000] range.

Test: imported/w3c/web-platform-tests/html/semantics/tabular-data/processing-model-1/col-span-limits.html

[1] https://html.spec.whatwg.org/#dom-colgroup-span
[2] https://html.spec.whatwg.org/#clamped-to-the-range
[3] https://github.com/whatwg/html/pull/2734/files

* html/HTMLTableColElement.cpp:
(WebCore::HTMLTableColElement::parseAttribute):
As per [1][2], the span attribute should be clamped to the range [1, 1000] with a default value of 1 (on getting).

(WebCore::HTMLTableColElement::setSpan):
As per [2], on setting, we should behave the same as setting a regular reflected unsigned integer when an attribute
is clamped to a range. Therefore, we now call limitToOnlyHTMLNonNegative() instead of
limitToOnlyHTMLNonNegativeNumbersGreaterThanZero(). We used to call limitToOnlyHTMLNonNegativeNumbersGreaterThanZero()
because the value used to be limited to only non-negative numbers greater than zero with fallback before [3]. Without
this change, "col.span = 0" would set the content attribute to 1 instead of 0, which would be wrong.

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

3 years agoExempt exclusively wall-powered devices from hardware codec requirement
jer.noble@apple.com [Wed, 7 Jun 2017 22:18:56 +0000 (22:18 +0000)]
Exempt exclusively wall-powered devices from hardware codec requirement
https://bugs.webkit.org/show_bug.cgi?id=173009

Reviewed by Eric Carlson.

* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/avfoundation/objc/AVAssetTrackUtilities.mm:
(WebCore::systemHasBattery):
(WebCore::assetTrackMeetsHardwareDecodeRequirements):
* platform/spi/cocoa/IOPSLibSPI.h: Added.

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

3 years agoRefactoring: MediaEngineSupportParameters should take a ContentType rather than separ...
jer.noble@apple.com [Wed, 7 Jun 2017 22:15:50 +0000 (22:15 +0000)]
Refactoring: MediaEngineSupportParameters should take a ContentType rather than separate type & codecs strings
https://bugs.webkit.org/show_bug.cgi?id=173038

Reviewed by Eric Carlson.

Source/WebCore:

* Modules/encryptedmedia/CDM.cpp:
(WebCore::CDM::getSupportedCapabilitiesForAudioVideoType):
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::addSourceBuffer):
(WebCore::MediaSource::isTypeSupported):
* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocument):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::canPlayType):
(WebCore::HTMLMediaElement::selectNextSourceChild):
* platform/ContentType.cpp:
(WebCore::ContentType::codecsParameter):
(WebCore::ContentType::profilesParameter):
(WebCore::ContentType::containerType):
(WebCore::simplifyWhitespace):
(WebCore::ContentType::codecs):
(WebCore::ContentType::profiles):
(WebCore::ContentType::type): Deleted.
* platform/ContentType.h:
* platform/graphics/MediaPlayer.cpp:
(WebCore::bestMediaEngineForSupportParameters):
(WebCore::MediaPlayer::load):
(WebCore::MediaPlayer::nextBestMediaEngine):
(WebCore::MediaPlayer::loadWithNextMediaEngine):
(WebCore::MediaPlayer::supportsType):
(WebCore::MediaPlayer::networkStateChanged):
(WebCore::codecs): Deleted.
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayer::contentMIMEType):
(WebCore::MediaPlayer::contentTypeCodecs):
* platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
(WebCore::CDMPrivateMediaSourceAVFObjC::supportsKeySystemAndMimeType):
(WebCore::CDMPrivateMediaSourceAVFObjC::supportsMIMEType):
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::MediaPlayerPrivateAVFoundationCF::supportsType):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
(WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType):
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
(WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::supportsType):
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::supportsType):
* platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
(WebCore::MediaPlayerPrivateQTKit::supportsType):
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::MediaPlayerPrivateMediaFoundation::supportsType):
* platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
(WebCore::MockMediaPlayerMediaSource::supportsType):
* platform/mock/mediasource/MockMediaSourcePrivate.cpp:
(WebCore::MockMediaSourcePrivate::addSourceBuffer):

Source/WTF:

Drive by fix: add a version of split that takes a UChar and returns a Vector<String>.

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

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

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

Reviewed by Chris Dumez.

Address Antti's review comment. We don't need a new Node flg.

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

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

3 years agoUpdate feature status for features Supported In Preview
jond@apple.com [Wed, 7 Jun 2017 21:35:23 +0000 (21:35 +0000)]
Update feature status for features Supported In Preview
https://bugs.webkit.org/show_bug.cgi?id=173071

Reviewed by Darin Adler.

Source/JavaScriptCore:

Updated Media Capture and Streams, Performance Observer, Resource Timing Level 2,
User Timing Level 2, Web Cryptography API, WebGL 2, WebRTC.

* features.json:

Source/WebCore:

Updated WebAssembly.

* features.json:

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

3 years agoTeach run-webkit-tests how to run HTTPS Web Platform Tests
dbates@webkit.org [Wed, 7 Jun 2017 20:25:22 +0000 (20:25 +0000)]
Teach run-webkit-tests how to run HTTPS Web Platform Tests
https://bugs.webkit.org/show_bug.cgi?id=172930
<rdar://problem/32570201>

Reviewed by Youenn Fablet.

Some web platform tests need to be run from an HTTPS server in order to exercise functionality
that is conditioned on the page being delivered over a secure protocol. One example of such
a test is LayoutTests/imported/w3c/web-platform-tests/WebCryptoAPI/secure_context/crypto-subtle-secure-context-available.https.sub.html.

Ideally we should look to use wptrunner to run Web Platform Tests. For now, modify run-webkit-tests
to access web platform tests from an HTTPS server when the filename of the test contains ".https.".
This makes run-webkit-test match the behavior of wptrunner: <https://github.com/w3c/web-platform-tests/blob/7ce469d1c46dd45aacfe1b408bf2ad36a630e089/tools/manifest/item.py#L42>.

* Scripts/webkitpy/layout_tests/servers/web_platform_test_server.py:
(https_base_url): Parses the Web Platform Tests JSON configuration and returns the base URL
to the Web Platform Tests HTTPS server.
* Scripts/webkitpy/port/base.py:
(Port.to.web_platform_test_server_https_base_url): Turns around and calls https_base_url().
* Scripts/webkitpy/port/driver.py:
(Driver.__init__): Caches the base URL to the Web Platform Tests HTTPS server. Also rename
instance variables web_platform_test_server_doc_root, web_platform_test_server_base_url to
_web_platform_test_server_doc_root and _web_platform_test_server_base_url, respectively to
indicate that they should be considered private instance variables.
(Driver.is_web_platform_test): Update code for renamed instance variables.
(Driver):
(Driver._web_platform_test_base_url_for_test): Returns the URL to access the specified test.
(Driver.test_to_uri): Modified to use Driver._web_platform_test_base_url_for_test() to
determine the base URL to use to access the test.
(Driver.uri_to_test): Added logic to compute the filesystem local test name from a Web
Platform Tests HTTPS URL. Also updated code for renamed instance variables.

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

3 years agoFetching Blob URLs with XHR gives null content-type and content-length
dbates@webkit.org [Wed, 7 Jun 2017 20:10:50 +0000 (20:10 +0000)]
Fetching Blob URLs with XHR gives null content-type and content-length
https://bugs.webkit.org/show_bug.cgi?id=137647
<rdar://problem/18215114>

Reviewed by Darin Adler.

Add a test to ensure that we do not regress the computed Content-Type and Content-Length
for a blob URL fetched using XHR.

* fast/xmlhttprequest/xmlhttprequest-blob-url-has-valid-response-type-and-size-expected.txt: Added.
* fast/xmlhttprequest/xmlhttprequest-blob-url-has-valid-response-type-and-size.html: Added.

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

3 years agoASSERTION failure: !masqueradesAsUndefinedWatchpointIsStillValid() || !isKnownCell...
mark.lam@apple.com [Wed, 7 Jun 2017 19:59:59 +0000 (19:59 +0000)]
ASSERTION failure: !masqueradesAsUndefinedWatchpointIsStillValid() || !isKnownCell(operand.node())
https://bugs.webkit.org/show_bug.cgi?id=168587

Not reviewed.

Unskipping the test because the issue has been fixed in https://bugs.webkit.org/show_bug.cgi?id=172673.

* stress/test-finally.js:

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

3 years agoUnreviewed GTK+ and WPE gardening.
zandobersek@gmail.com [Wed, 7 Jun 2017 19:32:23 +0000 (19:32 +0000)]
Unreviewed GTK+ and WPE gardening.

Add platform-specific test baselines for layout tests where the
libgcrypt-based implementation passes more tests than the generic
baselines expect. The WPE test expectations for these tests are
also cleaned up a bit, and the tests are marked as slow to give
them more time to properly execute.

* platform/gtk/TestExpectations: Skip two imported W3C Web Crypto API tests that rely in SPKI and PKCS#8 imports.
* platform/wpe/TestExpectations: Ditto.
* platform/wpe/crypto: Added.
* platform/wpe/crypto/subtle: Added.
* platform/wpe/crypto/subtle/rsa-generate-key-malformed-parameters-expected.txt: Added.
* platform/wpe/crypto/subtle/rsa-import-key-malformed-parameters-expected.txt: Added.
* platform/wpe/imported: Added.
* platform/wpe/imported/w3c: Added.
* platform/wpe/imported/w3c/web-platform-tests: Added.
* platform/wpe/imported/w3c/web-platform-tests/WebCryptoAPI: Added.
* platform/wpe/imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys: Added.
* platform/wpe/imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/hkdf.worker-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/test_hkdf.https-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/WebCryptoAPI/generateKey: Added.
* platform/wpe/imported/w3c/web-platform-tests/WebCryptoAPI/generateKey/failures.worker-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/WebCryptoAPI/generateKey/failures_RSA-PSS.worker-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/WebCryptoAPI/generateKey/successes_RSA-PSS.worker-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/WebCryptoAPI/generateKey/test_failures.https-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/WebCryptoAPI/generateKey/test_failures_RSA-PSS.https-expected.txt: Added.
* platform/wpe/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@217899 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoARES-6 incorrectly measures Worst 4 Iterations
sbarati@apple.com [Wed, 7 Jun 2017 19:13:46 +0000 (19:13 +0000)]
ARES-6 incorrectly measures Worst 4 Iterations
https://bugs.webkit.org/show_bug.cgi?id=172960

Reviewed by Mark Lam.

Version 1.0 of ARES-6 was accidentally measuring the first
4 iterations, instead of the worst 4. This patch fixes the
bug and bumps the version to 1.0.1.

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

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