WebKit-https.git
3 years agoBuild fix: TimerBase::start(double, double) can't be inline and exported,
simon.fraser@apple.com [Sat, 8 Apr 2017 03:53:46 +0000 (03:53 +0000)]
Build fix: TimerBase::start(double, double) can't be inline and exported,
so make it non-inline.

* platform/Timer.cpp:
(WebCore::TimerBase::start):
* platform/Timer.h:
(WebCore::TimerBase::start): Deleted.

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

3 years agoUnreviewed, remove constexpr function since GTK didn't like it.
keith_miller@apple.com [Sat, 8 Apr 2017 03:22:26 +0000 (03:22 +0000)]
Unreviewed, remove constexpr function since GTK didn't like it.

* wtf/PriorityQueue.h:
(WTF::PriorityQueue::parentOf):

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

3 years agoModernize WebPage.h
commit-queue@webkit.org [Sat, 8 Apr 2017 02:26:43 +0000 (02:26 +0000)]
Modernize WebPage.h
https://bugs.webkit.org/show_bug.cgi?id=170633

Patch by Alex Christensen <achristensen@webkit.org> on 2017-04-07
Reviewed by Joseph Pecoraro.

* UIProcess/API/APIUIClient.h:
(API::UIClient::createNewPage):
* UIProcess/API/C/WKPage.cpp:
(WebKit::RunBeforeUnloadConfirmPanelResultListener::create):
(WebKit::RunJavaScriptAlertResultListener::create):
(WebKit::RunJavaScriptConfirmResultListener::create):
(WebKit::RunJavaScriptConfirmResultListener::RunJavaScriptConfirmResultListener):
(WebKit::RunJavaScriptPromptResultListener::create):
(WebKit::RunJavaScriptPromptResultListener::RunJavaScriptPromptResultListener):
(WKPageSetPageUIClient):
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::UIClient::createNewPage):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::loadDataImpl):
(WebKit::WebPage::loadStringImpl):
(WebKit::WebPage::loadData):
(WebKit::WebPage::scaledSnapshotWithOptions):
(WebKit::WebPage::SandboxExtensionTracker::willPerformLoadDragDestinationAction):
(WebKit::WebPage::SandboxExtensionTracker::setPendingProvisionalSandboxExtension):
* WebProcess/WebPage/WebPage.h:

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

3 years agoREGRESSION (r203941): iAd Producer widgets fail to play in iBooks
cdumez@apple.com [Sat, 8 Apr 2017 02:23:12 +0000 (02:23 +0000)]
REGRESSION (r203941): iAd Producer widgets fail to play in iBooks
https://bugs.webkit.org/show_bug.cgi?id=170635
<rdar://problem/30797958>

Reviewed by Daniel Bates.

Extend the MouseEvent::initMouseEvent() workaround we added for iAd Producer
to iBooks since the iBooks widgets generated by iAd Producer contain the same
bug.

* dom/MouseEvent.cpp:
(WebCore::MouseEvent::initMouseEventQuirk):

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

3 years agoStart using MonotonicTime / Seconds in Timer class
cdumez@apple.com [Sat, 8 Apr 2017 01:33:55 +0000 (01:33 +0000)]
Start using MonotonicTime / Seconds in Timer class
https://bugs.webkit.org/show_bug.cgi?id=170625

Reviewed by Simon Fraser.

Source/WebCore:

Start using MonotonicTime / Seconds in Timer class. More work will be needed
for the transition to be complete. I plan to do this in a follow-up.

* page/DOMTimer.cpp:
(WebCore::DOMTimer::alignedFireTime):
* page/DOMTimer.h:
* page/SuspendableTimer.cpp:
(WebCore::SuspendableTimer::suspend):
(WebCore::SuspendableTimer::startRepeating):
(WebCore::SuspendableTimer::startOneShot):
(WebCore::SuspendableTimer::repeatInterval):
(WebCore::SuspendableTimer::augmentFireInterval):
(WebCore::SuspendableTimer::augmentRepeatInterval):
* page/SuspendableTimer.h:
(WebCore::SuspendableTimer::startRepeating):
(WebCore::SuspendableTimer::startOneShot):
(WebCore::SuspendableTimer::augmentFireInterval):
(WebCore::SuspendableTimer::augmentRepeatInterval):
* platform/ThreadTimers.cpp:
(WebCore::ThreadTimers::ThreadTimers):
(WebCore::ThreadTimers::setSharedTimer):
(WebCore::ThreadTimers::updateSharedTimer):
(WebCore::ThreadTimers::sharedTimerFiredInternal):
(WebCore::ThreadTimers::fireTimersInNestedEventLoop):
* platform/ThreadTimers.h:
* platform/Timer.cpp:
(WebCore::TimerHeapLessThanFunction::operator()):
(WebCore::TimerBase::TimerBase):
(WebCore::TimerBase::start):
(WebCore::TimerBase::stop):
(WebCore::TimerBase::nextFireInterval):
(WebCore::TimerBase::heapPop):
(WebCore::TimerBase::updateHeapIfNeeded):
(WebCore::TimerBase::setNextFireTime):
(WebCore::TimerBase::nextUnalignedFireInterval):
* platform/Timer.h:
(WebCore::TimerBase::start):
(WebCore::TimerBase::startOneShot):
(WebCore::TimerBase::repeatInterval):
(WebCore::TimerBase::repeatIntervalSeconds):
(WebCore::TimerBase::augmentFireInterval):
(WebCore::TimerBase::augmentRepeatInterval):
(WebCore::TimerBase::alignedFireTime):
(WebCore::TimerBase::isActive):
* testing/Internals.cpp:
(WebCore::Internals::isTimerThrottled):

Source/WTF:

Add modulo operator to MonotonicTime.

* wtf/MonotonicTime.h:
(WTF::MonotonicTime::operator%):

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

3 years agoAdd a PriorityQueue class
keith_miller@apple.com [Sat, 8 Apr 2017 01:15:09 +0000 (01:15 +0000)]
Add a PriorityQueue class
https://bugs.webkit.org/show_bug.cgi?id=170579

Reviewed by Saam Barati.

Source/JavaScriptCore:

Update Wasm::Worklist to use WTF::PriorityQueue.

* wasm/WasmWorklist.cpp:
(JSC::Wasm::Worklist::enqueue):
(JSC::Wasm::Worklist::completePlanSynchronously):
(JSC::Wasm::Worklist::stopAllPlansForVM):
(JSC::Wasm::Worklist::~Worklist):
(JSC::Wasm::Worklist::iterate): Deleted.
* wasm/WasmWorklist.h:
(JSC::Wasm::Worklist::isHigherPriority):
(JSC::Wasm::Worklist::Comparator::operator()): Deleted.

Source/WTF:

This patch adds a new PriorityQueue class that is backed by
WTF::Vector.  It also has a number of other niceties such as being
able to iterate the queue and increase or decrease keys.

One note is that increaseKey and decreaseKey are O(n) rather than
O(log(n)).  Traditionally, the lookup of the key is done with a
hash map but that's not feasible here.  This is because unless the
queue's element type is a pointer there is no good way maintain a
persistent reference to every entry in the queue while we sift.
The only way to update the location of an entry is to do a hash
table lookup with the entry's hash but this is probably more
expensive than just doing a linear search.

Also, add comparison operator functions, which can be passed to PriorityQueue.

* WTF.xcodeproj/project.pbxproj:
* wtf/MathExtras.h:
(isLessThan):
(isLessThanEqual):
(isGreaterThan):
(isGreaterThanEqual):
* wtf/PriorityQueue.h: Added.
(WTF::PriorityQueue::size):
(WTF::PriorityQueue::isEmpty):
(WTF::PriorityQueue::enqueue):
(WTF::PriorityQueue::peek):
(WTF::PriorityQueue::dequeue):
(WTF::PriorityQueue::decreaseKey):
(WTF::PriorityQueue::increaseKey):
(WTF::PriorityQueue::begin):
(WTF::PriorityQueue::end):
(WTF::PriorityQueue::isValidHeap):
(WTF::PriorityQueue::parentOf):
(WTF::PriorityQueue::leftChildOf):
(WTF::PriorityQueue::rightChildOf):
(WTF::PriorityQueue::siftUp):
(WTF::PriorityQueue::siftDown):

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WTF/PriorityQueue.cpp: Added.
(operator  _z ):
(enqueue):
(dequeue):
(TEST):
(compareMove):

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

3 years agoUnreviewed, update 2 media tests after r215120 so they work on iOS.
cdumez@apple.com [Sat, 8 Apr 2017 01:11:10 +0000 (01:11 +0000)]
Unreviewed, update 2 media tests after r215120 so they work on iOS.

Setting the volume is a no-op on iOS so mute the video instead.

* media/video-restricted-invisible-autoplay-allowed-when-visible.html:
* media/video-restricted-invisible-autoplay-not-allowed.html:

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

3 years agoFix and enable ChakraCore/test/es6/ES6Function_bugs.js after r215072
msaboff@apple.com [Sat, 8 Apr 2017 00:56:24 +0000 (00:56 +0000)]
Fix and enable ChakraCore/test/es6/ES6Function_bugs.js after r215072
https://bugs.webkit.org/show_bug.cgi?id=170580

Reviewed by JF Bastien.

Commented out subtest that expects defineProperty("length") to a getter on a
sealed function shouldn't throw.

* ChakraCore.yaml:
* ChakraCore/test/es6/ES6Function_bugs.js:

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

3 years agoUse audit_token_t instead of pid_t for checking sandbox of other processes
commit-queue@webkit.org [Sat, 8 Apr 2017 00:24:58 +0000 (00:24 +0000)]
Use audit_token_t instead of pid_t for checking sandbox of other processes
https://bugs.webkit.org/show_bug.cgi?id=170616
<rdar://problem/31158189>

Patch by Alex Christensen <achristensen@webkit.org> on 2017-04-07
Reviewed by Daniel Bates.

Source/WebKit2:

pid's can be reused, so it's theoretically unsafe to use the pid of another process to check whether it's sandboxed.
Use an audit_token_t instead to be more sure that we are not mistakenly checking a new process that has reused the
old process's pid. For the current process, though, we have no xpc_connection_t to the process because we are the process.

* PluginProcess/mac/PluginProcessMac.mm:
(WebKit::PluginProcess::initializeSandbox):
* Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
(WebKit::XPCServiceInitializerDelegate::isClientSandboxed):
* Shared/mac/SandboxUtilities.h:
* Shared/mac/SandboxUtilities.mm:
(WebKit::currentProcessIsSandboxed):
(WebKit::connectedProcessIsSandboxed):
(WebKit::processIsSandboxed): Deleted.
* UIProcess/Cocoa/WebProcessProxyCocoa.mm:
(WebKit::WebProcessProxy::platformIsBeingDebugged):
* UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
(WebKit::PluginInfoStore::shouldUsePlugin):
* UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
(WebKit::PluginProcessProxy::platformGetLaunchOptions):

Source/WTF:

* wtf/spi/darwin/SandboxSPI.h:
Declare more SPI.

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

3 years agoSource/JavaScriptCore:
commit-queue@webkit.org [Sat, 8 Apr 2017 00:21:26 +0000 (00:21 +0000)]
Source/JavaScriptCore:
WebGPU: implement ComputeCommandEncoder and related components
https://bugs.webkit.org/show_bug.cgi?id=170444

Patch by Yuichiro Kikura <y.kikura@gmail.com> on 2017-04-07
Reviewed by Alex Christensen.

I added some identifiers related with WebGPUComputeCommandEncoder based on the proposal.
https://webkit.org/wp-content/uploads/webgpu-api-proposal.html

* runtime/CommonIdentifiers.h:

Source/WebCore:
WebGPU: implement ComputeCommandEncoder and related components
https://bugs.webkit.org/show_bug.cgi?id=170444

Patch by Yuichiro Kikura <y.kikura@gmail.com> on 2017-04-07
Reviewed by Alex Christensen.

I implemented WebGPUComputeCommandEncoder and related components based on the WebGPU proposal.
https://webkit.org/wp-content/uploads/webgpu-api-proposal.html

Test: fast/canvas/webgpu/webgpu-dispatch.html

* CMakeLists.txt:
* DerivedSources.make:
* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSWebGPUCommandBufferCustom.cpp: Added.
(WebCore::JSWebGPUCommandBuffer::completed):
* html/canvas/WebGPUCommandBuffer.cpp:
(WebCore::WebGPUCommandBuffer::createComputeCommandEncoder):
* html/canvas/WebGPUCommandBuffer.h:
* html/canvas/WebGPUCommandBuffer.idl:
* html/canvas/WebGPUComputeCommandEncoder.cpp: Added.
(WebCore::GPUSizeMake):
(WebCore::WebGPUComputeCommandEncoder::create):
(WebCore::WebGPUComputeCommandEncoder::WebGPUComputeCommandEncoder):
(WebCore::WebGPUComputeCommandEncoder::~WebGPUComputeCommandEncoder):
(WebCore::WebGPUComputeCommandEncoder::setComputePipelineState):
(WebCore::WebGPUComputeCommandEncoder::setBuffer):
(WebCore::WebGPUComputeCommandEncoder::dispatch):
(WebCore::WebGPUComputeCommandEncoder::endEncoding):
* html/canvas/WebGPUComputeCommandEncoder.h: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.h.
(WebCore::WebGPUComputeCommandEncoder::computeCommandEncoder):
* html/canvas/WebGPUComputeCommandEncoder.idl: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.idl.
* html/canvas/WebGPUComputePipelineState.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUCommandBuffer.cpp.
(WebCore::WebGPUComputePipelineState::create):
(WebCore::WebGPUComputePipelineState::WebGPUComputePipelineState):
(WebCore::WebGPUComputePipelineState::~WebGPUComputePipelineState):
* html/canvas/WebGPUComputePipelineState.h: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.h.
(WebCore::WebGPUComputePipelineState::computePipelineState):
* html/canvas/WebGPUComputePipelineState.idl: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.idl.
* html/canvas/WebGPURenderingContext.cpp:
(WebCore::WebGPURenderingContext::createComputePipelineState):
* html/canvas/WebGPURenderingContext.h:
* html/canvas/WebGPURenderingContext.idl:
* html/canvas/WebGPUSize.h: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.idl.
* html/canvas/WebGPUSize.idl: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.idl.
* platform/graphics/cocoa/GPUCommandBufferMetal.mm:
(WebCore::GPUCommandBuffer::completed):
* platform/graphics/cocoa/GPUComputeCommandEncoderMetal.mm: Added.
(WebCore::MTLSizeMake):
(WebCore::GPUComputeCommandEncoder::GPUComputeCommandEncoder):
(WebCore::GPUComputeCommandEncoder::setComputePipelineState):
(WebCore::GPUComputeCommandEncoder::setBuffer):
(WebCore::GPUComputeCommandEncoder::dispatch):
(WebCore::GPUComputeCommandEncoder::endEncoding):
(WebCore::GPUComputeCommandEncoder::platformComputeCommandEncoder):
* platform/graphics/cocoa/GPUComputePipelineStateMetal.mm: Copied from Source/WebCore/platform/graphics/gpu/GPUCommandBuffer.cpp.
(WebCore::GPUComputePipelineState::GPUComputePipelineState):
(WebCore::GPUComputePipelineState::platformComputePipelineState):
* platform/graphics/gpu/GPUCommandBuffer.cpp:
(WebCore::GPUCommandBuffer::createComputeCommandEncoder):
* platform/graphics/gpu/GPUCommandBuffer.h:
* platform/graphics/gpu/GPUComputeCommandEncoder.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUCommandBuffer.cpp.
(WebCore::GPUComputeCommandEncoder::create):
(WebCore::GPUComputeCommandEncoder::~GPUComputeCommandEncoder):
(WebCore::GPUComputeCommandEncoder::setComputePipelineState):
(WebCore::GPUComputeCommandEncoder::setBuffer):
(WebCore::GPUComputeCommandEncoder::endEncoding):
* platform/graphics/gpu/GPUComputeCommandEncoder.h: Copied from Source/WebCore/platform/graphics/gpu/GPUCommandBuffer.h.
* platform/graphics/gpu/GPUComputePipelineState.cpp: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.idl.
(WebCore::GPUComputePipelineState::create):
(WebCore::GPUComputePipelineState::~GPUComputePipelineState):
* platform/graphics/gpu/GPUComputePipelineState.h: Copied from Source/WebCore/platform/graphics/gpu/GPUCommandBuffer.h.
* platform/graphics/gpu/GPUSize.h: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.idl.

