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

Reviewed by Alex Christensen.

Source/WebCore:

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

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

Source/WebKit2:

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

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

Source/WTF:

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

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

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

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

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

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

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

* platform/spi/mac/AVFoundationSPI.h:

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

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

* platform/spi/cocoa/IOSurfaceSPI.h:

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

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

Reviewed by Alex Christensen.

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

No new tests needed.

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

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

2 years agoDestroy the associated renderer subtree when display: contents node is deleted.
zalan@apple.com [Mon, 5 Jun 2017 21:04:30 +0000 (21:04 +0000)]
Destroy the associated renderer subtree when display: contents node is deleted.
https://bugs.webkit.org/show_bug.cgi?id=172920
<rdar://problem/32446045>

Reviewed by Antti Koivisto.

Since display: contents node does not create a renderer, we need to explicitly check
and distinguish it from the display: none case.

Covered by existing tests.

* dom/ContainerNode.cpp:
(WebCore::destroyRenderTreeIfNeeded):
* dom/Node.cpp:
(WebCore::Node::~Node): Promote ASSERT(!renderer()) to ASSERT_WITH_SECURITY_IMPLICATION.
* dom/Text.cpp:
(WebCore::Text::~Text): Redundant assert. Text is a Node.

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

2 years agowebkitpy: Add iOS to platform
jbedard@apple.com [Mon, 5 Jun 2017 21:00:51 +0000 (21:00 +0000)]
webkitpy: Add iOS to platform
https://bugs.webkit.org/show_bug.cgi?id=172931

Reviewed by Daniel Bates.

* Scripts/webkitpy/common/system/platforminfo.py:
PlatformInfo.__init__): Use platform_module.release() as the os_version for iOS device.
(PlatformInfo.is_ios): Added.
(PlatformInfo._determine_os_name): A platform name of 'ios' means that the os name is 'ios'.
* Scripts/webkitpy/common/system/platforminfo_mock.py:
(MockPlatformInfo.is_ios): Added.

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

2 years ago[WPE][JHBuild] Switch github repository from git:// to https://
clopez@igalia.com [Mon, 5 Jun 2017 20:54:08 +0000 (20:54 +0000)]
[WPE][JHBuild] Switch github repository from git:// to https://
https://bugs.webkit.org/show_bug.cgi?id=172921

Reviewed by Alex Christensen.

* wpe/jhbuild.modules:

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

2 years agoModify Netflix controlsManager quirk to prevent only scrubbing
bdakin@apple.com [Mon, 5 Jun 2017 20:29:24 +0000 (20:29 +0000)]
Modify Netflix controlsManager quirk to prevent only scrubbing
https://bugs.webkit.org/show_bug.cgi?id=172881
-and corresponding-
rdar://problem/32228660

Reviewed by Andy Estes.

Source/WebCore:

Instead of preventing Netflix from getting a controlsManager at all, this patch
ONLY prevents touch bar scrubbing from working. This means that Netflix will now
get controls in the TouchBar, it means that the play/pause and PiP buttons will be
functional, and it means that the timeline will accurately represent the current
time, BUT users will not be able to use the timeline to scrub the video. This also
allows Netflix to work with other MediaRemote clients such as AirPods.

Remove the quirk code from here, since this is no longer the right place to test
if the MediaElement is hosted at Netflix.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::bestMediaElementForShowingPlaybackControlsManager):
(WebCore::needsPlaybackControlsManagerQuirk): Deleted.

Pass around a new bool allowsTouchBarScrubbing.
* platform/cocoa/WebPlaybackSessionModel.h:
(WebCore::WebPlaybackSessionModelClient::allowsTouchBarScrubbingChanged):
* platform/cocoa/WebPlaybackSessionModelMediaElement.h:

Here’s where we check if we need quirky behavior.
* platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
(WebCore::WebPlaybackSessionModelMediaElement::updateForEventName):
(WebCore::WebPlaybackSessionModelMediaElement::allowsTouchBarScrubbing):

Return the bool we have plumbed through tracking whether the current site
allowsTouchBarScrubbing from the existing delegate method
canBeginTouchBarScrubbing. We will always return NO for video elements on Netflix,
and this will prevent users from be able to scrub with the TouchBar on Netflix.
* platform/mac/WebPlaybackControlsManager.h:
* platform/mac/WebPlaybackControlsManager.mm:
(-[WebPlaybackControlsManager canBeginTouchBarScrubbing]):

More plumbing.
* platform/mac/WebPlaybackSessionInterfaceMac.h:
* platform/mac/WebPlaybackSessionInterfaceMac.mm:
(WebCore::WebPlaybackSessionInterfaceMac::allowsTouchBarScrubbingChanged):
(WebCore::WebPlaybackSessionInterfaceMac::setPlayBackControlsManager):

Source/WebKit2:

Plumbing for allowsTouchBarScrubbing. See WebCore ChangeLog for more details.

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

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

2 years agoUpdate index.html to include ARES-6.
sbarati@apple.com [Mon, 5 Jun 2017 17:49:25 +0000 (17:49 +0000)]
Update index.html to include ARES-6.

Rubber stamped by Ryosuke Niwa.

* index.html:

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

2 years agoRebaseline tests for Windows after r217772.
ryanhaddad@apple.com [Mon, 5 Jun 2017 16:35:20 +0000 (16:35 +0000)]
Rebaseline tests for Windows after r217772.
https://bugs.webkit.org/show_bug.cgi?id=172866

Unreviewed test gardening.

* platform/win/svg/W3C-SVG-1.1-SE/paths-dom-02-f-expected.txt:
* platform/win/svg/W3C-SVG-1.1/animate-elem-06-t-expected.txt:
* platform/win/svg/W3C-SVG-1.1/animate-elem-07-t-expected.txt:
* platform/win/svg/W3C-SVG-1.1/animate-elem-08-t-expected.txt:
* platform/win/svg/W3C-SVG-1.1/animate-elem-83-t-expected.txt:
* platform/win/svg/W3C-SVG-1.1/filters-example-01-b-expected.txt:
* platform/win/svg/W3C-SVG-1.1/paths-data-01-t-expected.txt:
* platform/win/svg/W3C-SVG-1.1/paths-data-02-t-expected.txt:
* platform/win/svg/W3C-SVG-1.1/paths-data-12-t-expected.txt:
* platform/win/svg/W3C-SVG-1.1/text-path-01-b-expected.txt:
* platform/win/svg/batik/filters/feTile-expected.txt:
* platform/win/svg/batik/filters/filterRegions-expected.txt:
* platform/win/svg/batik/masking/maskRegions-expected.txt:
* platform/win/svg/batik/paints/gradientLimit-expected.txt:
* platform/win/svg/batik/paints/patternPreserveAspectRatioA-expected.txt:
* platform/win/svg/batik/paints/patternRegionA-expected.txt:
* platform/win/svg/batik/paints/patternRegions-expected.txt:
* platform/win/svg/batik/paints/patternRegions-positioned-objects-expected.txt: Added.
* platform/win/svg/batik/text/longTextOnPath-expected.txt: Added.
* platform/win/svg/batik/text/smallFonts-expected.txt:
* platform/win/svg/batik/text/textAnchor-expected.txt:
* platform/win/svg/batik/text/textDecoration-expected.txt:
* platform/win/svg/batik/text/textEffect-expected.txt:
* platform/win/svg/batik/text/textEffect2-expected.txt:
* platform/win/svg/batik/text/textEffect3-expected.txt:
* platform/win/svg/batik/text/textFeatures-expected.txt:
* platform/win/svg/batik/text/textGlyphOrientationHorizontal-expected.txt:
* platform/win/svg/batik/text/textLayout-expected.txt:
* platform/win/svg/batik/text/textLayout2-expected.txt:
* platform/win/svg/batik/text/textLength-expected.txt:
* platform/win/svg/batik/text/textOnPathSpaces-expected.txt:
* platform/win/svg/batik/text/textPosition-expected.txt:
* platform/win/svg/batik/text/textProperties-expected.txt:
* platform/win/svg/batik/text/textProperties2-expected.txt:
* platform/win/svg/batik/text/textStyles-expected.txt:
* platform/win/svg/custom/broken-internal-references-expected.txt:
* platform/win/svg/custom/path-textPath-simulation-expected.txt:
* platform/win/svg/dom/SVGPathSegList-segment-modification-expected.txt:
* platform/win/svg/hixie/perf/001-expected.txt:
* platform/win/svg/hixie/perf/002-expected.txt:
* platform/win/svg/text/text-path-01-b-expected.txt:
* platform/win/svg/zoom/page/zoom-svg-through-object-with-override-size-expected.txt:

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

2 years ago[GStreamer] Deadlock in MediaPlayerPrivateGStreamer::changePipelineState, web process...
carlosgc@webkit.org [Mon, 5 Jun 2017 16:27:19 +0000 (16:27 +0000)]
[GStreamer] Deadlock in MediaPlayerPrivateGStreamer::changePipelineState, web process often locks up on seeking in a youtube video that has already fully buffered
https://bugs.webkit.org/show_bug.cgi?id=170003

Reviewed by Michael Catanzaro.

When video sink is requested to render a frame, the GstBaseSink preroll mutex is taken. Then WebKit media player
schedules a repaint in the main thread, taking the draw mutex and waiting on draw condition. It can happen that
before the repaint is done in the main thread, a pause is requested in the main thread, causing a change state
from PLAYING to PAUSE. When the change state reaches the video sink gst_base_sink_change_state() tries to get
the preroll mutex. This causes a deadlock because the main thread is waiting to get the preroll mutex, but the
other thread is waiting for the main thread to do the repaint. GStreamer handles this case by calling unlock()
on the video sink before trying to get the preroll mutex, but the media player doesn't cancel the pending
repaint when using coordinated graphics. This patch adds a new signal to WebKitVideoSink "repaint-cancelled" to
notify the media player to cancel the pending prepaint.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::cancelRepaint): Release the draw mutex and notify the condition.
(WebCore::MediaPlayerPrivateGStreamerBase::repaintCancelledCallback): Call cancelRepaint().
(WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink): Connect to WebKitVideoSink::repaint-cancelled.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
(webkitVideoSinkRepaintCancelled): Emit WebKitVideoSink::repaint-cancelled.
(webkitVideoSinkUnlock): Call webkitVideoSinkRepaintCancelled().
(webkitVideoSinkStop): Ditto.
(webkit_video_sink_class_init): Add WebKitVideoSink::repaint-cancelled signal.

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

2 years ago[GStreamer] Cleanup ifdefs in MediaPlayerPrivateGStreamerBase
carlosgc@webkit.org [Mon, 5 Jun 2017 16:25:55 +0000 (16:25 +0000)]
[GStreamer] Cleanup ifdefs in MediaPlayerPrivateGStreamerBase
https://bugs.webkit.org/show_bug.cgi?id=172918

Reviewed by Michael Catanzaro.

The code in MediaPlayerPrivateGStreamerBase is quite difficult to follow with all the ifdefs for the
possibilities when rendering. Some of them are even dead code now that all ports using GStreamer are using also
coordinated graphics.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
(WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
(WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
(WebCore::MediaPlayerPrivateGStreamerBase::repaint):
(WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
(VideoRenderRequestScheduler::VideoRenderRequestScheduler):
(VideoRenderRequestScheduler::stop):
(VideoRenderRequestScheduler::requestRender):
(webkitVideoSinkRequestRender):

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

2 years agoUnreviewed. Fix compile warning when building GTK+ port without OpenGL.
carlosgc@webkit.org [Mon, 5 Jun 2017 16:05:04 +0000 (16:05 +0000)]
Unreviewed. Fix compile warning when building GTK+ port without OpenGL.

* platform/graphics/texmap/BitmapTexturePool.cpp:
(WebCore::BitmapTexturePool::createTexture):

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

2 years agoUnreviewed. Fix GTK+ build with OpenGL disabled after r217779.
carlosgc@webkit.org [Mon, 5 Jun 2017 16:03:10 +0000 (16:03 +0000)]
Unreviewed. Fix GTK+ build with OpenGL disabled after r217779.

* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::mainFrameContentSizeChanged):

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

2 years agoRemove debug-only flag for flaky test http/tests/navigation/statistics.html.
ryanhaddad@apple.com [Mon, 5 Jun 2017 15:59:35 +0000 (15:59 +0000)]
Remove debug-only flag for flaky test http/tests/navigation/statistics.html.
https://bugs.webkit.org/show_bug.cgi?id=172454

Unreviewed test gardening.

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

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

2 years agoASSERTION FAILED: m_currentScriptCallbackID in UIScriptContext::requestUIScriptComple...
timothy_horton@apple.com [Mon, 5 Jun 2017 15:42:13 +0000 (15:42 +0000)]
ASSERTION FAILED: m_currentScriptCallbackID in UIScriptContext::requestUIScriptCompletion(JSStringRef) running fast/events/ios/autocorrect-with-range-selection.html
https://bugs.webkit.org/show_bug.cgi?id=172887
<rdar://problem/32546061>

Reviewed by Sam Weinig.

* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::applyAutocorrection):
applyAutocorrection can call its completion handler synchronously,
which makes UIScriptController unhappy (see bug 172884).

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

2 years ago[GTK][WPE] Do not force video sample's buffer release when the platformLayerProxy...
magomez@igalia.com [Mon, 5 Jun 2017 12:33:31 +0000 (12:33 +0000)]
[GTK][WPE] Do not force video sample's buffer release when the platformLayerProxy is inactive
https://bugs.webkit.org/show_bug.cgi?id=172916

Reviewed by Carlos Garcia Campos.

When MediaPlayerPrivateGStreamerBase's plarformLayerProxy was inactive, a copy of the video sample
was being done (without the buffer) and set, causing the sample's buffer to get freed. This was done
to avoid stalling the gstreamer pipeline in situations where the video was set to display:none, as the
platformLayerProxy would keep all the available buffers. But this can't happen nowadays as setting
the video to display:none invalidates the proxy, causing it to release the references to the
gstreamer buffers it's using. Also, the current code is causing a crash when using gstreamer-gl and
the video is hidden but its contents are being painted through webgl or an accelerated canvas. So,
remove this sample copy as it's not necessary anymore.

Covered by existent tests.

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

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

2 years ago[WPE] Use AcceleratedDrawingArea instead of its fork
carlosgc@webkit.org [Mon, 5 Jun 2017 12:01:53 +0000 (12:01 +0000)]
[WPE] Use AcceleratedDrawingArea instead of its fork
https://bugs.webkit.org/show_bug.cgi?id=172496

Reviewed by Žan Doberšek.

WPE uses its own drawing area implementation, which is actually a fork of AcceleratedDrawingArea, but simplified
for the case of compositing being always forced. AcceleratedDrawingArea already handles the case of compositing
being forced, so now that WPE is upstream we could simply use AcceleratedDrawingArea instead.

* PlatformWPE.cmake:
* Shared/DrawingAreaInfo.h: Remove DrawingAreaTypeWPE type.
* UIProcess/API/wpe/DrawingAreaProxyWPE.cpp: Removed.
* UIProcess/API/wpe/DrawingAreaProxyWPE.h: Removed.
* UIProcess/API/wpe/PageClientImpl.cpp:
(WebKit::PageClientImpl::createDrawingAreaProxy): Create an AcceleratedDrawingAreaProxy.
* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::mainFrameContentSizeChanged): Moved from DrawingAreaImpl since it actually
belongs here.
* WebProcess/WebPage/DrawingArea.cpp:
(WebKit::DrawingArea::create): Create an AcceleratedDrawingArea for WPE port.
* WebProcess/WebPage/DrawingAreaImpl.cpp: Remove mainFrameContentSizeChanged() that doesn't belong here.
* WebProcess/WebPage/DrawingAreaImpl.h:
* WebProcess/WebPage/wpe/DrawingAreaWPE.cpp: Removed.
* WebProcess/WebPage/wpe/DrawingAreaWPE.h: Removed.

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

2 years agoRebaseline media/modern-media-controls/audio/audio-controls-metrics.html
commit-queue@webkit.org [Mon, 5 Jun 2017 09:11:34 +0000 (09:11 +0000)]
Rebaseline media/modern-media-controls/audio/audio-controls-metrics.html
https://bugs.webkit.org/show_bug.cgi?id=172915

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

