WebKit-https.git
18 months agoWeb Inspector: REGRESSION (r228349): ImageBitmap builtin is now runtime guarded
mattbaker@apple.com [Thu, 22 Feb 2018 22:58:50 +0000 (22:58 +0000)]
Web Inspector: REGRESSION (r228349): ImageBitmap builtin is now runtime guarded
https://bugs.webkit.org/show_bug.cgi?id=183056
<rdar://problem/37799067>

Reviewed by Joseph Pecoraro.

* WebProcess/WebPage/WebInspectorUI.cpp:
(WebKit::WebInspectorUI::WebInspectorUI):

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

18 months agoCaches::initialize should call all pending initialization callbacks in case of error
commit-queue@webkit.org [Thu, 22 Feb 2018 22:53:41 +0000 (22:53 +0000)]
Caches::initialize should call all pending initialization callbacks in case of error
https://bugs.webkit.org/show_bug.cgi?id=183062

Patch by Youenn Fablet <youenn@apple.com> on 2018-02-22
Reviewed by Chris Dumez.

* NetworkProcess/cache/CacheStorageEngineCaches.cpp:
(WebKit::CacheStorage::Caches::initialize):
(WebKit::CacheStorage::Caches::initializeSize):

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

18 months agoCacheStorage::Engine::Caches::writeRecord is not always calling the completion handler
commit-queue@webkit.org [Thu, 22 Feb 2018 22:50:19 +0000 (22:50 +0000)]
CacheStorage::Engine::Caches::writeRecord is not always calling the completion handler
https://bugs.webkit.org/show_bug.cgi?id=183055

Patch by Youenn Fablet <youenn@apple.com> on 2018-02-22
Reviewed by Chris Dumez.

Source/WebKit:

Add a completion handler to Storage::store.
Use it instead in Caches::writeRecord.
This ensures that the Cache add/put promise will be called once all write operations have been done.

* NetworkProcess/cache/CacheStorageEngineCaches.cpp:
(WebKit::CacheStorage::Caches::writeRecord):
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::Storage::WriteOperation::WriteOperation):
(WebKit::NetworkCache::Storage::finishWriteOperation):
(WebKit::NetworkCache::Storage::store):
* NetworkProcess/cache/NetworkCacheStorage.h:
(WebKit::NetworkCache::Storage::store):

LayoutTests:

* http/tests/cache-storage/resources/cache-persistency-iframe.html:

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

18 months agoResourceRequestBase::isolatedCopy() fails to isolate copy the cachePartition
cdumez@apple.com [Thu, 22 Feb 2018 22:36:47 +0000 (22:36 +0000)]
ResourceRequestBase::isolatedCopy() fails to isolate copy the cachePartition
https://bugs.webkit.org/show_bug.cgi?id=183059
<rdar://problem/37800202>

Reviewed by Youenn Fablet.

Update ResourceRequestBase::setAsIsolatedCopy() to call isolatedCopy() on the cachePartition as well,
given that it is a String and it would not be safe to send it to another thread otherwise.

* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::setAsIsolatedCopy):

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

18 months agoAdd an entitlement check for service worker on iOS
rniwa@webkit.org [Thu, 22 Feb 2018 22:05:06 +0000 (22:05 +0000)]
Add an entitlement check for service worker on iOS
https://bugs.webkit.org/show_bug.cgi?id=182865

Reviewed by Dan Bernstein.

Addressed Dan's comment by using xpc_connection_copy_entitlement_value instead of obtaining the audit token first.

* Shared/mac/SandboxUtilities.h:
* Shared/mac/SandboxUtilities.mm:
(WebKit::connectedProcessHasEntitlement):
* StorageProcess/ios/StorageProcessIOS.mm:
(WebKit::StorageProcess::parentProcessHasServiceWorkerEntitlement const):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::parentProcessHasServiceWorkerEntitlement const):

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

18 months agoRefactor MacroAssembler code to improve reuse and extensibility.
mark.lam@apple.com [Thu, 22 Feb 2018 21:53:12 +0000 (21:53 +0000)]
Refactor MacroAssembler code to improve reuse and extensibility.
https://bugs.webkit.org/show_bug.cgi?id=183054
<rdar://problem/37797337>

Reviewed by Saam Barati.

* assembler/ARM64Assembler.h:
* assembler/MacroAssembler.cpp:
* assembler/MacroAssembler.h:
* assembler/MacroAssemblerARM.h:
* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::canCompact):
(JSC::MacroAssemblerARM64::computeJumpType):
(JSC::MacroAssemblerARM64::jumpSizeDelta):
(JSC::MacroAssemblerARM64::link):
(JSC::MacroAssemblerARM64::load64):
(JSC::MacroAssemblerARM64::load64WithAddressOffsetPatch):
(JSC::MacroAssemblerARM64::load32):
(JSC::MacroAssemblerARM64::load32WithAddressOffsetPatch):
(JSC::MacroAssemblerARM64::load16):
(JSC::MacroAssemblerARM64::load16SignedExtendTo32):
(JSC::MacroAssemblerARM64::load8):
(JSC::MacroAssemblerARM64::load8SignedExtendTo32):
(JSC::MacroAssemblerARM64::store64):
(JSC::MacroAssemblerARM64::store64WithAddressOffsetPatch):
(JSC::MacroAssemblerARM64::store32):
(JSC::MacroAssemblerARM64::store32WithAddressOffsetPatch):
(JSC::MacroAssemblerARM64::store16):
(JSC::MacroAssemblerARM64::store8):
(JSC::MacroAssemblerARM64::getEffectiveAddress):
(JSC::MacroAssemblerARM64::branchDoubleNonZero):
(JSC::MacroAssemblerARM64::branchDoubleZeroOrNaN):
(JSC::MacroAssemblerARM64::branchTruncateDoubleToInt32):
(JSC::MacroAssemblerARM64::loadDouble):
(JSC::MacroAssemblerARM64::loadFloat):
(JSC::MacroAssemblerARM64::moveConditionallyAfterFloatingPointCompare):
(JSC::MacroAssemblerARM64::moveDoubleConditionallyAfterFloatingPointCompare):
(JSC::MacroAssemblerARM64::storeDouble):
(JSC::MacroAssemblerARM64::storeFloat):
(JSC::MacroAssemblerARM64::call):
(JSC::MacroAssemblerARM64::jump):
(JSC::MacroAssemblerARM64::tailRecursiveCall):
(JSC::MacroAssemblerARM64::setCarry):
(JSC::MacroAssemblerARM64::reemitInitialMoveWithPatch):
(JSC::MacroAssemblerARM64::isBreakpoint):
(JSC::MacroAssemblerARM64::invert):
(JSC::MacroAssemblerARM64::readCallTarget):
(JSC::MacroAssemblerARM64::replaceWithVMHalt):
(JSC::MacroAssemblerARM64::replaceWithJump):
(JSC::MacroAssemblerARM64::maxJumpReplacementSize):
(JSC::MacroAssemblerARM64::patchableJumpSize):
(JSC::MacroAssemblerARM64::repatchCall):
(JSC::MacroAssemblerARM64::makeBranch):
(JSC::MacroAssemblerARM64::makeCompareAndBranch):
(JSC::MacroAssemblerARM64::makeTestBitAndBranch):
(JSC::MacroAssemblerARM64::ARM64Condition):
(JSC::MacroAssemblerARM64::moveWithFixedWidth):
(JSC::MacroAssemblerARM64::load):
(JSC::MacroAssemblerARM64::store):
(JSC::MacroAssemblerARM64::tryLoadWithOffset):
(JSC::MacroAssemblerARM64::tryLoadSignedWithOffset):
(JSC::MacroAssemblerARM64::tryStoreWithOffset):
(JSC::MacroAssemblerARM64::jumpAfterFloatingPointCompare):
(JSC::MacroAssemblerARM64::linkCall):
* assembler/MacroAssemblerARMv7.h:
* assembler/MacroAssemblerMIPS.h:
* assembler/MacroAssemblerX86Common.h:
* assembler/ProbeStack.h:
- Removed a forward declaration of an obsolete class.

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

18 months agoServiceWorkerContainer::startScriptFetchForJob() fails to isolate copy the registrati...
cdumez@apple.com [Thu, 22 Feb 2018 21:40:38 +0000 (21:40 +0000)]
ServiceWorkerContainer::startScriptFetchForJob() fails to isolate copy the registrationKey before passing it to the main thread
https://bugs.webkit.org/show_bug.cgi?id=183050
<rdar://problem/37796881>

Reviewed by Youenn Fablet.

Create an isolated copy of the registrationKey before passing it to the main thread in ServiceWorkerContainer's
startScriptFetchForJob() / jobFinishedLoadingScript() / jobFailedLoadingScript().

* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::startScriptFetchForJob):
(WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
(WebCore::ServiceWorkerContainer::jobFailedLoadingScript):

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

18 months agoFetch event release assert should take into account the fetch mode
commit-queue@webkit.org [Thu, 22 Feb 2018 20:42:54 +0000 (20:42 +0000)]
Fetch event release assert should take into account the fetch mode
https://bugs.webkit.org/show_bug.cgi?id=183047

Patch by Youenn Fablet <youenn@apple.com> on 2018-02-22
Reviewed by Chris Dumez.

In case of navigation tasks, we should use the request URL and not the origin of the loading client.

* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::isValidFetch):
(WebKit::WebSWContextManagerConnection::startFetch):

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

18 months ago[WinCairo] Fix compile errors in WebPageWin.cpp and WebProcessWin.cpp due to WebCore...
commit-queue@webkit.org [Thu, 22 Feb 2018 19:50:57 +0000 (19:50 +0000)]
[WinCairo] Fix compile errors in WebPageWin.cpp and WebProcessWin.cpp due to WebCore forwarding header paths
https://bugs.webkit.org/show_bug.cgi?id=182969

Patch by Yousuke Kimoto <yousuke.kimoto@sony.com> on 2018-02-22
Reviewed by Konstantin Tokarev.

* WebProcess/WebPage/win/WebPageWin.cpp:
* WebProcess/win/WebProcessWin.cpp:

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

18 months agoServiceWorkerContainer::scheduleJob() fails to isolate copy the jobData before passin...
cdumez@apple.com [Thu, 22 Feb 2018 19:46:18 +0000 (19:46 +0000)]
ServiceWorkerContainer::scheduleJob() fails to isolate copy the jobData before passing it to the main thread
https://bugs.webkit.org/show_bug.cgi?id=183046
<rdar://problem/37793395>

Reviewed by Youenn Fablet.

Make sure we isolate copy the jobData before passing it to the main thread in ServiceWorkerContainer::scheduleJob().
The jobData contains Strings / URLs so it is not safe to have non-isolated copies of it on various threads.

* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::scheduleJob):

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

18 months ago[Curl] Fix warning on clang.
commit-queue@webkit.org [Thu, 22 Feb 2018 19:41:18 +0000 (19:41 +0000)]
[Curl] Fix warning on clang.
https://bugs.webkit.org/show_bug.cgi?id=182986

Patch by Basuke Suzuki <Basuke.Suzuki@sony.com> on 2018-02-22
Reviewed by Konstantin Tokarev.

No new tests because there's no behaviro changes.

* platform/network/curl/CurlResourceHandleDelegate.cpp:
(WebCore::CurlResourceHandleDelegate::curlDidSendData):
(WebCore::CurlResourceHandleDelegate::curlDidReceiveBuffer):
(WebCore::CurlResourceHandleDelegate::curlDidFailWithError):
* platform/network/curl/CurlResourceHandleDelegate.h:

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

18 months agoRemove sleep(double) and sleepMS(double) interfaces
utatane.tea@gmail.com [Thu, 22 Feb 2018 18:54:07 +0000 (18:54 +0000)]
Remove sleep(double) and sleepMS(double) interfaces
https://bugs.webkit.org/show_bug.cgi?id=183038

Reviewed by Mark Lam.

Source/JavaScriptCore:

* bytecode/SuperSampler.cpp:
(JSC::initializeSuperSampler):

Source/WebKit:

* PluginProcess/WebProcessConnection.cpp:
(WebKit::WebProcessConnection::createPluginAsynchronously):
* UIProcess/linux/MemoryPressureMonitor.cpp:
(WebKit::pollIntervalForUsedMemoryPercentage):
(WebKit::MemoryPressureMonitor::MemoryPressureMonitor):
* WebProcess/wpe/WebProcessMainWPE.cpp:

Source/WTF:

This patch removes sleep(double) and sleepMS(double) interfaces.
We can just use sleep(Seconds) instead.

* benchmarks/LockFairnessTest.cpp:
* benchmarks/LockSpeedTest.cpp:
* wtf/CurrentTime.cpp:
(WTF::sleep):
* wtf/CurrentTime.h:
(WTF::sleepMS): Deleted.
* wtf/DebugUtilities.h:
* wtf/Seconds.cpp:
(WTF::sleep): Deleted.
* wtf/Seconds.h:
* wtf/StackShotProfiler.h:

Tools:

* DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp:
(PluginTest::indicateTestFailure):
* DumpRenderTree/TestNetscapePlugIn/Tests/EvaluateJSWithinNPP_New.cpp:
(EvaluteJSWithinNPP_New::NPP_New):
* DumpRenderTree/TestNetscapePlugIn/Tests/InvokeDestroysPluginWithinNPP_New.cpp:
(InvokeDestroysPluginWithinNPP_New::NPP_New):
* DumpRenderTree/TestNetscapePlugIn/Tests/SlowNPPNew.cpp:
* TestWebKitAPI/Tests/WTF/Signals.cpp:
(TEST):
* TestWebKitAPI/Tests/WTF/ThreadGroup.cpp:
(TestWebKitAPI::testThreadGroup):
* TestWebKitAPI/Tests/WTF/WorkQueue.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitCocoa/PictureInPictureDelegate.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/ios/DataInteractionTests.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/jsconly/PlatformUtilitiesJSCOnly.cpp:
(TestWebKitAPI::Util::sleep):

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