LayoutTests:
WebGPU: implement ComputeCommandEncoder and related components
https://bugs.webkit.org/show_bug.cgi?id=170444

Patch by Yuichiro Kikura <y.kikura@gmail.com> on 2017-04-07
Reviewed by Alex Christensen.

Added a test case to ensure ComputeCommandEncoder is dispatched successfully

* fast/canvas/webgpu/webgpu-dispatch-expected.txt: Added.
* fast/canvas/webgpu/webgpu-dispatch.html: Added.

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

3 years agoEnable SSE4 and NEON optimizations of libopus where available
commit-queue@webkit.org [Sat, 8 Apr 2017 00:00:45 +0000 (00:00 +0000)]
Enable SSE4 and NEON optimizations of libopus where available
https://bugs.webkit.org/show_bug.cgi?id=170592

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

* Configurations/opus.xcconfig:
* libwebrtc.xcodeproj/project.pbxproj:

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

3 years ago[WK2][iOS] Add CoreMedia entitlement for WebProcess
bfulgham@apple.com [Fri, 7 Apr 2017 23:59:25 +0000 (23:59 +0000)]
[WK2][iOS] Add CoreMedia entitlement for WebProcess
https://bugs.webkit.org/show_bug.cgi?id=170623
<rdar://problem/30020073>

Reviewed by Youenn Fablet.

Add new "com.apple.tcc.delegated-services" entitlement to allow CoreMedia
to work properly in WebRTC.

* Configurations/WebContent-iOS.entitlements:

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

3 years agoVersioning.
jmarcell@apple.com [Fri, 7 Apr 2017 23:11:32 +0000 (23:11 +0000)]
Versioning.

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

3 years agoPrivate browsing sessions should not look in keychain for client certificates
commit-queue@webkit.org [Fri, 7 Apr 2017 23:02:41 +0000 (23:02 +0000)]
Private browsing sessions should not look in keychain for client certificates
https://bugs.webkit.org/show_bug.cgi?id=170618
<rdar://problem/18457427>

Patch by Alex Christensen <achristensen@webkit.org> on 2017-04-07
Reviewed by Dan Bernstein.

Source/WebCore:

Our client certificate testing in WebKit leaves much to be desired.
See rdar://problem/17694210 for reproduction steps.

* platform/spi/cf/CFNetworkSPI.h:
Add some new SPI.

Source/WebKit2:

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::configurationForSessionID):

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

3 years agoSimple line layout: FlowContents::segmentIndexForRunSlow skips empty runs.
zalan@apple.com [Fri, 7 Apr 2017 22:48:22 +0000 (22:48 +0000)]
Simple line layout: FlowContents::segmentIndexForRunSlow skips empty runs.
https://bugs.webkit.org/show_bug.cgi?id=170552

Reviewed by Antti Koivisto.

Source/WebCore:

The compare function passed to std::lower_bound completely misses empty runs.

Test: fast/text/simple-line-layout-hover-over-subsequent-linebreaks.html

* rendering/SimpleLineLayoutFlowContents.cpp:
(WebCore::SimpleLineLayout::FlowContents::segmentIndexForRunSlow):

LayoutTests:

* fast/text/simple-line-layout-hover-over-subsequent-linebreaks-expected.txt: Added.
* fast/text/simple-line-layout-hover-over-subsequent-linebreaks.html: Added.

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

3 years agoWe should log how much CPU a background process was using when killing it due to...
cdumez@apple.com [Fri, 7 Apr 2017 22:22:24 +0000 (22:22 +0000)]
We should log how much CPU a background process was using when killing it due to CPU limiting
https://bugs.webkit.org/show_bug.cgi?id=170619

Reviewed by Andreas Kling.

Source/WebCore:

CPUMonitor now passes the CPU usage to the callback when it exceeds the threashold.

* platform/CPUMonitor.cpp:
(WebCore::CPUMonitor::timerFired):
* platform/CPUMonitor.h:

Source/WebKit2:

* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::updateBackgroundCPUMonitorState):

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

3 years agoMark media/modern-media-controls/media-controller/media-controller-auto-hide-mouse...
ryanhaddad@apple.com [Fri, 7 Apr 2017 22:13:22 +0000 (22:13 +0000)]
Mark media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-leave-after-play.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=168540

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years agoMark inspector/codemirror/prettyprinting-css.html as a flaky timeout.
ryanhaddad@apple.com [Fri, 7 Apr 2017 22:13:19 +0000 (22:13 +0000)]
Mark inspector/codemirror/prettyprinting-css.html as a flaky timeout.
https://bugs.webkit.org/show_bug.cgi?id=170615

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years agoAudible autoplay videos should not get paused when outside the viewport
cdumez@apple.com [Fri, 7 Apr 2017 22:04:50 +0000 (22:04 +0000)]
Audible autoplay videos should not get paused when outside the viewport
https://bugs.webkit.org/show_bug.cgi?id=170610
<rdar://problem/31505984>

Reviewed by Eric Carlson.

Source/WebCore:

Audible autoplay videos should not get paused when outside the viewport as this
would be observable by the user.

Test: media/video-restricted-invisible-autoplay-allowed-if-audible.html

* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::autoplayPermitted):

LayoutTests:

Add layout test coverage.

* media/video-restricted-invisible-autoplay-allowed-if-audible-expected.txt: Added.
* media/video-restricted-invisible-autoplay-allowed-if-audible.html: Copied from LayoutTests/media/video-restricted-invisible-autoplay-not-allowed.html.
* media/video-restricted-invisible-autoplay-allowed-when-visible.html:
* media/video-restricted-invisible-autoplay-not-allowed.html:

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

3 years agoReplace ES6SampleBench by ARES-6 in run-benchmark
rniwa@webkit.org [Fri, 7 Apr 2017 21:52:22 +0000 (21:52 +0000)]
Replace ES6SampleBench by ARES-6 in run-benchmark
https://bugs.webkit.org/show_bug.cgi?id=170585

Reviewed by Saam Barati.

Updated the plan file for ES6SampleBench to run ARES-6 instead. Also increased the number of iterations
from 4 to 8 to match teh default, and reduced the number of browser instances to use from 5 to 3.

* Scripts/webkitpy/benchmark_runner/data/patches/ARES-6.patch: Renamed from ES6SampleBench.patch.
* Scripts/webkitpy/benchmark_runner/data/plans/ares6.plan: Renamed from es6bench.plan.

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

3 years agoMake cycler page scroll down when a dashboard is too tall for the current viewport...
rniwa@webkit.org [Fri, 7 Apr 2017 21:45:45 +0000 (21:45 +0000)]
Make cycler page scroll down when a dashboard is too tall for the current viewport size
https://bugs.webkit.org/show_bug.cgi?id=170588

Rubber-stamped by Chris Dumez.

Updated the cycler page to scroll down smoothly over 500ms and scroll up again before moving to the next page
when a dashboard page is too tall to be shown at once. For now, we assume that each dashboard's height is no
more than 2x the height of the viewport.

* public/cycler.html:

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

3 years agoREGRESSION(r211382): Complex text with justification erroneously overflows containers
mmaxfield@apple.com [Fri, 7 Apr 2017 21:37:57 +0000 (21:37 +0000)]
REGRESSION(r211382): Complex text with justification erroneously overflows containers
https://bugs.webkit.org/show_bug.cgi?id=170399
<rdar://problem/31442008>

Reviewed by Simon Fraser.

Source/WebCore:

When we perform justification, we adjust glyphs' advances to add extra space between words.
ComplexTextController maintains an invariant where m_totalWidth is equal to the sum of these
advances. However, in RTL text, inserting extra justification space to the left of a glyph
would break that invariant, and would increase the advances of two glyphs instead of just
one. Then, when we go to draw the text, the sum of the advances is wider than m_totalWidth,
which means the glyphs would be drawn outside of their container.

This regressed in r211382 simply because of an oversight and because there were no tests for
this codepath.

Test: ComplexTextControllerTest.TotalWidthWithJustification

* platform/graphics/ComplexTextController.cpp:
(WebCore::ComplexTextController::adjustGlyphsAndAdvances):
* rendering/InlineBox.h:
(WebCore::InlineBox::InlineBox):

Tools:

Check for the invariant that the sum of the advances is equal to m_totalWidth.

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

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

3 years agoThrottle / Align DOM Timers in cross-origin iframes to 30fps
cdumez@apple.com [Fri, 7 Apr 2017 20:49:49 +0000 (20:49 +0000)]
Throttle / Align DOM Timers in cross-origin iframes to 30fps
https://bugs.webkit.org/show_bug.cgi?id=170613
<rdar://problem/31506444>

Reviewed by Simon Fraser.

Source/WebCore:

Throttle / Align DOM Timers in cross-origin iframes to 30fps unless the user
has interacted with them, in order to reduce power use.

Test: http/tests/frame-throttling/timer-throttle-in-cross-origin-subframe.html

* dom/Document.cpp:
(WebCore::Document::domTimerAlignmentInterval):
(WebCore::Document::updateLastHandledUserGestureTimestamp):
* page/DOMTimer.h:

LayoutTests:

Add layout test coverage.

* http/tests/frame-throttling/resources/timer-throttling-frame.html: Added.
* http/tests/frame-throttling/timer-throttle-in-cross-origin-subframe-expected.txt: Added.
* http/tests/frame-throttling/timer-throttle-in-cross-origin-subframe.html: Added.

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

3 years agoFollow-up fix for Soup platform.
wilander@apple.com [Fri, 7 Apr 2017 19:57:03 +0000 (19:57 +0000)]
Follow-up fix for Soup platform.
https://bugs.webkit.org/show_bug.cgi?id=170322

Unreviewed build fix. Error introduced by me in
https://trac.webkit.org/changeset/215104/webkit.

No new tests.

* platform/network/soup/SocketStreamHandleImpl.h:
    Move parameter change to the right
    SocketStreamHandleImpl::create() function.

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

3 years agoWebAssembly: Module::getOrCreateCodeBlock is wrong
sbarati@apple.com [Fri, 7 Apr 2017 19:42:37 +0000 (19:42 +0000)]
WebAssembly: Module::getOrCreateCodeBlock is wrong
https://bugs.webkit.org/show_bug.cgi?id=170612

Reviewed by Keith Miller.

When we were getting a module's CodeBlock, we were checking if !runnable(),
and if !runnable(), we were re-creating the CodeBlock. This is wrong, since
!runnable() is true while the CodeBlock is compiling. Instead, we should check
if we've finished compiling, and if so, if that compilation failed.

* wasm/WasmModule.cpp:
(JSC::Wasm::Module::getOrCreateCodeBlock):

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

3 years agoWeb Inspector: DOM/XHR breakpoint tree elements shouldn't persist their represented...
mattbaker@apple.com [Fri, 7 Apr 2017 19:31:06 +0000 (19:31 +0000)]
Web Inspector: DOM/XHR breakpoint tree elements shouldn't persist their represented objects
https://bugs.webkit.org/show_bug.cgi?id=170611
<rdar://problem/31506161>

Reviewed by Joseph Pecoraro.

Prevent tree elements for DOM and XHR breakpoints from persisting their
represented objects.

* UserInterface/Views/ContentView.js:
(WebInspector.ContentView.createFromRepresentedObject):
* UserInterface/Views/NavigationSidebarPanel.js:
(WebInspector.NavigationSidebarPanel.prototype._isTreeElementWithoutRepresentedObject):

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

3 years ago[ios-simulator] API test WebKit2.WKWebProcessPlugInRangeHandle timing out
ryanhaddad@apple.com [Fri, 7 Apr 2017 19:28:09 +0000 (19:28 +0000)]
[ios-simulator] API test WebKit2.WKWebProcessPlugInRangeHandle timing out
https://bugs.webkit.org/show_bug.cgi?id=167594

Unreviewed test gardening.

Disable this test because it is still timing out on the bots.

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

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

3 years agoMissing conversion from window to content coordinates when adjusting unobscured conte...
wenson_hsieh@apple.com [Fri, 7 Apr 2017 19:17:35 +0000 (19:17 +0000)]
Missing conversion from window to content coordinates when adjusting unobscured content rects for input view
https://bugs.webkit.org/show_bug.cgi?id=170603

Reviewed by Simon Fraser.

Refactors -[WKContentView _computeUnobscuredContentRectRespectingInputViewBounds:unobscuredContentRect:inputViewBounds:scale:]
to convert the input view bounds into content coordinates instead of using the zoom scale to adjust the height of inputViewBounds.
Covered by the existing LayoutTest, fixed-element-on-bottom-with-keyboard.html.

* UIProcess/ios/WKContentView.mm:
(-[WKContentView _computeUnobscuredContentRectRespectingInputViewBounds:unobscuredContentRect:inputViewBounds:scale:]):

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

3 years agoRebaseline another test after r215096.
ryanhaddad@apple.com [Fri, 7 Apr 2017 19:13:54 +0000 (19:13 +0000)]
Rebaseline another test after r215096.
https://bugs.webkit.org/show_bug.cgi?id=170561
<rdar://problem/7415154>

Unreviewed test gardening.

* web-platform-tests/url/url-setters-expected.txt:

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

3 years agoREGRESSION (r214553): Allow layout-tests to be run from Xcode without re-directing...
jbedard@apple.com [Fri, 7 Apr 2017 19:07:33 +0000 (19:07 +0000)]
REGRESSION (r214553): Allow layout-tests to be run from Xcode without re-directing stdout, stdin and stderr
https://bugs.webkit.org/show_bug.cgi?id=170601
<rdar://problem/31492696>

Reviewed by Simon Fraser.

* TestRunnerShared/IOSLayoutTestCommunication.cpp:
(setUpIOSLayoutTestCommunication): Skip TCP setup if no port is in the environment.
(tearDownIOSLayoutTestCommunication): Only teardown if TCP was used.

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

3 years agoAdd support for test262 JavaScriptCore tests
aakash_jain@apple.com [Fri, 7 Apr 2017 19:06:51 +0000 (19:06 +0000)]
Add support for test262 JavaScriptCore tests
https://bugs.webkit.org/show_bug.cgi?id=170523

Reviewed by Daniel Bates.

