WebKit-https.git
4 years ago[CredentialManagement] Add IDL definitions for Credential, SiteBoundCredential, and...
jiewen_tan@apple.com [Mon, 27 Feb 2017 19:01:13 +0000 (19:01 +0000)]
[CredentialManagement] Add IDL definitions for Credential, SiteBoundCredential, and PasswordCredential
https://bugs.webkit.org/show_bug.cgi?id=168616
<rdar://problem/30167149>

Reviewed by Daniel Bates.

Source/WebCore:

This patch adds IDL definitions for:
1. Credential(https://w3c.github.io/webappsec-credential-management/#interfaces-credential-types-credential),
2. SiteBoundCredential(https://w3c.github.io/webappsec-credential-management/#interfaces-credential-types-siteboundcredential), and
3. PasswordCredential(https://w3c.github.io/webappsec-credential-management/#interfaces-credential-types-passwordcredential).

Test: credentials/idlharness.html

* CMakeLists.txt:
* DerivedSources.make:
* Modules/credentials/BasicCredential.cpp: Added.
(WebCore::BasicCredential::BasicCredential):
(WebCore::BasicCredential::~BasicCredential):
(WebCore::BasicCredential::type):
* Modules/credentials/BasicCredential.h: Added.
(WebCore::BasicCredential::id):
* Modules/credentials/BasicCredential.idl: Added.
* Modules/credentials/CredentialData.h: Added.
* Modules/credentials/CredentialData.idl: Added.
* Modules/credentials/PasswordCredential.cpp: Added.
(WebCore::PasswordCredential::PasswordCredential):
(WebCore::PasswordCredential::PasswordCredential):
Dummy constructors for now.
* Modules/credentials/PasswordCredential.h: Added.
(WebCore::PasswordCredential::create):
(WebCore::PasswordCredential::create):
(WebCore::PasswordCredential::setIdName):
(WebCore::PasswordCredential::idName):
(WebCore::PasswordCredential::setPasswordName):
(WebCore::PasswordCredential::passwordName):
(WebCore::PasswordCredential::setAdditionalData):
(WebCore::PasswordCredential::additionalData):
* Modules/credentials/PasswordCredential.idl: Added.
* Modules/credentials/SiteBoundCredential.cpp: Added.
(WebCore::SiteBoundCredential::SiteBoundCredential):
(WebCore::SiteBoundCredential::~SiteBoundCredential):
* Modules/credentials/SiteBoundCredential.h: Added.
(WebCore::SiteBoundCredential::name):
(WebCore::SiteBoundCredential::iconURL):
(WebCore::SiteBoundCredential::setOrigin):
(WebCore::SiteBoundCredential::origin):
* Modules/credentials/SiteBoundCredential.idl: Added.
* Modules/credentials/SiteBoundCredentialData.h: Added.
* Modules/credentials/SiteBoundCredentialData.idl: Added.
* WebCore.xcodeproj/project.pbxproj:

LayoutTests:

* credentials/idlharness-expected.txt: Added.
* credentials/idlharness.html: Added.
* platform/mac-elcapitan/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
* platform/mac/js/dom/global-constructors-attributes-expected.txt:
* resources/WebIDLParser.js: Added.
* resources/idlharness.js: Renamed from LayoutTests/imported/w3c/resources/idlharness.js.
Removed LayoutTests/imported/w3c/resources/idlharness.js since it is not needed any more.
Added resources/idlharness.js for idl harness.

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

4 years ago[WebRTC] Fix remote audio rendering
jer.noble@apple.com [Mon, 27 Feb 2017 18:22:49 +0000 (18:22 +0000)]
[WebRTC] Fix remote audio rendering
https://bugs.webkit.org/show_bug.cgi?id=168898

Reviewed by Eric Carlson.

Source/WebCore:

Test: webrtc/audio-peer-connection-webaudio.html

Fix MediaStreamAudioSourceNode by not bailing out early if the input sample rate doesn't match
the AudioContext's sample rate; there's code in setFormat() to do the sample rate conversion
correctly.

* Modules/webaudio/MediaStreamAudioSourceNode.cpp:
(WebCore::MediaStreamAudioSourceNode::setFormat):

Fix AudioSampleBufferList by making the AudioConverter input proc a free function, and passing
its refCon a struct containing only the information it needs to perform its task. Because the
conversion may result in a different number of output samples than input ones, just ask to
generate the entire capacity of the scratch buffer, and signal that the input buffer was fully
converted with a special return value.

* platform/audio/mac/AudioSampleBufferList.cpp:
(WebCore::audioConverterFromABLCallback):
(WebCore::AudioSampleBufferList::copyFrom):
(WebCore::AudioSampleBufferList::convertInput): Deleted.
(WebCore::AudioSampleBufferList::audioConverterCallback): Deleted.
* platform/audio/mac/AudioSampleBufferList.h:

Fix AudioSampleDataSource by updating both the sampleCount and the sampleTime after doing
a sample rate conversion to take into account that both the number of samples may have changed,
as well as the timeScale of the sampleTime. This may result in small off-by-one rounding errors
due to the sample rate conversion of sampleTime, so remember what the next expected sampleTime
should be, and correct sampleTime if it is indeed off-by-one. If the pull operation has gotten
ahead of the push operation, delay the next pull by the empty amount by rolling back the
m_outputSampleOffset. Introduce the same offset behavior during pull operations.

* platform/audio/mac/AudioSampleDataSource.h:
* platform/audio/mac/AudioSampleDataSource.mm:
(WebCore::AudioSampleDataSource::pushSamplesInternal):
(WebCore::AudioSampleDataSource::pullSamplesInternal):
(WebCore::AudioSampleDataSource::pullAvalaibleSamplesAsChunks):

Fix MediaPlayerPrivateMediaStreamAVFObjC by obeying the m_muted property.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVolume):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setMuted):

Fix LibWebRTCAudioModule by sleeping for the correct amount after emitting frames. Previously,
LibWebRTCAudioModule would sleep for a fixed amount of time, which meant it would get slowly out
of sync when emitting frames took a non-zero amount of time. Now, the amount of time before the
next cycle starts is correctly calculated, and then LibWebRTCAudioModule sleeps for a dynamic amount
of time in order to wake up correctly at the beginning of the next cycle.

* platform/mediastream/libwebrtc/LibWebRTCAudioModule.cpp:
(WebCore::LibWebRTCAudioModule::StartPlayoutOnAudioThread):

Fix AudioTrackPrivateMediaStreamCocoa by just using the output unit's preferred format
description (with the current system sample rate), rather than whatever is the current
input description.

* platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
(WebCore::AudioTrackPrivateMediaStreamCocoa::createAudioUnit):
(WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
* platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:

Fix RealtimeIncomingAudioSource by actually creating an AudioSourceProvider when asked.

* platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
(WebCore::RealtimeIncomingAudioSource::OnData):
(WebCore::RealtimeIncomingAudioSource::audioSourceProvider):
* platform/mediastream/mac/RealtimeIncomingAudioSource.h:

Fix RealtimeOutgoingAudioSource by using the outgoing format description rather than the
incoming one to determine the sample rate, channel count, sample byte size, etc., to use
when delivering data upstream to libWebRTC.

* platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
(WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
(WebCore::RealtimeOutgoingAudioSource::pullAudioData):
* platform/mediastream/mac/RealtimeOutgoingAudioSource.h:

Fix WebAudioSourceProviderAVFObjC by using a AudioSampleDataSource to do format and sample
rate conversion rather than trying to duplicate all that code and use a CARingBuffer and
AudioConverter directly.

* platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h:
* platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
(WebCore::WebAudioSourceProviderAVFObjC::~WebAudioSourceProviderAVFObjC):
(WebCore::WebAudioSourceProviderAVFObjC::provideInput):
(WebCore::WebAudioSourceProviderAVFObjC::prepare):
(WebCore::WebAudioSourceProviderAVFObjC::unprepare):
(WebCore::WebAudioSourceProviderAVFObjC::audioSamplesAvailable):

Fix the MockLibWebRTCAudioTrack by passing along the AddSink() sink to its AudioSourceInterface,
allowing the RealtimeOutgoingAudioSource to push data into the libWebRTC network stack. Also,
make sure m_enabled is initialized to a good value.

* testing/MockLibWebRTCPeerConnection.h:

LayoutTests:

* webrtc/audio-peer-connection-webaudio-expected.txt: Added.
* webrtc/audio-peer-connection-webaudio.html: Added.

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

4 years agoUnreviewed. Fix two GTK+ unit tests failing after r213062.
carlosgc@webkit.org [Mon, 27 Feb 2017 17:36:26 +0000 (17:36 +0000)]
Unreviewed. Fix two GTK+ unit tests failing after r213062.

We were building wrong Content-Disposition headers that libsoup doesn't parse correctly.

* TestWebKitAPI/Tests/WebKit2Gtk/TestDownloads.cpp:
(addContentDispositionHTTPHeaderToResponse):
* TestWebKitAPI/Tests/WebKit2Gtk/TestResources.cpp:
(serverCallback):

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

4 years agoOptimize checkWebRTCAvailability
achristensen@apple.com [Mon, 27 Feb 2017 17:21:55 +0000 (17:21 +0000)]
Optimize checkWebRTCAvailability
https://bugs.webkit.org/show_bug.cgi?id=168913

Reviewed by Darin Adler.

We can optimize startup time by using RTLD_LAZY instead of RTLD_NOW because we don't need to load all the symbols.
We just need to check whether libwebrtc.dylib can be found and is a valid dylib for the current architecture.
Also, initialize a static bool so it only needs to be checked once.  Right now it's only used when initializing settings,
but if we use it for other things in the future there will be no need to reopen the dylib.

* UIProcess/WebPreferences.cpp:
(WebKit::checkWebRTCAvailability):

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

4 years agocompositing/transitions/transform-on-large-layer.html : ImageDiff produced stderr...
commit-queue@webkit.org [Mon, 27 Feb 2017 17:20:29 +0000 (17:20 +0000)]
compositing/transitions/transform-on-large-layer.html : ImageDiff produced stderr output
https://bugs.webkit.org/show_bug.cgi?id=168217

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-02-27
Reviewed by Simon Fraser.

ImageDiff reports an error for image size mismatch of expected and
actual images. But, Nwtr ignores the errors for ref tests at the moment
(Bug 168033). They should have same window size before fixing the
bug.

* compositing/transitions/transform-on-large-layer-expected.html:
Do not resize the window to match the actual.
* fast/css/sticky/sticky-left-percentage-expected.html: Resize the
window to match the actual.

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

4 years agoAudioSampleDataSource should not exclusively lock its read and write threads.
jer.noble@apple.com [Mon, 27 Feb 2017 17:04:53 +0000 (17:04 +0000)]
AudioSampleDataSource should not exclusively lock its read and write threads.
https://bugs.webkit.org/show_bug.cgi?id=168646

Reviewed by Eric Carlson.

Locking the write thread causes the read thread to drop audio samples and generates audible
glitches, and the realtime audio thread backing the read thread should never block. There's
no real reason to lock these threads against one another here; they both rely on the
CARingBuffer to safely and simultaneously read and write data.

* platform/audio/mac/AudioSampleDataSource.cpp:
(WebCore::AudioSampleDataSource::setPaused):
(WebCore::AudioSampleDataSource::pushSamplesInternal):
(WebCore::AudioSampleDataSource::pushSamples):
(WebCore::AudioSampleDataSource::pullSamplesInternal):
(WebCore::AudioSampleDataSource::pullAvalaibleSamplesAsChunks):
(WebCore::AudioSampleDataSource::pullSamples):
* platform/audio/mac/AudioSampleDataSource.h:

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

4 years agoAudioTrackPrivateMediaStreamCocoa should not exclusively lock its read and write...
jer.noble@apple.com [Mon, 27 Feb 2017 16:59:53 +0000 (16:59 +0000)]
AudioTrackPrivateMediaStreamCocoa should not exclusively lock its read and write threads.
https://bugs.webkit.org/show_bug.cgi?id=168643

Reviewed by Eric Carlson.

Locking the write thread causes the read thread to drop audio samples and generates audible
glitches, and the realtime audio thread backing the read thread should never block. There's
no real reason to lock these threads against one another here; they both rely on the
AudioSampleDataSource and it's CARingBuffer to safely and simultaneously read and write
data.

The one piece which locks previously protected against unsafe access was during creation of
the audio unit.  Without a lock, the audio unit could begin playback after the unit was
created and assigned to m_remoteIOUnit but before the ring buffer was created. To protect
against this possibility, create the unit, set the input and output descriptions, but only
assign the new audio unit to m_remoteIOUnit after the ring buffer has been created and
initialized.

* platform/audio/mac/CAAudioStreamDescription.h:
* platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
(WebCore::AudioTrackPrivateMediaStreamCocoa::~AudioTrackPrivateMediaStreamCocoa):
(WebCore::AudioTrackPrivateMediaStreamCocoa::playInternal):
(WebCore::AudioTrackPrivateMediaStreamCocoa::play):
(WebCore::AudioTrackPrivateMediaStreamCocoa::pause):
(WebCore::AudioTrackPrivateMediaStreamCocoa::setVolume):
(WebCore::AudioTrackPrivateMediaStreamCocoa::createAudioUnit):
(WebCore::AudioTrackPrivateMediaStreamCocoa::setupAudioUnit): Renamed to createAudioUnit()
(WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
* platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:

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

4 years agoAdd public method to MediaTime for doing timeScale conversion.
jer.noble@apple.com [Mon, 27 Feb 2017 16:53:05 +0000 (16:53 +0000)]
Add public method to MediaTime for doing timeScale conversion.
https://bugs.webkit.org/show_bug.cgi?id=168860

Reviewed by Eric Carlson.

Source/WTF:

The newly public method, modeled on CMTimeConvertScale, allows callers to specify what rounding technique
will be used when converting to a new time scale.

* wtf/MediaTime.cpp:
(WTF::MediaTime::toTimeScale):
(WTF::MediaTime::setTimeScale):
* wtf/MediaTime.h:

Tools:

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

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

4 years agoWebAssembly: miscellaneous spec fixes part deux
jfbastien@apple.com [Mon, 27 Feb 2017 16:52:46 +0000 (16:52 +0000)]
WebAssembly: miscellaneous spec fixes part deux
https://bugs.webkit.org/show_bug.cgi?id=168861

Reviewed by Keith Miller.

JSTests:

* wasm.yaml: more passing tests
* wasm/Builder.js: use a Map instead of an Object for the function
index space, because Number entries such as 0 were colliding with
string entries such as "0". This in turn requires some hashing of
objects which are inserted, because Map uses Object's insertion
order when comparing.
(export.default.Builder):
(export.default.Builder.prototype._functionIndexSpaceKeyHash):
(export.default.Builder.prototype._registerFunctionToIndexSpace):
(export.default.Builder.prototype._getFunctionFromIndexSpace):
* wasm/js-api/test_Instance.js: add a FIXME test
* wasm/spec-tests/memory.wast.js:
(assert_unlinkable):
* wasm/spec-tests/names.wast.js:

Source/JavaScriptCore:

* wasm/WasmFunctionParser.h: add some FIXME

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

4 years ago[WebRTC] RealtimOutgoingVideoSource should not need to do image conversion
commit-queue@webkit.org [Mon, 27 Feb 2017 16:29:10 +0000 (16:29 +0000)]
[WebRTC] RealtimOutgoingVideoSource should not need to do image conversion
https://bugs.webkit.org/show_bug.cgi?id=168802

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

Source/ThirdParty/libwebrtc:

Exporting new symbols.
Including headers in the project file.

* Source/webrtc/common_video/include/corevideo_frame_buffer.h:
* Source/webrtc/common_video/include/i420_buffer_pool.h:
* Source/webrtc/common_video/include/video_frame_buffer.h:
* libwebrtc.xcodeproj/project.pbxproj:

Source/WebCore:

Covered by manual testing as mock sources do not hit the same code path.

* platform/mediastream/mac/AVVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::currentFrameCGImage):
* platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
(WebCore::RealtimeOutgoingVideoSource::sendFrame):
(WebCore::RealtimeOutgoingVideoSource::videoSampleAvailable):
* platform/mediastream/mac/RealtimeOutgoingVideoSource.h:

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

4 years agoUnreviewed, revert all temporary build fixes for data interaction
wenson_hsieh@apple.com [Mon, 27 Feb 2017 16:02:36 +0000 (16:02 +0000)]
Unreviewed, revert all temporary build fixes for data interaction

Rolls out r212990, r212988 and r212984.

Source/WebKit2:

* UIProcess/ios/WKContentViewInteraction.h:

Tools:

* TestWebKitAPI/Tests/ios/DataInteractionTests.mm:
* TestWebKitAPI/ios/DataInteractionSimulator.h:
* TestWebKitAPI/ios/DataInteractionSimulator.mm:
(-[DataInteractionSimulator _advanceProgress]):

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

4 years agoAdd a test verifying cache deduplication is not sensitive to SHA1 collision attack
antti@apple.com [Mon, 27 Feb 2017 15:27:07 +0000 (15:27 +0000)]
Add a test verifying cache deduplication is not sensitive to SHA1 collision attack
https://bugs.webkit.org/show_bug.cgi?id=168774

Reviewed by Alex Christensen.

We use SHA1 for deduplicating disk cache resources. Since a real world SHA1 collision was demonstrated
recently (http://shattered.io/) we can add a test that shows it can't be used for cache poisoning.

There are two protections in the cache code that both individually stop this type of attack:

- When deduplicating the data is verified to be equal by a bytewise comparison.
- SHA1 computations include random salt unique to cache instance.

Commenting out both protections is needed to make this test fail.

* http/tests/cache/disk-cache/resources/make-sha1-collision.php: Added.

This script turns the nocolliding pdfs into colliding ones on the fly, in memory. This way we don't need
to land the colliding versions and risk blowing up the infrastructure.

* http/tests/cache/disk-cache/resources/shattered-nocollision-1.pdf: Added.
* http/tests/cache/disk-cache/resources/shattered-nocollision-2.pdf: Added.

> shasum shattered-nocollision-*
5439274cf677fe3b7c51264f88a5ecee97319ee9  shattered-nocollision-1.pdf
7fdd163dc21064b7f26e1199fc560ee6e0307498  shattered-nocollision-2.pdf

* http/tests/cache/disk-cache/shattered-deduplication-expected.html: Added.
* http/tests/cache/disk-cache/shattered-deduplication.html: Added.

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

4 years ago[Win] Http preload tests are failing.
pvollan@apple.com [Mon, 27 Feb 2017 15:20:55 +0000 (15:20 +0000)]
[Win] Http preload tests are failing.
https://bugs.webkit.org/show_bug.cgi?id=168910

Reviewed by Alex Christensen.

The feature is not enabled.

* WebView.cpp:
(WebView::notifyPreferencesChanged):

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

4 years ago[GTK] Downloads attributes tests are failing
carlosgc@webkit.org [Mon, 27 Feb 2017 14:48:43 +0000 (14:48 +0000)]
[GTK] Downloads attributes tests are failing
https://bugs.webkit.org/show_bug.cgi?id=168871

Reviewed by Michael Catanzaro.

Source/WebCore:

Use libsoup to get the suggested filename from the Content-Disposition header instead of buggy
filenameFromHTTPContentDisposition().

Fixes: fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-doublequote.html
       fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-unicode.html

* platform/network/soup/ResourceResponseSoup.cpp:
(WebCore::ResourceResponse::platformSuggestedFilename):

LayoutTests:

Remove passing tests and add new baseline for
fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-slashes.html because libsoup handles slashes
differently but download succeeds.

* platform/gtk/TestExpectations:
* platform/gtk/fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-slashes-expected.txt: Added.

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

4 years ago[GTK] Rendering artifacts when resizing the window in X11 with AC mode enabled
carlosgc@webkit.org [Mon, 27 Feb 2017 14:42:08 +0000 (14:42 +0000)]
[GTK] Rendering artifacts when resizing the window in X11 with AC mode enabled
https://bugs.webkit.org/show_bug.cgi?id=168728

Reviewed by Žan Doberšek.

This happens because the pixmap we create from the redirected window is uninitialized until the threaded
compositor renders into it. We should always initialize the pixmap right after it's created.

* WebProcess/WebPage/gtk/AcceleratedSurfaceX11.cpp:
(WebKit::defaultVisual): Helper static method to get the default GdkVisual.
(WebKit::AcceleratedSurfaceX11::AcceleratedSurfaceX11): Use createPixmap().
(WebKit::AcceleratedSurfaceX11::createPixmap): Create and initialize the pixmap.
(WebKit::AcceleratedSurfaceX11::resize): Use createPixmap().
* WebProcess/WebPage/gtk/AcceleratedSurfaceX11.h:

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

4 years ago[GTK] Flickering when leaving accelerated compositing mode
carlosgc@webkit.org [Mon, 27 Feb 2017 14:38:47 +0000 (14:38 +0000)]
[GTK] Flickering when leaving accelerated compositing mode
https://bugs.webkit.org/show_bug.cgi?id=168911

Reviewed by Žan Doberšek.

It doesn't always happen, and it's too fast, more noticeable in websites with a dark background, because we are
drawing a single white frame. This happens when we leave AC mode during the layer flush that schedules an update
on the compositor, which at that point only clears the area and renders nothing. However,
CoordinatedGraphicsScene::paintToCurrentGLContext() always renders a white background when no web view color has
been set. And that's the white frame we get. We could prevent that last update from happening by checking if we
still have a graphics root layer after syncDisplayState() in the layer flush, the same way we check the layer
tree host is still valid.

* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
(WebKit::CoordinatedLayerTreeHost::layerFlushTimerFired):

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

4 years ago[Modern Media Controls] Dragging controls in fullscreen on macOS prevents scrubbing...
graouts@webkit.org [Mon, 27 Feb 2017 14:21:50 +0000 (14:21 +0000)]
[Modern Media Controls] Dragging controls in fullscreen on macOS prevents scrubbing or interacting with controls
https://bugs.webkit.org/show_bug.cgi?id=168820
<rdar://problem/30690281>

Reviewed by Jon Lee.

Source/WebCore:

We broke this in https://bugs.webkit.org/show_bug.cgi?id=168755. We restore the check that the
event target when initiating a drag is the controls bar itself and not some of its content.

Since this wasn't caught by our existing tests, we add a test that attemps to initiate a drag
starting over one of the controls and notice that no dragging occurs.

We also fix an issue where we wouldn't update the layout of the left container as its icon
buttons would load, which would cause the layout width of the left container to be incorrect
and the related tests to time out.

Test: media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-drag-is-prevented-over-button.html

* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
(MacOSFullscreenMediaControls.prototype.layout):
(MacOSFullscreenMediaControls.prototype._handleMousedown):

LayoutTests:

Making the existing test more robust and adding a new test that checks what happens
when we initiate a drag over some controls.

* media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-drag-expected.txt:
* media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-drag-is-prevented-over-button-expected.txt: Added.
* media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-drag-is-prevented-over-button.html: Added.
* media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-drag.html:

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

4 years ago[libwebrtc] Enable WebRTC in some Production Builds
achristensen@apple.com [Mon, 27 Feb 2017 14:09:50 +0000 (14:09 +0000)]
[libwebrtc] Enable WebRTC in some Production Builds
https://bugs.webkit.org/show_bug.cgi?id=168858

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

4 years ago[TextureMapper] Clean up BitmapTextureGL construction
zandobersek@gmail.com [Mon, 27 Feb 2017 11:29:57 +0000 (11:29 +0000)]
[TextureMapper] Clean up BitmapTextureGL construction
https://bugs.webkit.org/show_bug.cgi?id=168909

Reviewed by Carlos Garcia Campos.

Have the BitmapTextureGL constructor accept an rvalue reference pointer
to the GraphicsContext3D object. A static create() method is also added
to help with constructing these objects. Construction sites are updated
appropriately.

The BitmapTextureGL constructor is further cleaned up by moving default
member initializations together with the member declarations.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
* platform/graphics/texmap/BitmapTextureGL.cpp:
(WebCore::BitmapTextureGL::BitmapTextureGL):
* platform/graphics/texmap/BitmapTextureGL.h:
* platform/graphics/texmap/BitmapTexturePool.cpp:
(WebCore::BitmapTexturePool::createTexture):
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGL::createTexture):

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

4 years ago[TextureMapper] Remove InterpolationQuality, TextDrawingModeFlags member variables
zandobersek@gmail.com [Mon, 27 Feb 2017 10:06:28 +0000 (10:06 +0000)]
[TextureMapper] Remove InterpolationQuality, TextDrawingModeFlags member variables
https://bugs.webkit.org/show_bug.cgi?id=168906

Reviewed by Carlos Garcia Campos.

Remove the InterpolationQuality and TextDrawingModeFlags member variables from the
TextureMapper class. These weren't modified anywhere in the code.

BitmapTexture::updateContents() still sets the image interpolation quality and
drawing mode on the ImageBuffer's GraphicsContext, but now uses the default
InterpolationDefault and TextModeFill values.

* platform/graphics/texmap/BitmapTexture.cpp:
(WebCore::BitmapTexture::updateContents):
* platform/graphics/texmap/TextureMapper.cpp:
(WebCore::TextureMapper::TextureMapper): Deleted.
(WebCore::TextureMapper::~TextureMapper): Deleted.
* platform/graphics/texmap/TextureMapper.h:
(WebCore::TextureMapper::setImageInterpolationQuality): Deleted.
(WebCore::TextureMapper::setTextDrawingMode): Deleted.
(WebCore::TextureMapper::imageInterpolationQuality): Deleted.
(WebCore::TextureMapper::textDrawingMode): Deleted.

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

4 years agoAdd a way to test file input without relying on drag and drop
aestes@apple.com [Mon, 27 Feb 2017 09:49:29 +0000 (09:49 +0000)]
Add a way to test file input without relying on drag and drop
https://bugs.webkit.org/show_bug.cgi?id=168848
<rdar://problem/22258242>

Reviewed by Tim Horton.

Tools:

Existing layout tests relied on drag and drop support in EventSender to configure a file
input element for testing. This had several problems:

1. WebKitTestRunner has no support for beginDragWithFiles(), and DumpRenderTree doesn't
   support it on iOS.
2. We have no test coverage for selecting files via the runOpenPanel UI delegate, leading to
   bugs like webkit.org/b/159686.

Even if we fixed (1), we'd still have a test coverage gap due to (2), so this patch
introduces a way for a test to specify the list of files that should be selected by the
runOpenPanel UI delegate: TestRunner.setOpenPanelFiles(). It also creates versions of a
number of existing file input tests using TestRunner.setOpenPanelFiles() instead of
EventSender.beginDragWithFiles().

* DumpRenderTree/ios/DumpRenderTreeBrowserView.mm:
(-[DumpRenderTreeBrowserView webView:runOpenPanelForFileButtonWithResultListener:configuration:]):
Overrode to call the corresponding method on UIDelegate.
* DumpRenderTree/TestRunner.cpp:
(setOpenPanelFilesCallback): Added to call TestRunner::setOpenPanelFiles().
(TestRunner::staticFunctions): Registered setOpenPanelFiles.
(TestRunner::setOpenPanelFiles): Added. Converts the JavaScript array of file paths to a
std::vector of std::strings.
* DumpRenderTree/TestRunner.h:
(TestRunner::openPanelFiles):
* DumpRenderTree/mac/UIDelegate.mm:
(-[UIDelegate webView:runOpenPanelForFileButtonWithResultListener:allowMultipleFiles:]):
Added. Converts the array of file paths to an NSArray of NSURLs, resolving the file paths
relative to the current test URL. Returns either the first item or all items depending on
the value of allowMultipleFiles.
* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: Defined setOpenPanelFiles.
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setOpenPanelFiles): Added. Converts the JavaScript array of file paths to
a WKArray of WKURLs, resolving the file paths relative to the current test URL, and sends
the WKArray to the UI process with the "SetOpenPanelFileURLs" message.
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.cpp:
(WTR::runOpenPanel): Calls the WKOpenPanelResultListener with either the first item or all
items, depending on the value of WKOpenPanelParametersGetAllowsMultipleFiles().
(WTR::TestController::resetStateToConsistentValues): Clear m_openPanelFileURLs.
* WebKitTestRunner/TestController.h:
(WTR::TestController::openPanelFileURLs):
(WTR::TestController::setOpenPanelFileURLs):
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveMessageFromInjectedBundle): Added code to handle the
"SetOpenPanelFileURLs" message.

LayoutTests:

Added versions of existing file input tests that use TestRunner.setOpenPanelFiles() instead
of EventSender.beginDragWithFiles().

* fast/dom/FileList-iterator-using-open-panel-expected.txt: Added.
* fast/dom/FileList-iterator-using-open-panel.html: Added.
* fast/files/apply-blob-url-to-img-using-open-panel-expected.txt: Added.
* fast/files/apply-blob-url-to-img-using-open-panel.html: Added.
* fast/files/apply-blob-url-to-xhr-using-open-panel-expected.txt: Added.
* fast/files/apply-blob-url-to-xhr-using-open-panel.html: Added.
* fast/files/file-list-test-using-open-panel-expected.txt: Added.
* fast/files/file-list-test-using-open-panel.html: Added.
* fast/files/file-reader-abort-using-open-panel-expected.txt: Added.
* fast/files/file-reader-abort-using-open-panel.html: Added.
* fast/files/file-reader-directory-crash-using-open-panel-expected.txt: Added.
* fast/files/file-reader-directory-crash-using-open-panel.html: Added.
* fast/files/filereader-zip-bundle-using-open-panel-expected.txt: Added.
* fast/files/filereader-zip-bundle-using-open-panel.html: Added.
* fast/forms/file/file-input-reset-using-open-panel-expected.html: Added.
* fast/forms/file/file-input-reset-using-open-panel.html: Added.
* fast/forms/file/file-reset-in-change-using-open-panel-expected.html: Added.
* fast/forms/file/file-reset-in-change-using-open-panel.html: Added.
* fast/forms/file/get-file-upload-using-open-panel-expected.txt: Added.
* fast/forms/file/get-file-upload-using-open-panel.html: Added.
* fast/forms/file/input-file-value-using-open-panel-expected.txt: Added.
* fast/forms/file/input-file-value-using-open-panel.html: Added.
* fast/forms/file/input-file-write-files-using-open-panel-expected.txt: Added.
* fast/forms/file/input-file-write-files-using-open-panel.html: Added.
* fast/history/page-cache-createObjectURL-using-open-panel-expected.txt: Added.
* fast/history/page-cache-createObjectURL-using-open-panel.html: Added.
* http/tests/local/blob/resources/hybrid-blob-util.js:
(this.setupForTests):
(this.runTestsWithDrag):
(this.runTestsWithOpenPanel):
(this.runTests):
* http/tests/local/blob/script-tests/send-hybrid-blob-using-open-panel.js: Added.
(runHybridBlobTest):
(runTests.F):
(runTests.D):
(runTests):
* http/tests/local/blob/send-hybrid-blob-using-open-panel-expected.txt: Added.
* http/tests/local/blob/send-hybrid-blob-using-open-panel.html: Added.
* http/tests/local/fileapi/file-last-modified-after-delete-using-open-panel-expected.txt: Added.
* http/tests/local/fileapi/file-last-modified-after-delete-using-open-panel.html: Added.
* http/tests/local/fileapi/file-last-modified-using-open-panel-expected.txt: Added.
* http/tests/local/fileapi/file-last-modified-using-open-panel.html: Added.
* http/tests/local/fileapi/resources/setup-file-input-element-for-drag.js:
(setFileInputChangeCallback):
* http/tests/local/fileapi/script-tests/file-last-modified-after-delete-using-open-panel.js: Added.
(onFileChange):
(runTest):
* http/tests/local/fileapi/script-tests/file-last-modified-using-open-panel.js: Added.
(onFileChange):
(runTest):
* http/tests/local/fileapi/upload-zip-bundle-as-blob-using-open-panel-expected.txt: Added.
* http/tests/local/fileapi/upload-zip-bundle-as-blob-using-open-panel.html: Added.
* http/tests/local/formdata/send-form-data-constructed-from-form-using-open-panel-expected.txt: Added.
* http/tests/local/formdata/send-form-data-constructed-from-form-using-open-panel.html: Added.
* http/tests/local/formdata/send-form-data-with-empty-file-filename-using-open-panel-expected.txt: Added.
* http/tests/local/formdata/send-form-data-with-empty-file-filename-using-open-panel.html: Added.
* media/video-src-blob-using-open-panel-expected.txt: Added.
* media/video-src-blob-using-open-panel.html: Added.
* platform/ios-simulator/TestExpectations:

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

4 years agoA Locked indicator should be visually distinct from an unlocked indicator
rniwa@webkit.org [Mon, 27 Feb 2017 09:45:10 +0000 (09:45 +0000)]
A Locked indicator should be visually distinct from an unlocked indicator
https://bugs.webkit.org/show_bug.cgi?id=168868
<rdar://problem/29666054>

Reviewed by Antti Koivisto.

Added the support for specifying options.lockedIndicator in addition to options.indicator to style
an locked indicator differently from an unlocked one.

* browser-tests/time-series-chart-tests.js: Added new test cases for indicators.
(createChartWithSampleCluster): Renamed and swapped the order of arguments to better match
TimeSeriesChart's constructor. Now the second argument is an array of source as is in the constructor.
(createInteractiveChartWithSampleCluster): Added.

* public/v3/components/chart-styles.js:
(ChartStyles.overviewChartOptions): Changed the color of a selection to blue.
(ChartStyles.mainChartOptions): Ditto. Also use a different style for a locked indicator.

* public/v3/components/interactive-time-series-chart.js:
(InteractiveTimeSeriesChart.prototype._layout): Removed the unused variable.
(InteractiveTimeSeriesChart.prototype._renderChartContent): Use options.lockedIndicator when rendering
a locked indicator. Also stroke the circle in addition to filling it so that we can use a blue circle
with a white hole for a locked indicator to make it even more visually distinctive from an unlocked one.

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

4 years agoLinks cannot be activated when running Mobile Safari with external SDK build of WebKi...
aestes@apple.com [Mon, 27 Feb 2017 08:07:57 +0000 (08:07 +0000)]
Links cannot be activated when running Mobile Safari with external SDK build of WebKit for iOS Simulator
https://bugs.webkit.org/show_bug.cgi?id=141906

Reviewed by Tim Horton.

Source/WebKit2:

Even if Touch Events are disabled, we still need to register a
UIWebTouchEventsGestureRecognizer to record the layer tree transaction ID when a touch
begins. Click events are only generated for touches that occur after the current frame's
load has committed, and we use the transaction ID from when the touch began to implement
this check.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::handleTouchEventSynchronously):
(WebKit::WebPageProxy::resetState):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentViewInteraction.h: Declared _layerTreeTransactionIdAtLastTouchStart.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]): Register a UIWebTouchEventsGestureRecognizer even if
Touch Events are disabled.
(-[WKContentView cleanupInteraction]): Reset _layerTreeTransactionIdAtLastTouchStart to 0.
(-[WKContentView _webTouchEventsRecognized:]): Update _layerTreeTransactionIdAtLastTouchStart
when a touch begins, even if Touch Events are disabled.
(-[WKContentView _singleTapCommited:]): Passed _layerTreeTransactionIdAtLastTouchStart to
WebPageProxy::commitPotentialTap().
(-[WKContentView _attemptClickAtLocation:]): Ditto for WebPageProxy::handleTap().
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::commitPotentialTap):
(WebKit::WebPageProxy::handleTap):

