WebKit-https.git
4 years ago[EME] Implement MediaKeySession::close()
zandobersek@gmail.com [Wed, 8 Feb 2017 10:25:23 +0000 (10:25 +0000)]
[EME] Implement MediaKeySession::close()
https://bugs.webkit.org/show_bug.cgi?id=167869

Reviewed by Xabier Rodriguez-Calvar.

Source/WebCore:

Implement MediaKeySession::close() as outlined in the specification.

The CDMInstance::closeSession() virtual method, when called, should
close the session that's represented by the passed-in session ID on
the CDMInstance implementor object. That's the same session ID that
the CDMInstance object passes to the MediaKeySession class through
the callback that's provided to the updateLicense call.

The CloseSessionCallback, passed to CDMInstance::closeSession(),
should be invoked by the CDMInstance implementor once the session
is closed. When that is invoked, another task is queued for the
MediaKeySession object that runs the `session closed` algorithm
and resolves the promise.

MockCDMInstance::closeSession() is defined to remove the session
from the MockCDMFactory object and invoke the CloseSessionCallback.

Test: media/encrypted-media/mock-MediaKeySession-close.html

* Modules/encryptedmedia/CDMInstance.h:
* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::close):
* testing/MockCDMFactory.cpp:
(WebCore::MockCDMInstance::closeSession):
* testing/MockCDMFactory.h:

LayoutTests:

Add the mock-MediaKeySession-close.html test case which checks proper
behavior of MediaKeySession::close(), specifically that under specific
conditions the promise returned by that method is properly resolved or
rejected. The test is skipped on all platforms for now.

* media/encrypted-media/mock-MediaKeySession-close-expected.txt: Added.
* media/encrypted-media/mock-MediaKeySession-close.html: Added.
* platform/efl/TestExpectations:
* platform/mac/TestExpectations:

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

4 years ago[EME] Alias CDMInstance enums to the specification-defined enums
zandobersek@gmail.com [Wed, 8 Feb 2017 09:34:44 +0000 (09:34 +0000)]
[EME] Alias CDMInstance enums to the specification-defined enums
https://bugs.webkit.org/show_bug.cgi?id=167896

Reviewed by Sam Weinig.

Simplify the enums in the CDMInstance class by simply aliasing them
to the EME specification-defined enums. CDMInstance::KeyStatus and
CDMInstance::MessageType were already direct copies of the
MediaKeyStatus and MediaKeyMessageType enums, while the
CDMInstance::LicenseType had the members as MediaKeySessionType,
but with slightly different names.

No changes in behavior.

* Modules/encryptedmedia/CDMInstance.h:
* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::generateRequest):
(WebCore::MediaKeySession::update):
* testing/MockCDMFactory.cpp:
(WebCore::MockCDMInstance::requestLicense):

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

4 years agoREGRESSION(r210740): [GTK] 2.15 broke embedded videos in GNOME's yelp app
carlosgc@webkit.org [Wed, 8 Feb 2017 06:54:01 +0000 (06:54 +0000)]
REGRESSION(r210740): [GTK] 2.15 broke embedded videos in GNOME's yelp app
https://bugs.webkit.org/show_bug.cgi?id=167887

Reviewed by Michael Catanzaro.

Update the m_renderingCanBeAccelerated when accelerated rendering state changes.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::acceleratedRenderingStateChanged):
(WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:

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

4 years ago[GTK] Handle extended colors in cairo and texture mapper backends
carlosgc@webkit.org [Wed, 8 Feb 2017 06:41:12 +0000 (06:41 +0000)]
[GTK] Handle extended colors in cairo and texture mapper backends
https://bugs.webkit.org/show_bug.cgi?id=167943

Reviewed by Michael Catanzaro.

Fixes: css3/color/backgrounds-and-borders.html
       css3/color/box-shadows.html
       css3/color/canvas.html
       css3/color/composited-solid-backgrounds.html
       css3/color/text.html

* platform/graphics/Color.cpp:
(WebCore::premultipliedARGBFromColor): Handle the case of color being extended.
* platform/graphics/cairo/CairoUtilities.cpp:
(WebCore::setSourceRGBAFromColor): Ditto.
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::fillRectWithColor): Use isVisible() instead of alpha().
(WebCore::GraphicsContext::drawEllipse): Ditto.
* platform/graphics/gtk/ColorGtk.cpp:
(WebCore::Color::operator GdkRGBA): Handle the case of color being extended.
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGL::drawNumber): Ditto.
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::blendWithOpacity): Ditto.
(WebCore::TextureMapperLayer::paintSelf): Use isVisible() instead of alpha().
(WebCore::TextureMapperLayer::computeOverlapRegions): Ditto.

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

4 years agoWebItemProviderPasteboard should use -registerLoadHandlersToItemProvider: when creati...
wenson_hsieh@apple.com [Wed, 8 Feb 2017 01:47:31 +0000 (01:47 +0000)]
WebItemProviderPasteboard should use -registerLoadHandlersToItemProvider: when creating a new UIItemProvider
https://bugs.webkit.org/show_bug.cgi?id=167918
<rdar://problem/30382347>

Reviewed by Tim Horton.

Adopts SPI in WebItemProviderPasteboard for object types that the platform knows how to serialize. Since we use
-createObjectOfClass: to initialize data when reading off of the pasteboard, we need to match the format that
objects conforming to UIItemProviderReading will expect. Thus, for all given objects that conform to
UIItemProviderWriting, we have them register themselves to the item provider.

We register other UTI types due to the fact that PlatformPasteboardIOS does not care about the specific
pasteboard used. This should not be necessary, however, since data written to the WebItemProviderPasteboard
should never need to be read by an actual UIPasteboard. This will be refactored in a future patch to add a
special type of WebItemProviderPasteboard-aware PlatformPasteboard.

Also fixes some reference counting issues in WebItemProviderPasteboard by changing the array of _itemProviders
to be a RetainPtr.

* platform/ios/WebItemProviderPasteboard.mm:
(-[WebItemProviderPasteboard init]):
(-[WebItemProviderPasteboard pasteboardTypes]):
(-[WebItemProviderPasteboard itemProviders]):
(-[WebItemProviderPasteboard setItemProviders:]):
(-[WebItemProviderPasteboard numberOfItems]):
(-[WebItemProviderPasteboard setItems:]):
(-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]):
(-[WebItemProviderPasteboard itemProviderAtIndex:]):
(-[WebItemProviderPasteboard dealloc]): Deleted.

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

4 years agoUpdate flakiness dashboard configuration.
ryanhaddad@apple.com [Wed, 8 Feb 2017 01:25:42 +0000 (01:25 +0000)]
Update flakiness dashboard configuration.
https://bugs.webkit.org/show_bug.cgi?id=167957

Reviewed by Alexey Proskuryakov.

* TestResultServer/static-dashboards/builders.jsonp:

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

4 years agoFix libwebrtcpcrtc target include path
achristensen@apple.com [Wed, 8 Feb 2017 01:12:50 +0000 (01:12 +0000)]
Fix libwebrtcpcrtc target include path
https://bugs.webkit.org/show_bug.cgi?id=167971

Patch by Youenn Fablet <youenn@apple.com> on 2017-02-07
Reviewed by Alex Christensen.

* Configurations/libwebrtcpcrtc.xcconfig:

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

4 years ago[WebRTC] usrsctp (libwebrtc third party library) is not compiling
achristensen@apple.com [Wed, 8 Feb 2017 01:07:13 +0000 (01:07 +0000)]
[WebRTC] usrsctp (libwebrtc third party library) is not compiling
https://bugs.webkit.org/show_bug.cgi?id=167969

Patch by Youenn Fablet <youenn@apple.com> on 2017-02-07
Reviewed by Alex Christensen.

Also removing .gitignore files in libwebrtc directory.

* Source/.gitignore: Removed.
* Source/third_party/boringssl/src/.gitignore: Removed.
* Source/third_party/gflags/src/.gitignore: Removed.
* Source/third_party/jsoncpp/source/.gitignore: Removed.
* Source/third_party/libyuv/.gitignore: Removed.
* Source/third_party/protobuf/.gitignore: Removed.
* Source/third_party/protobuf/csharp/.gitignore: Removed.
* Source/third_party/protobuf/ruby/.gitignore: Removed.
* Source/third_party/usrsctp/usrsctplib/.gitignore: Removed.
* Source/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_input.c:
(sctp_process_cookie_existing):
* Source/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_output.c:
* Source/tools/.gitignore: Removed.
* Source/webrtc/.gitignore: Removed.

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

4 years agoMove webrtc/pc to own Xcode target
achristensen@apple.com [Wed, 8 Feb 2017 01:04:21 +0000 (01:04 +0000)]
Move webrtc/pc to own Xcode target
https://bugs.webkit.org/show_bug.cgi?id=167970

Reviewed by Youenn Fablet.

It needs to include different directories than the rest of libwebrtc.
Also moved some target names so liblibsrtp.a is changed to libsrtp.a, etc.

* Configurations/libwebrtcpcrtc.xcconfig: Added.
* libwebrtc.xcodeproj/project.pbxproj:

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

4 years agoReplace a bot that has an incorrect configuration.
ryanhaddad@apple.com [Wed, 8 Feb 2017 01:04:13 +0000 (01:04 +0000)]
Replace a bot that has an incorrect configuration.
https://bugs.webkit.org/show_bug.cgi?id=167747

Rubber-stamped by Alexey Proskuryakov.

* BuildSlaveSupport/build.webkit.org-config/config.json:

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

4 years agoWebContent process repeatedly jetsams on BuzzFeed's Another Round page
rniwa@webkit.org [Wed, 8 Feb 2017 00:58:02 +0000 (00:58 +0000)]
WebContent process repeatedly jetsams on BuzzFeed's Another Round page
https://bugs.webkit.org/show_bug.cgi?id=167830
<rdar://problem/30187368>

Reviewed by Simon Fraser.

Source/WebCore:

The jetsams on https://www.buzzfeed.com/anotherround were caused by WebKit creating the backing store
for every iframe's layer on the page regardless of whether they're in the viewport or not.

This was caused by GraphicsLayerCA's setVisibleAndCoverageRects not setting CoverageRectChanged on
m_uncommittedChanges on the very first call. Fixed the bug by initializing m_uncommittedChanges
to always have CoverageRectChanged so that the coverage rect would get updated properly.

Unfortunately, no new tests since somehow the backing store doesn't get created inside the test runner.

* platform/graphics/ca/GraphicsLayerCA.h:
(WebCore::GraphicsLayerCA):

LayoutTests:

Rebaseline the test now that some overlay repaints are avoided properly by updating the overlay coverage rects.

* platform/ios-simulator-wk2/pageoverlay/overlay-remove-reinsert-view-expected.txt:

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

4 years ago[libwebrtc] Move libsrtp and libyuv to own Xcode targets
achristensen@apple.com [Wed, 8 Feb 2017 00:47:20 +0000 (00:47 +0000)]
[libwebrtc] Move libsrtp and libyuv to own Xcode targets
https://bugs.webkit.org/show_bug.cgi?id=167966

Reviewed by Youenn Fablet.

* Configurations/libsrtp.xcconfig: Added.
* Configurations/libyuv.xcconfig: Added.
* Configurations/usrsctp.xcconfig:
* libwebrtc.xcodeproj/project.pbxproj:

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

4 years agoMark mathml/opentype/large-operators-displaystyle-dynamic.html as flaky on Sierra...
ryanhaddad@apple.com [Wed, 8 Feb 2017 00:46:32 +0000 (00:46 +0000)]
Mark mathml/opentype/large-operators-displaystyle-dynamic.html as flaky on Sierra WK2 Release.
https://bugs.webkit.org/show_bug.cgi?id=167206

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

4 years agoSkip http/tests/security/bypassing-cors-checks-for-extension-urls.html on ios-simulator.
ryanhaddad@apple.com [Wed, 8 Feb 2017 00:21:52 +0000 (00:21 +0000)]
Skip http/tests/security/bypassing-cors-checks-for-extension-urls.html on ios-simulator.

Unreviewed test gardening.

* platform/ios-simulator/TestExpectations:

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

4 years agoCorrect initialization of Resource Load Statistics for use in WebKitTestRunner
bfulgham@apple.com [Wed, 8 Feb 2017 00:07:02 +0000 (00:07 +0000)]
Correct initialization of Resource Load Statistics for use in WebKitTestRunner
https://bugs.webkit.org/show_bug.cgi?id=167960

Reviewed by Andy Estes.

WebKit2 starts up with different process configuration settings depending on the type of
WebView and client application. This led to two problems:
1. Registering the shared resource load observer did not start at UIProcess launch. Instead, it
   was lazily initialized as messages from the various WebProcess started getting received. This
   is too slow for WebKitTestRunner, which needs this object to be initialized right at launch
   time.

   A new 'registerSharedResourceLoadObserver' method was needed, so that the WebProcess can ask
   the WebsiteDataStore to register a resource load observer during platform initialization.

2. Some WebView uses do not enable WebsiteDataStore, and should not activate a resource load
   statistics observer.

* UIProcess/API/APIWebsiteDataStore.cpp:
(API::WebsiteDataStore::registerSharedResourceLoadObserver): Added.
* UIProcess/API/APIWebsiteDataStore.h:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitialize): If the web process is using a WebsiteDataStore,
register a resource load observer.
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): Added.
* UIProcess/WebResourceLoadStatisticsStore.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::registerSharedResourceLoadObserver): Added.
* UIProcess/WebsiteData/WebsiteDataStore.h:

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

4 years agoWeb Inspector: gradient editor should allow switching the units of the 'angle' parameter
commit-queue@webkit.org [Tue, 7 Feb 2017 22:31:48 +0000 (22:31 +0000)]
Web Inspector: gradient editor should allow switching the units of the 'angle' parameter
https://bugs.webkit.org/show_bug.cgi?id=166938

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2017-02-07
Reviewed by Brian Burg.

Source/WebInspectorUI:

* UserInterface/Test.html:
Add WebInspector.Gradient for new model object tests.

* UserInterface/Models/Gradient.js:
(WebInspector.Gradient.fromString):
(WebInspector.LinearGradient):
(WebInspector.LinearGradient.fromComponents):
(WebInspector.LinearGradient.prototype.set angleValue):
(WebInspector.LinearGradient.prototype.get angleValue):
(WebInspector.LinearGradient.prototype.set angleUnits):
(WebInspector.LinearGradient.prototype.get angleUnits):
(WebInspector.LinearGradient.prototype.copy):
(WebInspector.LinearGradient.prototype.toString):
(WebInspector.LinearGradient.prototype._angleValueForUnits):
Rework part of WebInspector.LinearGradient to support units other than "deg".