18 months agoAdd release logging for CacheStorage::Engine disk related functions
commit-queue@webkit.org [Thu, 22 Feb 2018 18:51:54 +0000 (18:51 +0000)]
Add release logging for CacheStorage::Engine disk related functions
https://bugs.webkit.org/show_bug.cgi?id=183042

Patch by Youenn Fablet <youenn@apple.com> on 2018-02-22
Reviewed by Chris Dumez.

* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::writeFile):
(WebKit::CacheStorage::Engine::readFile):

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

18 months agoWorkerCacheStorageConnection::doRemove can assert in case two frames try to delete...
commit-queue@webkit.org [Thu, 22 Feb 2018 18:48:34 +0000 (18:48 +0000)]
WorkerCacheStorageConnection::doRemove can assert in case two frames try to delete the same cache at the same time
https://bugs.webkit.org/show_bug.cgi?id=183041

Patch by Youenn Fablet <youenn@apple.com> on 2018-02-22
Reviewed by Chris Dumez.

* Modules/cache/WorkerCacheStorageConnection.cpp:
(WebCore::WorkerCacheStorageConnection::doRemove): Update the assertion to accept the
case of an already deleted cache, i.e. returned identifer is 0.

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

18 months agoRemove some code leftovers in LibWebRTCMediaEndpoint and RealtimeOutgoingVideoSource...
commit-queue@webkit.org [Thu, 22 Feb 2018 18:32:43 +0000 (18:32 +0000)]
Remove some code leftovers in LibWebRTCMediaEndpoint and RealtimeOutgoingVideoSource classes
https://bugs.webkit.org/show_bug.cgi?id=183031

Patch by Alejandro G. Castro <alex@igalia.com> on 2018-02-22
Reviewed by Youenn Fablet.

This include and namespace are not required in the file.

Just removing unused code, no tests required.

* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:

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

18 months agoDocument.open() cancels existing provisional load but not navigation policy check
cdumez@apple.com [Thu, 22 Feb 2018 18:29:26 +0000 (18:29 +0000)]
Document.open() cancels existing provisional load but not navigation policy check
https://bugs.webkit.org/show_bug.cgi?id=183012
<rdar://problem/37755831>

Reviewed by Alex Christensen.

Source/WebCore:

Test: fast/dom/Document/open-with-pending-load-async-policy.html

* dom/Document.cpp:
(WebCore::Document::open):
The existing code was calling FrameLoader::stopAllLoaders() when the loader's state
is FrameStateProvisional. The issue is that the FrameLoader's state only gets set
to FrameStateProvisional after the policy decision for the navigation is made.
This means that we fail to cancel a pending load if is still in the policy decision
stage, which can happen when the policy decision is made asynchronously. We now
also cancel such pending navigation policy checks as well.

* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):
Make sure the m_delegateIsDecidingNavigationPolicy flag gets reset inside the
lambda. Otherwise, it gets reset too early when the policy decision is made
asynchronously.

LayoutTests:

Add layout test coverage.

* fast/dom/Document/open-with-pending-load-async-policy-expected.txt: Added.
* fast/dom/Document/open-with-pending-load-async-policy.html: Added.

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

18 months agoUpdated expectations for http/tests/appcache/404-resource-with-slow-main-resource...
jlewis3@apple.com [Thu, 22 Feb 2018 18:22:24 +0000 (18:22 +0000)]
Updated expectations for http/tests/appcache/404-resource-with-slow-main-resource.php.
https://bugs.webkit.org/show_bug.cgi?id=153503

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:
* platform/mac/TestExpectations:

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

18 months agoUnreviewed, rolling out r228902.
jlewis3@apple.com [Thu, 22 Feb 2018 18:01:08 +0000 (18:01 +0000)]
Unreviewed, rolling out r228902.

This broke internal builds.

Reverted changeset:

"[Cocoa] Web Automation: provide a way to ask clients the type
of a JavaScript dialog"
https://bugs.webkit.org/show_bug.cgi?id=182660
https://trac.webkit.org/changeset/228902

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

18 months agoAdd release asserts for service worker fetch and postMessage events
cdumez@apple.com [Thu, 22 Feb 2018 16:55:53 +0000 (16:55 +0000)]
Add release asserts for service worker fetch and postMessage events
https://bugs.webkit.org/show_bug.cgi?id=183025
rdar://problem/37765052

Patch by Youenn Fablet <youenn@apple.com> on 2018-02-22
Reviewed by Daniel Bates.

Source/WebCore:

Add release assertion so that a service worker will only dispatch a message event
for clients and service workers with the same origin.
No change of behavior.

* platform/network/ResourceRequestBase.h:
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::postMessageToServiceWorker):
* workers/service/context/ServiceWorkerThreadProxy.h:

Source/WebKit:

Add assertion to protect interception of a fetch load by a service worker with
a different origin from the page.

* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::startFetch):

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

18 months agoMark http/tests/preload/onerror_event.html as a flaky crash on Windows.
pvollan@apple.com [Thu, 22 Feb 2018 16:43:45 +0000 (16:43 +0000)]
Mark http/tests/preload/onerror_event.html as a flaky crash on Windows.
https://bugs.webkit.org/show_bug.cgi?id=179297

Unreviewed test gardening.

* platform/win/TestExpectations:

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

18 months agoincluding both gl3.h and gl2.h when USE_OPENGL_ES is enabled
magomez@igalia.com [Thu, 22 Feb 2018 15:33:03 +0000 (15:33 +0000)]
including both gl3.h and gl2.h when USE_OPENGL_ES is enabled
https://bugs.webkit.org/show_bug.cgi?id=183008

Reviewed by Michael Catanzaro.

Don't include GLES3 headers as we stick to GLES2 API resources.

No new tests, no behavior change.

* platform/graphics/GLContext.cpp:

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

18 months agoUnreviewed GTK+ gardening after r228915.
magomez@igalia.com [Thu, 22 Feb 2018 14:57:36 +0000 (14:57 +0000)]
Unreviewed GTK+ gardening after r228915.

* platform/gtk/TestExpectations:

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

18 months ago[GTK][WPE] Fix some build errors in service workers code
Ms2ger@igalia.com [Thu, 22 Feb 2018 09:31:02 +0000 (09:31 +0000)]
[GTK][WPE] Fix some build errors in service workers code
https://bugs.webkit.org/show_bug.cgi?id=182966

Reviewed by Žan Doberšek.

Source/WebCore:

No new tests: no change in behavior.

* workers/service/ServiceWorkerProvider.h: add missing forward declaration.

Source/WebKit:

* CMakeLists.txt: add missing files.
* StorageProcess/ServiceWorker/WebSWServerConnection.cpp: add missing includes.
* UIProcess/ServiceWorkerProcessProxy.cpp: use #include rather than #import in C++; add missing ifdef.
* UIProcess/ServiceWorkerProcessProxy.h: add missing ifdef.
* WebProcess/Storage/WebSWClientConnection.cpp: add missing includes.
* WebProcess/Storage/WebSWContextManagerConnection.cpp: add missing includes.
(WebKit::WebSWContextManagerConnection::WebSWContextManagerConnection):
  call the function that exists outside cocoa.

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

18 months ago[RenderTreeBuilder] Move RenderObject::insertedInto() mutation logic to RenderTreeBuilder
zalan@apple.com [Thu, 22 Feb 2018 06:17:45 +0000 (06:17 +0000)]
[RenderTreeBuilder] Move RenderObject::insertedInto() mutation logic to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=183022
<rdar://problem/37764326>

Reviewed by Antti Koivisto.

No change in functionality.

* rendering/RenderObject.cpp:
(WebCore::RenderObject::insertedIntoTree):
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::insertChildToRenderElementInternal):
(WebCore::RenderTreeBuilder::moveChildrenTo):
(WebCore::RenderTreeBuilder::multiColumnDescendantInserted): Deleted.
* rendering/updating/RenderTreeBuilder.h:

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

18 months agoInclude all Cocoa sources in all Cocoa platform builds
timothy_horton@apple.com [Thu, 22 Feb 2018 03:49:05 +0000 (03:49 +0000)]
Include all Cocoa sources in all Cocoa platform builds
https://bugs.webkit.org/show_bug.cgi?id=183026
<rdar://problem/37513101>

Reviewed by Dan Bernstein.

Similar to r228571, don't have separate Sources files for iOS and Mac.
All sources now have #ifdefs that ensure that only the right ones
build on the right platforms. This makes it much easier to reason
about what builds where by just looking at the sources.

* SourcesCocoa.txt:
* SourcesIOS.txt: Removed.
* SourcesMac.txt: Removed.
* WebCore.xcodeproj/project.pbxproj:
* editing/WebContentReader.h:
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:

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

18 months agoMake SubstituteResource take a ResourceResponse r-value
commit-queue@webkit.org [Thu, 22 Feb 2018 00:28:20 +0000 (00:28 +0000)]
Make SubstituteResource take a ResourceResponse r-value
https://bugs.webkit.org/show_bug.cgi?id=183020

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

No change of behavior.
Make SubstituteResource take a ResourceResponse r-value.
Update ArchiveResource accordingly.
Take benefit of that in ApplicationCacheResource to set the response source to ApplicationCache
before passing it to SubstituteResource constructor.

* loader/SubstituteResource.h:
(WebCore::SubstituteResource::SubstituteResource):
(WebCore::SubstituteResource::resourceResponse): Deleted.
* loader/appcache/ApplicationCacheResource.cpp:
(WebCore::ApplicationCacheResource::create):
(WebCore::ApplicationCacheResource::ApplicationCacheResource):
* loader/appcache/ApplicationCacheResource.h:
(WebCore::ApplicationCacheResource::create): Deleted.
* loader/archive/ArchiveResource.cpp:
(WebCore::ArchiveResource::ArchiveResource):

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

18 months ago[RenderTreeBuilder] ::willBeRemoved() does not need RenderTreeBuilder anymore.
zalan@apple.com [Thu, 22 Feb 2018 00:20:40 +0000 (00:20 +0000)]
[RenderTreeBuilder] ::willBeRemoved() does not need RenderTreeBuilder anymore.
https://bugs.webkit.org/show_bug.cgi?id=183019
<rdar://problem/37761421>

Reviewed by Antti Koivisto.

All the willBeDestroyed() mutations have been moved over to RenderTreeBuilder.

No change in functionality.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::willBeDestroyed):
* rendering/RenderBlock.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::willBeDestroyed):
* rendering/RenderBlockFlow.h:
* rendering/RenderBox.cpp:
(WebCore::RenderBox::willBeDestroyed):
* rendering/RenderBox.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::willBeDestroyed):
* rendering/RenderBoxModelObject.h:
* rendering/RenderCounter.cpp:
(WebCore::RenderCounter::willBeDestroyed):
* rendering/RenderCounter.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::willBeDestroyed):
* rendering/RenderElement.h:
* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::willBeDestroyed):
* rendering/RenderEmbeddedObject.h:
* rendering/RenderFragmentedFlow.cpp:
(WebCore::RenderFragmentedFlow::willBeDestroyed):
* rendering/RenderFragmentedFlow.h:
* rendering/RenderImage.cpp:
(WebCore::RenderImage::willBeDestroyed):
* rendering/RenderImage.h:
* rendering/RenderInline.cpp:
(WebCore::RenderInline::willBeDestroyed):
* rendering/RenderInline.h:
* rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::willBeDestroyed):
* rendering/RenderLayerModelObject.h:
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::willBeDestroyed):
* rendering/RenderListBox.h:
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::willBeDestroyed):
* rendering/RenderListMarker.h:
* rendering/RenderMenuList.cpp:
(WebCore::RenderMenuList::willBeDestroyed):
* rendering/RenderMenuList.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::willBeDestroyed):
(WebCore::RenderObject::destroy):
* rendering/RenderObject.h:
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::willBeDestroyed):
* rendering/RenderReplaced.h:
* rendering/RenderSearchField.cpp:
(WebCore::RenderSearchField::willBeDestroyed):
* rendering/RenderSearchField.h:
* rendering/RenderSnapshottedPlugIn.cpp:
(WebCore::RenderSnapshottedPlugIn::willBeDestroyed):
* rendering/RenderSnapshottedPlugIn.h:
* rendering/RenderText.cpp:
(WebCore::RenderText::willBeDestroyed):
* rendering/RenderText.h:
* rendering/RenderTextControlMultiLine.cpp:
(WebCore::RenderTextControlMultiLine::willBeDestroyed):
* rendering/RenderTextControlMultiLine.h:
* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::willBeDestroyed):
* rendering/RenderVideo.h:
* rendering/RenderWidget.cpp:
(WebCore::RenderWidget::willBeDestroyed):
* rendering/RenderWidget.h:
* rendering/svg/RenderSVGBlock.cpp:
(WebCore::RenderSVGBlock::willBeDestroyed):
* rendering/svg/RenderSVGBlock.h:
* rendering/svg/RenderSVGImage.cpp:
(WebCore::RenderSVGImage::willBeDestroyed):
* rendering/svg/RenderSVGImage.h:
* rendering/svg/RenderSVGInline.cpp:
(WebCore::RenderSVGInline::willBeDestroyed):
* rendering/svg/RenderSVGInline.h:
* rendering/svg/RenderSVGModelObject.cpp:
(WebCore::RenderSVGModelObject::willBeDestroyed):
* rendering/svg/RenderSVGModelObject.h:
* rendering/svg/RenderSVGResourceContainer.cpp:
(WebCore::RenderSVGResourceContainer::willBeDestroyed):
* rendering/svg/RenderSVGResourceContainer.h:
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::willBeDestroyed):
* rendering/svg/RenderSVGRoot.h:
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::willBeDestroyed):
* rendering/svg/RenderSVGText.h:

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

