WebKit-https.git
3 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

3 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

3 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

3 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

3 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

3 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

3 years agoREGRESSION (r211305): Masks on composited elements with preserve-3d broken
simon.fraser@apple.com [Fri, 24 Feb 2017 05:33:40 +0000 (05:33 +0000)]
REGRESSION (r211305): Masks on composited elements with preserve-3d broken
https://bugs.webkit.org/show_bug.cgi?id=168815
rdar://problem/30676846

Reviewed by Jon Lee.

Source/WebCore:

r211305 moved the mask layer to be on the structural layer if there is one, to fix
masking backdrops. However, with preserve-3d the structural layer can be a CATransformLayer,
which doesn't take a mask, so limit the previous change to backdrops only.

Test: compositing/masks/mask-with-preserve-3d.html

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::updateMaskLayer):

LayoutTests:

* compositing/masks/mask-with-preserve-3d-expected.html: Added.
* compositing/masks/mask-with-preserve-3d.html: Added.

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

3 years ago[Modern Media Controls] Show "Loading" until playback starts
commit-queue@webkit.org [Fri, 24 Feb 2017 05:27:54 +0000 (05:27 +0000)]
[Modern Media Controls] Show "Loading" until playback starts
https://bugs.webkit.org/show_bug.cgi?id=168809
<rdar://problem/30687468>

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

We now display the "Loading" status as soon as we've started loading and
until we've obtained enough data to play. No test provided since we don't
have a way to specifically set networkState and readyState to the satisfactory
values.

* Modules/modern-media-controls/media/status-support.js:
(StatusSupport.prototype.syncControl):
(StatusSupport):

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

3 years agoIntrinsicify parseInt
sbarati@apple.com [Fri, 24 Feb 2017 04:07:30 +0000 (04:07 +0000)]
Intrinsicify parseInt
https://bugs.webkit.org/show_bug.cgi?id=168627

Reviewed by Filip Pizlo.

JSTests:

* stress/parse-int-intrinsic.js: Added.
(assert):
(testIntrinsic.let.s):
(testIntrinsic):
(testIntrinsic2.baz):
(testIntrinsic2):
(testIntrinsic3.foo):
(testIntrinsic3):
(testIntrinsic4.foo):
(testIntrinsic4):
(testIntrinsic5.foo):
(testIntrinsic5):
(testIntrinsic6.foo):
(testIntrinsic6):
(testIntrinsic7.foo):
(testIntrinsic7):

Source/JavaScriptCore:

This patch makes parseInt an intrinsic in the DFG and FTL.
We do our best to eliminate this node. If we speculate that
the first operand to the operation is an int32, and that there
isn't a second operand, we convert to the identity of the first
operand. That's because parseInt(someInt) === someInt.

If the first operand is proven to be an integer, and the second
operand is the integer 0 or the integer 10, we can eliminate the
node by making it an identity over its first operand. That's
because parseInt(someInt, 0) === someInt and parseInt(someInt, 10) === someInt.

If we are not able to constant fold the node away, we try to remove
checks. The most common use case of parseInt is that its first operand
is a proven string. The DFG might be able to remove type checks in this
case. We also set up CSE rules for parseInt(someString, someIntRadix)
because it's a "pure" operation (modulo resolving a rope).

This looks to be a 4% Octane/Box2D progression.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::foldConstants):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNode.h:
(JSC::DFG::Node::hasHeapPrediction):
* dfg/DFGNodeType.h:
* dfg/DFGOperations.cpp:
(JSC::DFG::parseIntResult):
* dfg/DFGOperations.h:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileParseInt):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::callOperation):
(JSC::DFG::SpeculativeJIT::appendCallSetResult):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileParseInt):
* jit/JITOperations.h:
* parser/Lexer.cpp:
* runtime/ErrorInstance.cpp:
* runtime/Intrinsic.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::toStringView): Deleted.
(JSC::isStrWhiteSpace): Deleted.
(JSC::parseDigit): Deleted.
(JSC::parseIntOverflow): Deleted.
(JSC::parseInt): Deleted.
* runtime/JSGlobalObjectFunctions.h:
* runtime/ParseInt.h: Added.
(JSC::parseDigit):
(JSC::parseIntOverflow):
(JSC::isStrWhiteSpace):
(JSC::parseInt):
(JSC::toStringView):
* runtime/StringPrototype.cpp:

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

3 years agoUnreviewed, try to reduce flakiness to timer throttling tests
cdumez@apple.com [Fri, 24 Feb 2017 03:22:05 +0000 (03:22 +0000)]
Unreviewed, try to reduce flakiness to timer throttling tests

Try to reduce flakiness to timer throttling tests by increasing
tolerance.

* fast/dom/timer-throttling-hidden-page-expected.txt:
* fast/dom/timer-throttling-hidden-page-non-nested-expected.txt:
* fast/dom/timer-throttling-hidden-page-non-nested.html:
* fast/dom/timer-throttling-hidden-page.html:

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

3 years agoREGRESSION(r212542): Make TimeSeriesChart.computeTimeGrid stops x-axis grid prematurely
rniwa@webkit.org [Fri, 24 Feb 2017 03:12:37 +0000 (03:12 +0000)]
REGRESSION(r212542): Make TimeSeriesChart.computeTimeGrid stops x-axis grid prematurely
https://bugs.webkit.org/show_bug.cgi?id=168812

Reviewed by Joseph Pecoraro.

Add time iterator of two months, three months, and four months with some tests.

Also for one-month time iterator, round the day of month to 1 or 15 whichever is closer.

* browser-tests/time-series-chart-tests.js: Added more tests.
* public/v3/components/time-series-chart.js:
(TimeSeriesChart._timeIterators.next):
(TimeSeriesChart._timeIterators):

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

3 years ago[GTK] Layout test imported/w3c/web-platform-tests/html/semantics/embedded-content...
jfernandez@igalia.com [Fri, 24 Feb 2017 03:11:29 +0000 (03:11 +0000)]
[GTK] Layout test imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/track/track-element/track-api-texttracks.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=168799

Unreviewed test gardening.

* platform/gtk/TestExpectations:

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

3 years ago[Modern Media Controls] Enforce a minimum layout height of 50pt for <audio>
commit-queue@webkit.org [Fri, 24 Feb 2017 01:44:40 +0000 (01:44 +0000)]
[Modern Media Controls] Enforce a minimum layout height of 50pt for <audio>
https://bugs.webkit.org/show_bug.cgi?id=168801
<rdar://problem/30683453>

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

Source/WebCore:

We enforce a 50pt minimum layout height for <audio> elements. There is no way
for the page author to override this value since the min-height property is set
as !important in a <style> element contained in a ShadowRoot.

* Modules/modern-media-controls/controls/media-controls.css:
(:host(audio)):

LayoutTests:

Update the existing <audio> metrics test to check that we correctly maintain
a 50pt minimum height even if an inline style attribute sets a shorter height
on an <audio> element, and also check that providing a taller height is respected.

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

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

3 years ago[WebRTC] Outgoing video quality is poor
commit-queue@webkit.org [Fri, 24 Feb 2017 01:00:50 +0000 (01:00 +0000)]
[WebRTC] Outgoing video quality is poor
https://bugs.webkit.org/show_bug.cgi?id=168778
<rdar://problem/30674673>

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

Covered by manually ensuring the voice process thread is not spinning.

* platform/mediastream/libwebrtc/LibWebRTCAudioModule.h: Setting the next call to max was not a good idea since the thread process is adding some value to it, making it a negative value.

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

3 years agoData interaction with a URL should navigate the page if the operation is not handled
wenson_hsieh@apple.com [Thu, 23 Feb 2017 23:38:06 +0000 (23:38 +0000)]
Data interaction with a URL should navigate the page if the operation is not handled
https://bugs.webkit.org/show_bug.cgi?id=168798
<rdar://problem/30665969>

Reviewed by Tim Horton.

Refactors some drag and drop code on the Mac, and implements PlatformPasteboard::stringForType.

* page/DragController.cpp:
(WebCore::DragController::performDragOperation):
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::stringForType):
* platform/mac/DragDataMac.mm:

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

3 years agoSource/WebKit2:
bdakin@apple.com [Thu, 23 Feb 2017 23:33:57 +0000 (23:33 +0000)]
Source/WebKit2:
No reliable way to get a snapshot of WKWebView
https://bugs.webkit.org/show_bug.cgi?id=161450
-and corresponding-
<rdar://problem/23846039>

Patch by Beth Dakin  <bdakin@apple.com> + Dan Saunders <dasau@microsoft.com> on 2017-02-23
Reviewed by Tim Horton.

This patch adds a new API to WKWebView to snapshot a rect:
takeSnapshotWithConfiguration:completionHandler:

It also adds a new API object WKSnapshotConfiguration.

* UIProcess/API/Cocoa/WKSnapshotConfiguration.h: Added.
* UIProcess/API/Cocoa/WKSnapshotConfiguration.mm: Added.
(-[WKSnapshotConfiguration copyWithZone:]):
* UIProcess/API/Cocoa/WKWebView.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView takeSnapshotWithConfiguration:completionHandler:]):
* WebKit2.xcodeproj/project.pbxproj:

Tools:
No reliable way to get a snapshot of WKWebView (macOS)
https://bugs.webkit.org/show_bug.cgi?id=161450
-and corresponding-
<rdar://problem/23846039>

Patch by Beth Dakin  <bdakin@apple.com> + Dan Saunders <dasau@microsoft.com> on 2017-02-23
Reviewed by Tim Horton.

Test for WKWebView’s new API takeSnapshotWithConfiguration:completionHandler:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/WKWebViewSnapshot.mm: Added.
(convertToCGImage):
(getPixelIndex):
(TEST):

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

3 years ago[WebRTC] RealtimeOutgoingAudioSource does not need to upsample audio buffers
commit-queue@webkit.org [Thu, 23 Feb 2017 23:05:45 +0000 (23:05 +0000)]
[WebRTC] RealtimeOutgoingAudioSource does not need to upsample audio buffers
https://bugs.webkit.org/show_bug.cgi?id=168796

Patch by Youenn Fablet <youenn@apple.com> on 2017-02-23
Reviewed by Jer Noble.

Covered by manual testing.
Limiting RealtimeOutgoingAudioSource conversion to interleaving and float-to-integer.
Removed the sample rate conversion.

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

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

3 years agoRe-soft-link CoreVideo after r212906
achristensen@apple.com [Thu, 23 Feb 2017 22:52:55 +0000 (22:52 +0000)]
Re-soft-link CoreVideo after r212906
https://bugs.webkit.org/show_bug.cgi?id=168803

Reviewed by Jer Noble.

CoreVideo should be soft linked to reduce startup time.
Linking against the framework just for a few symbols used in one file was the wrong solution.

* Configurations/WebCore.xcconfig:
* platform/cocoa/CoreVideoSoftLink.cpp:
* platform/cocoa/CoreVideoSoftLink.h:
* platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:

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

3 years agoASSERT in RTCNetwork::IPAddress::decode()
jer.noble@apple.com [Thu, 23 Feb 2017 22:04:43 +0000 (22:04 +0000)]
ASSERT in RTCNetwork::IPAddress::decode()
https://bugs.webkit.org/show_bug.cgi?id=168792

Reviewed by Tim Horton.

An ASSERT added to RTCNetwork::IPAddress::decode in r212781 was hit due to a bad encode of SocketAddress; an
extra boolean value was added to the encoder unnecessarily, leading to garbage data being decoded in the following
IPAddress.

Drive-by-fix: allow the IPAddress encoder/decoder to pass through a value of AF_UNSPEC for an IPAddress to support
passing through an "empty" IPAddress value.

* Shared/RTCNetwork.cpp:
(WebKit::RTCNetwork::IPAddress::decode):
(WebKit::RTCNetwork::IPAddress::encode):
(WebKit::RTCNetwork::SocketAddress::encode):

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

3 years agoAdd tests for InteractiveTimeSeriesChart and adopt actions
rniwa@webkit.org [Thu, 23 Feb 2017 21:39:55 +0000 (21:39 +0000)]
Add tests for InteractiveTimeSeriesChart and adopt actions
https://bugs.webkit.org/show_bug.cgi?id=168750

Reviewed by Chris Dumez.

Added tests for InteractiveTimeSeriesChart.

Also replaced selection.onchange, selection.onzoom, indicator.onchange, annotations.onclick callbacks
by "selectionChange", "zoom", "indicatorChange", and "annotationClick" actions respectively.

Also fixed various bugs and bad code I encountered while writing these tests.

* browser-tests/index.html:
(waitForComponentsToRender): Delay the call to enqueueToRender until the next run loop because there
might be outstanding promises that just got resolved. e.g. for fetching measurement sets JSONs. Let
all those promises get resolved first. Otherwise, some tests become racy.
(canvasImageData): Extracted from time-series-chart-tests.js.
(canvasRefTest): Ditto.
(CanvasTest): Ditto.
(CanvasTest.fillCanvasBeforeRedrawCheck): Ditto.
(CanvasTest.hasCanvasBeenRedrawn): Ditto.
(CanvasTest.canvasImageData): Ditto.
(CanvasTest.expectCanvasesMatch): Ditto.
(CanvasTest.expectCanvasesMismatch): Ditto.

* browser-tests/time-series-chart-tests.js: Fixed some test cases where dpr multipler was not doing
the right thing anymore in Safari under a high DPI screen. Also added a lot of test cases for interactive
time series chart and one for rendering annotations.
(scripts): Moved.
(posixTime): Added. A helper function for sampleCluster.
(dayInMilliseconds): Ditto.
(sampleCluster): Moved here. Made the same cluster more artifical for an easier testing.
(createChartWithSampleCluster): Moved out of one of the tests.
(respondWithSampleCluster): Ditto.