* UserInterface/Views/GradientEditor.css:
(.gradient-editor > .gradient-angle > input[type="range"]):
(.gradient-editor > .gradient-angle > input[type="number"]):

* UserInterface/Views/GradientEditor.js:
(WebInspector.GradientEditor):
(WebInspector.GradientEditor.prototype.set gradient):
(WebInspector.GradientEditor.prototype._gradientTypeChanged):
(WebInspector.GradientEditor.prototype._angleValueChanged):
(WebInspector.GradientEditor.prototype._angleUnitsChanged):
(WebInspector.GradientEditor.prototype._angleChanged): Deleted.
Add <select> for each unit type that will change the units of the gradient.

LayoutTests:

* inspector/model/gradient-expected.txt: Added.
* inspector/model/gradient.html: Added.
New tests for WebInspector.Gradient.

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

4 years agoMark media/modern-media-controls/tracks-support/tracks-support-show-panel-after-dragg...
ryanhaddad@apple.com [Tue, 7 Feb 2017 22:29:57 +0000 (22:29 +0000)]
Mark media/modern-media-controls/tracks-support/tracks-support-show-panel-after-dragging-controls.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=167275

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

4 years agoREGRESSION (r211819): [ios-simulator] API tests Coding.WKWebView and Coding.WKWebView...
andersca@apple.com [Tue, 7 Feb 2017 22:09:03 +0000 (22:09 +0000)]
REGRESSION (r211819): [ios-simulator] API tests Coding.WKWebView and Coding.WKWebView_SameConfiguration crashing
https://bugs.webkit.org/show_bug.cgi?id=167947

Reviewed by Tim Horton.

* Platform/spi/ios/UIKitSPI.h:
Add SPI declaration.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
Make sure to call setDrawsBackground here.

(-[WKWebView _populateArchivedSubviews:]):
We don't want to archive the scroll view and the fixed overlay view.

(-[WKWebView setOpaque:]):
Return early if this is called before we have a page (like from -[UIView initWithCoder:]).

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

4 years ago[WebRTC] LibWebRTCEndpoint should not own objects that should be destroyed on the...
commit-queue@webkit.org [Tue, 7 Feb 2017 21:56:42 +0000 (21:56 +0000)]
[WebRTC] LibWebRTCEndpoint should not own objects that should be destroyed on the main thread
https://bugs.webkit.org/show_bug.cgi?id=167816

Patch by Youenn Fablet <youennf@gmail.com> on 2017-02-07
Reviewed by Alex Christensen.

Source/WebCore:

Tests: webrtc/libwebrtc/release-while-creating-offer.html
       webrtc/libwebrtc/release-while-getting-stats.html
       webrtc/libwebrtc/release-while-setting-local-description.html

Moving AV sources, stats promises, ICE candidates from LibWebRTCEndpoint to LibWebRTCPeerConnectionBackend.
This allows ensuring these are destroyed in the main thread.

* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::getStats):
* Modules/mediastream/MediaEndpointPeerConnection.h:
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::getStats):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
(WebCore::LibWebRTCMediaEndpoint::doCreateAnswer):
(WebCore::LibWebRTCMediaEndpoint::getStats):
(WebCore::LibWebRTCMediaEndpoint::StatsCollector::StatsCollector):
(WebCore::LibWebRTCMediaEndpoint::StatsCollector::OnStatsDelivered):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
(WebCore::LibWebRTCMediaEndpoint::addIceCandidate):
(WebCore::LibWebRTCMediaEndpoint::isStopped):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::~LibWebRTCPeerConnectionBackend):
(WebCore::LibWebRTCPeerConnectionBackend::getStats):
(WebCore::LibWebRTCPeerConnectionBackend::iceCandidateSucceeded):
(WebCore::LibWebRTCPeerConnectionBackend::iceCandidateFailed):
(WebCore::LibWebRTCPeerConnectionBackend::doSetLocalDescription):
(WebCore::LibWebRTCPeerConnectionBackend::doSetRemoteDescription):
(WebCore::LibWebRTCPeerConnectionBackend::doAddIceCandidate):
(WebCore::LibWebRTCPeerConnectionBackend::addAudioSource):
(WebCore::LibWebRTCPeerConnectionBackend::addVideoSource):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
* testing/MockLibWebRTCPeerConnection.cpp:
(WebCore::MockLibWebRTCPeerConnectionReleasedInNetworkThreadWhileCreatingOffer::MockLibWebRTCPeerConnectionReleasedInNetworkThreadWhileCreatingOffer):
(WebCore::releaseInNetworkThread):
(WebCore::MockLibWebRTCPeerConnectionReleasedInNetworkThreadWhileCreatingOffer::CreateOffer):
(WebCore::MockLibWebRTCPeerConnectionReleasedInNetworkThreadWhileGettingStats::MockLibWebRTCPeerConnectionReleasedInNetworkThreadWhileGettingStats):
(WebCore::MockLibWebRTCPeerConnectionReleasedInNetworkThreadWhileGettingStats::GetStats):
(WebCore::MockLibWebRTCPeerConnectionReleasedInNetworkThreadWhileSettingDescription::MockLibWebRTCPeerConnectionReleasedInNetworkThreadWhileSettingDescription):
(WebCore::MockLibWebRTCPeerConnectionReleasedInNetworkThreadWhileSettingDescription::SetLocalDescription):
(WebCore::MockLibWebRTCPeerConnectionFactory::CreatePeerConnection):
* testing/MockLibWebRTCPeerConnection.h:

LayoutTests:

* webrtc/libwebrtc/release-while-creating-offer.html: Added.
* webrtc/libwebrtc/release-while-getting-stats.html: Added.
* webrtc/libwebrtc/release-while-setting-local-description.html: Added.

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

4 years ago[Win] [GTK] [EFL] Compile (but don't use, yet) the platform-independent piece of...
mmaxfield@apple.com [Tue, 7 Feb 2017 21:37:44 +0000 (21:37 +0000)]
[Win] [GTK] [EFL] Compile (but don't use, yet) the platform-independent piece of ComplexTextController
https://bugs.webkit.org/show_bug.cgi?id=167927

Reviewed by Brent Fulgham.

Source/WebCore:

This patch simply moves some functions around to enable the Win, GTK, and EFL ports to compile the
platform-independent pieces of ComplexTextController. Those parts of ComplexTextController have
some dependencies which were previously only available on the Cocoa ports; however, those
dependencies are easily created or moved from elsewhere. The next step is to populate the
ComplexTextController::collectComplexTextRunsForCharacters() function for DirectWrite and HarfBuzz.
Once that is done, UniscribeController and HarfBuzzShaper can be deleted.

Adds ComplexTextController TestWebKitAPI tests to the Win and GTK ports.

* CMakeLists.txt: Everyone can compile the platform-independent piece of ComplexTextController.
* PlatformEfl.cmake: Add the HarfBuzz-specific piece.
* PlatformGTK.cmake: Ditto.
* PlatformWin.cmake: Add the DirectWrite-specific piece.
* platform/graphics/ComplexTextController.cpp:
(WebCore::TextLayoutDeleter::operator()): ComplexTextController shouldn't be enabled yet for Win,
GTK, or EFL.
(WebCore::FontCascade::createLayout): Ditto.
(WebCore::FontCascade::width): Ditto.
(WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): Moved shared code to the shared
file.
* platform/graphics/Font.cpp:
(WebCore::Font::noSynthesizableFeaturesFont): Default implementation for other ports.
(WebCore::Font::variantCapsSupportsCharacterForSynthesis): Ditto.
* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::fontForCombiningCharacterSequence): Ditto.
(WebCore::FontCascade::drawEmphasisMarksForComplexText): Ditto.
(WebCore::FontCascade::createLayout): Deleted. Moved to ComplexTextController.
(WebCore::TextLayoutDeleter::operator()): Deleted. Ditto.
* platform/graphics/FontCascade.h: fontForCombiningCharacterSequence() should exist on all ports.
* platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
(WebCore::FontCascade::drawEmphasisMarksForComplexText): Deleted. Shared among all ports.
* platform/graphics/cocoa/FontCascadeCocoa.mm:
(WebCore::FontCascade::drawEmphasisMarksForComplexText): Deleted. Ditto.
* platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp: Added.
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Empty implementation of
HarfBuzz-specific piece of ComplexTextController.
* platform/graphics/mac/ComplexTextControllerCoreText.mm: Moved constructors to shared file.
* platform/graphics/win/ComplexTextControllerDirectWrite.cpp: Added.
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Empty implementation of
Direct Write-specific piece of ComplexTextController.
* platform/graphics/win/FontWin.cpp:
(WebCore::FontCascade::drawEmphasisMarksForComplexText): Deleted. Shared among all ports.

Tools:

Enable ComplexTextController API tests on the Win and GTK ports.

* TestWebKitAPI/PlatformGTK.cmake:
* TestWebKitAPI/PlatformWin.cmake:

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

4 years agoRevert r166597
achristensen@apple.com [Tue, 7 Feb 2017 21:29:50 +0000 (21:29 +0000)]
Revert r166597
https://bugs.webkit.org/show_bug.cgi?id=167951

Reviewed by Andreas Kling.

Source/WebCore:

* platform/spi/cf/CFNetworkSPI.h:
Remove now-unused SPI declaration.

Source/WebKit2:

CFURLConnectionInvalidateConnectionCache is not commonly called and is likely causing
CFNetwork to be in a strange state when using NSURLSession and invalidating the connection
cache during authentication, especially server trust evaluation.  Right now we only call
it when handling memory pressure, and it isn't worth getting into such a strange state
in a poorly tested situation. See rdar://problem/27439617

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::lowMemoryHandler):
(WebKit::NetworkProcess::initializeSandbox):
(WebKit::NetworkProcess::platformLowMemoryHandler): Deleted.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformLowMemoryHandler): Deleted.

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

4 years agoSigillCrashAnalyzer::analyze() should use a do-while loop instead of a lambda.
mark.lam@apple.com [Tue, 7 Feb 2017 21:22:20 +0000 (21:22 +0000)]
SigillCrashAnalyzer::analyze() should use a do-while loop instead of a lambda.
https://bugs.webkit.org/show_bug.cgi?id=167950

Reviewed by Michael Saboff.

Lambdas aren't free (apparently, the compiler isn't able to detect that the
lambda does not escape and can be inlined completely).  So, use a do-while loop
instead since we don't really need a lambda here.

* tools/SigillCrashAnalyzer.cpp:

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

4 years agoFile index appended to previous file in svn-create-patch with SVN 1.9
jbedard@apple.com [Tue, 7 Feb 2017 21:02:43 +0000 (21:02 +0000)]
File index appended to previous file in svn-create-patch with SVN 1.9
https://bugs.webkit.org/show_bug.cgi?id=167903
<rdar://problem/30387395>

Reviewed by Daniel Bates.

* Scripts/VCSUtils.pm:
(fixSVNPatchForAdditionWithHistory): Append a trailing newline character.
* Scripts/webkitperl/VCSUtils_unittest/fixSVNPatchForAdditionWithHistory.pl: Do not remove
trailing newline character from the expected result before comparing it to the actual result.

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

4 years agoTry to fix the windows build.
weinig@apple.com [Tue, 7 Feb 2017 20:56:19 +0000 (20:56 +0000)]
Try to fix the windows build.

* bindings/js/ReadableStreamDefaultController.cpp:

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

4 years ago[Mac] Web Automation: NSEventType not initialized in WebAutomationSession::platformSi...
bburg@apple.com [Tue, 7 Feb 2017 20:44:48 +0000 (20:44 +0000)]
[Mac] Web Automation: NSEventType not initialized in WebAutomationSession::platformSimulateMouseInteraction
https://bugs.webkit.org/show_bug.cgi?id=167902

Reviewed by Joseph Pecoraro.

* UIProcess/Automation/mac/WebAutomationSessionMac.mm:
(WebKit::WebAutomationSession::platformSimulateMouseInteraction):
Initialize these to 0, which is not a valid NSEventType. Assert that
each NSEventType has a valid value before attempting to use it.

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

4 years ago[WebRTC] LibWebRTC WK2 network stack is not providing correct ports for ICE candidates
commit-queue@webkit.org [Tue, 7 Feb 2017 20:19:09 +0000 (20:19 +0000)]
[WebRTC] LibWebRTC WK2 network stack is not providing correct ports for ICE candidates
https://bugs.webkit.org/show_bug.cgi?id=167939

Patch by Youenn Fablet <youennf@gmail.com> on 2017-02-07
Reviewed by Sam Weinig.

Source/WebCore:

Test: webrtc/no-port-zero-in-upd-candidates.html

* testing/MockLibWebRTCPeerConnection.cpp:
(WebCore::MockLibWebRTCPeerConnectionFactory::MockLibWebRTCPeerConnectionFactory): Adding a way to create one real PC in WTR environment.

Source/WebKit2:

AddressReady signalling was done by the WebProcess for UDP and ServerTCP as real async sockets in those case do
not send it. But the WebProcess does not have information on the port, as it is assigned by the socket factory
which is in the network process.

Fixed that bug by signalling AddressReady in the network process for UDP, ServerTCP and ClientTCP.

* NetworkProcess/webrtc/LibWebRTCSocketClient.cpp:
(WebKit::LibWebRTCSocketClient::LibWebRTCSocketClient):
(WebKit::LibWebRTCSocketClient::signalAddressReady):
* NetworkProcess/webrtc/LibWebRTCSocketClient.h:
* NetworkProcess/webrtc/NetworkRTCProvider.cpp:
(WebKit::NetworkRTCProvider::createUDPSocket):
(WebKit::NetworkRTCProvider::createServerTCPSocket):
(WebKit::NetworkRTCProvider::createClientTCPSocket):
* WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
(WebKit::LibWebRTCSocket::LibWebRTCSocket):
(WebKit::LibWebRTCSocket::signalAddressReady):

LayoutTests:

* webrtc/no-port-zero-in-upd-candidates.html: Added.
* webrtc/no-port-zero-in-upd-candidates-expected.txt: Added.
* webrtc/video.html:
* webrtc/video-expected.txt: Added.

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

4 years agoWeb Inspector: DOMTreeOutline becomes collapsed after switching back to Elements tab
mattbaker@apple.com [Tue, 7 Feb 2017 20:09:28 +0000 (20:09 +0000)]
Web Inspector: DOMTreeOutline becomes collapsed after switching back to Elements tab
https://bugs.webkit.org/show_bug.cgi?id=167924