18 months agoThe WebContent process should not use NSScreen in the screenAvailableRect/screenRect...
pvollan@apple.com [Thu, 22 Feb 2018 00:19:58 +0000 (00:19 +0000)]
The WebContent process should not use NSScreen in the screenAvailableRect/screenRect implementations.
https://bugs.webkit.org/show_bug.cgi?id=182855

Reviewed by Brent Fulgham.

On macOS, the functions screenAvailableRect and screenRect is implemented using NSScreen, which is communicating
with the WindowServer. To avoid this WindowServer communication from the WebContent process when calling
screenAvailableRect and screenRect, it is possible to let the UIProcess send a message to the WebContent
process whenever there is a change in the display properties, and have the WebContent process cache these
display properties. This message should also be sent to a newly started WebContent process.

Source/WebCore:

No new tests, covered by existing tests.

* WebCore.xcodeproj/project.pbxproj:
* platform/PlatformScreen.h:
* platform/mac/PlatformScreenMac.mm:
(WebCore::getScreenProperties):
(WebCore::screenProperties):
(WebCore::setScreenProperties):
(WebCore::screenRect):
(WebCore::screenAvailableRect):
* platform/ScreenProperties.h: Added.
(WebCore::ScreenProperties::encode const):
(WebCore::ScreenProperties::decode):

Source/WebKit:

* UIProcess/WebProcessPool.cpp:
(WebKit::displayReconfigurationCallBack):
(WebKit::registerDisplayConfigurationCallback):
(WebKit::WebProcessPool::initializeNewWebProcess):
(WebKit::WebProcessPool::warmInitialProcess):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::setScreenProperties):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

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

18 months agoAdd delay to make cookie purge catch up when running http/tests/resourceLoadStatistic...
wilander@apple.com [Thu, 22 Feb 2018 00:17:37 +0000 (00:17 +0000)]
Add delay to make cookie purge catch up when running http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-deletion.html
https://bugs.webkit.org/show_bug.cgi?id=183024
<rdar://problem/37765207>

Unreviewed test gardening.

* http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-deletion.html:
    Added a setTimeout() delay.

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

18 months ago[Curl] Curl Cookie Database File should be configurable using NetworkProcessCreationP...
commit-queue@webkit.org [Thu, 22 Feb 2018 00:10:25 +0000 (00:10 +0000)]
[Curl] Curl Cookie Database File should be configurable using NetworkProcessCreationParameters
https://bugs.webkit.org/show_bug.cgi?id=182751

Patch by Christopher Reid <chris.reid@sony.com> on 2018-02-21
Reviewed by Youenn Fablet.

Source/WebCore:

No change in behavior.

Adding support to set a custom CookieJar Database.
Took CookieJarDB::open() out of its constructor because both the Network and Web process
were trying to open the journal files but one process was failing due to a lack of permission.
Now the database file is lazily opened and only the Network process will try to open the database.
Some cleanup was done to CookieJarDB too.

* platform/network/NetworkStorageSession.h:
* platform/network/curl/CookieJarDB.cpp:
* platform/network/curl/CookieJarDB.h:
* platform/network/curl/NetworkStorageSessionCurl.cpp:

Source/WebKit:

Adding a cookiePersistentStorageFile parameter to Curl's NetworkProcessCreationParameters.
This parameter is based on Soup's cookiePersistentStoragePath.
This parameter is not used yet, it is added to prepare for WinCairo WebKit support.

* NetworkProcess/NetworkProcessCreationParameters.cpp:
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/curl/NetworkProcessCurl.cpp:
* WebProcess/Cookies/WebCookieManager.h:
* WebProcess/Cookies/curl/WebCookieManagerCurl.cpp:

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

18 months agoRegression(r228708): Crash under WebCore::MediaResource::responseReceived(WebCore...
cdumez@apple.com [Wed, 21 Feb 2018 23:56:16 +0000 (23:56 +0000)]
Regression(r228708): Crash under WebCore::MediaResource::responseReceived(WebCore::CachedResource&, WebCore::ResourceResponse const&)
https://bugs.webkit.org/show_bug.cgi?id=183018
<rdar://problem/37754154>

Reviewed by Eric Carlson.

The fix at r228708 was trying to address the fact that avplayer sometimes
deallocates WebCoreNSURLSessionDataTask objects on a non-main thread, which
was not safe because its _resource data member needs to be deallocated on
the main thread.

The issue is that r228708 caused _resource to outlive its WebCoreNSURLSessionDataTask.
This is an issue because _resource has a client data member (of type WebCoreNSURLSessionDataTaskClient)
which has a raw pointer to the WebCoreNSURLSessionDataTask. This means that the main thread could
call methods like responseReceived() on the resource, which would call responseReceived() on the
client, which would try to call [WebCoreNSURLSessionDataTask receivedResponse:] with an invalid
m_task pointer.

To address the issue, I introduced a clearTask() method on WebCoreNSURLSessionDataTaskClient, which
gets called from a non-main thread to clear the client's m_task pointer when the task is destroyed
on a non-main thread. So that this is safe, every time the client tries to use m_task, we now
acquire a lock for thread-safety and do a null-check on m_task.

No new tests, no known reproduction case.

* platform/graphics/PlatformMediaResourceLoader.h:
(WebCore::PlatformMediaResource::client):
* platform/network/cocoa/WebCoreNSURLSession.mm:
(WebCore::WebCoreNSURLSessionDataTaskClient::clearTask):
(WebCore::WebCoreNSURLSessionDataTaskClient::dataSent):
(WebCore::WebCoreNSURLSessionDataTaskClient::responseReceived):
(WebCore::WebCoreNSURLSessionDataTaskClient::shouldCacheResponse):
(WebCore::WebCoreNSURLSessionDataTaskClient::dataReceived):
(WebCore::WebCoreNSURLSessionDataTaskClient::redirectReceived):
(WebCore::WebCoreNSURLSessionDataTaskClient::accessControlCheckFailed):
(WebCore::WebCoreNSURLSessionDataTaskClient::loadFailed):
(WebCore::WebCoreNSURLSessionDataTaskClient::loadFinished):
(-[WebCoreNSURLSessionDataTask dealloc]):

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

18 months ago[Cocoa] Web Automation: provide a way to ask clients the type of a JavaScript dialog
bburg@apple.com [Wed, 21 Feb 2018 23:31:15 +0000 (23:31 +0000)]
[Cocoa] Web Automation: provide a way to ask clients the type of a JavaScript dialog
https://bugs.webkit.org/show_bug.cgi?id=182660
<rdar://problem/37408183>

Reviewed by Tim Horton and Carlos Garcia Campos.

Add another delegate method to ask what type of dialog is being shown.
This is used to implement §18.4 Step 5, where sending text to a dialog
without a prompt will return several different kinds of errors.

No new tests, covered by web platform tests once Safari side has landed.

* UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h: Update FIXME radar numbers.
* UIProcess/Cocoa/AutomationSessionClient.h:
* UIProcess/Cocoa/AutomationSessionClient.mm:
(WebKit::AutomationSessionClient::AutomationSessionClient):
(WebKit::toImpl):
(WebKit::AutomationSessionClient::typeOfCurrentJavaScriptDialogOnPage):
If there is no current dialog to be checked, the client can return the 'None'
type. This gets converted into a std::nullopt and causes a command error later.

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

18 months agoMove AppCache loading to the NetworkProcess
commit-queue@webkit.org [Wed, 21 Feb 2018 22:37:27 +0000 (22:37 +0000)]
Move AppCache loading to the NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=178540
<rdar://problem/37119346>

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

Source/WebCore:

Covered by existing tests.

Use ApplicationResourceLoader for cache entry loading.
Remove all ResourceHandle use from ApplicationCacheGroup.
Renamed m_loader in m_manifestLoader and added a new m_entryLoader to load cache entries.

Updated ApplicationCacheResourceLoader to handle different types of CachedResource.
This allows in particular to handle redirections based on the resource type and create the ApplicationCacheResource with the right type.
Use Include as credentials mode as per specification.

Add a new ApplicationCache ResourceResonse::Source.
This allows fixing an assertion and should allow better inspector support if needs be.

* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::responseSource):
* loader/ResourceLoader.cpp:
(WebCore::logResourceResponseSource):
* loader/SubstituteResource.h:
(WebCore::SubstituteResource::resourceResponse):
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::stopLoading):
(WebCore::ApplicationCacheGroup::update):
(WebCore::ApplicationCacheGroup::didFinishLoading):
(WebCore::ApplicationCacheGroup::didFinishLoadingEntry):
(WebCore::ApplicationCacheGroup::didFail):
(WebCore::ApplicationCacheGroup::didFailLoadingEntry):
(WebCore::ApplicationCacheGroup::checkIfLoadIsComplete):
(WebCore::ApplicationCacheGroup::startLoadingEntry):
* loader/appcache/ApplicationCacheGroup.h:
* loader/appcache/ApplicationCacheResource.cpp:
(WebCore::ApplicationCacheResource::ApplicationCacheResource):
* loader/appcache/ApplicationCacheResourceLoader.cpp:
(WebCore::ApplicationCacheResourceLoader::create):
(WebCore::ApplicationCacheResourceLoader::ApplicationCacheResourceLoader):
(WebCore::ApplicationCacheResourceLoader::responseReceived):
(WebCore::ApplicationCacheResourceLoader::redirectReceived):
* loader/appcache/ApplicationCacheResourceLoader.h:
* platform/network/ResourceResponseBase.h:
* platform/network/cocoa/ResourceResponseCocoa.mm:
(WebCore::ResourceResponse::platformCertificateInfo const):
* testing/Internals.cpp:
(WebCore::responseSourceToString):

LayoutTests:

There is no guarantee that aborting in an event handler will be executed before some loads finish,
as the events are fired asynchronously.
Making tests less flaky by waiting some time before fnishing some loads.

* http/tests/appcache/abort-cache-onchecking.html:
* http/tests/appcache/resource-redirect-2-expected.txt:
* http/tests/appcache/resources/abort-cache-onchecking-resource-404.manifest:
* http/tests/appcache/resources/abort-cache-onchecking.manifest: Removed.
* http/tests/appcache/resources/abort-cache-onchecking.manifest.php: Added.
* http/tests/appcache/resources/abort-cache-ondownloading.manifest:
* http/tests/appcache/resources/abort-cache-ondownloading.text: Removed.
* http/tests/appcache/resources/abort-cache-ondownloading.text.php: Added.
* http/tests/appcache/resources/not-exist.vob.php: Added.

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

18 months ago[CMake] Expose HAVE macros globally
don.olmstead@sony.com [Wed, 21 Feb 2018 22:34:01 +0000 (22:34 +0000)]
[CMake] Expose HAVE macros globally
https://bugs.webkit.org/show_bug.cgi?id=183011

Reviewed by Michael Catanzaro.

* Source/cmake/OptionsCommon.cmake:
* Source/cmake/WebKitFeatures.cmake:

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

18 months ago[RenderTreeBuilder] Move RenderBoxModelObject::willBeRemoved() mutation logic to...
zalan@apple.com [Wed, 21 Feb 2018 22:27:00 +0000 (22:27 +0000)]
[RenderTreeBuilder] Move RenderBoxModelObject::willBeRemoved() mutation logic to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=183014
<rdar://problem/37757428>

Reviewed by Antti Koivisto.

No change in functionality.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::~RenderBoxModelObject):
(WebCore::RenderBoxModelObject::willBeDestroyed):
(WebCore::RenderBoxModelObject::continuationChainNode const):
(): Deleted.
(WebCore::RenderBoxModelObject::removeAndDestroyAllContinuations): Deleted.
* rendering/RenderBoxModelObject.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::RenderTreeBuilder):
(WebCore::RenderTreeBuilder::removeAndDestroy):
* rendering/updating/RenderTreeBuilder.h:
(WebCore::RenderTreeBuilder::continuationBuilder):
* rendering/updating/RenderTreeBuilderContinuation.cpp: Added.
(WebCore::RenderTreeBuilder::Continuation::Continuation):
(WebCore::RenderTreeBuilder::Continuation::cleanupOnDestroy):
* rendering/updating/RenderTreeBuilderContinuation.h: Added.

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

18 months ago[CMake] Split declaration of JSC headers into public and private
don.olmstead@sony.com [Wed, 21 Feb 2018 22:02:03 +0000 (22:02 +0000)]
[CMake] Split declaration of JSC headers into public and private
https://bugs.webkit.org/show_bug.cgi?id=182980

Reviewed by Michael Catanzaro.

* CMakeLists.txt:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* PlatformWPE.cmake:
* PlatformWin.cmake:

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

18 months agoServiceWorkerJob::m_lastResponse is unneeded
commit-queue@webkit.org [Wed, 21 Feb 2018 21:51:31 +0000 (21:51 +0000)]
ServiceWorkerJob::m_lastResponse is unneeded
https://bugs.webkit.org/show_bug.cgi?id=183013