LayoutTests:

Unskipped tests that now pass. Rewrote a test to use UIHelper so that it works on both
DumpRenderTree and WebKitTestRunner.

* fast/events/can-click-element-on-page-with-active-pseudo-class-and-search-field.html:
Rewrote to use UIHelper.activateAt().
* platform/ios-simulator-wk2/TestExpectations:
* platform/ios-simulator/TestExpectations:

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

4 years ago[CoordinatedGraphics] Remove CoordinatedGraphicsScene::paintToGraphicsContext()
zandobersek@gmail.com [Mon, 27 Feb 2017 07:59:12 +0000 (07:59 +0000)]
[CoordinatedGraphics] Remove CoordinatedGraphicsScene::paintToGraphicsContext()
https://bugs.webkit.org/show_bug.cgi?id=168903

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Remove the GraphicsContext pointer member from the TextureMapper class
since the getter and setter methods are not used anywhere.

* platform/graphics/texmap/TextureMapper.cpp:
(WebCore::TextureMapper::TextureMapper):
* platform/graphics/texmap/TextureMapper.h:
(WebCore::TextureMapper::setGraphicsContext): Deleted.
(WebCore::TextureMapper::graphicsContext): Deleted.

Source/WebKit2:

Remove the CoordinatedGraphicsScene::paintToGraphicsContext() method as it
is not used anywhere. Also enables removing the GraphicsContext pointer
member from the TextureMapper class.

* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::paintToGraphicsContext): Deleted.
* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:

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

4 years ago[GTK] Hangs when showing Google search results
carlosgc@webkit.org [Mon, 27 Feb 2017 07:50:31 +0000 (07:50 +0000)]
[GTK] Hangs when showing Google search results
https://bugs.webkit.org/show_bug.cgi?id=168699

Reviewed by Žan Doberšek.

Connection::sendOutgoingMessage() can poll forever if sendmsg fails with EAGAIN or EWOULDBLOCK. For example if
socket read buffers are full, poll will be blocked until we read the pending data, but we can't read because
the thread is blocked in the poll. In case of EAGAIN/EWOULDBLOCK we should poll using the run loop, to allow
reads to happen in thread while we wait for the socket to be writable again. In the GTK+ port we use
GSocketMonitor to poll socket file descriptor without blocking, using the run loop. This patch renames the
socket monitor as readSocketMonitor and adds another one for polling output. When sendmsg fails with
EAGAIN/EWOULDBLOCK, the pending message is saved and the write monitor starts polling. Once the socket is
writable again we send the pending message. Helper class MessageInfo and a new one UnixMessage have been moved
to its own header file to be able to use std::unique_ptr member to save the pending message.

* Platform/IPC/Connection.cpp: Include UnixMessage.h as required by std::unique_ptr.
* Platform/IPC/Connection.h: Add write socket monitor and also keep the GSocket as a member to reuse it.
* Platform/IPC/glib/GSocketMonitor.cpp: Use Function instead of std::function.
(IPC::GSocketMonitor::start):
* Platform/IPC/glib/GSocketMonitor.h:
* Platform/IPC/unix/ConnectionUnix.cpp:
(IPC::Connection::platformInitialize): Initialize the GSocket here since we rely on it to take the ownership of
the descriptor. We were leaking it if the connection was invalidated without being opened.
(IPC::Connection::platformInvalidate): Destroy the GSocket even when not connected. Also stop the write monitor.
(IPC::Connection::processMessage):
(IPC::Connection::open):
(IPC::Connection::platformCanSendOutgoingMessages): Return false if we have a pending message to ensure
Connection doesn't try to send more messages until the pending message is dispatched. We don't need to check
m_isConnected because the caller already checks that.
(IPC::Connection::sendOutgoingMessage): Split it in two. This creates and prepares a UnixMessage and then calls
sendOutputMessage() to do the rest.
(IPC::Connection::sendOutputMessage): Send the message, or save it if sendmsg fails with EAGAIN or EWOULDBLOCK
to be sent later when the socket is writable.
* Platform/IPC/unix/UnixMessage.h: Added.
(IPC::MessageInfo::MessageInfo):
(IPC::MessageInfo::setMessageBodyIsOutOfLine):
(IPC::MessageInfo::isMessageBodyIsOutOfLine):
(IPC::MessageInfo::bodySize):
(IPC::MessageInfo::attachmentCount):
(IPC::UnixMessage::UnixMessage):
(IPC::UnixMessage::~UnixMessage):
(IPC::UnixMessage::attachments):
(IPC::UnixMessage::messageInfo):
(IPC::UnixMessage::body):
(IPC::UnixMessage::bodySize):
(IPC::UnixMessage::appendAttachment):
* PlatformGTK.cmake:

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

4 years agoUnreviewed. Bump GTK+ versions numbers.
carlosgc@webkit.org [Mon, 27 Feb 2017 06:48:52 +0000 (06:48 +0000)]
Unreviewed. Bump GTK+ versions numbers.

* Source/cmake/OptionsGTK.cmake:

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

4 years agoUnreviewed, rolling out r213024.
carlosgc@webkit.org [Mon, 27 Feb 2017 06:44:08 +0000 (06:44 +0000)]
Unreviewed, rolling out r213024.

Wrong version numbers

Reverted changeset:

"[GTK] Unreviewed, bump GTK version numbers also on trunk"
http://trac.webkit.org/changeset/213024

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

4 years agoWeb Inspector: RTL: Docking Left doesn't constrain the page width
commit-queue@webkit.org [Mon, 27 Feb 2017 06:31:44 +0000 (06:31 +0000)]
Web Inspector: RTL: Docking Left doesn't constrain the page width
https://bugs.webkit.org/show_bug.cgi?id=168862

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

* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
Calculate the inspectedViewFrame to be the remaining space after WebInspector is opened
instead of using the original page size.

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

4 years ago[GTK] Unreviewed, bump GTK version numbers also on trunk
mcatanzaro@igalia.com [Mon, 27 Feb 2017 06:03:23 +0000 (06:03 +0000)]
[GTK] Unreviewed, bump GTK version numbers also on trunk

* Source/cmake/OptionsGTK.cmake:

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

4 years agoStop exporting C++ member variables from WKDOMTextIterator
ap@apple.com [Mon, 27 Feb 2017 05:20:16 +0000 (05:20 +0000)]
Stop exporting C++ member variables from WKDOMTextIterator
https://bugs.webkit.org/show_bug.cgi?id=168885

Reviewed by Dan Bernstein.

* WebProcess/InjectedBundle/API/mac/WKDOMTextIterator.mm:

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

4 years agoAdd preprocessor guards to Mac specific files that are exposed as private headers...
ap@apple.com [Mon, 27 Feb 2017 04:31:03 +0000 (04:31 +0000)]
Add preprocessor guards to Mac specific files that are exposed as private headers on iOS
https://bugs.webkit.org/show_bug.cgi?id=168878

Reviewed by Dan Bernstein.