* public/v3/components/chart-pane-base.js:
(ChartPaneBase.prototype.configure): Adopted new actions in InteractiveTimeSeriesChart.

* public/v3/components/chart-status-view.js:
(ChartStatusView.prototype.updateStatusIfNeeded): Removed a superflous console.log.

* public/v3/components/chart-styles.js:
(ChartStyles.mainChartOptions): Set zoomButton to true. InteractiveTimeSeriesChart used to determine
whether to show the zoom button or not based on the precense of the zoom callback. We made it explicit.

* public/v3/components/interactive-time-series-chart.js:
(InteractiveTimeSeriesChart.prototype.setIndicator): Explicitly call _notifySelectionChanged with false
instead of relying on undefined to be treated as falsey.
(InteractiveTimeSeriesChart.prototype._createCanvas): Use id instead of selector to find elements.
(InteractiveTimeSeriesChart.htmlTemplate):
(InteractiveTimeSeriesChart.cssTemplate):
(InteractiveTimeSeriesChart.prototype._mouseMove): Explicitly call _startOrContinueDragging with false
instead of relying on undefined treated as falsey. Also added the missing call to enqueueToRender found
by new tests. This was working fine on the dashboard due to other components invoking enqueueToRender
but won't work in a standalone instance of InteractiveTimeSeriesChart.
(InteractiveTimeSeriesChart.prototype._mouseLeave): Ditto, adding the missing call to enqueueToRender.
(InteractiveTimeSeriesChart.prototype._click): Removed the assignment to _forceRender when calling
_mouseMove in an early exist, which does set this flag and invokes enqueueToRender, and added the missing
call to enqueueToRender in the other code path.
(InteractiveTimeSeriesChart.prototype._startOrContinueDragging): Replaced annotations.onclick callback
by the newly added "annotationClick" action, and added the missing call to enqueueToRender.
(InteractiveTimeSeriesChart.prototype._endDragging): Use arrow function.
(InteractiveTimeSeriesChart.prototype._notifyIndicatorChanged): Replaced indicator.onchange callback by
the newly added "indicatorChange" action.
(InteractiveTimeSeriesChart.prototype._notifySelectionChanged): Replaced selection.onchange callback by
the newly added "selectionChange" action.
(InteractiveTimeSeriesChart.prototype._renderChartContent): Show the zoom button when options.zoomButton
is set instead of relying on the presence of selection.onzoom especially now that the callback has been
replaced by the "zoom" action.

* public/v3/components/time-series-chart.js:
(TimeSeriesChart.prototype.setAnnotations): Added the missing call to enqueueToRender.

* public/v3/main.js:

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

3 years agoWebAssembly: support 0x1 version
jfbastien@apple.com [Thu, 23 Feb 2017 21:36:13 +0000 (21:36 +0000)]
WebAssembly: support 0x1 version
https://bugs.webkit.org/show_bug.cgi?id=168672

Reviewed by Keith Miller.

JSTests:

Update the version number for all the tests. Note that the spec
tests are only updated with a new version number because spec+wabt
aren't ready for 0x1 yet. This is tracked by bug #168784.

* wasm/import-spec-tests.rb: use the new spec repository layout
* wasm/js-api/test_basic_api.js:
* wasm/self-test/test_BuilderWebAssembly.js:
(EmptyModule):
(CustomSection):
* wasm/spec-tests/address.wast.js:
* wasm/spec-tests/binary.wast.js:
* wasm/spec-tests/block.wast.js:
* wasm/spec-tests/br.wast.js:
* wasm/spec-tests/br_if.wast.js:
* wasm/spec-tests/br_table.wast.js:
* wasm/spec-tests/break-drop.wast.js:
* wasm/spec-tests/call.wast.js:
* wasm/spec-tests/call_indirect.wast.js:
* wasm/spec-tests/comments.wast.js:
* wasm/spec-tests/conversions.wast.js:
* wasm/spec-tests/custom_section.wast.js:
* wasm/spec-tests/endianness.wast.js:
* wasm/spec-tests/exports.wast.js:
* wasm/spec-tests/f32.wast.js:
* wasm/spec-tests/f32_cmp.wast.js:
* wasm/spec-tests/f64.wast.js:
* wasm/spec-tests/f64_cmp.wast.js:
* wasm/spec-tests/fac.wast.js:
* wasm/spec-tests/float_exprs.wast.js:
* wasm/spec-tests/float_literals.wast.js:
* wasm/spec-tests/float_memory.wast.js:
* wasm/spec-tests/float_misc.wast.js:
* wasm/spec-tests/forward.wast.js:
* wasm/spec-tests/func.wast.js:
* wasm/spec-tests/func_ptrs.wast.js:
* wasm/spec-tests/get_local.wast.js:
* wasm/spec-tests/globals.wast.js:
* wasm/spec-tests/i32.wast.js:
* wasm/spec-tests/i64.wast.js:
* wasm/spec-tests/imports.wast.js:
* wasm/spec-tests/int_exprs.wast.js:
* wasm/spec-tests/int_literals.wast.js:
* wasm/spec-tests/left-to-right.wast.js:
* wasm/spec-tests/linking.wast.js:
* wasm/spec-tests/loop.wast.js:
* wasm/spec-tests/memory.wast.js:
* wasm/spec-tests/memory_redundancy.wast.js:
* wasm/spec-tests/memory_trap.wast.js:
* wasm/spec-tests/names.wast.js:
* wasm/spec-tests/nop.wast.js:
* wasm/spec-tests/resizing.wast.js:
* wasm/spec-tests/return.wast.js:
* wasm/spec-tests/select.wast.js:
* wasm/spec-tests/set_local.wast.js:
* wasm/spec-tests/skip-stack-guard-page.wast.js:
* wasm/spec-tests/stack.wast.js:
* wasm/spec-tests/start.wast.js:
* wasm/spec-tests/store_retval.wast.js:
* wasm/spec-tests/switch.wast.js:
* wasm/spec-tests/tee_local.wast.js:
* wasm/spec-tests/traps.wast.js:
* wasm/spec-tests/typecheck.wast.js:
* wasm/spec-tests/unreachable.wast.js:
* wasm/spec-tests/unwind.wast.js:
* wasm/wasm.json:

Source/JavaScriptCore:

* wasm/wasm.json: update the version number, everything is based
on its value

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

3 years agoMake Briggs fixpoint validation run only with validateGraphAtEachPhase
sbarati@apple.com [Thu, 23 Feb 2017 21:25:15 +0000 (21:25 +0000)]
Make Briggs fixpoint validation run only with validateGraphAtEachPhase
https://bugs.webkit.org/show_bug.cgi?id=168795

Rubber stamped by Keith Miller.

The Briggs allocator was running intensive validation
on each step of the fixpoint. Instead, it now will just
do it when shouldValidateIRAtEachPhase() is true because
doing this for all !ASSERT_DISABLED builds takes too long.

* b3/air/AirAllocateRegistersByGraphColoring.cpp:

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

3 years agoReport domains using abnormally high CPU usage via enhanced privacy logging
cdumez@apple.com [Thu, 23 Feb 2017 20:56:54 +0000 (20:56 +0000)]
Report domains using abnormally high CPU usage via enhanced privacy logging
https://bugs.webkit.org/show_bug.cgi?id=168794
<rdar://problem/29964018>

Reviewed by Ryosuke Niwa.

Report domains using abnormally high CPU usage (> 20%) via enhanced privacy
logging.

* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::domainCausingEnergyDrainKey):
* page/DiagnosticLoggingKeys.h:
* page/PerformanceMonitor.cpp:
(WebCore::reportPageOverPostLoadCPUUsageThreshold):
(WebCore::PerformanceMonitor::measurePostLoadCPUUsage):

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

3 years ago[WebRTC][Mac][WebKit2] WebRTC requires media capture
eric.carlson@apple.com [Thu, 23 Feb 2017 20:39:46 +0000 (20:39 +0000)]
[WebRTC][Mac][WebKit2] WebRTC requires media capture
https://bugs.webkit.org/show_bug.cgi?id=168782
<rdar://problem/30675242>

Reviewed by Youenn Fablet.

* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess): Extend the sanbox to allow microphone access
if media stream OR WebRTC is enabled.

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

3 years agoVersioning.
matthew_hanson@apple.com [Thu, 23 Feb 2017 20:32:26 +0000 (20:32 +0000)]
Versioning.

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

3 years agoWeb Inspector: RTL: DOM Tree spacing is wrong
commit-queue@webkit.org [Thu, 23 Feb 2017 20:24:10 +0000 (20:24 +0000)]
Web Inspector: RTL: DOM Tree spacing is wrong
https://bugs.webkit.org/show_bug.cgi?id=168744

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

* UserInterface/Base/Utilities.js:
(Element.prototype.totalOffsetRight):

* UserInterface/Views/DOMTreeOutline.css:
(.tree-outline.dom):
(.tree-outline.dom ol):
(body[dir=ltr] .tree-outline.dom ol):
(body[dir=rtl] .tree-outline.dom ol):
(.tree-outline.dom li:matches(.hovered, .selected) + ol.children.expanded):
(body[dir=ltr] .tree-outline.dom li:matches(.hovered, .selected) + ol.children.expanded):
(body[dir=rtl] .tree-outline.dom li:matches(.hovered, .selected) + ol.children.expanded):
(.tree-outline.dom li.selected + ol.children.expanded):
(.tree-outline.dom li):
(body[dir=ltr] .tree-outline.dom li):
(body[dir=rtl] .tree-outline.dom li):
(.tree-outline.dom li.pseudo-class-enabled > .selection-area::before):
(body[dir=rtl] .tree-outline.dom li.pseudo-class-enabled > .selection-area::before):
(body[dir=ltr] .tree-outline.dom.single-node li):
(body[dir=rtl] .tree-outline.dom.single-node li):
(.tree-outline.dom li.parent):
(body[dir=ltr] .tree-outline.dom li.parent):
(body[dir=rtl] .tree-outline.dom li.parent):
(body[dir=ltr] .tree-outline.dom li .html-tag.close):
(body[dir=rtl] .tree-outline.dom li .html-tag.close):
(.tree-outline.dom li.parent::before):
(body[dir=rtl] .tree-outline.dom li.parent::before):
(body[dir=ltr] .tree-outline.dom li.parent::before):
(.tree-outline.dom li.parent.shadow::after):
(body[dir=ltr] .tree-outline.dom li.parent.shadow::after):
(body[dir=rtl] .tree-outline.dom li.parent.shadow::after):
(.tree-outline.dom.single-node li): Deleted.
(.tree-outline.dom li .html-tag.close): Deleted.

* UserInterface/Views/TreeElement.js:
(WebInspector.TreeElement.prototype.isEventWithinDisclosureTriangle):
Calculate the position of the ::before triangle based on the layout direction.

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

3 years agoSimple line layout: Adjust RunResolver::lineIndexForHeight with line struts.
zalan@apple.com [Thu, 23 Feb 2017 20:12:23 +0000 (20:12 +0000)]
Simple line layout: Adjust RunResolver::lineIndexForHeight with line struts.
https://bugs.webkit.org/show_bug.cgi?id=168783
<rdar://problem/30676449>

Reviewed by Antti Koivisto.

When there's a pagination gap between lines the simple lineIndex = y / lineHeight formula does not work anymore.
This patch takes the line gaps into account by offsetting the y position accordingly.

Not enabled yet.

* rendering/SimpleLineLayoutResolver.cpp:
(WebCore::SimpleLineLayout::RunResolver::lineIndexForHeight):

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

3 years agoSpeculative fix for jsc timing out tests
sbarati@apple.com [Thu, 23 Feb 2017 19:56:56 +0000 (19:56 +0000)]
Speculative fix for jsc timing out tests
https://bugs.webkit.org/show_bug.cgi?id=168791

Rubber Stamped by Keith Miller.

Play musical chairs with IRC and Briggs options on
ftl-eager and ftl-eager-no-cjit.

* Scripts/run-jsc-stress-tests:

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

3 years agoWeb Inspector: RTL: navigation sidebar section disclosure triangles and tree element...
commit-queue@webkit.org [Thu, 23 Feb 2017 19:55:10 +0000 (19:55 +0000)]
Web Inspector: RTL: navigation sidebar section disclosure triangles and tree element icons should be aligned right
https://bugs.webkit.org/show_bug.cgi?id=168284

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

* UserInterface/Views/TreeOutline.css:
(.tree-outline,):
(.tree-outline.large .item):
(body[dir=ltr] .tree-outline .item :matches(.disclosure-button, .icon)):
(body[dir=rtl] .tree-outline .item :matches(.disclosure-button, .icon)):
(body[dir=ltr] .tree-outline:not(.hide-disclosure-buttons) .item:not(.parent) > .icon):
(body[dir=rtl] .tree-outline:not(.hide-disclosure-buttons) .item:not(.parent) > .icon):
(.tree-outline .item .disclosure-button):
(body[dir=rtl] .tree-outline .item .disclosure-button):
(.tree-outline .item .icon):
(body[dir=ltr] .tree-outline .item .icon):
(body[dir=rtl] .tree-outline .item .icon):
(.tree-outline.large .item .icon):
(.tree-outline .item .status):
(body[dir=ltr] .tree-outline .item .status):
(body[dir=rtl] .tree-outline .item .status):
(.tree-outline:not(.hide-disclosure-buttons) .item:not(.parent) > .icon): Deleted.

* UserInterface/Views/TreeOutline.js:
(WebInspector.TreeOutline._generateStyleRulesIfNeeded):

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

3 years agoSpeculativeJIT::compilePutByValForIntTypedArray should only do the constant-folding...
fpizlo@apple.com [Thu, 23 Feb 2017 19:47:32 +0000 (19:47 +0000)]
SpeculativeJIT::compilePutByValForIntTypedArray should only do the constant-folding optimization when the constant passes the type check
https://bugs.webkit.org/show_bug.cgi?id=168787