Patch by Youenn Fablet <youenn@apple.com> on 2018-02-21
Reviewed by Chris Dumez.

Remove this field since not used anywhere.

* workers/service/ServiceWorkerJob.cpp:
(WebCore::ServiceWorkerJob::didReceiveResponse):
* workers/service/ServiceWorkerJob.h:

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

18 months agoVersioning.
jmarcell@apple.com [Wed, 21 Feb 2018 21:51:23 +0000 (21:51 +0000)]
Versioning.

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

18 months ago[WinCairo] Fix compile errors of WebProcess and NetworkProcess due to no implementati...
commit-queue@webkit.org [Wed, 21 Feb 2018 21:41:06 +0000 (21:41 +0000)]
[WinCairo] Fix compile errors of WebProcess and NetworkProcess due to no implementation for windows
https://bugs.webkit.org/show_bug.cgi?id=182870

Patch by Yousuke Kimoto <yousuke.kimoto@sony.com> on 2018-02-21
Reviewed by Youenn Fablet.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
* WebProcess/Plugins/PluginProcessConnectionManager.cpp:
(WebKit::PluginProcessConnectionManager::getPluginProcessConnection):
* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::openFrontendConnection):
* WebProcess/WebPage/WebInspectorUI.cpp:
(WebKit::WebInspectorUI::establishConnection):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::ensureNetworkProcessConnection):

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

18 months agoUse ResourceLoader to load appcache manifest
commit-queue@webkit.org [Wed, 21 Feb 2018 20:21:59 +0000 (20:21 +0000)]
Use ResourceLoader to load appcache manifest
https://bugs.webkit.org/show_bug.cgi?id=182861

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

Source/WebCore:

Covered by updated tests.

Add ApplicationCacheResourceLoader to load an ApplicationCacheResource from a ResourceLoader.
Make use of it to load the app cache manifest.
Future work should load entries using the same loader.

Remove manifest handle.
Ensure that DocumentLoader does not register the manifest resource loader as its lifetime
is handled by its ApplicationCacheGroup.

Add a ResourceLoader option to bypass the application cache.
Use it for manifest loading.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::addSubresourceLoader):
* loader/ResourceLoaderOptions.h:
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::stopLoading):
(WebCore::ApplicationCacheGroup::update):
(WebCore::ApplicationCacheGroup::createRequest):
(WebCore::ApplicationCacheGroup::didReceiveResponseAsync):
(WebCore::ApplicationCacheGroup::didReceiveData):
(WebCore::ApplicationCacheGroup::didFinishLoading):
(WebCore::ApplicationCacheGroup::didFail):
(WebCore::ApplicationCacheGroup::didFinishLoadingManifest):
(WebCore::ApplicationCacheGroup::checkIfLoadIsComplete):
* loader/appcache/ApplicationCacheGroup.h:
* loader/appcache/ApplicationCacheHost.cpp:
(WebCore::ApplicationCacheHost::maybeLoadResource):
(WebCore::ApplicationCacheHost::maybeLoadFallbackForRedirect):
(WebCore::ApplicationCacheHost::maybeLoadFallbackForResponse):
(WebCore::ApplicationCacheHost::maybeLoadFallbackForError):
* loader/appcache/ApplicationCacheResourceLoader.cpp: Added.
* loader/appcache/ApplicationCacheResourceLoader.h: Added.

LayoutTests:

* http/tests/appcache/fail-on-update-2-expected.txt:
* http/tests/appcache/manifest-redirect-2-expected.txt:
* http/tests/appcache/offline-access-expected.txt:

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

18 months ago[CMake][Win] Use cmakeconfig.h rather than config.h and Platform.h
don.olmstead@sony.com [Wed, 21 Feb 2018 20:01:22 +0000 (20:01 +0000)]
[CMake][Win] Use cmakeconfig.h rather than config.h and Platform.h
https://bugs.webkit.org/show_bug.cgi?id=182883

Reviewed by Per Arne Vollan.

.:

* Source/cmake/OptionsAppleWin.cmake:
* Source/cmake/OptionsWin.cmake:
* Source/cmake/OptionsWinCairo.cmake:

Source/WebCore:

No new tests. No change in behavior.

* WebCorePrefix.h:
* config.h:
* testing/js/WebCoreTestSupportPrefix.h:

Source/WebKit:

* config.h:

Source/WebKitLegacy/win:

* WebKitPrefix.h:

Source/WTF:

* wtf/Platform.h:

Tools:

* DumpRenderTree/config.h:
* TestWebKitAPI/config.h:

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

18 months ago[GTK] Unsafe g_setenv use in MiniBrowser main
mcatanzaro@igalia.com [Wed, 21 Feb 2018 19:55:40 +0000 (19:55 +0000)]
[GTK] Unsafe g_setenv use in MiniBrowser main
https://bugs.webkit.org/show_bug.cgi?id=182978

Reviewed by Carlos Garcia Campos.

setenv (and g_setenv) will randomly crash if called too late.

* MiniBrowser/gtk/main.c:
(main):

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

18 months ago[RenderTreeBuilder] Move RenderView::willBeRemoved() mutation logic to RenderTreeBuilder
zalan@apple.com [Wed, 21 Feb 2018 19:50:23 +0000 (19:50 +0000)]
[RenderTreeBuilder] Move RenderView::willBeRemoved() mutation logic to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=183009

Reviewed by Antti Koivisto.

No change in functionality.

* dom/Document.cpp:
(WebCore::Document::destroyRenderTree):
* rendering/RenderView.cpp:
(WebCore::RenderView::~RenderView):
(WebCore::RenderView::willBeDestroyed): Deleted.
* rendering/RenderView.h:

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

18 months ago[GTK] USE_UPOWER causes crashes inside a chroot or on systems with broken dbus/upower
mcatanzaro@igalia.com [Wed, 21 Feb 2018 19:42:35 +0000 (19:42 +0000)]
[GTK] USE_UPOWER causes crashes inside a chroot or on systems with broken dbus/upower
https://bugs.webkit.org/show_bug.cgi?id=181825

Reviewed by Carlos Garcia Campos.

.:

Get rid of the upower-glib dependency. We will use upower's D-Bus API instead.

* Source/cmake/FindUPowerGLib.cmake: Removed.
* Source/cmake/OptionsGTK.cmake:

Source/WebCore:

We could fix this crash, but that would not be good enough, because upower-glib is a
synchronous API that wraps D-Bus calls. That's not acceptable for use in the web process.
Rewrite LowPowerModeNotifierGLib to use upower's D-Bus API directly, instead.

Note that this also enables LowPowerModeNotifier for WPE, since the USE(UPOWER) build
flag is no longer needed.

* platform/LowPowerModeNotifier.cpp:
* platform/LowPowerModeNotifier.h:
* platform/glib/LowPowerModeNotifierGLib.cpp:
(WebCore::LowPowerModeNotifier::LowPowerModeNotifier):
(WebCore::LowPowerModeNotifier::updateWarningLevel):
(WebCore::LowPowerModeNotifier::warningLevelChanged):
(WebCore::LowPowerModeNotifier::gPropertiesChangedCallback):
(WebCore::LowPowerModeNotifier::~LowPowerModeNotifier):
(WebCore::LowPowerModeNotifier::updateState): Deleted.
(WebCore::LowPowerModeNotifier::warningLevelCallback): Deleted.

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

18 months agoWeb Automation: failed provisional loads cause "Navigate To" command to hang
bburg@apple.com [Wed, 21 Feb 2018 19:41:03 +0000 (19:41 +0000)]
Web Automation: failed provisional loads cause "Navigate To" command to hang
https://bugs.webkit.org/show_bug.cgi?id=183007
<rdar://problem/37751819>

Reviewed by Andy Estes.

This hang was revealed by WPT test current_url.py::get_current_url_file_protocol. Now the
test simply fails because Safari chooses a policy of 'Ignore' for externally-opened files.
I filed an upstream issue with the test here: https://github.com/w3c/webdriver/issues/1232

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
Notify the session that the load failed in the frame, just like we do
for non-provisional failed loads and successful loads.

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

18 months agoVTTCue constructor should use 'double' type for startTime / endTime
cdumez@apple.com [Wed, 21 Feb 2018 19:36:47 +0000 (19:36 +0000)]
VTTCue constructor should use 'double' type for startTime / endTime
https://bugs.webkit.org/show_bug.cgi?id=182988

Reviewed by Eric Carlson.

Source/WebCore:

VTTCue constructor should use 'double' type for startTime / endTime, not
'unrestricted double':
- https://w3c.github.io/webvtt/#the-vttcue-interface

Otherwise, we end up potentially returning NaN for TextTrackCue.startTime / endTime,
even though those correctly use type 'double':
- https://html.spec.whatwg.org/multipage/media.html#texttrackcue

The new behavior is consistent with Firefox and Chrome.

No new tests, updated existing test.

* bindings/js/JSDOMConvertNumbers.h:
(WebCore::JSConverter<IDLDouble>::convert):
Add assertion to make sure our implementation never tries to return NaN
for an IDL attribute of type 'double'. This would be invalid as per Web
IDL spec and would crash if the NaN being returned was impure as JSValue
could not store it as a double.

* html/track/VTTCue.idl:
Update constructor parameters to use 'double' type instead of 'unrestricted
double', as per:
- https://w3c.github.io/webvtt/#the-vttcue-interface

LayoutTests:

Update existing test to reflect behavior change.

* media/track/track-add-remove-cue-expected.txt:
* media/track/track-add-remove-cue.html:

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

18 months agowebkitpy NetworkTransaction should retry on URLError
aakash_jain@apple.com [Wed, 21 Feb 2018 19:27:52 +0000 (19:27 +0000)]
webkitpy NetworkTransaction should retry on URLError
https://bugs.webkit.org/show_bug.cgi?id=182987

Reviewed by Alexey Proskuryakov.

* Scripts/webkitpy/common/net/networktransaction.py:
(NetworkTransaction.run): Retry on urllib2.URLError.

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

18 months ago[RenderTreeBuilder] Move RenderTextFragment::willBeRemoved() mutation logic to Render...
zalan@apple.com [Wed, 21 Feb 2018 18:45:56 +0000 (18:45 +0000)]
[RenderTreeBuilder] Move RenderTextFragment::willBeRemoved() mutation logic to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182946
<rdar://problem/37690039>

Reviewed by Antti Koivisto.

No change in functionality.

* rendering/RenderTextFragment.cpp:
(WebCore::RenderTextFragment::willBeDestroyed):
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::takeChild):
* rendering/updating/RenderTreeBuilderFirstLetter.cpp:
(WebCore::RenderTreeBuilder::FirstLetter::cleanupOnRemoval):
* rendering/updating/RenderTreeBuilderFirstLetter.h:

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

18 months agoTest gardening.
commit-queue@webkit.org [Wed, 21 Feb 2018 18:26:58 +0000 (18:26 +0000)]
Test gardening.
https://bugs.webkit.org/show_bug.cgi?id=183006

Unreviewed test gardening.

Patch by Ms2ger <Ms2ger@gmail.com> on 2018-02-21

* TestExpectations: add ietestcenter/css3/valuesandunits/units-000.htm.
* platform/gtk/TestExpectations: remove ietestcenter/css3/valuesandunits/units-000.htm.
* platform/gtk/js/dom/dom-static-property-for-in-iteration-expected.txt: update for r228827.
* platform/ios/TestExpectations: remove ietestcenter/css3/valuesandunits/units-000.htm.
* platform/mac/TestExpectations: remove ietestcenter/css3/valuesandunits/units-000.htm.
* platform/win/TestExpectations: remove ietestcenter/css3/valuesandunits/units-000.htm.
* platform/wpe/TestExpectations: remove ietestcenter/css3/valuesandunits/units-000.htm.
* platform/wpe/js/dom/dom-static-property-for-in-iteration-expected.txt: update for r228827.

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

18 months ago[GCrypt] Remove unsound assertion from CryptoKeyRSA::exportData().
Ms2ger@igalia.com [Wed, 21 Feb 2018 18:19:03 +0000 (18:19 +0000)]
[GCrypt] Remove unsound assertion from CryptoKeyRSA::exportData().
https://bugs.webkit.org/show_bug.cgi?id=183001

Reviewed by Philippe Normand.

This function is called from structured cloning, in particular when storing
a key in IndexedDB. This would trip the assertion if the key in question is
non-exportable.

The assertion was copied from the macOS implementation in r172389; it was
subsequently removed there in r172898 to handle this case.

Test: crypto/subtle/rsa-indexeddb-non-exportable.html

* crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
(WebCore::CryptoKeyRSA::exportData const): remove assertion.

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

18 months ago[WTR][WPE] Correct the process names in TestController.
Ms2ger@igalia.com [Wed, 21 Feb 2018 18:16:20 +0000 (18:16 +0000)]
[WTR][WPE] Correct the process names in TestController.
https://bugs.webkit.org/show_bug.cgi?id=178700

Reviewed by Michael Catanzaro.

Similar to r228731 for GTK.

* Scripts/webkitpy/port/wpe.py:
(WPEPort._get_crash_log): removed the code to convert WebProcess name.
* WebKitTestRunner/TestController.cpp: return the correct process names for WPE.
(WTR::TestController::webProcessName):
(WTR::TestController::networkProcessName):
(WTR::TestController::databaseProcessName):

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

18 months agoUpdate test expectations
cturner@igalia.com [Wed, 21 Feb 2018 18:12:59 +0000 (18:12 +0000)]
Update test expectations
https://bugs.webkit.org/show_bug.cgi?id=182973