* BuildSlaveSupport/build.webkit.org-config/config.json: Added bot433 and bot434.
* BuildSlaveSupport/build.webkit.org-config/master.cfg:
(RunTest262Tests): Added class to run Test262 tests.
(RunTest262Tests.start): Added.
(RunTest262Tests.countFailures): Method to count the failures.
(Test262Factory): Added Test262 factory class.
* BuildSlaveSupport/build.webkit.org-config/mastercfg_unittest.py:
(RunTest262TestsTest): Added unit tests.
(RunTest262TestsTest.assertResults): Helper method.
(RunTest262TestsTest.test_no_regressions_output): Added test case.
(test_failure_output): Same.
(test_failures_output): Same.

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

3 years agoInclude cstdio before using sscanf and stderr
commit-queue@webkit.org [Fri, 7 Apr 2017 19:03:59 +0000 (19:03 +0000)]
Include cstdio before using sscanf and stderr
https://bugs.webkit.org/show_bug.cgi?id=170098

Patch by Ting-Wei Lan <lantw44@gmail.com> on 2017-04-07
Reviewed by Michael Catanzaro.

* wtf/NumberOfCores.cpp:

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

3 years ago[GTK] Various build errors when plugin support is disabled
mcatanzaro@igalia.com [Fri, 7 Apr 2017 18:52:58 +0000 (18:52 +0000)]
[GTK] Various build errors when plugin support is disabled
https://bugs.webkit.org/show_bug.cgi?id=170015

Reviewed by Carlos Garcia Campos.

.:

Allow building with ENABLE_NETSCAPE_PLUGIN_API=ON and ENABLE_X11_TARGET=OFF. This should be
possible as Carlos worked to ensure windowless plugins work properly outside X11. The GTK2
plugin process still depends on ENABLE_X11_TARGET because a plugin that uses GTK+ surely
wants to display a window, and is not going to work outside X11. (If the plugin links to
GTK+ but does not display a window, it's dumb and deserves to be broken.)

Also, make ENABLE_PLUGIN_PROCESS conditional on ENABLE_NETSCAPE_PLUGIN_API, not
ENABLE_X11_TARGET.

* Source/cmake/OptionsGTK.cmake:

Source/WebKit2:

* PluginProcess/unix/PluginControllerProxyUnix.cpp:
* UIProcess/API/gtk/WebKitWebsiteData.cpp:
(recordContainsSupportedDataTypes):
(toWebKitWebsiteDataTypes):
* UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:
(toWebsiteDataTypes):

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

3 years ago[JSC] Change --debug option to --debugger
commit-queue@webkit.org [Fri, 7 Apr 2017 18:49:57 +0000 (18:49 +0000)]
[JSC] Change --debug option to --debugger
https://bugs.webkit.org/show_bug.cgi?id=170587

Patch by Caio Lima <ticaiolima@gmail.com> on 2017-04-07
Reviewed by Keith Miller.

* Scripts/run-jsc:

This patch is changing the new debugger flag for Tools/Scripts/run-jsc
to --debugger to avoid shadowing --debug flag used to run JSC with
Debug build.

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

3 years agoWebSocket streams should have network usage attributed to correct process
wilander@apple.com [Fri, 7 Apr 2017 18:36:03 +0000 (18:36 +0000)]
WebSocket streams should have network usage attributed to correct process
https://bugs.webkit.org/show_bug.cgi?id=170322
<rdar://problem/26413551>

Reviewed by Alex Christensen.

Source/WebCore:

Tested manually since it requires a per-app VPN.

* page/SocketProvider.cpp:
(WebCore::SocketProvider::createSocketStreamHandle):
    Sends in an empty struct since it doesn't have access to
    platform dependent sourceApplicationAuditData.
* platform/network/SocketStreamHandle.h:
    Declaration of a per-platform struct to hold CF data for
    Cocoa platforms.
* platform/network/cf/SocketStreamHandleImpl.h:
(WebCore::SocketStreamHandleImpl::create):
    Now takes WebCore::SourceApplicationAuditToken which is
    passed on to the constructor.
* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
(WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):
    Now takes WebCore::SourceApplicationAuditToken which is
    passed on to the streams once created.
(WebCore::SocketStreamHandleImpl::createStreams):
    Now sets kCFStreamPropertySourceApplication for the two
    streams.
* platform/network/curl/SocketStreamHandleImpl.h:
(WebCore::SocketStreamHandleImpl::create):
    Added unused WebCore::SourceApplicationAuditToken parameter.
* platform/network/soup/SocketStreamHandleImpl.h:
* platform/network/soup/SocketStreamHandleImplSoup.cpp:
(WebCore::SocketStreamHandleImpl::create):
    Added unused WebCore::SourceApplicationAuditToken parameter.

Source/WebKit2:

Changes here are due to the added WebCore::SourceApplicationAuditToken parameter
in WebCore::SocketStreamHandleImpl::create().
WebKit::NetworkSocketStream takes it and passes it on.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::createSocketStream):
* NetworkProcess/NetworkSocketStream.cpp:
(WebKit::NetworkSocketStream::create):
(WebKit::NetworkSocketStream::NetworkSocketStream):
* NetworkProcess/NetworkSocketStream.h:

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

3 years agoWebAssembly: Make to a compilation API that allows for multi-VM concurrent compilatio...
sbarati@apple.com [Fri, 7 Apr 2017 18:25:14 +0000 (18:25 +0000)]
WebAssembly: Make to a compilation API that allows for multi-VM concurrent compilations of Wasm Modules
https://bugs.webkit.org/show_bug.cgi?id=170488

Reviewed by JF Bastien.

Source/JavaScriptCore:

This patch adds a class called Wasm::Module. It contains the bits from
JSWebAssemblyModule that were not VM specific. JSWebAssemblyModule
now has a Ref<Wasm::Module>. Similarly, there is now a Wasm::CodeBlock,
which owns the non-VM-specific bits that JSWebAssemblyCodeBlock used
to own.

This patch also simplifies how we verify and compile code. Wasm::Module
now has an API for both sync/async validation and compilation. This
API abstracts away how Wasm::Plan works.

This is hopefully the last patch needed before we can implement
window.postMessage for a JSWebAssemblyModule. I think all that's
needed now to implement postMessage is simply creating a new
JSWebAssemblyModule with the underlying Wasm::Module.

This patch is neutral on WasmBench.

Finally, this patch changes the promise deferred timer to
allow for new tasks to be added while we're executing
a task. Before, we'd deadlock if this happened.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* jsc.cpp:
(functionTestWasmModuleFunctions):
* runtime/PromiseDeferredTimer.cpp:
(JSC::PromiseDeferredTimer::doWork):
(JSC::PromiseDeferredTimer::scheduleWorkSoon):
* runtime/PromiseDeferredTimer.h:
* wasm/WasmB3IRGenerator.cpp:
* wasm/WasmBinding.cpp:
(JSC::Wasm::wasmToJs):
(JSC::Wasm::wasmToWasm):
(JSC::Wasm::exitStubGenerator): Deleted.
* wasm/WasmBinding.h:
* wasm/WasmCodeBlock.cpp: Added.
(JSC::Wasm::CodeBlock::CodeBlock):
(JSC::Wasm::CodeBlock::waitUntilFinished):
(JSC::Wasm::CodeBlock::compileAsync):
(JSC::Wasm::CodeBlock::isSafeToRun):
* wasm/WasmCodeBlock.h: Added.
(JSC::Wasm::CodeBlock::create):
(JSC::Wasm::CodeBlock::compilationFinished):
(JSC::Wasm::CodeBlock::runnable):
(JSC::Wasm::CodeBlock::errorMessage):
(JSC::Wasm::CodeBlock::functionImportCount):
(JSC::Wasm::CodeBlock::jsEntrypointCalleeFromFunctionIndexSpace):
(JSC::Wasm::CodeBlock::wasmEntrypointCalleeFromFunctionIndexSpace):
* wasm/WasmModule.cpp: Added.
(JSC::Wasm::Module::Module):
(JSC::Wasm::makeValidationResult):
(JSC::Wasm::Module::validateSyncImpl):
(JSC::Wasm::Module::getOrCreateCodeBlock):
(JSC::Wasm::Module::compileSync):
(JSC::Wasm::Module::makeValidationCallback):
(JSC::Wasm::Module::compileAsync):
* wasm/WasmModule.h: Added.
(JSC::Wasm::Module::create):
(JSC::Wasm::Module::validateSync):
(JSC::Wasm::Module::validateAsync):
(JSC::Wasm::Module::signatureIndexFromFunctionIndexSpace):
(JSC::Wasm::Module::moduleInformation):
(JSC::Wasm::Module::nonNullCodeBlock):
* wasm/WasmPlan.cpp:
(JSC::Wasm::Plan::Plan):
(JSC::Wasm::Plan::addCompletionTask):
(JSC::Wasm::Plan::prepare):
(JSC::Wasm::Plan::compileFunctions):
(JSC::Wasm::Plan::complete):
(JSC::Wasm::Plan::tryRemoveVMAndCancelIfLast):
(JSC::Wasm::Plan::cancel): Deleted.
* wasm/WasmPlan.h:
(JSC::Wasm::Plan::dontFinalize):
(JSC::Wasm::Plan::takeWasmToWasmExitStubs):
(JSC::Wasm::Plan::mode):
(JSC::Wasm::Plan::takeWasmExitStubs): Deleted.
(JSC::Wasm::Plan::vm): Deleted.
* wasm/WasmWorklist.cpp:
(JSC::Wasm::Worklist::stopAllPlansForVM):
* wasm/js/JSWebAssemblyCodeBlock.cpp:
(JSC::JSWebAssemblyCodeBlock::JSWebAssemblyCodeBlock):
(JSC::JSWebAssemblyCodeBlock::isSafeToRun):
(JSC::JSWebAssemblyCodeBlock::initialize): Deleted.
* wasm/js/JSWebAssemblyCodeBlock.h:
(JSC::JSWebAssemblyCodeBlock::create):
(JSC::JSWebAssemblyCodeBlock::functionImportCount):
(JSC::JSWebAssemblyCodeBlock::jsEntrypointCalleeFromFunctionIndexSpace):
(JSC::JSWebAssemblyCodeBlock::wasmEntrypointCalleeFromFunctionIndexSpace):
(JSC::JSWebAssemblyCodeBlock::wasmToJsCallStubForImport):
(JSC::JSWebAssemblyCodeBlock::mode): Deleted.
(JSC::JSWebAssemblyCodeBlock::initialized): Deleted.
(JSC::JSWebAssemblyCodeBlock::plan): Deleted.
(JSC::JSWebAssemblyCodeBlock::runnable): Deleted.
(JSC::JSWebAssemblyCodeBlock::errorMessage): Deleted.
(JSC::JSWebAssemblyCodeBlock::setJSEntrypointCallee): Deleted.
(JSC::JSWebAssemblyCodeBlock::setWasmEntrypointCallee): Deleted.
* wasm/js/JSWebAssemblyInstance.cpp:
(JSC::JSWebAssemblyInstance::finalizeCreation):
(JSC::JSWebAssemblyInstance::addUnitializedCodeBlock): Deleted.
* wasm/js/JSWebAssemblyInstance.h:
(JSC::JSWebAssemblyInstance::initialized): Deleted.
* wasm/js/JSWebAssemblyModule.cpp:
(JSC::JSWebAssemblyModule::createStub):
(JSC::JSWebAssemblyModule::JSWebAssemblyModule):
(JSC::JSWebAssemblyModule::finishCreation):
* wasm/js/JSWebAssemblyModule.h:
(JSC::JSWebAssemblyModule::moduleInformation):
(JSC::JSWebAssemblyModule::signatureIndexFromFunctionIndexSpace):
(JSC::JSWebAssemblyModule::module):
* wasm/js/WebAssemblyFunction.cpp:
(JSC::WebAssemblyFunction::create):
* wasm/js/WebAssemblyInstanceConstructor.cpp:
(JSC::constructJSWebAssemblyInstance):
* wasm/js/WebAssemblyModuleConstructor.cpp:
(JSC::WebAssemblyModuleConstructor::createModule):
* wasm/js/WebAssemblyPrototype.cpp:
(JSC::reject):
(JSC::webAssemblyCompileFunc):
(JSC::resolve):
(JSC::instantiate):
(JSC::compileAndInstantiate):
(JSC::webAssemblyValidateFunc):

Source/WTF:

* wtf/SharedTask.h: Make SharedTaskFunctor forward its arguments.

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

3 years agoREGRESSION(r204512): WebSocket errors with "Failed to send WebSocket frame." if...
achristensen@apple.com [Fri, 7 Apr 2017 18:15:22 +0000 (18:15 +0000)]
REGRESSION(r204512): WebSocket errors with "Failed to send WebSocket frame."  if too much data is sent
https://bugs.webkit.org/show_bug.cgi?id=170463

Reviewed by Michael Catanzaro.

This only reproduces when using WebSockets to communicate with an external server.
When communicating with a local server, CFWriteStreamWrite succeeds too reliably, so
CFWriteStreamCanAcceptBytes returns true, when sometimes it doesn't when communicating
across the real internet.

* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
(WebCore::SocketStreamHandleImpl::platformSendInternal):
* platform/network/soup/SocketStreamHandleImplSoup.cpp:
(WebCore::SocketStreamHandleImpl::platformSendInternal):
Returning std::nullopt means there was an error, which is not true when the socket stream
is in a state where it cannot be written to because it is actively communicating.
Returning 0 means 0 new bytes were sent, so we will try again later.

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

3 years agoUnreviewed, fix missing return value warning
mcatanzaro@igalia.com [Fri, 7 Apr 2017 18:01:12 +0000 (18:01 +0000)]
Unreviewed, fix missing return value warning

* UIProcess/WebProcessProxy.cpp:
(WebKit::diagnosticLoggingKeyForSimulatedCrashReason):

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

3 years agoMediaSample should store video sample rotation instead of orientation
eric.carlson@apple.com [Fri, 7 Apr 2017 17:29:40 +0000 (17:29 +0000)]
MediaSample should store video sample rotation instead of orientation
https://bugs.webkit.org/show_bug.cgi?id=170598

Reviewed by Youenn Fablet.

No new tests, no functional change.

* platform/MediaSample.h:
(WebCore::MediaSample::videoRotation):
(WebCore::MediaSample::videoOrientation): Deleted.
* platform/graphics/avfoundation/MediaSampleAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::videoTransformationMatrix):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayLayer):

* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::processNewFrame):

* platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
(WebCore::RealtimeIncomingVideoSource::OnFrame):
(WebCore::RealtimeIncomingVideoSource::processNewSample):
* platform/mediastream/mac/RealtimeIncomingVideoSource.h:

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

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

3 years agoRebaseline additional tests after r215096.
bfulgham@apple.com [Fri, 7 Apr 2017 16:57:35 +0000 (16:57 +0000)]
Rebaseline additional tests after r215096.
https://bugs.webkit.org/show_bug.cgi?id=170561
<rdar://problem/7415154>

LayoutTests/imported/w3c:

* web-platform-tests/cors/allow-headers-expected.txt:
* web-platform-tests/cors/origin-expected.txt:

LayoutTests:

* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-cross-in-cross-none-block-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-cross-in-cross-self-block-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-cross-in-same-none-block-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-cross-in-same-self-block-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-same-in-cross-none-block-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-same-in-cross-self-block-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-same-in-same-none-block-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-none-block-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-self-block-expected.txt:
* http/tests/security/no-popup-from-sandbox-top-expected.txt:
* http/tests/xmlhttprequest/origin-exact-matching-expected.txt:

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