Reviewed by Michael Saboff and Mark Lam.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray):

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

3 years agoEnsure that the end of the last invalidation point does not extend beyond the end...
mark.lam@apple.com [Thu, 23 Feb 2017 19:42:58 +0000 (19:42 +0000)]
Ensure that the end of the last invalidation point does not extend beyond the end of the buffer.
https://bugs.webkit.org/show_bug.cgi?id=168786

Reviewed by Filip Pizlo.

In practice, we will always have multiple instructions after invalidation points,
and have enough room in the JIT buffer for the invalidation point to work with.
However, as a precaution, we can guarantee that there's enough room by always
emitting a label just before we link the buffer.  The label will emit nop padding
if needed.

* assembler/LinkBuffer.cpp:
(JSC::LinkBuffer::linkCode):

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

3 years agoAdd WebRTC to experimental-features.html
achristensen@apple.com [Thu, 23 Feb 2017 19:25:10 +0000 (19:25 +0000)]
Add WebRTC to experimental-features.html
https://bugs.webkit.org/show_bug.cgi?id=168757

Reviewed by Tim Horton.

* experimental-features.html:

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

3 years agoFix iOS WebRTC build after r212812
achristensen@apple.com [Thu, 23 Feb 2017 19:22:34 +0000 (19:22 +0000)]
Fix iOS WebRTC build after r212812
https://bugs.webkit.org/show_bug.cgi?id=168790

Reviewed by Tim Horton.

* Configurations/WebCore.xcconfig:

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

3 years agoImprove error message when the WPT server fails to start.
clopez@igalia.com [Thu, 23 Feb 2017 19:04:33 +0000 (19:04 +0000)]
Improve error message when the WPT server fails to start.
https://bugs.webkit.org/show_bug.cgi?id=168759

Reviewed by Ryosuke Niwa.

Check if the WPT server is running after 1 second, and if is not
print useful information for helping the user to debug the issue.

Using check_running_pid() to check if the process is still running
doesn't work. A process started via subprocess popen that has ended
will be in a zombie state until a call to wait/communicate/poll
is done, or until the object is deleted or garbage collected.

This adds also support for testing the behaviour of subprocess
poll() on the unit tests that use MockProcess.

A new test is added also for the battery of tests for the WPT
server.

* Scripts/webkitpy/common/system/executive_mock.py:
(MockProcess.__init__):
(MockProcess.wait):
(MockProcess.communicate):
(MockProcess.poll):
(MockExecutive.popen):
* Scripts/webkitpy/layout_tests/servers/web_platform_test_server.py:
(WebPlatformTestServer.__init__):
(WebPlatformTestServer._prepare_config):
(WebPlatformTestServer._spawn_process):
* Scripts/webkitpy/layout_tests/servers/web_platform_test_server_unittest.py:
(TestWebPlatformTestServer.test_corrupted_subserver_files):
(TestWebPlatformTestServer):
(TestWebPlatformTestServer.test_server_fails_to_start_throws_exception):

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

3 years ago[Mac] Remove unneeded sandbox exceptions for media elements
bfulgham@apple.com [Thu, 23 Feb 2017 19:01:29 +0000 (19:01 +0000)]
[Mac] Remove unneeded sandbox exceptions for media elements
https://bugs.webkit.org/show_bug.cgi?id=168767

Reviewed by Alex Christensen.

Remove several sandbox exceptions that have not been needed for the past four
or five macOS releases.

* WebProcess/com.apple.WebProcess.sb.in:

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

3 years agoMove instance member from WebFixedPositionContent to implementation file
aakash_jain@apple.com [Thu, 23 Feb 2017 19:00:46 +0000 (19:00 +0000)]
Move instance member from WebFixedPositionContent to implementation file
https://bugs.webkit.org/show_bug.cgi?id=168766

Reviewed by Tim Horton.

* WebCoreSupport/WebFixedPositionContent.h: Moving instance member to implementation file.
* WebCoreSupport/WebFixedPositionContent.mm: Ditto.

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

3 years ago[Mac] Remove com.apple.audio.VDCAssistant from sandboxes
bfulgham@apple.com [Thu, 23 Feb 2017 18:59:19 +0000 (18:59 +0000)]
[Mac] Remove com.apple.audio.VDCAssistant from sandboxes
https://bugs.webkit.org/show_bug.cgi?id=168764
<rdar://problem/16736919>

Reviewed by Alex Christensen.

Remove unneeded sandbox class.

* PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
* WebProcess/com.apple.WebProcess.sb.in:

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

3 years agoUnreviewed, temporarily disable DataInteractionTests in TestWebKitAPI.
wenson_hsieh@apple.com [Thu, 23 Feb 2017 18:25:47 +0000 (18:25 +0000)]
Unreviewed, temporarily disable DataInteractionTests in TestWebKitAPI.

These will be reenabled in https://bugs.webkit.org/show_bug.cgi?id=168602.

* TestWebKitAPI/Tests/ios/DataInteractionTests.mm:

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

3 years agoUnreviewed, fix the cloop build. Needed a #if.
keith_miller@apple.com [Thu, 23 Feb 2017 18:20:10 +0000 (18:20 +0000)]
Unreviewed, fix the cloop build. Needed a #if.

* jit/ExecutableAllocator.cpp:

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

3 years agoFixed saving survey data
jond@apple.com [Thu, 23 Feb 2017 18:18:11 +0000 (18:18 +0000)]
Fixed saving survey data
https://bugs.webkit.org/show_bug.cgi?id=168730

Reviewed by Joseph Pecoraro.

* wp-content/themes/webkit/functions.php:

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

3 years agoData interaction causes selection to fall out of sync between web/UI processes
wenson_hsieh@apple.com [Thu, 23 Feb 2017 17:23:51 +0000 (17:23 +0000)]
Data interaction causes selection to fall out of sync between web/UI processes
https://bugs.webkit.org/show_bug.cgi?id=168735
<rdar://problem/30657817>

Reviewed by Tim Horton.

Source/WebKit2:

Fixes a bug with data interaction causing selection state to fall out of sync between the UI and web processes,
and also introduces testing infrastructure and tests for grabbing UI-side selection view rects in TestWebKitAPI.
While performing a data interaction operation, we now lift restrictions for assisting the focused node.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView cleanupInteraction]):
(-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]):

Tools:

Adds a new method to TestWKWebView for querying selection view rects from the UI process and augments data
interaction unit tests to check for selection rects using this new hook.

* TestWebKitAPI/Tests/ios/DataInteractionTests.mm:
(makeCGRectValue):
(TestWebKitAPI::TEST):
* TestWebKitAPI/cocoa/TestWKWebView.h:
* TestWebKitAPI/cocoa/TestWKWebView.mm:
(-[TestWKWebView selectionRectsAfterPresentationUpdate]):
* TestWebKitAPI/ios/DataInteractionSimulator.h:
* TestWebKitAPI/ios/DataInteractionSimulator.mm:
(-[DataInteractionSimulator _resetSimulatedState]):
(-[DataInteractionSimulator runFrom:to:]):
(-[DataInteractionSimulator finalSelectionRects]):

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

3 years ago[GTK] Crash attempting to load Flash plugin in Wayland
carlosgc@webkit.org [Thu, 23 Feb 2017 16:47:04 +0000 (16:47 +0000)]
[GTK] Crash attempting to load Flash plugin in Wayland
https://bugs.webkit.org/show_bug.cgi?id=163159

Reviewed by Michael Catanzaro.

The problem is that we check if the current diplay is X11 or Wayland also in the plugin process, but with GTK2
plugins the display is always X11. We should early reject plugins requiring GTK2 in the UI process when the
current display is Wayland.

* UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
(WebKit::PluginInfoStore::getPluginInfo):
* UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
(WebKit::PluginProcessProxy::scanPlugin):
* UIProcess/gtk/WebPageProxyGtk.cpp:
(WebKit::WebPageProxy::createPluginContainer): Add an assert to ensure this message is never received on a
non-X11 display.
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::createPluginContainer): Never send CreatePluginContainer message to the UI process if the
display is not X11.

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

3 years ago[GTK] Gardening of some flaky tests
clopez@igalia.com [Thu, 23 Feb 2017 16:39:37 +0000 (16:39 +0000)]
[GTK] Gardening of some flaky tests

Unreviewed.

* platform/gtk/TestExpectations: Update some expectations or add new cases of flaky tests.

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

3 years ago[GStreamer] Several layout tests trigger GStreamer-CRITICAL **: gst_bin_get_by_name...
carlosgc@webkit.org [Thu, 23 Feb 2017 16:28:47 +0000 (16:28 +0000)]
[GStreamer] Several layout tests trigger GStreamer-CRITICAL **: gst_bin_get_by_name: assertion 'GST_IS_BIN (bin)' failed
https://bugs.webkit.org/show_bug.cgi?id=167016

Reviewed by Xabier Rodriguez-Calvar.

This is because we create AudioSourceProviderGStreamer objects that are never loaded. In the destructor the
AudioSourceProviderGStreamer calls gst_bin_get_by_name() on its m_audioSinkBin that is nullptr. We could simply
check m_audioSinkBin in the destructor, but I think it's better to simply not create
AudioSourceProviderGStreamer for nothing. MediaPlayerPrivateGStreamer should create the AudioSourceProvider on demand.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer): Do not create the AudioSourceProvider.
(WebCore::MediaPlayerPrivateGStreamer::createAudioSink): Call ensureAudioSourceProvider() before using m_audioSourceProvider.
(WebCore::MediaPlayerPrivateGStreamer::ensureAudioSourceProvider): Create the AudioSourceProvider if needed.
(WebCore::MediaPlayerPrivateGStreamer::audioSourceProvider): Ensure and return the m_audioSourceProvider.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:

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

3 years ago[GTK] MediaStream and WebRTC layout test gardening
clopez@igalia.com [Thu, 23 Feb 2017 15:54:46 +0000 (15:54 +0000)]
[GTK] MediaStream and WebRTC layout test gardening

Unreviewed.

* TestExpectations: Clarify some comments.
* platform/gtk/TestExpectations: Unskip most of the MediaStream / WebRTC tests for GTK and mark the expected failures accordingly.
* platform/gtk/fast/mediastream/RTCPeerConnection-more-media-to-negotiate-expected.txt: Removed. The test passes on GTK with the
general test expectation.

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

3 years ago[MediaStream iOS] Allow web process sandbox to be extended for media capture
eric.carlson@apple.com [Thu, 23 Feb 2017 15:13:16 +0000 (15:13 +0000)]
[MediaStream iOS] Allow web process sandbox to be extended for media capture
https://bugs.webkit.org/show_bug.cgi?id=168756

Reviewed by Brent Fulgham.

* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: Add rules to dynamically
extend the sandbox to allow access to the camera and/or microphone.

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

3 years ago[GTK] Compilation fails if using ninja together with icecream and cmake > 3.5
tpopela@redhat.com [Thu, 23 Feb 2017 11:27:10 +0000 (11:27 +0000)]
[GTK] Compilation fails if using ninja together with icecream and cmake > 3.5
https://bugs.webkit.org/show_bug.cgi?id=168770

Reviewed by Carlos Garcia Campos.

If using cmake >= 3.6 together with ninja generator and icecream, the
build will fail as icecream does not correctly handle the response
files and it's not passing compiler flags from there to the compiler
itself (in our case it's not passing -fPIC which leads to the
failure while linking). Don't enable the ninja's response files
support if we fulfill the preconditions.

* Source/cmake/OptionsCommon.cmake:

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

3 years ago[GTK] Drag and drop is always moving the content even if copy is requested
tpopela@redhat.com [Thu, 23 Feb 2017 11:24:17 +0000 (11:24 +0000)]
[GTK] Drag and drop is always moving the content even if copy is requested
https://bugs.webkit.org/show_bug.cgi?id=168424

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Drag and drop is always moving the content around even if the copy is
requested (i.e. by pressing the Control key).

Test: editing/pasteboard/drag-drop-copy-content.html

* page/gtk/DragControllerGtk.cpp:
(WebCore::DragController::isCopyKeyDown):

Source/WebKit2:

Drag and drop is always moving the content around even if the copy is
requested (i.e. by pressing the Control key).

* UIProcess/gtk/DragAndDropHandler.cpp:
(WebKit::DragAndDropHandler::drop):

LayoutTests:

Mark the editing/pasteboard/drag-drop-copy-content.html as failing
as WTR doesn't know how to perform drag and drop in WK2. Also the
test does not pass on the mac WK1, created a bug for it.

* platform/efl/TestExpectations:
* platform/gtk-wayland/TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac-wk2/TestExpectations:
* platform/mac/TestExpectations:

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

3 years agoMove instance members from WebPDFView to implementation file
aakash_jain@apple.com [Thu, 23 Feb 2017 07:24:22 +0000 (07:24 +0000)]
Move instance members from WebPDFView to implementation file
https://bugs.webkit.org/show_bug.cgi?id=168765

Reviewed by Tim Horton.

* WebView/WebPDFViewIOS.h: Moving instance members to implementation file.
* WebView/WebPDFViewIOS.mm: Ditto.

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

3 years agoExport Objective-C symbols for variables in Webkit SPI
aakash_jain@apple.com [Thu, 23 Feb 2017 07:19:19 +0000 (07:19 +0000)]
Export Objective-C symbols for variables in Webkit SPI
https://bugs.webkit.org/show_bug.cgi?id=168758

Reviewed by Alexey Proskuryakov.

Source/WebKit:

* WebKit.xcodeproj/project.pbxproj: Generating separate .exp file for i386 without _OBJC_IVAR symbols.