The default height of <audio> elements is now 31pt.

* media/modern-media-controls/audio/audio-controls-metrics-expected.txt:
* media/modern-media-controls/audio/audio-controls-metrics.html:

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

2 years ago[GTK][WPE] Fix the condition to decide whether the MediaPlayer can be rendered accele...
magomez@igalia.com [Mon, 5 Jun 2017 07:45:12 +0000 (07:45 +0000)]
[GTK][WPE] Fix the condition to decide whether the MediaPlayer can be rendered accelerated
https://bugs.webkit.org/show_bug.cgi?id=172852

Reviewed by Michael Catanzaro.

Before this change, in order to determine whether the MediaPlayer rendering could be accelerated we
needed the player to have a renderer or it would return false. The renderer was needed in order to
access the RenderLayerCompositor and check whether the chrome would be overwriting the accelerated
compositing setting. But we don't have that option in WebKitGTK+ or WPE, so we can just check the
accelerated compositing setting directly.

Another problems with the approach before this change is that accelerated rendering was being disabled
when the video element was not visible, as there's no video renderer. Due to this, cases where the video
is painted through an accelerated canvas or webgl would not be using hardware accelerated copies.

Covered by existent tests.

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

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

2 years agoPercentages are calculated wrong in SVG transform CSS property
simon.fraser@apple.com [Mon, 5 Jun 2017 06:09:01 +0000 (06:09 +0000)]
Percentages are calculated wrong in SVG transform CSS property
https://bugs.webkit.org/show_bug.cgi?id=172901

Reviewed by Zalan Bujtas.
Source/WebCore:

The code added in r217236 was just fetching viewBox(), but that can be empty.
SVGLengthContext::determineViewport() does the correct thing to get
the appropriate viewport.

Test: svg/transforms/percent-transform-values-viewbox.html

* svg/SVGGraphicsElement.cpp:
(WebCore::SVGGraphicsElement::animatedLocalTransform):

LayoutTests:

* svg/transforms/percent-transform-values-viewbox-expected.html: Added.
* svg/transforms/percent-transform-values-viewbox.html: Added.
* svg/transforms/transform-origin-css-property-expected.xhtml:
* svg/transforms/transform-origin-css-property.xhtml: Make this test a bit less
annoying to maintain by applying the transforms relative to the fill-box, which means all
the transform origins are no longer offset by the box position. Other tests exercise
view-box relative transform origins.

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

2 years ago[MediaStream] Page capture state not reported correctly
eric.carlson@apple.com [Sun, 4 Jun 2017 20:56:58 +0000 (20:56 +0000)]
[MediaStream] Page capture state not reported correctly
https://bugs.webkit.org/show_bug.cgi?id=172897
<rdar://problem/32493318>

Reviewed by Youenn Fablet.

Source/WebCore:

Test: fast/mediastream/media-stream-track-muted.html

* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::mediaState): Test for audio and video mute on the tracks.
(WebCore::MediaStream::characteristicsChanged): Call statusDidChange when m_mediaState
changes instead of m_muted, so the page is informed when just audio or video mute state
changes.
* Modules/mediastream/MediaStream.h:

* testing/Internals.cpp:
(WebCore::Internals::setMediaStreamTrackMuted): New.
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* fast/mediastream/media-stream-track-muted-expected.txt: Added.
* fast/mediastream/media-stream-track-muted.html: Added.

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

2 years agoStreamline handling of attributes, using references as much as possible
darin@apple.com [Sun, 4 Jun 2017 18:19:16 +0000 (18:19 +0000)]
Streamline handling of attributes, using references as much as possible
https://bugs.webkit.org/show_bug.cgi?id=172899

Reviewed by Chris Dumez.

Source/WebCore:

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::valueForRange): Use reference to value of
attribute instead of copy to avoid reference count churn.
(WebCore::AccessibilityNodeObject::maxValueForRange): Ditto.
(WebCore::AccessibilityNodeObject::minValueForRange): Ditto.
* accessibility/AccessibilitySVGElement.cpp:
(WebCore::AccessibilitySVGElement::childElementWithMatchingLanguage): Ditto.
(WebCore::AccessibilitySVGElement::accessibilityDescription): Ditto.
* css/PropertySetCSSStyleDeclaration.cpp:
(WebCore::StyleAttributeMutationScope::StyleAttributeMutationScope): Ditto.

* editing/cocoa/DataDetection.mm:
(WebCore::DataDetection::shouldCancelDefaultAction): Use the
equalLettersIgnoringASCIICase function instead of using
both equalIgnoringASCIICase and convertToASCIILowercase.

* html/HTMLAudioElement.cpp:
(WebCore::HTMLAudioElement::HTMLAudioElement): Marked this inline since we
want it inlined the one place it's used.
(WebCore::HTMLAudioElement::create): Use auto and named the local variable
just element.
(WebCore::HTMLAudioElement::createForJSConstructor): Call create rather than
repeating the code from create. Use setAttributeWithoutSynchronization directly
rather than calling helper functions. Removed unneeded null check;
setAttributeWithoutSynchronization handles null by removing the attribute.
* html/HTMLAudioElement.h: Changed src argument of createForJSConstructor to
take AtomicString since that is what we need for an attribute value.
* html/HTMLAudioElement.idl: Use [AtomicString] for src argument.

* html/HTMLElement.cpp:
(WebCore::HTMLElement::directionality): Use reference to value of
attribute instead of copy to avoid reference count churn.
(WebCore::HTMLElement::shouldAutocorrect): Ditto.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement): Call the new
parsedMediaAttribute instead of the old mediaQuerySet function. Other than the
name, the only change is that the result is now a const pointer.

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::updateType): Removed unnecessary local variable,
resulting in code that is slightly cleaner and possibly eliminating reference
count chrun.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setSrc): Deleted.
(WebCore::HTMLMediaElement::selectNextSourceChild): Use parsedMediaAttribute and
removed rendudant direct check of whether mediaAttr is present. Changed logging to
get the media attribute directly rather than with a helper function. Changed type
to get the type attribute directly rather than with a helper function.
(WebCore::HTMLMediaElement::sourceWasAdded): Take a reference rather than a pointer.
(WebCore::HTMLMediaElement::sourceWasRemoved): Ditto.
(WebCore::HTMLMediaElement::doesHaveAttribute): Use reference to value of
attribute instead of copy to avoid reference count churn.
* html/HTMLMediaElement.h: Updated for the above.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto): Pass reference instead of pointer.
(WebCore::HTMLSourceElement::removedFrom): Ditto.
(WebCore::HTMLSourceElement::setSrc): Deleted.
(WebCore::HTMLSourceElement::media): Deleted.
(WebCore::HTMLSourceElement::setMedia): Deleted.
(WebCore::HTMLSourceElement::type): Deleted.
(WebCore::HTMLSourceElement::setType): Deleted.
(WebCore::HTMLSourceElement::parseAttribute): Clear out m_cachedParsedMediaAttribute.
This makes the parsing be lazy. The old code would parse the attribute value to make
a MediaQuerySet here, but we do it in parsedMediaAttribute now.
(WebCore::HTMLSourceElement::parsedMediaAttribute): Added. Creates a MediaQuerySet
if needed, and returns it or null.
* html/HTMLSourceElement.h: Removed include of MediaList.h. Removed unneeded media,
type, setSrc, setMedia, and setType functions. Replaced the mediaQuerySet function
with the parsedMediaAttribute, which returns a const pointer rather than non-const,
and is also non-inline because it lazily creates the MediaQuerySet as needed. Replaced
m_mediaQuerySet with m_cachedParsedMediaAttribute.
* html/HTMLSourceElement.idl: Use [Reflect] for both type and media.

* html/MediaDocument.cpp: Modernize the MediaDocumentParser constructor.
(WebCore::MediaDocumentParser::createDocumentStructure): Instead of setSrc, use
setAttributeWithoutSynchronization for the src attribute just as we do for all the
other attributes of the newly created video element.

* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::wirelessVideoPlaybackDisabled): Use reference to
value of attribute instead of copy to avoid reference count churn.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::defaultSubstituteDataForURL): Ditto.
* rendering/RenderThemeIOS.mm:
(WebCore::getAttachmentProgress): Ditto.
* rendering/RenderThemeMac.mm:
(WebCore::AttachmentLayout::layOutSubtitle): Ditto.
(WebCore::RenderThemeMac::paintAttachment): Ditto.
* svg/SVGHKernElement.cpp:
(WebCore::SVGHKernElement::buildHorizontalKerningPair): Ditto.
* svg/SVGVKernElement.cpp:
(WebCore::SVGVKernElement::buildVerticalKerningPair): Ditto.
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::buildPendingResource): Ditto. Also use parentElement
instead of writing out code that does exactly what it does.

Source/WebKit/mac:

* WebView/WebHTMLRepresentation.mm:
(matchLabelsAgainstElement): Added handling of nullptr since nothing guarantees the
passed in element can't be null. Removed unnecessary conversion from NSString to String
and then back to NSString.

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

2 years agoCan't use Object.defineProperty() to add an item to a DOMStringMap or Storage
weinig@apple.com [Sun, 4 Jun 2017 18:00:01 +0000 (18:00 +0000)]
Can't use Object.defineProperty() to add an item to a DOMStringMap or Storage
https://bugs.webkit.org/show_bug.cgi?id=172687

Reviewed by Darin Adler.

Source/WebCore:

- Adds support for generating the defineOwnProperty ClassInfo method table hook
  to add support for Object.defineProperty(). The implementation follows WebIDL
  section 3.9.3 [[DefineOwnProperty]].
  (https://heycam.github.io/webidl/#legacy-platform-object-defineownproperty)
- Adds support for generating named setters in addition to the already supported
  indexed setters as much of the required work was needed to make defineOwnProperty
  work for those properties. This patch does not aim to follow WebIDL faithfully,
  but rather to generate as close to the custom code as possible. A follow up
  change will attempt to match WebIDL more closely (which will also require changes
  to [[GetOwnPropertySlot]]).
- Removes the need for custom bindings in DOMStringMap, HTMLOptionsCollection and
  HTMLSelectElement. Gets us one function away from supporting Storage.
- Tidies up generated headers a bit by grouping all the ClassInfo method table hooks
  together.
- Removes support for CustomIndexedSetter, which is no longer used.

Test: js/dom/legacy-platform-object-defineOwnProperty.html

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
Removed now unneeded custom bindings.

* bindings/js/JSDOMStringMapCustom.cpp: Removed.
* bindings/js/JSHTMLOptionsCollectionCustom.cpp: Removed.
* bindings/js/JSHTMLSelectElementCustom.cpp: Removed.
* bindings/js/JSHTMLSelectElementCustom.h: Removed.
* bindings/js/JSStorageCustom.cpp:
(WebCore::JSStorage::putDelegate): Deleted.
Remove more code that is now generated.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateIndexedGetter):
- Add missing check for indexed setter operation when determining if the property should be ReadOnly.
- Add support for custom implementation name, matching GenerateNamedGetter.
- Convert to taking an outputArray and indent to allow more flexibility going forward.

(GenerateNamedGetter):
- Add missing check for named setter operation when determining if the property should be ReadOnly.
- Convert to taking an outputArray and indent to allow more flexibility going forward.

(GenerateGetOwnPropertySlotBody):
- Convert to taking an outputArray and indent to allow more flexibility going forward.
- Take over responsibility for checking and bailing if CustomGetOwnPropertySlot is set.

(GenerateGetOwnPropertySlotBodyByIndex):
- Convert to taking an outputArray and indent to allow more flexibility going forward.
- Take over responsibility for checking and bailing if CustomGetOwnPropertySlotByIndex is set.

(GenerateGetOwnPropertyNames):
- Convert to taking an outputArray and indent to allow more flexibility going forward.
- Take over responsibility for checking and bailing if CustomEnumerateProperty is set.