3 years ago[CMake][Windows] WebKitGUID.lib should be built with the release CRT
commit-queue@webkit.org [Fri, 7 Apr 2017 16:22:06 +0000 (16:22 +0000)]
[CMake][Windows] WebKitGUID.lib should be built with the release CRT
https://bugs.webkit.org/show_bug.cgi?id=170593

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-04-07
Reviewed by Brent Fulgham.

Source/cmake/OptionsWin.cmake has a trick to force using the
release CRT even for debug build configuration. But, this works
only for C++, but for C. As the result, WebKitGUID.lib is built
with the debug CRT in debug build configuration because it has C
source files.

* Source/cmake/OptionsWin.cmake: Process CMAKE_C_FLAGS_* as well as CMAKE_CXX_FLAGS_*.

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

3 years agoWebKit should percent encode single quotes in query strings
bfulgham@apple.com [Fri, 7 Apr 2017 16:02:10 +0000 (16:02 +0000)]
WebKit should percent encode single quotes in query strings
https://bugs.webkit.org/show_bug.cgi?id=170561
<rdar://problem/7415154>

Reviewed by Alex Christensen.

Source/WebCore:

Modify the characterClassTable to instruct the URLParser to convert
the single-quote character ' to %27 in URL query strings.

Tests: URLParserTest in TestWebKitAPI.
    fast/events/popup-blocked-from-unique-frame-via-window-open-named-sibling-frame.html
    fast/frames/xss-auditor-handles-file-urls.html
    http/tests/security/xssAuditor

* platform/URLParser.cpp:

Tools:

Add a test case for single-quote in the URL query string.

* TestWebKitAPI/Tests/WebCore/URLParser.cpp:

LayoutTests:

Rebaseline tests after change.

* fast/events/popup-blocked-from-unique-frame-via-window-open-named-sibling-frame-expected.txt:
* fast/frames/xss-auditor-handles-file-urls-expected.txt:
* http/tests/security/xssAuditor/base-href-control-char-expected.txt:
* http/tests/security/xssAuditor/base-href-expected.txt:
* http/tests/security/xssAuditor/base-href-null-char-expected.txt:
* http/tests/security/xssAuditor/base-href-scheme-relative-expected.txt:
* http/tests/security/xssAuditor/embed-tag-control-char-expected.txt:
* http/tests/security/xssAuditor/embed-tag-expected.txt:
* http/tests/security/xssAuditor/embed-tag-javascript-url-expected.txt:
* http/tests/security/xssAuditor/embed-tag-null-char-expected.txt:
* http/tests/security/xssAuditor/form-action-expected.txt:
* http/tests/security/xssAuditor/formaction-on-button-expected.txt:
* http/tests/security/xssAuditor/formaction-on-input-expected.txt:
* http/tests/security/xssAuditor/frameset-injection-expected.txt:
* http/tests/security/xssAuditor/full-block-base-href-expected.txt:
* http/tests/security/xssAuditor/full-block-link-onclick-expected.txt:
* http/tests/security/xssAuditor/full-block-object-tag-expected.txt:
* http/tests/security/xssAuditor/full-block-script-tag-with-source-expected.txt:
* http/tests/security/xssAuditor/iframe-injection-expected.txt:
* http/tests/security/xssAuditor/iframe-javascript-url-more-encoding-expected.txt:
* http/tests/security/xssAuditor/img-onerror-non-ASCII-char-default-encoding-expected.txt:
* http/tests/security/xssAuditor/img-onerror-non-ASCII-char-expected.txt:
* http/tests/security/xssAuditor/link-onclick-ampersand-expected.txt:
* http/tests/security/xssAuditor/link-onclick-control-char-expected.txt:
* http/tests/security/xssAuditor/link-onclick-entities-expected.txt:
* http/tests/security/xssAuditor/link-onclick-expected.txt:
* http/tests/security/xssAuditor/link-onclick-null-char-expected.txt:
* http/tests/security/xssAuditor/object-embed-tag-control-char-expected.txt:
* http/tests/security/xssAuditor/object-embed-tag-expected.txt:
* http/tests/security/xssAuditor/object-embed-tag-null-char-expected.txt:
* http/tests/security/xssAuditor/object-tag-expected.txt:
* http/tests/security/xssAuditor/object-tag-javascript-url-expected.txt:
* http/tests/security/xssAuditor/script-tag-expression-follows-expected.txt:
* http/tests/security/xssAuditor/script-tag-with-16bit-unicode4-expected.txt:
* http/tests/security/xssAuditor/script-tag-with-16bit-unicode5-expected.txt:
* http/tests/security/xssAuditor/script-tag-with-comma-01-expected.txt:
* http/tests/security/xssAuditor/script-tag-with-source-control-char-expected.txt:
* http/tests/security/xssAuditor/script-tag-with-source-entities-expected.txt:
* http/tests/security/xssAuditor/script-tag-with-source-expected.txt:
* http/tests/security/xssAuditor/script-tag-with-source-null-char-expected.txt:
* http/tests/security/xssAuditor/script-tag-with-source-same-host-with-query-expected.txt:
* http/tests/security/xssAuditor/svg-animate-expected.txt:
* http/tests/security/xssAuditor/svg-script-tag-expected.txt:
* http/tests/security/xssAuditor/xss-filter-bypass-big5-expected.txt:
* http/tests/security/xssAuditor/xss-filter-bypass-sjis-expected.txt:

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

3 years agoImprove some WebRTC flaky tests
commit-queue@webkit.org [Fri, 7 Apr 2017 15:24:09 +0000 (15:24 +0000)]
Improve some WebRTC flaky tests
https://bugs.webkit.org/show_bug.cgi?id=170584

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

* webrtc/libwebrtc/descriptionGetters.html:
* webrtc/video-replace-track-to-null.html:

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

3 years agoText insertion cursor disappears after pressing enter
zalan@apple.com [Fri, 7 Apr 2017 15:05:43 +0000 (15:05 +0000)]
Text insertion cursor disappears after pressing enter
https://bugs.webkit.org/show_bug.cgi?id=169291
<rdar://problem/30899611>

Reviewed by Tim Horton.

Source/WebCore:

Positon upstream/downstream (as the result of VisiblePosition -> canonicalPosition) require
linebox tree. In addition to regular text, we need to bail out of simple line layout on line breaks too.

Test: editing/simple-line-layout-caret-is-gone.html

* dom/Position.cpp:
(WebCore::ensureLineBoxesIfNeeded):
(WebCore::Position::upstream):
(WebCore::Position::downstream):
(WebCore::Position::getInlineBoxAndOffset):
* rendering/RenderLineBreak.cpp:
(WebCore::RenderLineBreak::ensureLineBoxes):
(WebCore::RenderLineBreak::positionForPoint):
(WebCore::RenderLineBreak::setSelectionState):
(WebCore::RenderLineBreak::collectSelectionRects):
(WebCore::ensureLineBoxes): Deleted.
* rendering/RenderLineBreak.h:

LayoutTests:

* editing/simple-line-layout-caret-is-gone-expected.txt: Added.
* editing/simple-line-layout-caret-is-gone.html: Added.

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

3 years ago[GTK] Fix codec name in OWR ASSERT
commit-queue@webkit.org [Fri, 7 Apr 2017 14:13:26 +0000 (14:13 +0000)]
[GTK] Fix codec name in OWR ASSERT
https://bugs.webkit.org/show_bug.cgi?id=170600

Patch by Xan Lopez <xlopez@igalia.com> on 2017-04-07
Reviewed by Carlos Garcia Campos.

* platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
(WebCore::MediaEndpointOwr::prepareMediaSession): uppercase the
codec name we are looking for, that's how they appear in the
vector.

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

3 years agoAdd hasVideo property to WebAVPlayerController.
pvollan@apple.com [Fri, 7 Apr 2017 13:43:37 +0000 (13:43 +0000)]
Add hasVideo property to WebAVPlayerController.
https://bugs.webkit.org/show_bug.cgi?id=170545
rdar://problem/31325182

Reviewed by Eric Carlson.

Add a new "hasVideo" property which can be used to discover if any video content is present in the playback item,
whether video content is currently enabled or not.

* platform/ios/WebAVPlayerController.h:
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(WebVideoFullscreenInterfaceAVKit::hasVideoChanged):

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

3 years ago[GTK+] Animations not played properly when using synchronous decoding
magomez@igalia.com [Fri, 7 Apr 2017 12:52:27 +0000 (12:52 +0000)]
[GTK+] Animations not played properly when using synchronous decoding
https://bugs.webkit.org/show_bug.cgi?id=170591

Reviewed by Carlos Garcia Campos.

Fix an index error when destroying decoded frames that was sometimes deleting the frame we wanted
to keep.

Covered by exitent tests.

* platform/graphics/ImageFrameCache.cpp:
(WebCore::ImageFrameCache::destroyDecodedData):

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

3 years ago[GTK] Add message about missing codecs to ASSERT in OWR
commit-queue@webkit.org [Fri, 7 Apr 2017 12:01:00 +0000 (12:01 +0000)]
[GTK] Add message about missing codecs to ASSERT in OWR
https://bugs.webkit.org/show_bug.cgi?id=170596

Patch by Xan Lopez <xan@igalia.com> on 2017-04-07
Reviewed by Carlos Garcia Campos.

* platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
(WebCore::MediaEndpointOwr::prepareMediaSession): add a message
about the missing coded to the ASSERT.

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

3 years agoAX: Don't crash if no renderer is available for AccessibilityRenderObject
tpopela@redhat.com [Fri, 7 Apr 2017 11:59:28 +0000 (11:59 +0000)]
AX: Don't crash if no renderer is available for AccessibilityRenderObject
https://bugs.webkit.org/show_bug.cgi?id=170448

Reviewed by Chris Fleizach.

Don't crash or assert if no renderer is available, but early return
gracefully (as in other places in the AccessibilityRenderObject.cpp).
Spotted by running some tests through dogtail.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::isOffScreen):
(WebCore::AccessibilityRenderObject::isUnvisited):
(WebCore::AccessibilityRenderObject::isVisited):

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

3 years ago[GTK] Update the priorities used in glib main loop sources
carlosgc@webkit.org [Fri, 7 Apr 2017 10:43:43 +0000 (10:43 +0000)]
[GTK] Update the priorities used in glib main loop sources
https://bugs.webkit.org/show_bug.cgi?id=170457

Reviewed by Žan Doberšek.

Source/JavaScriptCore:

* runtime/JSRunLoopTimer.cpp:
(JSC::JSRunLoopTimer::JSRunLoopTimer):

Source/WebCore:

* platform/glib/MainThreadSharedTimerGLib.cpp:
(WebCore::MainThreadSharedTimer::MainThreadSharedTimer):
* platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
(WebCore::TextureMapperPlatformLayerProxy::TextureMapperPlatformLayerProxy):
(WebCore::TextureMapperPlatformLayerProxy::activateOnCompositingThread):

Source/WebKit2:

* Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
(WebKit::CompositingRunLoop::CompositingRunLoop):
* UIProcess/DrawingAreaProxyImpl.cpp:
(WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl):
(WebKit::DrawingAreaProxyImpl::DrawingMonitor::DrawingMonitor):
* UIProcess/gtk/WaylandCompositor.cpp:
(WebKit::createWaylandLoopSource):
* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::AcceleratedDrawingArea):
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
(WebKit::CompositingCoordinator::CompositingCoordinator):
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
(WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::DrawingAreaImpl):

Source/WTF:

Add an enum to define prirorities used in different GLib main sources. It allows to give them a better name
than high, low, medium, etc., but also to document them and other GLib based ports can define their own
values without changing all the places where they are used. The default values are based on the priorities
pre-defined by GLib.

* wtf/glib/MainThreadGLib.cpp:
(WTF::MainThreadDispatcher::MainThreadDispatcher):
* wtf/glib/RunLoopGLib.cpp:
(WTF::RunLoop::RunLoop):
(WTF::RunLoop::dispatchAfter):
(WTF::RunLoop::TimerBase::TimerBase):
* wtf/glib/RunLoopSourcePriority.h: Added.
* wtf/linux/MemoryPressureHandlerLinux.cpp:
(WTF::MemoryPressureHandler::EventFDPoller::EventFDPoller):

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

3 years ago[GCrypt] Implement AES_CBC support
zandobersek@gmail.com [Fri, 7 Apr 2017 07:37:36 +0000 (07:37 +0000)]
[GCrypt] Implement AES_CBC support
https://bugs.webkit.org/show_bug.cgi?id=170550

Reviewed by Michael Catanzaro.

Implement the CryptoAlgorithmAES_CBC::platform{Encrypt,Decrypt}
functionality for configurations that use libgcrypt. This is done
by leveraging the gcry_cipher_* APIs for the AES algorithm that's
deduced appropriately from the key size and the CBC cipher mode.
Additionally, the PKCS#7 padding is implemented for each operation,
as demanded by the Web Crypto specification.

No new tests -- current ones cover this sufficiently, but are not yet
enabled due to missing platform-specific SUBTLE_CRYPTO implementations.

* crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp:
(WebCore::gcryptEncrypt):
(WebCore::gcryptDecrypt):
(WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):

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

3 years ago[GCrypt] Implement raw and JWK imports and exports for EC keys
zandobersek@gmail.com [Fri, 7 Apr 2017 07:36:35 +0000 (07:36 +0000)]
[GCrypt] Implement raw and JWK imports and exports for EC keys
https://bugs.webkit.org/show_bug.cgi?id=170546

Reviewed by Michael Catanzaro.

Source/WebCore:

Implement import and export operations for EC keys, covering the raw
and JWK import/export types.

CryptoKeyEC::platformImportRaw() builds a public-key s-expression,
providing the curve name and the key data, and yields the gcry_sexp_t
object to the new CryptoKeyEC.

CryptoKeyEC::platformImportJWKPublic() first constructs a Vector<uint8_t>
object that contains the EC point in the uncompressed format. It then
puts that data into a newly-constructed public-key s-expression that is
then used to construct the new CryptoKeyEC object.

CryptoKeyEC::platformImportJWKPrivate() constructs the EC point data just
the same, but it also lays out the private key field element data into
the private-key s-expression that's then handed off to the CryptoKeyEC
object.

CryptoKeyEC::platformExportRaw() constructs a new EC operations context
and then uses it to retrieve the q parameter as an MPI. A Vector<uint8_t>
is retrieved from the MPI data through the extractMPIData() helper
function.

CryptoKeyEC::platformAddFieldElements() similarly uses the EC operations
context to retrieve the q parameter data, which it then splits into the
x and y field elements and Base64 URL-encodes them into a form that can
be placed in a JsonWebKey. If the key is private, the d parameter is
retrieved in the same fashion and again Base64 URL-encoded and stored
in the JsonWebKey object.

No new tests -- current ones cover this sufficiently, but are not yet
enabled due to other missing platform-specific SUBTLE_CRYPTO
implementations.

* crypto/gcrypt/CryptoKeyECGCrypt.cpp:
(WebCore::uncompressedPointSizeForCurve):
(WebCore::uncompressedFieldElementSizeForCurve):
(WebCore::extractMPIData):
(WebCore::CryptoKeyEC::platformImportRaw):
(WebCore::CryptoKeyEC::platformImportJWKPublic):
(WebCore::CryptoKeyEC::platformImportJWKPrivate):
(WebCore::CryptoKeyEC::platformExportRaw):
(WebCore::CryptoKeyEC::platformAddFieldElements):

Source/WebCore/PAL:

Add HandleDeleter specizalizations for gcry_ctx_t and gcry_mpi_t types.