Source/WebKit/mac:

* Configurations/WebKitLegacy.xcconfig: using separate .exp file for i386.
* WebKit.exp: Added various Objective-C symbols.

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

3 years agoBetter handle Thread and RunLoop initialization
carlosgc@webkit.org [Thu, 23 Feb 2017 07:10:54 +0000 (07:10 +0000)]
Better handle Thread and RunLoop initialization
https://bugs.webkit.org/show_bug.cgi?id=167828

Reviewed by Yusuke Suzuki.

Source/JavaScriptCore:

* runtime/InitializeThreading.cpp:
(JSC::initializeThreading): Do not initialize double_conversion, that is already initialized by WTF, and GC
threads that will be initialized by WTF main thread when needed.

Source/WebKit/win:

Remove unnecessary call to WTF::initializeMainThread().

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

Source/WebKit2:

Remove unnecessary call to WTF::initializeMainThread().

* Shared/WebKit2Initialize.cpp:
(WebKit::InitializeWebKit2):

Source/WTF:

Make initialization functions more independent so that they can run in different
order. WTF::initializeMainThread initializes WTF threading, so that neither WTF nor JSC theading need to be
initialized before. RunLoop::initializeMainRunLoop() requires main thread to be initialized in some
ports, so it initializes main thread too. WebKit1 always calls WTF::initializeMainThreadToProcessMainThread()
before RunLoop::initializeMainRunLoop() so there's no problem there. GC threads are initialized alwayas by the
main thread. The rules should be simpler now:

  - JSC::initializeThreading: should always be called when JSC is used.
  - WTF::initializeThreading: only needs to be explicitly called when JSC is not used and process doesn't
    initialize a main thread or main run loop.
  - WTF::initializeMainThread: only needs to be explicitly called if process initializes a main thread but not a
    main run loop.
  - WTF::initializeMainThreadToProcessMainThread(): should always be called in WebKit1 before
    RunLoop::initializeMainRunLoop().
  - RunLoop::initializeMainRunLoop(): to initialize the main run loop. The only requirement is JSC::initializeThreading()
    to be called before if JSC is used.

* wtf/MainThread.cpp:
(WTF::initializeMainThreadOnce): Use pthread_once to initialize the main thread also in GTK+ port.
(WTF::initializeMainThreadToProcessMainThreadOnce): Call initializeThreading() before the platform
initialization and initializeGCThreads() after it.
(WTF::initializeMainThread): Ditto.
* wtf/RunLoop.cpp:
(WTF::RunLoop::initializeMainRunLoop): Call initializeMainThread().
* wtf/glib/MainThreadGLib.cpp:
(WTF::initializeMainThreadPlatform):
(WTF::isMainThread):
* wtf/mac/MainThreadMac.mm:
(WTF::initializeMainThreadPlatform): Remove call to initializeGCThreads().
(WTF::initializeMainThreadToProcessMainThreadPlatform): Ditto.

Tools:

Remove unnecessary calls to WTF::initializeMainThread().

* TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp:
(TestWebKitAPI::ComplexTextControllerTest::SetUp):
* TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:
(TestWebKitAPI::ContentExtensionTest::SetUp):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::initialize):

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

3 years agoWebAssembly: clear out insignificant i32 bits when calling JavaScript
jfbastien@apple.com [Thu, 23 Feb 2017 06:35:50 +0000 (06:35 +0000)]
WebAssembly: clear out insignificant i32 bits when calling JavaScript
https://bugs.webkit.org/show_bug.cgi?id=166677

Reviewed by Keith Miller.

When WebAssembly calls JavaScript it needs to clear out the
insignificant bits of int32 values:

  +------------------- tag
  |  +---------------- insignificant
  |  |   +------------ 32-bit integer value
  |  |   |
  |--|---|-------|
0xffff0000ffffffff

At least some JavaScript code assumes that these bits are all
zero. In the wasm-to-wasm.js example we store a 64-bit value in an
object with lo / hi fields, each containing 32-bit integers. We
then load these back, and the baseline compiler fails its
comparison because it first checks the value are the same type
(yes, because the int32 tag is set in both), and then whether they
have the same value (no, because comparing the two registers
fails). We could argue that the baseline compiler is wrong for
performing a 64-bit comparison, but it doesn't really matter
because there's not much of a point in breaking that invariant for
WebAssembly's sake.

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

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

3 years ago[Cocoa] Remove Yosemite-specific font lookup code
mmaxfield@apple.com [Thu, 23 Feb 2017 06:11:02 +0000 (06:11 +0000)]
[Cocoa] Remove Yosemite-specific font lookup code
https://bugs.webkit.org/show_bug.cgi?id=168682

Reviewed by Zalan Bujtas.

Source/WebCore:

No new tests because there is no behavior change.

* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::platformFontLookupWithFamily):
(WebCore::fontWithFamily):
* platform/graphics/mac/FontCacheMac.mm:
(WebCore::platformInvalidateFontCache):
(WebCore::acceptableChoice): Deleted.
(WebCore::betterChoice): Deleted.
(WebCore::desiredFamilyToAvailableFamilyMap): Deleted.
(WebCore::hasDesiredFamilyToAvailableFamilyMapping): Deleted.
(WebCore::rememberDesiredFamilyToAvailableFamilyMapping): Deleted.
(WebCore::toAppKitFontWeight): Deleted.
(WebCore::appkitWeightToFontWeight): Deleted.
(WebCore::toNSFontTraits): Deleted.
(WebCore::platformFontWithFamily): Deleted.

Source/WTF:

* wtf/Platform.h:

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(fontWhitelist):
(adjustFonts):
(createWebViewAndOffscreenWindow):
(drt_NSFontManager_availableFontFamilies): Deleted.
(drt_NSFontManager_availableFonts): Deleted.
(swizzleNSFontManagerMethods): Deleted.
* WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm:
(WTR::activateFonts):
(WTR::allowedFontFamilySet): Deleted.
(WTR::systemHiddenFontFamilySet): Deleted.
(WTR::wtr_NSFontManager_availableFontFamilies): Deleted.
(WTR::wtr_NSFontManager_availableFonts): Deleted.
(WTR::swizzleNSFontManagerMethods): Deleted.
* WebKitTestRunner/mac/TestControllerMac.mm:
(WTR::generateWhitelist):
(WTR::TestController::platformInitializeContext):

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

3 years agoAdd GTK+ build instruction to ReadMe.md
rniwa@webkit.org [Thu, 23 Feb 2017 04:43:46 +0000 (04:43 +0000)]
Add GTK+ build instruction to ReadMe.md
https://bugs.webkit.org/show_bug.cgi?id=168745

Reviewed by Michael Catanzaro.

Add instructions to build GTK+ port.

Removed the instruction to set the default configuration since that didn't seem important.

* ReadMe.md:

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

3 years agoExport m_isLoggingEnabled symbol from MemoryMeasure.h
aakash_jain@apple.com [Thu, 23 Feb 2017 03:41:09 +0000 (03:41 +0000)]
Export m_isLoggingEnabled symbol from MemoryMeasure.h
https://bugs.webkit.org/show_bug.cgi?id=168760

Reviewed by Alexey Proskuryakov.

* WebKit.iOS.exp: Exporting m_isLoggingEnabled symbol.

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

3 years agoUnreviewed, drop console logging landed by mistake as part of r212832.
cdumez@apple.com [Thu, 23 Feb 2017 02:57:14 +0000 (02:57 +0000)]
Unreviewed, drop console logging landed by mistake as part of r212832.

* UIProcess/BackgroundProcessResponsivenessTimer.cpp:
(WebKit::BackgroundProcessResponsivenessTimer::timerFired):

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

3 years ago[Modern Media Controls] Clicking on the video doesn't toggle playback state in fullsc...
commit-queue@webkit.org [Thu, 23 Feb 2017 02:55:59 +0000 (02:55 +0000)]
[Modern Media Controls] Clicking on the video doesn't toggle playback state in fullscreen on macOS
https://bugs.webkit.org/show_bug.cgi?id=168755
<rdar://problem/30664484>

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

Source/WebCore:

We now call super in the handleEvent() method of MacOSFullscreenMediaControls if we're not dealing
with an event type and target combination that was specifically registered in this class's scope.
We had mistakenly added the call to super.handleEvent(event) in the wrong method when fixing
https://bugs.webkit.org/show_bug.cgi?id=168515.

Test: media/modern-media-controls/media-controller/media-controller-click-on-video-background-should-pause-fullscreen.html

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

LayoutTests:

Add a dedicated test for fullscreen to check that clicking on the video correctly toggles playback.

* media/modern-media-controls/media-controller/media-controller-click-on-video-background-should-pause-fullscreen-expected.txt: Added.
* media/modern-media-controls/media-controller/media-controller-click-on-video-background-should-pause-fullscreen.html: Added.
* platform/ios-simulator/TestExpectations:

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

3 years ago[Mac] Tighten sandbox to deny process-info* access
bfulgham@apple.com [Thu, 23 Feb 2017 01:58:50 +0000 (01:58 +0000)]
[Mac] Tighten sandbox to deny process-info* access
https://bugs.webkit.org/show_bug.cgi?id=168704
<rdar://problem/16371441>

Reviewed by Alex Christensen.

Tighten the various WebKit sandboxes by denying access to process-info.
Add back specific features needed to run WebKit tests and to do browsing
of websites (including plugins).

* DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
* PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
* WebProcess/com.apple.WebProcess.sb.in:

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

3 years ago[Modern Media Controls] Scrubber stops moving while scrubbing on macOS
graouts@webkit.org [Thu, 23 Feb 2017 01:55:05 +0000 (01:55 +0000)]
[Modern Media Controls] Scrubber stops moving while scrubbing on macOS
https://bugs.webkit.org/show_bug.cgi?id=168518
<rdar://problem/30577637>

Reviewed by Dean Jackson.

Source/WebCore:

As we start to scrub, controlValueWillStartChanging() is called on
ScrubberSupport and pauses the media if it's not already paused. This
causes the play/pause button to change icon and for layout() to be
called on MacOSInlineMediaControls. This in turns sets the .children
property on the .controlsBar and eventually yields a DOM manipulation
which re-inserts the scrubber's DOM hierarchy, causing stutters during
user interaction.

Our solution is to make the .children setter smarter about identifying
that the children list hasn't changed and that no DOM invalidation is
necessary.

* Modules/modern-media-controls/controls/layout-node.js:
(LayoutNode.prototype.set children):

LayoutTests:

Add assertions to check that setting children to a copy of itself doesn't
mark nodes as needing layout.

* media/modern-media-controls/layout-node/children-expected.txt:
* media/modern-media-controls/layout-node/children.html:

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

3 years ago[Modern Media Controls] Controls bar may disappear while captions menu is visible
commit-queue@webkit.org [Thu, 23 Feb 2017 01:48:40 +0000 (01:48 +0000)]
[Modern Media Controls] Controls bar may disappear while captions menu is visible
https://bugs.webkit.org/show_bug.cgi?id=168751
<rdar://problem/30663411>

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

Source/WebCore:

We now prevent the controls bar from fading out due to the auto-hide timer firing
when the tracks panel is up, and wait until the track panel is hidden before fading
the controls bar.

Test: media/modern-media-controls/tracks-panel/tracks-panel-prevent-controls-bar-from-fading.html

* Modules/modern-media-controls/controls/controls-bar.js:
(ControlsBar.prototype.set userInteractionEnabled):
(ControlsBar.prototype._autoHideTimerFired):

LayoutTests:

Add a new test to check that we correctly prevent the controls bar from fading out
due to the auto-hide timer firing when the tracks panel is up, and that it fades
once the track panel disappears after the auto-hide timer has fired.

* media/modern-media-controls/tracks-panel/tracks-panel-prevent-controls-bar-from-fading-expected.txt: Added.
* media/modern-media-controls/tracks-panel/tracks-panel-prevent-controls-bar-from-fading.html: Added.

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

3 years agoRemove the demand executable allocator
keith_miller@apple.com [Thu, 23 Feb 2017 01:37:32 +0000 (01:37 +0000)]
Remove the demand executable allocator
https://bugs.webkit.org/show_bug.cgi?id=168754

Reviewed by Saam Barati.

Source/JavaScriptCore:

We currently only use the demand executable allocator for non-iOS 32-bit platforms.
Benchmark results on a MBP indicate there is no appreciable performance difference
between a the fixed and demand allocators. In a future patch I will go back through
this code and remove more of the abstractions.

* JavaScriptCore.xcodeproj/project.pbxproj:
* jit/ExecutableAllocator.cpp:
(JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator):
(JSC::FixedVMPoolExecutableAllocator::initializeSeparatedWXHeaps):
(JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator):
(JSC::FixedVMPoolExecutableAllocator::genericWriteToJITRegion):
(JSC::ExecutableAllocator::initializeAllocator):
(JSC::ExecutableAllocator::ExecutableAllocator):
(JSC::FixedVMPoolExecutableAllocator::~FixedVMPoolExecutableAllocator):
(JSC::ExecutableAllocator::isValid):
(JSC::ExecutableAllocator::underMemoryPressure):
(JSC::ExecutableAllocator::memoryPressureMultiplier):
(JSC::ExecutableAllocator::allocate):
(JSC::ExecutableAllocator::isValidExecutableMemory):
(JSC::ExecutableAllocator::getLock):
(JSC::ExecutableAllocator::committedByteCount):
(JSC::ExecutableAllocator::dumpProfile):
(JSC::DemandExecutableAllocator::DemandExecutableAllocator): Deleted.
(JSC::DemandExecutableAllocator::~DemandExecutableAllocator): Deleted.
(JSC::DemandExecutableAllocator::bytesAllocatedByAllAllocators): Deleted.
(JSC::DemandExecutableAllocator::bytesCommittedByAllocactors): Deleted.
(JSC::DemandExecutableAllocator::dumpProfileFromAllAllocators): Deleted.
(JSC::DemandExecutableAllocator::allocateNewSpace): Deleted.
(JSC::DemandExecutableAllocator::notifyNeedPage): Deleted.
(JSC::DemandExecutableAllocator::notifyPageIsFree): Deleted.
(JSC::DemandExecutableAllocator::allocators): Deleted.
(JSC::DemandExecutableAllocator::allocatorsMutex): Deleted.
* jit/ExecutableAllocator.h:
* jit/ExecutableAllocatorFixedVMPool.cpp: Removed.
* jit/JITStubRoutine.h:
(JSC::JITStubRoutine::canPerformRangeFilter):
(JSC::JITStubRoutine::filteringStartAddress):
(JSC::JITStubRoutine::filteringExtentSize):