(GenerateInvokeIndexedPropertySetter):
Added. Implements the 'invoke an indexed property setter' algorithm (https://heycam.github.io/webidl/#invoke-indexed-setter)

(GenerateInvokeNamedPropertySetter):
Added. Implements the 'invoke a named property setter' algorithm (https://heycam.github.io/webidl/#invoke-named-setter)

(GeneratePut):
(GeneratePutByIndex):
- Convert to taking an outputArray and indent to allow more flexibility going forward.
- Take over responsibility for checking and bailing if CustomPut is set.
- Adds support for CEReactions.
- Adopts GenerateInvokeIndexedPropertySetter and GenerateInvokeNamedPropertySetter to
  simplify code.
- Removes support for CustomIndexedSetter, which is no longer used.
- Replaces use direct checking of OverrideBuiltins with check if any interface it inherits
  has it, which is how it is specified to work.

(GenerateIsUnforgeablePropertyName):
Added. Helper subroutine to generate a function that compares a property name
agains all the property names defined as Unforgeable on the interface. Used by
GenerateDefineOwnProperty.

(GenerateDefineOwnProperty):
Added. Implements section 3.9.3 [[DefineOwnProperty]] (https://heycam.github.io/webidl/#legacy-platform-object-defineownproperty)
Adds support for CEReactions.

(GenerateDeletePropertyCommon):
Switch from getting OverrideBuiltins directly off the interface to using InheritsExtendedAttribute.

(GenerateNamedDeleterDefinition):
Switch signature to match peer generators.

(InstanceOverridesGetOwnPropertySlot):
Update for rename of JSCustomGetOwnPropertySlotAndDescriptor to CustomGetOwnPropertySlotAndDescriptor.

(InstanceOverridesGetOwnPropertySlotByIndex):
Added. Like InstanceOverridesGetOwnPropertySlot, but checks for the new CustomGetOwnPropertySlotByIndex
rather than CustomGetOwnPropertySlot.

(InstanceOverridesGetOwnPropertyNames):
Added. Moves complex predicate out of line.

(InstanceOverridesPut):
Removes now unused CustomIndexedSetter, and adds CustomPutFunction, which used to be checked separately.

(InstanceOverridesDefineOwnProperty):
Added.

(GenerateHeader):
- Moves more structure flags together.
- Simplifies predicates and moves the ClassInfo method table hooks together.

(GenerateImplementation):
- Moves the ClassInfo method table hooks together
- Adds call to GenerateDefineOwnProperty.

(GenerateLegacyCallerDefinitions):
Simplify bail condition to match other generators.

(GeneratePrototypeDeclaration):
Update for new extended attribute names.

(InstanceOverridesCall):
Renamed from IsCallable for consistency.

(HasComplexGetOwnProperty):
Deleted. Unused.

(InstanceOverridesPutImplementation):
Deleted. Unused.

(InstanceOverridesPutDeclaration):
Deleted. Unused.

(IsCallable):
Renamed, for consistency, to InstanceOverridesCall .

* bindings/scripts/IDLAttributes.json:
Renames a few of the extended attributes to remove the JS prefix. This time
around I only did the ones in the area I was working, but we should probably
remove most of the rest.

* css/CSSStyleDeclaration.idl:
Update for JSCustomGetOwnPropertySlotAndDescriptor -> CustomGetOwnPropertySlotAndDescriptor rename.

* dom/DOMStringMap.idl:
Remove CustomNamedSetter and add uncomment out the setter.

* dom/DatasetDOMStringMap.cpp:
(WebCore::DatasetDOMStringMap::setNamedItem):
(WebCore::DatasetDOMStringMap::setItem): Deleted.
* dom/DatasetDOMStringMap.h:
Rename setItem to setNamedItem, which is what the generator expects.

* dom/Node.idl:
Update for JSCustomPushEventHandlerScope -> CustomPushEventHandlerScope rename.

* html/HTMLAppletElement.idl:
* html/HTMLEmbedElement.idl:
* html/HTMLObjectElement.idl:
Update for JSCustomGetOwnPropertySlotAndDescriptor -> CustomGetOwnPropertySlotAndDescriptor rename.

* html/HTMLCollection.cpp:
(WebCore::HTMLCollection::isSupportedPropertyName):
* html/HTMLCollection.h:
Add isSupportedPropertyName function which is used by the bindings and is now needed.

* html/HTMLElement.idl:
Update for JSCustomPushEventHandlerScope -> CustomPushEventHandlerScope rename.

* html/HTMLOptionsCollection.h:
(WebCore::HTMLOptionsCollection::setItem):
Add setItem() implementation which just forwards to the select element. Also, add
a type alias to make the implementations of item and namedItem less verbose.

* html/HTMLOptionsCollection.idl:
Remove CustomIndexedSetter and uncomment the setter.

* html/HTMLSelectElement.idl:
Remove CustomIndexedSetter and uncomment the setter. Also, reformat
to match the WHATWG spec.

* page/DOMWindow.idl:
Update for JSCustomDefineOwnProperty -> CustomDefineOwnProperty rename. Add
CustomGetOwnPropertySlotByIndex which is now needed to remove some unsound
assumptions the generator was making.

* page/Location.idl:
Update for removal of JS prefix from a bunch of extended attributes.

* page/UserMessageHandlersNamespace.idl:
Update for JSCustomGetOwnPropertySlotAndDescriptor -> CustomGetOwnPropertySlotAndDescriptor rename.

* storage/Storage.idl:
Remove CustomNamedSetter and uncomment the setter.

* bindings/scripts/test/JS/JSInterfaceName.h:
* bindings/scripts/test/JS/JSTestEventTarget.h:
* bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp: Added.
* bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.h: Added.
* bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp: Added.
* bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.h: Added.
* bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp: Added.
* bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.h: Added.
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp: Added.
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.h: Added.
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp: Added.
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.h: Added.
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp: Added.
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.h: Added.
* bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.h:
* bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.h:
* bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.h:
* bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.h:
* bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp: Added.
* bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.h: Added.
* bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp: Added.
* bindings/scripts/test/JS/JSTestNamedSetterThrowingException.h: Added.
* bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp: Added.
* bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.h: Added.
* bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp: Added.
* bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.h: Added.
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp: Added.
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.h: Added.
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp: Added.
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h: Added.
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
* bindings/scripts/test/TestIndexedSetterNoIdentifier.idl: Added.
* bindings/scripts/test/TestIndexedSetterThrowingException.idl: Added.
* bindings/scripts/test/TestIndexedSetterWithIdentifier.idl: Added.
* bindings/scripts/test/TestNamedAndIndexedSetterNoIdentifier.idl: Added.
* bindings/scripts/test/TestNamedAndIndexedSetterThrowingException.idl: Added.
* bindings/scripts/test/TestNamedAndIndexedSetterWithIdentifier.idl: Added.
* bindings/scripts/test/TestNamedDeleterWithIdentifier.idl:
* bindings/scripts/test/TestNamedSetterNoIdentifier.idl: Added.
* bindings/scripts/test/TestNamedSetterThrowingException.idl: Added.
* bindings/scripts/test/TestNamedSetterWithIdentifier.idl: Added.
* bindings/scripts/test/TestNamedSetterWithOverrideBuiltins.idl: Added.
* bindings/scripts/test/TestNamedSetterWithUnforgableProperties.idl: Added.
* bindings/scripts/test/TestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.idl: Added.
Added new tests and updated some results.

LayoutTests:

* js/dom/legacy-platform-object-defineOwnProperty-expected.txt: Added.
* js/dom/legacy-platform-object-defineOwnProperty.html: Added.
New tests for Object.defineProperty on Storage and DOMStringMap.

* js/dom/named-property-deleter.html:
Fix test which was deleting the wrong property. This doesn't change the result,
but is now actually testing the thing it meant to.

* storage/domstorage/localstorage/delete-defineproperty-removal-expected.txt:
* storage/domstorage/localstorage/delete-defineproperty-removal.html:
Convert to testharness.js and show that the results are now correct.

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

2 years agoObject bounding box wrong for some paths
simon.fraser@apple.com [Sun, 4 Jun 2017 17:57:03 +0000 (17:57 +0000)]
Object bounding box wrong for some paths
https://bugs.webkit.org/show_bug.cgi?id=172866

Reviewed by Tim Horton.
Source/WebCore:

RenderSVGShape::calculateObjectBoundingBox() should use boundingRect()
rather than fastBoundingRect(), because the latter includes control points.

Covered by existing tests.

* rendering/svg/RenderSVGShape.cpp:
(WebCore::RenderSVGShape::calculateObjectBoundingBox):

LayoutTests:

So many new baselines.

* platform/ios/svg/W3C-SVG-1.1-SE/paths-dom-02-f-expected.txt:
* platform/ios/svg/W3C-SVG-1.1/animate-elem-06-t-expected.txt:
* platform/ios/svg/W3C-SVG-1.1/animate-elem-08-t-expected.txt:
* platform/ios/svg/W3C-SVG-1.1/animate-elem-83-t-expected.txt:
* platform/ios/svg/W3C-SVG-1.1/filters-example-01-b-expected.txt:
* platform/ios/svg/W3C-SVG-1.1/metadata-example-01-b-expected.txt:
* platform/ios/svg/W3C-SVG-1.1/paths-data-01-t-expected.txt:
* platform/ios/svg/W3C-SVG-1.1/paths-data-02-t-expected.txt:
* platform/ios/svg/W3C-SVG-1.1/paths-data-03-f-expected.txt:
* platform/ios/svg/W3C-SVG-1.1/paths-data-12-t-expected.txt:
* platform/ios/svg/W3C-SVG-1.1/text-path-01-b-expected.txt:
* platform/ios/svg/batik/text/longTextOnPath-expected.txt:
* platform/ios/svg/batik/text/smallFonts-expected.txt:
* platform/ios/svg/batik/text/textAnchor-expected.txt:
* platform/ios/svg/batik/text/textDecoration-expected.txt:
* platform/ios/svg/batik/text/textEffect-expected.txt:
* platform/ios/svg/batik/text/textEffect2-expected.txt:
* platform/ios/svg/batik/text/textEffect3-expected.txt:
* platform/ios/svg/batik/text/textFeatures-expected.txt:
* platform/ios/svg/batik/text/textGlyphOrientationHorizontal-expected.txt:
* platform/ios/svg/batik/text/textLayout-expected.txt:
* platform/ios/svg/batik/text/textLayout2-expected.txt:
* platform/ios/svg/batik/text/textLength-expected.txt:
* platform/ios/svg/batik/text/textOnPath-expected.txt:
* platform/ios/svg/batik/text/textOnPathSpaces-expected.txt:
* platform/ios/svg/batik/text/textPosition-expected.txt:
* platform/ios/svg/batik/text/textPosition2-expected.txt:
* platform/ios/svg/batik/text/textProperties-expected.txt:
* platform/ios/svg/batik/text/textProperties2-expected.txt:
* platform/ios/svg/batik/text/textStyles-expected.txt:
* platform/ios/svg/batik/text/verticalText-expected.txt:
* platform/ios/svg/batik/text/verticalTextOnPath-expected.txt:
* platform/ios/svg/custom/broken-internal-references-expected.txt:
* platform/ios/svg/custom/path-textPath-simulation-expected.txt:
* platform/ios/svg/custom/relative-sized-use-on-symbol-expected.txt:
* platform/ios/svg/custom/relative-sized-use-without-attributes-on-symbol-expected.txt:
* platform/ios/svg/custom/second-inline-text-expected.txt:
* platform/ios/svg/text/text-path-01-b-expected.txt:
* platform/mac/svg/W3C-SVG-1.1-SE/paths-dom-02-f-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/animate-elem-06-t-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/animate-elem-07-t-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/animate-elem-08-t-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/animate-elem-83-t-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/filters-example-01-b-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/metadata-example-01-b-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/paths-data-01-t-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/paths-data-02-t-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/paths-data-03-f-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/paths-data-12-t-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/text-path-01-b-expected.txt:
* platform/mac/svg/batik/filters/filterRegions-expected.txt:
* platform/mac/svg/batik/paints/patternPreserveAspectRatioA-expected.txt:
* platform/mac/svg/batik/paints/patternRegionA-expected.txt:
* platform/mac/svg/batik/paints/patternRegions-expected.txt:
* platform/mac/svg/batik/text/smallFonts-expected.txt:
* platform/mac/svg/batik/text/textAnchor-expected.txt:
* platform/mac/svg/batik/text/textEffect2-expected.txt:
* platform/mac/svg/batik/text/textEffect3-expected.txt:
* platform/mac/svg/batik/text/textFeatures-expected.txt:
* platform/mac/svg/batik/text/textGlyphOrientationHorizontal-expected.txt:
* platform/mac/svg/batik/text/textLayout-expected.txt:
* platform/mac/svg/batik/text/textLayout2-expected.txt:
* platform/mac/svg/batik/text/textOnPathSpaces-expected.txt:
* platform/mac/svg/batik/text/textPosition2-expected.txt:
* platform/mac/svg/batik/text/textProperties-expected.txt:
* platform/mac/svg/batik/text/textProperties2-expected.txt:
* platform/mac/svg/batik/text/textStyles-expected.txt:
* platform/mac/svg/custom/animate-path-morphing-expected.txt:
* platform/mac/svg/custom/broken-internal-references-expected.txt:
* platform/mac/svg/custom/path-textPath-simulation-expected.txt:
* platform/mac/svg/custom/relative-sized-use-on-symbol-expected.txt:
* platform/mac/svg/custom/relative-sized-use-without-attributes-on-symbol-expected.txt:
* platform/mac/svg/custom/second-inline-text-expected.txt:
* platform/mac/svg/dom/SVGPathSegList-segment-modification-expected.txt:
* platform/mac/svg/hixie/perf/001-expected.txt:
* platform/mac/svg/hixie/perf/002-expected.txt:
* platform/mac/svg/text/text-path-01-b-expected.txt:
* platform/mac/svg/zoom/page/zoom-svg-through-object-with-override-size-expected.txt:
* svg/custom/control-points-for-S-and-T-expected.txt:
* svg/custom/use-nested-transform-expected.txt:

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

2 years agoFix build of Windows-specific code with ICU 59.1
annulen@yandex.ru [Sun, 4 Jun 2017 16:38:39 +0000 (16:38 +0000)]
Fix build of Windows-specific code with ICU 59.1
https://bugs.webkit.org/show_bug.cgi?id=172729

Reviewed by Darin Adler.

Source/JavaScriptCore:

Fix conversions from WTF::String to wchar_t* and vice versa.

* jsc.cpp:
(currentWorkingDirectory):
(fetchModuleFromLocalFileSystem):
* runtime/DateConversion.cpp:
(JSC::formatDateTime):

Source/WebCore:

Fix conversions from WTF::String to wchar_t* and vice versa.
No new tests needed.

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

Source/WebKit/win:

Fix conversions from WTF::String to wchar_t* and vice versa.

* Plugins/PluginDatabaseWin.cpp:
(WebCore::addPluginPathsFromRegistry):
(WebCore::PluginDatabase::getPluginPathsInDirectories):
(WebCore::addMozillaPluginDirectories):
(WebCore::addWindowsMediaPlayerPluginDirectory):
(WebCore::addAdobeAcrobatPluginDirectory):
(WebCore::addJavaPluginDirectory):
(WebCore::safariPluginsDirectory):
(WebCore::addMacromediaPluginDirectories):
* Plugins/PluginPackageWin.cpp:
(WebCore::getVersionInfo):
(WebCore::PluginPackage::fetchInfo):
(WebCore::PluginPackage::load):
* Plugins/PluginViewWin.cpp:
(WebCore::PluginView::handlePostReadFile):

Source/WTF:

* wtf/text/win/WCharStringExtras.h: Added new header file wuth helper
functions for conversion between WTF::String and wchart_t*.
(WTF::stringToNullTerminatedWChar):
(WTF::wcharToString):
(WTF::nullTerminatedWCharToString):

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

2 years ago[JSC] Drop unnecessary USE(CF) guard for getenv
utatane.tea@gmail.com [Sun, 4 Jun 2017 16:26:59 +0000 (16:26 +0000)]
[JSC] Drop unnecessary USE(CF) guard for getenv
https://bugs.webkit.org/show_bug.cgi?id=172903

Reviewed by Sam Weinig.

getenv is not related to USE(CF) and OS(UNIX). It seems that this
ifdef only hits in WinCairo, but WinCairo can use getenv.
Moreover, in VM::VM, we already use getenv without any ifdef guard.

This patch just drops it.

* runtime/VM.cpp:
(JSC::enableAssembler):

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

2 years ago[JSC] Drop OS(DARWIN) for uintptr_t type conflict
utatane.tea@gmail.com [Sun, 4 Jun 2017 16:21:52 +0000 (16:21 +0000)]
[JSC] Drop OS(DARWIN) for uintptr_t type conflict
https://bugs.webkit.org/show_bug.cgi?id=172904

Reviewed by Sam Weinig.

In non-Darwin environment, uintptr_t may have the same type
to uint64_t. We avoided the compile error by using OS(DARWIN).
But, since it depends on cstdint implementaion rather than OS, it is flaky.
Instead, we just use template parameter IntegralType.
And we describe the type constraint in a SFINAE manner.

* dfg/DFGOpInfo.h:
(JSC::DFG::OpInfo::OpInfo):

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

2 years agoUnreviewed test gardening
jbedard@apple.com [Sun, 4 Jun 2017 15:51:12 +0000 (15:51 +0000)]
Unreviewed test gardening

Gardening test expectations for layout tests on iOS device. Moving
expectations for tests which fail on Simulator but pass on device.

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

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

2 years agoImplement DOMMatrixReadOnly.transformPoint()
cdumez@apple.com [Sun, 4 Jun 2017 15:21:52 +0000 (15:21 +0000)]
Implement DOMMatrixReadOnly.transformPoint()
https://bugs.webkit.org/show_bug.cgi?id=172900

Reviewed by Simon Fraser.

LayoutTests/imported/w3c:

Rebaseline W3C test now that more checks are passing.

* web-platform-tests/css/geometry-1/DOMMatrix-newobject-expected.txt:

Source/WebCore:

Implement DOMMatrixReadOnly.transformPoint():
- https://drafts.fxtf.org/geometry/#dommatrixreadonly
- https://drafts.fxtf.org/geometry/#dom-dommatrixreadonly-transformpoint

Test: imported/blink/fast/dom/geometry-interfaces-dom-matrix-transformPoint.html

* css/DOMMatrixReadOnly.cpp:
(WebCore::DOMMatrixReadOnly::transformPoint):
* css/DOMMatrixReadOnly.h:
* css/DOMMatrixReadOnly.idl:

LayoutTests:

* imported/blink/fast/dom/geometry-interfaces-dom-matrix-transformPoint-expected.txt: Added.
* imported/blink/fast/dom/geometry-interfaces-dom-matrix-transformPoint.html: Added.
* imported/blink/fast/dom/resources/geometry-interfaces-test-helpers.js: Added.
Import test coverage from Blink.

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

2 years agoUnreviewed GTK+ gardening. Add a few test failure expectations, linking them to
zandobersek@gmail.com [Sun, 4 Jun 2017 11:26:50 +0000 (11:26 +0000)]
Unreviewed GTK+ gardening. Add a few test failure expectations, linking them to
existing bugs. Update or add GTK+-specific baselines for three tests.

* platform/gtk/TestExpectations:
* platform/gtk/accessibility/disabled-controls-not-focusable-expected.txt: Added.
* platform/gtk/compositing/backing-store-attachment-1-expected.txt: Added.
* platform/gtk/css1/box_properties/acid_test-expected.txt:

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

2 years ago[GCrypt] Improve comments in AES, PBKDF2, RSA-SSA algorithm implementations
zandobersek@gmail.com [Sun, 4 Jun 2017 10:24:44 +0000 (10:24 +0000)]
[GCrypt] Improve comments in AES, PBKDF2, RSA-SSA algorithm implementations
https://bugs.webkit.org/show_bug.cgi?id=172894

Reviewed by Michael Catanzaro.

Add or improve code comments in libgcrypt implementations for the AES_CBC,
AES_GCM, AES_KW, PBKDF2 and RSA-SSA algorithms.

* crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp: Add generic comments that
describe each operation that's performed.
(WebCore::gcryptEncrypt):
(WebCore::gcryptDecrypt):
* crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp: Ditto.
(WebCore::gcryptEncrypt):
(WebCore::gcryptDecrypt):
* crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp: Ditto.
(WebCore::gcryptWrapKey):
(WebCore::gcryptUnwrapKey):
* crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp: Ditto.
(WebCore::gcryptDeriveBits):
* crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp:
(WebCore::gcryptVerify): Align the verification results comment with the
one that's used in the ECDSA implementation.

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

2 years agoImplement DOMMatrix's fromFloat32Array / fromFloat64Array & toFloat32Array / toFloat6...
cdumez@apple.com [Sun, 4 Jun 2017 01:54:14 +0000 (01:54 +0000)]
Implement DOMMatrix's fromFloat32Array / fromFloat64Array & toFloat32Array / toFloat64Array
https://bugs.webkit.org/show_bug.cgi?id=172898

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

Rebaseline web-platform-test now that more checks are passing.

* web-platform-tests/css/geometry-1/DOMMatrix-newobject-expected.txt:

Source/WebCore:

Implement DOMMatrix's fromFloat32Array / fromFloat64Array & toFloat32Array / toFloat64Array
as per:
- https://drafts.fxtf.org/geometry/#dommatrixreadonly

Test: http/wpt/geometry/DOMMatrix-from-to-typed-arrays.html

* css/DOMMatrix.cpp:
(WebCore::DOMMatrix::fromFloat32Array):
(WebCore::DOMMatrix::fromFloat64Array):
* css/DOMMatrix.h:
* css/DOMMatrix.idl:
* css/DOMMatrixReadOnly.cpp:
(WebCore::DOMMatrixReadOnly::fromFloat32Array):
(WebCore::DOMMatrixReadOnly::fromFloat64Array):
(WebCore::DOMMatrixReadOnly::toFloat32Array):
(WebCore::DOMMatrixReadOnly::toFloat64Array):
* css/DOMMatrixReadOnly.h:
* css/DOMMatrixReadOnly.idl:

LayoutTests:

Add layout test coverage.

* http/wpt/geometry/DOMMatrix-from-to-typed-arrays-expected.txt: Added.
* http/wpt/geometry/DOMMatrix-from-to-typed-arrays.html: Added.

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

2 years agoImplement DOMPointReadOnly.matrixTransform()
simon.fraser@apple.com [Sat, 3 Jun 2017 21:09:00 +0000 (21:09 +0000)]
Implement DOMPointReadOnly.matrixTransform()
https://bugs.webkit.org/show_bug.cgi?id=172896

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

New baselines.

* web-platform-tests/css/geometry-1/DOMPoint-002-expected.txt:
* web-platform-tests/css/geometry-1/historical-expected.txt:

Source/WebCore:

DOMPointReadOnly.matrixTransform() creates the matrix or throws, then uses
a new function in TransformationMatrix to map x,y,z,w through the matrix.

Test: http/wpt/geometry/DOMPoint-003.html

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/DOMMatrixReadOnly.h:
(WebCore::DOMMatrixReadOnly::transformationMatrix):
* dom/DOMPointReadOnly.cpp: Copied from Source/WebCore/dom/DOMPointReadOnly.idl.
(WebCore::DOMPointReadOnly::matrixTransform):
* dom/DOMPointReadOnly.h:
* dom/DOMPointReadOnly.idl:
* platform/graphics/transforms/TransformationMatrix.cpp:
(WebCore::TransformationMatrix::map4ComponentPoint):
* platform/graphics/transforms/TransformationMatrix.h:

LayoutTests:

DOMPoint-003.html should be upstreamed at some point.

* http/wpt/geometry/DOMPoint-003-expected.txt: Added.
* http/wpt/geometry/DOMPoint-003.html: Added.

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

2 years agoCleanup arguments to preparePlatformFont() and fontWithFamily() in FontCacheCoreText.cpp
mmaxfield@apple.com [Sat, 3 Jun 2017 18:07:17 +0000 (18:07 +0000)]
Cleanup arguments to preparePlatformFont() and fontWithFamily() in FontCacheCoreText.cpp
https://bugs.webkit.org/show_bug.cgi?id=172886

Reviewed by Simon Fraser.

The number of arguments is getting out of control.

No new tests because there is no behavior change.

* platform/graphics/FontCache.h:
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::preparePlatformFont):
(WebCore::fontWithFamily):
(WebCore::FontCache::createFontPlatformData):
(WebCore::FontCache::systemFallbackForCharacters):
* platform/graphics/mac/FontCacheMac.mm:
(WebCore::platformFontWithFamilySpecialCase):
* platform/graphics/mac/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::fontPlatformData):
* platform/spi/cocoa/CoreTextSPI.h:

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

2 years agoUnreviewed test gardening
jbedard@apple.com [Sat, 3 Jun 2017 17:58:06 +0000 (17:58 +0000)]
Unreviewed test gardening

* platform/ios/TestExpectations: Update expectation for tests passing
after https://bugs.webkit.org/show_bug.cgi?id=139968.

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

2 years agoScript modules should be able to import data urls
utatane.tea@gmail.com [Sat, 3 Jun 2017 16:31:13 +0000 (16:31 +0000)]
Script modules should be able to import data urls
https://bugs.webkit.org/show_bug.cgi?id=171594

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/scripting-1/the-script-element/data-url-expected.txt:
* web-platform-tests/html/webappapis/scripting/processing-model-2/compile-error-data-url-expected.txt:
* web-platform-tests/html/webappapis/scripting/processing-model-2/runtime-error-data-url-expected.txt:

Source/WebCore:

Tests: js/dom/classic-script-with-data-url.html
       js/dom/modules/module-script-with-data-url.html

Script tag resources should have SameOriginDataURLFlag::Set to load data URLs
since script tags should treat data URLs as same origin.

* bindings/js/CachedScriptFetcher.cpp:
(WebCore::CachedScriptFetcher::requestScriptWithCache):

LayoutTests:

* http/tests/security/script-with-dataurl-expected.txt:
* http/tests/security/script-with-dataurl.html:
Now, the spec is changed and errors from data: scripts should not be muted.
https://github.com/whatwg/html/issues/1778

* js/dom/classic-script-with-data-url-expected.txt: Added.
* js/dom/classic-script-with-data-url.html: Added.
* js/dom/modules/module-script-with-data-url-expected.txt: Added.
* js/dom/modules/module-script-with-data-url.html: Added.

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

2 years agoSort the project file.
simon.fraser@apple.com [Sat, 3 Jun 2017 16:21:38 +0000 (16:21 +0000)]
Sort the project file.

Source/WebCore:

* WebCore.xcodeproj/project.pbxproj:

Source/WebKit2:

* WebKit2.xcodeproj/project.pbxproj:

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

2 years agowebkitpy: Add contextmanager to disable logging for a block
jbedard@apple.com [Sat, 3 Jun 2017 16:11:31 +0000 (16:11 +0000)]
webkitpy: Add contextmanager to disable logging for a block
https://bugs.webkit.org/show_bug.cgi?id=172876

Reviewed by Daniel Bates.

Add a context manager which will use an OutputCapture object to capture logging
in a block and hold it in a variable.

* Scripts/webkitpy/common/system/outputcapture.py:
(OutputCaptureScope):
(OutputCaptureScope.__init__): Construct with OutputCapture object.
(OutputCaptureScope.__enter__): Begin capturing output.
(OutputCaptureScope.__exit__): Restore output and save captured output to a variable.
output and retain the resulting log.
* Scripts/webkitpy/common/system/outputcapture_unittest.py:
(OutputCaptureTest.test_output_capture_scope): Added.

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

2 years agoMove css3/flexbox/image-percent-max-height.html failure expectation.
jbedard@apple.com [Sat, 3 Jun 2017 15:26:03 +0000 (15:26 +0000)]
Move css3/flexbox/image-percent-max-height.html failure expectation.
https://bugs.webkit.org/show_bug.cgi?id=126898

Unreviewed test gardening

css3/flexbox/image-percent-max-height.html fails on iOS-simulator,
but passes on device.

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

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

2 years ago[ARM] Unreviewed buildfix after r217711.
ossy@webkit.org [Sat, 3 Jun 2017 13:36:31 +0000 (13:36 +0000)]
[ARM] Unreviewed buildfix after r217711.

* assembler/MacroAssemblerARM.h:
(JSC::MacroAssemblerARM::xor32):

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

2 years agoASSERTION FAILED: "We should only declare a function as a lexically scoped variable...
utatane.tea@gmail.com [Sat, 3 Jun 2017 11:24:45 +0000 (11:24 +0000)]
ASSERTION FAILED: "We should only declare a function as a lexically scoped variable in scopes where var declarations aren't allowed. ..." for function redeclaration with async function module export
https://bugs.webkit.org/show_bug.cgi?id=168844

Reviewed by Saam Barati.

JSTests:

* modules/async-function-export.js: Added.
(f):
(export.async.f):

Source/JavaScriptCore:

As the same to the exported function declaration, we should set statementDepth = 1 for exported async function declaration.

* parser/Parser.cpp:
(JSC::DepthManager::DepthManager):
(JSC::Parser<LexerType>::parseExportDeclaration):
* parser/Parser.h:
(JSC::Parser::DepthManager::DepthManager): Deleted.
(JSC::Parser::DepthManager::~DepthManager): Deleted.

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

2 years ago[GCrypt] Gather SUBTLE_CRYPTO utility functions in a single header
zandobersek@gmail.com [Sat, 3 Jun 2017 10:29:32 +0000 (10:29 +0000)]
[GCrypt] Gather SUBTLE_CRYPTO utility functions in a single header
https://bugs.webkit.org/show_bug.cgi?id=172870

Reviewed by Jiewen Tan.

Gather the helper functions used across different source files
for libgcrypt-backed SUBTLE_CRYPTO implementations in a single
header file.

* crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp:
(WebCore::hashCryptoDigestAlgorithm): Deleted.
(WebCore::hashAlgorithmName): Deleted.
(WebCore::mpiData): Deleted.
* crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp:
(WebCore::gcryptDeriveBits):
(WebCore::macAlgorithmForHashFunction): Deleted.
* crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp:
(WebCore::gcryptDeriveBits):
* crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp:
(WebCore::mpiData): Deleted.
* crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp:
(WebCore::hashCryptoDigestAlgorithm): Deleted.
(WebCore::hashAlgorithmName): Deleted.
(WebCore::mpiData): Deleted.
* crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:
(WebCore::hashAlgorithmName): Deleted.
(WebCore::mpiData): Deleted.
* crypto/gcrypt/GCryptUtilities.h: Added.
(WebCore::hashAlgorithmName):
(WebCore::hmacAlgorithm):
(WebCore::digestAlgorithm):
(WebCore::hashCryptoDigestAlgorithm):
(WebCore::mpiData):

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

2 years ago[GCrypt] Fix PK verification for ECDSA
zandobersek@gmail.com [Sat, 3 Jun 2017 10:27:13 +0000 (10:27 +0000)]
[GCrypt] Fix PK verification for ECDSA
https://bugs.webkit.org/show_bug.cgi?id=172857

Reviewed by Michael Catanzaro.

No new tests -- covered by existing tests.

* crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp:
(WebCore::gcryptVerify): Return `true` if the verification succeeded or `false`
in any other case, avoiding spilling information about the exact cause of
verification failure.

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

2 years agohttp/tests/cache/disk-cache/shattered-deduplication.html is flaky
cdumez@apple.com [Sat, 3 Jun 2017 08:07:39 +0000 (08:07 +0000)]
http/tests/cache/disk-cache/shattered-deduplication.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=172868
<rdar://problem/31249379>

Reviewed by Antti Koivisto.

http/tests/cache/disk-cache/shattered-deduplication.html was flaky due to PDF banner
fade-in / fade-out animation.

<rdar://problem/31249379> is fixed for me with the proposed changes.

* http/tests/cache/disk-cache/shattered-deduplication-expected.html:
- Wait 1 second before calling notifyDone() to give the PDF as much time to render as
the test page.
- Reduce frame height to 30 to not have to worry about the PDF tool banner being visible
  or not (as it fades in and out). 30 is still enough to see the color and confirm the
  test is passing.

* http/tests/cache/disk-cache/shattered-deduplication.html:
- Reduce frame height to 30 to not have to worry about the PDF tool banner being visible
  or not (as it fades in and out). 30 is still enough to see the color and confirm the
  test is passing.

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

2 years agoCleanup FrameView::autoSizeIfEnabled.
zalan@apple.com [Sat, 3 Jun 2017 04:40:38 +0000 (04:40 +0000)]
Cleanup FrameView::autoSizeIfEnabled.
https://bugs.webkit.org/show_bug.cgi?id=172889
<rdar://problem/32550783>

Reviewed by Tim Horton.

Source/WebCore:

This patch ensures that we always have a clean tree (and a valid and current document size) when
setting m_autoSizeContentSize.

* page/FrameView.cpp:
(WebCore::FrameView::autoSizeIfEnabled):

Tools:

* TestWebKitAPI/Tests/WebKit2Cocoa/AutoLayoutIntegration.mm:
(-[AutoLayoutWKWebView load:withWidth:expectingContentSize:resettingWidth:]): progression.
(TEST):

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

2 years agoWeb Inspector: Don't create NavigationSidebarPanel classes until they are needed...
drousso@apple.com [Sat, 3 Jun 2017 03:44:51 +0000 (03:44 +0000)]
Web Inspector: Don't create NavigationSidebarPanel classes until they are needed by a Tab
https://bugs.webkit.org/show_bug.cgi?id=172621

Reviewed by Timothy Hatcher.

* UserInterface/Views/ContentBrowserTabContentView.js:
(WebInspector.ContentBrowserTabContentView):
(WebInspector.ContentBrowserTabContentView.prototype.shown):
* UserInterface/Views/TabContentView.js:
(WebInspector.TabContentView):
(WebInspector.TabContentView.prototype.get navigationSidebarPanel):

* UserInterface/Views/NetworkTabContentView.js:
(WebInspector.NetworkTabContentView.prototype.canShowRepresentedObject):
* UserInterface/Views/SearchTabContentView.js:
(WebInspector.SearchTabContentView.prototype.canShowRepresentedObject):
Use public getter for navigationSidebarPanel.

* UserInterface/Views/ResourceSidebarPanel.js:
(WebInspector.ResourceSidebarPanel):
(WebInspector.ResourceSidebarPanel.prototype.initialLayout): Added.
Load information about the current frame once the sidebar panel is displayed.

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

2 years agoWeb Inspector: Use initialLayout for DetailsSidebarPanel classes
drousso@apple.com [Sat, 3 Jun 2017 03:37:53 +0000 (03:37 +0000)]
Web Inspector: Use initialLayout for DetailsSidebarPanel classes
https://bugs.webkit.org/show_bug.cgi?id=172381

Reviewed by Timothy Hatcher.

* UserInterface/Views/ApplicationCacheDetailsSidebarPanel.js:
(WebInspector.ApplicationCacheDetailsSidebarPanel):
(WebInspector.ApplicationCacheDetailsSidebarPanel.prototype.initialLayout): Added.
(WebInspector.ApplicationCacheDetailsSidebarPanel.prototype.layout):
* UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
(WebInspector.DOMNodeDetailsSidebarPanel):
(WebInspector.DOMNodeDetailsSidebarPanel.prototype.initialLayout): Added.
(WebInspector.DOMNodeDetailsSidebarPanel.prototype.layout):
* UserInterface/Views/IndexedDatabaseDetailsSidebarPanel.js:
(WebInspector.IndexedDatabaseDetailsSidebarPanel):
(WebInspector.IndexedDatabaseDetailsSidebarPanel.prototype.initialLayout): Added.
(WebInspector.IndexedDatabaseDetailsSidebarPanel.prototype.layout):
* UserInterface/Views/LayerTreeDetailsSidebarPanel.js:
(WebInspector.LayerTreeDetailsSidebarPanel):
(WebInspector.LayerTreeDetailsSidebarPanel.prototype.initialLayout): Added.
(WebInspector.LayerTreeDetailsSidebarPanel.prototype.layout):
* UserInterface/Views/ProbeDetailsSidebarPanel.js:
(WebInspector.ProbeDetailsSidebarPanel):
(WebInspector.ProbeDetailsSidebarPanel.prototype.initialLayout): Added.
* UserInterface/Views/ResourceDetailsSidebarPanel.js:
(WebInspector.ResourceDetailsSidebarPanel):
(WebInspector.ResourceDetailsSidebarPanel.prototype.set resource):
(WebInspector.ResourceDetailsSidebarPanel.prototype.initialLayout): Added.
(WebInspector.ResourceDetailsSidebarPanel.prototype.layout):
(WebInspector.ResourceDetailsSidebarPanel.prototype._applyResourceEventListeners):

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

2 years agoREGRESSION(r216212): RenderReplaced::paint() should not save and restore the context...
wenson_hsieh@apple.com [Sat, 3 Jun 2017 02:27:27 +0000 (02:27 +0000)]
REGRESSION(r216212): RenderReplaced::paint() should not save and restore the context unless it has to
https://bugs.webkit.org/show_bug.cgi?id=172883
<rdar://problem/32548614>

Reviewed by Tim Horton.

After implementing dragged content fading, RenderReplace::paint is now always guarded by unnecessary calls to
GraphicsContext::save and GraphicsContext::restore, even when there is no dragged content being rendered. To
address this, we initialize our GraphicsContextStateSaver with saveAndRestore = false, indicating that we don't
want to immediately try and save the context.

If we are in a dragged content range, we will then call GraphicsContextStateSaver::save, which saves the
graphics context and also causes the GraphicsContextStateSaver to eventually try and restore() when it is
destroyed. Otherwise, in the common codepath where the renderer is not in a dragged content range, the
constructor and destructor of GraphicsContextStateSaver will be no-ops with respect to saving and restoring the
graphics context.

* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::paint):

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