* pal/crypto/gcrypt/Handle.h:
(PAL::GCrypt::HandleDeleter<gcry_ctx_t>::operator()):
(PAL::GCrypt::HandleDeleter<gcry_mpi_t>::operator()):

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

3 years ago[GCrypt] Implement CryptoKeyRSA::generatePair()
zandobersek@gmail.com [Fri, 7 Apr 2017 07:35:21 +0000 (07:35 +0000)]
[GCrypt] Implement CryptoKeyRSA::generatePair()
https://bugs.webkit.org/show_bug.cgi?id=170350

Reviewed by Michael Catanzaro.

Start implementing the libgcrypt-based platform bits of CryptoKeyRSA.

Implement generatePair() by constructing a genkey s-expression
that requests a generation of an RSA key that should use a modulus
of the specified bit-length and the specified exponent. The exponent
is extracted from an uint8_t array through a helper function. The
modulus length value is checked to be at least 16, since libgcrypt
does not support generating primes of less than that length in bits.

The returned s-expression upon request will contain the data for
both the public and the private key. gcry_sexp_t handles representing
those s-expressions are then passed to CryptoKeyRSA::create() before
invoking the success callback with a new CryptoKeyPair object in a
separate ScriptExecutionContext task.

The CryptoKeyRSA constructor simply has the notImplemented() call
removed. The destructor now invokes the HandleDeleter<gcry_sexp_t>
object instance to destroy the object represented by the
m_platformKey handle.

The methods in CryptoKeyRSA.cpp are also reordered to follow the
declaration order used in the header.

No new tests -- current ones cover this sufficiently, but are not yet
enabled due to other missing platform-specific SUBTLE_CRYPTO
implementations.

* crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
(WebCore::CryptoKeyRSA::CryptoKeyRSA):
(WebCore::CryptoKeyRSA::~CryptoKeyRSA):
(WebCore::exponentVectorToUInt32):
(WebCore::CryptoKeyRSA::generatePair):
(WebCore::CryptoKeyRSA::importSpki):
(WebCore::CryptoKeyRSA::importPkcs8):
(WebCore::CryptoKeyRSA::exportPkcs8):
(WebCore::CryptoKeyRSA::buildAlgorithm):
(WebCore::CryptoKeyRSA::exportData):
* crypto/keys/CryptoKeyRSA.h:

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

3 years agoAdd WKContentExtensionStore.h and WKContentExtension.h to public WebKit.h
commit-queue@webkit.org [Fri, 7 Apr 2017 03:45:32 +0000 (03:45 +0000)]
Add WKContentExtensionStore.h and WKContentExtension.h to public WebKit.h
https://bugs.webkit.org/show_bug.cgi?id=170533

Patch by Alex Christensen <achristensen@webkit.org> on 2017-04-06
Reviewed by Daniel Bates.

* Shared/API/Cocoa/WebKit.h:
In r213696 I added two public headers.  All public headers in WebKit are included with
#import <WebKit/WebKit.h>

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

3 years ago[Debug] ASSERT(!throwScope.exception()) on imported/w3c/web-platform-tests/fetch...
commit-queue@webkit.org [Fri, 7 Apr 2017 02:45:45 +0000 (02:45 +0000)]
[Debug] ASSERT(!throwScope.exception()) on imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status-worker.html
https://bugs.webkit.org/show_bug.cgi?id=170395
<rdar://problem/31394017>

Patch by Youenn Fablet <youenn@apple.com> on 2017-04-06
Reviewed by Mark Lam.

* bindings/js/JSDOMPromise.cpp:
(WebCore::DeferredPromise::reject): Exiting early in case of scope having an exception.
Adding an assertion to ensure this is a worker termination exception.

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

3 years agoWeb Inspector: Source Map Resources should show up in the Debugger Sources list
commit-queue@webkit.org [Fri, 7 Apr 2017 02:40:46 +0000 (02:40 +0000)]
Web Inspector: Source Map Resources should show up in the Debugger Sources list
https://bugs.webkit.org/show_bug.cgi?id=170581
<rdar://problem/31269140>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-04-06
Reviewed by Matt Baker.

* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel):
Include SourceMapResources in the DebuggerSidebar's Sources tree outline.

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

3 years agoMake FontWithFeatures test font pass OTS
mmaxfield@apple.com [Fri, 7 Apr 2017 00:59:57 +0000 (00:59 +0000)]
Make FontWithFeatures test font pass OTS
https://bugs.webkit.org/show_bug.cgi?id=169788

Reviewed by Tim Horton.

Tools:

OTS, or the OpenType Sanitizer, is a check which tells if fonts are properly formed.
Previously, our FontWithFeatures test font did not pass this check. This patch updates
the font to pass the checks. Now, we can use this font on other platforms, and
contribute the font to the W3C for testing the CSS Fonts level 3 spec.

* FontWithFeatures/FontWithFeatures/FontCreator.cpp:
(Generator::appendCFFTable):
(Generator::Feature::operator<):
(Generator::appendGSUBTable):
(Generator::appendOS2Table):
(Generator::appendFormat4CMAPTable):
(Generator::appendHEADTable):
(Generator::appendHHEATable):
(Generator::NameRecord::operator<):
(Generator::appendNameSubtable):
(Generator::appendNAMETable):

LayoutTests:

Updated font to the one which passes the tests.

* css3/resources/FontWithFeatures.otf:

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

3 years agoDisable flaky WebKit2.ResizeWithHiddenContentDoesNotHang
ap@apple.com [Fri, 7 Apr 2017 00:53:31 +0000 (00:53 +0000)]
Disable flaky WebKit2.ResizeWithHiddenContentDoesNotHang
for https://bugs.webkit.org/show_bug.cgi?id=170195

* TestWebKitAPI/Tests/WebKit2Cocoa/AnimatedResize.mm:

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

3 years agoLayoutTest crypto/subtle/aes-ctr-encrypt-malformed-parameters.html is a flaky failure
jiewen_tan@apple.com [Fri, 7 Apr 2017 00:47:51 +0000 (00:47 +0000)]
LayoutTest crypto/subtle/aes-ctr-encrypt-malformed-parameters.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=170571

Unreviewed.

* crypto/subtle/aes-ctr-encrypt-malformed-parameters-expected.txt:
* crypto/subtle/aes-ctr-encrypt-malformed-parameters.html:

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

3 years agoWeb Inspector: Hangs when loading under SpeculativeLoad::shouldCaptureExtraNetworkLoa...
joepeck@webkit.org [Fri, 7 Apr 2017 00:39:43 +0000 (00:39 +0000)]
Web Inspector: Hangs when loading under SpeculativeLoad::shouldCaptureExtraNetworkLoadMetrics
https://bugs.webkit.org/show_bug.cgi?id=170575

Rubber-stamped by Brian Burg.

* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
(WebKit::NetworkCache::SpeculativeLoad::shouldCaptureExtraNetworkLoadMetrics): Deleted.
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
m_networkLoad is a wrapper around `this` as the client, so we would infinite loop here.

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

3 years agoInaudible background tabs should become eligible for memory kill after 8 minutes
akling@apple.com [Fri, 7 Apr 2017 00:39:24 +0000 (00:39 +0000)]
Inaudible background tabs should become eligible for memory kill after 8 minutes
https://bugs.webkit.org/show_bug.cgi?id=170574
<rdar://problem/31488686>

Reviewed by Gavin Barraclough.

Lower the delay for potentially marking background tabs as inactive from 60 minutes to 8 minutes.
Letting a tab misbehave in the background for an entire hour was overly charitable.

* page/PerformanceMonitor.cpp:

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

3 years agoUnreviewed, rolling out r214973.
commit-queue@webkit.org [Fri, 7 Apr 2017 00:39:22 +0000 (00:39 +0000)]
Unreviewed, rolling out r214973.
https://bugs.webkit.org/show_bug.cgi?id=170578

Causes issues in Safari (Requested by bradee-oh on #webkit).

Reverted changeset:

"Refactor so WebsiteDataStores always have a StorageManager."
https://bugs.webkit.org/show_bug.cgi?id=170521
http://trac.webkit.org/changeset/214973

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

3 years agoScroll offset jumps after a programmatic scroll in an overflow container with scroll...
wenson_hsieh@apple.com [Fri, 7 Apr 2017 00:38:42 +0000 (00:38 +0000)]
Scroll offset jumps after a programmatic scroll in an overflow container with scroll snapping
https://bugs.webkit.org/show_bug.cgi?id=170560
<rdar://problem/31484693>

Reviewed by Tim Horton.

Source/WebCore:

Test: css3/scroll-snap/scroll-snap-programmatic-overflow-scroll.html

Logic for maintaining the scroll snap state in ScrollController was previously removed from iOS when refactoring
ScrollController. This was done because scroll snapping on iOS is driven not by the ScrollController (as it is
on Mac) but rather by sending scroll snap offsets to the UI process and hooking into UIScrollView delegates to
handle retargeted scrolling.

However, on iOS, this ScrollController state is still important for the purposes of keeping the last active
snap point index in sync with the UI process when the scroll offset changes outside of a user gesture (i.e.
programmatic scrolling). Since the UI process does not get a chance to update the active snap offset during a
programmatic scroll, our last active snap offset state was only being updated to the last snap position that the
user manually scrolled to, making programmatic scrolling jump to this offset.

To fix this, we need to update scroll snap state on iOS within ScrollController. Also adds a new Layout test
that exercises programmatic scrolling in an overflow scrolling container on all platforms.

* platform/cocoa/ScrollController.mm:
(WebCore::otherScrollEventAxis):
(WebCore::ScrollController::updateScrollSnapState):
(WebCore::ScrollController::updateScrollSnapPoints):

LayoutTests:

Add a test verifying that programmatically changing the scroll offset of an overflow container does not cause the
scroll offset to jump back to the last active snap position. See WebCore ChangeLog for more details.

* css3/scroll-snap/scroll-snap-programmatic-overflow-scroll-expected.txt: Added.
* css3/scroll-snap/scroll-snap-programmatic-overflow-scroll.html: Added.

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

3 years agoFix broken link.
dino@apple.com [Fri, 7 Apr 2017 00:36:53 +0000 (00:36 +0000)]
Fix broken link.

* demos/webgpu/index.html:

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

3 years agoRename allocateStack to allocateStackByGraphColoring.
fpizlo@apple.com [Fri, 7 Apr 2017 00:26:53 +0000 (00:26 +0000)]
Rename allocateStack to allocateStackByGraphColoring.

Rubber stamped by Saam Barati.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* b3/air/AirAllocateStack.cpp: Removed.
* b3/air/AirAllocateStack.h: Removed.
* b3/air/AirAllocateStackByGraphColoring.cpp: Copied from Source/JavaScriptCore/b3/air/AirAllocateStack.cpp.
(JSC::B3::Air::allocateStackByGraphColoring):
(JSC::B3::Air::allocateStack): Deleted.
* b3/air/AirAllocateStackByGraphColoring.h: Copied from Source/JavaScriptCore/b3/air/AirAllocateStack.h.
* b3/air/AirGenerate.cpp:
(JSC::B3::Air::prepareForGeneration):

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

3 years agoCannot Object.seal() or Object.freeze() global "this"
msaboff@apple.com [Fri, 7 Apr 2017 00:16:18 +0000 (00:16 +0000)]
Cannot Object.seal() or Object.freeze() global "this"
https://bugs.webkit.org/show_bug.cgi?id=170549

Reviewed by Mark Lam.

JSTests:

Enabled failing tests fixed by the corresponding code change:
    ChakraCore/test/LetConst/delete.js
    ChakraCore/test/LetConst/dop.js
    ChakraCore/test/LetConst/dop1.js

* ChakraCore.yaml:
* ChakraCore/test/LetConst/dop.baseline-jsc: Added JSC specific expected output.
* ChakraCore/test/LetConst/dop1.baseline-jsc: Added JSC specific expected output.

Source/JavaScriptCore:

Needed to implement JSProxy::isExtensible() which returns the results of calling
the same on wrapped object.

Implemented step 11 of Runtime Semantics: EvalDeclarationInstantiation from the ECMAScript
spec to properly return a TypeError object when attempting to add properties to a
non-extensible global object.

* interpreter/Interpreter.cpp:
(JSC::Interpreter::execute):
* runtime/JSProxy.cpp:
(JSC::JSProxy::isExtensible):
* runtime/JSProxy.h:

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

3 years agoLinear scan should run liveness only once
fpizlo@apple.com [Fri, 7 Apr 2017 00:11:16 +0000 (00:11 +0000)]
Linear scan should run liveness only once
https://bugs.webkit.org/show_bug.cgi?id=170569

Reviewed by Keith Miller.

Source/JavaScriptCore:

Air has a longstanding design bug that Tmps from different banks are indexed independently. This
means that all of our analyses over Tmps do separate GP and FP passes. This does have some
marginal benefits (the rest of the algorithm is specialized for Bank) but it's probably net bad.
However, I don't want to think about solving that general problem.

Instead, this just makes linear scan use a UnifiedTmpLiveness that uses a single "linear"
indexing for GP and FP. This lets me avoid the much larger refactoring (which would involve
substantial changes in graph coloring) while getting the bulk of the benefit (liveness runs once,
instead of twice, for linear scan).

This patch implements a lot of plumbing to make it possible for Liveness<> to view Tmps as having
a unified indexing scheme. Tmp calls this LinearlyIndexed (to match the naming convention of
AbsolutelyIndexed and Indexed), while AirLiveness calls this UnifiedTmpLiveness. With this
change, -O1 never does any liveness analysis that uses separate GP and FP passes. I think this
eliminates any urgency from the larger Tmp indexing bug. We can probably live with graph coloring
doing separate passes.

This is a ~6% speed-up for wasm -O1 compile times. I think this means that linear scan is no
longer the longest pole in the tent.

* JavaScriptCore.xcodeproj/project.pbxproj:
* b3/B3VariableLiveness.h:
(JSC::B3::VariableLivenessAdapter::prepareToCompute):
* b3/air/AirAllocateRegistersByLinearScan.cpp:
(JSC::B3::Air::allocateRegistersByLinearScan):
* b3/air/AirCode.h:
(JSC::B3::Air::Code::forEachTmp):
* b3/air/AirLiveness.h:
* b3/air/AirLivenessAdapter.h:
(JSC::B3::Air::LivenessAdapter::Actions::Actions):
(JSC::B3::Air::LivenessAdapter::LivenessAdapter):
(JSC::B3::Air::LivenessAdapter::adapter):
(JSC::B3::Air::LivenessAdapter::prepareToCompute):
(JSC::B3::Air::LivenessAdapter::actionsAt):
(JSC::B3::Air::LivenessAdapter::forEachUse):
(JSC::B3::Air::LivenessAdapter::forEachDef):
(JSC::B3::Air::TmpLivenessAdapter::numIndices):
(JSC::B3::Air::UnifiedTmpLivenessAdapter::UnifiedTmpLivenessAdapter):
(JSC::B3::Air::UnifiedTmpLivenessAdapter::numIndices):
(JSC::B3::Air::UnifiedTmpLivenessAdapter::acceptsBank):
(JSC::B3::Air::UnifiedTmpLivenessAdapter::acceptsRole):
(JSC::B3::Air::UnifiedTmpLivenessAdapter::valueToIndex):
(JSC::B3::Air::UnifiedTmpLivenessAdapter::indexToValue):
* b3/air/AirLivenessConstraints.h: Removed.
* b3/air/AirRegLiveness.h:
(JSC::B3::Air::RegLiveness::LocalCalc::LocalCalc):
* b3/air/AirTmp.cpp:
* b3/air/AirTmp.h:
* b3/air/AirTmpInlines.h:
(JSC::B3::Air::Tmp::LinearlyIndexed::LinearlyIndexed):
(JSC::B3::Air::Tmp::LinearlyIndexed::index):
(JSC::B3::Air::Tmp::linearlyIndexed):
(JSC::B3::Air::Tmp::indexEnd):
(JSC::B3::Air::Tmp::absoluteIndexEnd):
(JSC::B3::Air::Tmp::linearIndexEnd):
(JSC::B3::Air::Tmp::tmpForAbsoluteIndex):
(JSC::B3::Air::Tmp::tmpForLinearIndex):
* b3/air/AirTmpMap.h: Added.
(JSC::B3::Air::TmpMap::TmpMap):
(JSC::B3::Air::TmpMap::resize):
(JSC::B3::Air::TmpMap::clear):
(JSC::B3::Air::TmpMap::operator[]):
(JSC::B3::Air::TmpMap::append):

Source/WTF:

Have Liveness<> call Adapter::prepareToCompute(), since this makes it a lot easier to implement
constraint generation, since the constraint generator now gets to run after the Adapter is fully
constructed.

* wtf/IndexMap.h:
(WTF::IndexMap::append): Also make this a bit more versatile.
* wtf/Liveness.h:
(WTF::Liveness::LocalCalc::Iterable::contains):
(WTF::Liveness::Iterable::contains):
(WTF::Liveness::compute):

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

3 years agoThrottle requestAnimationFrame in cross-origin iframes to 30fps
simon.fraser@apple.com [Fri, 7 Apr 2017 00:04:10 +0000 (00:04 +0000)]
Throttle requestAnimationFrame in cross-origin iframes to 30fps
https://bugs.webkit.org/show_bug.cgi?id=170534

Reviewed by Dan Bates.

Source/WebCore:

Add a throttling reason to ScriptedAnimationController which is NonInteractedCrossOriginFrame,
set on cross-origin iframes whose documents have never seen a user interaction. It's cleared
as soon as an interaction on this frame or a child frame is detected.

Move the initialization of the LowPowerMode throttling reason to Document::requestAnimationFrame(),
since it's more appropriate to compute NonInteractedCrossOriginFrame here than down in ScriptedAnimationController,
and best to do both in the same place.

Tests: http/tests/frame-throttling/raf-throttle-in-cross-origin-subframe.html

* dom/Document.cpp:
(WebCore::Document::requestAnimationFrame):
(WebCore::Document::updateLastHandledUserGestureTimestamp):
* dom/Document.h:
(WebCore::Document::hasHadUserInteraction):
* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::ScriptedAnimationController):
(WebCore::throttlingReasonToString):
(WebCore::ScriptedAnimationController::interval):
* dom/ScriptedAnimationController.h:
* loader/FrameLoader.cpp:
(WebCore::shouldAskForNavigationConfirmation):