Reviewed by Brian Burg.

* UserInterface/Views/DOMTreeOutline.js:
(WebInspector.DOMTreeOutline.prototype.update):
Drive-by fix: move variable initialization below the early return.

* UserInterface/Views/ElementsTabContentView.js:
(WebInspector.ElementsTabContentView.prototype.shown): Deleted.
Calling this._showDOMTreeContentView isn't necessary. The base class
implementation will call `shown` on the content view.

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

4 years agoThe SigillCrashAnalyzer should play nicer with client code that may install its own...
mark.lam@apple.com [Tue, 7 Feb 2017 20:01:35 +0000 (20:01 +0000)]
The SigillCrashAnalyzer should play nicer with client code that may install its own SIGILL handler.
https://bugs.webkit.org/show_bug.cgi?id=167858

Reviewed by Michael Saboff.

Here are the scenarios that may come up:

1. Client code did not install a SIGILL handler.
   - In this case, once we're done analyzing the SIGILL, we can just restore the
     default handler and return to let the OS do the default action i.e. capture
     a core dump.

2. Client code installed a SIGILL handler before JSC does.
   - In this case, we will see a non-null handler returned as the old signal
     handler when we install ours.
   - In our signal handler, after doing our crash analysis, we should invoke the
     client handler to let it do its work.
   - Our analyzer can also tell us if the SIGILL source is from JSC code in
     general (right now, this would just mean JIT code).
   - If the SIGILL source is not from JSC, we'll just let the client handler
     decided how to proceed.  We assume that the client handler will do the right
     thing (which is how the old behavior is before the SigillCrashAnalyzer was
     introduced).
   - If the SIGILL source is from JSC, then we know the SIGILL is an unrecoverable
     condition.  Hence, after we have given the client handler a chance to run,
     we should restore the default handler and let the OS capture a core dump.
     This intentionally overrides whatever signal settings the client handler may
     have set.

3. Client code installed a SIGILL handler after JSC does.
   - In this case, we are dependent on the client handler to call our handler
     after it does its work.  This is compatible with the old behavior before
     SigillCrashAnalyzer was introduced.
   - In our signal handler, if we determine that the SIGILL source is from JSC
     code, then the SIGILL is not recoverable.  We should then restore the
     default handler and get a core dump.
   - If the SIGILL source is not from JSC, we check to see if there's a client
     handler installed after us.
   - If we detect a client handler installed after us, we defer judgement on what
     to do to the client handler.  Since the client handler did not uninstall
     itself, it must have considered itself to have recovered from the SIGILL.
     We'll trust the client handler and take no restore action of our own (which
     is compatible with old code behavior).
   - If we detect no client handler and we have no previous handler, then we
     should restore the default handler and get a core dump.

* tools/SigillCrashAnalyzer.cpp:
(JSC::handleCrash):
(JSC::installCrashHandler):
(JSC::SigillCrashAnalyzer::analyze): Deleted.

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

4 years agoFix libwebrtc build after r211817
achristensen@apple.com [Tue, 7 Feb 2017 19:51:55 +0000 (19:51 +0000)]
Fix libwebrtc build after r211817
https://bugs.webkit.org/show_bug.cgi?id=167944

* Configurations/usrsctp.xcconfig:
Disable more warnings.

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

4 years agoUpdate bindings tests results for additional include.
weinig@apple.com [Tue, 7 Feb 2017 19:49:51 +0000 (19:49 +0000)]
Update bindings tests results for additional include.

* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:

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

4 years agoTry to fix the windows build.
weinig@apple.com [Tue, 7 Feb 2017 19:47:59 +0000 (19:47 +0000)]
Try to fix the windows build.

* bindings/js/JSDOMConvertNumbers.h:

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

4 years agoTry to fix the EFL build.
weinig@apple.com [Tue, 7 Feb 2017 19:44:33 +0000 (19:44 +0000)]
Try to fix the EFL build.

* WebProcess/InjectedBundle/InjectedBundle.cpp:

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

4 years agoFix libwebrtc build after r211728
achristensen@apple.com [Tue, 7 Feb 2017 19:34:44 +0000 (19:34 +0000)]
Fix libwebrtc build after r211728
https://bugs.webkit.org/show_bug.cgi?id=167821

* platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
(WebCore::RealtimeIncomingVideoSource::processNewSample):
* platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
(WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
(WebCore::RealtimeOutgoingAudioSource::sourceHasMoreMediaData): Deleted.
* platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
* platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
(WebCore::RealtimeOutgoingVideoSource::RealtimeOutgoingVideoSource):
(WebCore::RealtimeOutgoingVideoSource::videoSampleAvailable):
(WebCore::RealtimeOutgoingVideoSource::sourceHasMoreMediaData): Deleted.
* platform/mediastream/mac/RealtimeOutgoingVideoSource.h:

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

4 years agoRemove accidentally-added (in r211409) patch reject file
timothy_horton@apple.com [Tue, 7 Feb 2017 19:15:22 +0000 (19:15 +0000)]
Remove accidentally-added (in r211409) patch reject file

* bindings/scripts/test/JS/JSTestSerialization.cpp.rej: Removed.

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

4 years agoJSDOMConvert is too big. Split it up!
weinig@apple.com [Tue, 7 Feb 2017 18:55:24 +0000 (18:55 +0000)]
JSDOMConvert is too big. Split it up!
https://bugs.webkit.org/show_bug.cgi?id=167806

Rubber-stamped by Geoff Garen.

Split JSDOMConvert up roughly by IDL type. Some are grouped for convenience, e.g. all the
string types are together, all the numeric types are together. Also moved helpers from
JSDOMBinding to their respective JSDOMConvertFoo header. For now, JSDOMConvert.h as an
umbrella of all the sub headers, but it will be removed, and the code generator taught
to include the right header in a subsequent patch.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
Add new files.

* bindings/js/IDBBindingUtilities.cpp:
* bindings/js/IDBBindingUtilities.h:
Remove toJS that takes a std::optional<IDBKeyPath>, it was unused, and update date code
to only call valueToDate once, and pass things by reference.

* bindings/js/JSDOMBinding.cpp:
* bindings/js/JSDOMBinding.h:
Move most of the conversion helpers into their respective JSDOMConvertFoo header.

* bindings/js/JSDOMConvert.h:
Leave for now, just has includes of all the broken out headers.

* bindings/js/JSDOMConvertAny.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertBase.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertBoolean.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertBufferSource.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertCallbacks.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertDate.cpp: Copied from Source/WebCore/bindings/js/JSDOMBinding.cpp.
* bindings/js/JSDOMConvertDate.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertDictionary.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertEnumeration.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertEventListener.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertIndexedDB.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertInterface.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertJSON.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertNull.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertNullable.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertNumbers.cpp: Copied from Source/WebCore/bindings/js/JSDOMBinding.cpp.
* bindings/js/JSDOMConvertNumbers.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertObject.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertRecord.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertSequences.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertSerializedScriptValue.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertStrings.cpp: Copied from Source/WebCore/bindings/js/JSDOMBinding.cpp.
* bindings/js/JSDOMConvertStrings.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertUnion.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertVariadic.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertWebGL.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertXPathNSResolver.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateParametersCheck):
Add include of JSDOMConvertVariadic.h rather than JSDOMConvert.

* bindings/js/JSCryptoCustom.cpp:
* bindings/js/JSCryptoOperationData.cpp:
* bindings/js/JSImageDataCustom.cpp:
* bindings/js/ReadableStreamDefaultController.h:
* bindings/js/WebCoreTypedArrayController.cpp:
* html/canvas/WebGLAny.cpp:
* platform/mac/SerializedPlatformRepresentationMac.mm:
Add includes for specific JSDOMConvert header now that helpers have
been moved their from JSDOMBinding.h

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

4 years agoRemove unnecessary exports on inline functions. They were causing build failures
weinig@apple.com [Tue, 7 Feb 2017 18:53:01 +0000 (18:53 +0000)]
Remove unnecessary exports on inline functions. They were causing build failures
with some compilers.

* Modules/mediasource/SampleMap.h:
(WebCore::PresentationOrderSampleMap::begin):
(WebCore::PresentationOrderSampleMap::end):
(WebCore::PresentationOrderSampleMap::rbegin):
(WebCore::PresentationOrderSampleMap::rend):
(WebCore::DecodeOrderSampleMap::begin):
(WebCore::DecodeOrderSampleMap::end):
(WebCore::DecodeOrderSampleMap::rbegin):
(WebCore::DecodeOrderSampleMap::rend):
(WebCore::SampleMap::sizeInBytes):
(WebCore::SampleMap::decodeOrder):
(WebCore::SampleMap::presentationOrder):
(WebCore::SampleMap::addRange):
(WebCore::SampleMap::SampleMap): Deleted.

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

4 years ago-[WKWebView encodeWithCoder:] needs to call super
andersca@apple.com [Tue, 7 Feb 2017 18:42:01 +0000 (18:42 +0000)]
-[WKWebView encodeWithCoder:] needs to call super
https://bugs.webkit.org/show_bug.cgi?id=167945
rdar://problem/29777668

Reviewed by Geoffrey Garen.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView encodeWithCoder:]):
Call super.

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

4 years agoUnreviewed, manual roll out of r211777
utatane.tea@gmail.com [Tue, 7 Feb 2017 18:24:49 +0000 (18:24 +0000)]
Unreviewed, manual roll out of r211777
https://bugs.webkit.org/show_bug.cgi?id=167457

Source/JavaScriptCore:

* jsc.cpp:
(GlobalObject::moduleLoaderImportModule):
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::globalFuncImportModule):

Source/WebCore:

* bindings/js/ScriptModuleLoader.cpp:
(WebCore::ScriptModuleLoader::importModule):

LayoutTests:

Later, I'll reland it with the deterministic tests.

* inspector/controller/resources/cappuccino.js: Removed.
* inspector/controller/resources/cocoa.js: Removed.
* inspector/controller/resources/drink.js: Removed.
* inspector/controller/runtime-controller-expected.txt:
* inspector/controller/runtime-controller.html:

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

4 years agobuild usrsctp with Xcode
achristensen@apple.com [Tue, 7 Feb 2017 18:24:02 +0000 (18:24 +0000)]
build usrsctp with Xcode
https://bugs.webkit.org/show_bug.cgi?id=167944

Reviewed by Youenn Fablet.

* Configurations/usrsctp.xcconfig:
* Source/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_pcb.c:
* Source/third_party/usrsctp/usrsctplib/usrsctplib/user_atomic.h:
* libwebrtc.xcodeproj/project.pbxproj:

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

4 years ago[Soup] WebKitSoupRequestInputStream can still leave requests unfinished after r211773
carlosgc@webkit.org [Tue, 7 Feb 2017 18:08:56 +0000 (18:08 +0000)]
[Soup] WebKitSoupRequestInputStream can still leave requests unfinished after r211773
https://bugs.webkit.org/show_bug.cgi?id=167929

Reviewed by Michael Catanzaro.

The while loop to process the pending data requests was not a good idea, because having a new pending request
doesn't mean we have more data available, but that more data was requested.

* WebProcess/soup/WebKitSoupRequestInputStream.cpp:
(webkitSoupRequestInputStreamPendingReadAsyncComplete): Process only one request if needed.

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

4 years ago[GStreamer] Deadlock when media player is destroyed
carlosgc@webkit.org [Tue, 7 Feb 2017 18:04:50 +0000 (18:04 +0000)]
[GStreamer] Deadlock when media player is destroyed
https://bugs.webkit.org/show_bug.cgi?id=167861

Reviewed by Michael Catanzaro.

The problem is that we are calling notifyOne() for the draw mutex without taking the lock.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::repaint):

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

4 years agoMediaSourceClientGStreamerMSE: wrap FastMalloc-ed memory into pipeline-bound GstBuffers
zandobersek@gmail.com [Tue, 7 Feb 2017 17:59:16 +0000 (17:59 +0000)]
MediaSourceClientGStreamerMSE: wrap FastMalloc-ed memory into pipeline-bound GstBuffers
https://bugs.webkit.org/show_bug.cgi?id=167928

Reviewed by Xabier Rodriguez-Calvar.

The buffers created in MediaSourceClientGStreamerMSE can be large enough in size
that repetitive allocations can cause larger heap fragmentation in different libc
allocators. To avoid that occurrence, we should simply use FastMalloc to allocate
memory for these buffers.

* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
(WebCore::MediaSourceClientGStreamerMSE::append):

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

4 years ago[GTK][Efl] Do not require LibXslt if XSLT is disabled
commit-queue@webkit.org [Tue, 7 Feb 2017 17:20:57 +0000 (17:20 +0000)]
[GTK][Efl] Do not require LibXslt if XSLT is disabled
https://bugs.webkit.org/show_bug.cgi?id=167931

This fixes build with --no-xslt, when the libxslt dev files are not installed.

Patch by Olivier Blin <olivier.blin@softathome.com> on 2017-02-07
Reviewed by Michael Catanzaro.

* Source/cmake/OptionsEfl.cmake:
* Source/cmake/OptionsGTK.cmake:

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

4 years ago[webkitdirs] remove unused host_processor variable in determineArchitecture()
commit-queue@webkit.org [Tue, 7 Feb 2017 16:59:12 +0000 (16:59 +0000)]
[webkitdirs] remove unused host_processor variable in determineArchitecture()
https://bugs.webkit.org/show_bug.cgi?id=167936

Patch by Olivier Blin <olivier.blin@softathome.com> on 2017-02-07
Reviewed by Michael Catanzaro.

* Scripts/webkitdirs.pm:
(determineArchitecture):
The host_processor variable in webkitdirs.pm's determineArchitecture() is not used anymore,
since r195083.

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

4 years agoUse a JSON file to define which WPT files/folders to import
commit-queue@webkit.org [Tue, 7 Feb 2017 16:14:56 +0000 (16:14 +0000)]
Use a JSON file to define which WPT files/folders to import
https://bugs.webkit.org/show_bug.cgi?id=167923

Patch by Youenn Fablet <youenn@apple.com> on 2017-02-07
Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

* resources/ImportExpectations: Removed.
* resources/import-expectations.json: Added.

Tools:

* Scripts/webkitpy/w3c/test_downloader.py:
(TestDownloader.__init__):
(TestDownloader._init_paths_from_expectations):
* Scripts/webkitpy/w3c/test_importer.py:
(parse_args):
* Scripts/webkitpy/w3c/test_importer_unittest.py:

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