Unreviewed gardening.

* platform/gtk/TestExpectations:

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

18 months ago[ATK] Remove attributeSet variable from AccessibilityUIElement::attributedStringForRa...
Ms2ger@igalia.com [Wed, 21 Feb 2018 17:57:07 +0000 (17:57 +0000)]
[ATK] Remove attributeSet variable from AccessibilityUIElement::attributedStringForRange().
https://bugs.webkit.org/show_bug.cgi?id=183000

Reviewed by Joanmarie Diggs.

It is never initialized, but is passed to atk_attribute_set_free.
This caused a crash in accessibility/content-editable-as-textarea.html on the debug bots.

* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::AccessibilityUIElement::attributedStringForRange):

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

18 months agoRebaseline web animations tests after r228717
cturner@igalia.com [Wed, 21 Feb 2018 17:54:33 +0000 (17:54 +0000)]
Rebaseline web animations tests after r228717
https://bugs.webkit.org/show_bug.cgi?id=182970

Reviewed by Antoine Quint.

* platform/gtk/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-expected.txt: Added.
* platform/gtk/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-expected.txt: Added.
* platform/gtk/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-expected.txt: Added.

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

18 months ago[Cocoa] Make system-ui obey the user-installed-font policy
mmaxfield@apple.com [Wed, 21 Feb 2018 17:34:45 +0000 (17:34 +0000)]
[Cocoa] Make system-ui obey the user-installed-font policy
https://bugs.webkit.org/show_bug.cgi?id=182860
<rdar://problem/36158249>

Reviewed by Antti Koivisto.

Source/WebCore:

We have a completely different codepath for system-ui which makes it follow the system's
font cascade list. This codepath (along with all the other relevant places which create
system fonts) needs to obey the AllowUserInstalledFonts enum. This patch is fairly
mechanical; we simply are hooking up the flag across SystemFontDatabase.

There are a few places which creates system fonts which this patch doesn't touch. This is
not a problem because all the remaining places either:
1) Simply pull out some attributes of the font (name, weight, size, etc.) and then throw
away the font object itself, or
2) Use the font in an environment where script cannot access the characters rendered (such
as DragImages or the fullscreen placeholder view or the inside of the attachment element).

Test: fast/text/user-installed-fonts/system-ui.html

* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontDatabase::collectionForFamily):
(WebCore::FontDatabase::fontForPostScriptName):
(WebCore::fontWithFamily):
(WebCore::installedFontMandatoryAttributes):
(WebCore::createSpecificFontForInstalledFonts):
* platform/graphics/cocoa/FontCacheCoreText.h:
* platform/graphics/cocoa/FontDescriptionCocoa.cpp:
(WebCore::SystemFontDatabase::CoreTextCascadeListParameters::operator== const):
(WebCore::SystemFontDatabase::CoreTextCascadeListParameters::hash const):
(WebCore::SystemFontDatabase::systemFontCascadeList):
(WebCore::SystemFontDatabase::removeCascadeList):
(WebCore::SystemFontDatabase::computeCascadeList):
(WebCore::systemFontParameters):
(WebCore::systemFontCascadeList):
(WebCore::FontCascadeDescription::effectiveFamilyCount const):
(WebCore::FontCascadeDescription::effectiveFamilyAt const):
* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::platformFontWithFamilySpecialCase):
* platform/graphics/mac/FontCacheMac.mm:
(WebCore::platformFontWithFamilySpecialCase):

Tools:

Create a font, FakeHelvetica-ArmenianCharacter.ttf, which supports a particular Armenian
character which isn't isn't supported by any other font on the system.

* WebKitTestRunner/FakeHelvetica-ArmenianCharacter.ttf:
* WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:

LayoutTests:

FakeHelvetica-ArmenianCharacter.ttf is a font which supports a particular Armenian character which
isn't supported by any other font on the system. Installing this font will cause it to be added to
the 'system-ui' font cascade list. When we disable user-installed-fonts, this font should not be
used to render the character.

* fast/text/user-installed-fonts/system-ui-expected-mismatch.html:
* fast/text/user-installed-fonts/system-ui.html:

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

18 months agoUnreviewed attempt to fix build after r228867.
cdumez@apple.com [Wed, 21 Feb 2018 17:08:45 +0000 (17:08 +0000)]
Unreviewed attempt to fix build after r228867.

* Modules/webvr/VRStageParameters.cpp:

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

18 months ago[GStreamer] Rewrite purgeInvalid*Tracks methods
philn@webkit.org [Wed, 21 Feb 2018 17:00:53 +0000 (17:00 +0000)]
[GStreamer] Rewrite purgeInvalid*Tracks methods
https://bugs.webkit.org/show_bug.cgi?id=183004

Reviewed by Carlos Garcia Campos.

Removing items from a hashmap while iterating is bad.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::purgeInvalidAudioTracks):
Safely remove items from the hashmap using removeIf().
(WebCore::MediaPlayerPrivateGStreamer::purgeInvalidVideoTracks): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::purgeInvalidTextTracks): Ditto.

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

18 months agoUnreviewed attempt to fix build after r228867.
cdumez@apple.com [Wed, 21 Feb 2018 17:00:21 +0000 (17:00 +0000)]
Unreviewed attempt to fix build after r228867.

* Modules/webvr/VRStageParameters.cpp:

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

19 months ago[GStreamer] Crash in Debug build when purging invalid tracks
philn@webkit.org [Wed, 21 Feb 2018 13:26:51 +0000 (13:26 +0000)]
[GStreamer] Crash in Debug build when purging invalid tracks
https://bugs.webkit.org/show_bug.cgi?id=182997

Reviewed by Xabier Rodriguez-Calvar.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::purgeInvalidAudioTracks): Clear the hashmap when there is no valid track left.
(WebCore::MediaPlayerPrivateGStreamer::purgeInvalidVideoTracks): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::purgeInvalidTextTracks): Ditto.
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
(WebCore::TrackPrivateBaseGStreamer::getLanguageCode): Demote debugging, this appears too much at least with playbin2.
(WebCore::TrackPrivateBaseGStreamer::getTag): Ditto.

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

19 months ago[GStreamer] We need to adopt GstGlDisplays after GStreamer 1.13.1
philn@webkit.org [Wed, 21 Feb 2018 13:25:26 +0000 (13:25 +0000)]
[GStreamer] We need to adopt GstGlDisplays after GStreamer 1.13.1
https://bugs.webkit.org/show_bug.cgi?id=182996

Reviewed by Xabier Rodriguez-Calvar.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
Adopt references when running with GStreamer 1.13.1 to avoid
memory leaks.

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

19 months ago[GTK] Layout test media/track/track-in-band-duplicate-tracks-when-source-changes...
philn@webkit.org [Wed, 21 Feb 2018 11:42:05 +0000 (11:42 +0000)]
[GTK] Layout test media/track/track-in-band-duplicate-tracks-when-source-changes.html failing since r228617
https://bugs.webkit.org/show_bug.cgi?id=160131
<rdar://problem/35873985>

Reviewed by Michael Catanzaro.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText): We
can't assume the pad has a sticky event here like implemented in
InbandTextTrackPrivateGStreamer because it might be emitted after
the track was created. So fallback to a dummy stream ID like in
the Audio and Video tracks.

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

19 months ago[WebVR][OpenVR] Retrieve stage parameters
svillar@igalia.com [Wed, 21 Feb 2018 10:47:14 +0000 (10:47 +0000)]
[WebVR][OpenVR] Retrieve stage parameters
https://bugs.webkit.org/show_bug.cgi?id=182976

Reviewed by Žan Doberšek.

Use OpenVR to retrieve stage parameters, i.e., play area size and
the transformation from sitting to standing position. It includes
the same fallback used by Firefox to provide sensible values in case
we cannot get the required information from the VR SDK (it's quite
common not to have defined a play area).

* Modules/webvr/VRDisplay.cpp:
(WebCore::VRDisplay::stageParameters const):
* Modules/webvr/VRDisplay.h:
* Modules/webvr/VRStageParameters.cpp:
(WebCore::VRStageParameters::VRStageParameters):
(WebCore::VRStageParameters::sittingToStandingTransform const):
(WebCore::VRStageParameters::sizeX const):
(WebCore::VRStageParameters::sizeZ const):
* Modules/webvr/VRStageParameters.h:
(WebCore::VRStageParameters::create):
* platform/vr/VRPlatformDisplay.h:
* platform/vr/openvr/VRPlatformDisplayOpenVR.cpp:
(WebCore::VRPlatformDisplayOpenVR::VRPlatformDisplayOpenVR):
(WebCore::VRPlatformDisplayOpenVR::updateStageParameters):
* platform/vr/openvr/VRPlatformDisplayOpenVR.h:

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

19 months ago[GStreamer] Create a Wayland GL display instead of EGL
philn@webkit.org [Wed, 21 Feb 2018 09:34:35 +0000 (09:34 +0000)]
[GStreamer] Create a Wayland GL display instead of EGL
https://bugs.webkit.org/show_bug.cgi?id=182968

Reviewed by Xabier Rodriguez-Calvar.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
Add logging and instantiate a GstDisplayWayland display instead of
an EGL display when running under a Wayland compositor.

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

19 months ago[RenderTreeBuilder] Move RenderFullScreen::willBeRemoved() mutation logic to RenderTr...
zalan@apple.com [Wed, 21 Feb 2018 08:25:39 +0000 (08:25 +0000)]
[RenderTreeBuilder] Move RenderFullScreen::willBeRemoved() mutation logic to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182947
<rdar://problem/37690848>

Reviewed by Antti Koivisto.

No change in functionality.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderFullScreen.cpp:
(WebCore::RenderFullScreen::willBeDestroyed):
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::takeChild):
* rendering/updating/RenderTreeBuilder.h:
(WebCore::RenderTreeBuilder::fullScreenBuilder):
* rendering/updating/RenderTreeBuilderFullScreen.cpp: Added.
(WebCore::RenderTreeBuilder::FullScreen::FullScreen):
(WebCore::RenderTreeBuilder::FullScreen::cleanupOnRemoval):
* rendering/updating/RenderTreeBuilderFullScreen.h: Added.
* rendering/updating/RenderTreeBuilderMathML.cpp:

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

19 months agoDFG::VarargsForwardingPhase should eliminate getting argument length
sbarati@apple.com [Wed, 21 Feb 2018 06:56:11 +0000 (06:56 +0000)]
DFG::VarargsForwardingPhase should eliminate getting argument length
https://bugs.webkit.org/show_bug.cgi?id=182959

Reviewed by Keith Miller.

JSTests:

* microbenchmarks/forward-arguments-dont-escape-on-arguments-length.js: Added.

Source/JavaScriptCore:

This patch teaches the DFG VarargsForwardingPhase to not treat
length accesses on Cloned/Direct Arguments objects as escapes.
It teaches this phase to materialize the length in the same
way the ArgumentsEliminationPhase does.

This is around a 0.5-1% speedup on ARES6 on my iMac. It speeds
up the ML subtest by 2-4%.

This patch also extends compileGetArgumentCountIncludingThis to take
a parameter that is the inline call frame to load from (in the case
where the inline call frame is a varargs frame). This allows the
the emitCodeToGetArgumentsArrayLength helper function to just emit
a GetArgumentCountIncludingThis node instead of a GetLocal. If we
emitted a GetLocal, we'd need to rerun CPS rethreading.

* dfg/DFGArgumentsEliminationPhase.cpp:
* dfg/DFGArgumentsUtilities.cpp:
(JSC::DFG::emitCodeToGetArgumentsArrayLength):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::getArgumentCount):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGNode.h:
(JSC::DFG::Node::argumentsInlineCallFrame):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileGetArgumentCountIncludingThis):
* dfg/DFGVarargsForwardingPhase.cpp:
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileGetArgumentCountIncludingThis):

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

19 months agoTry to fix the 32-bit build after r228857
timothy_horton@apple.com [Wed, 21 Feb 2018 05:48:38 +0000 (05:48 +0000)]
Try to fix the 32-bit build after r228857

* WebKitTestRunner/mac/UIScriptControllerMac.mm:
(WTR::UIScriptController::firstResponderSuppressionForWebView):

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

19 months ago[RenderTreeBuilder] Move RenderListItem::willBeRemoved() mutation logic to RenderTree...
zalan@apple.com [Wed, 21 Feb 2018 04:39:29 +0000 (04:39 +0000)]
[RenderTreeBuilder] Move RenderListItem::willBeRemoved() mutation logic to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182943
<rdar://problem/37689029>

Reviewed by Antti Koivisto.

We don't need to destroy the marker in RenderListItem::willBeRemoved(), because it gets deleted
in RenderTreeBuilder::removeAndDestroy() together with RenderListItem (as long as the marker is
the RenderListItem's descendent).

Covered by existing tests.

* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::~RenderListItem):
(WebCore::RenderListItem::willBeDestroyed): Deleted.
* rendering/RenderListItem.h:

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

19 months agoAX: Keyboard focus not following VoiceOver cursor into web content or within web...
n_wang@apple.com [Wed, 21 Feb 2018 04:17:20 +0000 (04:17 +0000)]
AX: Keyboard focus not following VoiceOver cursor into web content or within web content.
https://bugs.webkit.org/show_bug.cgi?id=182752
<rdar://problem/37518233>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Call the assistive technology specific method for becoming first responder.

Test: accessibility/mac/accessibility-make-first-responder.html

* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
* page/ChromeClient.h:

Source/WebKit:

* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::assistiveTechnologyMakeFirstResponder):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::assistiveTechnologyMakeFirstResponder):
* UIProcess/mac/PageClientImplMac.h:
* UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::assistiveTechnologyMakeFirstResponder):
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::assistiveTechnologyMakeFirstResponder):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::assistiveTechnologyMakeFirstResponder):
* WebProcess/WebCoreSupport/WebChromeClient.h:

Tools:

* DumpRenderTree/mac/UIScriptControllerMac.mm:
(WTR::UIScriptController::firstResponderSuppressionForWebView):
(WTR::UIScriptController::makeWindowContentViewFirstResponder):
(WTR::UIScriptController::isWindowContentViewFirstResponder const):
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::firstResponderSuppressionForWebView):
(WTR::UIScriptController::makeWindowContentViewFirstResponder):
(WTR::UIScriptController::isWindowContentViewFirstResponder const):
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/mac/UIScriptControllerMac.mm:
(WTR::UIScriptController::firstResponderSuppressionForWebView):
(WTR::UIScriptController::makeWindowContentViewFirstResponder):
(WTR::UIScriptController::isWindowContentViewFirstResponder const):

LayoutTests:

* accessibility/mac/accessibility-make-first-responder-expected.txt: Added.
* accessibility/mac/accessibility-make-first-responder.html: Added.
* platform/mac-wk1/TestExpectations:

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

19 months agoWeb Automation: combine session commands to resize and move top-level browsing contexts
bburg@apple.com [Wed, 21 Feb 2018 04:13:42 +0000 (04:13 +0000)]
Web Automation: combine session commands to resize and move top-level browsing contexts
https://bugs.webkit.org/show_bug.cgi?id=182749
<rdar://problem/37515170>

Reviewed by Andy Estes.

Source/WebDriver:

The new command can take either size or origin. Just have one session command for use by endpoints.

* Session.cpp:
(WebDriver::Session::setWindowRect):
(WebDriver::Session::moveToplevelBrowsingContextWindow): Deleted.
(WebDriver::Session::resizeToplevelBrowsingContextWindow): Deleted.
* Session.h:

Source/WebKit:

Since moving and resizing the window are both accomplished by setting the window frame,
and the W3C WebDriver specification has a Get/Set Window Rect command, it's time to
deduplicate these two methods which basically do the same thing.

Adopt modern JSON::Value getters that return std::optional<float>. I have been trying
to move the protocol over to this style wholesale, but it is probably easier to do
this conversion in smaller pieces. And so, I have started to do so.

This change is covered by existing WebDriver tests.

* UIProcess/Automation/Automation.json: Add new command.
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::setWindowFrameOfBrowsingContext): Added.
(WebKit::WebAutomationSession::resizeWindowOfBrowsingContext): Deleted.
(WebKit::WebAutomationSession::moveWindowOfBrowsingContext): Deleted.
* UIProcess/Automation/WebAutomationSession.h:

Source/WTF:

* wtf/JSONValues.h: add a getDouble() implementation that returns a std::optional<T>
rather than using an out-parameter. I'd like to move more code to this style.

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

19 months ago[GTK] jhbuild: Remove gtk-doc
commit-queue@webkit.org [Wed, 21 Feb 2018 03:27:09 +0000 (03:27 +0000)]
[GTK] jhbuild: Remove gtk-doc
https://bugs.webkit.org/show_bug.cgi?id=182956

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2018-02-20
Reviewed by Michael Catanzaro.

jhbuild doesn't need to build gtk-doc because major LTS Linux
distributions have gtk-doc v1.25, and
Tools/gtk/install-dependencies installs gtk-doc.

* gtk/jhbuild.modules: Removed gtk-doc.

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

19 months agoASSERT under WebAutomationSession::setProcessPool() when running W3C test suite a...
bburg@apple.com [Wed, 21 Feb 2018 02:17:57 +0000 (02:17 +0000)]
ASSERT under WebAutomationSession::setProcessPool() when running W3C test suite a second time
https://bugs.webkit.org/show_bug.cgi?id=182991
<rdar://problem/37620578>

Reviewed by Timothy Hatcher.

Sometimes when running more than one session end-to-end with the same browser instance,
UIProcess would crash under addMessageReceiver because another WebAutomationSession was still
registered. This is hard to reproduce, but upon code inspection, the receiver management code
is somewhat problematic because it only runs when the WebAutomationSession destructor runs.
In some cases the client could retain two sessions and cause the first one to never remove itself
as the message receiver.

Instead of unregistering the session as a message receiver underneath the session's destructor,
do this whenever a new session supplants an old session since there is only one active session at a time.

* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::~WebAutomationSession):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::setAutomationSession):

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

19 months agoIntroduce HAVE(IOSURFACE_ACCELERATOR)
timothy_horton@apple.com [Wed, 21 Feb 2018 01:32:26 +0000 (01:32 +0000)]
Introduce HAVE(IOSURFACE_ACCELERATOR)
https://bugs.webkit.org/show_bug.cgi?id=182955
<rdar://problem/37699510>

Reviewed by Sam Weinig.

Source/WebCore:

No new tests, no change in behavior.

Introduce HAVE(IOSURFACE_ACCELERATOR) and guard all uses of
IOSurfaceAccelerator behind it.

Rename USE(IOSURFACE) to HAVE(IOSURFACE) for accuracy.

* page/cocoa/MemoryReleaseCocoa.mm:
* platform/graphics/ca/TileController.cpp:
* platform/graphics/cg/IOSurfacePool.cpp:
* platform/graphics/cg/IOSurfacePool.h:
* platform/graphics/cg/ImageBufferCG.cpp:
* platform/graphics/cocoa/IOSurface.h:
* platform/graphics/cocoa/IOSurface.mm:
* platform/graphics/cocoa/IOSurfacePoolCocoa.mm:
* platform/graphics/cv/VideoTextureCopierCV.cpp:
* platform/graphics/cv/VideoTextureCopierCV.h:

Source/WebCore/PAL:

* pal/spi/cg/CoreGraphicsSPI.h:
* pal/spi/cocoa/IOSurfaceSPI.h:
* pal/spi/cocoa/QuartzCoreSPI.h:

Source/WebKit:

* Shared/RemoteLayerTree/RemoteLayerBackingStore.h:
* Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
* Shared/cg/ShareableBitmapCG.cpp:
* UIProcess/API/Cocoa/WKWebView.mm:
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
* UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
* UIProcess/mac/ViewSnapshotStore.h:
* UIProcess/mac/ViewSnapshotStore.mm:

Source/WTF:

* wtf/Platform.h:

Tools:

* DumpRenderTree/ios/PixelDumpSupportIOS.mm:
(createBitmapContextFromWebView):
* WebKitTestRunner/ios/PlatformWebViewIOS.mm:
(WTR::PlatformWebView::windowSnapshotImage):

WebKitLibraries:

* WebKitPrivateFrameworkStubs/iOS/10/IOSurface.framework/IOSurface.tbd:
* WebKitPrivateFrameworkStubs/iOS/10/IOSurfaceAccelerator.framework/IOSurfaceAccelerator.tbd: Added.
* WebKitPrivateFrameworkStubs/iOS/11/IOSurfaceAccelerator.framework/IOSurfaceAccelerator.tbd: Added.
Switch IOSurfaceAccelerator symbols over to the still-private IOSurfaceAccelerator framework.

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

19 months agoProvisional load may get committed before receiving the decidePolicyForNavigationResp...
cdumez@apple.com [Wed, 21 Feb 2018 01:08:28 +0000 (01:08 +0000)]
Provisional load may get committed before receiving the decidePolicyForNavigationResponse response
https://bugs.webkit.org/show_bug.cgi?id=182720
<rdar://problem/37515204>

Reviewed by Alex Christensen.

Source/WebCore:

Wait for the policy response from the client after receiving a resource response,
before sending the NetworkResourceLoader::ContinueDidReceiveResponse IPC back to
the NetworkProcess. Otherwise, the network process may start sending us data and
we may end up committing the provisional load before receiving the policy decision
fron the client.

Change is covered by new API test.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::responseReceived):
* loader/NetscapePlugInStreamLoader.cpp:
(WebCore::NetscapePlugInStreamLoader::didReceiveResponse):
* loader/NetscapePlugInStreamLoader.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::deliverResponseAndData):
(WebCore::ResourceLoader::loadDataURL):
(WebCore::ResourceLoader::didReceiveResponse):
(WebCore::ResourceLoader::didReceiveResponseAsync):
* loader/ResourceLoader.h:
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didReceiveResponse):
(WebCore::SubresourceLoader::didReceiveResponsePolicy):
(WebCore::SubresourceLoader::willCancel):
* loader/SubresourceLoader.h:
* loader/ios/PreviewLoader.mm:
(-[WebPreviewLoader _sendDidReceiveResponseIfNecessary]):

Source/WebKit:

* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::didReceiveResponse):
* WebProcess/Storage/ServiceWorkerClientFetch.cpp:
(WebKit::ServiceWorkerClientFetch::didReceiveResponse):
* WebProcess/WebPage/WebURLSchemeTaskProxy.cpp:
(WebKit::WebURLSchemeTaskProxy::didReceiveResponse):

Source/WTF:

Add convenience CompletionHandlerCallingScope class which calls its CompletionHandler
when destroyed, and provides a release() methods to manually call the completionHandler.

* wtf/CompletionHandler.h:
(WTF::CompletionHandlerCallingScope::CompletionHandlerCallingScope):
(WTF::CompletionHandlerCallingScope::~CompletionHandlerCallingScope):
(WTF::CompletionHandlerCallingScope::CompletionHandler<void):

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/AsyncPolicyForNavigationResponse.mm:
(-[TestAsyncNavigationDelegate webView:decidePolicyForNavigationResponse:decisionHandler:]):
(TestWebKitAPI::TEST):

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

19 months agoCrash under JSC::JSCell::toNumber(JSC::ExecState*)
cdumez@apple.com [Wed, 21 Feb 2018 00:51:06 +0000 (00:51 +0000)]
Crash under JSC::JSCell::toNumber(JSC::ExecState*)
https://bugs.webkit.org/show_bug.cgi?id=182984
<rdar://problem/37694346>

Reviewed by Mark Lam.

Source/WebCore:

The issue was caused by DOMMatrix attributes potentially returning "impure"
NaN values. We would call JSC::jsNumber(double) to construct the JSValue
but this is only safe for pure NaN values. Make sure we purify the double
returned by the implementation for IDL attributes of type 'unrestricted double'
before calling JSC::jsNumber(double).

No new tests, extended existing test.

* bindings/js/JSDOMConvertNumbers.h:
(WebCore::JSConverter<IDLUnrestrictedDouble>::convert):
* testing/TypeConversions.h:
(WebCore::TypeConversions::testImpureNaNUnrestrictedDouble const):
(WebCore::TypeConversions::testImpureNaN2UnrestrictedDouble const):
(WebCore::TypeConversions::testQuietNaNUnrestrictedDouble const):
* testing/TypeConversions.idl:

LayoutTests:

Add layout test coverage.

* js/dom/webidl-type-mapping-expected.txt:
* js/dom/webidl-type-mapping.html:

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

19 months agoMark two imported/w3c/web-platform-tests/2dcontext/imagebitmap tests as flaky on...
ryanhaddad@apple.com [Wed, 21 Feb 2018 00:35:11 +0000 (00:35 +0000)]
Mark two imported/w3c/web-platform-tests/2dcontext/imagebitmap tests as flaky on iOS.
https://bugs.webkit.org/show_bug.cgi?id=182833

Unreviewed test gardening.

* platform/ios/TestExpectations:

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

19 months agoMake more use of USE(OPENGL_ES) where it makes sense
timothy_horton@apple.com [Tue, 20 Feb 2018 23:34:00 +0000 (23:34 +0000)]
Make more use of USE(OPENGL_ES) where it makes sense
https://bugs.webkit.org/show_bug.cgi?id=182957
<rdar://problem/37699443>

Reviewed by Dan Bernstein.

No new tests, no behavior change.

Make use of USE(OPENGL_ES) for CoreVideo functions that differ based
on GL availability. Also adjust GraphicsContext3D in the same way.

* platform/cocoa/CoreVideoSoftLink.cpp:
* platform/cocoa/CoreVideoSoftLink.h:
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/cv/TextureCacheCV.mm:
(WebCore::TextureCacheCV::create):
(WebCore::TextureCacheCV::textureFromImage):
* platform/graphics/cv/VideoTextureCopierCV.cpp:
(WebCore::enumToStringMap):
(WebCore::VideoTextureCopierCV::initializeContextObjects):
(WebCore::VideoTextureCopierCV::initializeUVContextObjects):
(WebCore::VideoTextureCopierCV::copyImageToPlatformTexture):
(WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture):

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

19 months agoAlways inline soft linking functions to work around a clang bug
timothy_horton@apple.com [Tue, 20 Feb 2018 23:11:32 +0000 (23:11 +0000)]
Always inline soft linking functions to work around a clang bug
https://bugs.webkit.org/show_bug.cgi?id=182985
<rdar://problem/37587017>

Reviewed by Dan Bernstein.

* wtf/cocoa/SoftLinking.h:
In some cases, clang will emit a weak extern symbol for a re-declared
symbol that has availability attributes on it. To avoid this, always
inline to avoid emitting a second symbol.

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

19 months agoUnreviewed, rolling out r228829.
jlewis3@apple.com [Tue, 20 Feb 2018 23:02:01 +0000 (23:02 +0000)]
Unreviewed, rolling out r228829.