LayoutTests:

* http/tests/frame-throttling/raf-throttle-in-cross-origin-subframe-expected.txt: Added.
* http/tests/frame-throttling/raf-throttle-in-cross-origin-subframe.html: Added.
* http/tests/frame-throttling/resources/requestAnimationFrame-frame.html: Added.

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

3 years agoUse the Accelerate framework to optimize FEColorMatrix operations
simon.fraser@apple.com [Fri, 7 Apr 2017 00:01:29 +0000 (00:01 +0000)]
Use the Accelerate framework to optimize FEColorMatrix operations
https://bugs.webkit.org/show_bug.cgi?id=170518

Reviewed by Tim Horton.

On macOS and iOS, we can use the Accelerate framework (vImage) to do color matrix
math to optimize color matrix, hue rotate, saturation and luminosity to alpha filters.

Change ImageBuffer::getUnmultipliedImageData() and getPremultipliedImageData() to
return the size of the returned Uint8ClampedArray in physical pixels, because we
need to pass that to vImage.

* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::getImageData):
* platform/graphics/ImageBuffer.h:
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBuffer::getUnmultipliedImageData):
(WebCore::ImageBuffer::getPremultipliedImageData):
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::getUnmultipliedImageData):
(WebCore::ImageBuffer::getPremultipliedImageData):
* platform/graphics/filters/FEColorMatrix.cpp:
(WebCore::effectApplyAccelerated):
(WebCore::effectType):
(WebCore::FEColorMatrix::platformApplySoftware):
* platform/graphics/filters/FEDropShadow.cpp:
(WebCore::FEDropShadow::platformApplySoftware):
* platform/graphics/win/ImageBufferDirect2D.cpp:
(WebCore::ImageBuffer::getUnmultipliedImageData):
(WebCore::ImageBuffer::getPremultipliedImageData):

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

3 years agoDo some minor FEColorMatrix code cleanup and optimization
simon.fraser@apple.com [Fri, 7 Apr 2017 00:01:25 +0000 (00:01 +0000)]
Do some minor FEColorMatrix code cleanup and optimization
https://bugs.webkit.org/show_bug.cgi?id=170474

Reviewed by Dean Jackson.

Don't switch inside of a pixel processing loop; repeat the loop inside switch (filterType).

Change matrix() and saturateAndHueRotate() to dereference the source pixels once, instead
of multiple times, which is faster.

This kind of code benefits from aligning things with spaces for readability, so do so,
violating webkit style.

Add some off-by-default performance logging code.

Increases pixel processing performance from about 86ms per megapixel to 65ms per megapixel.

* platform/graphics/filters/FEColorMatrix.cpp:
(WebCore::matrix):
(WebCore::saturateAndHueRotate):
(WebCore::effectType):
(WebCore::FEColorMatrix::platformApplySoftware):

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

3 years agoUnreviewed, rolling out r215041.
ryanhaddad@apple.com [Thu, 6 Apr 2017 23:24:44 +0000 (23:24 +0000)]
Unreviewed, rolling out r215041.

The LayoutTest for this change is failing on ios-simulator.

Reverted changeset:

"Rendering flexbox children across columns"
https://bugs.webkit.org/show_bug.cgi?id=164166
http://trac.webkit.org/changeset/215041

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

3 years agoUnreviewed, rolling out r215046.
ryanhaddad@apple.com [Thu, 6 Apr 2017 23:11:45 +0000 (23:11 +0000)]
Unreviewed, rolling out r215046.

This change broke internal builds.

Reverted changeset:

"WebRTC tests gardening"
https://bugs.webkit.org/show_bug.cgi?id=170508
http://trac.webkit.org/changeset/215046

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

3 years agoWeb Inspector: Only Capture Extra Network Load Metrics when there is a Web Inspector...
commit-queue@webkit.org [Thu, 6 Apr 2017 22:58:08 +0000 (22:58 +0000)]
Web Inspector: Only Capture Extra Network Load Metrics when there is a Web Inspector Frontend
https://bugs.webkit.org/show_bug.cgi?id=170525

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-04-06
Reviewed by Youenn Fablet.

Source/WebCore:

Covered by existing tests that when Web Inspector is open we enable collecting the extra data.

* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::firstFrontendCreated):
(WebCore::InspectorInstrumentation::lastFrontendDeleted):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::frontendCreated):
(WebCore::InspectorInstrumentation::frontendDeleted):
When the first frontend is created enable a new loader strategy to
collect extra network load metrics. When the last frontend is closed
disable the extra metrics.

* loader/LoaderStrategy.h:
* platform/PlatformStrategies.h:
New load strategy to enable/disable new metrics.

Source/WebKit:

* WebCoreSupport/WebResourceLoadScheduler.h:

Source/WebKit2:

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
Only collect extra metrics if the WebProcess this load is for has enabled
collecting extra metrics.

* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::setCaptureExtraNetworkLoadMetricsEnabled):
* WebProcess/Network/WebLoaderStrategy.h:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::setCaptureExtraNetworkLoadMetricsEnabled):
* NetworkProcess/NetworkConnectionToWebProcess.h:
(WebKit::NetworkConnectionToWebProcess::captureExtraNetworkLoadMetricsEnabled):
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
New bool state toggled through the loader policy.

* NetworkProcess/NetworkDataTask.cpp:
(WebKit::NetworkDataTask::shouldCaptureExtraNetworkLoadMetrics):
* NetworkProcess/NetworkDataTask.h:
(WebKit::NetworkDataTaskClient::shouldCaptureExtraNetworkLoadMetrics):
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::shouldCaptureExtraNetworkLoadMetrics):
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/NetworkLoadClient.h:
(WebKit::NetworkLoadClient::shouldCaptureExtraNetworkLoadMetrics):
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::shouldCaptureExtraNetworkLoadMetrics):
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
(WebKit::NetworkCache::SpeculativeLoad::shouldCaptureExtraNetworkLoadMetrics):
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
Default handling for network loads is to not include extra data. Thread
client messages back from the NetworkLoads / SpeculativeLoads to check
the NetworkConnectionToWebProcess state on whether or not we should collect
extra metrics.

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

3 years agoSkip a test that was accidentally enabled with r214982.
ryanhaddad@apple.com [Thu, 6 Apr 2017 22:39:15 +0000 (22:39 +0000)]
Skip a test that was accidentally enabled with r214982.

Unreviewed test gardening.

* platform/ios/TestExpectations:

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

3 years agoObj-C bindings build fails with CSS_DEVICE_ADAPTATION turned on
timothy_horton@apple.com [Thu, 6 Apr 2017 22:38:04 +0000 (22:38 +0000)]
Obj-C bindings build fails with CSS_DEVICE_ADAPTATION turned on
https://bugs.webkit.org/show_bug.cgi?id=170566

Reviewed by Simon Fraser.

* DOM/DOMCSS.mm:
(kitClass):
Use the WebCore-side enum for this, since that's actually what we're switching over.
This allows us to handle values here without adding them to the API header.
All of the other kitClass() functions work the same way.
Also, unindent for style purposes.

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

3 years agoWeb Inspector: Show all headers in the Request Headers section of the Resource detail...
joepeck@webkit.org [Thu, 6 Apr 2017 22:02:04 +0000 (22:02 +0000)]
Web Inspector: Show all headers in the Request Headers section of the Resource details sidebar
https://bugs.webkit.org/show_bug.cgi?id=16531
<rdar://problem/5712895>

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

* inspector/protocol/Network.json:
Optional refined list of request headers in Metrics.

Source/WebCore:

Test: http/tests/inspector/network/resource-request-headers.html

* loader/ResourceTiming.cpp:
(WebCore::ResourceTiming::ResourceTiming):
Eliminate unnecessary data from the NetworkLoadTiming object
when it is used for ResourceTiming. This clears up some memory
that will otherwise never be used.

* platform/network/NetworkLoadMetrics.h:
(WebCore::NetworkLoadMetrics::isolatedCopy):
(WebCore::NetworkLoadMetrics::reset):
(WebCore::NetworkLoadMetrics::clearNonTimingData):
(WebCore::NetworkLoadMetrics::operator==):
(WebCore::NetworkLoadMetrics::encode):
(WebCore::NetworkLoadMetrics::decode):
Include an optional HTTPHeaderMap for a refined list of
request headers for this network load.

* inspector/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::buildObjectForMetrics):
Include request headers with other optional metrics data
when the load is completed.

Source/WebInspectorUI:

* UserInterface/Models/Resource.js:
(WebInspector.Resource.prototype.updateWithMetrics):
Update request headers if provided in metrics.

Source/WebKit2:

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
Include a complete list of the request headers sent for this load.
There may be headers that WebCore did not know about and developer
tools should be informed of.

LayoutTests:

* http/tests/inspector/network/resource-request-headers-expected.txt: Added.
* http/tests/inspector/network/resource-request-headers.html: Added.
* http/tests/inspector/network/resources/basic-auth.php: Added.
Test coverage for Cookie and Basic Authentication headers.

* platform/mac/TestExpectations:
* platform/mac-wk1/TestExpectations:
* platform/win/TestExpectations:
Mark the test as expected to fail on WebKit1 CFNetwork based platforms,
and ElCapitan which uses the legacy non-NSURLSession loading path.

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

3 years agoEach build request should be associated with a repository group
rniwa@webkit.org [Thu, 6 Apr 2017 21:56:59 +0000 (21:56 +0000)]
Each build request should be associated with a repository group
https://bugs.webkit.org/show_bug.cgi?id=170528

Rubber-stamped by Chris Dumez.

Make the buildbot syncing script use the concept of repository groups so that each repository group can post
a different set of properties to buildbot. In order to do this, we associate each build request with
a repository group to use. Each triggerable's repository groups is now updated by the syncing scripts via
/api/update-triggerable just the same way the set of the supported platform, test pairs are updated.

Each repository group specifies the list of repositories, a dictionary that maps the buildbot property name
to either a string value or a repository name enclosed in < and >:

```js
"repositoryGroups": {
    "webkit-svn": {
        "repositories": ["WebKit", "macOS"],
        "properties": {"os": "<macOS>", "wk": "<WebKit>"}
    }
}
```

With this, removed the support for specifying a repository to use in generic dictionary of properties via
a dictionary with a single key of "root", "rootOptions", and "rootsExcluding". We now validate that the list of
repositories in each repository group matches exactly the ones used in buildbot properties as well as ones in
build requests.

After this patch, sync-with-buildbot.js will no longer schedule a build request without a repository group.
Run the appropriate database queries to set the repository group on each build request. Because of this change,
this patch also makes BuildbotTriggerable.prototype.syncOnce more robust against invalid build requests.
Instead of throwing an exception and exiting early, it simply skips all build requests that belong to the same
test group if the next build request to be scheduled does not specify a repository group.

* init-database.sql: Add request_repository_group column to build_requests table, and a unique constraint for
repository and group pair in triggerable_repositories table.

* public/api/update-triggerable.php:
(main): Validate and insert repository groups.
(validate_configurations): Extracted from main.
(validate_repository_groups): Added.

* public/v3/models/repository.js:
(Repository.findTopLevelByName): Added.

* public/include/build-requests-fetcher.php:
(BuildRequestsFetcher::results_internal): Include the repository group of each request in the JSON response.

* public/include/repository-group-finder.php: Added. A helper class to find the repository group for a given
triggerable for a list of repositories.
(RepositoryGroupFinder): Added.
(RepositoryGroupFinder::__construct): Added.
(RepositoryGroupFinder::find_by_repositories): Added.
(RepositoryGroupFinder::populate_map): Added.

* public/privileged-api/create-test-group.php:
(main): Each element in an array returned by ensure_commit_sets and commit_sets_from_revision_sets now contains
"set", the list of commit IDs, and "repository_group", the repository group identified for each commit set.
Use that to set the repository group in each new build request.
(commit_sets_from_revision_sets): Use RepositoryGroupFinder to find the right repository group.
(ensure_commit_sets): Ditto. There is no need to find a repository group for each commit set here since its
argument is keyed by the repository name. e.g. {"WebKit": [123, 456], "macOS": ["16A323", "16A323"]}

* public/v3/models/build-request.js:
(BuildRequest):
(BuildRequest.prototype.triggerable): Added.
(BuildRequest.prototype.repositoryGroup): Added.
(BuildRequest.constructBuildRequestsFromData): Resolve the triggerable and the repository group.

* public/v3/models/triggerable.js:
(Triggerable.prototype.name): Added.
(Triggerable.prototype.acceptedRepositories): Deleted.
(TriggerableRepositoryGroup):
(TriggerableRepositoryGroup.prototype.accepts): Added. Retruns true if the repository group