2 years agoES2015 modules - Export default function hoisting
utatane.tea@gmail.com [Sat, 3 Jun 2017 01:35:00 +0000 (01:35 +0000)]
ES2015 modules - Export default function hoisting
https://bugs.webkit.org/show_bug.cgi?id=170174

Reviewed by Saam Barati.

This issue itself is solved by fixing function declaration hoisting rules.
This patch just adds the specific test to modules tests to ensure the bug
is fixed.

* modules/export-default-function-hoisting.js: Added.
* modules/export-default-function-hoisting/cappuccino.js: Added.
(import.drinkCocoa.from.string_appeared_here.export.default.drinkCappuccino):
* modules/export-default-function-hoisting/cocoa.js: Added.
(export.default.drinkCocoa):

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

2 years agoWeb Inspector: The CodeMirror instance in the ConsolePrompt does't need to be refresh...
drousso@apple.com [Sat, 3 Jun 2017 01:18:51 +0000 (01:18 +0000)]
Web Inspector: The CodeMirror instance in the ConsolePrompt does't need to be refreshed each time it is shown
https://bugs.webkit.org/show_bug.cgi?id=172608

Reviewed by Timothy Hatcher.

* UserInterface/Views/ConsolePrompt.js:
(WebInspector.ConsolePrompt.prototype.shown): Deleted.
* UserInterface/Views/DatabaseContentView.js:
(WebInspector.DatabaseContentView.prototype.shown): Deleted.
* UserInterface/Views/QuickConsole.js:
(WebInspector.QuickConsole):

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