Source/WTF:

* wtf/Platform.h:

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

3 years ago[Modern Media Controls] Can't set the volume slider with macOS inline controls
commit-queue@webkit.org [Thu, 23 Feb 2017 00:19:04 +0000 (00:19 +0000)]
[Modern Media Controls] Can't set the volume slider with macOS inline controls
https://bugs.webkit.org/show_bug.cgi?id=168747
<rdar://problem/30605528>

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

Source/WebCore:

Only call super for events we haven't registered specifically in the context
of this class. Otherwise we'd invalidate the volume container visibility for
a "mousedown" event registered by the MacOSMediaControls, the super class.

* Modules/modern-media-controls/controls/macos-inline-media-controls.js:
(MacOSInlineMediaControls.prototype.handleEvent):

LayoutTests:

Add some assertions to check that the volume slider container remains visible
after interacting with the volume slider.

* media/modern-media-controls/volume-support/volume-support-click-expected.txt:
* media/modern-media-controls/volume-support/volume-support-click.html:
* media/modern-media-controls/volume-support/volume-support-drag-expected.txt:
* media/modern-media-controls/volume-support/volume-support-drag.html:

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

3 years agoReplace SimpleLineLayout::Range by WTF::IteratorRange
antti@apple.com [Wed, 22 Feb 2017 23:55:34 +0000 (23:55 +0000)]
Replace SimpleLineLayout::Range by WTF::IteratorRange
https://bugs.webkit.org/show_bug.cgi?id=168742

Reviewed by Zalan Bujtas.

Kill a redundant custom type.

* rendering/SimpleLineLayoutResolver.cpp:
(WebCore::SimpleLineLayout::RunResolver::rangeForRect):
(WebCore::SimpleLineLayout::RunResolver::rangeForRenderer):
(WebCore::SimpleLineLayout::RunResolver::rangeForRendererWithOffsets):
* rendering/SimpleLineLayoutResolver.h:
(WebCore::SimpleLineLayout::LineResolver::rangeForRect):
(WebCore::SimpleLineLayout::Range::Range): Deleted.
(WebCore::SimpleLineLayout::Range::begin): Deleted.
(WebCore::SimpleLineLayout::Range::end): Deleted.

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

3 years agoMove instance members from WKQuadObject to implementation file
aakash_jain@apple.com [Wed, 22 Feb 2017 23:44:53 +0000 (23:44 +0000)]
Move instance members from WKQuadObject to implementation file
https://bugs.webkit.org/show_bug.cgi?id=168740

Reviewed by Tim Horton.

* DOM/DOM.mm: Moving instance member to implementation file.
* DOM/DOMExtensions.h: Ditto.

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

3 years agoMove instance members from WebPDFViewPlaceholder.h to implementation file
aakash_jain@apple.com [Wed, 22 Feb 2017 23:38:30 +0000 (23:38 +0000)]
Move instance members from WebPDFViewPlaceholder.h to implementation file
https://bugs.webkit.org/show_bug.cgi?id=168705

Reviewed by Tim Horton.

* WebView/WebPDFViewPlaceholder.h: Moving instance members to implementation file.
* WebView/WebPDFViewPlaceholder.mm: Ditto.

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

3 years agoAdd the Web Authentication API as "Under Consideration".
simon.fraser@apple.com [Wed, 22 Feb 2017 23:30:15 +0000 (23:30 +0000)]
Add the Web Authentication API as "Under Consideration".

* features.json:

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

3 years agoMove instance members from WebSelectionRect.h to implementation file
aakash_jain@apple.com [Wed, 22 Feb 2017 23:12:59 +0000 (23:12 +0000)]
Move instance members from WebSelectionRect.h to implementation file
https://bugs.webkit.org/show_bug.cgi?id=168732

Reviewed by Tim Horton.

* WebCoreSupport/WebSelectionRect.h: Moving instance members to implementation file.
* WebCoreSupport/WebSelectionRect.m: Ditto.

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

3 years agoWeb Inspector: RTL: Sidebar borders are on the wrong side
commit-queue@webkit.org [Wed, 22 Feb 2017 23:09:26 +0000 (23:09 +0000)]
Web Inspector: RTL: Sidebar borders are on the wrong side
https://bugs.webkit.org/show_bug.cgi?id=168743

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2017-02-22
Reviewed by Matt Baker.

* UserInterface/Views/Sidebar.css:
(body[dir=ltr] .sidebar.right > .resizer, body[dir=rtl] .sidebar.left > .resizer):
(body[dir=ltr] .sidebar.left > .resizer, body[dir=rtl] .sidebar.right > .resizer):
(body[dir=ltr] .sidebar.left, body[dir=rtl] .sidebar.right):
(body[dir=ltr] .sidebar.right, body[dir=rtl] .sidebar.left):
(.sidebar.right > .resizer): Deleted.
(.sidebar.left > .resizer): Deleted.
(.sidebar.left): Deleted.
(.sidebar.right): Deleted.

* UserInterface/Views/Sidebar.js:
(WebInspector.Sidebar.prototype.resizerDragging):
Reverse the change if the direction is RTL.

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

3 years agoSimple line layout: Set the pagination strut on the flow when the first line does...
zalan@apple.com [Wed, 22 Feb 2017 22:37:41 +0000 (22:37 +0000)]
Simple line layout: Set the pagination strut on the flow when the first line does not fit the page.
https://bugs.webkit.org/show_bug.cgi?id=168738
<rdar://problem/30659469>

Reviewed by Antti Koivisto.

The pagination strut for the first line is tracked by the parent RenderBlockFlow and not by
the line itself (see RenderBlockFlow::adjustLinePositionForPagination()). Also renamed *PaginationStrut* to
*LineStrut* to make sure we don't confuse it with the block level strut.

Not enabled yet.

* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::computeLineTopAndBottomWithOverflow):
(WebCore::SimpleLineLayout::computeLineBreakIndex):
(WebCore::SimpleLineLayout::setPageBreakForLine):
(WebCore::SimpleLineLayout::adjustLinePositionsForPagination):
(WebCore::SimpleLineLayout::create):
(WebCore::SimpleLineLayout::Layout::create):
(WebCore::SimpleLineLayout::Layout::Layout):
* rendering/SimpleLineLayout.h:
(WebCore::SimpleLineLayout::Layout::hasLineStruts):
(WebCore::SimpleLineLayout::Layout::struts):
(WebCore::SimpleLineLayout::Layout::hasPaginationStruts): Deleted.
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::paintFlow):
* rendering/SimpleLineLayoutFunctions.h:
(WebCore::SimpleLineLayout::computeFlowHeight):
* rendering/SimpleLineLayoutResolver.h:
(WebCore::SimpleLineLayout::RunResolver::Run::computeBaselinePosition):

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

3 years agoMake sampling algorithm more stable and introduce an abstraction for sampled data
rniwa@webkit.org [Wed, 22 Feb 2017 22:07:39 +0000 (22:07 +0000)]
Make sampling algorithm more stable and introduce an abstraction for sampled data
https://bugs.webkit.org/show_bug.cgi?id=168693

Reviewed by Chris Dumez.

Before this patch, TimeSeriesChart's resampling resulted in some points poping up and disappearing as
the width of a chart is changed. e.g. when resizing the browser window. The bug was by caused by
the sample for a given width not always including all points for a smaller width so as the width is
expanded, some point may be dropped.

Fixed this by using a much simpler algorithm of always picking a point when the time interval between
the preceding point and the succeeding point is larger than the minimum space we allow for a given width.

Also introduced a new abstraction around the sample data: TimeSeriesView. A TimeSeriesView provides
a similar API to TimeSeries for a subset of the time series filtered by a time range a custom function.
This paves a way to adding the ability to select baseline, etc... on the chart status view.

TimeSeriesView can be in two modes:
Mode 1. The view represents a contiguous subrange of TimeSeries - In this mode, this._data references
        the underlying TimeSeries's _data directly, and we use _startingIndex to adjust index given to
        find the relative index. Finding the next point or the previous point of a given point is done
        via looking up the point's seriesIndex and doing a simple arithmetic. In general, an index is
        converted to the absolute index in the underlying TimeSeries's _data array.

Mode 2. The view represents a filtered non-contiguous subset of TimeSeries -  In this mode, this._data is
        its own array. Finding the next point or the previous point of a given point requires finding
        a sibling point in the underlying TimeSeries which is in this view. Since this may result in O(n)
        traversal and a hash lookup, we lazily build a map of each point to its position in _data instead.

* public/v3/components/chart-status-view.js:
(ChartStatusView.prototype.updateStatusIfNeeded): Call selectedPoints instead of sampledDataBetween for
clarity. This function now returns a TimeSeriesView instead of a raw array.

* public/v3/components/interactive-time-series-chart.js:
(InteractiveTimeSeriesChart.prototype.currentPoint): Updated now that _sampledTimeSeriesData contains
an array of TimeSeriesView's. Note that diff is either 0, -1, or 1.
(InteractiveTimeSeriesChart.prototype.selectedPoints): Ditto. sampledDataBetween no longer exists since
we can simply call viewTimeRange on TimeSeriesView returned by sampledDataBetween.
(InteractiveTimeSeriesChart.prototype.firstSelectedPoint): Ditto.
(InteractiveTimeSeriesChart.prototype._sampleTimeSeries): Use add since excludedPoints is now a Set.

* public/v3/components/time-series-chart.js:
(TimeSeriesChart.prototype.sampledDataBetween): Deleted.
(TimeSeriesChart.prototype.firstSampledPointBetweenTime): Deleted.
(TimeSeriesChart.prototype._ensureSampledTimeSeries): Modernized the code. Use the the time interval of
the chart divided by the number of allowed points as the time interval used in the new sampling algorithm.
(TimeSeriesChart.prototype._sampleTimeSeries): Rewritten. We also create TimeSeriesView here.
(TimeSeriesChart.prototype._sampleTimeSeries.findMedian): Deleted.
(TimeSeriesChart.prototype._updateCanvasSizeIfClientSizeChanged): Fixed a bug that the canvas size wasn't
set to the correct value on Chrome when a high DPI screen is used.

* public/v3/models/time-series.js:
(TimeSeries.prototype.viewBetweenPoints): Renamed from dataBetweenPoints. Now returns a TimeSeriesView.
(TimeSeriesView): Added. This constructor is to be called by viewBetweenPoints, viewTimeRange, and filter.
(TimeSeriesView.prototype._buildPointIndexMap): Added. Used in mode (2).
(TimeSeriesView.prototype.length): Added.
(TimeSeriesView.prototype.firstPoint): Added.
(TimeSeriesView.prototype.lastPoint): Added.
(TimeSeriesView.prototype.nextPoint): Added. Note index is always a position in this._data. In mode (1),
this is the position of the point in the underlying TimeSeries' _data. In mode (2), this is the position
of the point in this._data which is dictinct from the underlying TimeSeries' _data.
(TimeSeriesView.prototype.previousPoint): Ditto.
(TimeSeriesView.prototype.findPointByIndex): Added. Finds the point using the positional index from the
beginning of this view. findPointByIndex(0) on one view may not be same as findPointByIndex(0) of another.
(TimeSeriesView.prototype.findById): Added. This is O(n).
(TimeSeriesView.prototype.values): Added. Returns the value of each point in this view.
(TimeSeriesView.prototype.filter): Added. Creates a new view with a subset of data points the predicate
function returned true.
(TimeSeriesView.prototype.viewTimeRange): Added. Creates a new view with a subset of data points for the
given time ragne. When the resultant view would include all points of this view, it simply returns itself
as an optimization.
(TimeSeriesView.prototype.firstPointInTimeRange): Added. Returns the first point in the view which lies
within the specified time range.
(TimeSeriesView.prototype.Symbol.iterator): Added. Iterates over each point in the view.

* public/v3/pages/analysis-task-page.js:
(AnalysisTaskChartPane.prototype.selectedPoints): Use selectedPoints in lieu of getting selection and then
calling sampledDataBetween with that range.

* public/v3/pages/summary-page.js:
(SummaryPageConfigurationGroup.set _medianForTimeRange): Modernized.

* unit-tests/time-series-tests.js: Added tests for TimeSeries and TimeSeriesView. Already caught bugs!
(addPointsToSeries):

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

3 years agoAutoInstaller should not skip the install step if the package is downloaded but not...
clopez@igalia.com [Wed, 22 Feb 2017 21:55:03 +0000 (21:55 +0000)]
AutoInstaller should not skip the install step if the package is downloaded but not installed
https://bugs.webkit.org/show_bug.cgi?id=168737

Reviewed by Ryosuke Niwa.

Don't skip the install step if the package target path don't exists.
Fix the description for "should_refresh" optional argument.

* Scripts/webkitpy/common/system/autoinstall.py:
(AutoInstaller.install):

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