* server-tests/api-build-requests-tests.js: Added a test for getting the repository group of a build request.
* server-tests/api-manifest-tests.js: Added assertions for the repository groups.
* server-tests/api-report-tests.js:
(.emptyReport):
(.reportWithTwoLevelsOfAggregations):
* server-tests/api-update-triggerable.js: Added test cases for updating the repository groups associated with
a triggerable.
(.updateWithOSXRepositoryGroup):
(.mapRepositoriesByGroup):
* server-tests/privileged-api-create-test-group-tests.js:
(addTriggerableAndCreateTask): Add two repository groups for testing. Added assertions for repository groups
in existing test cases, and added a test case for creating a test group with two different repository groups.

* server-tests/resources/mock-data.js:
(MockData.resetV3Models): Reset TriggerableRepositoryGroup's static maps.
(MockData.emptyTriggeragbleId): Added.
(MockData.macosRepositoryId): Added.
(MockData.webkitRepositoryId): Added.
(MockData.gitWebkitRepositoryId): Added.
(MockData.addMockData): Create repository groups as needed. Renamed the "OS X" repository to "macOS" since some
tests were using the latter, and now we need mock data to be consistent across tests due to stricter checks.
(MockData.addEmptyTriggerable): Added. Used in api-update-triggerable.js.
(MockData.addMockTestGroupWithGitWebKit): Added. Used in api-build-requests-tests.js.
(MockData.addAnotherMockTestGroup): Cleanup.
(MockData.mockTestSyncConfigWithSingleBuilder): Updated the mock configuration per code changes.
(MockData.mockTestSyncConfigWithTwoBuilders): Ditto.

* server-tests/tools-buildbot-triggerable-tests.js: Updated a test case testing /api/update-triggerable to test
updating the set of repository groups in addition to the set of test, platform pairs.
(.refetchManifest): Added.

* tools/js/buildbot-syncer.js:
(BuildbotSyncer): Now takes a set of configurations shared across syncers: repositoryGroups, slaveArgument,
and buildRequestArgument as the third argument.
(BuildbotSyncer.prototype.repositoryGroups): Added.
(BuildbotSyncer.prototype._testGroupMapForBuildRequests): Cleaned up the code to use Array.prototype.find.
Also added an assertion that the build request is associated with a repository group.
(BuildbotSyncer.prototype._propertiesForBuildRequest): Removed the support for using an arbitary property to
specify a revision in favor of explicity listing each property and repository name in a repository group.
(BuildbotSyncer._loadConfig): Removed the support for "shared", which specified the set of buildbot properties
shared across syncers, the name of properties which specifies the build slave name and build request ID. These
values are not stored as top-level properties and superseded by the concept of repository groups.
(BuildbotSyncer._parseRepositoryGroup): Parses and validates repository groups.
(BuildbotSyncer._createTestConfiguration): We no longer expect each configuration to specify a dictionary of
properties or buildRequestArgument (often inherited from shared).
(BuildbotSyncer._validateAndMergeConfig): Removed "slaveArgument" and "buildRequestArgument" from the list of
allowed proeprties in each configuration now that they're specified as top-level properties.

* tools/js/buildbot-triggerable.js:
(BuildbotTriggerable.prototype.updateTriggerable): Update the associated repository groups.
(BuildbotTriggerable.prototype.syncOnce): Skip test groups for which the next build request to be scheduled is
not included in the list of valid build requests.
(BuildbotTriggerable.prototype._validateRequests): Now returns the list of valid build requests, which excludes
those that lack a repository group set.
(BuildbotTriggerable.prototype._nextRequestInGroup): Extracted from _scheduleRequestIfSlaveIsAvailable. Finds
the next build request to be scheduled for the test group.
(BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Renamed from
_scheduleNextRequestInGroupIfSlaveIsAvailable. Now takes the syncer and the slave name as arguments instead of
a test group information since syncOnce now calls _nextRequestInGroup to find the next build request.

* tools/js/v3-models.js:

* unit-tests/build-request-tests.js: Fixed the test name.

* unit-tests/buildbot-syncer-tests.js: Removed tests for "rootOptions" and "rootsExcluding", and added tests
for parsing repository groups.
(sampleiOSConfig): Updated the mock configuration per code changes.
(sampleiOSConfigWithExpansions): Ditto.
(smallConfiguration): Ditto. Now returns the entire configuration instead of a single builder configuration.
Various test cases have been updated to reflect this.
(createSampleBuildRequest): Removed the git hash of WebKit to match the repository groups listed in the mock
configurations. The git hash was there to test "rootOptions", which this patch removed.
(samplePendingBuild): Removed "root_dict" from the list of properties. This was used to test "rootsExcluding"
which, again, this patch removed.
(sampleInProgressBuild): Ditto.
(sampleFinishedBuild): Ditto.

* unit-tests/resources/mock-v3-models.js:
(MockModels.inject): Added ock repository groups so that existing tests will continue to function.

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

3 years agoOptionSet options need to be powers of two
andersca@apple.com [Thu, 6 Apr 2017 21:35:09 +0000 (21:35 +0000)]
OptionSet options need to be powers of two
https://bugs.webkit.org/show_bug.cgi?id=170565

Reviewed by Chris Dumez.

Change Cache::Option to be powers of two.

* NetworkProcess/cache/NetworkCache.h:

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

3 years agoFollow up to r209304, remove line numbers from one more StyleRule construction
timothy_horton@apple.com [Thu, 6 Apr 2017 21:12:25 +0000 (21:12 +0000)]
Follow up to r209304, remove line numbers from one more StyleRule construction
https://bugs.webkit.org/show_bug.cgi?id=170564

Reviewed by Simon Fraser.

* css/StyleRule.cpp:
(WebCore::StyleRuleViewport::StyleRuleViewport):
This one was missed in r209304.

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

3 years agoRemove an unused member and constructor parameter from CSSPropertyParser
timothy_horton@apple.com [Thu, 6 Apr 2017 21:11:35 +0000 (21:11 +0000)]
Remove an unused member and constructor parameter from CSSPropertyParser
https://bugs.webkit.org/show_bug.cgi?id=170562

Reviewed by Simon Fraser.

* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseSingleValue):
(WebCore::CSSParser::parseValueWithVariableReferences):
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::consumeDeclarationValue):
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::CSSPropertyParser):
(WebCore::CSSPropertyParser::parseValue):
(WebCore::CSSPropertyParser::parseSingleValue):
* css/parser/CSSPropertyParser.h:
It is possible to get Clang to complain about the unused member, though
I'm not sure why it doesn't in the build today.

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

3 years agoB3 -O1 should generate better code than -O0
fpizlo@apple.com [Thu, 6 Apr 2017 20:58:34 +0000 (20:58 +0000)]
B3 -O1 should generate better code than -O0
https://bugs.webkit.org/show_bug.cgi?id=170563

Reviewed by Michael Saboff.

Prior to this change, code generated by -O1 ran slower than code generated by -O0. This turned
out to be because of reduceStrength optimizations that increase live ranges and create register
pressure, which then creates problems for linear scan.

It seemed obvious that canonicalizations that help isel, constant folding, and one-for-one
strength reductions should stay. It also seemed obvious that SSA and CFG simplification are fast
and harmless. So, I focused on removing:

- CSE, which increases live ranges. This is a risky optimization when we know that we've chosen
  to use a bad register allocator.

- Sophisticated strength reductions that create more code, like the insane division optimization.

- Anything that inserts basic blocks.

CSE appeared to be the cause of half of the throughput regression of -O1 but none of the compile
time. This change also reduces the running time of reduceStrength by making it not a fixpoint at
optLevel<2.

This makes wasm -O1 compile 17% faster. This makes wasm -O1 run 19% faster. This makes -O1 code
run 3% faster than -O0, and compile about 4% slower than -O0. We may yet end up choosing to use
-O0, but at least now -O1 isn't totally useless.

* b3/B3ReduceStrength.cpp:

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

3 years agoLayoutTest fast/mediastream/getUserMedia-webaudio.html is flaky
commit-queue@webkit.org [Thu, 6 Apr 2017 20:38:38 +0000 (20:38 +0000)]
LayoutTest fast/mediastream/getUserMedia-webaudio.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=167513

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

* fast/mediastream/getUserMedia-webaudio.html: Removing unecessary flaky check.

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

3 years agoKill any WebContent process using over 16 GB of memory.
akling@apple.com [Thu, 6 Apr 2017 20:18:52 +0000 (20:18 +0000)]
Kill any WebContent process using over 16 GB of memory.
https://bugs.webkit.org/show_bug.cgi?id=170515
<rdar://problem/29930931>

Reviewed by Antti Koivisto.

Restructure the code since it was getting out of sync with the intended behavior.
Now there's a thresholdForMemoryKill() which returns the current memory limit based
on the process status.

The memory usage policy is separated from the killing, and now only drives the
asynchronous invocations of pressure relief that occur when we pass over one of
the policy edges (now 1GB for Conservative, 2GB for Strict.)

Removed the "Panic" policy and moved the memory kill logic to shrinkOrDie().

Behavior as of this patch:

    - Everyone gets killed over 16 GB.
    - Inactive processes get killed over 4 GB.
    - Strict memory usage policy kicks in at 2 GB.
    - Conservative memory usage policy at 1 GB.

Like before, we make a best-effort attempt to free up memory before killing the process.

* wtf/MemoryPressureHandler.cpp:
(WTF::toString):
(WTF::MemoryPressureHandler::thresholdForMemoryKill):
(WTF::thresholdForPolicy):
(WTF::policyForFootprint):
(WTF::MemoryPressureHandler::shrinkOrDie):
(WTF::MemoryPressureHandler::setMemoryUsagePolicyBasedOnFootprint):
(WTF::MemoryPressureHandler::measurementTimerFired):
* wtf/MemoryPressureHandler.h:

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

3 years agoSimple line layout: Hittest always returns the first renderer in the block.
zalan@apple.com [Thu, 6 Apr 2017 20:03:55 +0000 (20:03 +0000)]
Simple line layout: Hittest always returns the first renderer in the block.
https://bugs.webkit.org/show_bug.cgi?id=170520
<rdar://problem/30979175>

Reviewed by Antti Koivisto.

Source/WebCore:

This is incorrect now with <br> support (multiple renderers within the same block flow).

Test: fast/dom/Document/CaretRangeFromPoint/simple-line-layout-hittest-with-caret-range-from-point.html

* rendering/RenderText.cpp:
(WebCore::RenderText::positionForPoint): Related fix. We don't yet support positionForPoint with multiple renderes.
* rendering/SimpleLineLayoutFlowContents.h:
(WebCore::SimpleLineLayout::FlowContents::segmentForRun): Empty runs are all valid.
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::hitTestFlow):
(WebCore::SimpleLineLayout::collectFlowOverflow):
* rendering/SimpleLineLayoutResolver.cpp:
(WebCore::SimpleLineLayout::LineResolver::Iterator::operator*): This should eventually return a list of renderes.
* rendering/SimpleLineLayoutResolver.h:
(WebCore::SimpleLineLayout::RunResolver::flowContents):

LayoutTests:

* fast/dom/Document/CaretRangeFromPoint/simple-line-layout-hittest-with-caret-range-from-point-expected.html: Added.
* fast/dom/Document/CaretRangeFromPoint/simple-line-layout-hittest-with-caret-range-from-point.html: Added.

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

3 years agoUpdates feature status for recently shipped features
jond@apple.com [Thu, 6 Apr 2017 19:51:25 +0000 (19:51 +0000)]
Updates feature status for recently shipped features
https://bugs.webkit.org/show_bug.cgi?id=170359

Reviewed by Brian Burg.
Source/JavaScriptCore:

Changed "Done" status to "Supported".

* features.json:

Source/WebCore:

Added missing Gamepad entry.
Changed "Done" status to "Supported".
Also changed status from "In Development" to "Supported" for:

- CSS Grid Layout Level 1
- CSS Inline Layout Module Level 3
- CSS Scroll Snap Points Module Level 1
- CSS Color Level 4
- Fetch API
- Indexed Database 2.0
- Media Capture and Streams
- Pointer Lock
- Preload
- Input Events

* features.json:

Websites/webkit.org:

Added styles for "Supported" status.

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

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

3 years ago[WebCrypto] Add support for AES-CTR
jiewen_tan@apple.com [Thu, 6 Apr 2017 18:56:33 +0000 (18:56 +0000)]
[WebCrypto] Add support for AES-CTR
https://bugs.webkit.org/show_bug.cgi?id=169761
<rdar://problem/31331321>

Reviewed by Brent Fulgham.

LayoutTests/imported/w3c:

* web-platform-tests/WebCryptoAPI/derive_bits_keys/pbkdf2.worker-expected.txt:
* web-platform-tests/WebCryptoAPI/derive_bits_keys/test_pbkdf2-expected.txt:
* web-platform-tests/WebCryptoAPI/encrypt_decrypt/aes_cbc.worker-expected.txt:
* web-platform-tests/WebCryptoAPI/encrypt_decrypt/aes_ctr.worker-expected.txt:
* web-platform-tests/WebCryptoAPI/encrypt_decrypt/test_aes_cbc-expected.txt:
* web-platform-tests/WebCryptoAPI/encrypt_decrypt/test_aes_ctr-expected.txt:
* web-platform-tests/WebCryptoAPI/generateKey/failures_AES-CTR.worker-expected.txt:
* web-platform-tests/WebCryptoAPI/generateKey/successes_AES-CTR.worker-expected.txt:
* web-platform-tests/WebCryptoAPI/generateKey/test_aes-ctr-expected.txt:
* web-platform-tests/WebCryptoAPI/generateKey/test_failures_AES-CTR-expected.txt:
* web-platform-tests/WebCryptoAPI/generateKey/test_successes_AES-CTR-expected.txt:
* web-platform-tests/WebCryptoAPI/import_export/symmetric_importKey.worker-expected.txt:
* web-platform-tests/WebCryptoAPI/import_export/test_symmetric_importKey-expected.txt:

Source/WebCore:

This patch adds support for AES-CTR. Operations of AES-CTR include: encrypt, decrypt, generateKey,
importKey, exportKey, wrapKey, and unwrapKey. This implementation follows the latest WebCryptoAPI
spec: https://www.w3.org/TR/WebCryptoAPI/#aes-ctr.

Tests: crypto/subtle/aes-ctr-encrypt-malformed-parameters.html
       crypto/subtle/aes-ctr-encrypt-overflow.html
       crypto/subtle/aes-ctr-generate-export-key-jwk-length-128.html
       crypto/subtle/aes-ctr-generate-export-key-jwk-length-192.html
       crypto/subtle/aes-ctr-generate-export-key-jwk-length-256.html
       crypto/subtle/aes-ctr-generate-export-raw-key.html
       crypto/subtle/aes-ctr-generate-key-encrypt-decrypt.html
       crypto/subtle/aes-ctr-generate-key.html
       crypto/subtle/aes-ctr-import-jwk-key-length-128.html
       crypto/subtle/aes-ctr-import-jwk-key-length-192.html
       crypto/subtle/aes-ctr-import-jwk-key-length-256.html
       crypto/subtle/aes-ctr-import-key-decrypt.html
       crypto/subtle/aes-ctr-import-key-encrypt.html
       crypto/subtle/aes-ctr-import-key-unwrap-jwk-key.html
       crypto/subtle/aes-ctr-import-key-unwrap-raw-key.html
       crypto/subtle/aes-ctr-import-key-wrap-jwk-key.html
       crypto/subtle/aes-ctr-import-key-wrap-raw-key.html
       crypto/subtle/aes-ctr-import-raw-key.html
       crypto/workers/subtle/aes-ctr-import-key-decrypt.html
       crypto/workers/subtle/aes-ctr-import-key-encrypt.html
       crypto/workers/subtle/aes-ctr-import-key-unwrap-key.html
       crypto/workers/subtle/aes-ctr-import-key-wrap-key.html