* UIProcess/API/C/WKInspector.h:
* WebProcess/InjectedBundle/API/c/mac/WKBundlePageBannerMac.h:

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

4 years agoRemove spurious C++ include from _WKTestingDelegate.h
ap@apple.com [Mon, 27 Feb 2017 00:54:03 +0000 (00:54 +0000)]
Remove spurious C++ include from _WKTestingDelegate.h
https://bugs.webkit.org/show_bug.cgi?id=168877

Reviewed by Dan Bernstein.

* UIProcess/API/Cocoa/_WKTestingDelegate.h:

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

4 years agoStop compiling our own cursorMovementIterator()
mmaxfield@apple.com [Mon, 27 Feb 2017 00:36:02 +0000 (00:36 +0000)]
Stop compiling our own cursorMovementIterator()
https://bugs.webkit.org/show_bug.cgi?id=168211

Reviewed by David Hyatt.

Source/WebCore:

Covered by existing tests.

Hook up the caret iterator.

* platform/graphics/ComplexTextController.cpp:
(WebCore::ComplexTextController::offsetForPosition):
* rendering/RenderText.cpp:
(WebCore::RenderText::previousOffset):
(WebCore::RenderText::nextOffset):
* rendering/RenderText.h:

Source/WTF:

This patch creates a unified Text Breaking API, which can be backed by either ICU
or CoreFoundation (for ports which can use it). Rather than using inheritance and
virtual functions to implement this, because there are only two subclasses, the
simpler option of just using a Variant is used instead. There is also a cache which
allows you to reuse iterators without reconstructing them. This cache is better
than the previous method of having a single static iterator because the cache
lets you use two iterators simultaneously.

In the future, I will hook up all iterators to use this shared class. However, for
this patch, I've only hooked up the caret position iterator (backed by CoreFoundation
on Cocoa ports and UBRK_CHARACTER on other ports).

* WTF.xcodeproj/project.pbxproj:
* wtf/spi/cf/CFStringSPI.h: Added.
* wtf/text/TextBreakIterator.cpp:
(WTF::initializeIteratorWithRules): Deleted.
(WTF::cursorMovementIterator): Deleted.
* wtf/text/TextBreakIterator.h:
(WTF::TextBreakIterator::preceding):
(WTF::TextBreakIterator::following):
(WTF::TextBreakIterator::isBoundary):
(WTF::TextBreakIterator::setText):
(WTF::TextBreakIterator::mode):
(WTF::TextBreakIterator::locale):
(WTF::TextBreakIteratorCache::singleton):
(WTF::TextBreakIteratorCache::take):
(WTF::TextBreakIteratorCache::put):
(WTF::TextBreakIteratorCache::TextBreakIteratorCache):
* wtf/text/cf/TextBreakIteratorCF.h: Added.
(WTF::TextBreakIteratorCF::TextBreakIteratorCF):
(WTF::TextBreakIteratorCF::setText):
(WTF::TextBreakIteratorCF::preceding):
(WTF::TextBreakIteratorCF::following):
(WTF::TextBreakIteratorCF::isBoundary):
* wtf/text/icu/TextBreakIteratorICU.h: Added.
(WTF::TextBreakIteratorICU::set8BitText):
(WTF::TextBreakIteratorICU::TextBreakIteratorICU):
(WTF::TextBreakIteratorICU::operator=):
(WTF::TextBreakIteratorICU::~TextBreakIteratorICU):
(WTF::TextBreakIteratorICU::setText):
(WTF::TextBreakIteratorICU::preceding):
(WTF::TextBreakIteratorICU::following):
(WTF::TextBreakIteratorICU::isBoundary):
* wtf/text/icu/UTextProviderLatin1.h:
* wtf/text/mac/TextBreakIteratorInternalICUMac.mm:
(WTF::mapModeToBackingIterator):
(WTF::TextBreakIterator::TextBreakIterator):

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

4 years agoop_get_by_id_with_this should use inline caching
commit-queue@webkit.org [Mon, 27 Feb 2017 00:32:10 +0000 (00:32 +0000)]
op_get_by_id_with_this should use inline caching
https://bugs.webkit.org/show_bug.cgi?id=162124

Patch by Caio Lima <ticaiolima@gmail.com> on 2017-02-26
Reviewed by Saam Barati.

JSTests:

* microbenchmarks/super-getter.js: Added.
(A.prototype.get f):
(A):
(B.prototype.get f):
(B):
* stress/super-force-ic-fail.js: Added.
(let.assert):
(let.aObj.get foo):
(let.obj.jaz):
(let.bObj.get foo):
(let.obj2.foo):
* stress/super-get-by-id.js: Added.
(assert):
(Base):
(Base.prototype.get name):
(Base.prototype.set name):
(Subclass.prototype.get name):
(Subclass):
(getterName):
(getterValue):
(PolymorphicSubclass.prototype.get value):
(PolymorphicSubclass):
(i.let.BaseCode):
(i.get value):
(MegamorphicSubclass.prototype.get value):
(MegamorphicSubclass):
(let.subObj.get value):
(i.catch):
(subObj.get value):
(BaseException):
(BaseException.prototype.get name):
(SubclassException.prototype.get name):
(SubclassException):
(prototype.foo):
(prototype.get name):
(SubclassExceptionComplex.prototype.get name):
(SubclassExceptionComplex):
* stress/super-getter-reset-ic.js: Added.
(let.assert):
(let.B.f):

Source/JavaScriptCore:

This patch is enabling inline cache for op_get_by_id_with_this in all
tiers. It means that operations using ```super.member``` are going to
be able to be optimized by PIC. To enable it, we introduced a new
member of StructureStubInfo.patch named thisGPR, created a new class
to manage the IC named JITGetByIdWithThisGenerator and changed
PolymorphicAccess.regenerate that uses StructureStubInfo.patch.thisGPR
to decide the correct this value on inline caches.
With inline cached enabled, ```super.member``` are ~4.5x faster,
according microbenchmarks.

* bytecode/AccessCase.cpp:
(JSC::AccessCase::generateImpl):
* bytecode/PolymorphicAccess.cpp:
(JSC::PolymorphicAccess::regenerate):
* bytecode/PolymorphicAccess.h:
* bytecode/StructureStubInfo.cpp:
(JSC::StructureStubInfo::reset):
* bytecode/StructureStubInfo.h:
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::link):
* dfg/DFGJITCompiler.h:
(JSC::DFG::JITCompiler::addGetByIdWithThis):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileIn):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::callOperation):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::cachedGetByIdWithThis):
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::cachedGetByIdWithThis):
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileGetByIdWithThis):
(JSC::FTL::DFG::LowerDFGToB3::compileIn):
(JSC::FTL::DFG::LowerDFGToB3::getByIdWithThis):
* jit/CCallHelpers.h:
(JSC::CCallHelpers::setupArgumentsWithExecState):
* jit/ICStats.h:
* jit/JIT.cpp:
(JSC::JIT::JIT):
(JSC::JIT::privateCompileSlowCases):
(JSC::JIT::link):
* jit/JIT.h:
* jit/JITInlineCacheGenerator.cpp:
(JSC::JITByIdGenerator::JITByIdGenerator):
(JSC::JITGetByIdWithThisGenerator::JITGetByIdWithThisGenerator):
(JSC::JITGetByIdWithThisGenerator::generateFastPath):
* jit/JITInlineCacheGenerator.h:
(JSC::JITGetByIdWithThisGenerator::JITGetByIdWithThisGenerator):
* jit/JITInlines.h:
(JSC::JIT::callOperation):
* jit/JITOperations.cpp:
* jit/JITOperations.h:
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emit_op_get_by_id_with_this):
(JSC::JIT::emitSlow_op_get_by_id_with_this):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emit_op_get_by_id_with_this):
(JSC::JIT::emitSlow_op_get_by_id_with_this):
* jit/Repatch.cpp:
(JSC::appropriateOptimizingGetByIdFunction):
(JSC::appropriateGenericGetByIdFunction):
(JSC::tryCacheGetByID):
* jit/Repatch.h:
* jsc.cpp:
(WTF::CustomGetter::getOwnPropertySlot):
(WTF::CustomGetter::customGetterAcessor):

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

4 years agoDon't import RetainPtr in WebNotification.h
ap@apple.com [Mon, 27 Feb 2017 00:17:34 +0000 (00:17 +0000)]
Don't import RetainPtr in WebNotification.h
https://bugs.webkit.org/show_bug.cgi?id=168876

Reviewed by Dan Bernstein.

This is an Objective-C SPI header.

* WebView/WebNotification.h:
* WebView/WebNotification.mm:
(-[WebNotification initWithCoreNotification:notificationID:]):
(-[WebNotification dealloc]):

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

4 years agoSimplify EXPORTED_SYMBOLS_FILE variables in WebKitLegacy.xcconfig
aakash_jain@apple.com [Mon, 27 Feb 2017 00:16:50 +0000 (00:16 +0000)]
Simplify EXPORTED_SYMBOLS_FILE variables in WebKitLegacy.xcconfig
https://bugs.webkit.org/show_bug.cgi?id=168819

Reviewed by Dan Bernstein.

* Configurations/WebKitLegacy.xcconfig:

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

4 years agoRemove unimplemented WKResourceLoadStatisticsManagerSetReducedTimestampResolution
ap@apple.com [Mon, 27 Feb 2017 00:13:26 +0000 (00:13 +0000)]
Remove unimplemented WKResourceLoadStatisticsManagerSetReducedTimestampResolution
https://bugs.webkit.org/show_bug.cgi?id=168880

Reviewed by Dan Bernstein.

* UIProcess/API/C/WKResourceLoadStatisticsManager.h:

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

4 years agoRemove leftover WebKit2 C API function declarations
ap@apple.com [Mon, 27 Feb 2017 00:13:10 +0000 (00:13 +0000)]
Remove leftover WebKit2 C API function declarations
https://bugs.webkit.org/show_bug.cgi?id=168879

Reviewed by Tim Horton.

* UIProcess/API/C/WKPreferencesRefPrivate.h:

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

4 years agoRemove some old WKSecurityOrigin binary compatibility stubs
ap@apple.com [Mon, 27 Feb 2017 00:12:51 +0000 (00:12 +0000)]
Remove some old WKSecurityOrigin binary compatibility stubs
https://bugs.webkit.org/show_bug.cgi?id=168881

Reviewed by Dan Bernstein.

* Shared/API/c/WKSecurityOriginRef.cpp:
(WKSecurityOriginGetHost): Deleted.
(WKSecurityOriginGetProtocol): Deleted.

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

4 years agoUnreviewed, rolling out r212942.
commit-queue@webkit.org [Sun, 26 Feb 2017 23:40:54 +0000 (23:40 +0000)]
Unreviewed, rolling out r212942.
https://bugs.webkit.org/show_bug.cgi?id=168882

Made EWS very flaky (Requested by ap on #webkit).

Reverted changeset:

"[Modern Media Controls] Dragging controls in fullscreen on
macOS prevents scrubbing or interacting with controls"
https://bugs.webkit.org/show_bug.cgi?id=168820
http://trac.webkit.org/changeset/212942

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

4 years agoREGRESSION (r211312): Double-clicking a word selects it along with the space that...
wenson_hsieh@apple.com [Sun, 26 Feb 2017 23:06:54 +0000 (23:06 +0000)]
REGRESSION (r211312): Double-clicking a word selects it along with the space that follows it
https://bugs.webkit.org/show_bug.cgi?id=168821
<rdar://problem/30690431>

Reviewed by Tim Horton.

Source/WebKit2:

Actually encode and decode smartInsertDeleteEnabled when sending WebPageCreationParameters over XPC.

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode):
(WebKit::WebPageCreationParameters::decode):

Tools:

Adds the ability for TestWKWebView to send a sequence of clicks to its window, and uses this capability to
verify that double clicking to select a word in a WKWebView on Mac selects just the word, and not a trailing
space along with it.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/double-click-does-not-select-trailing-space.html: Added.
* TestWebKitAPI/Tests/mac/WKWebViewSelectionTests.mm: Copied from Tools/TestWebKitAPI/cocoa/TestWKWebView.h.
(TEST):
* TestWebKitAPI/cocoa/TestWKWebView.h:
* TestWebKitAPI/cocoa/TestWKWebView.mm:
(-[TestWKWebViewHostWindow _mouseDownAtPoint:simulatePressure:clickCount:]):
(-[TestWKWebViewHostWindow _mouseUpAtPoint:clickCount:]):
(-[TestWKWebView mouseDownAtPoint:simulatePressure:]):
(-[TestWKWebView mouseUpAtPoint:]):
(-[TestWKWebView sendClicksAtPoint:numberOfClicks:]):
(-[TestWKWebViewHostWindow _mouseDownAtPoint:simulatePressure:]): Deleted.
(-[TestWKWebViewHostWindow _mouseUpAtPoint:]): Deleted.

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

4 years agoMake check-webkit-style do some basic validation for CSSProperties.json
simon.fraser@apple.com [Sun, 26 Feb 2017 18:36:30 +0000 (18:36 +0000)]
Make check-webkit-style do some basic validation for CSSProperties.json
https://bugs.webkit.org/show_bug.cgi?id=168874

Reviewed by Zalan Bujtas.

Do checking of the keys and the value types.

Print exceptions if they occur; previously, coding errors caused silent failure.

* Scripts/webkitpy/style/checker.py:
(CheckerDispatcher._create_checker):
* Scripts/webkitpy/style/checkers/jsonchecker.py:
(JSONFeaturesChecker.check):
(JSONCSSPropertiesChecker):
(JSONCSSPropertiesChecker.check):
(JSONCSSPropertiesChecker.validate_comment):
(JSONCSSPropertiesChecker.validate_type):
(JSONCSSPropertiesChecker.validate_boolean):
(JSONCSSPropertiesChecker.validate_string):
(JSONCSSPropertiesChecker.validate_array):
(JSONCSSPropertiesChecker.validate_codegen_properties):
(JSONCSSPropertiesChecker.check_property):
(JSONCSSPropertiesChecker.check_codegen_properties):

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

4 years agoHitTestResult's linkSuggestedFilename should sanitize download attribute
cdumez@apple.com [Sun, 26 Feb 2017 18:31:13 +0000 (18:31 +0000)]
HitTestResult's linkSuggestedFilename should sanitize download attribute
https://bugs.webkit.org/show_bug.cgi?id=168856
<rdar://problem/30683109>

Reviewed by Antti Koivisto.

Source/WebCore:

HitTestResult's linkSuggestedFilename should sanitize download attribute.
This is used by the context menu's "Download Linked File" & "Download Linked
File As..." actions.

* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::linkSuggestedFilename):
* rendering/HitTestResult.h:

Source/WebKit2:

HitTestResult's linkSuggestedFilename should sanitize download attribute.
This is used by the context menu's "Download Linked File" & "Download Linked
File As..." actions.

* Shared/WebHitTestResultData.cpp:
(WebKit::WebHitTestResultData::WebHitTestResultData):
* WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
(WebKit::InjectedBundleHitTestResult::linkSuggestedFilename):

Tools:

Add test coverage.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/link-with-download-attribute-with-slashes.html: Added.
* TestWebKitAPI/Tests/WebKit2/mac/ContextMenuDownload.mm:
(TestWebKitAPI::decideDestinationWithSuggestedFilenameContainingSlashes):
(TestWebKitAPI::TEST):

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

4 years agoSimple line layout: Move coverage functions out of SimpleLineLayout.cpp
zalan@apple.com [Sun, 26 Feb 2017 07:19:22 +0000 (07:19 +0000)]
Simple line layout: Move coverage functions out of SimpleLineLayout.cpp
https://bugs.webkit.org/show_bug.cgi?id=168872

Reviewed by Simon Fraser.

SimpleLineLayout.cpp is for core functions only.

No change in functionality.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderingAllInOne.cpp:
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForWithReason):
(WebCore::SimpleLineLayout::printReason): Deleted.
(WebCore::SimpleLineLayout::printReasons): Deleted.
(WebCore::SimpleLineLayout::printTextForSubtree): Deleted.
(WebCore::SimpleLineLayout::textLengthForSubtree): Deleted.
(WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlows): Deleted.
(WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlowsForCurrentPage): Deleted.
(WebCore::SimpleLineLayout::toggleSimpleLineLayout): Deleted.
(WebCore::SimpleLineLayout::printSimpleLineLayoutBlockList): Deleted.
(WebCore::SimpleLineLayout::printSimpleLineLayoutCoverage): Deleted.
* rendering/SimpleLineLayout.h:
* rendering/SimpleLineLayoutCoverage.cpp: Added.
(WebCore::SimpleLineLayout::printReason):
(WebCore::SimpleLineLayout::printReasons):
(WebCore::SimpleLineLayout::printTextForSubtree):
(WebCore::SimpleLineLayout::textLengthForSubtree):
(WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlows):
(WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlowsForCurrentPage):
(WebCore::SimpleLineLayout::toggleSimpleLineLayout):
(WebCore::SimpleLineLayout::printSimpleLineLayoutBlockList):
(WebCore::SimpleLineLayout::printSimpleLineLayoutCoverage):
* rendering/SimpleLineLayoutCoverage.h: Added.

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

4 years agoText might wrap when its preferred logical width is used for sizing the containing...
zalan@apple.com [Sat, 25 Feb 2017 22:18:23 +0000 (22:18 +0000)]
Text might wrap when its preferred logical width is used for sizing the containing block.
https://bugs.webkit.org/show_bug.cgi?id=168864
<rdar://problem/30690734>

Reviewed by Antti Koivisto.

Source/WebCore:

In certain cases we end up measuring a text run in 2 different ways.
1. preferred width computation -> slow path FontCascade::width()
2. line breaking logic -> fast path FontCascade::widthForSimpleText()

FontCascade::width() and ::widthForSimpleText() might return different results for the same run even when
the individual glyph widths are measured to be the same. It's because they run diffrent set of
arithmetics on the float values and for certain values these arithmetics produce different results due to the floating point
precision.
Since RenderText::computePreferredLogicalWidths() currently forces us to use the slow path
(to retrieve fontfallback and glyph overflow information) the only alternative solution is to turn off the fast path
for all runs that have been already measured using the slow path (which would be just wasteful).

Test: fast/text/fast-run-width-vs-slow-run-width.html

* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::widthForSimpleText): Mimics WidthIterator::applyFontTransforms. Use the same set of arithmetics here.

LayoutTests:

* fast/text/fast-run-width-vs-slow-run-width-expected.html: Added.
* fast/text/fast-run-width-vs-slow-run-width.html: Added.

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

4 years agoImprove how multiple codegen-properties are handled in CSSProperties.json
simon.fraser@apple.com [Sat, 25 Feb 2017 19:02:14 +0000 (19:02 +0000)]
Improve how multiple codegen-properties are handled in CSSProperties.json
https://bugs.webkit.org/show_bug.cgi?id=168867

Reviewed by Zalan Bujtas.

To make upcoming metadata storage easier, it's better if property entries in CSSProperties.json
are always hashes. One property (line-height) used an array, in order to represent settings for
two different build flags (ENABLE_TEXT_AUTOSIZING and !ENABLE_TEXT_AUTOSIZING).

Fix by making "codegen-properties" optionally be an array. The relevant item is selected in
removeInactiveCodegenProperties() and used to replace the array.