2 years agoDefer installing mach breakpoint handler until watchdog is actually called
keith_miller@apple.com [Sat, 3 Jun 2017 01:09:50 +0000 (01:09 +0000)]
Defer installing mach breakpoint handler until watchdog is actually called
https://bugs.webkit.org/show_bug.cgi?id=172885

Reviewed by Saam Barati.

Eagerly installing the mach breakpoint handler causes issues with Xcode GUI debugging.
This hides the issue, so it won't occur as often.

* runtime/VMTraps.cpp:
(JSC::VMTraps::SignalSender::send):
(JSC::VMTraps::VMTraps): Deleted.
* runtime/VMTraps.h:

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

2 years agoWeb Inspector: Attributes table in Node Details Sidebar should have editable keys...
drousso@apple.com [Fri, 2 Jun 2017 23:58:39 +0000 (23:58 +0000)]
Web Inspector: Attributes table in Node Details Sidebar should have editable keys and values
https://bugs.webkit.org/show_bug.cgi?id=167076
<rdar://problem/30033629>

Reviewed by Timothy Hatcher.

* UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
(WebInspector.DOMNodeDetailsSidebarPanel.prototype._refreshAttributes):
(WebInspector.DOMNodeDetailsSidebarPanel.prototype._attributeNodeValueChanged):
(WebInspector.DOMNodeDetailsSidebarPanel.prototype._createAttributesDataGrid): Deleted.
Rework creation of the attributes DataGrid so that it is only created once and cleared for
new content. Nodes in the DataGrid are now EditableDataGridNode instances so that attribute
names and values can be changed from within the sidebar. The DataGrid is also sorted based
on attribute name, to make finding attributes easier.

* UserInterface/Views/DataGrid.css:
(.data-grid tr.editable .cell-content > input):
(body:not(.window-inactive, .window-docked-inactive) .data-grid:matches(:focus, .force-focus) tr.editable.selected .cell-content > input):

* UserInterface/Views/DetailsSection.css:
(.details-section > .content .data-grid tr:not(.editable) td.value-column):
(.details-section > .content .data-grid tr:not(.editable) td.value-column > div):
(.details-section > .content .data-grid td.value-column): Deleted.
(.details-section > .content .data-grid td.value-column > div): Deleted.

* UserInterface/Main.html:
* UserInterface/Views/EditableDataGridNode.js: Added.
(WebInspector.EditableDataGridNode):
(WebInspector.EditableDataGridNode.prototype.get element):
(WebInspector.EditableDataGridNode.prototype.createCellContent):
(WebInspector.EditableDataGridNode.prototype._handleKeyPress):
(WebInspector.EditableDataGridNode.prototype._handleBlur):
(WebInspector.EditableDataGridNode.prototype._notifyInputElementValueChanged):
Special type of DataGridNode that wraps the content of each cell in an <input>.

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

2 years agoResourceLoadStatistics are not using unique paths during test runs
cdumez@apple.com [Fri, 2 Jun 2017 23:48:50 +0000 (23:48 +0000)]
ResourceLoadStatistics are not using unique paths during test runs
https://bugs.webkit.org/show_bug.cgi?id=172861
<rdar://problem/32442251>

Reviewed by Darin Adler.

Source/WebKit2:

Add WKContextConfigurationSetResourceLoadStatisticsDirectory() C API to allow
WKTR to use a custom directory.

* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
(API::ProcessPoolConfiguration::ProcessPoolConfiguration):
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/C/WKContextConfigurationRef.cpp:
(WKContextConfigurationCopyResourceLoadStatisticsDirectory):
(WKContextConfigurationSetResourceLoadStatisticsDirectory):
* UIProcess/API/C/WKContextConfigurationRef.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::legacyWebsiteDataStoreConfiguration):

Tools:

Make sure WebKitTestRunner sets a temporary path for saving resource
load statistics.

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::generateContextConfiguration):

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

2 years agoREGRESSION(r213464): [iOS] Fonts get too bold when the "Bold Text" accessibility...
mmaxfield@apple.com [Fri, 2 Jun 2017 23:40:07 +0000 (23:40 +0000)]
REGRESSION(r213464): [iOS] Fonts get too bold when the "Bold Text" accessibility setting is enabled
https://bugs.webkit.org/show_bug.cgi?id=172737
Source/WebCore:

Reviewed by Simon Fraser.

Revert the part of r213464 which changed how we calculate the weights of system fonts.

Add an InternalSetting to trigger our mock of the accessbility "Bold Text" setting. We can't
use the real setting, so instead we just ask for bold fonts instead of regular fonts when this
setting is true.

Tests: fast/text/accessibility-bold-system-font.html
       fast/text/accessibility-bold-system-font-2.html

* platform/graphics/FontCache.h:
(WebCore::FontCache::shouldMockBoldSystemFontForAccessibility):
(WebCore::FontCache::setShouldMockBoldSystemFontForAccessibility):
* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::platformFontWithFamilySpecialCase):
* rendering/RenderTheme.h:
(WebCore::RenderTheme::shouldMockBoldSystemFontForAccessibility):
(WebCore::RenderTheme::setShouldMockBoldSystemFontForAccessibility):
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::cssWeightOfSystemFont):
(WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setShouldMockBoldSystemFontForAccessibility):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:

LayoutTests:

<rdar://problem/31608236>

Reviewed by Simon Fraser.

* fast/text/accessibility-bold-system-font-2-expected.html: Added.
* fast/text/accessibility-bold-system-font-2.html: Added.
* fast/text/accessibility-bold-system-font-expected.txt: Added.
* fast/text/accessibility-bold-system-font.html: Added.
* platform/mac/TestExpectations:

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

2 years agoMark webrtc/captureCanvas-webrtc.html as flaky on iOS.
ryanhaddad@apple.com [Fri, 2 Jun 2017 23:11:44 +0000 (23:11 +0000)]
Mark webrtc/captureCanvas-webrtc.html as flaky on iOS.
https://bugs.webkit.org/show_bug.cgi?id=170870

Unreviewed test gardening.

* platform/ios-wk2/TestExpectations:

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

2 years agoMove compositing/overflow/dynamic-composited-scrolling-status.html failure expectation.
jbedard@apple.com [Fri, 2 Jun 2017 23:10:53 +0000 (23:10 +0000)]
Move compositing/overflow/dynamic-composited-scrolling-status.html failure expectation.
https://bugs.webkit.org/show_bug.cgi?id=152439

Unreviewed test gardening

compositing/overflow/dynamic-composited-scrolling-status.html fails on iOS-simulator WK2,
but passes on device.

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

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

2 years agoMark webrtc/audio-replace-track.html as flaky on iOS and remove Timeout expectation...
ryanhaddad@apple.com [Fri, 2 Jun 2017 23:07:47 +0000 (23:07 +0000)]
Mark webrtc/audio-replace-track.html as flaky on iOS and remove Timeout expectation for macOS.
https://bugs.webkit.org/show_bug.cgi?id=171895

Unreviewed test gardening.

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

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

2 years agoPrevent scheme handlers from handling all built-in URL schemes.
beidson@apple.com [Fri, 2 Jun 2017 23:07:08 +0000 (23:07 +0000)]
Prevent scheme handlers from handling all built-in URL schemes.
<rdar://problem/32404790> and https://bugs.webkit.org/show_bug.cgi?id=172869

Reviewed by Andy Estes.

Source/WebCore:

Covered by API test.

This patch refactors SchemeRegistry to keep a base, constant set of each of the special
URL schemes that WebKit knows about by default.

It then exposes that list through a new method to support WK2 API.

* platform/SchemeRegistry.cpp:
(WebCore::allBuiltinSchemes):
(WebCore::builtinLocalURLSchemes):
(WebCore::localURLSchemes):
(WebCore::builtinSecureSchemes):
(WebCore::secureSchemes):
(WebCore::builtinSchemesWithUniqueOrigins):
(WebCore::schemesWithUniqueOrigins):
(WebCore::builtinEmptyDocumentSchemes):
(WebCore::emptyDocumentSchemes):
(WebCore::builtinCanDisplayOnlyIfCanRequestSchemes):
(WebCore::canDisplayOnlyIfCanRequestSchemes):
(WebCore::SchemeRegistry::removeURLSchemeRegisteredAsLocal):
(WebCore::builtinCORSEnabledSchemes):
(WebCore::CORSEnabledSchemes):
(WebCore::SchemeRegistry::isBuiltinScheme):
* platform/SchemeRegistry.h:

Source/WebKit2:

* UIProcess/API/Cocoa/WKWebView.mm:
(+[WKWebView handlesURLScheme:]): Check against WebCore's new master list of URL schemes.

Tools:

* TestWebKitAPI/Tests/WebKit2Cocoa/WKURLSchemeHandler-1.mm:

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

2 years agoAll scroll peformance logging should happen in the UI process
simon.fraser@apple.com [Fri, 2 Jun 2017 23:06:13 +0000 (23:06 +0000)]
All scroll peformance logging should happen in the UI process
https://bugs.webkit.org/show_bug.cgi?id=172874
rdar://problem/24474830

Reviewed by Tim Horton.

Printing to stdout from the WebProcess doesn't show up anywhere in non-development builds,
so we have to log from the UI process.

Achieve this by adding a PerformanceLoggingClient to Page which forwards messages to
WebPageProxy, which prints them with the same format they had before. Some plumbing through
PlatformCALayerClient and GraphicsLayerClient is required to get messages from TileControllers
through to something that can get to Page.

Source/WebCore:

* WebCore.xcodeproj/project.pbxproj:
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::~Page):
* page/Page.h:
(WebCore::Page::performanceLoggingClient):
* page/PageConfiguration.cpp:
* page/PageConfiguration.h:
* page/PerformanceLoggingClient.cpp: Added.
(WebCore::PerformanceLoggingClient::synchronousScrollingReasonsAsString):
* page/PerformanceLoggingClient.h: Added.
(WebCore::PerformanceLoggingClient::~PerformanceLoggingClient):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::reportExposedUnfilledArea):
(WebCore::AsyncScrollingCoordinator::reportSynchronousScrollingReasonsChanged):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::reportSynchronousScrollingReasonsChanged):
(WebCore::ScrollingTree::reportExposedUnfilledArea):
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::reportSynchronousScrollingReasonsChanged):
(WebCore::ThreadedScrollingTree::reportExposedUnfilledArea):
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition):
(WebCore::ScrollingTreeFrameScrollingNodeMac::exposedUnfilledArea):
(WebCore::ScrollingTreeFrameScrollingNodeMac::logExposedUnfilledArea): Deleted.
(WebCore::logThreadedScrollingMode): Deleted.
* platform/graphics/GraphicsLayerClient.h:
(WebCore::GraphicsLayerClient::logFilledVisibleFreshTile):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::platformCALayerLogFilledVisibleFreshTile):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCALayerClient.h:
(WebCore::PlatformCALayerClient::platformCALayerLogFilledVisibleFreshTile):
* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::logFilledVisibleFreshTile):
* platform/graphics/ca/TileController.h:
* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::platformCALayerPaintContents):
* platform/graphics/ca/TileGrid.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::logFilledVisibleFreshTile):
* rendering/RenderLayerBacking.h:

Source/WebKit2:

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::logScrollingEvent):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebPerformanceLoggingClient.cpp: Added.
(WebKit::WebPerformanceLoggingClient::WebPerformanceLoggingClient):
(WebKit::WebPerformanceLoggingClient::logScrollingEvent):
* WebProcess/WebCoreSupport/WebPerformanceLoggingClient.h: Added.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_cpuLimit):

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

2 years ago[JSCOnly] Build static jsc.exe on Windows
commit-queue@webkit.org [Fri, 2 Jun 2017 22:20:15 +0000 (22:20 +0000)]
[JSCOnly] Build static jsc.exe on Windows
https://bugs.webkit.org/show_bug.cgi?id=172833

Patch by Stephan Szabo <stephan.szabo@am.sony.com> on 2017-06-02
Reviewed by Konstantin Tokarev.

.:

* Source/cmake/OptionsJSCOnly.cmake:

Source/WTF:

* wtf/PlatformJSCOnly.cmake:

Tools:

* CMakeLists.txt:
* Scripts/build-jsc:

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

2 years agoDisable ViewportSizeForViewportUnits tests on iOS.
zalan@apple.com [Fri, 2 Jun 2017 22:12:26 +0000 (22:12 +0000)]
Disable ViewportSizeForViewportUnits tests on iOS.
https://bugs.webkit.org/show_bug.cgi?id=172872

Reviewed by Tim Horton.

* TestWebKitAPI/Tests/WebKit2/ViewportSizeForViewportUnits.mm:

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

2 years ago[MediaStream iOS] Cleanup video muting/unmuting when tab visibility changes
eric.carlson@apple.com [Fri, 2 Jun 2017 21:16:53 +0000 (21:16 +0000)]
[MediaStream iOS] Cleanup video muting/unmuting when tab visibility changes
https://bugs.webkit.org/show_bug.cgi?id=172858

Reviewed by Youenn Fablet.

Source/WebCore:

Test: platform/ios/mediastream/video-muted-in-background-tab.html