This caused a consistent failure in the API test
WebKit.InteractionDeadlockAfterCrash on iOS Simulator

Reverted changeset:

"Switch to UIWKTextInteractionAssistant for non-editable text"
https://bugs.webkit.org/show_bug.cgi?id=182834
https://trac.webkit.org/changeset/228829

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

19 months agoSkip tests that need ENABLE_LINK_PREFETCH
rego@igalia.com [Tue, 20 Feb 2018 21:45:27 +0000 (21:45 +0000)]
Skip tests that need ENABLE_LINK_PREFETCH
https://bugs.webkit.org/show_bug.cgi?id=182981

Unreviewed gardening.

These tests were marked in the different TestExpectations fails of each port,
when actually none of them were testing this code as ENABLE_LINK_PREFETCH is disabled by default
(even in development builds).

The patch just moves the flagged tests from the port specific TestExpectations files
to the generic TestExpectations file skipping them.

* TestExpectations:
* platform/gtk/TestExpectations:
* platform/ios/TestExpectations:
* platform/mac/TestExpectations:
* platform/win/TestExpectations:

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

19 months agoSwitch to UIWKTextInteractionAssistant for non-editable text
megan_gardner@apple.com [Tue, 20 Feb 2018 20:12:09 +0000 (20:12 +0000)]
Switch to UIWKTextInteractionAssistant for non-editable text
https://bugs.webkit.org/show_bug.cgi?id=182834

Reviewed by Wenson Hsieh and Tim Horton.

Switching to only using the UIWKTextInteractionAssistant. Only character granularity is now supported.
Also keep the from regressing gating the keyboard bring up on user interaction. The presents of a
textInteractionAssistant can no longer be used as proxy for the presence of the keyboard.

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

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

19 months agoMake WebResourceLoadStatisticsStore::processStatisticsAndDataRecords() call WebProces...
wilander@apple.com [Tue, 20 Feb 2018 19:27:26 +0000 (19:27 +0000)]
Make WebResourceLoadStatisticsStore::processStatisticsAndDataRecords() call WebProcessProxy::notifyPageStatisticsAndDataRecordsProcessed() in a proper callback
https://bugs.webkit.org/show_bug.cgi?id=182719
<rdar://problem/37517370>

Reviewed by Brent Fulgham.

Source/WebKit:

This will allow the page notification, statistics pruning, and persistence write
to be done at the right time and hopefully stabilize the layout tests including:
http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-deletion.html

* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
    Now takes a callback parameter.
(WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
* UIProcess/WebResourceLoadStatisticsStore.h:
    Now calls WebProcessProxy::notifyPageStatisticsAndDataRecordsProcessed()
    in a callback provided to WebResourceLoadStatisticsStore::removeDataRecords().

LayoutTests:

* platform/mac-wk2/TestExpectations:
    Marked http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-deletion.html
    as [ Pass ].
* platform/wk2/TestExpectations:
    Marked http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store.html
    as [ Pass ]. This should have been done already in r227223:
    https://bugs.webkit.org/show_bug.cgi?id=181822

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

19 months agoAX: AOM: Dispatch accessibleclick event
n_wang@apple.com [Tue, 20 Feb 2018 19:02:25 +0000 (19:02 +0000)]
AX: AOM: Dispatch accessibleclick event
https://bugs.webkit.org/show_bug.cgi?id=180898
<rdar://problem/36086710>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Accessibility events.
Spec: https://wicg.github.io/aom/spec/phase2.html

This patch allows developers to register event handlers on Elements
for custom accessibility events.

Accessibility events go through a capturing and bubbling phase just
like DOM events, but in the accessibility tree.

Implemented "accessibleclick" event.

Test: accessibility/mac/AOM-events.html

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::press):
(WebCore::AccessibilityObject::dispatchAccessibilityEvent):
* accessibility/AccessibilityObject.h:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityPerformAction:]):
* dom/Element.idl:
* dom/EventDispatcher.cpp:
(WebCore::dispatchEventWithType):
(WebCore::EventDispatcher::dispatchEvent):
* dom/EventDispatcher.h:
* dom/EventNames.h:
* dom/EventPath.cpp:
(WebCore::EventPath::EventPath):
* dom/EventPath.h:

Tools:

* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
(WTR::AccessibilityUIElement::syncPress):
* WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
* WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
(WTR::AccessibilityUIElement::syncPress):

LayoutTests:

* accessibility/mac/AOM-events-expected.txt: Added.
* accessibility/mac/AOM-events.html: Added.
* js/dom/dom-static-property-for-in-iteration-expected.txt:
* platform/mac-wk1/TestExpectations:

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

19 months ago[GTK][CMake] Support building with Enchant 2.x
aperez@igalia.com [Tue, 20 Feb 2018 18:46:10 +0000 (18:46 +0000)]
[GTK][CMake] Support building with Enchant 2.x
https://bugs.webkit.org/show_bug.cgi?id=182933

Reviewed by Michael Catanzaro.

* Source/cmake/FindEnchant.cmake: Check for both the "enchant" and "enchant-2"
pkg-config components, picking the first available for which the headers and
library are usable.

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

19 months ago[iOS 11.3 Beta] Can't copy a URL from Safari and paste it into the Gmail app
wenson_hsieh@apple.com [Tue, 20 Feb 2018 18:32:09 +0000 (18:32 +0000)]
[iOS 11.3 Beta] Can't copy a URL from Safari and paste it into the Gmail app
https://bugs.webkit.org/show_bug.cgi?id=182952
<rdar://problem/37636190>

Reviewed by Tim Horton.

Source/WebCore:

After r220865 refactored the iOS copy codepaths to use NSItemProviders, we stopped writing the URL as plain text
to the pasteboard. However, this means clients that only check for "text/plain" (or one of its aliases) on the
pasteboard won't read any data on paste.

To fix this, we restore the pre-iOS 11.3 behavior of writing both the URL and plain text to the pasteboard.
Since we're using item providers, we also ensure that the NSURL is at a higher fidelity than the string to make
it clear that the data should be consumed as a URL.

This patch also rebaselines an existing drag and drop test to cover this change, and adds a new API test,
ActionSheetTests.CopyLinkWritesURLAndPlainText, which simulates copying a link using the share sheet and pasting
into a DataTransfer-dumping test harness.

* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::write):

Tools:

Adds a new iOS copy/paste test that copies an anchor element via action sheet, and checks that upon pasting,
both "text/plain" and "text/uri-list" are provided. Additionally tweaks an existing iOS drag and drop test to
check for the same behavior.

* TestWebKitAPI/Tests/ios/ActionSheetTests.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/ios/DataInteractionTests.mm:
(TestWebKitAPI::TEST):

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

19 months ago[iOS] Returning from Auto-PiP causes Safari to be unresponsive
eric.carlson@apple.com [Tue, 20 Feb 2018 18:29:02 +0000 (18:29 +0000)]
[iOS] Returning from Auto-PiP causes Safari to be unresponsive
https://bugs.webkit.org/show_bug.cgi?id=182977
<rdar://problem/37685981>

Reviewed by Jer Noble.

Remove the error handling added in r228115, it breaks auto-pip.

* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(VideoFullscreenInterfaceAVKit::applicationDidBecomeActive):
(VideoFullscreenInterfaceAVKit::enterFullscreenStandard):
(VideoFullscreenInterfaceAVKit::exitFullscreen):
(VideoFullscreenInterfaceAVKit::cleanupFullscreen):
(VideoFullscreenInterfaceAVKit::didStartPictureInPicture):
(VideoFullscreenInterfaceAVKit::prepareForPictureInPictureStopWithCompletionHandler):
(VideoFullscreenInterfaceAVKit::exitFullscreenHandler):
(VideoFullscreenInterfaceAVKit::enterFullscreenHandler):

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

19 months ago[EME] Adopt new AVContentKeySession success delegate callback
jer.noble@apple.com [Tue, 20 Feb 2018 18:14:32 +0000 (18:14 +0000)]
[EME] Adopt new AVContentKeySession success delegate callback
https://bugs.webkit.org/show_bug.cgi?id=182974
<rdar://problem/36079035>

Reviewed by Eric Carlson.

Store the updateLicenseCallback if the new protocol method is present and supported.

* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
(-[WebCoreFPSContentKeySessionDelegate contentKeySession:contentKeyRequestDidSucceed:]):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::updateLicense):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::didFailToProvideRequest):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::requestDidSucceed):

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

19 months agoHandle all writing-modes in downcast
dino@apple.com [Tue, 20 Feb 2018 17:52:34 +0000 (17:52 +0000)]
Handle all writing-modes in downcast
https://bugs.webkit.org/show_bug.cgi?id=182949
<rdar://problem/37710687>

Reviewed by Myles Maxfield.

Source/WebCore:

It appears we forgot to handle the deprecated "lr"
writing-mode value.

Test: fast/writing-mode/svg-writing-modes.html

* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::operator WritingMode const):

LayoutTests:

Test all the deprecated SVG writing modes.

* fast/writing-mode/svg-writing-modes-expected.html: Added.
* fast/writing-mode/svg-writing-modes.html: Added.

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

19 months ago[Cairo] Drop target GraphicsContext usage in Cairo operations
zandobersek@gmail.com [Tue, 20 Feb 2018 17:03:07 +0000 (17:03 +0000)]
[Cairo] Drop target GraphicsContext usage in Cairo operations
https://bugs.webkit.org/show_bug.cgi?id=182964

Reviewed by Carlos Garcia Campos.

The GraphicsContext parameters in various Cairo operations are not used
anymore, so they can be removed. Callsites are updated to reflect this.

Source/WebCore:

* platform/graphics/cairo/CairoOperations.cpp:
(WebCore::Cairo::drawShadowLayerBuffer):
(WebCore::Cairo::fillShadowBuffer):
(WebCore::Cairo::drawPathShadow):
(WebCore::Cairo::drawGlyphsShadow):
(WebCore::Cairo::fillRect):
(WebCore::Cairo::fillRoundedRect):
(WebCore::Cairo::fillRectWithRoundedHole):
(WebCore::Cairo::fillPath):
(WebCore::Cairo::strokeRect):
(WebCore::Cairo::strokePath):
(WebCore::Cairo::drawGlyphs):
(WebCore::Cairo::drawNativeImage):
(WebCore::Cairo::drawSurface):
* platform/graphics/cairo/CairoOperations.h:
* platform/graphics/cairo/FontCairo.cpp:
(WebCore::FontCascade::drawGlyphs):
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::drawNativeImage):
(WebCore::GraphicsContext::fillPath):
(WebCore::GraphicsContext::strokePath):
(WebCore::GraphicsContext::fillRect):
(WebCore::GraphicsContext::strokeRect):
(WebCore::GraphicsContext::platformFillRoundedRect):
(WebCore::GraphicsContext::fillRectWithRoundedHole):
* platform/graphics/cairo/GraphicsContextImplCairo.cpp:
(WebCore::GraphicsContextImplCairo::fillRect):
(WebCore::GraphicsContextImplCairo::fillRoundedRect):
(WebCore::GraphicsContextImplCairo::fillRectWithRoundedHole):
(WebCore::GraphicsContextImplCairo::fillPath):
(WebCore::GraphicsContextImplCairo::strokeRect):
(WebCore::GraphicsContextImplCairo::strokePath):
(WebCore::GraphicsContextImplCairo::drawGlyphs):
(WebCore::GraphicsContextImplCairo::drawNativeImage):
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame):

Source/WebKit:

* Shared/cairo/ShareableBitmapCairo.cpp:
(WebKit::ShareableBitmap::paint):
* WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
(WebKit::convertCairoSurfaceToShareableBitmap):

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

19 months agoAdd widescreen layout class for the Downloads page
jond@apple.com [Tue, 20 Feb 2018 16:37:21 +0000 (16:37 +0000)]
Add widescreen layout class for the Downloads page
https://bugs.webkit.org/show_bug.cgi?id=182948

Reviewed by Alexey Proskuryakov.

* wp-content/themes/webkit/downloads.php: Added .widescreen for full-width layout.

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

19 months ago[WebVR][OpenVR] Retrieve eye parameters and field of view
svillar@igalia.com [Tue, 20 Feb 2018 15:52:01 +0000 (15:52 +0000)]
[WebVR][OpenVR] Retrieve eye parameters and field of view
https://bugs.webkit.org/show_bug.cgi?id=182962

Reviewed by Žan Doberšek.

Get the required data from OpenVR to fill in the VREyeParameters and
the VRFieldOfView objects.

* Modules/webvr/VRDisplay.cpp: Create some attributes in the
body of the constructor instead in the member initialization list to
avoid calling getDisplayInfo() multiple times.
(WebCore::VRDisplay::VRDisplay):
(WebCore::VRDisplay::capabilities const):
(WebCore::VRDisplay::getEyeParameters const):
* Modules/webvr/VRDisplay.h:
* Modules/webvr/VREyeParameters.cpp:
(WebCore::VREyeParameters::VREyeParameters): Added new attributes to
the constructor.
(WebCore::VREyeParameters::offset const): Return a Ref instead of
a raw pointer.
(WebCore::VREyeParameters::renderWidth const):
(WebCore::VREyeParameters::renderHeight const):
* Modules/webvr/VREyeParameters.h:
(WebCore::VREyeParameters::create):
* Modules/webvr/VRFieldOfView.cpp: Removed. All the impletementation
fits perfectly in the header file.
* Modules/webvr/VRFieldOfView.h:
(WebCore::VRFieldOfView::create):
(WebCore::VRFieldOfView::upDegrees const):
(WebCore::VRFieldOfView::rightDegrees const):
(WebCore::VRFieldOfView::downDegrees const):
(WebCore::VRFieldOfView::leftDegrees const):
(WebCore::VRFieldOfView::VRFieldOfView):
* Sources.txt:
* platform/vr/VRPlatformDisplay.h: Added some more data to the
VRPlatformDisplayInfo struct.
* platform/vr/openvr/VRPlatformDisplayOpenVR.cpp:
(WebCore::VRPlatformDisplayOpenVR::VRPlatformDisplayOpenVR):
(WebCore::VRPlatformDisplayOpenVR::computeFieldOfView): Computes the
up/down/left/right FOV angles in degrees from the raw project
values returned by OpenVR.
(WebCore::VRPlatformDisplayOpenVR::updateEyeParameters): Fills in
the eye parameter info.
(WebCore::VRPlatformDisplayOpenVR::~VRPlatformDisplayOpenVR):
* platform/vr/openvr/VRPlatformDisplayOpenVR.h:

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