Sort @internalProprerties when generating code, otherwise the contents of isInternalCSSProperty()
are unstable (the order in @allNames is not stable because it's the keys in a hash).

* css/CSSProperties.json:
* css/makeprop.pl:
(matchEnableFlags):
(removeInactiveCodegenProperties):
(isPropertyEnabled):

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

4 years agoUnreviewed GTK test gardening
mcatanzaro@igalia.com [Sat, 25 Feb 2017 16:33:39 +0000 (16:33 +0000)]
Unreviewed GTK test gardening

* platform/gtk/TestExpectations:

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

4 years ago[GTK] Unreviewed, document deficiency in webkit_website_data_manager_clear() API
mcatanzaro@igalia.com [Sat, 25 Feb 2017 15:47:44 +0000 (15:47 +0000)]
[GTK] Unreviewed, document deficiency in webkit_website_data_manager_clear() API

Document that this function cannot currently delete cookie data for a particular period of
time.

* UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:

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

4 years agoWeb Inspector: RTL: add support for Color Picker
commit-queue@webkit.org [Sat, 25 Feb 2017 09:23:27 +0000 (09:23 +0000)]
Web Inspector: RTL: add support for Color Picker
https://bugs.webkit.org/show_bug.cgi?id=168853

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

* UserInterface/Views/ColorPicker.css:
(.color-picker):
(body[dir=ltr] .color-picker > .brightness):
(body[dir=rtl] .color-picker > .brightness):
(body[dir=ltr] .color-picker > .opacity):
(body[dir=rtl] .color-picker > .opacity):
(.color-picker > .brightness): Deleted.
(.color-picker > .opacity): Deleted.

* UserInterface/Views/ColorWheel.js:
(WebInspector.ColorWheel.prototype.set dimension):
Set the CSS width and height style of the container element to ensure that the element only
takes up the space it needs.

* UserInterface/Views/Slider.css:
(.slider):
* UserInterface/Views/Variables.css:
(:root):
Add `--slider-height` CSS variable for convenience.

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

4 years agoCommit should order by 'commit_order' as secondary key.
dewei_zhu@apple.com [Sat, 25 Feb 2017 08:58:18 +0000 (08:58 +0000)]
Commit should order by 'commit_order' as secondary key.
https://bugs.webkit.org/show_bug.cgi?id=168866

Reviewed by Ryosuke Niwa.

Currently, commits are sorted by 'commit_time' only.
We should use 'commit_order' as secondary key when 'commit_time' is equal or null.

* public/include/commit-log-fetcher.php:
* public/include/db.php:
* server-tests/api-commits.js:
(return.addSlaveForReport.subversionCommits.then):
(then):

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

4 years agoWeb Inspector: RTL: add support for Bezier/Spring editor
commit-queue@webkit.org [Sat, 25 Feb 2017 08:44:43 +0000 (08:44 +0000)]
Web Inspector: RTL: add support for Bezier/Spring editor
https://bugs.webkit.org/show_bug.cgi?id=168854

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

* UserInterface/Views/BezierEditor.css:
(.bezier-editor):
(body[dir=ltr] .bezier-editor):
(body[dir=rtl] .bezier-editor):
(.bezier-editor > .bezier-preview-timing):
(body[dir=ltr] .bezier-editor > .bezier-preview-timing):
(body[dir=rtl] .bezier-editor > .bezier-preview-timing):
(@keyframes bezierPreview):
(body[dir=rtl] .bezier-editor > .bezier-container):
(.bezier-editor > .number-input-container > input):
(body[dir=ltr] .bezier-editor > .number-input-container > input):
(body[dir=rtl] .bezier-editor > .number-input-container > input):

* UserInterface/Views/SpringEditor.css:
(.spring-editor > .spring-timing):
(.spring-editor > .spring-timing::before):
(.spring-editor > .spring-timing::after):
(body[dir=ltr] .spring-editor > .spring-timing::before, body[dir=rtl] .spring-editor > .spring-timing::after):
(body[dir=ltr] .spring-editor > .spring-timing::after, body[dir=rtl] .spring-editor > .spring-timing::before):
(.spring-editor > .number-input-container > .number-input-row > input):

* UserInterface/Views/SpringEditor.js:
(WebInspector.SpringEditor.prototype._updatePreviewAnimation):

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

4 years agoWeb Inspector: RTL: Elements tab Styles sidebar label/arrows need adjustment
commit-queue@webkit.org [Sat, 25 Feb 2017 08:43:29 +0000 (08:43 +0000)]
Web Inspector: RTL: Elements tab Styles sidebar label/arrows need adjustment
https://bugs.webkit.org/show_bug.cgi?id=168746

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

* UserInterface/Views/ScopeRadioButtonNavigationItem.css:
(.scope-radio-button-navigation-item):
(.scope-radio-button-navigation-item > .scope-radio-button-item-select):
(body[dir=ltr] .scope-radio-button-navigation-item > .scope-radio-button-item-select):
(body[dir=rtl] .scope-radio-button-navigation-item > .scope-radio-button-item-select):
(.scope-radio-button-navigation-item > .scope-radio-button-item-select:focus):
(.scope-radio-button-navigation-item > .arrows):
(body[dir=ltr] .scope-radio-button-navigation-item > .arrows):
(body[dir=rtl] .scope-radio-button-navigation-item > .arrows):

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

4 years agoWeb Inspector: copying a search result out of Search Tab navigation sidebar does...
commit-queue@webkit.org [Sat, 25 Feb 2017 08:29:59 +0000 (08:29 +0000)]
Web Inspector: copying a search result out of Search Tab navigation sidebar does nothing
https://bugs.webkit.org/show_bug.cgi?id=167074

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

* UserInterface/Base/Main.js:
(WebInspector._copy):
* UserInterface/Views/SearchTabContentView.js:
(WebInspector.SearchTabContentView.prototype.handleCopyEvent):
Provide the container TabContentView with the opportunity to intercept the copy event.

* UserInterface/Models/SourceCodeTextRange.js:
(WebInspector.SourceCodeTextRange.prototype.get synthesizedTextValue):
* UserInterface/Views/SearchResultTreeElement.js:
(WebInspector.SearchResultTreeElement.prototype.get synthesizedTextValue):
Generate a string with the format `${url}:${lineNumber}:${resultLine}`.

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

4 years agoWeb Inspector: RTL: Styles - Rules sidebar icons are misaligned
commit-queue@webkit.org [Sat, 25 Feb 2017 08:08:27 +0000 (08:08 +0000)]
Web Inspector: RTL: Styles - Rules sidebar icons are misaligned
https://bugs.webkit.org/show_bug.cgi?id=168807

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

* UserInterface/Views/CSSStyleDeclarationSection.css:
(.style-declaration-section > .header):
(body[dir=ltr] .style-declaration-section > .header):
(body[dir=rtl] .style-declaration-section > .header):
(.style-declaration-section.locked > .header > .locked-icon):
(body[dir=ltr] .style-declaration-section.locked > .header > .locked-icon):
(body[dir=rtl] .style-declaration-section.locked > .header > .locked-icon):
(.style-declaration-section > .header > .icon):
(body[dir=ltr] .style-declaration-section > .header > .icon):
(body[dir=rtl] .style-declaration-section > .header > .icon):
(.style-declaration-section > .header > textarea):
(body[dir=ltr] .style-declaration-section > .header > textarea):
(body[dir=rtl] .style-declaration-section > .header > textarea):
(.style-declaration-section.invalid-selector > .header > .icon):

* UserInterface/Views/CSSStyleDetailsSidebarPanel.css:
(.sidebar > .panel.details.css-style > .content):
(.sidebar > .panel.details.css-style > .content ~ .options-container > .new-rule):
(body[dir=ltr] .sidebar > .panel.details.css-style > .content ~ .options-container > .new-rule):
(body[dir=rtl] .sidebar > .panel.details.css-style > .content ~ .options-container > .new-rule):
(.sidebar > .panel.details.css-style > .content ~ .options-container > .toggle-class-toggle):
(body[dir=ltr] .sidebar > .panel.details.css-style > .content ~ .options-container > .toggle-class-toggle):
(body[dir=rtl] .sidebar > .panel.details.css-style > .content ~ .options-container > .toggle-class-toggle):
(.sidebar > .panel.details.css-style > .content ~ .class-list-container > .new-class > .class-name-input):
(body[dir=ltr] .sidebar > .panel.details.css-style > .content ~ .class-list-container > .new-class > .class-name-input):
(body[dir=rtl] .sidebar > .panel.details.css-style > .content ~ .class-list-container > .new-class > .class-name-input):

* UserInterface/Views/Variables.css:
(:root):

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

4 years agoWeb Inspector: RTL: disclosure triangles in details section headers should be flipped...
commit-queue@webkit.org [Sat, 25 Feb 2017 08:05:21 +0000 (08:05 +0000)]
Web Inspector: RTL: disclosure triangles in details section headers should be flipped and aligned right
https://bugs.webkit.org/show_bug.cgi?id=168283

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

* UserInterface/Views/DetailsSection.css:
(.details-section):
(.details-section > .header):
(body[dir=ltr] .details-section > .header):
(body[dir=rtl] .details-section > .header):
(.details-section > .header > .options > .navigation-bar):
(body[dir=ltr] .details-section > .header > :matches(label, .node-link, .go-to-arrow, .options > .navigation-bar), body[dir=rtl] .details-section > .header::before):
(body[dir=ltr] .details-section > .header::before, body[dir=rtl] .details-section > .header > :matches(label, .node-link, .go-to-arrow, .options > .navigation-bar)):
(.details-section > .header::before):
(body[dir=rtl] .details-section > .header::before):
(.details-section > .header > label):
(.details-section > .header > label > input[type="checkbox"]):
(body[dir=ltr] .details-section > .header > label > input[type="checkbox"]):
(body[dir=rtl] .details-section > .header > label > input[type="checkbox"]):
(.details-section > .header .go-to-arrow):
(body[dir=ltr] .details-section > .header .go-to-arrow):
(body[dir=rtl] .details-section > .header .go-to-arrow):
(.details-section > .content > .group > .row.simple > .label):
(body[dir=ltr] .details-section > .content > .group > .row.simple > .label):
(body[dir=rtl] .details-section > .content > .group > .row.simple > .label):
(.details-section > .content > .group > .row.simple > .value):
(body[dir=ltr] .details-section > .content > .group > .row.simple > .value):
(body[dir=rtl] .details-section > .content > .group > .row.simple > .value):
(.details-section > .content > .group > .row.simple > .value .go-to-arrow):
(body[dir=ltr] .details-section > .content > .group > .row.simple > .value .go-to-arrow):
(body[dir=rtl] .details-section > .content > .group > .row.simple > .value .go-to-arrow):
(.details-section > .header > :matches(.node-link, .go-to-arrow)): Deleted.

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

4 years agoREGRESSION(r212853): Comparisons to baseline no longer shows up
rniwa@webkit.org [Sat, 25 Feb 2017 08:02:02 +0000 (08:02 +0000)]
REGRESSION(r212853): Comparisons to baseline no longer shows up
https://bugs.webkit.org/show_bug.cgi?id=168863

Reviewed by Joseph Pecoraro.

The bug was caused by ChartStatusView's code not being updated to use TimeSeriesView's.
Updated the code to use TimeSeriesView's methods to fix the bug.

Also made InteractiveTimeSeriesChart's currentPoint to return a (TimeSeriesView, point, isLocked) tuple
to consolidate it with lockedIndicator() to work towards making the baseline data points selectable.

* browser-tests/time-series-chart-tests.js: Updated the test cases to use currentIndicator, and added
test cases for newly added lastPointInTimeRange.

* public/v3/components/chart-pane.js:
(ChartPane.prototype.serializeState): Updated to use currentIndicator.
(ChartPane.prototype._renderFilteringPopover): Ditto.

* public/v3/components/chart-status-view.js:
(ChartStatusView.prototype.updateStatusIfNeeded): Use currentIndicator for an interative time series.
Fixed the non-interactive chart's code path for TimeSeriesView.
(ChartStatusView.prototype._computeChartStatus): Modernized the code.
(ChartStatusView.prototype._findLastPointPriorToTime): Deleted. Replaced by TimeSeriesView's
lastPointInTimeRange.

* public/v3/components/interactive-time-series-chart.js:
(InteractiveTimeSeriesChart.prototype.currentIndicator):
(InteractiveTimeSeriesChart.prototype.moveLockedIndicatorWithNotification):
(InteractiveTimeSeriesChart.prototype._renderChartContent):
(InteractiveTimeSeriesChart):

* public/v3/models/time-series.js:
(TimeSeriesView.prototype.lastPointInTimeRange): Added.
(TimeSeriesView.prototype._reverse): Added. Traverses the view in the reverse order.
* unit-tests/time-series-tests.js:

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

4 years agoWeb Inspector: RTL: add support for Error page
commit-queue@webkit.org [Sat, 25 Feb 2017 07:53:35 +0000 (07:53 +0000)]
Web Inspector: RTL: add support for Error page
https://bugs.webkit.org/show_bug.cgi?id=168855

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

* UserInterface/Debug/UncaughtExceptionReporter.css:
(.uncaught-exception-sheet):
(body[dir=ltr] .uncaught-exception-sheet):
(body[dir=rtl] .uncaught-exception-sheet):
(.uncaught-exception-sheet h1 > img):
(body[dir=ltr] .uncaught-exception-sheet h1 > img):
(body[dir=rtl] .uncaught-exception-sheet h1 > img):
(.uncaught-exception-sheet h2 > img):
(body[dir=ltr] .uncaught-exception-sheet h2 > img):
(body[dir=rtl] .uncaught-exception-sheet h2 > img):
(.uncaught-exception-sheet dd):
(body[dir=ltr] .uncaught-exception-sheet dd):
(body[dir=rtl] .uncaught-exception-sheet dd):
(.uncaught-exception-sheet ul):
(body[dir=ltr] .uncaught-exception-sheet ul):
(body[dir=rtl] .uncaught-exception-sheet ul):

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

4 years agoWeb Inspector: Uncaught Exception: Unknown angle units "undefined"
commit-queue@webkit.org [Sat, 25 Feb 2017 07:50:32 +0000 (07:50 +0000)]
Web Inspector: Uncaught Exception: Unknown angle units "undefined"
https://bugs.webkit.org/show_bug.cgi?id=168851

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

* UserInterface/Views/GradientEditor.js:
(WebInspector.GradientEditor.prototype._gradientTypeChanged):

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

4 years ago[Resource Timing] Media elements initiated loads should set the initiatorType to...
joepeck@webkit.org [Sat, 25 Feb 2017 07:50:08 +0000 (07:50 +0000)]
[Resource Timing] Media elements initiated loads should set the initiatorType to their element name (video/audio)
https://bugs.webkit.org/show_bug.cgi?id=168680

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

* web-platform-tests/resource-timing/rt-initiatorType-media-expected.txt:
Progression on the initiatorType.

Source/WebCore:

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerCreateResourceLoader):
Pass in the element so it may be used as the initiator.

* html/HTMLVideoElement.h:
Export create() for TestWebKitAPI to use.

* loader/MediaResourceLoader.cpp:
(WebCore::MediaResourceLoader::MediaResourceLoader):
(WebCore::MediaResourceLoader::contextDestroyed):
(WebCore::MediaResourceLoader::requestResource):
* loader/MediaResourceLoader.h:
Include the HTMLMediaElement as the initiator.

Tools:

* TestWebKitAPI/Tests/WebCore/cocoa/WebCoreNSURLSession.mm:
(TestWebKitAPI::WebCoreNSURLSessionTest::SetUp):
Include a dummy HTMLVideoElement.

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

4 years ago[Resource Timing] Gather timing information with reliable responseEnd time
joepeck@webkit.org [Sat, 25 Feb 2017 05:48:51 +0000 (05:48 +0000)]
[Resource Timing] Gather timing information with reliable responseEnd time
https://bugs.webkit.org/show_bug.cgi?id=168351

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

* web-platform-tests/fetch/api/redirect/redirect-count-cross-origin-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-count-cross-origin-worker-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-count-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-count-worker-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-location-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-location-worker-expected.txt:
New behavior for too many redirects caused by <rdar://problem/30610988>.

* web-platform-tests/resource-timing/rt-nextHopProtocol-expected.txt: Added.
* web-platform-tests/resource-timing/rt-nextHopProtocol.html: Added.
* web-platform-tests/resource-timing/rt-nextHopProtocol.js: Added.
* web-platform-tests/resource-timing/rt-nextHopProtocol.worker-expected.txt: Added.
* web-platform-tests/resource-timing/rt-nextHopProtocol.worker.html: Added.
* web-platform-tests/resource-timing/rt-nextHopProtocol.worker.js: Added.
New tests specific to just checking the nextHopProtocol property with
a non-cached resource to avoid flakeyness.

Source/WebCore:

This patch replaces the unused `double finishTime` in ResourceLoader's
didFinishLoad with a complete WebCore::NetworkLoadMetrics object. This
allows the NetworkProcess to give complete timing information, and more
final metrics about the load, to WebCore. Currently this is only used
by ResourceTiming, but it will soon be used by Web Inspector as well.
We may also end up extending this to the didFail path as well, since it
is possible that we have some metrics for load failures.

At the same time we want to start moving away from the legacy path that
populated a subset of this information in ResourceResponse's NetworkLoadMetrics.
It doesn't make sense to store this information on the ResourceResponse
for a few reasons: We don't want to store the metrics in our Network Cache and
not all of the load timing metrics have been populated yet (responseEnd).
In an effort to move off of this data we've renamed the accessor to
"deprecatedNetworkLoadMetrics". There are a few remaining clients
(ResourceHandle, PerformanceTiming, InspectorNetworkAgent) which can be
migrated separately from this patch.

Having both the legacy and new code paths adds a little bit of complexity.
One advantage of the new path is that the complete load timing data
(fetchStart -> dns -> connect -> request -> response -> responseEnd) can
be packaged together. The legacy path could not include a responseEnd, so
WebCore faked that value with its own timestamp. Having the fake responseEnd
caused issues as timestamps / clocks are different between processes. In order
for PerformanceResponseTiming to know whether or not the NetworkLoadMetrics
has the complete network timing metrics it checks isComplete(). If true
it knows it can use the responseEnd time from NetworkLoadMetrics, otherwise
it must fallback to the legacy value from LoadTiming. Once all of the
deprecatedNetworkLoadMetrics clients go away, we should always have the
complete data and this can be eliminated.

Tests: imported/w3c/web-platform-tests/resource-timing/rt-nextHopProtocol.html
       imported/w3c/web-platform-tests/resource-timing/rt-nextHopProtocol.worker.html

* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
Rename NetworkLoadTiming -> NetworkLoadMetrics.

* page/PerformanceResourceTiming.cpp:
(WebCore::entryStartTime):
(WebCore::entryEndTime):
(WebCore::PerformanceResourceTiming::PerformanceResourceTiming):
(WebCore::PerformanceResourceTiming::nextHopProtocol):
(WebCore::PerformanceResourceTiming::domainLookupStart):
(WebCore::PerformanceResourceTiming::domainLookupEnd):
(WebCore::PerformanceResourceTiming::connectStart):
(WebCore::PerformanceResourceTiming::connectEnd):
(WebCore::PerformanceResourceTiming::secureConnectionStart):
(WebCore::PerformanceResourceTiming::requestStart):
(WebCore::PerformanceResourceTiming::responseStart):
(WebCore::PerformanceResourceTiming::responseEnd):
(WebCore::PerformanceResourceTiming::networkLoadTimeToDOMHighResTimeStamp):
* page/PerformanceResourceTiming.h:
Mostly just updating names and types. This does however need to get the
correct endTime based on whether the NetworkLoadMetrics are complete
(meaning includes responseEnd) or not (legacy, use LoadTiming value).

* page/PerformanceResourceTiming.idl:
Add nextHopProtocol.

* page/PerformanceTiming.cpp:
(WebCore::PerformanceTiming::domainLookupStart):
(WebCore::PerformanceTiming::domainLookupEnd):
(WebCore::PerformanceTiming::connectStart):
(WebCore::PerformanceTiming::connectEnd):
(WebCore::PerformanceTiming::secureConnectionStart):
(WebCore::PerformanceTiming::requestStart):
(WebCore::PerformanceTiming::responseStart):
(WebCore::PerformanceTiming::resourceLoadTimeRelativeToFetchStart):
* page/PerformanceTiming.h:
Navigation Timing values still uses the NetworkLoadTiming values stored on
the DocumentLoader. This should be moved off of the deprecated path separately.

* platform/network/NetworkLoadMetrics.h: Renamed from Source/WebCore/platform/network/NetworkLoadTiming.h.
(WebCore::NetworkLoadMetrics::NetworkLoadMetrics):
(WebCore::NetworkLoadMetrics::isolatedCopy):
(WebCore::NetworkLoadMetrics::reset):
(WebCore::NetworkLoadMetrics::operator==):
(WebCore::NetworkLoadMetrics::operator!=):
(WebCore::NetworkLoadMetrics::isComplete):
(WebCore::NetworkLoadMetrics::markComplete):
(WebCore::NetworkLoadMetrics::encode):
(WebCore::NetworkLoadMetrics::decode):
Re-introduce a reset() method (for NetworkLoadSoup to reset between redirects).
Add protocolName and "complete" boolean.

* platform/network/cocoa/NetworkLoadMetrics.mm: Renamed from Source/WebCore/platform/network/cocoa/NetworkLoadTiming.mm.
(WebCore::timingValue):
(WebCore::copyTimingData):
(WebCore::setCollectsTimingData):
Use this opportunity to convert NetworkLoadTiming timestamps to WTF::Seconds.
Since we already have to modify all the clients this moves us to use the more
strongly typed units that are less ambiguous then "double". The rest of the
Performance API has already moved to these units.

* inspector/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::buildObjectForTiming):
(WebCore::InspectorNetworkAgent::buildObjectForResourceResponse):
(WebCore::InspectorNetworkAgent::didFinishLoading):
* inspector/InspectorNetworkAgent.h:
Inspector was the only client of the finishTime, and since the value was
erratically coming from clients in different ways it was almost certainly
inaccurate. Simplify this in preparation for using NetworkLoadMetrics.