* dom/Document.cpp:
(WebCore::Document::visibilityStateChanged): Call notifyMediaCaptureOfVisibilityChanged.
(WebCore::Document::notifyMediaCaptureOfVisibilityChanged): Renamed from notifyVisibilityChangedToMediaCapture.
Set m_videoCaptureMutedForVisibilityChange when capture is muted because the document is hidden,
and clear it when visibility changes when capture is disabled. Don't unmute when the document
becomes visible unless this m_videoCaptureMutedForVisibilityChange is still true.
(WebCore::Document::notifyVisibilityChangedToMediaCapture): Deleted.
* dom/Document.h:

* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/RealtimeMediaSourceCenter.cpp:
(WebCore::RealtimeMediaSourceCenter::setVideoCaptureMutedForPageVisibility): Renamed from
setVisibility.
(WebCore::RealtimeMediaSourceCenter::setVisibility): Deleted.
* platform/mediastream/RealtimeMediaSourceCenter.h:

* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSourceFactory::setVideoCaptureMutedForPageVisibility): Ditto.
(WebCore::AVVideoCaptureSourceFactory::setVisibility): Deleted.

* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSourceFactory::setVideoCaptureMutedForPageVisibility): Ditto.
(WebCore::MockRealtimeVideoSourceFactory::setVisibility): Deleted.

LayoutTests:

* platform/ios/mediastream/video-muted-in-background-tab-expected.txt: Added.
* platform/ios/mediastream/video-muted-in-background-tab.html: Added.

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

2 years agoWeb Inspector: Existing query in Search tab doesn't perform search on reload
drousso@apple.com [Fri, 2 Jun 2017 20:57:17 +0000 (20:57 +0000)]
Web Inspector: Existing query in Search tab doesn't perform search on reload
https://bugs.webkit.org/show_bug.cgi?id=172663

Reviewed by Timothy Hatcher.

* Localizations/en.lproj/localizedStrings.js:

* UserInterface/Views/SearchSidebarPanel.css:
(.sidebar > .panel.navigation.search.changed > .banner):
(.sidebar > .panel.navigation.search.changed > .banner > a):
(.sidebar > .panel.navigation.search.changed > :matches(.content, .empty-content-placeholder)):

* UserInterface/Views/SearchSidebarPanel.js:
(WebInspector.SearchSidebarPanel.prototype.performSearch.resourcesCallback):
(WebInspector.SearchSidebarPanel.prototype._mainResourceDidChange):
(WebInspector.SearchSidebarPanel.prototype._contentChanged):
Listen for any "resource added" event, and show the content changed banner when one occurs.

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

2 years agoMoved test expectation for http/tests/preload/viewport/meta-viewport-link-headers...
jlewis3@apple.com [Fri, 2 Jun 2017 20:48:32 +0000 (20:48 +0000)]
Moved test expectation for http/tests/preload/viewport/meta-viewport-link-headers.php to correct file.
https://bugs.webkit.org/show_bug.cgi?id=172518

Unreviewed test gardening

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

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

2 years agoREGRESSION: LayoutTest fast/scrolling/arrow-key-scroll-in-rtl-document.html is a...
cdumez@apple.com [Fri, 2 Jun 2017 19:57:14 +0000 (19:57 +0000)]
REGRESSION: LayoutTest fast/scrolling/arrow-key-scroll-in-rtl-document.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=161549
<rdar://problem/28213429>

Reviewed by Simon Fraser.

* fast/scrolling/arrow-key-scroll-in-rtl-document.html:
Call eventSender.callAfterScrollingCompletes() in the next event loop iteration to
address the flakiness.

* platform/mac-wk2/TestExpectations:
Unskip test.

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

2 years ago[Mac] Include frames in the scrolling tree when ScrollingTreeIncludesFrames=true
fred.wang@free.fr [Fri, 2 Jun 2017 19:40:04 +0000 (19:40 +0000)]
[Mac] Include frames in the scrolling tree when ScrollingTreeIncludesFrames=true
https://bugs.webkit.org/show_bug.cgi?id=172825

Patch by Frederic Wang <fwang@igalia.com> on 2017-06-02
Reviewed by Simon Fraser.

Source/WebCore:

This commit generalizes RenderLayerCompositor/ScrollingCoordinator so that it handles the
case of non-main frames. When ScrollingTreeIncludesFrames=true, all the frames will appear
in the scrolling tree on Mac WK2.

Test: fast/scrolling/scrolling-tree-includes-frame.html

* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::coordinatesScrollingForFrameView): Do not to restrict to the
main frame.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateBacking): Do not to restrict to the main frame.
(WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer): Make this function a class
member so it can call hasCoordinatedScrolling and no longer needs a RenderView parameter.
(WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus): Do not to restrict to the
main frame.
* rendering/RenderLayerCompositor.h: Introduce useCoordinatedScrollingForLayer.

LayoutTests:

Add a new test to check whether a non-main frame appears in the scrolling tree when
ScrollingTreeIncludesFrames=true. For now this is only happens for Mac WK2. Also update
the iOS WK2 reference for scrolling-iframe-expected.html

* fast/scrolling/scrolling-tree-includes-frame-expected.txt: Added.
* fast/scrolling/scrolling-tree-includes-frame.html: Added.
* platform/ios-simulator/fast/scrolling/scrolling-tree-includes-frame-expected.txt: Added.
* platform/ios-wk2/compositing/iframes/scrolling-iframe-expected.txt: Update reference.
* platform/mac-wk1/fast/scrolling/scrolling-tree-includes-frame-expected.txt: Added.

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

2 years agoREGRESSION (r206386): Xactimate Website Crashes @ com.apple.WebKit: WebKit::NPRuntime...
cdumez@apple.com [Fri, 2 Jun 2017 19:15:54 +0000 (19:15 +0000)]
REGRESSION (r206386): Xactimate Website Crashes @ com.apple.WebKit: WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant + 255
https://bugs.webkit.org/show_bug.cgi?id=172846
<rdar://problem/31093005>

Reviewed by Mark Lam.

Follow-up to r217695 to deal with exceptions potentially thrown by
NPRuntimeObjectMap::convertJSValueToNPVariant() as well.

* WebProcess/Plugins/Netscape/NPJSObject.cpp:
(WebKit::NPJSObject::invoke):

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

2 years agoAdd abilility to specify presentingApplicationPID for a WebProcessPool.
commit-queue@webkit.org [Fri, 2 Jun 2017 19:04:59 +0000 (19:04 +0000)]
Add abilility to specify presentingApplicationPID for a WebProcessPool.
https://bugs.webkit.org/show_bug.cgi?id=172839
rdar://problem/32247170

Patch by Jeremy Jones <jeremyj@apple.com> on 2017-06-02
Reviewed by Tim Horton.

Expose presentingApplicationPID through WebProcessPoolConfiguration.
This allows rehosted WebViews to specify the hosting application.

* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration setPresentingApplicationPID:]):
(-[_WKProcessPoolConfiguration presentingApplicationPID]):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
(WebKit::WebProcessPool::createNewWebProcess):

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

2 years ago[WebCore] DragImageRef should correspond to USE(CAIRO)
commit-queue@webkit.org [Fri, 2 Jun 2017 19:04:53 +0000 (19:04 +0000)]
[WebCore] DragImageRef should correspond to USE(CAIRO)
https://bugs.webkit.org/show_bug.cgi?id=172863

Patch by Don Olmstead <don.olmstead@am.sony.com> on 2017-06-02
Reviewed by Carlos Alberto Lopez Perez.

No new tests. No change in behavior.

* platform/DragImage.h:

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

2 years ago[Mac] Use compositing for frames when ScrollingTreeIncludesFrames=true
fred.wang@free.fr [Fri, 2 Jun 2017 18:42:03 +0000 (18:42 +0000)]
[Mac] Use compositing for frames when ScrollingTreeIncludesFrames=true
https://bugs.webkit.org/show_bug.cgi?id=172851

Patch by Frederic Wang <fwang@igalia.com> on 2017-06-02
Reviewed by Simon Fraser.

Source/WebCore:

When fast frame scrolling is supported on mac (bug 171667), scrollable frames will require
special composited layer. This commit enables that on mac but only when
ScrollingTreeIncludesFrames=true, so that the default behavior is unchanged.

Test: compositing/iframes/compositing-for-scrollable-iframe.html

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame): Do not enable frame
compositing when ScrollingTreeIncludesFrames=false.
Rename ScrollableInnerFrameTrigger to ScrollableNonMainFrameTrigger.
* page/ChromeClient.h: Rename ScrollableInnerFrameTrigger.

Source/WebKit2:

When fast frame scrolling is supported on mac (bug 171667), scrollable frames will require
special composited layer. This commit enables that on mac but only when
ScrollingTreeIncludesFrames=true, so that the default behavior is unchanged.

* WebProcess/WebCoreSupport/WebChromeClient.h: Make scrollable inner frame trigger
compositing on Mac by default. This is ignored on mac when ScrollingTreeIncludesFrames=false.
Rename ScrollableInnerFrameTrigger to ScrollableNonMainFrameTrigger.

LayoutTests:

This commit adds a test to check whether scrollable iframes require a special composited
layer when ScrollingTreeIncludesFrames=true. This is currently only done on Mac WK2.

* compositing/iframes/compositing-for-scrollable-iframe.html: Added. This is a basic test
printing the layer tree of a page with an iframe.
* platform/ios-simulator/compositing/iframes/compositing-for-scrollable-iframe-expected.txt: Added.
* platform/mac/compositing/iframes/compositing-for-scrollable-iframe-expected.txt: Added.
* platform/mac-wk1/compositing/iframes/compositing-for-scrollable-iframe-expected.txt: Added.

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

2 years agoAllow clients to override viewport size for CSS viewport units.
zalan@apple.com [Fri, 2 Jun 2017 18:38:17 +0000 (18:38 +0000)]
Allow clients to override viewport size for CSS viewport units.
https://bugs.webkit.org/show_bug.cgi?id=172838
<rdar://problem/32523441>

Reviewed by Tim Horton.

Source/WebKit2:

This enables auto-sizing clients to ensure that styles relative to the viewport are
resolved to a set value (presumably the size of the container) as opposed to the preferred
document size (which is set as the FrameView size).

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _viewportSizeForCSSViewportUnits]):
(-[WKWebView _setViewportSizeForCSSViewportUnits:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
(WebKit::WebPageProxy::setViewportSizeForCSSViewportUnits):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::viewportSizeForCSSViewportUnits):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_cpuLimit):
(WebKit::WebPage::setViewportSizeForCSSViewportUnits):
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::viewportSizeForCSSViewportUnits):
* WebProcess/WebPage/WebPage.messages.in:

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/ViewportSizeForViewportUnits.mm: Added.
(TEST):

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

2 years agoGet <chrono> out of StdLibExtras.h
simon.fraser@apple.com [Fri, 2 Jun 2017 18:20:47 +0000 (18:20 +0000)]
Get <chrono> out of StdLibExtras.h
https://bugs.webkit.org/show_bug.cgi?id=172744

Reviewed by Zalan Bujtas.

Source/WebCore:

Only bring in <chrono> and namespace std::literals::chrono_literals when necessary.

* fileapi/FileReader.cpp:
* inspector/InspectorOverlay.cpp:
* loader/CrossOriginPreflightResultCache.cpp:
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::freshnessLifetime):
* page/ResourceUsageThread.cpp:
(WebCore::ResourceUsageThread::threadBody):
* page/cocoa/MemoryReleaseCocoa.mm:
(WebCore::jettisonExpensiveObjectsOnTopLevelNavigation):
* platform/network/CacheValidation.cpp:
(WebCore::computeFreshnessLifetimeForHTTPFamily):
* platform/network/CacheValidation.h:

Source/WebKit2:

Only bring in <chrono> and namespace std::literals::chrono_literals when necessary.

* NetworkProcess/cache/NetworkCache.cpp:
* NetworkProcess/cache/NetworkCacheFileSystem.h:
* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::computeRecordWorth):
* Shared/mac/RemoteLayerBackingStoreCollection.mm:
* WebProcess/Cookies/WebCookieManager.h:

Source/WTF:

We hates std::chrono. Don't include it everywhere to discourage use.

* wtf/StdLibExtras.h:

Tools:

* TestWebKitAPI/Tests/WTF/WorkQueue.cpp:

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

2 years ago[Cocoa] Add a "supportedCountries" property to ApplePayPaymentRequest
aestes@apple.com [Fri, 2 Jun 2017 18:14:47 +0000 (18:14 +0000)]
[Cocoa] Add a "supportedCountries" property to ApplePayPaymentRequest
https://bugs.webkit.org/show_bug.cgi?id=172832
<rdar://problem/30735544>

Reviewed by Alex Christensen.

Source/WebCore:

Test: http/tests/ssl/applepay/ApplePaySessionV3.html

* Modules/applepay/ApplePayPaymentRequest.h:
* Modules/applepay/ApplePayPaymentRequest.idl:
* Modules/applepay/ApplePaySession.cpp:
(WebCore::convertAndValidate):
* Modules/applepay/PaymentRequest.h:
(WebCore::PaymentRequest::supportedCountries):
(WebCore::PaymentRequest::setSupportedCountries):
* Modules/applepay/PaymentRequestValidator.cpp:
(WebCore::PaymentRequestValidator::validate):
* platform/spi/cocoa/PassKitSPI.h:

Source/WebKit2:

* Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
(IPC::ArgumentCoder<PaymentRequest>::encode):
(IPC::ArgumentCoder<PaymentRequest>::decode):
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::toNSSet):
(WebKit::toPKPaymentRequest):

LayoutTests:

* http/tests/ssl/applepay/ApplePaySessionV3-expected.txt: Added.
* http/tests/ssl/applepay/ApplePaySessionV3.html: Added.
* platform/mac-wk2/TestExpectations:

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

2 years agoAtomics.load and Atomics.store need to be fully fenced
fpizlo@apple.com [Fri, 2 Jun 2017 17:58:24 +0000 (17:58 +0000)]
Atomics.load and Atomics.store need to be fully fenced
https://bugs.webkit.org/show_bug.cgi?id=172844

Reviewed by Keith Miller.

Source/JavaScriptCore:

Implement fully fenced loads and stores in FTL using AtomicXchgAdd(0, ptr) for the load and
AtomicXchg(value, ptr) for the store.

DFG needed no changes because it implements all atomics using a CAS loop.

AtomicsObject.cpp now uses new Atomic<> API for fully fences loads and stores.

Prior to this change, we used half fences (acquire/release) for atomic loads and stores. This
is not correct according to my current understanding of the SAB memory model, which requires
that atomic operations are SC with respect to everything not just other atomics.

* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileAtomicsReadModifyWrite):
* ftl/FTLOutput.cpp:
(JSC::FTL::Output::atomicWeakCAS):
* ftl/FTLOutput.h:
* runtime/AtomicsObject.cpp:

Source/WTF:

Add loadFullyFenced and storeFullyFenced to Atomic<>.

* wtf/Atomics.h:
(WTF::Atomic::loadFullyFenced):
(WTF::Atomic::storeRelaxed):
(WTF::Atomic::storeFullyFenced):
(WTF::atomicLoadFullyFenced):
(WTF::atomicStoreFullyFenced):

Websites/webkit.org:

Update documentation to say that the canonical way to do fully fenced loads and stores is
AtomicXchgAdd(0, ptr) and AtomicXchg(value, ptr), respectively.

* docs/b3/intermediate-representation.html:

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

2 years agoWeb Inspector: Should see active Web Sockets when opening Web Inspector
drousso@apple.com [Fri, 2 Jun 2017 17:54:47 +0000 (17:54 +0000)]
Web Inspector: Should see active Web Sockets when opening Web Inspector
https://bugs.webkit.org/show_bug.cgi?id=172312

Reviewed by Joseph Pecoraro.

Source/WebCore:

Test: http/tests/websocket/tests/hybi/inspector/before-load.html

* Modules/websockets/WebSocket.h:
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::WebSocket):
(WebCore::WebSocket::~WebSocket):
(WebCore::WebSocket::allActiveWebSockets):
(WebCore::WebSocket::allActiveWebSocketsMutex):
(WebCore::WebSocket::channel):
(WebCore::WebSocket::eventTargetInterface):
Add a static set of all WebSocket objects and provide getters to access web socket metadata.