19 months ago[GStreamer][MiniBrowser] Honor GStreamer command line parameters in MiniBrowser
philn@webkit.org [Tue, 20 Feb 2018 14:16:00 +0000 (14:16 +0000)]
[GStreamer][MiniBrowser] Honor GStreamer command line parameters in MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=173655

Reviewed by Xabier Rodriguez-Calvar.

The FIXME in GStreamerUtilities.cpp asks to pass the command line
parameters to the GStreamer initialization function.

Based on initial patch by: Vanessa Chipirrás Navalón  <vchipirras@igalia.com>

Source/WebCore:

* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::constructCommon): Removes the call to the method
that GStreamer initializes. It is no longer necessary.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::initializeGStreamerAndRegisterWebKitElements): Ditto
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::initializeGStreamerAndRegisterWebKitMSEElement): Ditto
* platform/graphics/gstreamer/GStreamerUtilities.cpp:
(WebCore::initializeGStreamer): Receive the GStreamer options and initialize GStreamer.
* platform/graphics/gstreamer/GStreamerUtilities.h: Add vector which contains
GStreamer options as the input parameter of the initializeGStreamer() method.

Source/WebKit:

* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode const):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h: Define the vector which contains the GStreamer options.
* UIProcess/gtk/WebProcessPoolGtk.cpp:
(WebKit::WebProcessPool::platformInitializeWebProcess): Read from cmdline file
the GStreamer options written by console.
* WebProcess/soup/WebProcessSoup.cpp:
(WebKit::WebProcess::platformInitializeWebProcess): Call initializeGStreamer() method passing
the vector which contains the options.

Tools:

* MiniBrowser/gtk/main.c:
(main): Add the group containing the Gstreamer options that the console displays.

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

19 months ago[css3-text] Skip tests that need ENABLE_CSS3_TEXT
rego@igalia.com [Tue, 20 Feb 2018 14:11:05 +0000 (14:11 +0000)]
[css3-text] Skip tests that need ENABLE_CSS3_TEXT
https://bugs.webkit.org/show_bug.cgi?id=182963

Unreviewed gardening.

These tests were marked in the different TestExpectations fails of each port,
when actually none of them were testing this code as ENABLE_CSS3_TEXT is disabled by default
(even in development builds).

The patch just moves the flagged tests from the port specific TestExpectations files
to the generic TestExpectations file skipping them.

It also removes editing/pasteboard/insert-text-decoration.html from the skipping list
as it should be passing for Mac an iOs too.

* TestExpectations:
* platform/gtk/TestExpectations:
* platform/ios/TestExpectations:
* platform/mac/TestExpectations:

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

19 months ago[GTK] whatsapp web blurry in some parts, sharp on others
magomez@igalia.com [Tue, 20 Feb 2018 12:46:23 +0000 (12:46 +0000)]
[GTK] whatsapp web blurry in some parts, sharp on others
https://bugs.webkit.org/show_bug.cgi?id=182673

Reviewed by Carlos Garcia Campos.

CoordinatedGraphicsLayer::createBackingStore() uses the scale factor returned by effectiveContentsScale(),
which is always 1 if selfOrAncestorHaveNonAffineTransforms() returns true. But this fuction always returns
true if the layer has an AnimatedPropertyTransform animation, which means that layers with those animations
won't use the appropriate scale factor, causing blurry renderings.

This patch removes the animations check, so animated layers properly use the required scale factor.

No new tests, no behavior change.

* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::selfOrAncestorHaveNonAffineTransforms):

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

19 months ago[Cairo] Leverage ShadowBlur without using scratch buffer, target GraphicsContext
zandobersek@gmail.com [Tue, 20 Feb 2018 10:52:16 +0000 (10:52 +0000)]
[Cairo] Leverage ShadowBlur without using scratch buffer, target GraphicsContext
https://bugs.webkit.org/show_bug.cgi?id=182958

Reviewed by Carlos Garcia Campos.

To allow ShadowBlur usage in different threads, avoid the ShadowBlur
class using the scratch buffer internally. The current implementation of
that scratch buffer is not thread-safe and its usage in such conditions
can lead to crashes.

Instead, the new methods use a temporary ImageBuffer object for drawing.
This does negate the efficiency of possibly reusing the scratch buffer,
but at this point that is not yet the priority. This only affects ports
using Cairo for drawing.

The added methods don't require a target GraphicsContext object to be
passed in, instead they accept buffer draw callbacks that are invoked
with the temporary ImageBuffer object containing the rasterized shadow,
as well as position and size parameters. The CTM and clip bounds values
also have to be passed in manually. In CairoOperations.cpp, the provided
callbacks invoke commands that are equivalent in effect to those that
would otherwise be invoked on the target GraphicsContext object in the
ShadowBlur class.

For now, this approach has to avoid the tiling-based drawing of the
rectangular shadows in drawRectShadow() and inset shadows in
drawInsetShadow(), and instead stick to the non-tiling fallback. While
only affecting Cairo-using ports, with some refactoring it should be
possible to again leverage the tiling-based approach as well.

The beginShadowLayer() and endShadowLayer() functions, which are only
used in CairoOperations.cpp, are replaced with the drawShadowLayer()
method. This one accepts an additional callback that allows the caller
to explicitly draw the shadow shape using the provided shadowing
GraphicsContext object. As with the other two new methods, a temporary
ImageBuffer object is used, and the buffer draw callback is invoked to
allow caller to properly handle the shadowing output.

In CairoOperations.cpp, the new ShadowBlur methods are exercised, with
direct Cairo operation invocation replacing the GraphicsContext calls
otherwise done through ShadowBlur. ShadowState object now also has to
track the global alpha and the global composite operator values so that
it can properly rasterize the resulting shadow into the final image.

No new tests -- no change in behavior.

* platform/graphics/ShadowBlur.cpp:
(WebCore::ShadowBlur::adjustBlurRadius):
(WebCore::ShadowBlur::calculateLayerBoundingRect):
(WebCore::ShadowBlur::drawRectShadow):
(WebCore::ShadowBlur::drawInsetShadow):
(WebCore::ShadowBlur::drawShadowLayer):
(WebCore::ShadowBlur::beginShadowLayer): Deleted.
(WebCore::ShadowBlur::endShadowLayer): Deleted.
* platform/graphics/ShadowBlur.h:
* platform/graphics/cairo/CairoOperations.cpp:
(WebCore::Cairo::drawShadowLayerBuffer):
(WebCore::Cairo::fillShadowBuffer):
(WebCore::Cairo::drawPathShadow):
(WebCore::Cairo::drawGlyphsShadow):
(WebCore::Cairo::ShadowState::ShadowState):
(WebCore::Cairo::fillRect):
(WebCore::Cairo::fillRoundedRect):
(WebCore::Cairo::fillRectWithRoundedHole):
(WebCore::Cairo::drawSurface):
* platform/graphics/cairo/CairoOperations.h:
Default-initialize FillSource::fillRule to RULE_NONZERO.
* platform/graphics/cairo/PlatformContextCairo.h:
Drop the ShadowBlur.h include, it's moved to CairoOperations.cpp.
* rendering/RenderThemeGtk.cpp:
Explicitly include the FloatRoundedRect.h header now that it's not
included through the ShadowBlur.h header via PlatformContextCairo.h.

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

19 months ago[WebVR] Use RuntimeEnabledFeatures to enable/disable WebVR
svillar@igalia.com [Tue, 20 Feb 2018 10:18:04 +0000 (10:18 +0000)]
[WebVR] Use RuntimeEnabledFeatures to enable/disable WebVR
https://bugs.webkit.org/show_bug.cgi?id=182961

Reviewed by Xabier Rodriguez-Calvar.

The shared feature was properly added to RuntimeEnabledFeatures some
time ago but the code was instead using a private method in
NavigatorWebVR to temporarily disable it. WebVR is enabled in
WebPreferences.yaml for GTK+ & WPE as default experimental feature.

* Modules/webvr/NavigatorWebVR.cpp:
(WebCore::NavigatorWebVR::getVRDisplays):
(WebCore::NavigatorWebVR::vrEnabled): Deleted.

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

19 months ago[Win] Fix MSVC's treating __attribute__((warn_unused_result))
commit-queue@webkit.org [Tue, 20 Feb 2018 08:42:12 +0000 (08:42 +0000)]
[Win] Fix MSVC's treating __attribute__((warn_unused_result))
https://bugs.webkit.org/show_bug.cgi?id=182479

Patch by Yousuke Kimoto <yousuke.kimoto@sony.com> on 2018-02-20
Reviewed by Darin Adler.

Since MSVC doesn't understand "__attribute__", "_Check_return_" is used instead.
If clang and VisualStudio 2017 are used, a macro with "__attriute__" will be chosen.

* UIProcess/API/cpp/WKRetainPtr.h:

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

19 months ago[WTR][GTK] crash log backtrace doesn't show symbol names for DatabaseProcess and...
commit-queue@webkit.org [Tue, 20 Feb 2018 07:08:00 +0000 (07:08 +0000)]
[WTR][GTK] crash log backtrace doesn't show symbol names for DatabaseProcess and NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=182953

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

* Scripts/webkitpy/port/gtk.py:
(GtkPort._get_crash_log): Removed the code to convert WebProcess name.
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::webProcessName): Return the correct program name for GTK+ port.
(WTR::TestController::networkProcessName): Ditto.
(WTR::TestController::databaseProcessName): Ditto.

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

19 months agoUse selector filter when invalidating descendants
antti@apple.com [Tue, 20 Feb 2018 06:09:13 +0000 (06:09 +0000)]
Use selector filter when invalidating descendants
https://bugs.webkit.org/show_bug.cgi?id=182839
<rdar://problem/37581072>

Reviewed by Zalan Bujtas.

We can make descendant invalidation faster by enabling filtering.

* css/SelectorFilter.cpp:
(WebCore::SelectorFilter::initializeParentStack):

    Traverse and reverse the ancestor chain, and push it.

(WebCore::SelectorFilter::pushParent):
(WebCore::SelectorFilter::pushParentInitializingIfNeeded):

    Add a version of pushParent that can initialize the stack.

(WebCore::SelectorFilter::popParent):
(WebCore::SelectorFilter::popParentsUntil):

    Pop until a given parent element.

(WebCore::SelectorFilter::pushParentStackFrame): Deleted.
(WebCore::SelectorFilter::popParentStackFrame): Deleted.

    These were the same as push/popParent.

* css/SelectorFilter.h:
(WebCore::SelectorFilter::popParent): Deleted.
* style/StyleInvalidator.cpp:
(WebCore::Style::Invalidator::invalidateStyleForDescendants):

    Use pushParentInitializingIfNeeded.

(WebCore::Style::Invalidator::invalidateStyleWithMatchElement):

    Use selector filter when doing descendant tree invalidation.
    Make sure to pop it until the parent when reusing.

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

19 months ago[FTL] Support ArrayPush for ArrayStorage
utatane.tea@gmail.com [Tue, 20 Feb 2018 05:01:57 +0000 (05:01 +0000)]
[FTL] Support ArrayPush for ArrayStorage
https://bugs.webkit.org/show_bug.cgi?id=182782

Reviewed by Saam Barati.

JSTests:

Existing array-push-multiple-storage.js covers ArrayPush(ArrayStorage) multiple arguments case.

* stress/array-push-array-storage-beyond-int32.js: Added.
(shouldBe):
(test):
* stress/array-push-array-storage.js: Added.
(shouldBe):
(test):
* stress/array-push-multiple-array-storage-beyond-int32.js: Added.
(shouldBe):
(test):
* stress/array-push-multiple-storage-continuous.js: Added.
(shouldBe):
(test):

Source/JavaScriptCore:

This patch adds support for ArrayPush(ArrayStorage). We just port ArrayPush(ArrayStorage) in DFG to FTL.

* ftl/FTLAbstractHeapRepository.h:
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileArrayPush):

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

19 months ago[FTL] Support ArrayPop for ArrayStorage
utatane.tea@gmail.com [Tue, 20 Feb 2018 04:33:33 +0000 (04:33 +0000)]
[FTL] Support ArrayPop for ArrayStorage
https://bugs.webkit.org/show_bug.cgi?id=182783

Reviewed by Saam Barati.

JSTests:

* stress/array-pop-array-storage.js: Added.
(shouldBe):
(test):

Source/JavaScriptCore:

This patch adds ArrayPop(ArrayStorage) support to FTL. We port the implementation in DFG to FTL.

* ftl/FTLAbstractHeapRepository.h:
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileArrayPop):

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