3 years agoAdd biased coloring to Briggs and IRC
sbarati@apple.com [Wed, 22 Feb 2017 21:52:13 +0000 (21:52 +0000)]
Add biased coloring to Briggs and IRC
https://bugs.webkit.org/show_bug.cgi?id=168611

Reviewed by Filip Pizlo.

This patch implements biased coloring as proposed by Briggs. See section
5.3.3 of his thesis for more information: http://www.cs.utexas.edu/users/mckinley/380C/lecs/briggs-thesis-1992.pdf

The main idea of biased coloring is this:
We try to coalesce a move between u and v, but the conservative heuristic
fails. We don't want coalesce the move because we don't want to risk
creating an uncolorable graph. However, if the conservative heuristic fails,
it's not proof that the graph is uncolorable if the move were indeed coalesced.
So, when we go to color the tmps, we'll remember that we really want the
same register for u and v, and if legal during coloring, we will
assign them to the same register.

* b3/air/AirAllocateRegistersByGraphColoring.cpp:

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

3 years agoCrash if there's a mismatch between the WebKit used by the UI process and child proce...
andersca@apple.com [Wed, 22 Feb 2017 21:49:54 +0000 (21:49 +0000)]
Crash if there's a mismatch between the WebKit used by the UI process and child processes respectively
https://bugs.webkit.org/show_bug.cgi?id=168739
Part of rdar://problem/30631411.

Reviewed by Geoffrey Garen.

If the UI process and web process for some reason end up using different versions of the WebKit framework, weird things happen
because the message format is different between versions. To avoid this, send along the WebKit bundle version from the UI process
in the XPC bootstrap message, check that it matches inside the XPC main functions. If there's a mismatch, crash.

* Shared/Cocoa/ChildProcessCocoa.mm:
(WebKit::ChildProcess::didReceiveInvalidMessage):
Fix parameters.

* Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
(main):
Check for the bundle version and crash if it's not what we expect.

* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::ProcessLauncher::launchProcess):
Initialize the bundle version.

* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::_WKSetCrashReportApplicationSpecificInformation):
Export this so we can call it from the XPC services without having to link WKSI.

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

3 years agoRe-commit part of r212812 accidentally rolled out with r212841.
achristensen@apple.com [Wed, 22 Feb 2017 21:33:10 +0000 (21:33 +0000)]
Re-commit part of r212812 accidentally rolled out with r212841.
https://bugs.webkit.org/show_bug.cgi?id=167293

* wtf/Platform.h:
Use libwebrtc on Mac if webrtc is enabled.

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

3 years ago[WebRTC] Some webrtc tests are failing
commit-queue@webkit.org [Wed, 22 Feb 2017 20:59:21 +0000 (20:59 +0000)]
[WebRTC] Some webrtc tests are failing
https://bugs.webkit.org/show_bug.cgi?id=168736

Unreviewed.

Patch by Youenn Fablet <youenn@apple.com> on 2017-02-22

* TestExpectations: Marking some tests as failing until we fix them.

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

3 years ago[WebRTC] Disable libwebrtc stderr logging in release mode
commit-queue@webkit.org [Wed, 22 Feb 2017 20:57:18 +0000 (20:57 +0000)]
[WebRTC] Disable libwebrtc stderr logging in release mode
https://bugs.webkit.org/show_bug.cgi?id=168734

Patch by Youenn Fablet <youenn@apple.com> on 2017-02-22
Reviewed by Tim Horton.

Source/ThirdParty/libwebrtc:

* Source/webrtc/base/logging.h:

Source/WebCore:

No change of behavior.

* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
(WebCore::initializePeerConnectionFactoryAndThreads):

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

3 years agoSource/WebCore:
jer.noble@apple.com [Wed, 22 Feb 2017 20:46:32 +0000 (20:46 +0000)]
Source/WebCore:
MediaStreamSourceNode never receives audio from MockRealtimeAudioSourceMac.
https://bugs.webkit.org/show_bug.cgi?id=168731

Reviewed by Eric Carlson.

Test: fast/mediastream/mock-media-source-webaudio.html

Because the audioSourceProvider can be created before the mock source is configured, explicitly configure the
source if necessary after creating the audioSourceProvider.

* platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
(WebCore::MockRealtimeAudioSourceMac::audioSourceProvider):

LayoutTests:
MediaStreamSourceNode never receives audio from a getUserMedia() created stream
https://bugs.webkit.org/show_bug.cgi?id=168731

Reviewed by Eric Carlson.

* fast/mediastream/mock-media-source-webaudio-expected.txt: Added.
* fast/mediastream/mock-media-source-webaudio.html: Added.

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

3 years agoDo not aggressively throttle DOM timers until they've reached their max nesting level
cdumez@apple.com [Wed, 22 Feb 2017 20:44:30 +0000 (20:44 +0000)]
Do not aggressively throttle DOM timers until they've reached their max nesting level
https://bugs.webkit.org/show_bug.cgi?id=168700
<rdar://problem/29808005>

Reviewed by Simon Fraser.

Source/WebCore:

Do not aggressively throttle DOM timers until they've actually areached their max
nesting level (5). This overly aggressive throttling of non-nested timers is what
was causing Google Maps to use 100% CPU in background tabs for several minutes.

Test: fast/dom/timer-throttling-hidden-page-non-nested.html

* dom/Document.cpp:
(WebCore::Document::timerAlignmentInterval):

LayoutTests:

Add layout test coverage.

* TestExpectations:
* fast/dom/timer-throttling-hidden-page-expected.txt:
* fast/dom/timer-throttling-hidden-page-non-nested-expected.txt: Added.
* fast/dom/timer-throttling-hidden-page-non-nested.html: Added.
* fast/dom/timer-throttling-hidden-page.html:

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

3 years ago[MediaStream iOS] Respond to capture interruptions and notifications
eric.carlson@apple.com [Wed, 22 Feb 2017 20:06:57 +0000 (20:06 +0000)]
[MediaStream iOS] Respond to capture interruptions and notifications
https://bugs.webkit.org/show_bug.cgi?id=168610

Reviewed by Jer Noble.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayer): Drive-by cleanup: don't create
a sample buffer display layer unless there is an active video track.

* platform/mediastream/mac/AVMediaCaptureSource.h:
* platform/mediastream/mac/AVMediaCaptureSource.mm:
(WebCore::AVMediaCaptureSource::AVMediaCaptureSource): Add static_asserts to ensure that
WebCore::InterruptionReason values map directly to AVCaptureSessionInterruptionReason values.
(WebCore::AVMediaCaptureSource::~AVMediaCaptureSource): Minor cleanup.
(WebCore::AVMediaCaptureSource::startProducingData): Start listening for notifications before
starting the session.
(WebCore::AVMediaCaptureSource::stopProducingData): Remove the notification observers before
stopping the session.
(WebCore::AVMediaCaptureSource::setupSession): Minor style cleanup.
(WebCore::AVMediaCaptureSource::captureSessionRuntimeError): New. When the error is AVErrorMediaServicesWereReset,
sometimes caused by a mediaserverd crash, try to restart the session one time.
(WebCore::AVMediaCaptureSource::captureSessionBeginInterruption): Store the interruption reason.
(WebCore::AVMediaCaptureSource::captureSessionEndInterruption): Try to restart the session if
it was interrupted because the app went into multi-app layout mode.
(WebCore::sessionKVOProperties): Drive-by cleanup.
(-[WebCoreAVMediaCaptureSourceObserver initWithCallback:]):
(-[WebCoreAVMediaCaptureSourceObserver disconnect]):
(-[WebCoreAVMediaCaptureSourceObserver addNotificationObservers]):
(-[WebCoreAVMediaCaptureSourceObserver removeNotificationObservers]):
(-[WebCoreAVMediaCaptureSourceObserver sessionRuntimeError:]):
(-[WebCoreAVMediaCaptureSourceObserver beginSessionInterrupted:]):
(-[WebCoreAVMediaCaptureSourceObserver endSessionInterrupted:]):

* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::initializeCapabilities): Not all AVCaptureSession preset strings
are available on all platforms so load with SOFT_LINK_POINTER_OPTIONAL and NULL check before use.
(WebCore::sizeForPreset): Ditto.
(WebCore::AVVideoCaptureSource::bestSessionPresetForVideoDimensions): Ditto.

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

3 years agoSimple line layout: ensureLineBoxes for paginated content.
zalan@apple.com [Wed, 22 Feb 2017 19:33:02 +0000 (19:33 +0000)]
Simple line layout: ensureLineBoxes for paginated content.
https://bugs.webkit.org/show_bug.cgi?id=168729
<rdar://problem/30654400>

Reviewed by Antti Koivisto.

This patch sets the layout state bits for paginated subtree layout, when we are switching
over from simple line runs to inline tree.

Not enabled yet.

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::ensureLineBoxes):
* rendering/RenderView.cpp:
(WebCore::RenderView::pushLayoutStateForPagination): LayoutUnit(1) is not the real height, it's just
an indicator that we've got paginated content.
* rendering/RenderView.h:
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::create):
(WebCore::SimpleLineLayout::Layout::create):
(WebCore::SimpleLineLayout::Layout::Layout):
* rendering/SimpleLineLayout.h:
(WebCore::SimpleLineLayout::Layout::isPaginated):
(WebCore::SimpleLineLayout::Layout::hasPaginationStruts):
* rendering/SimpleLineLayoutFunctions.h:
(WebCore::SimpleLineLayout::computeFlowHeight):
* rendering/SimpleLineLayoutResolver.h:
(WebCore::SimpleLineLayout::RunResolver::Run::computeBaselinePosition):

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

3 years agoRolling out r212757
jmarcell@apple.com [Wed, 22 Feb 2017 18:36:51 +0000 (18:36 +0000)]
Rolling out r212757

Revert "Resource Load Statistics: Add alternate classification method"

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

3 years ago[GTK] Do not use g_return_if_fail in EventSenderProxy::continuousMouseScrollBy
commit-queue@webkit.org [Wed, 22 Feb 2017 18:03:13 +0000 (18:03 +0000)]
[GTK] Do not use g_return_if_fail in EventSenderProxy::continuousMouseScrollBy
https://bugs.webkit.org/show_bug.cgi?id=168721

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2017-02-22
Reviewed by Michael Catanzaro.

Use WTFLogAlways instead. It's still shown in stderr, but it won't crash if we ever run tests with fatal
criticals.

* WebKitTestRunner/gtk/EventSenderProxyGtk.cpp:
(WTR::EventSenderProxy::continuousMouseScrollBy):

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

3 years agoWeb Inspector: RTL: Settings tab labels need adjustment
bburg@apple.com [Wed, 22 Feb 2017 17:56:52 +0000 (17:56 +0000)]
Web Inspector: RTL: Settings tab labels need adjustment
https://bugs.webkit.org/show_bug.cgi?id=168497

Reviewed by Matt Baker.

Flip margins. Use 'text-align: end' instead of manually choosing
right and left based on body[dir].

* UserInterface/Views/SettingsTabContentView.css:
(.content-view.settings > .setting-container > .setting-name):
(body[dir=ltr] .content-view.settings > .setting-container > .setting-name):
(body[dir=rtl] .content-view.settings > .setting-container > .setting-name):
(.content-view.settings > .setting-container > .setting-value-controller input[type="checkbox"]):
(body[dir=ltr] .content-view.settings > .setting-container > .setting-value-controller input[type="checkbox"]):
(body[dir=rtl] .content-view.settings > .setting-container > .setting-value-controller input[type="checkbox"]):
(.content-view.settings > .setting-container > .setting-value-controller input[type="number"]):
(body[dir=ltr] .content-view.settings > .setting-container > .setting-value-controller input[type="number"]):
(body[dir=rtl] .content-view.settings > .setting-container > .setting-value-controller input[type="number"]):

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

3 years agoMove iOS specific symbols to WebKit.ios.exp
aakash_jain@apple.com [Wed, 22 Feb 2017 17:44:34 +0000 (17:44 +0000)]
Move iOS specific symbols to WebKit.ios.exp
https://bugs.webkit.org/show_bug.cgi?id=168726

Reviewed by Alexey Proskuryakov.

Source/WebKit/ios:

* WebKit.iOS.exp:

Source/WebKit/mac:

* WebKit.exp:

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

3 years ago[WK2] Call processDidBecomeUnresponsive delegate when a background process is unrespo...
cdumez@apple.com [Wed, 22 Feb 2017 17:15:45 +0000 (17:15 +0000)]
[WK2] Call processDidBecomeUnresponsive delegate when a background process is unresponsive
https://bugs.webkit.org/show_bug.cgi?id=168683
<rdar://problem/30558745>

Reviewed by Dan Bernstein.

Call processDidBecomeUnresponsive delegate when a background process is unresponsive
instead of killing it on WebKit side. This gives the client the choice about what it
wants to do about this process.

* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/C/WKContext.cpp:
* UIProcess/API/C/WKContextPrivate.h:
* UIProcess/BackgroundProcessResponsivenessTimer.cpp: Renamed from Source/WebKit2/UIProcess/UnresponsiveWebProcessTerminator.cpp.
(WebKit::BackgroundProcessResponsivenessTimer::BackgroundProcessResponsivenessTimer):
(WebKit::BackgroundProcessResponsivenessTimer::updateState):
(WebKit::BackgroundProcessResponsivenessTimer::timerFired):
* UIProcess/BackgroundProcessResponsivenessTimer.h: Renamed from Source/WebKit2/UIProcess/UnresponsiveWebProcessTerminator.h.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::reattachToWebProcess):
(WebKit::WebPageProxy::dispatchActivityStateChange):
(WebKit::WebPageProxy::terminateProcess):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::m_backgroundResponsivenessTimer):
* UIProcess/WebProcessProxy.h:
* WebKit2.xcodeproj/project.pbxproj:

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