* Modules/websockets/ThreadableWebSocketChannel.h:
(WebCore::ThreadableWebSocketChannel::isWebSocketChannel):
* Modules/websockets/WebSocketChannel.h:
* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::isWebSocketChannel):
(WebCore::WebSocketChannel::identifier):
(WebCore::WebSocketChannel::clientHandshakeRequest):
(WebCore::WebSocketChannel::serverHandshakeResponse):
(WebCore::WebSocketChannel::handshakeMode):
(WebCore::WebSocketChannel::isType):
Provide getters to access web socket metadata.

* inspector/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::enable):
Loops over the static set of all WebSocket objects and sends events for each to the frontend.

Source/WebInspectorUI:

* UserInterface/Controllers/FrameResourceManager.js:
(WebInspector.FrameResourceManager.prototype.webSocketHandshakeResponseReceived):
(WebInspector.FrameResourceManager.prototype.initialize): Removed.
Rework order of agent enable calls to ensure that the main frame is initialized before any
websocket events are dispatched.

* UserInterface/Models/WebSocketResource.js:
(WebInspector.WebSocketResource.ReadyState):
Change symbol strings in enum for better printing in tests.

LayoutTests:

Test that WebSockets created before the inspector loads are also tracked.

* http/tests/websocket/tests/hybi/inspector/before-load-expected.txt: Added.
* http/tests/websocket/tests/hybi/inspector/before-load.html: Added.
* http/tests/websocket/tests/hybi/inspector/before-load_wsh.py: Added.
(web_socket_do_extra_handshake):
(web_socket_transfer_data):

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

2 years ago[Xcode] Header postprocessing should be based on the target OS version rather than...
mitz@apple.com [Fri, 2 Jun 2017 17:01:36 +0000 (17:01 +0000)]
[Xcode] Header postprocessing should be based on the target OS version rather than the builder OS version
https://bugs.webkit.org/show_bug.cgi?id=172860

Reviewed by Anders Carlsson.

* Configurations/WebKit.xcconfig: Use TARGET_MAC_OS_X_VERSION_MAJOR

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

2 years agoUnreviewed, fix linking errors on iOS after r217712.
cdumez@apple.com [Fri, 2 Jun 2017 16:47:45 +0000 (16:47 +0000)]
Unreviewed, fix linking errors on iOS after r217712.

* platform/OrientationNotifer.h:
(WebCore::OrientationNotifier::Observer::setNotifier):

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

2 years agoUnreviewed, attempt to fix the iOS build after r217711.
ryanhaddad@apple.com [Fri, 2 Jun 2017 16:25:57 +0000 (16:25 +0000)]
Unreviewed, attempt to fix the iOS build after r217711.

* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::xor32):
(JSC::MacroAssemblerARM64::xor64):

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

2 years agoMarked fast/images/slower-decoding-than-animation-image.html as flaky.
jlewis3@apple.com [Fri, 2 Jun 2017 16:17:47 +0000 (16:17 +0000)]
Marked fast/images/slower-decoding-than-animation-image.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=172666

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

2 years agoCrash under OrientationNotifier::Observer::setNotifier()
cdumez@apple.com [Fri, 2 Jun 2017 16:08:53 +0000 (16:08 +0000)]
Crash under OrientationNotifier::Observer::setNotifier()
https://bugs.webkit.org/show_bug.cgi?id=172847
<rdar://problem/32519127>

Reviewed by Youenn Fablet.

Update OrientationNotifier::Observer::setNotifier() to unregister itself from
its current notifier if it already has one. This is needed because
Internals::setCameraMediaStreamTrackOrientation() may be used to override the
notifier of an observer. If we override the notifier without unregistering
the observer from its previous notifier, then the previous notifier will not
get notified when the observer gets destroyed.

No new tests, already covered by webrtc/video-rotation.html that is currently
failing on some bots.

* platform/OrientationNotifer.h:
(WebCore::OrientationNotifier::Observer::setNotifier):

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

2 years agoGC should use scrambled free-lists
fpizlo@apple.com [Fri, 2 Jun 2017 15:59:22 +0000 (15:59 +0000)]
GC should use scrambled free-lists
https://bugs.webkit.org/show_bug.cgi?id=172793

Reviewed by Mark Lam.

Previously, our bump'n'pop allocator would use a conventional linked-list for the free-list.
The linked-list would be threaded through free memory, as is the usual convention.

This scrambles the next pointers of that free-list. It also scrambles the head pointer, because
this leads to a more natural fast-path structure and saves one register on ARM64.

The secret with which pointers are scrambled is per-allocator. Allocators choose a new secret
every time they do a sweep-to-pop.

This doesn't change the behavior of the bump part of bump'n'pop, but it does refactor the code
quite a bit. Previously, there were four copies of the allocator fast path: two in
MarkedAllocatorInlines.h, one in MarkedAllocator.cpp, and one in AssemblyHelpers.h. The JIT one
was obviously different-looking, but the other three were almost identical. This moves all of
that logic into FreeList. There are now just two copies of the allocator: FreeListInlines.h and
AssemblyHelpers.h.

This appears to be just as fast as our previously allocator.

* JavaScriptCore.xcodeproj/project.pbxproj:
* heap/FreeList.cpp:
(JSC::FreeList::FreeList):
(JSC::FreeList::~FreeList):
(JSC::FreeList::clear):
(JSC::FreeList::initializeList):
(JSC::FreeList::initializeBump):
(JSC::FreeList::contains):
(JSC::FreeList::dump):
* heap/FreeList.h:
(JSC::FreeList::allocationWillFail):
(JSC::FreeList::originalSize):
(JSC::FreeList::addressOfList):
(JSC::FreeList::offsetOfBlock):
(JSC::FreeList::offsetOfList):
(JSC::FreeList::offsetOfIndex):
(JSC::FreeList::offsetOfPayloadEnd):
(JSC::FreeList::offsetOfRemaining):
(JSC::FreeList::offsetOfOriginalSize):
(JSC::FreeList::FreeList): Deleted.
(JSC::FreeList::list): Deleted.
(JSC::FreeList::bump): Deleted.
(JSC::FreeList::operator==): Deleted.
(JSC::FreeList::operator!=): Deleted.
(JSC::FreeList::operator bool): Deleted.
* heap/FreeListInlines.h: Added.
(JSC::FreeList::addFreeCell):
(JSC::FreeList::allocate):
(JSC::FreeList::forEach):
(JSC::FreeList::toOffset):
(JSC::FreeList::fromOffset):
* heap/IncrementalSweeper.cpp:
(JSC::IncrementalSweeper::sweepNextBlock):
* heap/MarkedAllocator.cpp:
(JSC::MarkedAllocator::MarkedAllocator):
(JSC::MarkedAllocator::didConsumeFreeList):
(JSC::MarkedAllocator::tryAllocateWithoutCollecting):
(JSC::MarkedAllocator::tryAllocateIn):
(JSC::MarkedAllocator::allocateSlowCaseImpl):
(JSC::MarkedAllocator::stopAllocating):
(JSC::MarkedAllocator::prepareForAllocation):
(JSC::MarkedAllocator::resumeAllocating):
(JSC::MarkedAllocator::sweep):
(JSC::MarkedAllocator::setFreeList): Deleted.
* heap/MarkedAllocator.h:
(JSC::MarkedAllocator::freeList):
(JSC::MarkedAllocator::isFreeListedCell): Deleted.
* heap/MarkedAllocatorInlines.h:
(JSC::MarkedAllocator::isFreeListedCell):
(JSC::MarkedAllocator::tryAllocate):
(JSC::MarkedAllocator::allocate):
* heap/MarkedBlock.cpp:
(JSC::MarkedBlock::Handle::stopAllocating):
(JSC::MarkedBlock::Handle::lastChanceToFinalize):
(JSC::MarkedBlock::Handle::resumeAllocating):
(JSC::MarkedBlock::Handle::zap):
(JSC::MarkedBlock::Handle::sweep):
(JSC::MarkedBlock::Handle::isFreeListedCell):
(JSC::MarkedBlock::Handle::forEachFreeCell): Deleted.
* heap/MarkedBlock.h:
* heap/MarkedBlockInlines.h:
(JSC::MarkedBlock::Handle::specializedSweep):
(JSC::MarkedBlock::Handle::finishSweepKnowingSubspace):
(JSC::MarkedBlock::Handle::isFreeListedCell): Deleted.
* heap/Subspace.cpp:
(JSC::Subspace::finishSweep):
* heap/Subspace.h:
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::emitAllocateWithNonNullAllocator):
* runtime/JSDestructibleObjectSubspace.cpp:
(JSC::JSDestructibleObjectSubspace::finishSweep):
* runtime/JSDestructibleObjectSubspace.h:
* runtime/JSSegmentedVariableObjectSubspace.cpp:
(JSC::JSSegmentedVariableObjectSubspace::finishSweep):
* runtime/JSSegmentedVariableObjectSubspace.h:
* runtime/JSStringSubspace.cpp:
(JSC::JSStringSubspace::finishSweep):
* runtime/JSStringSubspace.h:
* wasm/js/JSWebAssemblyCodeBlockSubspace.cpp:
(JSC::JSWebAssemblyCodeBlockSubspace::finishSweep):
* wasm/js/JSWebAssemblyCodeBlockSubspace.h:

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

2 years agoUnreviewed WPE gardening.
zandobersek@gmail.com [Fri, 2 Jun 2017 15:18:25 +0000 (15:18 +0000)]
Unreviewed WPE gardening.

* platform/wpe/TestExpectations: Add a few test failure expectations.
* platform/wpe/js/dom/global-constructors-attributes-dedicated-worker-expected.txt: Rebaseline.
* platform/wpe/js/dom/global-constructors-attributes-expected.txt: Ditto.

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

2 years ago[css-grid] Logical margin incorrectly applied during the tracks sizing algorithm...
jfernandez@igalia.com [Fri, 2 Jun 2017 11:35:27 +0000 (11:35 +0000)]
[css-grid] Logical margin incorrectly applied during the tracks sizing algorithm of auto tracks
https://bugs.webkit.org/show_bug.cgi?id=172836

Reviewed by Manuel Rego Casasnovas.

Source/WebCore:

When computing min-content and max-content of the content-sized tracks
we are using the marginIntrinsicLogicalWidthForChild function, which
uses the grid's writing-mode to determine wether to use the child's
margin width or height. This is not correct when the grid item is
orthogonal.

This patch changes how we compute the tracks width so we use always
the item's marginLogicalWidth, which depends only on its own writing
mode.

Test: fast/css-grid-layout/grid-track-sizing-with-margins-and-orthogonal-flows.html

* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::GridTrackSizingAlgorithmStrategy::minContentForChild):
(WebCore::GridTrackSizingAlgorithmStrategy::maxContentForChild):

LayoutTests:

Test to verify different cases of auto-sized tracks and orthogonal items with margins.

* fast/css-grid-layout/grid-track-sizing-with-margins-and-orthogonal-flows-expected.txt: Added.
* fast/css-grid-layout/grid-track-sizing-with-margins-and-orthogonal-flows.html: Added.

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

2 years agoInvalidate the shadow subtree style when slotted pseudo rules are present.
commit-queue@webkit.org [Fri, 2 Jun 2017 10:18:54 +0000 (10:18 +0000)]
Invalidate the shadow subtree style when slotted pseudo rules are present.
https://bugs.webkit.org/show_bug.cgi?id=172822

Patch by Emilio Cobos Álvarez <ecobos@igalia.com> on 2017-06-02
Reviewed by Antti Koivisto.

No new tests, this is tested by
fast/shadow-dom/css-scoping-slot-with-id.html, once we don't force an
Inherit style change for slots. I could add some more tests for stuff
with descendant combinators and similar I guess, though.

* style/AttributeChangeInvalidation.cpp:
(WebCore::Style::AttributeChangeInvalidation::invalidateStyle):
* style/ClassChangeInvalidation.cpp:
(WebCore::Style::ClassChangeInvalidation::invalidateStyle):
* style/IdChangeInvalidation.cpp:
(WebCore::Style::IdChangeInvalidation::invalidateStyle):

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

2 years agoREGRESSION(r217214): [Coordinated Graphics] UpdateAtlas didn't released while resetti...
yoon@igalia.com [Fri, 2 Jun 2017 09:57:54 +0000 (09:57 +0000)]
REGRESSION(r217214): [Coordinated Graphics] UpdateAtlas didn't released while resetting testrunner
https://bugs.webkit.org/show_bug.cgi?id=172746

Reviewed by Žan Doberšek.

After clearing update atlases in CompositingCoordinator, we should
release update atlases at the compositing thread, too.

We cannot remove update atlases from the CoordinatedGraphicsScene
without regard to update scheduling, since previously committed scene
states can try to use already released update atlases.
To prevent this timing problem, releasing update atlases should be done
with a update scheduler.

* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::syncRemoteContent):
(WebKit::CoordinatedGraphicsScene::appendUpdate):
* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
Use WTF::Function instead of std::function
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::updateSceneState):
(WebKit::ThreadedCompositor::releaseUpdateAtlases):
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
(WebKit::ThreadedCompositor::flushPendingLayerChanges):
Release UpdateAtlases at the end of compositing states update, too.
(WebKit::CompositingCoordinator::clearUpdateAtlases):

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

2 years ago[GTK+][WPE] Allow TextureMapperShaderProgram to perform colorspace conversions with...
magomez@igalia.com [Fri, 2 Jun 2017 09:18:16 +0000 (09:18 +0000)]
[GTK+][WPE] Allow TextureMapperShaderProgram to perform colorspace conversions with the source texture pixels
https://bugs.webkit.org/show_bug.cgi?id=172749

Reviewed by Žan Doberšek.

Currently TextureMapperGL is only able to paint properly textures that are in RGBA format. There are
situations where we will want it to be able to handle other formats (for example BGRA for gstreamer-gl).
To make this possible without having to perform the color conversion in the CPU, we add a new color
conversion matrix to TextureMapperShaderProgram. This matrix will perform the color space conversion
in the GPU, just after sampling the source texture.

Also, add a new flag to TextureMapperGL to indicate that a color conversion is required to handle a
texture. This flag will be set to the TextureMapperPlatformLayerBuffers as required, and TextureMapperGL
will set the appropriate color space matrix to the shader. Initially only the flag for BGRA->RGBA conversion
is defined, but support for new transformations can be added as needed.

VideoTextureCopierGStreamer also uses the TextureMapperShaderProgram to perform texture sampling, but for
the moment it just sets an identity matrix because when using gstreamer-gl, the format of the video frames
is RGBA. This will be changed soon to use BGRA.

No new tests.

* platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
(WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture):
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::colorSpaceMatrixForFlags):
(WebCore::TextureMapperGL::drawTexturedQuadWithProgram):
* platform/graphics/texmap/TextureMapperGL.h:
* platform/graphics/texmap/TextureMapperShaderProgram.cpp:
* platform/graphics/texmap/TextureMapperShaderProgram.h:

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

2 years ago[css-grid] Margin wrong applied when stretching an orthogonal item in fixed size...
jfernandez@igalia.com [Fri, 2 Jun 2017 09:08:15 +0000 (09:08 +0000)]
[css-grid] Margin wrong applied when stretching an orthogonal item in fixed size track
https://bugs.webkit.org/show_bug.cgi?id=172590

Reviewed by Sergio Villar Senin.

LayoutTests/imported/w3c:

All the test cases of these tests pass with this change, so updating their expectations accordingly.

* web-platform-tests/css/css-grid-1/alignment/grid-self-alignment-stretch-006-expected.txt:
* web-platform-tests/css/css-grid-1/alignment/grid-self-alignment-stretch-vertical-lr-006-expected.txt:
* web-platform-tests/css/css-grid-1/alignment/grid-self-alignment-stretch-vertical-rl-006-expected.txt:

Source/WebCore:

We need to consider orthogonality when using the item's logical margin to
compute the available space for stretching.

The issue this patch fixes is only reproducible when the grid layout logic
is executed several times, since probably the item doesn't need to be
laid out again. In such cases, we just get the cached logical margins
but we were not taking orthogonality into account.

Test: fast/css-grid-layout/grid-item-stretching-must-not-depend-on-previous-layouts.html

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutBlock):
(WebCore::RenderGrid::marginLogicalSizeForChild):
(WebCore::RenderGrid::availableAlignmentSpaceForChildBeforeStretching):
* rendering/RenderGrid.h:

LayoutTests:

* TestExpectations: 2 tests pass now but 3 more fail because of bug #172836
* fast/css-grid-layout/grid-item-stretching-must-not-depend-on-previous-layouts-expected.html: Added.
* fast/css-grid-layout/grid-item-stretching-must-not-depend-on-previous-layouts.html: Added.

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

2 years ago[WPE] Enable SUBTLE_CRYPTO
zandobersek@gmail.com [Fri, 2 Jun 2017 07:52:27 +0000 (07:52 +0000)]
[WPE] Enable SUBTLE_CRYPTO
https://bugs.webkit.org/show_bug.cgi?id=172756

Reviewed by Michael Catanzaro.

Tools:

* Scripts/webkitperl/FeatureList.pm: Set ENABLE_SUBTLE_CRYPTO to 1 for WPE.
* wpe/jhbuild.modules: Add libgpg-error and libgcrypt dependencies.
* wpe/patches/libgcrypt-use-only-dev-urandom-for-testing.patch: Added. Prevents
exhausting entropy when running the crypto layout tests.

LayoutTests:

* platform/wpe/TestExpectations: Enable tests under crypto/ and
imported/w3c/web-platform-tests/WebCryptoAPI/ in general, but add
the test expectations for failing tests under those directories.

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

2 years ago[JSC] Use @globalPrivate for concatSlowPath
utatane.tea@gmail.com [Fri, 2 Jun 2017 07:47:16 +0000 (07:47 +0000)]
[JSC] Use @globalPrivate for concatSlowPath
https://bugs.webkit.org/show_bug.cgi?id=172802

Reviewed by Darin Adler.

Use @globalPrivate instead of manually putting it to JSGlobalObject.

* builtins/ArrayPrototype.js:
(concatSlowPath): Deleted.
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):

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

2 years ago[GTK] Cache RenderThemeGadget hierarchies for rendering themed elements with GTK...
carlosgc@webkit.org [Fri, 2 Jun 2017 06:40:36 +0000 (06:40 +0000)]
[GTK] Cache RenderThemeGadget hierarchies for rendering themed elements with GTK+ 3.20+
https://bugs.webkit.org/show_bug.cgi?id=162673

Reviewed by Michael Catanzaro.

Because of the way the new theming system works in GTK+ >= 3.20 we are currently creating a gadget hierarchy
every time we need to render a styled element or get layout information about it. That's happening on every
repaint, and it's specially problematic for overlay scrollbar indicators that fade in/out when shown/hidden. We
need to cache the gadgets and simply apply the state before every paint or layout query. When using GtkWidgetPath,
calling gtk_style_context_save() breaks the gadget hierarchy, and style classes need to be set when building the
GtkWidgetPath. That means we can't cache RenderThemeGadgets, call save, apply style classes and state, and then
call restore. We need to cache gadget hierarchies with fixed style classes. Fortunately, setting the state does
work, so we don't need to also cache a different hierarchy for every possible state. For example, for the
particular case of scrollbars we would cache VerticalScrollbarRight, VerticalScrollbarLeft, HorizontalScrollbar,
VerticalScrollIndicatorRight, VerticalScrollIndicatorLeft and HorizontalScrollIndicator. In practice, we will
only have 4 of those at the same time in the cache.
This patch adds RenderThemeWidget to represent a hierarchy of gadgets with fixed style classes that can be
cached and reused to render or query style of those "widgets". It also simplifies the RenderThemeGtk and
ScrollbarThemeGtk code by removing a lot of duplicated code to build the gadget hierarchies.

* PlatformGTK.cmake:
* platform/gtk/RenderThemeGadget.cpp:
(WebCore::createStyleContext):
(WebCore::appendElementToPath):
(WebCore::RenderThemeGadget::state):
(WebCore::RenderThemeGadget::setState):
* platform/gtk/RenderThemeGadget.h:
* platform/gtk/RenderThemeWidget.cpp: Added.
(WebCore::widgetMap):
(WebCore::RenderThemeWidget::getOrCreate):
(WebCore::RenderThemeWidget::clearCache):
(WebCore::RenderThemeWidget::~RenderThemeWidget):
(WebCore::RenderThemeScrollbar::RenderThemeScrollbar):
(WebCore::RenderThemeScrollbar::stepper):
(WebCore::RenderThemeToggleButton::RenderThemeToggleButton):
(WebCore::RenderThemeButton::RenderThemeButton):
(WebCore::RenderThemeComboBox::RenderThemeComboBox):
(WebCore::RenderThemeEntry::RenderThemeEntry):
(WebCore::RenderThemeSearchEntry::RenderThemeSearchEntry):
(WebCore::RenderThemeSpinButton::RenderThemeSpinButton):
(WebCore::RenderThemeSlider::RenderThemeSlider):
(WebCore::RenderThemeProgressBar::RenderThemeProgressBar):
(WebCore::RenderThemeListView::RenderThemeListView):
(WebCore::RenderThemeIcon::RenderThemeIcon):
* platform/gtk/RenderThemeWidget.h: Added.
(WebCore::RenderThemeEntry::entry):
(WebCore::RenderThemeEntry::selection):
* platform/gtk/ScrollbarThemeGtk.cpp:
(WebCore::ScrollbarThemeGtk::themeChanged):
(WebCore::ScrollbarThemeGtk::updateThemeProperties):
(WebCore::widgetTypeForScrollbar):
(WebCore::contentsRectangle):
(WebCore::ScrollbarThemeGtk::trackRect):
(WebCore::ScrollbarThemeGtk::backButtonRect):
(WebCore::ScrollbarThemeGtk::forwardButtonRect):
(WebCore::ScrollbarThemeGtk::paint):
(WebCore::ScrollbarThemeGtk::scrollbarThickness):
(WebCore::ScrollbarThemeGtk::minimumThumbLength):
* rendering/RenderThemeGtk.cpp:
(WebCore::createStyleContext):
(WebCore::setToggleSize):
(WebCore::paintToggle):
(WebCore::RenderThemeGtk::paintButton):
(WebCore::menuListColor):
(WebCore::RenderThemeGtk::popupInternalPaddingBox):
(WebCore::RenderThemeGtk::paintMenuList):
(WebCore::RenderThemeGtk::adjustTextFieldStyle):
(WebCore::RenderThemeGtk::paintTextField):
(WebCore::adjustSearchFieldIconStyle):
(WebCore::paintSearchFieldIcon):
(WebCore::RenderThemeGtk::paintSliderTrack):
(WebCore::RenderThemeGtk::adjustSliderThumbSize):
(WebCore::RenderThemeGtk::paintSliderThumb):
(WebCore::RenderThemeGtk::progressBarRectForBounds):
(WebCore::RenderThemeGtk::paintProgressBar):
(WebCore::RenderThemeGtk::adjustInnerSpinButtonStyle):
(WebCore::RenderThemeGtk::paintInnerSpinButton):
(WebCore::styleColor):
(WebCore::RenderThemeGtk::platformActiveSelectionBackgroundColor):
(WebCore::RenderThemeGtk::platformInactiveSelectionBackgroundColor):
(WebCore::RenderThemeGtk::platformActiveSelectionForegroundColor):
(WebCore::RenderThemeGtk::platformInactiveSelectionForegroundColor):
(WebCore::RenderThemeGtk::paintMediaButton):

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

2 years agoEnsure a good experience for ARES-6 error reporting
sbarati@apple.com [Fri, 2 Jun 2017 05:55:28 +0000 (05:55 +0000)]
Ensure a good experience for ARES-6 error reporting
https://bugs.webkit.org/show_bug.cgi?id=171699

Reviewed by Filip Pizlo and Jon Davis.

This patch fixes a bug where we would silently fail running ARES-6. The bug
was that we were calling reportError with the wrong |this| value.
I also cleaned up a bit of the code around error reporting. We
now indicate which test failed, and update the status to reflect
that a failure happened.

This patch also modifies the CSS a bit to work better on smaller
screened devices. The CSS prevents the status from having a line
break both when an error is reported and when we're running the
benchmark.

* ARES-6/driver.js:
(Driver):
(Driver.prototype.reportError):
* ARES-6/results.js:
(Results.prototype.reportError):
(Results):
* ARES-6/styles.css:
(.start):
(#status):
(.failed):
(#status.failed):
(.test .failed:before):
(#magic):
(@media only screen and (max-width: 784px)):
(.test):
(p):
(@media only screen and (max-width: 320px)):

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

2 years ago[Mac] Remove backing store for layers that are outside the viewport
akling@apple.com [Fri, 2 Jun 2017 05:04:14 +0000 (05:04 +0000)]
[Mac] Remove backing store for layers that are outside the viewport
https://bugs.webkit.org/show_bug.cgi?id=170082
<rdar://problem/31245009>

Reviewed by Simon Fraser.

Source/WebCore:

Implement the backingStoreAttached flag in PlatformCALayerCocoa. This means that
compositing layers outside the tiling coverage rect will no longer have backing
stores, saving large amounts of memory.

Also added a canDetachBackingStore flag that is set to false for scroll control
layers, to avoid complicating coverage rect computations.

Test: compositing/backing-store-attachment-1.html

* page/Frame.h:
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::GraphicsLayer):
(WebCore::GraphicsLayer::dumpProperties):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::backingStoreAttached):
(WebCore::GraphicsLayer::setCanDetachBackingStore):
(WebCore::GraphicsLayer::canDetachBackingStore):
* platform/graphics/GraphicsLayerClient.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::backingStoreAttached):
(WebCore::GraphicsLayerCA::setNeedsDisplay):
(WebCore::GraphicsLayerCA::updateCoverage):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(PlatformCALayerCocoa::setBackingStoreAttached):
(PlatformCALayerCocoa::backingStoreAttached):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateOverflowControlsLayers):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::layerTreeAsText):
(WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
* testing/Internals.cpp:
(WebCore::toLayerTreeFlags):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit2:

* WebProcess/WebPage/mac/PlatformCALayerRemote.h:

LayoutTests:

Add a simple test with two compositing layers far apart vertically. Only one of them
should have its backing store attached.

* compositing/backing-store-attachment-1-expected.txt: Added.
* compositing/backing-store-attachment-1.html: Added.

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

2 years agoREGRESSION (r206386): Xactimate Website Crashes @ com.apple.WebKit: WebKit::NPRuntime...
cdumez@apple.com [Fri, 2 Jun 2017 04:35:25 +0000 (04:35 +0000)]
REGRESSION (r206386): Xactimate Website Crashes @ com.apple.WebKit: WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant + 255
https://bugs.webkit.org/show_bug.cgi?id=172846
<rdar://problem/31093005>

Reviewed by Andreas Kling.

In NPJSObject::invoke(), return early if there was an exception when calling JSC::call().
Using the value returned by JSC::call() when an exception occurred is unsafe.

* WebProcess/Plugins/Netscape/NPJSObject.cpp:
(WebKit::NPJSObject::invoke):

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

2 years agoUnreviewed, rolling out r217691.
ryanhaddad@apple.com [Fri, 2 Jun 2017 04:17:13 +0000 (04:17 +0000)]
Unreviewed, rolling out r217691.

This change broke the Windows build.

Reverted changeset:

"Web Inspector: Should see active Web Sockets when opening Web
Inspector"
https://bugs.webkit.org/show_bug.cgi?id=172312
http://trac.webkit.org/changeset/217691

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

2 years agoUnreviewed Windows build fix after r217691.
joepeck@webkit.org [Fri, 2 Jun 2017 04:14:40 +0000 (04:14 +0000)]
Unreviewed Windows build fix after r217691.

* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::sendFrame):
* Modules/websockets/WebSocketChannel.h:
Disambiguate the Function being used.

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

2 years agoLibWebRTC might crash with frames having a null width or height
commit-queue@webkit.org [Fri, 2 Jun 2017 02:50:50 +0000 (02:50 +0000)]
LibWebRTC might crash with frames having a null width or height
https://bugs.webkit.org/show_bug.cgi?id=172842
<rdar://problem/32514813>

Patch by Youenn Fablet <youenn@apple.com> on 2017-06-01
Reviewed by Jon Lee.

Do not send black frames in case the video width or height is zero.
Also ensure that even if a null buffer is returned by the pool, no crash might actually happen.

* platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
(WebCore::RealtimeOutgoingVideoSource::sendBlackFramesIfNeeded):
(WebCore::RealtimeOutgoingVideoSource::videoSampleAvailable):

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

2 years agoWeb Inspector: Should see active Web Sockets when opening Web Inspector
drousso@apple.com [Fri, 2 Jun 2017 02:44:45 +0000 (02:44 +0000)]
Web Inspector: Should see active Web Sockets when opening Web Inspector
https://bugs.webkit.org/show_bug.cgi?id=172312

Reviewed by Joseph Pecoraro.

Source/WebCore:

Test: http/tests/websocket/tests/hybi/inspector/before-load.html

* Modules/websockets/WebSocket.h:
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::WebSocket):
(WebCore::WebSocket::~WebSocket):
(WebCore::WebSocket::allActiveWebSockets):
(WebCore::WebSocket::allActiveWebSocketsMutex):
(WebCore::WebSocket::channel):
(WebCore::WebSocket::eventTargetInterface):
Add a static set of all WebSocket objects and provide getters to access web socket metadata.

* Modules/websockets/ThreadableWebSocketChannel.h:
(WebCore::ThreadableWebSocketChannel::isWebSocketChannel):
* Modules/websockets/WebSocketChannel.h:
* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::isWebSocketChannel):
(WebCore::WebSocketChannel::identifier):
(WebCore::WebSocketChannel::clientHandshakeRequest):
(WebCore::WebSocketChannel::serverHandshakeResponse):
(WebCore::WebSocketChannel::handshakeMode):
(WebCore::WebSocketChannel::isType):
Provide getters to access web socket metadata.

* inspector/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::enable):
Loops over the static set of all WebSocket objects and sends events for each to the frontend.

Source/WebInspectorUI:

* UserInterface/Controllers/FrameResourceManager.js:
(WebInspector.FrameResourceManager.prototype.webSocketHandshakeResponseReceived):
(WebInspector.FrameResourceManager.prototype.initialize): Removed.
Rework order of agent enable calls to ensure that the main frame is initialized before any
websocket events are dispatched.

* UserInterface/Models/WebSocketResource.js:
(WebInspector.WebSocketResource.ReadyState):
Change symbol strings in enum for better printing in tests.

LayoutTests:

Test that WebSockets created before the inspector loads are also tracked.

* http/tests/websocket/tests/hybi/inspector/before-load-expected.txt: Added.
* http/tests/websocket/tests/hybi/inspector/before-load.html: Added.
* http/tests/websocket/tests/hybi/inspector/before-load_wsh.py: Added.
(web_socket_do_extra_handshake):
(web_socket_transfer_data):

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

2 years agoWeb Inspector: Web Sockets: Unable to inspect a WebSocket that receives >50 messages...
nvasilyev@apple.com [Fri, 2 Jun 2017 00:50:17 +0000 (00:50 +0000)]
Web Inspector: Web Sockets: Unable to inspect a WebSocket that receives >50 messages per second
https://bugs.webkit.org/show_bug.cgi?id=171904
<rdar://problem/32095863>

Reviewed by Matt Baker.

Every size increase of a resource causes a sidebar item to be re-attached to the DOM. Sending or
receiving a WebSocket message causes a size increase. When size increase happens too frequently,
the go-to arrow starts to flicker and becomes unclickable. This patch makes sure a sidebar item gets
re-attached only when its position (index) changes.

* UserInterface/Views/NetworkSidebarPanel.js:
Add the go-to arrow and close buttons when treeElement.status is a spinner element.

(WebInspector.NetworkSidebarPanel.prototype.treeElementAddedOrChanged):
* UserInterface/Views/ResourceTreeElement.js:
(WebInspector.ResourceTreeElement.prototype._updateStatus):
Setting status to "" removes the go-to arrow and close buttons in the Network tab.
Only set status to "" to remove the spinner.

* UserInterface/Views/TimelineDataGrid.js:
(WebInspector.TimelineDataGrid.prototype._refreshDirtyDataGridNodes):
* UserInterface/Views/TreeOutline.js:
(WebInspector.TreeOutline.prototype.reattachIfIndexChanged): Added.

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