* CMakeLists.txt:
* DerivedSources.make:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::normalizeCryptoAlgorithmParameters):
* crypto/CryptoAlgorithmParameters.h:
* crypto/algorithms/CryptoAlgorithmAES_CTR.cpp: Added.
(WebCore::usagesAreInvalidForCryptoAlgorithmAES_CTR):
(WebCore::parametersAreValid):
(WebCore::CryptoAlgorithmAES_CTR::create):
(WebCore::CryptoAlgorithmAES_CTR::identifier):
(WebCore::CryptoAlgorithmAES_CTR::encrypt):
(WebCore::CryptoAlgorithmAES_CTR::decrypt):
(WebCore::CryptoAlgorithmAES_CTR::generateKey):
(WebCore::CryptoAlgorithmAES_CTR::importKey):
(WebCore::CryptoAlgorithmAES_CTR::exportKey):
(WebCore::CryptoAlgorithmAES_CTR::getKeyLength):
* crypto/algorithms/CryptoAlgorithmAES_CTR.h: Added.
* crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp: Added.
(WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
* crypto/mac/CryptoAlgorithmAES_CTRMac.cpp: Added.
(WebCore::bigIntegerToSize):
(WebCore::transformAES_CTR):
(WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
* crypto/mac/CryptoAlgorithmRegistryMac.cpp:
(WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
* crypto/parameters/AesCtrParams.idl: Added.
* crypto/parameters/CryptoAlgorithmAesCtrParams.h: Added.

LayoutTests:

* crypto/subtle/aes-ctr-encrypt-malformed-parameters-expected.txt: Added.
* crypto/subtle/aes-ctr-encrypt-malformed-parameters.html: Added.
* crypto/subtle/aes-ctr-generate-export-key-jwk-length-128-expected.txt: Added.
* crypto/subtle/aes-ctr-generate-export-key-jwk-length-128.html: Added.
* crypto/subtle/aes-ctr-generate-export-key-jwk-length-192-expected.txt: Added.
* crypto/subtle/aes-ctr-generate-export-key-jwk-length-192.html: Added.
* crypto/subtle/aes-ctr-generate-export-key-jwk-length-256-expected.txt: Added.
* crypto/subtle/aes-ctr-generate-export-key-jwk-length-256.html: Added.
* crypto/subtle/aes-ctr-generate-export-raw-key-expected.txt: Added.
* crypto/subtle/aes-ctr-generate-export-raw-key.html: Added.
* crypto/subtle/aes-ctr-generate-key-encrypt-decrypt-expected.txt: Added.
* crypto/subtle/aes-ctr-generate-key-encrypt-decrypt.html: Added.
* crypto/subtle/aes-ctr-generate-key-expected.txt: Added.
* crypto/subtle/aes-ctr-generate-key.html: Added.
* crypto/subtle/aes-ctr-import-jwk-key-length-128-expected.txt: Added.
* crypto/subtle/aes-ctr-import-jwk-key-length-128.html: Added.
* crypto/subtle/aes-ctr-import-jwk-key-length-192-expected.txt: Added.
* crypto/subtle/aes-ctr-import-jwk-key-length-192.html: Added.
* crypto/subtle/aes-ctr-import-jwk-key-length-256-expected.txt: Added.
* crypto/subtle/aes-ctr-import-jwk-key-length-256.html: Added.
* crypto/subtle/aes-ctr-import-key-decrypt-expected.txt: Added.
* crypto/subtle/aes-ctr-import-key-decrypt.html: Added.
* crypto/subtle/aes-ctr-import-key-encrypt-expected.txt: Added.
* crypto/subtle/aes-ctr-import-key-encrypt.html: Added.
* crypto/subtle/aes-ctr-import-key-unwrap-jwk-key-expected.txt: Added.
* crypto/subtle/aes-ctr-import-key-unwrap-jwk-key.html: Added.
* crypto/subtle/aes-ctr-import-key-unwrap-raw-key-expected.txt: Added.
* crypto/subtle/aes-ctr-import-key-unwrap-raw-key.html: Added.
* crypto/subtle/aes-ctr-import-key-wrap-jwk-key-expected.txt: Added.
* crypto/subtle/aes-ctr-import-key-wrap-jwk-key.html: Added.
* crypto/subtle/aes-ctr-import-key-wrap-raw-key-expected.txt: Added.
* crypto/subtle/aes-ctr-import-key-wrap-raw-key.html: Added.
* crypto/subtle/aes-ctr-import-raw-key-expected.txt: Added.
* crypto/subtle/aes-ctr-import-raw-key.html: Added.
* crypto/subtle/aes-generate-key-malformed-parameters-expected.txt:
* crypto/subtle/aes-generate-key-malformed-parameters.html:
* crypto/subtle/aes-import-key-malformed-parameters-expected.txt:
* crypto/subtle/aes-import-key-malformed-parameters.html:
* crypto/workers/subtle/aes-ctr-import-key-decrypt-expected.txt: Added.
* crypto/workers/subtle/aes-ctr-import-key-decrypt.html: Added.
* crypto/workers/subtle/aes-ctr-import-key-encrypt-expected.txt: Added.
* crypto/workers/subtle/aes-ctr-import-key-encrypt.html: Added.
* crypto/workers/subtle/aes-ctr-import-key-unwrap-key-expected.txt: Added.
* crypto/workers/subtle/aes-ctr-import-key-unwrap-key.html: Added.
* crypto/workers/subtle/aes-ctr-import-key-wrap-key-expected.txt: Added.
* crypto/workers/subtle/aes-ctr-import-key-wrap-key.html: Added.
* crypto/workers/subtle/resources/aes-ctr-import-key-decrypt.js: Added.
* crypto/workers/subtle/resources/aes-ctr-import-key-encrypt.js: Added.
* crypto/workers/subtle/resources/aes-ctr-import-key-unwrap-key.js: Added.
* crypto/workers/subtle/resources/aes-ctr-import-key-wrap-key.js: Added.

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

3 years agoMark inspector/codemirror/prettyprinting-css-rules.html as flaky on release.
ryanhaddad@apple.com [Thu, 6 Apr 2017 18:53:25 +0000 (18:53 +0000)]
Mark inspector/codemirror/prettyprinting-css-rules.html as flaky on release.
https://bugs.webkit.org/show_bug.cgi?id=153460

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years agoWebRTC aborts when trying to sleep on a wrong thread
commit-queue@webkit.org [Thu, 6 Apr 2017 18:53:17 +0000 (18:53 +0000)]
WebRTC aborts when trying to sleep on a wrong thread
https://bugs.webkit.org/show_bug.cgi?id=170492
<rdar://problem/31446377>

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

Libwebrtc network thread is set up so that it does not accept blocking calls to other threads.
as per ChannelManager::Init() in channelmanager.cc.
But rtc::Thread::SleepMs expects to block it.
Marking thread as blockable before calling SleepMs and resetting the value if needed afterwards.
* Source/webrtc/media/sctp/sctptransport.cc:

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

3 years agoWeb Inspector: Reorder Debugger tab sidebar panels: Scope Chain, Resource, Probes
mattbaker@apple.com [Thu, 6 Apr 2017 18:50:05 +0000 (18:50 +0000)]
Web Inspector: Reorder Debugger tab sidebar panels: Scope Chain, Resource, Probes
https://bugs.webkit.org/show_bug.cgi?id=170418
<rdar://problem/31410771>

Reviewed by Timothy Hatcher.

Maintain the sidebar panel order defined by TabContentView when adding
and removing panels.

* UserInterface/Views/ContentBrowserTabContentView.js:
(WebInspector.ContentBrowserTabContentView.prototype.showDetailsSidebarPanels):
Insert sidebar panel based on the panel order defined by TabContentView.

* UserInterface/Views/DebuggerTabContentView.js:
(WebInspector.DebuggerTabContentView):

* UserInterface/Views/Sidebar.js:
(WebInspector.Sidebar.prototype.addSidebarPanel):
Implemented as an insert at the end.
(WebInspector.Sidebar.prototype.insertSidebarPanel):
Allow inserting into the sidebar panel collection.
(WebInspector.Sidebar.prototype.removeSidebarPanel):
Remove unused return value.

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

3 years agoWebRTC tests gardening
commit-queue@webkit.org [Thu, 6 Apr 2017 18:48:11 +0000 (18:48 +0000)]
WebRTC tests gardening
https://bugs.webkit.org/show_bug.cgi?id=170508

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

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

* Configurations/FeatureDefines.xcconfig: Changing webrtc enabling for ios.

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

LayoutTests:

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

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

3 years agoStop forcing CA commit when memory pressure changes.
akling@apple.com [Thu, 6 Apr 2017 18:35:47 +0000 (18:35 +0000)]
Stop forcing CA commit when memory pressure changes.
https://bugs.webkit.org/show_bug.cgi?id=170522
<rdar://problem/31460236>

Reviewed by Antti Koivisto.

Don't force a CA commit when reaching critical memory pressure. We're already doing a ton
of work in response to the pressure, and this was really a hack to try to react quickly on
512 MB devices which we don't support anymore.

* page/MemoryRelease.cpp:
(WebCore::releaseCriticalMemory):

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

3 years agoImplement testing mode for disk cache
antti@apple.com [Thu, 6 Apr 2017 18:32:47 +0000 (18:32 +0000)]
Implement testing mode for disk cache
https://bugs.webkit.org/show_bug.cgi?id=170547

Reviewed by Andreas Kling.

Source/WebKit2:

Disable read timeouts and cache shrinking in TestRunner to eliminate potential sources of randomness.

Cache directories are deleted by TestRunner so lack of shrinking does not consume the disk.

This is enabled by the existing WKContextUseTestingNetworkSession SPI.

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::initialize):
* NetworkProcess/cache/NetworkCache.h:
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::Storage::open):
(WebKit::NetworkCache::Storage::Storage):
(WebKit::NetworkCache::Storage::dispatchReadOperation):
(WebKit::NetworkCache::Storage::shrinkIfNeeded):
* NetworkProcess/cache/NetworkCacheStorage.h:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):

LayoutTests:

Enable a few disabled tests to see how it goes.

* platform/mac-wk2/TestExpectations:

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

3 years ago[Readable Streams API] Implement ReadableStreamBYOBRequest respondWithNewView()
commit-queue@webkit.org [Thu, 6 Apr 2017 17:25:10 +0000 (17:25 +0000)]
[Readable Streams API] Implement ReadableStreamBYOBRequest respondWithNewView()
https://bugs.webkit.org/show_bug.cgi?id=170339

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

Source/WebCore:

Implemented ReadableStreamBYOBRequest respondWithNewView().

Added new tests to check respondWithNewView() behaviour.

* Modules/streams/ReadableByteStreamInternals.js:
(readableByteStreamControllerRespondWithNewView): Added.
* Modules/streams/ReadableStreamBYOBRequest.js:
(respondWithNewView): Updated.

LayoutTests:

Added new tests addressing respondWithNewView() behaviour.

* streams/readable-stream-byob-request-expected.txt: Updated.
* streams/readable-stream-byob-request.js: Added new tests.

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

3 years ago[MediaStream] Host application should be able to mute and unmute media streams
eric.carlson@apple.com [Thu, 6 Apr 2017 17:20:28 +0000 (17:20 +0000)]
[MediaStream] Host application should be able to mute and unmute media streams
https://bugs.webkit.org/show_bug.cgi?id=170519
<rdar://problem/31174326>

Unreviewed, fix crash introduced in r214980.

* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::MediaStream): NULL-check page.

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

3 years agoRendering flexbox children across columns
hyatt@apple.com [Thu, 6 Apr 2017 16:44:22 +0000 (16:44 +0000)]
Rendering flexbox children across columns
https://bugs.webkit.org/show_bug.cgi?id=164166
<rdar://problem/29055587>

Reviewed by Zalan Bujtas.

Source/WebCore:

Added fast/multicol/flexbox-rows.html.

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::adjustForUnsplittableChild):
Treat block-level flexboxes that occur inside block flows the same as replaced
and unsplittable elements and push them to the next page if they don't fit. We don't
update the minimum page height though, since the flexbox is not really unsplittable.

LayoutTests:

* fast/multicol/flexbox-rows-expected.html: Added.
* fast/multicol/flexbox-rows.html: Added.

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

3 years ago[WK2] Add C private API to toggle invisibleAutoplayNotPermitted setting
cdumez@apple.com [Thu, 6 Apr 2017 16:39:39 +0000 (16:39 +0000)]
[WK2] Add C private API to toggle invisibleAutoplayNotPermitted setting
https://bugs.webkit.org/show_bug.cgi?id=170524
<rdar://problem/31461472>

Reviewed by Eric Carlson.

Add C private API to toggle invisibleAutoplayNotPermitted setting.

* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetInvisibleMediaAutoplayPermitted):
(WKPreferencesGetInvisibleMediaAutoplayPermitted):
* UIProcess/API/C/WKPreferencesRefPrivate.h:

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

3 years agoREGRESSION: Simulators failing to install after launch_app times out
jbedard@apple.com [Thu, 6 Apr 2017 15:58:28 +0000 (15:58 +0000)]
REGRESSION: Simulators failing to install after launch_app times out
<rdar://problem/31478107>

Unreviewed infrastructure fix.

* Scripts/webkitpy/xcode/simulated_device.py:
(SimulatedDevice.launch_app._install_timeout): Raise RuntimeError, not Exception.

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

3 years ago[JSC][MIPS][DFG] Use x86 generic HasOwnProperty
commit-queue@webkit.org [Thu, 6 Apr 2017 15:23:53 +0000 (15:23 +0000)]
[JSC][MIPS][DFG] Use x86 generic HasOwnProperty
https://bugs.webkit.org/show_bug.cgi?id=170222

Patch by Guillaume Emont <guijemont@igalia.com> on 2017-04-06
Reviewed by Yusuke Suzuki.

* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
use the X86 special version for HasOwnProperty on MIPS too.
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
use the X86 special version for HasOwnProperty on MIPS too.

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

3 years ago[GTK] Fix build with MEDIA_CAPTURE enabled
commit-queue@webkit.org [Thu, 6 Apr 2017 09:58:18 +0000 (09:58 +0000)]
[GTK] Fix build with MEDIA_CAPTURE enabled
https://bugs.webkit.org/show_bug.cgi?id=170539

Patch by Adrian Perez de Castro <aperez@igalia.com> on 2017-04-06
Reviewed by Carlos Garcia Campos.

* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp:
(webkit_dom_html_input_element_get_capture): Add missing namespace in usage of WebCore::MediaCaptureTypeNone.

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

3 years ago[GTK] Build fails when using icecream, ccache and cmake 3.6
nael.ouedraogo@crf.canon.fr [Thu, 6 Apr 2017 08:24:30 +0000 (08:24 +0000)]
[GTK] Build fails when using icecream, ccache and cmake 3.6
https://bugs.webkit.org/show_bug.cgi?id=170498

Reviewed by Michael Catanzaro.

Disable ninja response file when using icecream, ccache and cmake > 3.5.

* Source/cmake/OptionsCommon.cmake:

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