3 years ago[Win] Compile fix.
pvollan@apple.com [Wed, 22 Feb 2017 17:05:22 +0000 (17:05 +0000)]
[Win] Compile fix.
https://bugs.webkit.org/show_bug.cgi?id=168713

Reviewed by Brent Fulgham.

The include file <ANGLE/ShaderLang.h> is not found.

* testing/Internals.cpp:

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

3 years ago[GStreamer][EME] Fix issue with allowed systems extraction
calvaris@igalia.com [Wed, 22 Feb 2017 16:54:45 +0000 (16:54 +0000)]
[GStreamer][EME] Fix issue with allowed systems extraction
https://bugs.webkit.org/show_bug.cgi?id=168717

Reviewed by Carlos Garcia Campos.

The allowed systems were not being extracted from the need-context
message because the loop was not stopping on the right condition.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::extractEventsAndSystemsFromMessage): Fix wrong
condition.
(WebCore::MediaPlayerPrivateGStreamerBase::handleProtectionEvent):
Add better debug category.

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

3 years ago[GTK] [2.15.90] Disable RESOURCE_USAGE on non-Linux systems
berto@igalia.com [Wed, 22 Feb 2017 16:53:17 +0000 (16:53 +0000)]
[GTK] [2.15.90] Disable RESOURCE_USAGE on non-Linux systems
https://bugs.webkit.org/show_bug.cgi?id=168714

Reviewed by Carlos Garcia Campos.

* Source/cmake/OptionsGTK.cmake:

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

3 years agoREGRESSION(r207669): Crash after mutating selector text
antti@apple.com [Wed, 22 Feb 2017 14:46:06 +0000 (14:46 +0000)]
REGRESSION(r207669): Crash after mutating selector text
https://bugs.webkit.org/show_bug.cgi?id=168655
<rdar://problem/30632111>

Reviewed by Andreas Kling.

Source/WebCore:

Test: fast/css/selector-text-mutation-crash.html

* style/StyleScope.cpp:
(WebCore::Style::Scope::resolver):
(WebCore::Style::Scope::updateStyleResolver):

Protect against entering scheduleUpdate and wiping style resolver while updating it.
Extension stylesheets can trigger this.

(WebCore::Style::Scope::scheduleUpdate):

Clear the style resolver immediately if style sheet content changes. The resolver may
have data structures that point to the old sheet contents.

The resolver would get wiped anyway when the scheduled update actually occurs.

* style/StyleScope.h:

LayoutTests:

* fast/css/selector-text-mutation-crash-expected.txt: Added.
* fast/css/selector-text-mutation-crash.html: Added.

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

3 years ago[Win] WebCrypto tests are failing.
pvollan@apple.com [Wed, 22 Feb 2017 14:12:37 +0000 (14:12 +0000)]
[Win] WebCrypto tests are failing.
https://bugs.webkit.org/show_bug.cgi?id=165090

Unreviewed test gardening.

* platform/win/TestExpectations:

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

3 years agoUnreviewed GTK+ gardening. Mark fast/css/paint-order-shadow.html as failing.
carlosgc@webkit.org [Wed, 22 Feb 2017 13:23:21 +0000 (13:23 +0000)]
Unreviewed GTK+ gardening. Mark fast/css/paint-order-shadow.html as failing.

* platform/gtk/TestExpectations:

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

3 years agoUnreviewed GTK+ gardening. Mark http/tests/media/video-redirect.html as timing out.
carlosgc@webkit.org [Wed, 22 Feb 2017 13:15:02 +0000 (13:15 +0000)]
Unreviewed GTK+ gardening. Mark http/tests/media/video-redirect.html as timing out.

* platform/gtk/TestExpectations:

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

3 years agoUnreviewed GTK+ gardening. Remove duplicated entries.
carlosgc@webkit.org [Wed, 22 Feb 2017 13:09:00 +0000 (13:09 +0000)]
Unreviewed GTK+ gardening. Remove duplicated entries.

* platform/gtk/TestExpectations:

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

3 years ago[css-grid] Move the track sizing algorithm to its own class
svillar@igalia.com [Wed, 22 Feb 2017 11:44:15 +0000 (11:44 +0000)]
[css-grid] Move the track sizing algorithm to its own class
https://bugs.webkit.org/show_bug.cgi?id=167988

Reviewed by Manuel Rego Casasnovas.

This is about moving the track sizing algorithm code out of RenderGrid to a new class
GridTrackSizingAlgorithm, making RenderGrid more compact and easy to maintain. A nice side
effect of this patch is the removal of the GridSizingData structure as it is no longer
needed. All the data structures in that class were transferred to GridTrackSizingAlgorithm
as private attribute members. The GridTrack class was also moved to the new file.

The algorithm execution starts with the call to run(). It's mandatory to call setup() before
any call to run() in order to properly configure the behaviour of the algorithm. You can
call setup() & run() multiple times for a single layout operation (normally twice, one for
columns and another one for rows). The algorithm uses a state machine to verify that the
client issues the calls in the proper order (i.e. first columns and then rows). After
finishing the layout, the client should call reset() to allow the algorithm to perform
cleanups and to prepare itself for another round of calls.

In order to implement the different behaviours of the algorithm depending on whether the
available size is definite or not, a strategy pattern was implemented in the
GridTrackSizingAlgorithmStrategy class. It has two subclasses, one for definite sizes and
another one for indefinite ones.

We took advantage of this change to perform some renames of the track sizing algorithm
methods that were still using the names from the first versions of the specs. Not only that,
the original track sizing algorithm method (computeUsedBreadthOfGridTracks) was split in 4
different parts representing the 4 steps of the algorithm.