4 years ago[Modern Media Controls] Handle media durations of an hour or more gracefully
commit-queue@webkit.org [Tue, 7 Feb 2017 14:30:29 +0000 (14:30 +0000)]
[Modern Media Controls] Handle media durations of an hour or more gracefully
https://bugs.webkit.org/show_bug.cgi?id=167882
<rdar://problem/29601260>

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

Source/WebCore:

We add a new "labelsMayDisplayTimesOverAnHour" to TimeControl so that time labels
to the left and right of the scrubber may have extra room to display to account for
the extra "xx:" characters that may appear. We don't lay the time out dynamically
such that we don't see layout jumps as the times shown in the labels go around
the hour mark.

We also refactor the ElapsedTimeSupport and RemainingTimeSupport in a single
TimeLabelsSupport class which updates both elapsed and remaining time labels
and sets the "labelsMayDisplayTimesOverAnHour" on the TimeControl should a
"durationchange" happen to make the media duration reach or go past the hour mark.

Tests: http/tests/media/modern-media-controls/time-labels-support/long-time.html
       media/modern-media-controls/time-control/time-control-labels-may-display-times-over-an-hour.html
       media/modern-media-controls/time-labels-support/elapsed-time.html
       media/modern-media-controls/time-labels-support/remaining-time.html

* Modules/modern-media-controls/controls/time-control.js:
(TimeControl.prototype.get labelsMayDisplayTimesOverAnHour):
(TimeControl.prototype.set labelsMayDisplayTimesOverAnHour):
(TimeControl.prototype.set width):
* Modules/modern-media-controls/controls/time-label.css:
(.time-label):
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/elapsed-time-support.js: Removed.
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype._updateControlsIfNeeded):
* Modules/modern-media-controls/media/time-labels-support.js: Renamed from Source/WebCore/Modules/modern-media-controls/media/remaining-time-support.js.
(TimeLabelsSupport.prototype.get control):
(TimeLabelsSupport.prototype.syncControl):
(TimeLabelsSupport):
* WebCore.xcodeproj/project.pbxproj:

LayoutTests:

Add new tests to check that we correctly handle times at or past the hour mark.

* http/tests/media/modern-media-controls/time-labels-support/long-time-expected.txt: Added.
* http/tests/media/modern-media-controls/time-labels-support/long-time.html: Added.
* media/modern-media-controls/time-control/time-control-labels-may-display-times-over-an-hour-expected.txt: Added.
* media/modern-media-controls/time-control/time-control-labels-may-display-times-over-an-hour.html: Added.
* media/modern-media-controls/time-labels-support/elapsed-time-expected.txt: Renamed from LayoutTests/media/modern-media-controls/elapsed-time-support/elapsed-time-support-expected.txt.
* media/modern-media-controls/time-labels-support/elapsed-time.html: Renamed from LayoutTests/media/modern-media-controls/elapsed-time-support/elapsed-time-support.html.
* media/modern-media-controls/time-labels-support/remaining-time-expected.txt: Renamed from LayoutTests/media/modern-media-controls/remaining-time-support/remaining-time-support-expected.txt.
* media/modern-media-controls/time-labels-support/remaining-time.html: Renamed from LayoutTests/media/modern-media-controls/remaining-time-support/remaining-time-support.html.

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

4 years agoLayoutTet media/modern-media-controls/tracks-support/tracks-support-show-panel-after...
commit-queue@webkit.org [Tue, 7 Feb 2017 14:07:48 +0000 (14:07 +0000)]
LayoutTet media/modern-media-controls/tracks-support/tracks-support-show-panel-after-dragging-controls.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=167275

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

After bringing fullscreen controls up to spec as part of https://bugs.webkit.org/show_bug.cgi?id=167875,
we need to initiate dragging on an area that is not covered by controls, so we shift further right to
initiate dragging.

* media/modern-media-controls/tracks-support/tracks-support-show-panel-after-dragging-controls.html:
* platform/mac/TestExpectations:

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

4 years agoLayoutTest media/modern-media-controls/layout-node/addChild.html is a flaky timeout
commit-queue@webkit.org [Tue, 7 Feb 2017 13:46:30 +0000 (13:46 +0000)]
LayoutTest media/modern-media-controls/layout-node/addChild.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=167461

Unreviewed test gardening, this test is no longer flaky.

Patch by Antoine Quint <graouts@apple.com> on 2017-02-07

* platform/mac/TestExpectations:

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

4 years ago[mac-wk1] LayoutTest media/modern-media-controls/macos-inline-media-controls/macos...
commit-queue@webkit.org [Tue, 7 Feb 2017 13:22:31 +0000 (13:22 +0000)]
[mac-wk1] LayoutTest media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-buttons-styles.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=163598

Unreviewed test gardening, this test is no longer flaky.

Patch by Antoine Quint <graouts@apple.com> on 2017-02-07

* platform/mac-wk1/TestExpectations:

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

4 years agoRead stroke width of subtitles from MediaAccessibility framework.
pvollan@apple.com [Tue, 7 Feb 2017 13:09:06 +0000 (13:09 +0000)]
Read stroke width of subtitles from MediaAccessibility framework.
https://bugs.webkit.org/show_bug.cgi?id=167871
<rdar://problem/29265906>

Reviewed by Brent Fulgham.

Read MACaptionFontAttributeStrokeWidth from CTFontDescriptorRef.

* page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::CaptionUserPreferencesMediaAF::strokeWidth):
(WebCore::CaptionUserPreferencesMediaAF::captionsTextEdgeCSS):
* page/CaptionUserPreferencesMediaAF.h:
* platform/cf/MediaAccessibilitySoftLink.cpp:
* platform/cf/MediaAccessibilitySoftLink.h:

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

4 years ago[Modern Media Controls] Improve handling of <video> with only audio tracks
commit-queue@webkit.org [Tue, 7 Feb 2017 10:53:54 +0000 (10:53 +0000)]
[Modern Media Controls] Improve handling of <video> with only audio tracks
https://bugs.webkit.org/show_bug.cgi?id=167836
<rdar://problem/30255812>

Patch by Antoine Quint <graouts@apple.com> on 2017-02-07
Reviewed by Dean Jackson.

Source/WebCore:

We now check for the availability of video tracks before considering a <video>
element is displaying an actual video file and turning auto-hide on. We also
check that we have video tracks before enabling the fullscreen button. This
brings the behavior of a <video> pointing to a resource with no video tracks
to be the same as an <audio> element.

Test: media/modern-media-controls/media-controller/media-controller-video-with-only-audio.html

* Modules/modern-media-controls/media/controls-visibility-support.js:
(ControlsVisibilitySupport.prototype.get tracksToMonitor):
(ControlsVisibilitySupport.prototype._updateControls):
(ControlsVisibilitySupport):
* Modules/modern-media-controls/media/fullscreen-support.js:
(FullscreenSupport.prototype.syncControl):
(FullscreenSupport):

LayoutTests:

Add a new test to check that a <video> with a resource that only has audio tracks
does not auto-hide nor show the fullscreen button. We also rebaseline a few existing
tests for this change of behavior.

* fast/regions/inline-block-inside-anonymous-overflow-with-covered-controls-expected.html:
* fast/regions/inline-block-inside-anonymous-overflow-with-covered-controls.html:
* media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-on-expected.txt:
* media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-on.html:
* media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-toggle-expected.txt:
* media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-toggle.html:
* media/modern-media-controls/media-controller/media-controller-video-with-only-audio-expected.txt: Added.
* media/modern-media-controls/media-controller/media-controller-video-with-only-audio.html: Added.
* media/modern-media-controls/time-label/time-label-white-space-nowrap.html:

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

4 years ago[Readable Streams API] Implement ReadableByteStreamController enqueue()
commit-queue@webkit.org [Tue, 7 Feb 2017 09:00:10 +0000 (09:00 +0000)]
[Readable Streams API] Implement ReadableByteStreamController enqueue()
https://bugs.webkit.org/show_bug.cgi?id=167786

Patch by Romain Bellessort <romain.bellessort@crf.canon.fr> on 2017-02-07
Reviewed by Youenn Fablet.

Source/WebCore:

Implemented ReadableByteStreamController enqueue() method. Also replaced
@queue by an Array instead of a dedicated queue object (said object is
useful for ReadableStreamDefaultController, but not for ReadableByteStreamController).

Added 8 tests to cover newly added code as well as code that was previously unreachable.

* Modules/streams/ReadableByteStreamController.js:
(enqueue): Implemented as defined by spec.
* Modules/streams/ReadableByteStreamInternals.js:
(privateInitializeReadableByteStreamController): Updated @queue.
(readableByteStreamControllerCancel): Updated @queue.
(readableByteStreamControllerError): Updated @queue.
(readableByteStreamControllerPull): Updated @queue.
(readableByteStreamControllerEnqueue): Added.
(readableByteStreamControllerEnqueueChunkToQueue): Added.
* Modules/streams/ReadableStreamInternals.js:
(readableStreamFulfillReadRequest): Added (used at different places).

LayoutTests:

Added 8 tests to cover newly added code as well as code that was previously unreachable.

* streams/readable-byte-stream-controller-expected.txt:
* streams/readable-byte-stream-controller.js:

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

4 years agoObject.preventExtensions() on a Location object should throw a TypeError
cdumez@apple.com [Tue, 7 Feb 2017 08:51:09 +0000 (08:51 +0000)]
Object.preventExtensions() on a Location object should throw a TypeError
https://bugs.webkit.org/show_bug.cgi?id=167917

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Rebaseline web platform test now that one more check is passing.

* web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt:

Source/WebCore:

Object.preventExtensions() on a Location object should throw a TypeError:
- https://html.spec.whatwg.org/#location-preventextensions
- https://www.ecma-international.org/ecma-262/7.0/index.html#sec-object.preventextensions

Firefox already implements this.

No new tests, rebaselined existing tests.

* bindings/js/JSLocationCustom.cpp:
(WebCore::JSLocation::preventExtensions):

LayoutTests:

Rebaseline test now that more checks are passing.

* http/tests/security/preventExtensions-window-location-expected.txt:
* http/tests/security/preventExtensions-window-location.html:

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

4 years agoWeb Inspector: allow import() inside the inspector
utatane.tea@gmail.com [Tue, 7 Feb 2017 08:17:17 +0000 (08:17 +0000)]
Web Inspector: allow import() inside the inspector
https://bugs.webkit.org/show_bug.cgi?id=167457

Reviewed by Ryosuke Niwa.

Source/JavaScriptCore:

We relax import module hook to accept null SourceOrigin.
Such a script can be evaluated from the inspector console.

* jsc.cpp:
(GlobalObject::moduleLoaderImportModule):
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::globalFuncImportModule):

Source/WebCore:

When evaluating `import("...")`, we need the caller's context to resolve
the module specifier correctly. For example, if `import("./cocoa.js")` is
evaluated in the script "drinks/hot.js", this module name is resolved to
"drinks/cocoa.js". If the same import operator is evaluated in the script
"menu/all.js", the module specifier becomes "menu/cocoa.js".

Previously we reject the import operator if the caller does not have such
a context. These context is SourceOrigin and its ScriptFetcher. While they
are offered in the script tag and other code evaluations, the inspector
console does not offer that. These class are offered in the WebCore side
and we should not touch these classes in the JSC's inspector code.

Now we relax the above restriction. If the above caller information is not
offered, we fallback to the default one. In the web page, we use the page's
URL as the caller's source origin. This allows us to evaluate the import
operator in the inspector console.

And as of r167698, the console recognizes `await import("...")` form. We use
this to test this `import()` in the console functionality.

* bindings/js/ScriptModuleLoader.cpp:
(WebCore::ScriptModuleLoader::importModule):

LayoutTests:

* inspector/controller/resources/cappuccino.js: Added.
* inspector/controller/resources/cocoa.js: Added.
* inspector/controller/resources/drink.js: Added.
* inspector/controller/runtime-controller-expected.txt:
* inspector/controller/runtime-controller.html:

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

4 years agoMove platform-independent parts of ComplexTextController out of mac/ subfolder
mmaxfield@apple.com [Tue, 7 Feb 2017 08:14:06 +0000 (08:14 +0000)]
Move platform-independent parts of ComplexTextController out of mac/ subfolder
https://bugs.webkit.org/show_bug.cgi?id=167922

Reviewed by Jon Lee.

Just a mechanical git mv, and updating the Xcode projects.

No new tests because there is no behavior change.

* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/ComplexTextController.cpp: Renamed from Source/WebCore/platform/graphics/mac/ComplexTextController.cpp.
* platform/graphics/ComplexTextController.h: Renamed from Source/WebCore/platform/graphics/mac/ComplexTextController.h.

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

4 years agoOverlay scrolling with iframe-s broken
carlosgc@webkit.org [Tue, 7 Feb 2017 06:45:43 +0000 (06:45 +0000)]
Overlay scrolling with iframe-s broken
https://bugs.webkit.org/show_bug.cgi?id=165056

Reviewed by Antonio Gomes.

Source/WebCore:

Mouse press events for overlay scrollbars are ignored if there's a subframe under the scrollbar. This doesn't
happen with normal scrollbars, because the subframe is not really under the scrollbar, so events are always
correctly passed to the scrollbar. With overlay scrollbars, the hit test detects the scrollbar, but events are
always passed first to the subframe. Scrollbars are correctly updated on hover though, because
handleMouseMoveEvent checks the presence of scrollbars before checking for subframes and move events are
actually passed to both, the scrollbar and the subframe. Overlay scrollbars should always take precedence over
subframes to handle mouse press events, so we should check first if mouse is over a scrollbar and never pass the
event to a subframe in that case. Another problem is that the cursor is not updated either when the overlay
scrollbar is hovered and there's a subframe. This is because in handleMouseMoveEvent we pass the event to both
the scrollbar and subframe but we never update the cursor when a suframe was found. So, here again we need to make
an exception for scrollbars and upate the cursor when mouse is over the scrollbar even if a subframe was found.

Test: fast/scrolling/scroll-animator-overlay-scrollbars-clicked.html

* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent): Move the scrollbar check before the subframe check.
(WebCore::EventHandler::handleMouseMoveEvent): Update the cursor when hovering a scrollbar even if a subframe
was found.
(WebCore::EventHandler::updateLastScrollbarUnderMouse): Use an enum instead of a boolean for setLast parameter.
* page/EventHandler.h:

LayoutTests:

Add a new test to check that clicking on an overlay scrollbar works even it's over a subframe.

* fast/scrolling/scroll-animator-overlay-scrollbars-clicked-expected.txt: Added.
* fast/scrolling/scroll-animator-overlay-scrollbars-clicked.html: Added.
* platform/ios-simulator/TestExpectations:
* platform/mac-wk1/TestExpectations:

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

4 years ago[GTK] jhbuild fails: mesa-11.0.6.tar.xz: 404 Not Found
commit-queue@webkit.org [Tue, 7 Feb 2017 06:34:26 +0000 (06:34 +0000)]
[GTK] jhbuild fails: mesa-11.0.6.tar.xz: 404 Not Found
https://bugs.webkit.org/show_bug.cgi?id=167916

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-02-06
Reviewed by Carlos Garcia Campos.

URL of mesa-11.0.6.tar.xz has been moved.

* gtk/jhbuild.modules: Fix the module path.

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

4 years ago[Soup] Long resources loaded by custom protocols sometimes never finish loading
carlosgc@webkit.org [Tue, 7 Feb 2017 06:12:53 +0000 (06:12 +0000)]
[Soup] Long resources loaded by custom protocols sometimes never finish loading
https://bugs.webkit.org/show_bug.cgi?id=167890

Reviewed by Michael Catanzaro.

It's another bug that has appeared in WebKitSoupRequestInputStream after moving the custom protocols handling to
the main thread. The problem is that webkitSoupRequestInputStreamPendingReadAsyncComplete invalidates
pendingAsyncRead after calling webkitSoupRequestInputStreamReadAsyncResultComplete, but in some cases
webkitSoupRequestInputStreamReadAsyncResultComplete completes the task in the same run loop iteration. In that
case webkitSoupRequestInputStreamReadAsync is called again creating a new AsyncReadData that is destroyed right
after webkitSoupRequestInputStreamReadAsyncResultComplete returns.

* WebProcess/soup/WebKitSoupRequestInputStream.cpp:
(AsyncReadData::AsyncReadData): Use an rvalue reference for the task.
(webkitSoupRequestInputStreamPendingReadAsyncComplete): Use WTFMove to ensure pendingAsyncRead is cleared before
webkitSoupRequestInputStreamReadAsyncResultComplete is called, and continue processing pending requests if there
are new ones after webkitSoupRequestInputStreamReadAsyncResultComplete.
(webkitSoupRequestInputStreamReadAsync): Use WTFMove to transfer the task to AsyncReadData.
(webkitSoupRequestInputStreamDidFailWithError): Use WTFMove to ensure pendingAsyncRead is cleared.

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

4 years agoSymbols exposed on cross-origin Window / Location objects should be configurable
cdumez@apple.com [Tue, 7 Feb 2017 04:47:13 +0000 (04:47 +0000)]
Symbols exposed on cross-origin Window / Location objects should be configurable
https://bugs.webkit.org/show_bug.cgi?id=167920

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Rebaseline web platform test now that more checks are passing.

* web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt:

Source/WebCore:

Symbols exposed on cross-origin Window / Location objects should be configurable:
- https://html.spec.whatwg.org/#crossorigingetownpropertyhelper-(-o,-p-) (Step 1)

Firefox behaves as per specification.

No new tests, rebaselined existing test.

* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
* bindings/js/JSLocationCustom.cpp:
(WebCore::JSLocation::getOwnPropertySlotDelegate):

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

4 years agoWeb Inspector: Do not use RunLoop when dispatching inspector GC event
commit-queue@webkit.org [Tue, 7 Feb 2017 04:27:05 +0000 (04:27 +0000)]
Web Inspector: Do not use RunLoop when dispatching inspector GC event
https://bugs.webkit.org/show_bug.cgi?id=167683
<rdar://problem/30167791>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-02-06
Reviewed by Brian Burg.

Source/JavaScriptCore:

Move the RunLoop deferred implementation to WebCore. It is not needed
for JSContext inspection, and in JSContext inspection we are not
guarenteed a RunLoop to defer to.

* inspector/agents/InspectorHeapAgent.h:
* inspector/agents/InspectorHeapAgent.cpp:
(Inspector::InspectorHeapAgent::InspectorHeapAgent):
(Inspector::InspectorHeapAgent::~InspectorHeapAgent):
(Inspector::InspectorHeapAgent::disable):
(Inspector::InspectorHeapAgent::didGarbageCollect):
(Inspector::SendGarbageCollectionEventsTask::SendGarbageCollectionEventsTask): Deleted.
(Inspector::SendGarbageCollectionEventsTask::addGarbageCollection): Deleted.
(Inspector::SendGarbageCollectionEventsTask::reset): Deleted.
(Inspector::SendGarbageCollectionEventsTask::timerFired): Deleted.

(Inspector::InspectorHeapAgent::dispatchGarbageCollectedEvent):
Make a virtual method so that WebCore implementations of this agent can choose
to dispatch this event asynchronously.

* inspector/agents/InspectorScriptProfilerAgent.cpp:
Remove unnecessary RunLoop include.

Source/WebCore:

Covered by existing tests.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* inspector/InspectorAllInOne.cpp:
Add new file.

* inspector/PageHeapAgent.cpp:
(WebCore::PageHeapAgent::PageHeapAgent):
(WebCore::PageHeapAgent::enable):
(WebCore::PageHeapAgent::disable):
* inspector/PageHeapAgent.h:
Extend WebHeapAgent.

* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::WorkerInspectorController):
Use WebHeapAgent.

* inspector/WebHeapAgent.cpp: Added.
(WebCore::SendGarbageCollectionEventsTask::SendGarbageCollectionEventsTask):
(WebCore::SendGarbageCollectionEventsTask::addGarbageCollection):
(WebCore::SendGarbageCollectionEventsTask::reset):
(WebCore::SendGarbageCollectionEventsTask::timerFired):
(WebCore::WebHeapAgent::WebHeapAgent):
(WebCore::WebHeapAgent::~WebHeapAgent):
(WebCore::WebHeapAgent::disable):
(WebCore::WebHeapAgent::dispatchGarbageCollectedEvent):
(WebCore::WebHeapAgent::dispatchGarbageCollectionEventsAfterDelay):
* inspector/WebHeapAgent.h:
Move the defered event dispatch from InspectorHeapAgent here where a RunLoop is guarenteed.

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

4 years ago[iOS] -[WKWebView becomeFirstResponder] and -[WKWebView resignFirstResponder] don...
mitz@apple.com [Tue, 7 Feb 2017 04:23:52 +0000 (04:23 +0000)]
[iOS] -[WKWebView becomeFirstResponder] and -[WKWebView resignFirstResponder] don’t get called when non-programmatic first responder changes happen
https://bugs.webkit.org/show_bug.cgi?id=167898

Reviewed by Tim Horton.

Made WKContentView’s -becomeFirstResponder and -resignFirstResponder forward to the
WKWebView, giving subclasses an opportunity to override these methods. Changed the WKWebView
implementations to call back into WKContentView methods that actually do the work.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView becomeFirstResponder]): If the current content view is a WKContentView, call
  -becomeFirstResponderForWebView. Added a check that the content view has a superview to
  get the right behavior when this is called during the transition from not having to having
  a custom content view.
(-[WKWebView canBecomeFirstResponder]): If the current content view is a WKContentView, call
  -canBecomeFirstResponderForWebView.
(-[WKWebView resignFirstResponder]): If the current content view is a WKContentView, call
  -resignFirstResponderForWebView.
(-[WKWebView _setHasCustomContentView:loadedMIMEType:]): If the new content view is a
  WKContentView, use -canBecomeFirstResponderForWebView.

* UIProcess/ios/WKContentViewInteraction.h: Added _becomingFirstResponder ivar.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView canBecomeFirstResponder]): Return _becomingFirstResponder. Normally this is
  NO, so code that hit-tests then walks up the view hierarchy to select a first responder
  will continue to the WKWebView. But we need to return YES around the call to super’s
  -becomeFirstResponder in -becomeFirstResponderForWebView.
(-[WKContentView canBecomeFirstResponderForWebView]): Moved the old
  -becomeFirstResponderForWebView implementation here.
(-[WKContentView becomeFirstResponder]): Forward to the WKWebView.
(-[WKContentView becomeFirstResponderForWebView]): Moved the old -becomeFirstResponder
  implementation here, setting _becomingFirstResponder to YES around the call to super.
(-[WKContentView resignFirstResponder]): Forward to the WKWebView.
(-[WKContentView resignFirstResponderForWebView]): Moved the old -resignFirstResponder
  implementation here.

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

4 years agoStatic Analyzer: Address some leaks in MiniBrowser
commit-queue@webkit.org [Tue, 7 Feb 2017 04:19:24 +0000 (04:19 +0000)]
Static Analyzer: Address some leaks in MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=167897

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-02-06
Reviewed by Alexey Proskuryakov.

* MiniBrowser/mac/BrowserWindowController.m:
(-[BrowserWindowController sharingService:transitionImageForShareItem:contentRect:]):
* MiniBrowser/mac/ExtensionManagerWindowController.m:
(-[ExtensionManagerWindowController add:]):
(-[ExtensionManagerWindowController remove:]):
* MiniBrowser/mac/SettingsController.m:
(-[SettingsController _populateMenu]):
(-[SettingsController togglePerWindowWebProcessesDisabled:]):
Address obvious leaks caught by the static analyzer.

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

4 years agoExtendedColor leaks seen on leaks bot
commit-queue@webkit.org [Tue, 7 Feb 2017 02:40:01 +0000 (02:40 +0000)]
ExtendedColor leaks seen on leaks bot
https://bugs.webkit.org/show_bug.cgi?id=167912

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-02-06
Reviewed by Alexey Proskuryakov.

* platform/graphics/Color.cpp:
(WebCore::Color::operator=):
Before overwriting m_colorData, we must deref the extended color inside it.

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

4 years agoRemove assertion in WebViewImpl::performKeyEquivalent()
simon.fraser@apple.com [Tue, 7 Feb 2017 02:19:57 +0000 (02:19 +0000)]
Remove assertion in WebViewImpl::performKeyEquivalent()

Reviewed by Wenson Hsieh.

The assertion ASSERT(event == [NSApp currentEvent]) fires when using certain key combinations
in MiniBrowser's location field (e.g. Option-Shift-Arrow to select). The assertion is not correct,
so remove it.

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

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

4 years agoRe-land r210095 (avoid a tile revalidation on scale change)
simon.fraser@apple.com [Tue, 7 Feb 2017 02:19:54 +0000 (02:19 +0000)]
Re-land r210095 (avoid a tile revalidation on scale change)
https://bugs.webkit.org/show_bug.cgi?id=167866

Reviewed by Tim Horton.

r210095 was rolled out in r211230 but now that all TileControllers unparent
offscreen tiles, we can roll it back it.

Also add more Tiling logging.

* platform/graphics/ca/TileGrid.cpp:
(WebCore::validationPolicyAsString):
(WebCore::TileGrid::setScale):
(WebCore::TileGrid::prepopulateRect):
(WebCore::TileGrid::revalidateTiles):
(WebCore::TileGrid::ensureTilesForRect):

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

4 years agoMigrate ComplexTextController to use platform-independent types
mmaxfield@apple.com [Tue, 7 Feb 2017 02:14:53 +0000 (02:14 +0000)]
Migrate ComplexTextController to use platform-independent types
https://bugs.webkit.org/show_bug.cgi?id=167833

Reviewed by Brent Fulgham.

Source/WebCore:

ComplexTextController will eventually be used on all ports to perform complex text layout.
This is a mechanical patch which migrates the shared parts of ComplexTextController away from
using CoreGraphics and CoreFoundation types in favor of WebCore/platform types. Eventually,
ComplexTextController will get moved to PAL but there is a layering violation (TextLayout) to
fix first.

No new tests because there is no behavior change.

* platform/graphics/GlyphBuffer.h:
(WebCore::GlyphBufferAdvance::GlyphBufferAdvance):
* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::ComplexTextController::offsetForPosition):
(WebCore::advanceByCombiningCharacterSequence):
(WebCore::ComplexTextController::ComplexTextRun::indexAt):
(WebCore::ComplexTextController::ComplexTextRun::setIsNonMonotonic):
(WebCore::ComplexTextController::advance):
(WebCore::ComplexTextController::adjustGlyphsAndAdvances):
* platform/graphics/mac/ComplexTextController.h:
(WebCore::ComplexTextController::ComplexTextRun::create):
(WebCore::ComplexTextController::ComplexTextRun::stringLength):
(WebCore::ComplexTextController::ComplexTextRun::indexBegin):
(WebCore::ComplexTextController::ComplexTextRun::indexEnd):
(WebCore::ComplexTextController::ComplexTextRun::endOffsetAt):
(WebCore::ComplexTextController::ComplexTextRun::glyphs):
(WebCore::ComplexTextController::ComplexTextRun::growInitialAdvanceHorizontally):
(WebCore::ComplexTextController::ComplexTextRun::initialAdvance):
(WebCore::ComplexTextController::ComplexTextRun::baseAdvances):
(WebCore::ComplexTextController::ComplexTextRun::glyphOrigins):
(WebCore::ComplexTextController::glyphOrigin):
(WebCore::ComplexTextController::ComplexTextRun::createForTesting): Deleted.
* platform/graphics/mac/ComplexTextControllerCoreText.mm:
(SOFT_LINK):
(WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters):

Tools:

Migrate tests away from platform-dependent types.

* TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp:
(TestWebKitAPI::TEST_F):

LayoutTests:

Rebaseline tiny rounding result.

* platform/mac/fast/text/complex-text-opacity-expected.txt:

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

4 years ago[iOS WK2] Keep the tiled scrolling indicator on-screen when pinching
simon.fraser@apple.com [Tue, 7 Feb 2017 02:08:37 +0000 (02:08 +0000)]
[iOS WK2] Keep the tiled scrolling indicator on-screen when pinching
https://bugs.webkit.org/show_bug.cgi?id=167915

Reviewed by Tim Horton.

Clamp the location to the larger of the location of .unobscuredContentRect() and 0,0.

* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorLocation):

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

4 years agoCorrect File Path Handling in SecurityOrigin and FileSystem
bfulgham@apple.com [Tue, 7 Feb 2017 01:48:22 +0000 (01:48 +0000)]
Correct File Path Handling in SecurityOrigin and FileSystem
https://bugs.webkit.org/show_bug.cgi?id=167894
<rdar://problem/30380080>

Reviewed by Alexey Proskuryakov.

Source/WebCore:

Roll out the URL decoding being done in the FileSystem class (added in Bug 167894), and instead ensure that
SecurityOrigin properly handles file URLs, and only passes valid file strings to the FileSystem interface.

Tested by FileSystemTests and SecurityOriginTests in TestWebKitAPI.

* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::SecurityOrigin): Initialize m_filePath using the url's fileSystemPath, not
the %-encoded 'path' property.
(WebCore::SecurityOrigin::canDisplay): Pass the 'fileSystemPath' to 'filesHaveSameVolume', rather than
the %-encoded 'path' property.
* page/SecurityOrigin.h:
* platform/FileSystem.cpp:
(WebCore::filesHaveSameVolume): Do not use 'decodeURLEscapeSequences' in 'filesHaveSameVolume'.

Tools:

* TestWebKitAPI/Tests/WebCore/FileSystem.cpp: Don't encode the temporary files,
and perform same-volume checks using filesystem-compatible paths.
* TestWebKitAPI/Tests/WebCore/SecurityOrigin.cpp: Create SecurityOrigins from
filesystem paths, and perform validation of same-volume checks.
(TestWebKitAPI::SecurityOriginTest::tempFilePath): Added.
(TestWebKitAPI::SecurityOriginTest::spaceContainingFilePath): Added.
(TestWebKitAPI::SecurityOriginTest::bangContainingFilePath): Added.
(TestWebKitAPI::SecurityOriginTest::quoteContainingFilePath): Added.

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

4 years ago[Cocoa] Split FileSystemMac.mm into Mac and Cocoa parts
aestes@apple.com [Tue, 7 Feb 2017 01:39:45 +0000 (01:39 +0000)]
[Cocoa] Split FileSystemMac.mm into Mac and Cocoa parts
https://bugs.webkit.org/show_bug.cgi?id=167908

Reviewed by Sam Weinig.

Kept the Mac-only functions in FileSystemMac.mm and moved the rest into FileSystemCocoa.mm.

* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
* platform/cocoa/FileSystemCocoa.mm: Copied from Source/WebCore/platform/mac/FileSystemMac.mm.
* platform/mac/FileSystemMac.mm:
(-[WebFileManagerDelegate fileManager:shouldProceedAfterError:movingItemAtURL:toURL:]): Moved to FileSystemCocoa.mm.
(WebCore::homeDirectoryPath): Ditto.
(WebCore::openTemporaryFile): Ditto.
(WebCore::moveFile): Ditto.
(WebCore::getVolumeFreeSpace): Ditto.

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

4 years ago[MediaStream Mac] Remove some unused code
eric.carlson@apple.com [Tue, 7 Feb 2017 01:33:41 +0000 (01:33 +0000)]
[MediaStream Mac] Remove some unused code
https://bugs.webkit.org/show_bug.cgi?id=167913

Reviewed by Jer Noble.

No new tests, no functional change.

* platform/mediastream/CaptureDeviceManager.h:
(WebCore::CaptureSessionInfo::~CaptureSessionInfo): Deleted.
(WebCore::CaptureSessionInfo::supportsVideoSize): Deleted.
(WebCore::CaptureSessionInfo::bestSessionPresetForVideoDimensions): Deleted.
* platform/mediastream/mac/AVCaptureDeviceManager.h:
* platform/mediastream/mac/AVCaptureDeviceManager.mm:
(WebCore::AVCaptureDeviceManager::refreshCaptureDeviceList):
(WebCore::AVCaptureSessionInfo::AVCaptureSessionInfo): Deleted.
(WebCore::AVCaptureSessionInfo::supportsVideoSize): Deleted.
(WebCore::AVCaptureSessionInfo::bestSessionPresetForVideoDimensions): Deleted.
* platform/mediastream/mac/AVMediaCaptureSource.mm:
(WebCore::AVMediaCaptureSource::AVMediaCaptureSource):

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

4 years agoTiled scrolling indicator gets doubled up on navigation
simon.fraser@apple.com [Tue, 7 Feb 2017 01:20:05 +0000 (01:20 +0000)]
Tiled scrolling indicator gets doubled up on navigation
https://bugs.webkit.org/show_bug.cgi?id=167909

Reviewed by Tim Horton.

TiledCoreAnimationDrawingArea::updateDebugInfoLayer() would parent a new m_debugInfoLayer
in m_hostingLayer without removing the old one, causing the old tiled scrolling indicator layer
hierarchy to get left in the layer tree.

Also a couple of nullptr/0 -> nil.

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
(WebKit::TiledCoreAnimationDrawingArea::updateDebugInfoLayer):

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

4 years agoAllow some schemes to opt-out of CORS
commit-queue@webkit.org [Tue, 7 Feb 2017 00:25:00 +0000 (00:25 +0000)]
Allow some schemes to opt-out of CORS
https://bugs.webkit.org/show_bug.cgi?id=167795

Patch by Youenn Fablet <youennf@gmail.com> on 2017-02-06
Reviewed by Alex Christensen.

Source/WebCore:

Test: http/tests/security/bypassing-cors-checks-for-extension-urls.html

Adding the possibility to opt out of CORS for DocumentThreadableLoader clients (fetch and XHR).
This is made specific to the case of user extension URLs for pages running user scripts.
Introducing a boolean flag in Page for that purpose.
Introducing a helper routine in SchemeRegistry to centralize the various user script extension schemes.

* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
* page/Frame.cpp:
(WebCore::Frame::injectUserScripts):
* page/Page.h:
(WebCore::Page::setAsRunningUserScripts):
(WebCore::Page::isRunningUserScripts):
* platform/SchemeRegistry.cpp:
(WebCore::SchemeRegistry::isUserExtensionScheme):
* platform/SchemeRegistry.h:
* testing/Internals.cpp:
(WebCore::Internals::setAsRunningUserScripts):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* http/tests/security/bypassing-cors-checks-for-extension-urls-expected.txt: Added.
* http/tests/security/bypassing-cors-checks-for-extension-urls.html: Added.

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

4 years agoMore build fixes after r211751
achristensen@apple.com [Mon, 6 Feb 2017 23:56:09 +0000 (23:56 +0000)]
More build fixes after r211751
https://bugs.webkit.org/show_bug.cgi?id=166998

* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
(WebKit::NetworkDataTaskSoup::authenticate):
(WebKit::NetworkDataTaskSoup::continueAuthenticate):
(WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
Use the correct partition for credentials.

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

4 years agoAlign [[OwnPropertyKeys]] with the HTML specification for cross-origin Window / Locat...
cdumez@apple.com [Mon, 6 Feb 2017 23:50:39 +0000 (23:50 +0000)]
Align [[OwnPropertyKeys]] with the HTML specification for cross-origin Window / Location objects
https://bugs.webkit.org/show_bug.cgi?id=167647
<rdar://problem/30339489>

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

Rebaseline web platform test now that more checks are passing.

* web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt:

Source/WebCore:

Align [[OwnPropertyKeys]] with the HTML specification for cross-origin Window / Location objects:
- https://html.spec.whatwg.org/#windowproxy-ownpropertykeys [1]
- https://html.spec.whatwg.org/#crossoriginownpropertykeys-(-o-) [2]
- https://html.spec.whatwg.org/#crossoriginproperties-(-o-) [3]

In particular, the following changes were made:
- Location:
  - We now return the following symbols as well: @@toStringTag, @@hasInstance,
    @@isConcatSpreadable as per [2].
- Window:
  - We now return the following symbols as well: @@toStringTag, @@hasInstance,
    @@isConcatSpreadable as per [2].
  - We now return the indices of the child browsing contexts as per [1].
  - We now return the names of the child browsing contexts as per [3].

No new tests, updated / rebaselined existing tests.

* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
Index properties should be configurable as per:
- https://html.spec.whatwg.org/#windowproxy-getownproperty (step 2.5)

(WebCore::inScope):
(WebCore::addScopedChildrenNames):
(WebCore::addCrossOriginPropertyNames):
(WebCore::addScopedChildrenIndexes):
(WebCore::addCrossOriginOwnPropertyNames):
(WebCore::JSDOMWindow::getOwnPropertyNames):
* bindings/js/JSLocationCustom.cpp:
(WebCore::addCrossOriginPropertyNames):
(WebCore::addCrossOriginOwnPropertyNames):
(WebCore::JSLocation::getOwnPropertyNames):

LayoutTests:

Extend test coverage for [[OwnPropertyKeys]] for cross-origin Window / Location objects.

* http/tests/security/cross-frame-access-enumeration-expected.txt:
* http/tests/security/cross-frame-access-enumeration.html:
* http/tests/security/resources/cross-frame-iframe-for-enumeration-test.html:
* js/dom/getOwnPropertyDescriptor-expected.txt:
* js/resources/getOwnPropertyDescriptor.js:

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

4 years agohttp/tests/preload/dynamic_removing_preload.html fails to test what it should
yoav@yoav.ws [Mon, 6 Feb 2017 23:47:51 +0000 (23:47 +0000)]
http/tests/preload/dynamic_removing_preload.html fails to test what it should
https://bugs.webkit.org/show_bug.cgi?id=167792

Reviewed by Ryosuke Niwa.

Source/WebCore:

Cancel the link preload resource load when the link element is removed from the DOM.

No new tests, but unskipping an existing test: http/tests/preload/dynamic_removing_preload.html

* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::removedFrom): Call m_linkLoader.cancelLoad().
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::cancelLoad): Clear m_preloadResourceClient.
* loader/LinkLoader.h:
* loader/LinkPreloadResourceClients.h:
(WebCore::LinkPreloadResourceClient::clearResource): Call m_resource->cancelLoad().
* loader/SubresourceLoader.cpp:
(WebCore::LinkPreloadResourceClient::didFinishLoading): Change ASSERT to exempt cancelled loads.

LayoutTests:

* TestExpectations: Unskip dynamic_removing_preload.html
* http/tests/preload/dynamic_removing_preload-expected.txt:
* http/tests/preload/dynamic_removing_preload.html: Switch test to use ResourceTiming.

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

4 years agoMore build fixes after r211751
achristensen@apple.com [Mon, 6 Feb 2017 23:47:26 +0000 (23:47 +0000)]
More build fixes after r211751
https://bugs.webkit.org/show_bug.cgi?id=166998

Source/WebCore:

* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::applyAuthenticationToRequest):
* platform/network/soup/SocketStreamHandleImplSoup.cpp:
(WebCore::SocketStreamHandleImpl::create):

Source/WebKit/win:

* WebDownloadCFNet.cpp:
(WebDownload::didReceiveAuthenticationChallenge):

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

4 years agoFix non-cocoa builds after r211751.
achristensen@apple.com [Mon, 6 Feb 2017 23:27:48 +0000 (23:27 +0000)]
Fix non-cocoa builds after r211751.
https://bugs.webkit.org/show_bug.cgi?id=166998

* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::ResourceHandle::createCFURLConnection):
(WebCore::ResourceHandle::willSendRequest):
(WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication):
(WebCore::ResourceHandle::receivedCredential):
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::receivedCredential):
* platform/network/curl/ResourceHandleManager.cpp:
(WebCore::ResourceHandleManager::applyAuthenticationToRequest):
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::applyAuthenticationToRequest):
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::receivedCredential):

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

4 years agoUpdate sandbox to allow CoreMedia to perform custom media loading.
jer.noble@apple.com [Mon, 6 Feb 2017 23:02:51 +0000 (23:02 +0000)]
Update sandbox to allow CoreMedia to perform custom media loading.
https://bugs.webkit.org/show_bug.cgi?id=167700

Reviewed by Alexey Proskuryakov.

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

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

4 years agocredentials should be partitioned by main document domain
achristensen@apple.com [Mon, 6 Feb 2017 22:45:23 +0000 (22:45 +0000)]
credentials should be partitioned by main document domain
https://bugs.webkit.org/show_bug.cgi?id=166998
Source/WebCore:

rdar://problem/22901123

Reviewed by Brady Eidson.

Covered by http/tests/security/credentials-iframes.html
Also added http/tests/security/credentials-from-different-domains.html to verify existing behavior without iframes.

* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::connect):
* dom/Document.h:
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::domainForCachePartition):
Return emptyString instead of a null String because it is used as a key in a HashMap, and hashing null strings dereferences null.
* page/SocketProvider.cpp:
(WebCore::SocketProvider::createSocketStreamHandle):
* page/SocketProvider.h:
* platform/network/CredentialStorage.cpp:
(WebCore::CredentialStorage::set):
(WebCore::CredentialStorage::get):
(WebCore::CredentialStorage::remove):
* platform/network/CredentialStorage.h:
Partition credentials.
* platform/network/ResourceHandleInternal.h:
(WebCore::ResourceHandleInternal::ResourceHandleInternal):
* platform/network/cf/SocketStreamHandleImpl.h:
(WebCore::SocketStreamHandleImpl::create):
* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
(WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):
(WebCore::SocketStreamHandleImpl::getStoredCONNECTProxyCredentials):
* platform/network/curl/SocketStreamHandleImpl.h:
(WebCore::SocketStreamHandleImpl::create):
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::createNSURLConnection):
(WebCore::ResourceHandle::willSendRequest):
(WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication):
(WebCore::ResourceHandle::receivedCredential):
* platform/network/soup/SocketStreamHandleImpl.h:

Source/WebKit/mac:

rdar://problem/22901123

Reviewed by Brady Eidson.

* Misc/WebDownload.mm:
* Plugins/WebBaseNetscapePluginView.mm:
(WebKit::getAuthenticationInfo):
Don't use partitioned credentials for WebKit1 plugins or downloads.
Downloads should be authenticated before becoming a download anyways.

Source/WebKit2:

rdar://problem/22901123

Reviewed by Brady Eidson.

* NetworkProcess/NetworkDataTask.cpp:
(WebKit::NetworkDataTask::NetworkDataTask):
* NetworkProcess/NetworkDataTask.h:
(WebKit::NetworkDataTask::partition):
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
(WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
(WebKit::NetworkDataTaskCocoa::tryPasswordBasedAuthentication):
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
* WebProcess/Network/WebSocketProvider.cpp:
(WebKit::WebSocketProvider::createSocketStreamHandle):
* WebProcess/Network/WebSocketProvider.h:
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::getAuthenticationInfo):

LayoutTests:

<rdar://problem/22901123>

Reviewed by Brady Eidson.