* Modules/fetch/FetchLoader.cpp:
(WebCore::FetchLoader::didFinishLoading):
* Modules/fetch/FetchLoader.h:
* fileapi/FileReaderLoader.cpp:
(WebCore::FileReaderLoader::didFinishLoading):
* fileapi/FileReaderLoader.h:
* html/MediaFragmentURIParser.cpp:
(WebCore::MediaFragmentURIParser::parseNPTTime):
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didFinishLoadingImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didFinishLoading):
* loader/CrossOriginPreflightChecker.cpp:
(WebCore::CrossOriginPreflightChecker::validatePreflightResponse):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::notifyFinished):
(WebCore::DocumentLoader::finishedLoading):
(WebCore::DocumentLoader::continueAfterContentPolicy):
(WebCore::DocumentLoader::maybeLoadEmpty):
* loader/DocumentLoader.h:
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::didReceiveResponse):
(WebCore::DocumentThreadableLoader::notifyFinished):
(WebCore::DocumentThreadableLoader::didFinishLoading):
(WebCore::DocumentThreadableLoader::loadRequest):
* loader/DocumentThreadableLoader.h:
* loader/NetscapePlugInStreamLoader.cpp:
(WebCore::NetscapePlugInStreamLoader::didFinishLoading):
* loader/NetscapePlugInStreamLoader.h:
* loader/ResourceLoadNotifier.cpp:
(WebCore::ResourceLoadNotifier::didFinishLoad):
(WebCore::ResourceLoadNotifier::dispatchDidFinishLoading):
(WebCore::ResourceLoadNotifier::sendRemainingDelegateMessages):
* loader/ResourceLoadNotifier.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::deliverResponseAndData):
(WebCore::ResourceLoader::loadDataURL):
(WebCore::ResourceLoader::didFinishLoading):
(WebCore::ResourceLoader::didFinishLoadingOnePart):
* loader/ResourceLoader.h:
* loader/ResourceTiming.cpp:
(WebCore::ResourceTiming::fromLoad):
(WebCore::ResourceTiming::fromSynchronousLoad):
(WebCore::ResourceTiming::ResourceTiming):
(WebCore::ResourceTiming::isolatedCopy):
* loader/ResourceTiming.h:
(WebCore::ResourceTiming::networkLoadMetrics):
(WebCore::ResourceTiming::ResourceTiming):
(WebCore::ResourceTiming::networkLoadTiming): Deleted.
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::SubresourceLoader):
(WebCore::SubresourceLoader::willSendRequestInternal):
(WebCore::SubresourceLoader::didReceiveResponse):
(WebCore::SubresourceLoader::didFinishLoading):
(WebCore::SubresourceLoader::reportResourceTiming):
* loader/SubresourceLoader.h:
* loader/ThreadableLoaderClient.h:
(WebCore::ThreadableLoaderClient::didFinishLoading):
* loader/ThreadableLoaderClientWrapper.h:
(WebCore::ThreadableLoaderClientWrapper::didFinishLoading):
* loader/WorkerThreadableLoader.cpp:
(WebCore::WorkerThreadableLoader::MainThreadBridge::didFinishLoading):
* loader/WorkerThreadableLoader.h:
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::didFinishLoading):
* loader/appcache/ApplicationCacheGroup.h:
* loader/cache/CachedResource.h:
(WebCore::CachedResource::setLoadFinishTime):
* loader/ios/QuickLook.mm:
(-[WebPreviewLoader connectionDidFinishLoading:]):
* page/EventSource.cpp:
(WebCore::EventSource::didFinishLoading):
* page/EventSource.h:
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(ResourceHandleStreamingClient::didFinishLoading):
* platform/network/BlobResourceHandle.cpp:
(WebCore::doNotifyFinish):
* platform/network/PingHandle.h:
* platform/network/ResourceHandle.h:
* platform/network/ResourceHandleClient.h:
(WebCore::ResourceHandleClient::didFinishLoading):
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::crossThreadData):
(WebCore::ResourceResponseBase::fromCrossThreadData):
(WebCore::ResourceResponseBase::compare):
* platform/network/ResourceResponseBase.h:
(WebCore::ResourceResponseBase::deprecatedNetworkLoadMetrics):
(WebCore::ResourceResponseBase::encode):
(WebCore::ResourceResponseBase::decode):
(WebCore::ResourceResponseBase::networkLoadTiming): Deleted.
* platform/network/SynchronousLoaderClient.cpp:
(WebCore::SynchronousLoaderClient::didFinishLoading):
* platform/network/SynchronousLoaderClient.h:
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFinishLoading):
* platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didFinishLoading):
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::WebCoreSynchronousLoader::didFinishLoading):
* platform/network/curl/ResourceHandleManager.cpp:
(WebCore::calculateWebTimingInformations):
(WebCore::ResourceHandleManager::downloadTimerCallback):
(WebCore::handleDataURL):
(WebCore::milisecondsSinceRequest): Deleted.
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::getConnectionTimingData):
* platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
(-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]):
(-[WebCoreResourceHandleAsDelegate connectionDidFinishLoading:]):
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connectionDidFinishLoading:]):
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::restartedCallback):
(WebCore::nextMultipartResponsePartCallback):
(WebCore::sendRequestCallback):
(WebCore::ResourceHandle::didStartRequest):
(WebCore::networkEventCallback):
(WebCore::ResourceHandle::sendPendingRequest):
(WebCore::readCallback):
(WebCore::milisecondsSinceRequest): Deleted.
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::didFinishLoading):
* workers/WorkerScriptLoader.h:
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::didFinishLoading):
* xml/XMLHttpRequest.h:
Eliminate the unused finishTime double.

Source/WebKit2:

Change from an unused `double finishTime` to a complete WebCore::NetworkLoadMetrics
object in the didFinishLoad ResourceLoader path. We may also extend this in the
didFail path later on. This allows the NetworkProcess to give complete timing
information, and more final metrics about the load, to WebCore.

* NetworkProcess/NetworkDataTask.h:
(WebKit::NetworkDataTaskClient::didCompleteWithError):
Give the NetworkDataTaskClient a basic didCompleteWithError for a completion
without metrics. For loads that complete with an error, or haven't populated
any metrics, this will pass empty metrics onward.

* NetworkProcess/Downloads/BlobDownloadClient.cpp:
(WebKit::BlobDownloadClient::didFinishLoading):
* NetworkProcess/Downloads/BlobDownloadClient.h:
* NetworkProcess/Downloads/PendingDownload.h:
* NetworkProcess/PingLoad.h:
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
(WebKit::NetworkCache::SpeculativeLoad::didFinishLoading):
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
* NetworkProcess/NetworkDataTaskBlob.cpp:
(WebKit::NetworkDataTaskBlob::didFail):
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::continueWillSendRequest):
(WebKit::NetworkLoad::didCompleteWithError):
(WebKit::NetworkLoad::didFinishLoading):
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/NetworkLoadClient.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::didFinishLoading):
(WebKit::NetworkResourceLoader::sendResultForCacheEntry):
* NetworkProcess/NetworkResourceLoader.h:
* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::didFinishResourceLoad):
(WebKit::WebResourceLoader::didReceiveResource):
* WebProcess/Network/WebResourceLoader.h:
* WebProcess/Network/WebResourceLoader.messages.in:
Change didFinishLoad paths to take a NetworkLoadMetrics object instead of finishTime.
Change didCompleteWithError pathes to include a NetworkLoadMetrics object instead of finishTime.

* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::didCompleteWithError):
Own a NetworkLoadTiming that will be populated with the load.

* NetworkProcess/cocoa/NetworkSessionCocoa.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
(-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
(-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
Populate NetworkLoadMetrics in the didFinishCollectingMetrics NSURLSessionTaskDelegate method.

* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
(WebKit::NetworkDataTaskSoup::timeoutFired):
(WebKit::NetworkDataTaskSoup::didSendRequest):
(WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse):
(WebKit::NetworkDataTaskSoup::dispatchDidCompleteWithError):
(WebKit::NetworkDataTaskSoup::tlsErrorsChanged):
(WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
(WebKit::NetworkDataTaskSoup::didFinishRead):
(WebKit::NetworkDataTaskSoup::didFinishRequestNextPart):
(WebKit::NetworkDataTaskSoup::didFailDownload):
(WebKit::NetworkDataTaskSoup::didFail):
(WebKit::NetworkDataTaskSoup::networkEvent):
(WebKit::NetworkDataTaskSoup::didStartRequest):
(WebKit::NetworkDataTaskSoup::didRestart):
* NetworkProcess/soup/NetworkDataTaskSoup.h:
Instead of populating the NetworkLoadMetrics on the ResourceResponse, populate
a member variable during the entire load and dispatch didFinishCollectingMetrics
right before didCompleteLoadWithError.

Source/WTF:

* wtf/persistence/Coders.h:
(WTF::Persistence::Coder<Seconds>::encode):
(WTF::Persistence::Coder<Seconds>::decode):

LayoutTests:

* TestExpectations:
Now that nextHopProtocol is available on Mac mark the test as flakey
because the value can be set or not depending on whether or not the
resource was loaded from a cache.

* platform/ios-simulator/TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:
* platform/win/TestExpectations:
Mark nextHopProtocol tests as expected to fail on ports that do not
yet support those values. Mark redirect tests as failing on ports
that encounter the CFNetwork issue causing unexpected callbacks.

* performance-api/resource-timing-apis-expected.txt:
* performance-api/resources/resource-timing-api.js:
Progressions.

* platform/mac-elcapitan/imported/w3c/web-platform-tests/resource-timing/test_resource_timing-expected.txt: Added.
* platform/mac/imported/w3c/web-platform-tests/resource-timing/test_resource_timing-expected.txt: Added.
Expected passing values on mac, except el capitan where this new resource timing data is unavailable.

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

4 years agoRubber-stamped by Chris Dumez.
keith_miller@apple.com [Sat, 25 Feb 2017 04:54:36 +0000 (04:54 +0000)]
Rubber-stamped by Chris Dumez.

Replace typename Bool with typename BoolType because X11 has
#define Bool int for some unknown reason...

* wtf/HashFunctions.h:
(WTF::TupleHash::allTrue):
* wtf/HashTraits.h:
(WTF::TupleHashTraits::allTrue):

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

4 years agoUnreviewed GTK build fix after r212965
cdumez@apple.com [Sat, 25 Feb 2017 04:27:09 +0000 (04:27 +0000)]
Unreviewed GTK build fix after r212965

* CMakeLists.txt:

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

4 years agoUnreviewed, temporarily disable all data interaction tests.
wenson_hsieh@apple.com [Sat, 25 Feb 2017 04:05:05 +0000 (04:05 +0000)]
Unreviewed, temporarily disable all data interaction tests.

They will be reenabled once the bots are ready to build and run them.

* TestWebKitAPI/Tests/ios/DataInteractionTests.mm:
* TestWebKitAPI/ios/DataInteractionSimulator.h:
* TestWebKitAPI/ios/DataInteractionSimulator.mm:

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

4 years agoUnreviewed, rolling out r212944.
cdumez@apple.com [Sat, 25 Feb 2017 03:34:33 +0000 (03:34 +0000)]
Unreviewed, rolling out r212944.

Caused a lot of failures on the debug bots

Reverted changeset:

"[Resource Timing] Gather timing information with reliable
responseEnd time"
https://bugs.webkit.org/show_bug.cgi?id=168351
http://trac.webkit.org/changeset/212944

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

4 years agoUnreviewed, fix the internal build.
wenson_hsieh@apple.com [Sat, 25 Feb 2017 03:24:59 +0000 (03:24 +0000)]
Unreviewed, fix the internal build.

* TestWebKitAPI/ios/DataInteractionSimulator.mm:
(-[DataInteractionSimulator _advanceProgress]):

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

4 years agoUnreviewed, follow-up fix after r212972.
cdumez@apple.com [Sat, 25 Feb 2017 03:23:10 +0000 (03:23 +0000)]
Unreviewed, follow-up fix after r212972.

Fixes a few assertions on the debug build bots.
URL needs to be exactly the same as the parsed one given
that we are calling the ParsedURLString constructor.

* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::sanitizeSuggestedFilename):

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

4 years agoSimple line layout: Re-adjust paginated lines when block height changes.
zalan@apple.com [Sat, 25 Feb 2017 02:14:40 +0000 (02:14 +0000)]
Simple line layout: Re-adjust paginated lines when block height changes.
https://bugs.webkit.org/show_bug.cgi?id=168838
<rdar://problem/30701233>

Reviewed by Antti Koivisto.

When the estimated block height is wrong, we issue an additional layout on the inline children
so that we get the pagination right (this layout is setChildNeedsLayout(MarkOnlyThis) only).
Since the height change only affects the struts and page breaks (and again, the relayoutChildren flag is false)
we don't need to re-layout the content, but instead we just need to re-adjust the pagination for the simple lines.
This patch also moves the pagination logic to SimpleLineLayoutPagination.cpp.

Not enabled yet.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutSimpleLines):
* rendering/RenderingAllInOne.cpp:
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForWithReason):
(WebCore::SimpleLineLayout::create):
(WebCore::SimpleLineLayout::Layout::create):
(WebCore::SimpleLineLayout::Layout::Layout):
(WebCore::SimpleLineLayout::computeLineTopAndBottomWithOverflow): Deleted.
(WebCore::SimpleLineLayout::computeLineBreakIndex): Deleted.
(WebCore::SimpleLineLayout::computeOffsetAfterLineBreak): Deleted.
(WebCore::SimpleLineLayout::setPageBreakForLine): Deleted.
(WebCore::SimpleLineLayout::updateMinimumPageHeight): Deleted.
(WebCore::SimpleLineLayout::adjustLinePositionsForPagination): Deleted.
* rendering/SimpleLineLayout.h:
(WebCore::SimpleLineLayout::Layout::setIsPaginated):
(WebCore::SimpleLineLayout::Layout::setLineStruts):
* rendering/SimpleLineLayoutPagination.cpp: Added.
(WebCore::SimpleLineLayout::computeLineTopAndBottomWithOverflow):
(WebCore::SimpleLineLayout::computeLineBreakIndex):
(WebCore::SimpleLineLayout::computeOffsetAfterLineBreak):
(WebCore::SimpleLineLayout::setPageBreakForLine):
(WebCore::SimpleLineLayout::updateMinimumPageHeight):
(WebCore::SimpleLineLayout::adjustLinePositionsForPagination):
* rendering/SimpleLineLayoutPagination.h: Added.

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

4 years agoAlias "system-ui" for the System font name
jonlee@apple.com [Sat, 25 Feb 2017 02:07:12 +0000 (02:07 +0000)]
Alias "system-ui" for the System font name
https://bugs.webkit.org/show_bug.cgi?id=151493

Reviewed by Tim Horton and Joseph Pecoraro.

Source/WebCore:

Updated existing tests.

* WebCore.xcodeproj/project.pbxproj: Add WebKitFontFamilyNames.in for
convenience.
* css/CSSValueKeywords.in: Add system-ui as a keyword.
* css/WebKitFontFamilyNames.in: Add system-ui.

* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::platformFontWithFamilySpecialCase): Include "system-ui" as an
alias.
* platform/graphics/mac/FontCacheMac.mm:
(WebCore::platformFontWithFamilySpecialCase): Ditto.

* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::updateCachedSystemFontDescription): Update
serialization to "system-ui" from "-apple-system".

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::identifierForFamily):
* css/CSSFontFaceSet.cpp:
(WebCore::CSSFontFaceSet::familyNameFromPrimitive):
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueFontFamily):

Source/WebInspectorUI:

* UserInterface/Models/CSSKeywordCompletions.js: Ditto.

LayoutTests:

Add "system-ui" to the test.
* fast/css/font-family-builtins.html:
* fast/css/font-family-builtins-expected.txt:
* fast/text/system-font-features.html:
* fast/text/system-font-features-expected.html:
* fast/text/system-font-legacy-name.html:
* fast/text/system-font-legacy-name-expected.txt:
* platform/ios-simulator/ios/fast/text/opticalFont.html:
* platform/ios-simulator/ios/fast/text/opticalFont-expected.txt:
* platform/ios-simulator/ios/fast/text/opticalFontWithTextStyle-expected.txt:

Unskip opticalFont* tests.
* platform/ios-simulator/TestExpectations:

Update tests to use "system-ui" instead of "-apple-system" or the even
older "-apple-system-font".
* fast/css/multiple-tabs-expected.html:
* fast/css/multiple-tabs.html:
* fast/text/international/system-language/han-quotes-expected-mismatch.html:
* fast/text/international/system-language/han-quotes.html:
* fast/text/international/system-language/hindi-system-font-punctuation-expected.html:
* fast/text/international/system-language/hindi-system-font-punctuation.html:
* fast/text/letterpress-different-expected-mismatch.html:
* fast/text/letterpress-different.html:
* fast/text/letterpress-paint.html:
* fast/text/system-font-weight-italic.html:
* fast/text/system-font-weight.html:
* fast/text/text-node-remains-dirty-after-calling-surroundContents-expected.html:
* fast/text/text-node-remains-dirty-after-calling-surroundContents.html:
* fast/text/trak-optimizeLegibility.html:
* fast/text/weighted-italicized-system-font-expected.html:
* fast/text/weighted-italicized-system-font.html:
* platform/ios-simulator/ios/fast/text/apple-logo.html:
* platform/ios-simulator/ios/fast/text/opticalFontWithWeight-expected.txt:
* platform/ios-simulator/ios/fast/text/opticalFontWithWeight.html:
* platform/ios-simulator/ios/fast/text/underline-scaling.html:
* platform/mac/fast/css/css2-system-fonts-expected.txt:

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

4 years agoUnreviewed, fix the internal build
wenson_hsieh@apple.com [Sat, 25 Feb 2017 02:07:05 +0000 (02:07 +0000)]
Unreviewed, fix the internal build

* UIProcess/ios/WKContentViewInteraction.h:

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

4 years agoWebAssembly: miscellaneous spec fixes
jfbastien@apple.com [Sat, 25 Feb 2017 02:02:06 +0000 (02:02 +0000)]
WebAssembly: miscellaneous spec fixes
https://bugs.webkit.org/show_bug.cgi?id=168822

Reviewed by Saam Barati.

JSTests:

* wasm.yaml: mark some skip tests as normal, now that they pass
* wasm/Builder.js: error message was wrong, causing extra error if hit
* wasm/js-api/global-error.js: new tests
(assert.throws):
* wasm/spec-tests/call.wast.js: comment out stack check tests
* wasm/spec-tests/call_indirect.wast.js: comment out stack check tests
* wasm/spec-tests/fac.wast.js: comment out stack check tests
* wasm/spec-tests/float_exprs.wast.js: wabt is wrong, bug reported, we should update
* wasm/spec-tests/imports.wast.js: bug in old wabt, fixed in recent wabt
(assert_unlinkable):

Source/JavaScriptCore:

* wasm/WasmModuleParser.cpp: "unknown" sections are now called "custom" sections
* wasm/WasmSections.h:
(JSC::Wasm::validateOrder):
(JSC::Wasm::makeString): fix ASSERT_UNREACHABLE bug in printing
* wasm/js/WebAssemblyInstanceConstructor.cpp:
(JSC::constructJSWebAssemblyInstance): disallow i64 import
* wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::WebAssemblyModuleRecord::link): disallow i64 export
(JSC::WebAssemblyModuleRecord::evaluate):

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

4 years agoMedia: notify clients when autoplay is denied
mrajca@apple.com [Sat, 25 Feb 2017 01:17:15 +0000 (01:17 +0000)]
Media: notify clients when autoplay is denied
https://bugs.webkit.org/show_bug.cgi?id=168840

Reviewed by Alex Christensen.

Source/WebCore:

Added API tests.

* WebCore.xcodeproj/project.pbxproj:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setReadyState):
(WebCore::HTMLMediaElement::play):
(WebCore::HTMLMediaElement::playInternal):
* page/AutoplayEvent.h: Added.
* page/ChromeClient.h:

Source/WebKit2:

* UIProcess/API/APIUIClient.h:
(API::UIClient::handleAutoplayEvent):
(API::UIClient::didPlayMediaPreventedFromPlayingWithoutUserGesture): Deleted.
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageUIClient):
* UIProcess/API/C/WKPageUIClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::handleAutoplayEvent):
(WebKit::WebPageProxy::didPlayMediaPreventedFromPlayingWithoutUserGesture): Deleted.
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::handleAutoplayEvent):
(WebKit::WebChromeClient::didPlayMediaPreventedFromPlayingWithoutUserGesture): Deleted.
* WebProcess/WebCoreSupport/WebChromeClient.h:

Tools:

* TestWebKitAPI/Tests/WebKit2Cocoa/WebsitePolicies.mm:
(handleAutoplayEvent):
(runUntilReceivesAutoplayEvent):
(TEST): Added.

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

4 years agocurl: Improve errors by including the domain
commit-queue@webkit.org [Sat, 25 Feb 2017 01:08:30 +0000 (01:08 +0000)]
curl: Improve errors by including the domain
https://bugs.webkit.org/show_bug.cgi?id=134340

Patch by Basuke Suzuki <Basuke.Suzuki@am.sony.com> on 2017-02-24
Reviewed by Alex Christensen.

Added proper error domain to ResourceError created by
Curl problem.

* platform/network/curl/ResourceHandleManager.cpp:
(WebCore::ResourceHandleManager::downloadTimerCallback):
(WebCore::ResourceHandleManager::dispatchSynchronousJob):

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

4 years ago[Modern Media Controls] <audio> controls should center in their container when the...
commit-queue@webkit.org [Sat, 25 Feb 2017 01:03:30 +0000 (01:03 +0000)]
[Modern Media Controls] <audio> controls should center in their container when the page is scaled
https://bugs.webkit.org/show_bug.cgi?id=168841
<rdar://problem/28612794>

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

Source/WebCore:

When dealing with <audio> elements, we vertically center the controls relative to their containing
media element such that if the controls visually overflow, they overflow equally above and below
to minimize the likelihood of overlap with surrounding elements.

Test: media/modern-media-controls/media-controller/media-controller-scale-factor-audio.html

* Modules/modern-media-controls/controls/media-controls.js:
(MediaControls.prototype.get shouldCenterControlsVertically):
(MediaControls.prototype.set shouldCenterControlsVertically):
(MediaControls.prototype.commitProperty):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype.get isAudio):
(MediaController.prototype.get layoutTraits):
(MediaController.prototype._updateControlsSize):