No new tests as this is about moving code and refactoring.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* rendering/GridTrackSizingAlgorithm.cpp: Added.
(WebCore::GridTrack::baseSize):
(WebCore::GridTrack::growthLimit):
(WebCore::GridTrack::setBaseSize):
(WebCore::GridTrack::setGrowthLimit):
(WebCore::GridTrack::growthLimitIfNotInfinite):
(WebCore::GridTrack::setTempSize):
(WebCore::GridTrack::growTempSize):
(WebCore::GridTrack::setGrowthLimitCap):
(WebCore::GridTrack::ensureGrowthLimitIsBiggerThanBaseSize):
(WebCore::shouldClearOverrideContainingBlockContentSizeForChild):
(WebCore::hasOverrideContainingBlockContentSizeForChild):
(WebCore::setOverrideContainingBlockContentSizeForChild):
(WebCore::flowAwareDirectionForChild):
(WebCore::overrideContainingBlockContentSizeForChild):
(WebCore::computeMarginLogicalSizeForChild):
(WebCore::marginIntrinsicLogicalWidthForChild):
(WebCore::GridTrackSizingAlgorithm::setFreeSpace):
(WebCore::GridTrackSizingAlgorithm::rawGridTrackSize):
(WebCore::GridTrackSizingAlgorithm::computeTrackBasedSize):
(WebCore::GridTrackSizingAlgorithm::initialBaseSize):
(WebCore::GridTrackSizingAlgorithm::initialGrowthLimit):
(WebCore::GridTrackSizingAlgorithm::sizeTrackToFitNonSpanningItem):
(WebCore::GridTrackSizingAlgorithm::spanningItemCrossesFlexibleSizedTracks):
(WebCore::GridItemWithSpan::GridItemWithSpan):
(WebCore::GridItemWithSpan::gridItem):
(WebCore::GridItemWithSpan::span):
(WebCore::GridItemWithSpan::operator<):
(WebCore::GridTrackSizingAlgorithm::itemSizeForTrackSizeComputationPhase):
(WebCore::shouldProcessTrackForTrackSizeComputationPhase):
(WebCore::trackSizeForTrackSizeComputationPhase):
(WebCore::updateTrackSizeForTrackSizeComputationPhase):
(WebCore::trackShouldGrowBeyondGrowthLimitsForTrackSizeComputationPhase):
(WebCore::markAsInfinitelyGrowableForTrackSizeComputationPhase):
(WebCore::GridTrackSizingAlgorithm::increaseSizesToAccommodateSpanningItems):
(WebCore::sortByGridTrackGrowthPotential):
(WebCore::clampGrowthShareIfNeeded):
(WebCore::GridTrackSizingAlgorithm::distributeSpaceToTracks):
(WebCore::GridTrackSizingAlgorithm::assumedRowsSizeForOrthogonalChild):
(WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild):
(WebCore::GridTrackSizingAlgorithm::gridTrackSize):
(WebCore::GridTrackSizingAlgorithm::computeFlexFactorUnitSize):
(WebCore::GridTrackSizingAlgorithm::computeFlexSizedTracksGrowth):
(WebCore::GridTrackSizingAlgorithm::findFrUnitSize):
(WebCore::GridTrackSizingAlgorithm::computeGridContainerIntrinsicSizes):
(WebCore::GridTrackSizingAlgorithmStrategy::logicalHeightForChild):
(WebCore::GridTrackSizingAlgorithmStrategy::minContentForChild):
(WebCore::GridTrackSizingAlgorithmStrategy::maxContentForChild):
(WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild):
(WebCore::GridTrackSizingAlgorithmStrategy::updateOverrideContainingBlockContentSizeForChild):
(WebCore::IndefiniteSizeStrategy::minLogicalWidthForChild):
(WebCore::IndefiniteSizeStrategy::layoutGridItemForMinSizeComputation):
(WebCore::IndefiniteSizeStrategy::maximizeTracks):
(WebCore::normalizedFlexFraction):
(WebCore::IndefiniteSizeStrategy::findUsedFlexFraction):
(WebCore::IndefiniteSizeStrategy::recomputeUsedFlexFractionIfNeeded):
(WebCore::DefiniteSizeStrategy::minLogicalWidthForChild):
(WebCore::DefiniteSizeStrategy::maximizeTracks):
(WebCore::DefiniteSizeStrategy::layoutGridItemForMinSizeComputation):
(WebCore::DefiniteSizeStrategy::findUsedFlexFraction):
(WebCore::DefiniteSizeStrategy::recomputeUsedFlexFractionIfNeeded):
(WebCore::GridTrackSizingAlgorithm::initializeTrackSizes):
(WebCore::GridTrackSizingAlgorithm::resolveIntrinsicTrackSizes):
(WebCore::GridTrackSizingAlgorithm::stretchFlexibleTracks):
(WebCore::GridTrackSizingAlgorithm::advanceNextState):
(WebCore::GridTrackSizingAlgorithm::isValidTransition):
(WebCore::GridTrackSizingAlgorithm::setup):
(WebCore::GridTrackSizingAlgorithm::run):
(WebCore::GridTrackSizingAlgorithm::reset):
(WebCore::GridTrackSizingAlgorithm::tracksAreWiderThanMinTrackBreadth):
(WebCore::GridTrackSizingAlgorithm::StateMachine::StateMachine):
(WebCore::GridTrackSizingAlgorithm::StateMachine::~StateMachine):
* rendering/GridTrackSizingAlgorithm.h: Added.
(WebCore::GridTrack::GridTrack):
(WebCore::GridTrack::infiniteGrowthPotential):
(WebCore::GridTrack::plannedSize):
(WebCore::GridTrack::setPlannedSize):
(WebCore::GridTrack::tempSize):
(WebCore::GridTrack::infinitelyGrowable):
(WebCore::GridTrack::setInfinitelyGrowable):
(WebCore::GridTrack::growthLimitCap):
(WebCore::GridTrack::growthLimitIsInfinite):
(WebCore::GridTrack::isGrowthLimitBiggerThanBaseSize):
(WebCore::GridTrackSizingAlgorithmStrategy::GridTrackSizingAlgorithmStrategy):
(WebCore::GridTrackSizingAlgorithmStrategy::computeTrackBasedSize):
(WebCore::GridTrackSizingAlgorithmStrategy::direction):
(WebCore::GridTrackSizingAlgorithmStrategy::findFrUnitSize):
(WebCore::GridTrackSizingAlgorithmStrategy::distributeSpaceToTracks):
(WebCore::GridTrackSizingAlgorithmStrategy::renderGrid):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::RenderGrid):
(WebCore::RenderGrid::computeTrackBasedLogicalHeight):
(WebCore::RenderGrid::computeTrackSizesForDefiniteSize):
(WebCore::RenderGrid::repeatTracksSizingIfNeeded):
(WebCore::RenderGrid::layoutBlock):
(WebCore::RenderGrid::computeIntrinsicLogicalWidths):
(WebCore::RenderGrid::computeTrackSizesForIndefiniteSize):
(WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
(WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded):
(WebCore::RenderGrid::layoutGridItems):
(WebCore::RenderGrid::gridAreaBreadthForChildIncludingAlignmentOffsets):
(WebCore::RenderGrid::populateGridPositionsForDirection):
(WebCore::RenderGrid::columnAxisOffsetForChild):
(WebCore::RenderGrid::rowAxisOffsetForChild):
(WebCore::RenderGrid::findChildLogicalPosition):
(WebCore::GridTrack::GridTrack): Deleted.
(WebCore::GridTrack::baseSize): Deleted.
(WebCore::GridTrack::growthLimit): Deleted.
(WebCore::GridTrack::setBaseSize): Deleted.
(WebCore::GridTrack::setGrowthLimit): Deleted.
(WebCore::GridTrack::infiniteGrowthPotential): Deleted.
(WebCore::GridTrack::growthLimitIfNotInfinite): Deleted.
(WebCore::GridTrack::plannedSize): Deleted.
(WebCore::GridTrack::setPlannedSize): Deleted.
(WebCore::GridTrack::tempSize): Deleted.
(WebCore::GridTrack::setTempSize): Deleted.
(WebCore::GridTrack::growTempSize): Deleted.
(WebCore::GridTrack::infinitelyGrowable): Deleted.
(WebCore::GridTrack::setInfinitelyGrowable): Deleted.
(WebCore::GridTrack::setGrowthLimitCap): Deleted.
(WebCore::GridTrack::growthLimitCap): Deleted.
(WebCore::GridTrack::growthLimitIsInfinite): Deleted.
(WebCore::GridTrack::isGrowthLimitBiggerThanBaseSize): Deleted.
(WebCore::GridTrack::ensureGrowthLimitIsBiggerThanBaseSize): Deleted.
(WebCore::RenderGrid::GridSizingData::GridSizingData): Deleted.
(WebCore::RenderGrid::GridSizingData::freeSpace): Deleted.
(WebCore::RenderGrid::GridSizingData::availableSpace): Deleted.
(WebCore::RenderGrid::GridSizingData::setAvailableSpace): Deleted.
(WebCore::RenderGrid::GridSizingData::advanceNextState): Deleted.
(WebCore::RenderGrid::GridSizingData::isValidTransition): Deleted.
(WebCore::RenderGrid::GridSizingData::grid): Deleted.
(WebCore::RenderGrid::GridSizingData::setFreeSpace): Deleted.
(WebCore::RenderGrid::computeTrackSizesForDirection): Deleted.
(WebCore::RenderGrid::computeIntrinsicLogicalHeight): Deleted.
(WebCore::normalizedFlexFraction): Deleted.
(WebCore::RenderGrid::computeUsedBreadthOfGridTracks): Deleted.
(WebCore::RenderGrid::computeFlexSizedTracksGrowth): Deleted.
(WebCore::RenderGrid::computeUsedBreadthOfMinLength): Deleted.
(WebCore::RenderGrid::computeUsedBreadthOfMaxLength): Deleted.
(WebCore::RenderGrid::computeFlexFactorUnitSize): Deleted.
(WebCore::RenderGrid::findFlexFactorUnitSize): Deleted.
(WebCore::hasOverrideContainingBlockContentSizeForChild): Deleted.
(WebCore::setOverrideContainingBlockContentSizeForChild): Deleted.
(WebCore::shouldClearOverrideContainingBlockContentSizeForChild): Deleted.
(WebCore::RenderGrid::rawGridTrackSize): Deleted.
(WebCore::RenderGrid::gridTrackSize): Deleted.
(WebCore::RenderGrid::logicalHeightForChild): Deleted.
(WebCore::RenderGrid::minSizeForChild): Deleted.
(WebCore::RenderGrid::updateOverrideContainingBlockContentSizeForChild): Deleted.
(WebCore::RenderGrid::minContentForChild): Deleted.
(WebCore::RenderGrid::maxContentForChild): Deleted.
(WebCore::GridItemWithSpan::GridItemWithSpan): Deleted.
(WebCore::GridItemWithSpan::gridItem): Deleted.
(WebCore::GridItemWithSpan::span): Deleted.
(WebCore::GridItemWithSpan::operator<): Deleted.
(WebCore::RenderGrid::spanningItemCrossesFlexibleSizedTracks): Deleted.
(WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions): Deleted.
(WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems): Deleted.
(WebCore::trackSizeForTrackSizeComputationPhase): Deleted.
(WebCore::RenderGrid::shouldProcessTrackForTrackSizeComputationPhase): Deleted.
(WebCore::RenderGrid::trackShouldGrowBeyondGrowthLimitsForTrackSizeComputationPhase): Deleted.
(WebCore::RenderGrid::markAsInfinitelyGrowableForTrackSizeComputationPhase): Deleted.
(WebCore::RenderGrid::updateTrackSizeForTrackSizeComputationPhase): Deleted.
(WebCore::RenderGrid::currentItemSizeForTrackSizeComputationPhase): Deleted.
(WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems): Deleted.
(WebCore::sortByGridTrackGrowthPotential): Deleted.
(WebCore::clampGrowthShareIfNeeded): Deleted.
(WebCore::RenderGrid::distributeSpaceToTracks): Deleted.
(WebCore::RenderGrid::tracksAreWiderThanMinTrackBreadth): Deleted.
(WebCore::RenderGrid::assumedRowsSizeForOrthogonalChild): Deleted.
(WebCore::RenderGrid::gridAreaBreadthForChild): Deleted.
* rendering/RenderGrid.h:

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

3 years ago[Win] Crash under CACFLayerTreeHost::acceleratedCompositingAvailable().
pvollan@apple.com [Wed, 22 Feb 2017 11:34:46 +0000 (11:34 +0000)]
[Win] Crash under CACFLayerTreeHost::acceleratedCompositingAvailable().
https://bugs.webkit.org/show_bug.cgi?id=168711

Reviewed by Alex Christensen.

Add null pointer check.

* platform/graphics/ca/win/CACFLayerTreeHost.cpp:
(WebCore::CACFLayerTreeHost::acceleratedCompositingAvailable):

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

3 years agoUnreviewed GTK+ gardening. Mark WebRTC tests failing after r212812.
carlosgc@webkit.org [Wed, 22 Feb 2017 11:08:50 +0000 (11:08 +0000)]
Unreviewed GTK+ gardening. Mark WebRTC tests failing after r212812.

* platform/gtk/TestExpectations:

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

3 years agoJSModuleNamespace object should have IC
utatane.tea@gmail.com [Wed, 22 Feb 2017 09:23:08 +0000 (09:23 +0000)]
JSModuleNamespace object should have IC
https://bugs.webkit.org/show_bug.cgi?id=160590

Reviewed by Saam Barati.

JSTests:

* modules/module-assert-access-binding.js: Added.
* modules/module-assert-access-namespace.js: Added.
* modules/namespace-empty.js: Added.
(from.string_appeared_here.access):
(i.shouldThrow):
* stress/module-namespace-access-change.js: Added.
(shouldBe):
(access):
(import.string_appeared_here.then):
* stress/module-namespace-access-non-constant.js: Added.
(shouldBe):
(import.string_appeared_here.then):
* stress/module-namespace-access-poly.js: Added.
(shouldBe):
(access):
(import.string_appeared_here.then):
* stress/module-namespace-access-transitive-exports.js: Added.
(shouldBe):
(import.string_appeared_here.then):
* stress/module-namespace-access.js: Added.
(shouldBe):
(import.string_appeared_here.then):
* stress/resources/module-namespace-access-transitive-exports-2.js: Added.
(export.cocoa):
(export.change):
* stress/resources/module-namespace-access-transitive-exports.js: Added.
* stress/resources/module-namespace-access.js: Added.
(export.cocoa):
(export.change):

Source/JavaScriptCore:

This patch optimizes accesses to module namespace objects.

1. Cache the resolutions for module namespace objects.

    When constructing the module namespace object, we already resolves all the exports.
    The module namespace object caches this result and leverage it in the later access in
    getOwnPropertySlot. This avoids resolving bindings through resolveExport.

2. Introduce ModuleNamespaceLoad IC.

    This patch adds new IC for module namespace objects. The mechanism is simple, getOwnPropertySlot
    tells us about module namespace object resolution. The IC first checks whether the given object
    is an expected module namespace object. If this check succeeds, we load the value from the module
    environment.

3. Introduce DFG/FTL optimization.

    After exploiting module namespace object accesses in (2), DFG can recognize this in ByteCodeParser.
    DFG will convert it to CheckCell with the namespace object and GetClosureVar from the cached environment.
    At that time, we have a chance to fold it to the constant.

This optimization improves the performance of accessing to module namespace objects.

Before
    $ time ../../WebKitBuild/module-ic-tot/Release/bin/jsc -m module-assert-access-namespace.js
    ../../WebKitBuild/module-ic-tot/Release/bin/jsc -m   0.43s user 0.03s system 101% cpu 0.451 total
    $ time ../../WebKitBuild/module-ic-tot/Release/bin/jsc -m module-assert-access-binding.js
    ../../WebKitBuild/module-ic-tot/Release/bin/jsc -m   0.08s user 0.02s system 103% cpu 0.104 total

After
    $ time ../../WebKitBuild/module-ic/Release/bin/jsc -m module-assert-access-namespace.js
    ../../WebKitBuild/module-ic/Release/bin/jsc -m   0.11s user 0.01s system 106% cpu 0.109 total
    $ time ../../WebKitBuild/module-ic/Release/bin/jsc -m module-assert-access-binding.js
    ../../WebKitBuild/module-ic/Release/bin/jsc -m module-assert-access-binding.j  0.08s user 0.02s system 102% cpu 0.105 total

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/AccessCase.cpp:
(JSC::AccessCase::create):
(JSC::AccessCase::guardedByStructureCheck):
(JSC::AccessCase::canReplace):
(JSC::AccessCase::visitWeak):
(JSC::AccessCase::generateWithGuard):
(JSC::AccessCase::generateImpl):
* bytecode/AccessCase.h:
* bytecode/GetByIdStatus.cpp:
(JSC::GetByIdStatus::GetByIdStatus):
(JSC::GetByIdStatus::computeForStubInfoWithoutExitSiteFeedback):
(JSC::GetByIdStatus::makesCalls):
(JSC::GetByIdStatus::dump):
* bytecode/GetByIdStatus.h:
(JSC::GetByIdStatus::isModuleNamespace):
(JSC::GetByIdStatus::takesSlowPath):
(JSC::GetByIdStatus::moduleNamespaceObject):
(JSC::GetByIdStatus::moduleEnvironment):
(JSC::GetByIdStatus::scopeOffset):
* bytecode/ModuleNamespaceAccessCase.cpp: Added.
(JSC::ModuleNamespaceAccessCase::ModuleNamespaceAccessCase):
(JSC::ModuleNamespaceAccessCase::create):
(JSC::ModuleNamespaceAccessCase::~ModuleNamespaceAccessCase):
(JSC::ModuleNamespaceAccessCase::clone):
(JSC::ModuleNamespaceAccessCase::emit):
* bytecode/ModuleNamespaceAccessCase.h: Added.
(JSC::ModuleNamespaceAccessCase::moduleNamespaceObject):
(JSC::ModuleNamespaceAccessCase::moduleEnvironment):
(JSC::ModuleNamespaceAccessCase::scopeOffset):
* bytecode/PolymorphicAccess.cpp:
(WTF::printInternal):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleModuleNamespaceLoad):
(JSC::DFG::ByteCodeParser::handleGetById):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::loadValue):
* jit/Repatch.cpp:
(JSC::tryCacheGetByID):
* runtime/AbstractModuleRecord.cpp:
(JSC::AbstractModuleRecord::getModuleNamespace):
* runtime/JSModuleNamespaceObject.cpp:
(JSC::JSModuleNamespaceObject::finishCreation):
(JSC::JSModuleNamespaceObject::visitChildren):
(JSC::getValue):
(JSC::JSModuleNamespaceObject::getOwnPropertySlot):
(JSC::JSModuleNamespaceObject::getOwnPropertyNames):
* runtime/JSModuleNamespaceObject.h:
(JSC::isJSModuleNamespaceObject):
(JSC::JSModuleNamespaceObject::create): Deleted.
(JSC::JSModuleNamespaceObject::createStructure): Deleted.
(JSC::JSModuleNamespaceObject::moduleRecord): Deleted.
* runtime/JSModuleRecord.h:
(JSC::JSModuleRecord::moduleEnvironment): Deleted.
* runtime/PropertySlot.h:
(JSC::PropertySlot::PropertySlot):
(JSC::PropertySlot::domJIT):
(JSC::PropertySlot::moduleNamespaceSlot):
(JSC::PropertySlot::setValueModuleNamespace):
(JSC::PropertySlot::setCacheableCustom):

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

3 years agoFix ASAN build after activating libwebrtc.
achristensen@apple.com [Wed, 22 Feb 2017 08:55:30 +0000 (08:55 +0000)]
Fix ASAN build after activating libwebrtc.

* wtf/Ref.h:
__asan_address_is_poisoned returns an int, not a bool.
This didn't cause a problem before because we didn't include the real definition anywhere,
but libwebrtc includes <sanitizer/asan_interface.h> directly now so the return types need to be correct.

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

3 years agoNetworkProcess: Stop disabling buffering when NETWORK_CACHE is disabled in build
carlosgc@webkit.org [Wed, 22 Feb 2017 08:33:41 +0000 (08:33 +0000)]
NetworkProcess: Stop disabling buffering when NETWORK_CACHE is disabled in build
https://bugs.webkit.org/show_bug.cgi?id=168637

Reviewed by Alex Christensen.

It was added in r193752 as part of bug #137692 to fix an infinite loop in network process that happened in EFL
because they didn't enable the network cache at that time. I think that was actually a workaround, and it was
added without any comment so it has stayed there even when EFL enabled disk cache, and now that is gone. Looking
at current code I see no reason why buffering can't work with the disk cache disabled, so I think it's time to
remove that workaround.

* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::maximumBufferingTime):

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

3 years ago[GStreamer] Crash in MediaPlayerPrivateGStreamerMSE::buffered() when MEDIA_STREAM...
carlosgc@webkit.org [Wed, 22 Feb 2017 08:31:53 +0000 (08:31 +0000)]
[GStreamer] Crash in MediaPlayerPrivateGStreamerMSE::buffered() when MEDIA_STREAM is disabled
https://bugs.webkit.org/show_bug.cgi?id=168662

Reviewed by Michael Catanzaro.

When MEDIA_STREAM is disabled, if MediaPlayer::loadWithNextMediaEngine is called with a current engine and
there's no type specified, the next media engine that is used is the MSE one. Since there's no actually a media
stream, the engine is created but never loaded. When buffered is called it tries to use its media source that is
nullptr. It doesn't happen when MEDIA_STREAM is enabled, because the next media engine returned is Owr that
doesn't implement buffered and always returns an empty PlatformTimeRanges.

* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::buffered): Return an empty PlatformTimeRanges if m_mediaSource is nullptr.

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