* http/tests/security/credentials-from-different-domains-expected.txt: Added.
* http/tests/security/credentials-from-different-domains.html: Added.
* http/tests/security/credentials-iframes-expected.txt: Added.
* http/tests/security/credentials-iframes.html: Added.
* http/tests/security/resources/cors-basic-auth.php: Added.
* http/tests/security/resources/credentials-from-different-domains-continued-1.html: Added.
* http/tests/security/resources/credentials-from-different-domains-continued-2.html: Added.
* http/tests/security/resources/credentials-iframes-continued.html: Added.
* http/tests/security/resources/credentials-iframes-different-domain.html: Added.
* http/tests/security/resources/credentials-iframes-same-domain.html: Added.
* platform/mac-wk1/http: Added.
* platform/mac-wk1/http/security: Added.
* platform/mac-wk1/http/security/credentials-iframes-expected.txt: Added.
DumpRenderTree prints out the entire URL of the authentication challenge.
WebKitTestRunner only prints out the host and port.
Both results show the fact that no credentials were sent on the second request.

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

4 years agoSafari pages are blank sometimes (missing tiles)
simon.fraser@apple.com [Mon, 6 Feb 2017 22:33:42 +0000 (22:33 +0000)]
Safari pages are blank sometimes (missing tiles)
https://bugs.webkit.org/show_bug.cgi?id=167904

Reviewed by Tim Horton.

Source/WebCore:

After r211683 we failed to udpate the "inWindow" flag on the page tiled layer, because
usingTiledBacking() on GraphicsLayer confusingly was false for the page tiled layer.

Fix by removing usingTiledBacking() entirely, and checking for tiledBacking(),
looking at the layer type when necessary.

Tested by tiled-drawing/tiled-backing-in-window.html

* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::GraphicsLayer):
(WebCore::GraphicsLayer::setIsInWindowIncludingDescendants): This is the bug fix.
(WebCore::GraphicsLayer::getDebugBorderInfo):
(WebCore::GraphicsLayer::dumpProperties):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::usingTiledBacking): Deleted.
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::recursiveCommitChanges):
(WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
(WebCore::GraphicsLayerCA::changeLayerTypeTo):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::willDestroyLayer):
(WebCore::RenderLayerBacking::compositingLayerType):
* rendering/RenderLayerCompositor.cpp: A bit more logging.
(WebCore::RenderLayerCompositor::setIsInWindow):
(WebCore::RenderLayerCompositor::attachRootLayer):

LayoutTests:

New result; this test detected the bug.

* tiled-drawing/tiled-backing-in-window-expected.txt:

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

4 years ago[WebRTC] Remove unneeded build directory accidentally checked in with libwebrtc source.
achristensen@apple.com [Mon, 6 Feb 2017 22:20:53 +0000 (22:20 +0000)]
[WebRTC] Remove unneeded build directory accidentally checked in with libwebrtc source.

Reviewed by Youenn Fablet.

* third_party/usrsctp/build: Removed.

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

4 years agoChange the CSS animation timer a to be little more than 60fps to ensure we hit that...
commit-queue@webkit.org [Mon, 6 Feb 2017 21:58:41 +0000 (21:58 +0000)]
Change the CSS animation timer a to be little more than 60fps to ensure we hit that frame rate
https://bugs.webkit.org/show_bug.cgi?id=167825

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

The system timer fires little bit slower than 60fps. This might cause the
frame to be missed and hence it can lower the frame rate significantly. The
rAF timer was set to 15ms for the same reason. So set the repeated CSS
animation timer also to 15ms.

* page/animation/CSSAnimationController.cpp:

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

4 years agoCrash child processes if they receive an invalid message
andersca@apple.com [Mon, 6 Feb 2017 21:49:54 +0000 (21:49 +0000)]
Crash child processes if they receive an invalid message
https://bugs.webkit.org/show_bug.cgi?id=167900

Reviewed by Dan Bernstein.

Previously, some processes would try to gracefully exit, others would just drop messages leading to weird bugs.
Instead, set app-specific crash information to the message that failed to be decoded, and then crash.

* DatabaseProcess/DatabaseProcess.cpp:
(WebKit::DatabaseProcess::didReceiveInvalidMessage): Deleted.
* DatabaseProcess/DatabaseProcess.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::didReceiveInvalidMessage): Deleted.
* NetworkProcess/NetworkProcess.h:
* PluginProcess/PluginProcess.cpp:
(WebKit::PluginProcess::didReceiveInvalidMessage): Deleted.
* PluginProcess/PluginProcess.h:
* Shared/ChildProcess.h:
* Shared/Cocoa/ChildProcessCocoa.mm: Added.
(WebKit::ChildProcess::didReceiveInvalidMessage):
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::didReceiveInvalidMessage): Deleted.
* WebProcess/WebProcess.h:

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

4 years agoPlayback stalls when a SourceBuffer append causes frame eviction
jer.noble@apple.com [Mon, 6 Feb 2017 21:49:24 +0000 (21:49 +0000)]
Playback stalls when a SourceBuffer append causes frame eviction
https://bugs.webkit.org/show_bug.cgi?id=167834

Reviewed by Eric Carlson.

PerformanceTests:

Add an in-page performance test measuring the amount of time required
to append a large amount of media data to a SourceBuffer, and then to
completely remove that data 30s at a time.

Add a microbenchmark for MediaTime which measures the amount of time
required to create a 1M entry std::map and traverse the map 1M times.

* Media/MSERemoveCodedFrames.html: Added.
* Media/media-source-loader.js:
(MediaSourceLoader.prototype.get duration):
* MediaTime/Configurations/Base.xcconfig: Added.
* MediaTime/Configurations/DebugRelease.xcconfig: Added.
* MediaTime/Makefile: Added.
* MediaTime/MediaTime.xcodeproj/project.pbxproj: Added.
* MediaTime/main.cpp: Added.
(performTest):
(test):
(main):
* Skipped:

Source/WebCore:

Test: PerformanceTests/Media/MSERemoveCodedFrames.html

Optimize searching through SampleMap by presentationTime.

Many of the methods exposed by PresentationOrderSampleMap used the bare  std::equal_range,
lower_bound, or upper_bound methods. Unlike those methods exposed on std::map, the bare
search methods perform a linear O(n) search, rather than a the binary O(log(n)) search used
by std::map. Rewrite those methods using the bare methods in terms of the std::map search
methods.

Drive-by fix: rename findSampleOnOrAfterPresentationTime to
findSampleStartingOnOrAfterPresentationTime to make the behavior of the method more
explicit.

* Modules/mediasource/SampleMap.cpp:
(WebCore::PresentationOrderSampleMap::findSampleContainingPresentationTime):
(WebCore::PresentationOrderSampleMap::findSampleStartingOnOrAfterPresentationTime):
(WebCore::PresentationOrderSampleMap::reverseFindSampleBeforePresentationTime):
(WebCore::DecodeOrderSampleMap::findSyncSampleAfterPresentationTime):
(WebCore::PresentationOrderSampleMap::findSamplesBetweenPresentationTimes):
(WebCore::PresentationOrderSampleMap::findSamplesWithinPresentationRange):
(WebCore::PresentationOrderSampleMap::findSampleOnOrAfterPresentationTime): Deleted.
* Modules/mediasource/SampleMap.h:
(WebCore::PresentationOrderSampleMap::begin):
(WebCore::PresentationOrderSampleMap::end):
(WebCore::PresentationOrderSampleMap::rbegin):
(WebCore::PresentationOrderSampleMap::rend):
(WebCore::DecodeOrderSampleMap::begin):
(WebCore::DecodeOrderSampleMap::end):
(WebCore::DecodeOrderSampleMap::rbegin):
(WebCore::DecodeOrderSampleMap::rend):
(WebCore::SampleMap::SampleMap):
(WebCore::SampleMap::sizeInBytes):
(WebCore::SampleMap::decodeOrder):
(WebCore::SampleMap::presentationOrder):
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::removeSamplesFromTrackBuffer):
(WebCore::SourceBuffer::removeCodedFrames):
(WebCore::SourceBuffer::reenqueueMediaForTime):
* WebCore.xcodeproj/project.pbxproj:

Source/WTF:

Optimize the MediaTime class; specifically the compare() method. The class only
needs 6 bits to store the TimeFlags, so make that a uint8_t rather than uint32_t.
The implementation is slightly simpler if the TimeScale is unsigned, so make that
a uint32_t rather than int32_t. Inline the comparison operators. Optimize the equality
comparison by bitwise-and'ing the flags together and masking the result. Optimize for
common comparison scenarios (equal timeScales, equal timeValues(), etc.). Attempt the
mathematically simpler simpler method for comparing ratios, and only fall back to the
complex method if the results of multiplying the timeScale by the timeValue overflows.

* wtf/MediaTime.cpp:
(WTF::greatestCommonDivisor):
(WTF::leastCommonMultiple):
(WTF::signum):
(WTF::MediaTime::MediaTime):
(WTF::MediaTime::createWithFloat):
(WTF::MediaTime::createWithDouble):
(WTF::MediaTime::operator+):
(WTF::MediaTime::operator-):
(WTF::MediaTime::operator!):
(WTF::MediaTime::operator bool):
(WTF::MediaTime::compare):
(WTF::MediaTime::setTimeScale):
(WTF::abs):
(WTF::MediaTime::operator<): Deleted.
(WTF::MediaTime::operator>): Deleted.
(WTF::MediaTime::operator!=): Deleted.
(WTF::MediaTime::operator==): Deleted.
(WTF::MediaTime::operator>=): Deleted.
(WTF::MediaTime::operator<=): Deleted.
* wtf/MediaTime.h:

Tools:

Add new correctness tests for the Webcore::SampleMap class. Add additional subtests
for the WTF::MediaTime class.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WTF/MediaTime.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebCore/SampleMap.cpp: Added.
(WTF::operator<<):
(TestWebKitAPI::TestSample::create):
(TestWebKitAPI::TestSample::TestSample):
(TestWebKitAPI::TEST_F):

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

4 years agoSkip media/audio-dealloc-crash.html on ios-simulator.
ryanhaddad@apple.com [Mon, 6 Feb 2017 20:49:25 +0000 (20:49 +0000)]
Skip media/audio-dealloc-crash.html on ios-simulator.

Unreviewed test gardening.

* platform/ios-simulator/TestExpectations:

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

4 years ago[WK2] Drop legacy WKBundlePageDiagnosticLoggingClient API
cdumez@apple.com [Mon, 6 Feb 2017 20:18:36 +0000 (20:18 +0000)]
[WK2] Drop legacy WKBundlePageDiagnosticLoggingClient API
https://bugs.webkit.org/show_bug.cgi?id=167883
<rdar://problem/30376695>

Reviewed by Sam Weinig.

Drop legacy WKBundlePageDiagnosticLoggingClient API as I am not aware of any remaining client.
All clients have now switched to the equivalent UIProcess-side API.

* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageSetDiagnosticLoggingClient): Deleted.
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
* WebProcess/InjectedBundle/API/c/WKBundlePageDiagnosticLoggingClient.h: Removed.
* WebProcess/InjectedBundle/InjectedBundlePageDiagnosticLoggingClient.cpp: Removed.
* WebProcess/InjectedBundle/InjectedBundlePageDiagnosticLoggingClient.h: Removed.
* WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
(WebKit::WebDiagnosticLoggingClient::logDiagnosticMessage):
(WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithResult):
(WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithValue):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::close):
(WebKit::WebPage::initializeInjectedBundleDiagnosticLoggingClient): Deleted.
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::injectedBundleUIClient):
(WebKit::WebPage::injectedBundleDiagnosticLoggingClient): Deleted.

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

4 years agoMake ARES-6 work from the CLI again
sbarati@apple.com [Mon, 6 Feb 2017 20:06:52 +0000 (20:06 +0000)]
Make ARES-6 work from the CLI again
https://bugs.webkit.org/show_bug.cgi?id=167895

Reviewed by Michael Saboff.

* ARES-6/driver.js:
(Driver.prototype.readyTrigger):
(Driver.prototype.disableTrigger):
* ARES-6/stats.js:
(Stats.prototype.toString.span.span):
(Stats.prototype.toString.return.span):
(Stats.prototype.toString):

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

4 years agoChange capitalization in platform name after r211735.
ryanhaddad@apple.com [Mon, 6 Feb 2017 19:46:32 +0000 (19:46 +0000)]
Change capitalization in platform name after r211735.

Unreviewed dashboard fix.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/WebKitBuildbot.js:
(WebKitBuildbot):

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

4 years agoRename AnimationController to CSSAnimationController
commit-queue@webkit.org [Mon, 6 Feb 2017 19:21:45 +0000 (19:21 +0000)]
Rename AnimationController to CSSAnimationController
https://bugs.webkit.org/show_bug.cgi?id=167829

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

Source/WebCore:

AnimationController is a very generic name. The current function of this
class is CSS animation.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::computeRenderStyleForProperty):
* dom/Document.cpp:
* history/CachedFrame.cpp:
* page/Frame.cpp:
(WebCore::Frame::Frame):
* page/Frame.h:
(WebCore::Frame::animation):
* page/FrameView.cpp:
* page/Page.cpp:
* page/animation/AnimationBase.cpp:
* page/animation/CSSAnimationController.cpp: Renamed from Source/WebCore/page/animation/AnimationController.cpp.
(WebCore::AnimationPrivateUpdateBlock::AnimationPrivateUpdateBlock):
(WebCore::AnimationPrivateUpdateBlock::~AnimationPrivateUpdateBlock):
(WebCore::CSSAnimationControllerPrivate::CSSAnimationControllerPrivate):
(WebCore::CSSAnimationControllerPrivate::~CSSAnimationControllerPrivate):
(WebCore::CSSAnimationControllerPrivate::ensureCompositeAnimation):
(WebCore::CSSAnimationControllerPrivate::clear):
(WebCore::CSSAnimationControllerPrivate::updateAnimations):
(WebCore::CSSAnimationControllerPrivate::updateAnimationTimerForRenderer):
(WebCore::CSSAnimationControllerPrivate::updateAnimationTimer):
(WebCore::CSSAnimationControllerPrivate::updateStyleIfNeededDispatcherFired):
(WebCore::CSSAnimationControllerPrivate::fireEventsAndUpdateStyle):
(WebCore::CSSAnimationControllerPrivate::startUpdateStyleIfNeededDispatcher):
(WebCore::CSSAnimationControllerPrivate::addEventToDispatch):
(WebCore::CSSAnimationControllerPrivate::addElementChangeToDispatch):
(WebCore::CSSAnimationControllerPrivate::animationFrameCallbackFired):
(WebCore::CSSAnimationControllerPrivate::animationTimerFired):
(WebCore::CSSAnimationControllerPrivate::isRunningAnimationOnRenderer):
(WebCore::CSSAnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer):
(WebCore::CSSAnimationControllerPrivate::suspendAnimations):
(WebCore::CSSAnimationControllerPrivate::resumeAnimations):
(WebCore::CSSAnimationControllerPrivate::animationsAreSuspendedForDocument):
(WebCore::CSSAnimationControllerPrivate::detachFromDocument):
(WebCore::CSSAnimationControllerPrivate::suspendAnimationsForDocument):
(WebCore::CSSAnimationControllerPrivate::resumeAnimationsForDocument):
(WebCore::CSSAnimationControllerPrivate::startAnimationsIfNotSuspended):
(WebCore::CSSAnimationControllerPrivate::setAllowsNewAnimationsWhileSuspended):
(WebCore::CSSAnimationControllerPrivate::pauseAnimationAtTime):
(WebCore::CSSAnimationControllerPrivate::pauseTransitionAtTime):
(WebCore::CSSAnimationControllerPrivate::beginAnimationUpdateTime):
(WebCore::CSSAnimationControllerPrivate::beginAnimationUpdate):
(WebCore::CSSAnimationControllerPrivate::endAnimationUpdate):
(WebCore::CSSAnimationControllerPrivate::receivedStartTimeResponse):
(WebCore::CSSAnimationControllerPrivate::getAnimatedStyleForRenderer):
(WebCore::CSSAnimationControllerPrivate::computeExtentOfAnimation):
(WebCore::CSSAnimationControllerPrivate::numberOfActiveAnimations):
(WebCore::CSSAnimationControllerPrivate::addToAnimationsWaitingForStyle):
(WebCore::CSSAnimationControllerPrivate::removeFromAnimationsWaitingForStyle):
(WebCore::CSSAnimationControllerPrivate::styleAvailable):
(WebCore::CSSAnimationControllerPrivate::addToAnimationsWaitingForStartTimeResponse):
(WebCore::CSSAnimationControllerPrivate::removeFromAnimationsWaitingForStartTimeResponse):
(WebCore::CSSAnimationControllerPrivate::startTimeResponse):
(WebCore::CSSAnimationControllerPrivate::animationWillBeRemoved):
(WebCore::CSSAnimationControllerPrivate::addToAnimationsDependentOnScroll):
(WebCore::CSSAnimationControllerPrivate::removeFromAnimationsDependentOnScroll):
(WebCore::CSSAnimationControllerPrivate::scrollWasUpdated):
(WebCore::CSSAnimationController::CSSAnimationController):
(WebCore::CSSAnimationController::~CSSAnimationController):
(WebCore::CSSAnimationController::cancelAnimations):
(WebCore::CSSAnimationController::updateAnimations):
(WebCore::CSSAnimationController::getAnimatedStyleForRenderer):
(WebCore::CSSAnimationController::computeExtentOfAnimation):
(WebCore::CSSAnimationController::notifyAnimationStarted):
(WebCore::CSSAnimationController::pauseAnimationAtTime):
(WebCore::CSSAnimationController::numberOfActiveAnimations):
(WebCore::CSSAnimationController::pauseTransitionAtTime):
(WebCore::CSSAnimationController::isRunningAnimationOnRenderer):
(WebCore::CSSAnimationController::isRunningAcceleratedAnimationOnRenderer):
(WebCore::CSSAnimationController::isSuspended):
(WebCore::CSSAnimationController::suspendAnimations):
(WebCore::CSSAnimationController::resumeAnimations):
(WebCore::CSSAnimationController::allowsNewAnimationsWhileSuspended):
(WebCore::CSSAnimationController::setAllowsNewAnimationsWhileSuspended):
(WebCore::CSSAnimationController::serviceAnimations):
(WebCore::CSSAnimationController::animationsAreSuspendedForDocument):
(WebCore::CSSAnimationController::detachFromDocument):
(WebCore::CSSAnimationController::suspendAnimationsForDocument):
(WebCore::CSSAnimationController::resumeAnimationsForDocument):
(WebCore::CSSAnimationController::startAnimationsIfNotSuspended):
(WebCore::CSSAnimationController::beginAnimationUpdate):
(WebCore::CSSAnimationController::endAnimationUpdate):
(WebCore::CSSAnimationController::supportsAcceleratedAnimationOfProperty):
(WebCore::CSSAnimationController::wantsScrollUpdates):
(WebCore::CSSAnimationController::scrollWasUpdated):
(WebCore::CSSAnimationController::hasAnimations):
* page/animation/CSSAnimationController.h: Renamed from Source/WebCore/page/animation/AnimationController.h.
(WebCore::AnimationUpdateBlock::AnimationUpdateBlock):
(WebCore::AnimationUpdateBlock::~AnimationUpdateBlock):
* page/animation/CSSAnimationControllerPrivate.h: Renamed from Source/WebCore/page/animation/AnimationControllerPrivate.h.
(WebCore::CSSAnimationControllerPrivate::hasAnimations):
(WebCore::CSSAnimationControllerPrivate::isSuspended):
(WebCore::CSSAnimationControllerPrivate::setBeginAnimationUpdateTime):
(WebCore::CSSAnimationControllerPrivate::allowsNewAnimationsWhileSuspended):
(WebCore::CSSAnimationControllerPrivate::wantsScrollUpdates):
(WebCore::CSSAnimationControllerPrivate::scrollPosition):
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::singleton):
* page/animation/CompositeAnimation.cpp:
(WebCore::CompositeAnimation::CompositeAnimation):
* page/animation/CompositeAnimation.h:
(WebCore::CompositeAnimation::create):
(WebCore::CompositeAnimation::animationController):
* page/animation/ImplicitAnimation.cpp:
* page/animation/KeyframeAnimation.cpp:
* page/ios/FrameIOS.mm:
* platform/graphics/GraphicsLayer.h:
* rendering/RenderElement.h:
* rendering/RenderLayer.cpp:
* rendering/RenderLayerBacking.cpp:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingForAnimation):
* rendering/RenderObject.cpp:
* rendering/RenderObject.h:
(WebCore::RenderObject::animation):
* testing/Internals.cpp:

Source/WebKit/mac:

* WebView/WebFrame.mm:
* WebView/WebView.mm:

Source/WebKit/win:

* WebFrame.cpp:

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

4 years agoStatic Analyzer: JSContext.mm: Incorrect decrement of the reference count of an object
commit-queue@webkit.org [Mon, 6 Feb 2017 19:16:07 +0000 (19:16 +0000)]
Static Analyzer: JSContext.mm: Incorrect decrement of the reference count of an object
https://bugs.webkit.org/show_bug.cgi?id=167848

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

Source/JavaScriptCore/API/JSContext.mm:87:5: warning: Incorrect decrement of the reference count of an object that is not owned at this point by the caller
    [self.exceptionHandler release];
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.

* API/JSContext.mm:
(-[JSContext dealloc]):
Use the ivar in dealloc instead of going through the getter.

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

4 years agoAdd a survey to learn how people use WebKit Nightly builds
jond@apple.com [Mon, 6 Feb 2017 19:13:40 +0000 (19:13 +0000)]
Add a survey to learn how people use WebKit Nightly builds
https://bugs.webkit.org/show_bug.cgi?id=167748

Reviewed by Joseph Pecoraro.

* wp-content/themes/webkit/functions.php:
* wp-content/themes/webkit/nightly-start.php:
* wp-content/themes/webkit/nightly-survey.php: Added.
* wp-content/themes/webkit/survey.json: Added.

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

4 years agoSimple line layout: Use simplified text measuring when possible.
zalan@apple.com [Mon, 6 Feb 2017 19:06:39 +0000 (19:06 +0000)]
Simple line layout: Use simplified text measuring when possible.
https://bugs.webkit.org/show_bug.cgi?id=167843
<rdar://problem/30364907>

Reviewed by Antti Koivisto.

This patch adds a simplified version of text width measuring.
Certain type of text runs (no spacing etc) only require a subset of what we
currently do in FontCascade::width().

* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::widthForSimpleText):
* platform/graphics/FontCascade.h:
* platform/graphics/WidthCache.h:
(WebCore::WidthCache::add):
(WebCore::WidthCache::addSlowCase):
* platform/graphics/WidthIterator.cpp:
(WebCore::WidthIterator::advanceInternal):
* rendering/RenderText.cpp:
(WebCore::RenderText::styleDidChange):
(WebCore::RenderText::setRenderedText):
(WebCore::RenderText::computeCanUseSimplifiedTextMeasuring):
* rendering/RenderText.h:
(WebCore::RenderText::canUseSimplifiedTextMeasuring):
* rendering/SimpleLineLayoutFlowContents.cpp:
(WebCore::SimpleLineLayout::initializeSegments):
* rendering/SimpleLineLayoutFlowContents.h:
* rendering/SimpleLineLayoutTextFragmentIterator.cpp:
(WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
(WebCore::SimpleLineLayout::TextFragmentIterator::TextFragmentIterator):
(WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
* rendering/SimpleLineLayoutTextFragmentIterator.h:

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

4 years agoNull check the WebKit::RemoteObjectProxy object before calling it
andersca@apple.com [Mon, 6 Feb 2017 18:55:56 +0000 (18:55 +0000)]
Null check the WebKit::RemoteObjectProxy object before calling it
https://bugs.webkit.org/show_bug.cgi?id=167891
rdar://problem/30229358

Reviewed by Tim Horton.

If a _WKRemoteObjectRegistry invocation reply block outlives its underlying WebKit::RemoteObjectProxy object,
we'll crash trying to send an unused reply to it. Work around this crash by adding a null check before calling
sendUnusedReply.

While this fixes the crash it will lead to leaks in the process that holds on to the reply block. A more long term fix
would be to manage the reply block checkers and call sendUnusedReply when invalidating the _WKRemoteObjectRegistry.

* Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
(-[_WKRemoteObjectRegistry _invokeMethod:]):

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

4 years agoMove the Leaks bot to Sierra
ap@apple.com [Mon, 6 Feb 2017 18:38:14 +0000 (18:38 +0000)]
Move the Leaks bot to Sierra
https://bugs.webkit.org/show_bug.cgi?id=167886

Reviewed by Daniel Bates.

* BuildSlaveSupport/build.webkit.org-config/config.json:
* BuildSlaveSupport/build.webkit.org-config/mastercfg_unittest.py:
* BuildSlaveSupport/build.webkit.org-config/public_html/LeaksViewer/LeaksViewer.js:
(LeaksViewer._displayURLPrompt):
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/WebKitBuildbot.js:
(WebKitBuildbot):

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

4 years ago[Soup] Deadlock in NetworkProcess
carlosgc@webkit.org [Mon, 6 Feb 2017 18:00:52 +0000 (18:00 +0000)]
[Soup] Deadlock in NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=167876

Reviewed by Michael Catanzaro.

WebKitSoupRequestInputStream uses a read lock. What is happening is that webkitSoupRequestInputStreamAddData
takes the lock, and it calls webkitSoupRequestInputStreamPendingReadAsyncComplete with the lock help. That
causes webkitSoupRequestInputStreamReadAsync to be called again to read the next chunk, but in the same run loop
operation. We don't really need the read lock because both webkitSoupRequestInputStreamAddData and
webkitSoupRequestInputStreamReadAsync shoudl always be called from the main thread.

* WebProcess/soup/WebKitSoupRequestInputStream.cpp:
(webkitSoupRequestInputStreamReadAsync): Remove the read lock and assert if called from a secondary thread.
(webkitSoupRequestInputStreamAddData): Ditto.

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

4 years agoResource usage overlay should ignore mouse events outside bounds by default
carlosgc@webkit.org [Mon, 6 Feb 2017 17:49:18 +0000 (17:49 +0000)]
Resource usage overlay should ignore mouse events outside bounds by default
https://bugs.webkit.org/show_bug.cgi?id=167874

Reviewed by Andreas Kling.

It's overriding the default causing that the first click after the overlay is shown is always handled by the
overlay even when clicked outside bounds. It should only be set false while dragging.

* page/ResourceUsageOverlay.cpp:
(WebCore::ResourceUsageOverlay::initialize):

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

4 years agoRe-sync html/browsers/origin/cross-origin-objects tests
cdumez@apple.com [Mon, 6 Feb 2017 17:47:02 +0000 (17:47 +0000)]
Re-sync html/browsers/origin/cross-origin-objects tests
https://bugs.webkit.org/show_bug.cgi?id=167881

Reviewed by Youenn Fablet.

Re-sync html/browsers/origin/cross-origin-objects tests from upstream a052787d.

* web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-exceptions-expected.txt: Removed.
* web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-exceptions.html: Removed.
* web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt:
* web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects.html:
* web-platform-tests/html/browsers/origin/cross-origin-objects/frame.html:
* web-platform-tests/html/browsers/origin/cross-origin-objects/w3c-import.log:

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

4 years agoSkip ARES-6 on performance bots
ryanhaddad@apple.com [Mon, 6 Feb 2017 17:36:15 +0000 (17:36 +0000)]
Skip ARES-6 on performance bots
https://bugs.webkit.org/show_bug.cgi?id=167863

Unreviewed test gardening.

ES6SampleBench was renamed to ARES-6, so this should be updated in PerformanceTests/Skipped as well.

* Skipped:

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

4 years agoCrashTracer: com.apple.WebKit.WebContent at WebCore: WebCore::Node::invalidateStyle
antti@apple.com [Mon, 6 Feb 2017 17:35:12 +0000 (17:35 +0000)]
CrashTracer: com.apple.WebKit.WebContent at WebCore: WebCore::Node::invalidateStyle
https://bugs.webkit.org/show_bug.cgi?id=167878
rdar://problem/30251840

Reviewed by Andreas Kling.

Speculative fix.

We are trying to invalidate a null node from ~PostResolutionCallbackDisabler. Looks like the only way
this could happen is if HTMLFrameOwnerElement::scheduleinvalidateStyleAndLayerComposition is called
with null 'this'. There is one place where this might happen.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::attachRootLayer): Add null check.

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

4 years agoUnreviewed, rolling out r211722.
ryanhaddad@apple.com [Mon, 6 Feb 2017 17:28:04 +0000 (17:28 +0000)]
Unreviewed, rolling out r211722.

This change introduced a LayoutTest failure on mac-wk2.

Reverted changeset:

"[Modern Media Controls] Improve handling of <video> with only
audio tracks"
https://bugs.webkit.org/show_bug.cgi?id=167836
http://trac.webkit.org/changeset/211722

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