LayoutTests:

Adding test coverage for the "top" property set on the media controls to achieve vertical centering,
and creating a new test that checks the behavior for an <audio> element on iOS.

* TestExpectations:
* media/modern-media-controls/media-controller/media-controller-scale-factor-audio-expected.txt: Added.
* media/modern-media-controls/media-controller/media-controller-scale-factor-audio.html: Added.
* media/modern-media-controls/media-controller/media-controller-scale-factor-expected.txt:
* media/modern-media-controls/media-controller/media-controller-scale-factor.html:
* platform/ios-simulator/TestExpectations:

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

4 years agoNon-special relative URLs should not ignore extra slashes
achristensen@apple.com [Sat, 25 Feb 2017 00:36:19 +0000 (00:36 +0000)]
Non-special relative URLs should not ignore extra slashes
https://bugs.webkit.org/show_bug.cgi?id=168834

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

* web-platform-tests/url/a-element-expected.txt:
* web-platform-tests/url/a-element-xhtml-expected.txt:
* web-platform-tests/url/url-constructor-expected.txt:

Source/WebCore:

Special authority ignore slashes state should, as its name implies,
only be reached by special URLs.  See https://url.spec.whatwg.org/#relative-slash-state

Covered by newly passing web platform tests.

* platform/URLParser.cpp:
(WebCore::URLParser::parse):

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

4 years agoBuild fix for newer clang
ap@apple.com [Sat, 25 Feb 2017 00:20:12 +0000 (00:20 +0000)]
Build fix for newer clang
https://bugs.webkit.org/show_bug.cgi?id=168849
rdar://problem/30638741

Reviewed by Ryosuke Niwa.

* dom/Range.cpp: (WebCore::Range::toString): std::max(0, <unsigned>) is not meaningful,
and now triggers a warning.

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

4 years agoAPI test WebKit2.WebsitePoliciesPlayAfterPreventedAutoplay is timing out
mrajca@apple.com [Sat, 25 Feb 2017 00:17:36 +0000 (00:17 +0000)]
API test WebKit2.WebsitePoliciesPlayAfterPreventedAutoplay is timing out
https://bugs.webkit.org/show_bug.cgi?id=167466

Reviewed by Alex Christensen.

* TestWebKitAPI/Tests/WebKit2Cocoa/WebsitePolicies.mm:
(TEST): Use the correct API version.

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

4 years agoRefactor data interaction to use new WKDataInteraction SPI
wenson_hsieh@apple.com [Sat, 25 Feb 2017 00:05:45 +0000 (00:05 +0000)]
Refactor data interaction to use new WKDataInteraction SPI
https://bugs.webkit.org/show_bug.cgi?id=168602
Work towards <rdar://problem/30313681>

Reviewed by Tim Horton.

Source/WebKit2:

Adjust testing SPI to match new data interaction interfaces.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _simulateDataInteractionEntered:]):
(-[WKWebView _simulateDataInteractionUpdated:]):
(-[WKWebView _simulateDataInteractionPerformOperation:]):
(-[WKWebView _simulateDataInteractionEnded:]):
(-[WKWebView _simulateDataInteractionSessionDidEnd:]):
(-[WKWebView _simulateWillBeginDataInteractionWithSession:]):
(-[WKWebView _simulatedItemsForSession:]):
(-[WKWebView _simulatePrepareForDataInteractionSession:completion:]):
(-[WKWebView _simulateDataInteractionSessionDidEnd:withOperation:]): Deleted.
(-[WKWebView _simulateFailedDataInteractionWithIndex:]): Deleted.
(-[WKWebView _simulateWillBeginDataInteractionWithIndex:withSession:]): Deleted.
(-[WKWebView _simulatedItemsForDataInteractionWithIndex:]): Deleted.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _positionInformationDidChange:]):
* UIProcess/ios/WKScrollView.h:
* UIProcess/ios/WKScrollView.mm:

Tools:

Update DataInteractionSimulator to simulate data interaction using updated SPI. See changes in WebKit2 for more details.

* TestWebKitAPI/Tests/ios/DataInteractionTests.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/ios/DataInteractionSimulator.h:
* TestWebKitAPI/ios/DataInteractionSimulator.mm:
(-[DataInteractionSimulator _resetSimulatedState]):
(-[DataInteractionSimulator runFrom:to:]):
(-[DataInteractionSimulator _advanceProgress]):
(-[DataInteractionSimulator _currentLocation]):
(-[DataInteractionSimulator _finishDataInteraction]): Deleted.
(-[DataInteractionSimulator webViewDidSendDataInteractionStartRequest:]): Deleted.
(-[DataInteractionSimulator webView:didReceiveDataInteractionStartResponse:]): Deleted.

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

4 years agoRemove the data interaction gesture recognizer
wenson_hsieh@apple.com [Sat, 25 Feb 2017 00:05:39 +0000 (00:05 +0000)]
Remove the data interaction gesture recognizer
https://bugs.webkit.org/show_bug.cgi?id=168600
<rdar://problem/30313681>

Reviewed by Anders Carlsson.

Source/WebKit2:

The data interaction gesture recognizer will no longer be needed moving forward.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _simulateDataInteractionGestureRecognized]): Deleted.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView cleanupInteraction]):
(-[WKContentView _removeDefaultGestureRecognizers]):
(-[WKContentView _addDefaultGestureRecognizers]):
(-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
(-[WKContentView gestureRecognizerShouldBegin:]):
(-[WKContentView _dataInteractionGestureRecognizer]): Deleted.

Tools:

Adjust TestWebKitAPI for changes in WebKit2.

* TestWebKitAPI/ios/DataInteractionSimulator.h:
* TestWebKitAPI/ios/DataInteractionSimulator.mm:
(-[DataInteractionSimulator initWithWebView:]):
(-[DataInteractionSimulator runFrom:to:]):
(-[DataInteractionSimulator _advanceProgress]):
(-[DataInteractionSimulator _finishDataInteraction]):
(-[MockLongPressGestureRecognizer initWithWindow:]): Deleted.
(-[MockLongPressGestureRecognizer locationInView:]): Deleted.
(-[MockLongPressGestureRecognizer state]): Deleted.
(-[MockLongPressGestureRecognizer numberOfTouches]): Deleted.
(-[DataInteractionSimulator _recognizeGestureAtLocation:withState:]): Deleted.
(-[DataInteractionSimulator dataInteractionGestureRecognizer]): Deleted.
(-[DataInteractionSimulator webView:beginDataInteractionWithSourceIndex:gestureRecognizer:]): Deleted.

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

4 years agoDownload attribute should be sanitized before being used as suggested filename
cdumez@apple.com [Sat, 25 Feb 2017 00:02:24 +0000 (00:02 +0000)]
Download attribute should be sanitized before being used as suggested filename
https://bugs.webkit.org/show_bug.cgi?id=168839
<rdar://problem/30683109>

Reviewed by Darin Adler.

Source/WebCore:

Sanitize Download attribute before using it as a suggested filename for the download.
We rely on ResourceResponse's sanitizing of the suggested filename to do so, which has
the benefit of being consistent with downloads without the download attribute.

Tests: fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-doublequote.html
       fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-slashes.html
       fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-unicode.html

* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::handleClick):
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::sanitizeSuggestedFilename):
* platform/network/ResourceResponseBase.h:

LayoutTests:

Add layout test coverage.

* fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-doublequote-expected.txt: Added.
* fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-doublequote.html: Added.
* fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-slashes-expected.txt: Added.
* fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-slashes.html: Added.
* fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-unicode-expected.txt: Added.
* fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-unicode.html: Added.
* platform/ios-simulator-wk1/TestExpectations:
* platform/ios-simulator-wk2/TestExpectations:
* platform/mac-wk1/TestExpectations:
* platform/win/TestExpectations:

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

4 years agoRemove unneeded protobuf tests directory.
achristensen@apple.com [Fri, 24 Feb 2017 23:16:10 +0000 (23:16 +0000)]
Remove unneeded protobuf tests directory.

Rubber-stamped by Joe Pecoraro.

This directory contained a swift file that was causing problems in an internal verification step.

* Source/third_party/protobuf/objectivec/Tests: Removed.
(And everything in this subdirectory)

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

4 years agoMove Arg::Type and Arg::Width out into the B3 namespace, since they are general concepts
fpizlo@apple.com [Fri, 24 Feb 2017 22:50:00 +0000 (22:50 +0000)]
Move Arg::Type and Arg::Width out into the B3 namespace, since they are general concepts
https://bugs.webkit.org/show_bug.cgi?id=168833

Reviewed by Saam Barati.

I want to use the Air::Arg::Type and Air::Arg::Width concepts in B3. We are already
doing this a bit, and it's akward because of the namespacing. Throughout B3 we take the
approach that if something is not specific to Air, then it should be in the B3
namespace.

This moves Air::Arg::Type to B3::Bank. This moves Air::Arg::Width to B3::Width.

I renamed Arg::Type to Bank because there is already a B3::Type and because Arg::Type
was never really a type. Its purpose was always to identify register banks, and we use
this enum when the thing we care about is whether the value is most appropriate for
GPRs or FPRs.

I kept both as non-enum classes because I think that we've learned that terse compiler
code is a good thing. I don't want to say Bank::GP when I can say GP. With Width, the
argument is even stronger, since you cannot say Width::8 but you can say Width8.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* b3/B3Bank.cpp: Added.
(WTF::printInternal):
* b3/B3Bank.h: Added.
(JSC::B3::forEachBank):
(JSC::B3::bankForType):
* b3/B3CheckSpecial.cpp:
(JSC::B3::CheckSpecial::forEachArg):
* b3/B3LegalizeMemoryOffsets.cpp:
* b3/B3LowerToAir.cpp:
(JSC::B3::Air::LowerToAir::run):
(JSC::B3::Air::LowerToAir::tmp):
(JSC::B3::Air::LowerToAir::scaleForShl):
(JSC::B3::Air::LowerToAir::effectiveAddr):
(JSC::B3::Air::LowerToAir::addr):
(JSC::B3::Air::LowerToAir::createGenericCompare):
(JSC::B3::Air::LowerToAir::createBranch):
(JSC::B3::Air::LowerToAir::createCompare):
(JSC::B3::Air::LowerToAir::createSelect):
(JSC::B3::Air::LowerToAir::lower):
* b3/B3MemoryValue.cpp:
(JSC::B3::MemoryValue::accessWidth):
* b3/B3MemoryValue.h:
* b3/B3MoveConstants.cpp:
* b3/B3PatchpointSpecial.cpp:
(JSC::B3::PatchpointSpecial::forEachArg):
* b3/B3StackmapSpecial.cpp:
(JSC::B3::StackmapSpecial::forEachArgImpl):
* b3/B3Value.h:
* b3/B3Variable.h:
(JSC::B3::Variable::width):
(JSC::B3::Variable::bank):
* b3/B3WasmAddressValue.h:
* b3/B3Width.cpp: Added.
(WTF::printInternal):
* b3/B3Width.h: Added.
(JSC::B3::pointerWidth):
(JSC::B3::widthForType):
(JSC::B3::conservativeWidth):
(JSC::B3::minimumWidth):
(JSC::B3::bytes):
(JSC::B3::widthForBytes):
* b3/air/AirAllocateRegistersByGraphColoring.cpp:
* b3/air/AirAllocateStack.cpp:
(JSC::B3::Air::allocateStack):
* b3/air/AirArg.cpp:
(JSC::B3::Air::Arg::canRepresent):
(JSC::B3::Air::Arg::isCompatibleBank):
(JSC::B3::Air::Arg::isCompatibleType): Deleted.
* b3/air/AirArg.h:
(JSC::B3::Air::Arg::hasBank):
(JSC::B3::Air::Arg::bank):
(JSC::B3::Air::Arg::isBank):
(JSC::B3::Air::Arg::forEachTmp):
(JSC::B3::Air::Arg::forEachType): Deleted.
(JSC::B3::Air::Arg::pointerWidth): Deleted.
(JSC::B3::Air::Arg::typeForB3Type): Deleted.
(JSC::B3::Air::Arg::widthForB3Type): Deleted.
(JSC::B3::Air::Arg::conservativeWidth): Deleted.
(JSC::B3::Air::Arg::minimumWidth): Deleted.
(JSC::B3::Air::Arg::bytes): Deleted.
(JSC::B3::Air::Arg::widthForBytes): Deleted.
(JSC::B3::Air::Arg::hasType): Deleted.
(JSC::B3::Air::Arg::type): Deleted.
(JSC::B3::Air::Arg::isType): Deleted.
* b3/air/AirArgInlines.h:
(JSC::B3::Air::ArgThingHelper<Tmp>::forEach):
(JSC::B3::Air::ArgThingHelper<Arg>::forEach):
(JSC::B3::Air::ArgThingHelper<Reg>::forEach):
(JSC::B3::Air::Arg::forEach):
* b3/air/AirCCallSpecial.cpp:
(JSC::B3::Air::CCallSpecial::forEachArg):
* b3/air/AirCCallingConvention.cpp:
* b3/air/AirCode.cpp:
(JSC::B3::Air::Code::Code):
(JSC::B3::Air::Code::setRegsInPriorityOrder):
(JSC::B3::Air::Code::pinRegister):
* b3/air/AirCode.h:
(JSC::B3::Air::Code::regsInPriorityOrder):
(JSC::B3::Air::Code::newTmp):
(JSC::B3::Air::Code::numTmps):
(JSC::B3::Air::Code::regsInPriorityOrderImpl):
* b3/air/AirCustom.cpp:
(JSC::B3::Air::PatchCustom::isValidForm):
(JSC::B3::Air::ShuffleCustom::isValidForm):
* b3/air/AirCustom.h:
(JSC::B3::Air::PatchCustom::forEachArg):
(JSC::B3::Air::CCallCustom::forEachArg):
(JSC::B3::Air::ColdCCallCustom::forEachArg):
(JSC::B3::Air::ShuffleCustom::forEachArg):
(JSC::B3::Air::WasmBoundsCheckCustom::forEachArg):
* b3/air/AirDumpAsJS.cpp:
(JSC::B3::Air::dumpAsJS):
* b3/air/AirEliminateDeadCode.cpp:
(JSC::B3::Air::eliminateDeadCode):
* b3/air/AirEmitShuffle.cpp:
(JSC::B3::Air::emitShuffle):
* b3/air/AirEmitShuffle.h:
(JSC::B3::Air::ShufflePair::ShufflePair):
(JSC::B3::Air::ShufflePair::width):
* b3/air/AirFixObviousSpills.cpp:
* b3/air/AirFixPartialRegisterStalls.cpp:
(JSC::B3::Air::fixPartialRegisterStalls):
* b3/air/AirInst.cpp:
(JSC::B3::Air::Inst::hasArgEffects):
* b3/air/AirInst.h:
(JSC::B3::Air::Inst::forEachTmp):
* b3/air/AirInstInlines.h:
(JSC::B3::Air::Inst::forEach):
(JSC::B3::Air::Inst::forEachDef):
(JSC::B3::Air::Inst::forEachDefWithExtraClobberedRegs):
* b3/air/AirLiveness.h:
(JSC::B3::Air::TmpLivenessAdapter::numIndices):
(JSC::B3::Air::TmpLivenessAdapter::acceptsBank):
(JSC::B3::Air::TmpLivenessAdapter::valueToIndex):
(JSC::B3::Air::TmpLivenessAdapter::indexToValue):
(JSC::B3::Air::StackSlotLivenessAdapter::acceptsBank):
(JSC::B3::Air::RegLivenessAdapter::acceptsBank):
(JSC::B3::Air::AbstractLiveness::AbstractLiveness):
(JSC::B3::Air::AbstractLiveness::LocalCalc::execute):
(JSC::B3::Air::TmpLivenessAdapter::acceptsType): Deleted.
(JSC::B3::Air::StackSlotLivenessAdapter::acceptsType): Deleted.
(JSC::B3::Air::RegLivenessAdapter::acceptsType): Deleted.
* b3/air/AirLogRegisterPressure.cpp:
(JSC::B3::Air::logRegisterPressure):
* b3/air/AirLowerAfterRegAlloc.cpp:
(JSC::B3::Air::lowerAfterRegAlloc):
* b3/air/AirLowerMacros.cpp:
(JSC::B3::Air::lowerMacros):
* b3/air/AirPadInterference.cpp:
(JSC::B3::Air::padInterference):
* b3/air/AirReportUsedRegisters.cpp:
(JSC::B3::Air::reportUsedRegisters):
* b3/air/AirSpillEverything.cpp:
(JSC::B3::Air::spillEverything):
* b3/air/AirTmpInlines.h:
(JSC::B3::Air::AbsoluteTmpMapper<Arg::GP>::absoluteIndex): Deleted.
(JSC::B3::Air::AbsoluteTmpMapper<Arg::GP>::lastMachineRegisterIndex): Deleted.
(JSC::B3::Air::AbsoluteTmpMapper<Arg::GP>::tmpFromAbsoluteIndex): Deleted.
(JSC::B3::Air::AbsoluteTmpMapper<Arg::FP>::absoluteIndex): Deleted.
(JSC::B3::Air::AbsoluteTmpMapper<Arg::FP>::lastMachineRegisterIndex): Deleted.
(JSC::B3::Air::AbsoluteTmpMapper<Arg::FP>::tmpFromAbsoluteIndex): Deleted.
* b3/air/AirTmpWidth.cpp:
(JSC::B3::Air::TmpWidth::recompute):
* b3/air/AirTmpWidth.h:
(JSC::B3::Air::TmpWidth::width):
(JSC::B3::Air::TmpWidth::requiredWidth):
(JSC::B3::Air::TmpWidth::defWidth):
(JSC::B3::Air::TmpWidth::useWidth):
(JSC::B3::Air::TmpWidth::Widths::Widths):
* b3/air/AirUseCounts.h:
(JSC::B3::Air::UseCounts::UseCounts):
* b3/air/AirValidate.cpp:
* b3/air/opcode_generator.rb:
* b3/air/testair.cpp:
(JSC::B3::Air::compile): Deleted.
(JSC::B3::Air::invoke): Deleted.
(JSC::B3::Air::compileAndRun): Deleted.
(JSC::B3::Air::testSimple): Deleted.
(JSC::B3::Air::loadConstantImpl): Deleted.
(JSC::B3::Air::loadConstant): Deleted.
(JSC::B3::Air::loadDoubleConstant): Deleted.
(JSC::B3::Air::testShuffleSimpleSwap): Deleted.
(JSC::B3::Air::testShuffleSimpleShift): Deleted.
(JSC::B3::Air::testShuffleLongShift): Deleted.
(JSC::B3::Air::testShuffleLongShiftBackwards): Deleted.
(JSC::B3::Air::testShuffleSimpleRotate): Deleted.
(JSC::B3::Air::testShuffleSimpleBroadcast): Deleted.
(JSC::B3::Air::testShuffleBroadcastAllRegs): Deleted.
(JSC::B3::Air::testShuffleTreeShift): Deleted.
(JSC::B3::Air::testShuffleTreeShiftBackward): Deleted.
(JSC::B3::Air::testShuffleTreeShiftOtherBackward): Deleted.
(JSC::B3::Air::testShuffleMultipleShifts): Deleted.
(JSC::B3::Air::testShuffleRotateWithFringe): Deleted.
(JSC::B3::Air::testShuffleRotateWithFringeInWeirdOrder): Deleted.
(JSC::B3::Air::testShuffleRotateWithLongFringe): Deleted.
(JSC::B3::Air::testShuffleMultipleRotates): Deleted.
(JSC::B3::Air::testShuffleShiftAndRotate): Deleted.
(JSC::B3::Air::testShuffleShiftAllRegs): Deleted.
(JSC::B3::Air::testShuffleRotateAllRegs): Deleted.
(JSC::B3::Air::testShuffleSimpleSwap64): Deleted.
(JSC::B3::Air::testShuffleSimpleShift64): Deleted.
(JSC::B3::Air::testShuffleSwapMixedWidth): Deleted.
(JSC::B3::Air::testShuffleShiftMixedWidth): Deleted.
(JSC::B3::Air::testShuffleShiftMemory): Deleted.
(JSC::B3::Air::testShuffleShiftMemoryLong): Deleted.
(JSC::B3::Air::testShuffleShiftMemoryAllRegs): Deleted.
(JSC::B3::Air::testShuffleShiftMemoryAllRegs64): Deleted.
(JSC::B3::Air::combineHiLo): Deleted.
(JSC::B3::Air::testShuffleShiftMemoryAllRegsMixedWidth): Deleted.
(JSC::B3::Air::testShuffleRotateMemory): Deleted.
(JSC::B3::Air::testShuffleRotateMemory64): Deleted.
(JSC::B3::Air::testShuffleRotateMemoryMixedWidth): Deleted.
(JSC::B3::Air::testShuffleRotateMemoryAllRegs64): Deleted.
(JSC::B3::Air::testShuffleRotateMemoryAllRegsMixedWidth): Deleted.
(JSC::B3::Air::testShuffleSwapDouble): Deleted.
(JSC::B3::Air::testShuffleShiftDouble): Deleted.
(JSC::B3::Air::testX86VMULSD): Deleted.
(JSC::B3::Air::testX86VMULSDDestRex): Deleted.
(JSC::B3::Air::testX86VMULSDOp1DestRex): Deleted.
(JSC::B3::Air::testX86VMULSDOp2DestRex): Deleted.
(JSC::B3::Air::testX86VMULSDOpsDestRex): Deleted.
(JSC::B3::Air::testX86VMULSDAddr): Deleted.
(JSC::B3::Air::testX86VMULSDAddrOpRexAddr): Deleted.
(JSC::B3::Air::testX86VMULSDDestRexAddr): Deleted.
(JSC::B3::Air::testX86VMULSDRegOpDestRexAddr): Deleted.
(JSC::B3::Air::testX86VMULSDAddrOpDestRexAddr): Deleted.
(JSC::B3::Air::testX86VMULSDBaseNeedsRex): Deleted.
(JSC::B3::Air::testX86VMULSDIndexNeedsRex): Deleted.
(JSC::B3::Air::testX86VMULSDBaseIndexNeedRex): Deleted.
(JSC::B3::Air::run): Deleted.

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

4 years agoWe should be able to use std::tuples as keys in HashMap
keith_miller@apple.com [Fri, 24 Feb 2017 22:14:38 +0000 (22:14 +0000)]
We should be able to use std::tuples as keys in HashMap
https://bugs.webkit.org/show_bug.cgi?id=168805

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

Convert the mess of std::pairs we used as the keys in PrototypeMap
to a std::tuple. I also plan on using this for a HashMap in wasm.

* JavaScriptCore.xcodeproj/project.pbxproj:
* runtime/PrototypeMap.cpp:
(JSC::PrototypeMap::createEmptyStructure):
(JSC::PrototypeMap::clearEmptyObjectStructureForPrototype):
* runtime/PrototypeMap.h:

Source/WTF:

This patch adds support for using std::tupeles as the key
type in HashMap. It is equivalent to doing a sequence of
std::pairs but has a nicer syntax.

* wtf/HashFunctions.h:
(WTF::TupleHash::hash):
(WTF::TupleHash::equal):
(WTF::TupleHash::allTrue):
* wtf/HashTraits.h:
(WTF::TupleHashTraits::allTrue):
(WTF::TupleHashTraits::emptyValue):
(WTF::TupleHashTraits::constructDeletedValue):
(WTF::TupleHashTraits::isDeletedValue):

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

4 years ago[GTK] WebkitWebProcess crashes on exit on nvidia if threaded compositing is enabled
magomez@igalia.com [Fri, 24 Feb 2017 20:44:41 +0000 (20:44 +0000)]
[GTK] WebkitWebProcess crashes on exit on nvidia if threaded compositing is enabled
https://bugs.webkit.org/show_bug.cgi?id=165522

Reviewed by Carlos Garcia Campos.

Before destrying a GLContextGLX we need to set the default framebufer to avoid a bug
in some nvidia drivers. Ensure that we set the context as current before performing
that operation, and set the appropriate current context after doing so.

No new tests.

* platform/graphics/glx/GLContextGLX.cpp:
(WebCore::GLContextGLX::~GLContextGLX):

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

4 years agoPrepare to enable WebRTC on iOS
commit-queue@webkit.org [Fri, 24 Feb 2017 20:09:13 +0000 (20:09 +0000)]
Prepare to enable WebRTC on iOS
https://bugs.webkit.org/show_bug.cgi?id=168811

Patch by Alex Christensen <achristensen@webkit.org> on 2017-02-24
Reviewed by Youenn Fablet.

* wtf/Platform.h:

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

4 years agoRemove leftover html files.
antti@apple.com [Fri, 24 Feb 2017 20:04:25 +0000 (20:04 +0000)]
Remove leftover html files.

* http/tests/cache/disk-cache/shattered-deduplication-expected.html: Removed.
* http/tests/cache/disk-cache/shattered-deduplication.html: Removed.

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

4 years ago[iOS][WK2] Disable network cache speculative revalidation / loading in low power...
cdumez@apple.com [Fri, 24 Feb 2017 19:51:17 +0000 (19:51 +0000)]
[iOS][WK2] Disable network cache speculative revalidation / loading in low power mode
https://bugs.webkit.org/show_bug.cgi?id=168832
<rdar://problem/30697911>

Reviewed by Antti Koivisto.

Source/WebCore:

Add LowPowerModeNotifier class to monitor low power mode state on iOS.

* WebCore.xcodeproj/project.pbxproj:
* platform/LowPowerModeNotifier.cpp: Added.
(WebCore::LowPowerModeNotifier::LowPowerModeNotifier):
(WebCore::LowPowerModeNotifier::isLowPowerModeEnabled):
* platform/LowPowerModeNotifier.h: Added.
* platform/ios/LowPowerModeNotifierIOS.mm: Added.
(-[WebLowPowerModeObserver initWithNotifier:]):
(-[WebLowPowerModeObserver dealloc]):
(-[WebLowPowerModeObserver _didReceiveLowPowerModeChange]):
(WebCore::LowPowerModeNotifier::LowPowerModeNotifier):
(WebCore::LowPowerModeNotifier::isLowPowerModeEnabled):
(WebCore::LowPowerModeNotifier::notifyLowPowerModeChanged):
(WebCore::notifyLowPowerModeChanged):

Source/WebKit2:

Disable network cache speculative revalidation / loading in low power mode on iOS to
save battery.

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::initialize):
* NetworkProcess/cache/NetworkCache.h:

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

4 years agoUnreviewed. Remove inaccurate copy-paste comment from r212939.
sbarati@apple.com [Fri, 24 Feb 2017 19:36:35 +0000 (19:36 +0000)]
Unreviewed. Remove inaccurate copy-paste comment from r212939.

* dfg/DFGOperations.cpp:

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

4 years ago[Mac] Report domains using abnormally high memory usage via enhanced privacy logging
cdumez@apple.com [Fri, 24 Feb 2017 19:24:21 +0000 (19:24 +0000)]
[Mac] Report domains using abnormally high memory usage via enhanced privacy logging
https://bugs.webkit.org/show_bug.cgi?id=168797
<rdar://problem/29964017>

Reviewed by Andreas Kling.

Report domains using abnormally high memory usage (> 2GB) via enhanced privacy
logging on Mac.

* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::domainCausingJetsamKey):
* page/DiagnosticLoggingKeys.h:
* page/PerformanceMonitor.cpp:
(WebCore::reportPageOverPostLoadResourceThreshold):
(WebCore::PerformanceMonitor::measurePostLoadCPUUsage):
(WebCore::PerformanceMonitor::measurePostLoadMemoryUsage):
(WebCore::reportPageOverPostLoadCPUUsageThreshold): Deleted.

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

4 years ago.. should not remove windows drive letters in paths of file URLs
achristensen@apple.com [Fri, 24 Feb 2017 16:45:32 +0000 (16:45 +0000)]
.. should not remove windows drive letters in paths of file URLs
https://bugs.webkit.org/show_bug.cgi?id=168824

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

* web-platform-tests/url/a-element-expected.txt:
* web-platform-tests/url/a-element-xhtml-expected.txt:
* web-platform-tests/url/url-constructor-expected.txt:

Source/WebCore:

It's specified in https://url.spec.whatwg.org/#shorten-a-urls-path and helps behavior for browsers on Windows.
It can't hurt to pass a few more web platform tests, though.

* platform/URLParser.cpp:
(WebCore::URLParser::copyURLPartsUntil):
(WebCore::URLParser::shouldPopPath):
(WebCore::URLParser::popPath):
(WebCore::URLParser::parse):
* platform/URLParser.h:

LayoutTests:

* fast/url/file-expected.txt:
* fast/url/file-http-base-expected.txt:
* fast/url/relative-win-expected.txt:

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

4 years agoReverting https://trac.webkit.org/r212951, landing this doesn't actually work due...
antti@apple.com [Fri, 24 Feb 2017 13:17:48 +0000 (13:17 +0000)]
Reverting https://trac.webkit.org/r212951, landing this doesn't actually work due to Git infrastucture.

* http/tests/cache/disk-cache/resources/shattered-1-nocollision.pdf: Removed.
* http/tests/cache/disk-cache/resources/shattered-1.pdf: Removed.
* http/tests/cache/disk-cache/resources/shattered-2-nocollision.pdf: Removed.

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

4 years agoAdd a test verifying cache deduplication is not sensitive to SHA1 collision attack
antti@apple.com [Fri, 24 Feb 2017 12:45:41 +0000 (12:45 +0000)]
Add a test verifying cache deduplication is not sensitive to SHA1 collision attack
https://bugs.webkit.org/show_bug.cgi?id=168774

Reviewed by Sam Weinig.

We use SHA1 for deduplicating disk cache resources. Since a real world SHA1 collision was demonstrated
recently (http://shattered.io/) we can add a test that shows it can't be used for cache poisoning.

There are two protections in the cache code that both individually stop this type of attack:

- When deduplicating the data is verified to be equal by a bytewise comparison.
- SHA1 computations include random salt unique to cache instance.

Commenting out both protections is needed to make this test fail.

* http/tests/cache/disk-cache/resources/shattered-1-nocollision.pdf: Added.
* http/tests/cache/disk-cache/resources/shattered-1.pdf: Added.
* http/tests/cache/disk-cache/resources/shattered-2-nocollision.pdf: Added.
* http/tests/cache/disk-cache/resources/shattered-2.pdf: Added.

Files shattered-1.pdf and shattered-2.pdf differ visually but have the same SHA1.
The nocollision versions for the ref have the same pixels but don't collide.

* http/tests/cache/disk-cache/shattered-deduplication-expected.html: Added.
* http/tests/cache/disk-cache/shattered-deduplication.html: Added.

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

4 years ago[Mac][cmake] Unreviewed buildfix after r212736.
ossy@webkit.org [Fri, 24 Feb 2017 09:34:17 +0000 (09:34 +0000)]
[Mac][cmake] Unreviewed buildfix after r212736.

* PlatformMac.cmake:

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

4 years agoResource Load Statistics: Add alternate classification method
wilander@apple.com [Fri, 24 Feb 2017 09:19:53 +0000 (09:19 +0000)]
Resource Load Statistics: Add alternate classification method
https://bugs.webkit.org/show_bug.cgi?id=168347
<rdar://problem/30352793>
<rdar://problem/30646710>
<rdar://problem/30660708>

Reviewed by Alex Christensen.

Source/WebCore:

This patch only adds test infrastructure in WebCore.

Tests: http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics.html
       http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins.html
       http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins.html
       http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to.html
       http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics.html
       http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins.html
       http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins.html
       http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to.html

* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::setSubframeUnderTopFrameOrigin):
(WebCore::ResourceLoadObserver::setSubresourceUnderTopFrameOrigin):
(WebCore::ResourceLoadObserver::setSubresourceUniqueRedirectTo):
* loader/ResourceLoadObserver.h:

Source/WebKit2:

This patch adds a CorePrediction-based classifier to the WebResourceLoadStatisticsStore.
The CorePrediction framework is introduced as a dependency for macOS and iOS. The patch
also adds functions to support layout tests of the feature.

* Platform/Logging.h:
    Added channel ResourceLoadStatistics.
* Platform/classifier/ResourceLoadStatisticsClassifier.h: Added.
    Pulls in the Cocoa-specific classifier for Cocoa-based platforms.
(WebKit::ResourceLoadStatisticsClassifier::ResourceLoadStatisticsClassifier):
* Platform/classifier/ResourceLoadStatisticsClassifierBase.cpp: Added.
(WebKit::ResourceLoadStatisticsClassifierBase::hasPrevalentResourceCharacteristics):
    Shared classifier logic.
(WebKit::ResourceLoadStatisticsClassifierBase::classifyWithVectorThreshold):
    Fallback classifier for when we don't have CorePrediction.
* Platform/classifier/ResourceLoadStatisticsClassifierBase.h: Added.
(WebKit::ResourceLoadStatisticsClassifierBase::ResourceLoadStatisticsClassifierBase):
(WebKit::ResourceLoadStatisticsClassifierBase::~ResourceLoadStatisticsClassifierBase):
* Platform/classifier/cocoa/CorePredictionSoftLink.h: Added.
    Soft links to CorePrediction and the two functions we use from it.
* Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp: Added.
(WebKit::ResourceLoadStatisticsClassifier::classify):
(WebKit::ResourceLoadStatisticsClassifier::storagePath):
(WebKit::ResourceLoadStatisticsClassifier::shouldUseCorePredictionAndHaveModelLoaded):
(WebKit::ResourceLoadStatisticsClassifier::singletonPredictionModel):
    The new classifier for Cocoa platforms.
* Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.h: Added.
* PlatformGTK.cmake:
    Added Platform/classifier directory and ResourceLoadStatisticsClassifierBase.cpp.
* PlatformMac.cmake:
    Added Platform/classifier and Platform/classifier/cocoa directories, and
    source files ResourceLoadStatisticsClassifierBase.cpp and
    ResourceLoadStatisticsClassifierCocoa.cpp
* Resources/ResourceLoadStatistics/corePrediction_model: Added.
    Model file to load into CorePrediction.
* UIProcess/API/C/WKResourceLoadStatisticsManager.cpp:
(WKResourceLoadStatisticsManagerSetSubframeUnderTopFrameOrigin):
(WKResourceLoadStatisticsManagerSetSubresourceUnderTopFrameOrigin):
(WKResourceLoadStatisticsManagerSetSubresourceUniqueRedirectTo):
    Test infrastructure.
* UIProcess/API/C/WKResourceLoadStatisticsManager.h:
* UIProcess/WebResourceLoadStatisticsManager.cpp:
(WebKit::WebResourceLoadStatisticsManager::setSubframeUnderTopFrameOrigin):
(WebKit::WebResourceLoadStatisticsManager::setSubresourceUnderTopFrameOrigin):
(WebKit::WebResourceLoadStatisticsManager::setSubresourceUniqueRedirectTo):
    Test infrastructure.
* UIProcess/WebResourceLoadStatisticsManager.h:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
    Renamed m_storagePath to m_statisticsStoragePath for clarity.
(WebKit::WebResourceLoadStatisticsStore::classifyResource):
    Now calls the classifier through its ResourceLoadStatisticsClassifier
    member variable.
(WebKit::WebResourceLoadStatisticsStore::persistentStoragePath):
    Renamed m_storagePath to m_statisticsStoragePath for clarity.
(WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk):
    Renamed m_storagePath to m_statisticsStoragePath for clarity.
(WebKit::WebResourceLoadStatisticsStore::hasPrevalentResourceCharacteristics): Deleted.
* UIProcess/WebResourceLoadStatisticsStore.h:
* WebKit2.xcodeproj/project.pbxproj:
    Added the new classifier source files under Platform/classifier and the
    corePrediction_model file under Resources/ResourceLoadStatistics.

Tools:

Added three testRunner functions to facilitate layout tests:
- setStatisticsSubframeUnderTopFrameOrigin()
- setStatisticsSubresourceUnderTopFrameOrigin()
- setStatisticsSubresourceUniqueRedirectTo()

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setStatisticsSubframeUnderTopFrameOrigin):
(WTR::TestRunner::setStatisticsSubresourceUnderTopFrameOrigin):
(WTR::TestRunner::setStatisticsSubresourceUniqueRedirectTo):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::setStatisticsSubframeUnderTopFrameOrigin):
(WTR::TestController::setStatisticsSubresourceUnderTopFrameOrigin):
(WTR::TestController::setStatisticsSubresourceUniqueRedirectTo):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):

LayoutTests:

* http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics-expected.txt: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics.html: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins-expected.txt: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins.html: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins-expected.txt: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins.html: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to-expected.txt: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to.html: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics-expected.txt: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics.html: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins-expected.txt: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins.html: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins-expected.txt: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins.html: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to-expected.txt: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to.html: Added.
* http/tests/loading/resourceLoadStatistics/non-prevalent-resource-with-user-interaction.html:
    Added a call to internals.setResourceLoadStatisticsEnabled(false) before testRunner.notifyDone().
* http/tests/loading/resourceLoadStatistics/non-prevalent-resource-without-user-interaction.html:
    Added a call to internals.setResourceLoadStatisticsEnabled(false) before testRunner.notifyDone().
* http/tests/loading/resourceLoadStatistics/prevalent-resource-with-user-interaction-timeout.html:
    Added a call to internals.setResourceLoadStatisticsEnabled(false) before testRunner.notifyDone().
* http/tests/loading/resourceLoadStatistics/prevalent-resource-with-user-interaction.html:
    Added a call to internals.setResourceLoadStatisticsEnabled(false) before testRunner.notifyDone().
* http/tests/loading/resourceLoadStatistics/prevalent-resource-without-user-interaction.html:
    Added a call to internals.setResourceLoadStatisticsEnabled(false) before testRunner.notifyDone().
* platform/gtk/TestExpectations:
    The whole http/tests/loading/resourceLoadStatistics marked as crashing based on
    Carlos Garcia Campos's assessment in https://bugs.webkit.org/show_bug.cgi?id=168171.
* platform/wk2/TestExpectations:
    The above tests are only valid for WebKit2. Marked as [ Pass ].

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

4 years ago[Modern Media Controls] No controls are shown for <audio preload="none">
commit-queue@webkit.org [Fri, 24 Feb 2017 07:38:41 +0000 (07:38 +0000)]
[Modern Media Controls] No controls are shown for <audio preload="none">
https://bugs.webkit.org/show_bug.cgi?id=168800
<rdar://problem/30652142>

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

Source/WebCore:

A media element's currentSrc property will only be set when data has started
to load. In the case where preload="none" is used, regardless of whether a
source is specified, currentSrc would be the empty string and we wouldn't
show controls at all. Identifying whether a source is specified is a little
tricky because it could be specified in a variety of ways and dynamically
as well.

So instead we optimistically show controls always provided the "controls"
attribute is set.

* Modules/modern-media-controls/media/controls-visibility-support.js:
(ControlsVisibilitySupport.prototype._updateControls):
(ControlsVisibilitySupport):
* Modules/modern-media-controls/media/start-support.js:
(StartSupport.prototype._shouldShowStartButton):
(StartSupport):

LayoutTests:

Update tests to account for the new rules for controls visibility and force an older test
not to use modern media controls since we now show the play button and there is a bug
that prevents the play button from being positioned correctly when inside a region
(see https://bugs.webkit.org/show_bug.cgi?id=168823).

* fast/regions/inline-block-inside-anonymous-overflow-with-covered-controls-expected.html
* fast/regions/inline-block-inside-anonymous-overflow-with-covered-controls.html
* media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-on-audio-expected.txt:
* media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-on-audio.html:
* media/modern-media-controls/start-support/start-support-no-source-expected.txt:
* media/modern-media-controls/start-support/start-support-no-source.html:

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

4 years agoRename 'commit_parent' in 'commits' table to 'commit_previous_commit'.
dewei_zhu@apple.com [Fri, 24 Feb 2017 07:17:48 +0000 (07:17 +0000)]
Rename 'commit_parent' in 'commits' table to 'commit_previous_commit'.
https://bugs.webkit.org/show_bug.cgi?id=168816

Reviewed by Ryosuke Niwa.

Rename 'commit_parent' to avoid ambiguity in the coming feature.
For exisiting database, run
    "ALTER TABLE commits RENAME commit_parent TO commit_previous_commit;"
to update the database.

* init-database.sql:
* public/api/report-commits.php:
* public/include/commit-log-fetcher.php:
* server-tests/api-commits.js:
(then):
* server-tests/api-report-commits-tests.js:
(then):
* tools/sync-commits.py:
(main):
(Repository.fetch_commits_and_submit):
(GitRepository._revision_from_tokens):
* unit-tests/analysis-task-tests.js:
(sampleAnalysisTask):

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

4 years agoNew sampling algorithm shows very few points when zoomed out
rniwa@webkit.org [Fri, 24 Feb 2017 06:57:04 +0000 (06:57 +0000)]
New sampling algorithm shows very few points when zoomed out
https://bugs.webkit.org/show_bug.cgi?id=168813

Reviewed by Saam Barati.

When a chart is zoomed out to a large time interval, the new sampling algorithm introduced in r212853 can
hide most of the data points because the difference between the preceding point's time and the succeeding
point's time of most points will be below the threshold we computed.

Instead, rank each data point based on the aforementioned time interval difference, and pick the first M data
points when M data points are to be shown.

This makes the new algorithm behave like our old algorithm while keeping it stable still. Note that this
algorithm still biases data points without a close neighboring point but this seems to work out in practice
because such a point tends to be an important sample anyway, and we don't have a lot of space between
data points since we aim to show about one point per pixel.

* browser-tests/index.html:
(CanvasTest.canvasContainsColor): Extracted from one of the test cases and generalized. Returns true when
the specified region of the canvas contains a specified color (alpha is optional).
* browser-tests/time-series-chart-tests.js: Added a test case for sampling. It checks that sampling happens
and that we always show some data point even when zoomed out to a large time interval.
(createChartWithSampleCluster):

* public/v3/components/interactive-time-series-chart.js:
(InteractiveTimeSeriesChart.prototype._sampleTimeSeries):
* public/v3/components/time-series-chart.js:
(TimeSeriesChart.prototype._ensureSampledTimeSeries): M, the number of data points we pick must be computed
based on the width of data points we're about to draw constrained by the canvas size. e.g. when the canvas
is only half filled, we shouldn't be showing two points per pixel in the filled region.
(TimeSeriesChart.prototype._sampleTimeSeries): Refined the algorithm. First, compute the time difference or
the rank for each N data points. Sort those ranks in descending order (in the order we prefer), and include
all data points above the M-th rank in the sample.
(TimeSeriesChart.prototype.computeTimeGrid): Revert the inadvertent change in r212935.

* public/v3/models/time-series.js:
(TimeSeriesView.prototype.filter): Fixed a bug that the indices passed onto the callback were shifted by the
starting index.
* unit-tests/time-series-tests.js: Added a test case to ensure callbacks are called with correct data points
and indices.

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

4 years ago[Resource Timing] Add Experimental Feature Flag
joepeck@webkit.org [Fri, 24 Feb 2017 06:52:02 +0000 (06:52 +0000)]
[Resource Timing] Add Experimental Feature Flag
https://bugs.webkit.org/show_bug.cgi?id=167147

Reviewed by Ryosuke Niwa.

Source/WebKit2:

* Shared/WebPreferencesDefinitions.h:
Move ResourceTiming to experimental section.
Disable it for El Capitan due to known issues.

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(enableExperimentalFeatures):
(resetWebPreferencesToConsistentValues):
* DumpRenderTree/win/DumpRenderTree.cpp:
(enableExperimentalFeatures):
(resetWebPreferencesToConsistentValues):
Put experimental flags in the experimental section.

Websites/webkit.org:

* experimental-features.html:
Test for Resource Timing.

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

4 years ago[Resource Timing] Gather timing information with reliable responseEnd time
joepeck@webkit.org [Fri, 24 Feb 2017 06:51:54 +0000 (06:51 +0000)]
[Resource Timing] Gather timing information with reliable responseEnd time
https://bugs.webkit.org/show_bug.cgi?id=168351

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

* web-platform-tests/fetch/api/redirect/redirect-count-cross-origin-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-count-cross-origin-worker-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-count-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-count-worker-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-location-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-location-worker-expected.txt:
New behavior for too many redirects caused by <rdar://problem/30610988>.

* web-platform-tests/resource-timing/rt-nextHopProtocol-expected.txt: Added.
* web-platform-tests/resource-timing/rt-nextHopProtocol.html: Added.
* web-platform-tests/resource-timing/rt-nextHopProtocol.js: Added.
* web-platform-tests/resource-timing/rt-nextHopProtocol.worker-expected.txt: Added.
* web-platform-tests/resource-timing/rt-nextHopProtocol.worker.html: Added.
* web-platform-tests/resource-timing/rt-nextHopProtocol.worker.js: Added.
New tests specific to just checking the nextHopProtocol property with
a non-cached resource to avoid flakeyness.

Source/WebCore:

This patch replaces the unused `double finishTime` in ResourceLoader's
didFinishLoad with a complete WebCore::NetworkLoadMetrics object. This
allows the NetworkProcess to give complete timing information, and more
final metrics about the load, to WebCore. Currently this is only used
by ResourceTiming, but it will soon be used by Web Inspector as well.
We may also end up extending this to the didFail path as well, since it
is possible that we have some metrics for load failures.

At the same time we want to start moving away from the legacy path that
populated a subset of this information in ResourceResponse's NetworkLoadMetrics.
It doesn't make sense to store this information on the ResourceResponse
for a few reasons: We don't want to store the metrics in our Network Cache and
not all of the load timing metrics have been populated yet (responseEnd).
In an effort to move off of this data we've renamed the accessor to
"deprecatedNetworkLoadMetrics". There are a few remaining clients
(ResourceHandle, PerformanceTiming, InspectorNetworkAgent) which can be
migrated separately from this patch.

Having both the legacy and new code paths adds a little bit of complexity.
One advantage of the new path is that the complete load timing data
(fetchStart -> dns -> connect -> request -> response -> responseEnd) can
be packaged together. The legacy path could not include a responseEnd, so
WebCore faked that value with its own timestamp. Having the fake responseEnd
caused issues as timestamps / clocks are different between processes. In order
for PerformanceResponseTiming to know whether or not the NetworkLoadMetrics
has the complete network timing metrics it checks isComplete(). If true
it knows it can use the responseEnd time from NetworkLoadMetrics, otherwise
it must fallback to the legacy value from LoadTiming. Once all of the
deprecatedNetworkLoadMetrics clients go away, we should always have the
complete data and this can be eliminated.

Tests: imported/w3c/web-platform-tests/resource-timing/rt-nextHopProtocol.html
       imported/w3c/web-platform-tests/resource-timing/rt-nextHopProtocol.worker.html

* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
Rename NetworkLoadTiming -> NetworkLoadMetrics.

* page/PerformanceResourceTiming.cpp:
(WebCore::entryStartTime):
(WebCore::entryEndTime):
(WebCore::PerformanceResourceTiming::PerformanceResourceTiming):
(WebCore::PerformanceResourceTiming::nextHopProtocol):
(WebCore::PerformanceResourceTiming::domainLookupStart):
(WebCore::PerformanceResourceTiming::domainLookupEnd):
(WebCore::PerformanceResourceTiming::connectStart):
(WebCore::PerformanceResourceTiming::connectEnd):
(WebCore::PerformanceResourceTiming::secureConnectionStart):
(WebCore::PerformanceResourceTiming::requestStart):
(WebCore::PerformanceResourceTiming::responseStart):
(WebCore::PerformanceResourceTiming::responseEnd):
(WebCore::PerformanceResourceTiming::networkLoadTimeToDOMHighResTimeStamp):
* page/PerformanceResourceTiming.h:
Mostly just updating names and types. This does however need to get the
correct endTime based on whether the NetworkLoadMetrics are complete
(meaning includes responseEnd) or not (legacy, use LoadTiming value).

* page/PerformanceResourceTiming.idl:
Add nextHopProtocol.

* page/PerformanceTiming.cpp:
(WebCore::PerformanceTiming::domainLookupStart):
(WebCore::PerformanceTiming::domainLookupEnd):
(WebCore::PerformanceTiming::connectStart):
(WebCore::PerformanceTiming::connectEnd):
(WebCore::PerformanceTiming::secureConnectionStart):
(WebCore::PerformanceTiming::requestStart):
(WebCore::PerformanceTiming::responseStart):
(WebCore::PerformanceTiming::resourceLoadTimeRelativeToFetchStart):
* page/PerformanceTiming.h:
Navigation Timing values still uses the NetworkLoadTiming values stored on
the DocumentLoader. This should be moved off of the deprecated path separately.

* platform/network/NetworkLoadMetrics.h: Renamed from Source/WebCore/platform/network/NetworkLoadTiming.h.
(WebCore::NetworkLoadMetrics::NetworkLoadMetrics):
(WebCore::NetworkLoadMetrics::isolatedCopy):
(WebCore::NetworkLoadMetrics::reset):
(WebCore::NetworkLoadMetrics::operator==):
(WebCore::NetworkLoadMetrics::operator!=):
(WebCore::NetworkLoadMetrics::isComplete):
(WebCore::NetworkLoadMetrics::markComplete):
(WebCore::NetworkLoadMetrics::encode):
(WebCore::NetworkLoadMetrics::decode):
Re-introduce a reset() method (for NetworkLoadSoup to reset between redirects).
Add protocolName and "complete" boolean.

* platform/network/cocoa/NetworkLoadMetrics.mm: Renamed from Source/WebCore/platform/network/cocoa/NetworkLoadTiming.mm.
(WebCore::timingValue):
(WebCore::copyTimingData):
(WebCore::setCollectsTimingData):
Use this opportunity to convert NetworkLoadTiming timestamps to WTF::Seconds.
Since we already have to modify all the clients this moves us to use the more
strongly typed units that are less ambiguous then "double". The rest of the
Performance API has already moved to these units.

* inspector/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::buildObjectForTiming):
(WebCore::InspectorNetworkAgent::buildObjectForResourceResponse):
(WebCore::InspectorNetworkAgent::didFinishLoading):
* inspector/InspectorNetworkAgent.h:
Inspector was the only client of the finishTime, and since the value was
erratically coming from clients in different ways it was almost certainly
inaccurate. Simplify this in preparation for using NetworkLoadMetrics.

* Modules/fetch/FetchLoader.cpp:
(WebCore::FetchLoader::didFinishLoading):
* Modules/fetch/FetchLoader.h:
* fileapi/FileReaderLoader.cpp:
(WebCore::FileReaderLoader::didFinishLoading):
* fileapi/FileReaderLoader.h:
* html/MediaFragmentURIParser.cpp:
(WebCore::MediaFragmentURIParser::parseNPTTime):
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didFinishLoadingImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didFinishLoading):
* loader/CrossOriginPreflightChecker.cpp:
(WebCore::CrossOriginPreflightChecker::validatePreflightResponse):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::notifyFinished):
(WebCore::DocumentLoader::finishedLoading):
(WebCore::DocumentLoader::continueAfterContentPolicy):
(WebCore::DocumentLoader::maybeLoadEmpty):
* loader/DocumentLoader.h:
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::didReceiveResponse):
(WebCore::DocumentThreadableLoader::notifyFinished):
(WebCore::DocumentThreadableLoader::didFinishLoading):
(WebCore::DocumentThreadableLoader::loadRequest):
* loader/DocumentThreadableLoader.h:
* loader/NetscapePlugInStreamLoader.cpp:
(WebCore::NetscapePlugInStreamLoader::didFinishLoading):
* loader/NetscapePlugInStreamLoader.h:
* loader/ResourceLoadNotifier.cpp:
(WebCore::ResourceLoadNotifier::didFinishLoad):
(WebCore::ResourceLoadNotifier::dispatchDidFinishLoading):
(WebCore::ResourceLoadNotifier::sendRemainingDelegateMessages):
* loader/ResourceLoadNotifier.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::deliverResponseAndData):
(WebCore::ResourceLoader::loadDataURL):
(WebCore::ResourceLoader::didFinishLoading):
(WebCore::ResourceLoader::didFinishLoadingOnePart):
* loader/ResourceLoader.h:
* loader/ResourceTiming.cpp:
(WebCore::ResourceTiming::fromLoad):
(WebCore::ResourceTiming::fromSynchronousLoad):
(WebCore::ResourceTiming::ResourceTiming):
(WebCore::ResourceTiming::isolatedCopy):
* loader/ResourceTiming.h:
(WebCore::ResourceTiming::networkLoadMetrics):
(WebCore::ResourceTiming::ResourceTiming):
(WebCore::ResourceTiming::networkLoadTiming): Deleted.
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::SubresourceLoader):
(WebCore::SubresourceLoader::willSendRequestInternal):
(WebCore::SubresourceLoader::didReceiveResponse):
(WebCore::SubresourceLoader::didFinishLoading):
(WebCore::SubresourceLoader::reportResourceTiming):
* loader/SubresourceLoader.h:
* loader/ThreadableLoaderClient.h:
(WebCore::ThreadableLoaderClient::didFinishLoading):
* loader/ThreadableLoaderClientWrapper.h:
(WebCore::ThreadableLoaderClientWrapper::didFinishLoading):
* loader/WorkerThreadableLoader.cpp:
(WebCore::WorkerThreadableLoader::MainThreadBridge::didFinishLoading):
* loader/WorkerThreadableLoader.h:
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::didFinishLoading):
* loader/appcache/ApplicationCacheGroup.h:
* loader/cache/CachedResource.h:
(WebCore::CachedResource::setLoadFinishTime):
* loader/ios/QuickLook.mm:
(-[WebPreviewLoader connectionDidFinishLoading:]):
* page/EventSource.cpp:
(WebCore::EventSource::didFinishLoading):
* page/EventSource.h:
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(ResourceHandleStreamingClient::didFinishLoading):
* platform/network/BlobResourceHandle.cpp:
(WebCore::doNotifyFinish):
* platform/network/PingHandle.h:
* platform/network/ResourceHandle.h:
* platform/network/ResourceHandleClient.h:
(WebCore::ResourceHandleClient::didFinishLoading):
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::crossThreadData):
(WebCore::ResourceResponseBase::fromCrossThreadData):
(WebCore::ResourceResponseBase::compare):
* platform/network/ResourceResponseBase.h:
(WebCore::ResourceResponseBase::deprecatedNetworkLoadMetrics):
(WebCore::ResourceResponseBase::encode):
(WebCore::ResourceResponseBase::decode):
(WebCore::ResourceResponseBase::networkLoadTiming): Deleted.
* platform/network/SynchronousLoaderClient.cpp:
(WebCore::SynchronousLoaderClient::didFinishLoading):
* platform/network/SynchronousLoaderClient.h:
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFinishLoading):
* platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didFinishLoading):
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::WebCoreSynchronousLoader::didFinishLoading):
* platform/network/curl/ResourceHandleManager.cpp:
(WebCore::calculateWebTimingInformations):
(WebCore::ResourceHandleManager::downloadTimerCallback):
(WebCore::handleDataURL):
(WebCore::milisecondsSinceRequest): Deleted.
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::getConnectionTimingData):
* platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
(-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]):
(-[WebCoreResourceHandleAsDelegate connectionDidFinishLoading:]):
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connectionDidFinishLoading:]):
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::restartedCallback):
(WebCore::nextMultipartResponsePartCallback):
(WebCore::sendRequestCallback):
(WebCore::ResourceHandle::didStartRequest):
(WebCore::networkEventCallback):
(WebCore::ResourceHandle::sendPendingRequest):
(WebCore::readCallback):
(WebCore::milisecondsSinceRequest): Deleted.
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::didFinishLoading):
* workers/WorkerScriptLoader.h:
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::didFinishLoading):
* xml/XMLHttpRequest.h:
Eliminate the unused finishTime double.

Source/WebKit2:

Change from an unused `double finishTime` to a complete WebCore::NetworkLoadMetrics
object in the didFinishLoad ResourceLoader path. We may also extend this in the
didFail path later on. This allows the NetworkProcess to give complete timing
information, and more final metrics about the load, to WebCore.

* NetworkProcess/NetworkDataTask.h:
(WebKit::NetworkDataTaskClient::didCompleteWithError):
Give the NetworkDataTaskClient a basic didCompleteWithError for a completion
without metrics. For loads that complete with an error, or haven't populated
any metrics, this will pass empty metrics onward.

* NetworkProcess/Downloads/BlobDownloadClient.cpp:
(WebKit::BlobDownloadClient::didFinishLoading):
* NetworkProcess/Downloads/BlobDownloadClient.h:
* NetworkProcess/Downloads/PendingDownload.h:
* NetworkProcess/PingLoad.h:
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
(WebKit::NetworkCache::SpeculativeLoad::didFinishLoading):
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
* NetworkProcess/NetworkDataTaskBlob.cpp:
(WebKit::NetworkDataTaskBlob::didFail):
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::continueWillSendRequest):
(WebKit::NetworkLoad::didCompleteWithError):
(WebKit::NetworkLoad::didFinishLoading):
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/NetworkLoadClient.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::didFinishLoading):
(WebKit::NetworkResourceLoader::sendResultForCacheEntry):
* NetworkProcess/NetworkResourceLoader.h:
* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::didFinishResourceLoad):
(WebKit::WebResourceLoader::didReceiveResource):
* WebProcess/Network/WebResourceLoader.h:
* WebProcess/Network/WebResourceLoader.messages.in:
Change didFinishLoad paths to take a NetworkLoadMetrics object instead of finishTime.
Change didCompleteWithError pathes to include a NetworkLoadMetrics object instead of finishTime.

* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::didCompleteWithError):
Own a NetworkLoadTiming that will be populated with the load.

* NetworkProcess/cocoa/NetworkSessionCocoa.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
(-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
(-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
Populate NetworkLoadMetrics in the didFinishCollectingMetrics NSURLSessionTaskDelegate method.

* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
(WebKit::NetworkDataTaskSoup::timeoutFired):
(WebKit::NetworkDataTaskSoup::didSendRequest):
(WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse):
(WebKit::NetworkDataTaskSoup::dispatchDidCompleteWithError):
(WebKit::NetworkDataTaskSoup::tlsErrorsChanged):
(WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
(WebKit::NetworkDataTaskSoup::didFinishRead):
(WebKit::NetworkDataTaskSoup::didFinishRequestNextPart):
(WebKit::NetworkDataTaskSoup::didFailDownload):
(WebKit::NetworkDataTaskSoup::didFail):
(WebKit::NetworkDataTaskSoup::networkEvent):
(WebKit::NetworkDataTaskSoup::didStartRequest):
(WebKit::NetworkDataTaskSoup::didRestart):
* NetworkProcess/soup/NetworkDataTaskSoup.h:
Instead of populating the NetworkLoadMetrics on the ResourceResponse, populate
a member variable during the entire load and dispatch didFinishCollectingMetrics
right before didCompleteLoadWithError.

Source/WTF:

* wtf/persistence/Coders.h:
(WTF::Persistence::Coder<Seconds>::encode):
(WTF::Persistence::Coder<Seconds>::decode):

LayoutTests:

* TestExpectations:
Now that nextHopProtocol is available on Mac mark the test as flakey
because the value can be set or not depending on whether or not the
resource was loaded from a cache.

* platform/ios-simulator/TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:
* platform/win/TestExpectations:
Mark nextHopProtocol tests as expected to fail on ports that do not
yet support those values. Mark redirect tests as failing on ports
that encounter the CFNetwork issue causing unexpected callbacks.

* performance-api/resource-timing-apis-expected.txt:
* performance-api/resources/resource-timing-api.js:
Progressions.

* platform/mac-elcapitan/imported/w3c/web-platform-tests/resource-timing/test_resource_timing-expected.txt: Added.
* platform/mac/imported/w3c/web-platform-tests/resource-timing/test_resource_timing-expected.txt: Added.
Expected passing values on mac, except el capitan where this new resource timing data is unavailable.

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

4 years ago[Modern Media Controls] Controls overflow when media element has border or padding
commit-queue@webkit.org [Fri, 24 Feb 2017 06:40:29 +0000 (06:40 +0000)]
[Modern Media Controls] Controls overflow when media element has border or padding
https://bugs.webkit.org/show_bug.cgi?id=168818
<rdar://problem/30689780>

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

Source/WebCore:

We used to query the media element's layout size to compute the size of the media controls,
which would account for border and padding. Instead, we should use the size of the container,
at the root of the ShadowRoot, which will always match the size of the media.

Test: media/modern-media-controls/media-controller/media-controller-controls-sizing-with-border-and-padding.html

* Modules/modern-media-controls/controls/media-controls.css:
(.media-controls-container,):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype._updateControlsSize):
(MediaController.prototype._controlsWidth):

LayoutTests:

Updating a host of tests to ensure they have an explicitly host and add a new test
to check that we have the correct size with borders and padding.

* media/modern-media-controls/fullscreen-support/fullscreen-support-click.html:
* media/modern-media-controls/media-controller/media-controller-compact-expected.txt:
* media/modern-media-controls/media-controller/media-controller-compact.html:
* media/modern-media-controls/media-controller/media-controller-controls-sizing-with-border-and-padding-expected.txt: Added.
* media/modern-media-controls/media-controller/media-controller-controls-sizing-with-border-and-padding.html: Added.
* media/modern-media-controls/media-controller/media-controller-reduced-padding-expected.txt:
* media/modern-media-controls/media-controller/media-controller-reduced-padding.html:
* media/modern-media-controls/media-controller/media-controller-tight-padding-expected.txt:
* media/modern-media-controls/media-controller/media-controller-tight-padding.html:
* media/modern-media-controls/pip-support/pip-support-click.html:
* media/modern-media-controls/scrubber-support/scrubber-support-click.html:
* media/modern-media-controls/scrubber-support/scrubber-support-drag.html:
* media/modern-media-controls/volume-support/volume-support-click.html:
* media/modern-media-controls/volume-support/volume-support-drag.html:
* media/track/track-cue-rendering-snap-to-lines-not-set.html: Turn modern media controls off for this test to pass.

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

4 years ago[Modern Media Controls] Dragging controls in fullscreen on macOS prevents scrubbing...
commit-queue@webkit.org [Fri, 24 Feb 2017 05:41:22 +0000 (05:41 +0000)]
[Modern Media Controls] Dragging controls in fullscreen on macOS prevents scrubbing or interacting with controls
https://bugs.webkit.org/show_bug.cgi?id=168820
<rdar://problem/30690281>

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

Source/WebCore:

We broke this in https://bugs.webkit.org/show_bug.cgi?id=168755. We restore the check that the
event target when initiating a drag is the controls bar itself and not some of its content.

Since this wasn't caught by our existing tests, we add a test that attemps to initiate a drag
starting over one of the controls and notice that no dragging occurs.

Test: media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-drag-is-prevented-over-button.html

* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
(MacOSFullscreenMediaControls.prototype._handleMousedown):

LayoutTests:

Making the existing test more robust and adding a new test that checks what happens
when we initiate a drag over some controls.

* media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-drag-expected.txt:
* media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-drag-is-prevented-over-button-expected.txt: Added.
* media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-drag-is-prevented-over-button.html: Added.
* media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-drag.html:

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