WebKit-https.git
21 months agoput_to_scope/get_from_scope should not cache lexical scopes when expecting a global...
keith_miller@apple.com [Tue, 6 Feb 2018 22:42:26 +0000 (22:42 +0000)]
put_to_scope/get_from_scope should not cache lexical scopes when expecting a global object
https://bugs.webkit.org/show_bug.cgi?id=182549
<rdar://problem/36189995>

Reviewed by Saam Barati.

JSTests:

* stress/var-injection-cache-invalidation.js: Added.
(allocateLotsOfThings):
(test):

Source/JavaScriptCore:

Previously, the llint/baseline caching for put_to_scope and
get_from_scope would cache lexical environments when the
varInjectionWatchpoint had been fired for global properties. Code
in the DFG does not follow this same assumption so we could
potentially return the wrong result. Additionally, the baseline
would write barrier the global object rather than the lexical
enviroment object. This patch makes it so that we do not cache
anything other than the global object for when the resolve type is
GlobalPropertyWithVarInjectionChecks or GlobalProperty.

* assembler/MacroAssembler.cpp:
(JSC::MacroAssembler::jitAssert):
* assembler/MacroAssembler.h:
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emit_op_get_from_scope):
(JSC::JIT::emit_op_put_to_scope):
* runtime/CommonSlowPaths.h:
(JSC::CommonSlowPaths::tryCachePutToScopeGlobal):
(JSC::CommonSlowPaths::tryCacheGetFromScopeGlobal):
* runtime/Options.h:

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

21 months agoREGRESSION: WebGL no longer producing a transparent canvas on iOS
dino@apple.com [Tue, 6 Feb 2018 22:23:11 +0000 (22:23 +0000)]
REGRESSION: WebGL no longer producing a transparent canvas on iOS
https://bugs.webkit.org/show_bug.cgi?id=182550
<rdar://problem/37234491>

Reviewed by Eric Carlson.

Due to some weirdness GL_RGBA8 is sometimes different between iOS and
other platforms. Only tell the WebGLLayer that it is opaque when it really
is not transparent.

Covered by existing test: fast/canvas/webgl/context-attributes-alpha

* platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
(WebCore::GraphicsContext3D::setRenderbufferStorageFromDrawable): Look at the context
attributes to decide if we should use an opaque layer.
* platform/graphics/cocoa/WebGLLayer.mm: Ditto.
(-[WebGLLayer initWithGraphicsContext3D:]):

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

21 months ago[WebIDL] Support optional Promise arguments
aestes@apple.com [Tue, 6 Feb 2018 21:45:21 +0000 (21:45 +0000)]
[WebIDL] Support optional Promise arguments
https://bugs.webkit.org/show_bug.cgi?id=182399
<rdar://problem/36754552>

Reviewed by Sam Weinig and Chris Dumez.

Previously, declaring a Promise argument as optional would result in a native type of
std::optional<RefPtr<DOMPromise>>. This is wasteful, since RefPtr can represent an optional
argument by storing nullptr. Further, PassArgumentExpression() assumed Promises were never
optional and tried to pass the argument as a Ref by calling RefPtr::releaseNonNull().

This patch removes the std::optional wrapper around optional Promises and simply passes the
promise as a RefPtr to native code.

* bindings/scripts/CodeGeneratorJS.pm:
(PassArgumentExpression):
(GenerateParametersCheck):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalPromiseBody):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalPromise):
* bindings/scripts/test/TestObj.idl:

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

21 months agoHasServiceWorkerRegistration bit should be sent when creating a new page
commit-queue@webkit.org [Tue, 6 Feb 2018 21:24:09 +0000 (21:24 +0000)]
HasServiceWorkerRegistration bit should be sent when creating a new page
https://bugs.webkit.org/show_bug.cgi?id=182410

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

Source/WebCore:

Covered by new API test.

Changed the default value of service workers being registered to false.
Every page created in the process will be responsible to change the value to true,
at which time the value will be kept to true for the lifetime of the process.

* workers/service/ServiceWorkerProvider.h:

Source/WebKit:

Move the bit computation at page creation time.
This allows computing the bit based on the web site data store and not only on the pool configuration.
WebPage uses that bit to activate service worker registration matching for the whole process.

In case there is a service worker process proxy created, the bit is set to true by default.

Bit is computed by checking for database file presence.
This information is cached in a map for efficiency reasons and cleared when a service worker process proxy is created.

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode const):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::initializeWebPage):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
(WebKit::WebProcessPool::initializeNewWebProcess):
(WebKit::WebProcessPool::mayHaveRegisteredServiceWorkers):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_cpuLimit):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:

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

21 months agoMake mixed content basic auth tests more robust
dbates@webkit.org [Tue, 6 Feb 2018 21:00:52 +0000 (21:00 +0000)]
Make mixed content basic auth tests more robust
https://bugs.webkit.org/show_bug.cgi?id=182537

Reviewed by Chris Dumez.

Load the test image programmatically instead of declaratively to avoid output flakiness caused by
the preload scanner preloading the test image. The preload scanner performs mixed content checks
and this can cause duplicate mixed content warnings in the test output.

* http/tests/security/mixedContent/secure-redirect-to-insecure-redirect-to-basic-auth-secure-image.https.html:
* http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-secure-image.https.html:

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

21 months agoAdd missing #if ENABLE(VIDEO) after r228092.
ross.kirsling@sony.com [Tue, 6 Feb 2018 20:55:08 +0000 (20:55 +0000)]
Add missing #if ENABLE(VIDEO) after r228092.
https://bugs.webkit.org/show_bug.cgi?id=182539

Reviewed by Michael Catanzaro.

* html/ImageBitmap.cpp:

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

21 months ago[Modern Media Controls] Test at media/modern-media-controls/tracks-panel/tracks-panel...
graouts@webkit.org [Tue, 6 Feb 2018 19:36:40 +0000 (19:36 +0000)]
[Modern Media Controls] Test at media/modern-media-controls/tracks-panel/tracks-panel-controls-bar-remains-visible-after-clicking-over-it.html fails
https://bugs.webkit.org/show_bug.cgi?id=182425

Reviewed by Dean Jackson.

Source/WebCore:

This test failed because the controls bar would not hit test at the moment we synthesized a mousemove over the controls bar as the first step towards
synthesizing a click on the controls bar to dismiss the tracks panel. Indeed, it would have "pointer-events" set to "none" until the tracks panel was
dismissed, which would only happen after the click event had been propagated. All we need to do is to ensure that none of the controls within the controls
bar get activated as a result of clicking over them when the tracks panel is visible, so we instead set "pointer-events" to "none" on all children of a
controls bar rather than the controls bar itself, which can thus still hit test.

* Modules/modern-media-controls/controls/media-controls.css:
(.media-controls.shows-tracks-panel > .controls-bar > *,):
(.media-controls.shows-tracks-panel > .controls-bar,): Deleted.

LayoutTests:

Turn the test back on now that it works.

* platform/mac/TestExpectations:

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

21 months agoLayout Test media/modern-media-controls/slider/slider-value.html is flaky
graouts@webkit.org [Tue, 6 Feb 2018 19:20:23 +0000 (19:20 +0000)]
Layout Test media/modern-media-controls/slider/slider-value.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=182515

Reviewed by Dean Jackson.

Ensure we stop printing messages once the test has completed since the bots show that this could happen,
although I couldn't reproduce locally.

* media/modern-media-controls/slider/slider-value.html:

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

21 months agoUnreviewed, unskip readable-byte-streams/detached-buffers.serviceworker.https.html...
cdumez@apple.com [Tue, 6 Feb 2018 18:44:49 +0000 (18:44 +0000)]
Unreviewed, unskip readable-byte-streams/detached-buffers.serviceworker.https.html as it is no longer flaky

* TestExpectations:

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

21 months agoService workers registrations are saved to disk before the install / activation succeeds
cdumez@apple.com [Tue, 6 Feb 2018 18:43:50 +0000 (18:43 +0000)]
Service workers registrations are saved to disk before the install / activation succeeds
https://bugs.webkit.org/show_bug.cgi?id=182535
<rdar://problem/36591485>

Reviewed by Youenn Fablet.

Service workers registrations are saved to disk before the install / activation succeeds.
This means if the browser exits before the install / activation succeeds, we may restore
from disk a registration with an “active” worker which may have never been installed /
activated.

To address the issue, we now delay saving the registration to disk until after the service
worker has been activated.

No new tests, restoration from disk is covered by API tests that still pass.

* workers/service/server/SWServer.cpp:
(WebCore::SWServer::didFinishActivation):
(WebCore::SWServer::installContextData):

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

21 months agoUnreviewed, add bug number of service-worker/fetch-event-respond-with-response-body...
cdumez@apple.com [Tue, 6 Feb 2018 18:41:13 +0000 (18:41 +0000)]
Unreviewed, add bug number of service-worker/fetch-event-respond-with-response-body-with-invalid-chunk.https.html

* TestExpectations:

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

21 months agoUnreviewed, unskip service-worker/about-blank-replacement.https.html as it is no...
cdumez@apple.com [Tue, 6 Feb 2018 18:36:53 +0000 (18:36 +0000)]
Unreviewed, unskip service-worker/about-blank-replacement.https.html as it is no longer flaky

* TestExpectations:

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

21 months agoUnreviewed, unskip service-worker/service-worker-csp-connect.https.html as it is...
cdumez@apple.com [Tue, 6 Feb 2018 18:34:25 +0000 (18:34 +0000)]
Unreviewed, unskip service-worker/service-worker-csp-connect.https.html as it is no longer flaky

* TestExpectations:

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

21 months agoUnreviewed, unskip service-worker/uncontrolled-page.https.html as it no longer seems...
cdumez@apple.com [Tue, 6 Feb 2018 18:32:11 +0000 (18:32 +0000)]
Unreviewed, unskip service-worker/uncontrolled-page.https.html as it no longer seems flaky

* TestExpectations:

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

21 months agoUnreviewed, mark service-worker/windowclient-navigate.https.html as slow instead...
cdumez@apple.com [Tue, 6 Feb 2018 18:26:20 +0000 (18:26 +0000)]
Unreviewed, mark service-worker/windowclient-navigate.https.html as slow instead of flaky

* TestExpectations:

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

21 months agoUnreviewed, unskip service-worker/registration-service-worker-attributes.https.html...
cdumez@apple.com [Tue, 6 Feb 2018 18:18:50 +0000 (18:18 +0000)]
Unreviewed, unskip service-worker/registration-service-worker-attributes.https.html now that it is no longer flaky

* TestExpectations:

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

21 months agoUnreviewed, unskip service-worker/update.https.html now that it is no longer flaky
cdumez@apple.com [Tue, 6 Feb 2018 18:16:14 +0000 (18:16 +0000)]
Unreviewed, unskip service-worker/update.https.html now that it is no longer flaky

* TestExpectations:

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

21 months ago[GTK][WPE] Add dependencies watching lists for WKGTK+ and WPE
agomez@igalia.com [Tue, 6 Feb 2018 16:24:59 +0000 (16:24 +0000)]
[GTK][WPE] Add dependencies watching lists for WKGTK+ and WPE
https://bugs.webkit.org/show_bug.cgi?id=182346

Reviewed by Michael Catanzaro.

Loren, Carlos and Andres are interested on the WKGTK+ dependencies
watchlist since they are running WKGTK+ EWS.

Similarly, Adrian and Carlos are running a WPE EWS.

* Scripts/webkitpy/common/config/watchlist: Added WPEDependencies
  and WebKitGTKDependencies watchlists with the proper people.

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

21 months agoUnreviewed, fix format specifiers added in r228116
mcatanzaro@igalia.com [Tue, 6 Feb 2018 14:50:01 +0000 (14:50 +0000)]
Unreviewed, fix format specifiers added in r228116
https://bugs.webkit.org/show_bug.cgi?id=182456
<rdar://problem/37181006>

* NetworkProcess/cache/CacheStorageEngineConnection.cpp:
(WebKit::CacheStorageEngineConnection::open):
(WebKit::CacheStorageEngineConnection::remove):
(WebKit::CacheStorageEngineConnection::caches):
(WebKit::CacheStorageEngineConnection::retrieveRecords):
(WebKit::CacheStorageEngineConnection::deleteMatchingRecords):
(WebKit::CacheStorageEngineConnection::putRecords):
(WebKit::CacheStorageEngineConnection::reference):
(WebKit::CacheStorageEngineConnection::dereference):

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

21 months agoUnreviewed, canonicalize contributors.json
mcatanzaro@igalia.com [Tue, 6 Feb 2018 13:20:48 +0000 (13:20 +0000)]
Unreviewed, canonicalize contributors.json

After Thibault's addition, automatic checks complain about
contributors.json with:

"[...] Use "validate-committer-lists --canonicalize" to reformat
it. [...]"

Patch by Andres Gomez <agomez@igalia.com> on 2018-02-06

* Scripts/webkitpy/common/config/contributors.json: Canonicalize.

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

21 months agoUnreviewed, add Lorenzo Tilve to contributors.json
mcatanzaro@igalia.com [Tue, 6 Feb 2018 13:19:40 +0000 (13:19 +0000)]
Unreviewed, add Lorenzo Tilve to contributors.json

We need to add Loren to the contributors list in order to CC him
in Bugzilla.

Patch by Andres Gomez <agomez@igalia.com> on 2018-02-06

* Scripts/webkitpy/common/config/contributors.json: Added Lorenzo
  Tilve.

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

21 months ago[GTK] fast/events/message-channel-gc-4.html is flaky
commit-queue@webkit.org [Tue, 6 Feb 2018 10:55:31 +0000 (10:55 +0000)]
[GTK] fast/events/message-channel-gc-4.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=182104

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

Revert r228001 because RunLoop::current isn't called in GC thread
anymore since r228152.

* wtf/RunLoop.cpp:
(WTF::RunLoop::current): Removed a template argument
CanBeGCThread::True of ThreadSpecific.

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

21 months agoInitialize ImageBitmap::m_bitmapData in the constructor.
Ms2ger@igalia.com [Tue, 6 Feb 2018 09:45:49 +0000 (09:45 +0000)]
Initialize ImageBitmap::m_bitmapData in the constructor.
https://bugs.webkit.org/show_bug.cgi?id=182487

Reviewed by Sam Weinig.

This removes the span of time where an ImageBitmap object would exist
with a null m_bitmapData during its construction.

No new tests: no behavior changes.

* html/ImageBitmap.cpp:
(WebCore::ImageBitmap::create): update signature
(WebCore::ImageBitmap::createPromise): update callers
(WebCore::ImageBitmap::ImageBitmap): update signature
* html/ImageBitmap.h: update signatures

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

21 months agoAvoid unnecessarily constructing RunLoops for GC AutomaticThreads in Connection:...
cdumez@apple.com [Tue, 6 Feb 2018 06:50:24 +0000 (06:50 +0000)]
Avoid unnecessarily constructing RunLoops for GC AutomaticThreads in Connection::sendMessage() after r228001
https://bugs.webkit.org/show_bug.cgi?id=182494
<rdar://problem/37147632>

Reviewed by Ryosuke Niwa.

Somebody fixed a GC crash in r228001 by allowing RunLoop::current() to be called from a
GC thread. However, this is still unnecessarily inefficient. Calling RunLoop::current()
will construct RunLoops for background GC threads (WTF::AutomaticThreads). This patches
updates the IPC code to call isMainThread() instead of RunLoop::isMain() in
Connection::sendMessage(). This should mean the same thing since this code runs in
WebKit2 and should be more efficient as it ends up simply calling pthread_main_np(),
without constructing a RunLoop.

* Platform/IPC/Connection.cpp:
(IPC::Connection::sendMessage):

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

21 months agoRelease assertion in inlineVideoFrame
rniwa@webkit.org [Tue, 6 Feb 2018 05:00:07 +0000 (05:00 +0000)]
Release assertion in inlineVideoFrame
https://bugs.webkit.org/show_bug.cgi?id=182513
<rdar://problem/37159363>

Reviewed by Zalan Bujtas.

Source/WebCore:

The bug was caused by the fact it's not always safe to invoke updateLayout even when isSafeToUpdateStyleOrLayout
on a document of a flattened frame on iOS. isSafeToUpdateStyleOrLayout returns true when the frame view is in
the frame-flattening mode to avoid hitting a release asssertion in updateLayout of the frame. However, it's still
not safe to invoke updateLayout on a parent frame in this case.

As a result, inlineVideoFrame (in Source/WebKit/WebProcess/cocoa/VideoFullscreenManager.mm) invokes updateLayout
even when the top-level document is not safe to update when the video element is in a frame-flattened document.

Fixed this bug by explicitly checking that we still have a live render tree and document hasn't been stopped.
Also replaced other uses of isSafeToUpdateStyleOrLayout by more explicit checks.

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::updateBackingStore): Made the early exit condition added in r227006 more explicit.
Namely, InspectorDOMAgent::pseudoElementCreated is invoked during style recalc.
* dom/Document.cpp:
(WebCore::isSafeToUpdateStyleOrLayout): Made this local to the file.
(WebCore::Document::updateStyleIfNeeded):
(WebCore::Document::updateLayout):
* dom/Document.h:
* html/MediaElementSession.cpp:
(WebCore::isMainContentForPurposesOfAutoplay): Made the early exit condition added in r227529 more explicit. Don't
update the layout when the render tree had been destroyed or the active DOM objects had been stopped.

Source/WebKit:

Fixed the bug. Don't try to update the layout when there is no live render tree or active DOM objects
had been stopped: i.e. during a document destruction.

* WebProcess/cocoa/VideoFullscreenManager.mm:
(WebKit::inlineVideoFrame):

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

21 months agoCrash in imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap...
commit-queue@webkit.org [Tue, 6 Feb 2018 03:57:32 +0000 (03:57 +0000)]
Crash in imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-origin.sub.html
https://bugs.webkit.org/show_bug.cgi?id=182422
<rdar://problem/37182665>

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

Source/WebCore:

Covered by test no longer crashing in Debug mode.
Make sure completionHandler is called on the main thread.

* platform/network/cocoa/WebCoreNSURLSession.mm:
(-[WebCoreNSURLSessionDataTask resource:receivedRedirect:request:completionHandler:]):

LayoutTests:

* platform/mac/TestExpectations:

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

21 months agoGlobal objects should be able to use TLCs to allocate from different blocks from...
fpizlo@apple.com [Tue, 6 Feb 2018 03:50:30 +0000 (03:50 +0000)]
Global objects should be able to use TLCs to allocate from different blocks from each other
https://bugs.webkit.org/show_bug.cgi?id=182227

Source/JavaScriptCore:

Reviewed by JF Bastien.

This uses TLCs to create at least `minimumDistanceBetweenCellsFromDifferenOrigins` bytes of
distance between objects from different origins, using the following combination of things. For
short lets refer to that constant as K.

- Since r227721, LargeAllocation puts K bytes padding at the end of each allocation.

- Since r227718, MarkedBlock puts at least K bytes in its footer.

- Since r227617, global objects can have their own TLCs, which make them allocate from a
  different set of blocks than other global objects. The TLC of a global object comes into
  effect when you enter the VM via that global object.

- With this change, TLCs and blocks both have security origins. A TLC will only use blocks that
  share the same security origin or empty blocks (in which case we zero the block and change
  its security origin).

WebCore determines the TLC-GlobalObject mapping. By default, global objects would simply use
the VM's default TLC. WebCore makes it so that DOM windows (but not worker global objects) get
a TLC based on their document's SecurityOrigin.

* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* heap/BlockDirectory.cpp:
(JSC::BlockDirectory::findBlockForAllocation):
(JSC::BlockDirectory::prepareForAllocation):
* heap/BlockDirectory.h:
* heap/LocalAllocator.cpp:
(JSC::LocalAllocator::LocalAllocator):
(JSC::LocalAllocator::reset):
(JSC::LocalAllocator::~LocalAllocator):
(JSC::LocalAllocator::allocateSlowCase):
(JSC::LocalAllocator::tryAllocateWithoutCollecting):
* heap/LocalAllocator.h:
(JSC::LocalAllocator::tlc const):
* heap/MarkStackMergingConstraint.cpp:
* heap/MarkStackMergingConstraint.h:
* heap/MarkedBlock.cpp:
(JSC::MarkedBlock::Handle::associateWithOrigin):
* heap/MarkedBlock.h:
(JSC::MarkedBlock::Handle::securityOriginToken const):
* heap/SecurityOriginToken.cpp: Added.
(JSC::uniqueSecurityOriginToken):
* heap/SecurityOriginToken.h: Added.
* heap/ThreadLocalCache.cpp:
(JSC::ThreadLocalCache::create):
(JSC::ThreadLocalCache::ThreadLocalCache):
(JSC::ThreadLocalCache::allocateData):
(JSC::ThreadLocalCache::installSlow):
* heap/ThreadLocalCache.h:
(JSC::ThreadLocalCache::securityOriginToken const):
* heap/ThreadLocalCacheInlines.h:
(JSC::ThreadLocalCache::install):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::JSGlobalObject):
(JSC::JSGlobalObject::createThreadLocalCache):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::threadLocalCache):
(JSC::JSGlobalObject::threadLocalCache const): Deleted.
* runtime/VMEntryScope.cpp:
(JSC::VMEntryScope::VMEntryScope):
(JSC::VMEntryScope::~VMEntryScope):
* runtime/VMEntryScope.h:

Source/WebCore:

Reviewed by Daniel Bates and Chris Dumez.

No new tests because no change in behavior.

Adopt JSC TLC API to put distance between objects from different security origins. WebCore has
a subclass of ThreadLocalCache that supports hash-consing based on the relevant origin data
using the existing SecurityOriginHash. It's Document's job to initiate this, but all of the
logic is in WebCore::OriginThreadLocalCache.

Workers don't opt into this. They just get the VM's default TLC all the time.

* ForwardingHeaders/heap/ThreadLocalCache.h: Added.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::JSDOMGlobalObject):
* bindings/js/JSDOMGlobalObject.h:
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::JSDOMWindowBase):
* dom/Document.cpp:
(WebCore::Document::initSecurityContext):
(WebCore::Document::threadLocalCache):
* dom/Document.h:
* page/OriginThreadLocalCache.cpp: Added.
(WebCore::threadLocalCacheMap):
(WebCore::OriginThreadLocalCache::create):
(WebCore::OriginThreadLocalCache::~OriginThreadLocalCache):
(WebCore::OriginThreadLocalCache::OriginThreadLocalCache):
* page/OriginThreadLocalCache.h: Added.
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::passesFileCheck const):
(WebCore::SecurityOrigin::setEnforcesFilePathSeparation):
(WebCore::SecurityOrigin::toString const):
(WebCore::SecurityOrigin::enforceFilePathSeparation): Deleted.
* page/SecurityOrigin.h:
(WebCore::SecurityOrigin::enforcesFilePathSeparation const):

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

21 months ago[WinCairo] Refine WebKitLegacy and WebKit build for wincairo
commit-queue@webkit.org [Tue, 6 Feb 2018 02:29:57 +0000 (02:29 +0000)]
[WinCairo] Refine WebKitLegacy and WebKit build for wincairo
https://bugs.webkit.org/show_bug.cgi?id=182478

Patch by Yousuke Kimoto <yousuke.kimoto@sony.com> on 2018-02-05
Reviewed by Alex Christensen.

.:

* Source/cmake/OptionsWinCairo.cmake: Added a ENABLE_WIN_CAIRO_WEBKIT option to build webkit for wincairo.

Source/WebKit:

Fixed a typo of forwarding header path for InjectedBundle and copying header
method, which should use FLATTENED.

* PlatformWin.cmake: Fix a typo of a forwarding header path for InjectedBundle and use FLATTENED.

Tools:

For TestWebKitAPI, sources related to WebKitLegacy are built
at WebKit build. Those files should be reffered for WebKitLegacy build.

* TestWebKitAPI/PlatformWin.cmake:

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

21 months agoTest gardening after r228044
mmaxfield@apple.com [Tue, 6 Feb 2018 02:27:50 +0000 (02:27 +0000)]
Test gardening after r228044
https://bugs.webkit.org/show_bug.cgi?id=182517

Unreviewed.

* platform/ios/fast/css-generated-content/initial-letter-basic-expected.txt:
* platform/ios/fast/css-generated-content/initial-letter-border-padding-expected.txt:
* platform/ios/fast/css-generated-content/initial-letter-raised-expected.txt:
* platform/ios/fast/css-generated-content/initial-letter-sunken-expected.txt:

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

21 months agoiOS WK2: fast/visual-viewport/resize-event-fired.html crashes with GuardMalloc
simon.fraser@apple.com [Tue, 6 Feb 2018 01:44:06 +0000 (01:44 +0000)]
iOS WK2: fast/visual-viewport/resize-event-fired.html crashes with GuardMalloc
https://bugs.webkit.org/show_bug.cgi?id=182504
rdar://problem/36386435

Reviewed by Wenson Hsieh.

Don't end the test until both the resize handler has been called, and the zoom is complete, to
avoid leaving dangling zoom completion handlers.

* fast/visual-viewport/resize-event-fired.html:
* platform/ios/TestExpectations:

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

21 months agoUnreviewed, fix build using the new ENABLE_ADDRESS_SANITIZER option
mcatanzaro@igalia.com [Tue, 6 Feb 2018 01:21:51 +0000 (01:21 +0000)]
Unreviewed, fix build using the new ENABLE_ADDRESS_SANITIZER option
https://bugs.webkit.org/show_bug.cgi?id=182400
<rdar://problem/37252242>

I failed to properly test a last-minute change.

* Source/cmake/WebKitCompilerFlags.cmake:

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

21 months ago[Win] Release assert failed under NetworkStateNotifier::singleton.
pvollan@apple.com [Tue, 6 Feb 2018 00:49:22 +0000 (00:49 +0000)]
[Win] Release assert failed under NetworkStateNotifier::singleton.
https://bugs.webkit.org/show_bug.cgi?id=182516

Reviewed by Brent Fulgham.

The callback NetworkStateNotifier::addressChangeCallback will always be called on a
worker thread on Windows. Since the method NetworkStateNotifier::singleton() is
called by NetworkStateNotifier::addressChangeCallback, but has to be called on the
on the main thread, the call has to be moved there.

No new tests. I have not been able to reproduce the crash.

* platform/network/win/NetworkStateNotifierWin.cpp:
(WebCore::NetworkStateNotifier::addressChangeCallback):

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

21 months agoWebsiteDataStore::resolveDirectoriesIfNecessary() should not overwrite its resolved...
cdumez@apple.com [Mon, 5 Feb 2018 23:36:51 +0000 (23:36 +0000)]
WebsiteDataStore::resolveDirectoriesIfNecessary() should not overwrite its resolved serviceWorkerRegistrationDirectory  if already set
https://bugs.webkit.org/show_bug.cgi?id=182514

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

* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):

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

21 months ago[cmake] Fix build with ICU configured without collation support
annulen@yandex.ru [Mon, 5 Feb 2018 23:31:31 +0000 (23:31 +0000)]
[cmake] Fix build with ICU configured without collation support
https://bugs.webkit.org/show_bug.cgi?id=182498

Reviewed by Alex Christensen.

WebKit has CollatorDefault.cpp providing necessary stubs when
UCONFIG_NO_COLLATION is defined, however it is not included in cmake
file list.

* wtf/CMakeLists.txt:

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

21 months ago[iOS] Storage process is using the wrong sandbox profile filename
bfulgham@apple.com [Mon, 5 Feb 2018 23:31:22 +0000 (23:31 +0000)]
[iOS] Storage process is using the wrong sandbox profile filename
https://bugs.webkit.org/show_bug.cgi?id=182500
<rdar://problem/37232614>

Reviewed by David Kilzer.

The iOS entitlements file was still referencing the old Databases sandbox profile, even though the
process has been renamed 'Storage'.

* Configurations/Databases-iOS.entitlements:

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

21 months ago[CMake] Add ENABLE_ADDRESS_SANITIZER to make it easier to build with asan support
mcatanzaro@igalia.com [Mon, 5 Feb 2018 23:23:28 +0000 (23:23 +0000)]
[CMake] Add ENABLE_ADDRESS_SANITIZER to make it easier to build with asan support
https://bugs.webkit.org/show_bug.cgi?id=182400

Reviewed by Konstantin Tokarev.

* Source/cmake/OptionsGTK.cmake:
* Source/cmake/WebKitCompilerFlags.cmake:

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

21 months agoREGRESSION (r217572): run-webkit-tests exits without emitting newline character
dbates@webkit.org [Mon, 5 Feb 2018 23:10:58 +0000 (23:10 +0000)]
REGRESSION (r217572): run-webkit-tests exits without emitting newline character
https://bugs.webkit.org/show_bug.cgi?id=182360

Rubber-stamped by Aakash Jain.

Fixes an annoyance where run-webkit-tests always exits without printing a newline character.
In the terminal this looks like:

    $ Tools/Scripts/run-webkit-tests
    Expected to fail, but passed: (7)
    ...
    Stopping WebSocket server ...$

This bug was caused by code added in r217572 to stop all run-webkit-tests started servers (e.g. an HTTP
server) from an at-exit handler. When run-webkit-tests runs successfully (i.e. without error or
control-C interruption) we would stop all such servers twice: once as part of ending the test
run and once from the at-exit handler. The latter never prints a trailing newline character hence
the state of the terminal (as depicted above). Instead LayoutTestRunner.stop_servers() should only
stop servers that it started in LayoutTestRunner.start_servers().

* Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py:
(LayoutTestRunner.__init__):
(LayoutTestRunner.start_servers):
(LayoutTestRunner.stop_servers):
Only start servers that run-webkit-tests has not already started and only stop servers that
run-webkit-tests started.

* Scripts/webkitpy/layout_tests/controllers/layout_test_runner_unittest.py:
(LayoutTestRunnerTests.test_servers_started.is_websocket_server_running):
(LayoutTestRunnerTests.test_servers_started):
(LayoutTestRunnerTests.test_servers_started.is_websocket_servers_running): Deleted.
Update due to rename below.

* Scripts/webkitpy/layout_tests/servers/websocket_server.py:
(is_web_socket_server_running): Added.
(PyWebSocket.is_running): Deleted.

* Scripts/webkitpy/port/base.py:
(Port.is_http_server_running): Check if we already started the server ourself.
(Port.is_websocket_server_running): Formerly named is_websocket_servers_running. Modified
to check if we already started the server ourself. Take a similar approach as the other
Port.is_*_running methods and only check if an existing WebSocket server is running on the
non-secure server port. This is a simple heuristic and should be sufficient in practice.
(Port.is_wpt_server_running): Check if we already started the server ourself.
(Port.is_websocket_servers_running): Deleted; renamed to is_websocket_server_running().

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

21 months agoprepare-ChangeLog gets confused about Python docstrings that contain the word "class...
dbates@webkit.org [Mon, 5 Feb 2018 22:54:17 +0000 (22:54 +0000)]
prepare-ChangeLog gets confused about Python docstrings that contain the word "class" or "def"
https://bugs.webkit.org/show_bug.cgi?id=182405

Reviewed by David Kilzer.

String literal statements, including docstrings, do not demarcate a new scope in Python.
So, do not treat them like they do when building up the list of modified functions.

* Scripts/prepare-ChangeLog:
(get_function_line_ranges_for_python):
* Scripts/webkitperl/prepare-ChangeLog_unittest/resources/python_unittests-expected.txt:
The expected ending line number for the last "pass" statement inside the scope of Class5 changed
from 97 to 98 because empty lines do not effect scope. This is consistent with the parsing
of the second "pass" statement in the scope of class Class5. A "pass" is a null operation that
is used as a syntactic placeholder when a statement is required. Ideally we would make
the parsing code smarter so as to avoid emitting ranges for "pass" statements that serve
not syntactic purpose.
* Scripts/webkitperl/prepare-ChangeLog_unittest/resources/python_unittests.py:
(Class5):
(Class6):
(Class6.__init__):
(Class7):
(Class7.__init__):
(Class8):
(Class8.__init__):
Add some more tests.

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

21 months agoWeb Inspector: Add an experimental setting to enable Sources tab
nvasilyev@apple.com [Mon, 5 Feb 2018 22:37:51 +0000 (22:37 +0000)]
Web Inspector: Add an experimental setting to enable Sources tab
https://bugs.webkit.org/show_bug.cgi?id=182461

Reviewed by Brian Burg.

This patch only adds a setting. It doesn't add the Sources tab.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Base/Setting.js:
* UserInterface/Views/SettingsTabContentView.js:

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

21 months agoUnreviewed, silence -Wimplicit-fallthrough in openvr
mcatanzaro@igalia.com [Mon, 5 Feb 2018 22:19:17 +0000 (22:19 +0000)]
Unreviewed, silence -Wimplicit-fallthrough in openvr
https://bugs.webkit.org/show_bug.cgi?id=182117

* openvr/patches/cmake-build.patch:
* openvr/src/CMakeLists.txt:

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

21 months agoAdd DoNotProcessIncomingMessagesWhenWaitingForSyncReply to GetPlugins and RootViewToS...
rniwa@webkit.org [Mon, 5 Feb 2018 22:13:51 +0000 (22:13 +0000)]
Add DoNotProcessIncomingMessagesWhenWaitingForSyncReply to GetPlugins and RootViewToScreen
https://bugs.webkit.org/show_bug.cgi?id=182458

Reviewed by Chris Dumez.

Added DoNotProcessIncomingMessagesWhenWaitingForSyncReply to GetPlugins and RootViewToScreen
which are found to get sent from WebContent process while ScriptDisallowedScope is present
by a work-in-progress patch on webkit.org/b/182449.

* WebProcess/Plugins/WebPluginInfoProvider.cpp:
(WebKit::WebPluginInfoProvider::populatePluginCache):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::rootViewToScreen):

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

21 months agoAbstract heap generator should include JavaScriptCore headers directly
don.olmstead@sony.com [Mon, 5 Feb 2018 22:10:15 +0000 (22:10 +0000)]
Abstract heap generator should include JavaScriptCore headers directly
https://bugs.webkit.org/show_bug.cgi?id=182501

Reviewed by Alex Christensen.

No new tests. No change in behavior.

* domjit/generate-abstract-heap.rb:

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

21 months agoUnreviewed, rolling out r227964 and r228087.
jlewis3@apple.com [Mon, 5 Feb 2018 22:00:59 +0000 (22:00 +0000)]
Unreviewed, rolling out r227964 and r228087.
https://bugs.webkit.org/show_bug.cgi?id=182508

These introduced an API test  failure with
URLTest.HostIsIPAddress alongside commit r228086 (Requested by
mlewis13 on #webkit).

Reverted changesets:

"[SOUP] Ensure domain is valid when converting a WebCore
Cookie to Soup"
https://bugs.webkit.org/show_bug.cgi?id=182328
https://trac.webkit.org/changeset/227964

"WebDriver: addCookie command should prepend a dot to domain
if missing"
https://bugs.webkit.org/show_bug.cgi?id=182328
https://trac.webkit.org/changeset/228087

Patch by Commit Queue <commit-queue@webkit.org> on 2018-02-05

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

21 months ago[Extra zoom mode] Implement number pad UI when editing `tel` and `number` inputs
wenson_hsieh@apple.com [Mon, 5 Feb 2018 21:44:02 +0000 (21:44 +0000)]
[Extra zoom mode] Implement number pad UI when editing `tel` and `number` inputs
https://bugs.webkit.org/show_bug.cgi?id=182472
<rdar://problem/35143057>

Reviewed by Tim Horton.

Source/WebCore:

Adds a localized string for the "Done" button text in extra zoomed form controls.

* English.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::formControlDoneButtonTitle):
* platform/LocalizedStrings.h:

Source/WebKit:

Allows the user to edit numeric input types using a number pad. See below comments for more detail.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _startAssistingKeyboard]):
(-[WKContentView _stopAssistingNode]):

Dismiss the number pad, if it is present.

(-[WKContentView dismissNumberPadViewController:]):
(-[WKContentView presentNumberPadViewController:]):

Add new helpers for showing and hiding the number pad view controller.

(-[WKContentView presentViewControllerForAssistedNode:]):
(-[WKContentView textInputController:didRequestDismissalWithAction:]):

Dismiss the number pad, if it is present.

(-[WKContentView focusedFormControlControllerDidBeginEditing:]):
(-[WKContentView shouldPresentTextInputViewController:]): Deleted.

Remove -shouldPresentTextInputViewController and replace it with -presentViewControllerForAssistedNode:, which
presents the appropriate view controller given "assisted" node information.

* UIProcess/ios/forms/WKNumberPadView.h: Added.
* UIProcess/ios/forms/WKNumberPadView.mm: Added.
* UIProcess/ios/forms/WKNumberPadViewController.h: Added.
* UIProcess/ios/forms/WKNumberPadViewController.mm: Added.

Add "WebKitAdditions harness" files for the new number pad view and view controller classes.

* WebKit.xcodeproj/project.pbxproj:

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

21 months agoBuild fix for r228115, simple naming issue succeeded —> success.
wilander@apple.com [Mon, 5 Feb 2018 21:41:43 +0000 (21:41 +0000)]
Build fix for r228115, simple naming issue succeeded —> success.
https://bugs.webkit.org/show_bug.cgi?id=182507
<rdar://problem/37248566>

Reviewed by Eric Carlson.

No new tests. Build fix.

* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(VideoFullscreenInterfaceAVKit::enterFullscreenHandler):
    succeeded —> success

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

21 months agoUnreviewed, rolling out r228086.
jlewis3@apple.com [Mon, 5 Feb 2018 21:36:18 +0000 (21:36 +0000)]
Unreviewed, rolling out r228086.

This introduced a failure with API test
URLTest.HostIsIPAddress.

Reverted changeset:

"Add a way to check if a host is an IP address"
https://bugs.webkit.org/show_bug.cgi?id=182427
https://trac.webkit.org/changeset/228086

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

21 months agoUnreviewed, rolling out r228103.
jlewis3@apple.com [Mon, 5 Feb 2018 21:17:40 +0000 (21:17 +0000)]
Unreviewed, rolling out r228103.

This caused multiple tests to crash.

Reverted changeset:

"Use downcast in createLinkPreloadResourceClient"
https://bugs.webkit.org/show_bug.cgi?id=182488
https://trac.webkit.org/changeset/228103

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

21 months agoAdd logging to CacheStorageEngineConnection
commit-queue@webkit.org [Mon, 5 Feb 2018 21:03:58 +0000 (21:03 +0000)]
Add logging to CacheStorageEngineConnection
https://bugs.webkit.org/show_bug.cgi?id=182456

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

* NetworkProcess/cache/CacheStorageEngineConnection.cpp:
(WebKit::CacheStorageEngineConnection::open):
(WebKit::CacheStorageEngineConnection::remove):
(WebKit::CacheStorageEngineConnection::caches):
(WebKit::CacheStorageEngineConnection::retrieveRecords):
(WebKit::CacheStorageEngineConnection::deleteMatchingRecords):
(WebKit::CacheStorageEngineConnection::putRecords):
(WebKit::CacheStorageEngineConnection::reference):
(WebKit::CacheStorageEngineConnection::dereference):
* Platform/Logging.h:

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

21 months ago[iOS] VideoFullscreenInterfaceAVKit should not ignore errors
eric.carlson@apple.com [Mon, 5 Feb 2018 20:58:58 +0000 (20:58 +0000)]
[iOS] VideoFullscreenInterfaceAVKit should not ignore errors
https://bugs.webkit.org/show_bug.cgi?id=182497
<rdar://problem/36986898>

Reviewed by Jer Noble.

Always call layoutIfNeeded before calling -[AVPlayerViewController enterFullScreenAnimated:completionHandler]
or -[AVPlayerViewController exitFullScreenAnimated:completionHandler] because they both fail
if the view needs layout. Also don't ignore errors returned by those calls.

No new tests, the failure is non deterministic and I was not able to reproduce in a test.

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

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

21 months agoREGRESSION (r222795): Nike app "Refused to set unsafe header" when adding and viewing...
dbates@webkit.org [Mon, 5 Feb 2018 20:46:46 +0000 (20:46 +0000)]
REGRESSION (r222795): Nike app "Refused to set unsafe header" when adding and viewing cart
https://bugs.webkit.org/show_bug.cgi?id=182491
<rdar://problem/36533447>

Reviewed by Brent Fulgham.

Exempt Nike from the XHR header restrictions in r222795.

Following r222795 only Dashboard widgets are allowed to set arbitrary XHR headers.
However Nike also depends on such functionality.

Source/WebCore:

* platform/RuntimeApplicationChecks.h:
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
(WebCore::IOSApplication::isNike):

Source/WebKit:

* UIProcess/API/Cocoa/WKWebView.mm:
(shouldAllowSettingAnyXHRHeaderFromFileURLs):

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

21 months agoUnreviewed, unskip fetch-event-respond-with-partial-stream.https.html as it no longer...
cdumez@apple.com [Mon, 5 Feb 2018 20:26:45 +0000 (20:26 +0000)]
Unreviewed, unskip fetch-event-respond-with-partial-stream.https.html as it no longer times out

LayoutTests/imported/w3c:

* web-platform-tests/service-workers/service-worker/fetch-event-respond-with-partial-stream.https-expected.txt:
* web-platform-tests/service-workers/service-worker/import-scripts-redirect.https-expected.txt:

LayoutTests:

* TestExpectations:

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

21 months agoUnreviewed GTK+ gardening.
zandobersek@gmail.com [Mon, 5 Feb 2018 20:20:26 +0000 (20:20 +0000)]
Unreviewed GTK+ gardening.

* platform/gtk/TestExpectations: Re-skip the modern media controls tests
on the GTK+ port after they were unskipped in r228097. They're timing
out in large enough numbers to cause early exits. They should be
examined in more detail and unskipped once fixed.

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

21 months agoImprove NetworkResourceLoader logging so it can be used for 'setCookiesFromDOM'
bfulgham@apple.com [Mon, 5 Feb 2018 20:03:48 +0000 (20:03 +0000)]
Improve NetworkResourceLoader logging so it can be used for 'setCookiesFromDOM'
https://bugs.webkit.org/show_bug.cgi?id=182455
<rdar://problem/36626601>

Reviewed by Chris Dumez.

Source/WebCore:

After this refactoring, a convenience method I added in r227860 is no longer needed.
This patch removes this dead code.

* platform/network/NetworkStorageSession.h: Export 'cookieStoragePartition' so it can
be used in WebKit.
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::hasStorageAccessForFrame): Deleted unused method.

Source/WebKit:

Refactor "logCookieInformation" so that it can be used for resource loads and DOM cookie
manipulation. Place the generally useful logic in a static method that can be invoked
from other places in the NetworkProcess.

Call the new refactored method from NetworkConnectionToWebProcess::setCookiesFromDOM so
we can perform logging there as well.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM): Call the new logging method
(when enabled).
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::shouldLogCookieInformation): Changed to static method.
(WebKit::escapeForJSON): Made a static function so it could be shared between multiple
methods.
(WebKit::NetworkResourceLoader::logCookieInformation const): Refactor into two methods.
(WebKit::NetworkResourceLoader::logCookieInformation): Ditto.
(WebKit::NetworkResourceLoader::shouldLogCookieInformation const): Deleted.
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): Switch to user-enabled release logging
to track partitioning and blocking behavior.

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

21 months agoMake ASSERT_WITH_SECURITY_IMPLICATION in CachedResourceClientWalker::next a release...
antti@apple.com [Mon, 5 Feb 2018 19:43:35 +0000 (19:43 +0000)]
Make ASSERT_WITH_SECURITY_IMPLICATION in CachedResourceClientWalker::next a release assert
https://bugs.webkit.org/show_bug.cgi?id=182492

Reviewed by Youenn Fablet.

* loader/cache/CachedResourceClientWalker.h:
(WebCore::CachedResourceClientWalker::next):

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

21 months agoStorage Access API: Add testRunner.getAllStorageAccessEntries() to make testing easie...
wilander@apple.com [Mon, 5 Feb 2018 19:35:13 +0000 (19:35 +0000)]
Storage Access API: Add testRunner.getAllStorageAccessEntries() to make testing easier and more explicit
https://bugs.webkit.org/show_bug.cgi?id=181601
<rdar://problem/36475837>

Reviewed by Alex Christensen.

Source/WebCore:

No new tests. Existing test updated.

http/tests/storageAccess/request-and-grant-access-then-detach-should-not-have-access.html
was found to be flaky. With the testRunner.hasStorageAccessEntry() getter
it's possible to check access even if a frame doesn't respond timely to
postMessage after detach and attach.

* platform/network/NetworkStorageSession.h:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::getAllStorageAccessEntries const):

Source/WebKit:

http/tests/storageAccess/request-and-grant-access-then-detach-should-not-have-access.html
was found to be flaky. With the testRunner.hasStorageAccessEntry() getter
it's possible to check access even if a frame doesn't respond timely to
postMessage after detach and attach.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::getAllStorageAccessEntries):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _getAllStorageAccessEntries:]):
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::getAllStorageAccessEntries):
(WebKit::NetworkProcessProxy::allStorageAccessEntriesResult):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::getAllStorageAccessEntries):
* UIProcess/WebsiteData/WebsiteDataStore.h:

Tools:

http/tests/storageAccess/request-and-grant-access-then-detach-should-not-have-access.html
was found to be flaky. With the testRunner.hasStorageAccessEntry() getter
it's possible to check access even if a frame doesn't respond timely to
postMessage after detach and attach.

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::didReceiveMessageToPage):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setStorageAccessAPIEnabled):
    Just moved for source file grouping.
(WTR::TestRunner::getAllStorageAccessEntries):
(WTR::TestRunner::callDidReceiveAllStorageAccessEntriesCallback):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::getAllStorageAccessEntries):
    Note that this is just stubbed out, i.e. not implemented.
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):
(WTR::TestInvocation::didReceiveAllStorageAccessEntries):
* WebKitTestRunner/TestInvocation.h:
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::getAllStorageAccessEntries):
    This is the Cocoa-specific version of this test infrastructure.

LayoutTests:

http/tests/storageAccess/request-and-grant-access-then-detach-should-not-have-access.html
was found to be flaky. With the testRunner.hasStorageAccessEntry() getter
it's possible to check access even if a frame doesn't respond timely to
postMessage after detach and attach.

* http/tests/storageAccess/request-and-grant-access-then-detach-should-not-have-access-expected.txt:
* http/tests/storageAccess/request-and-grant-access-then-detach-should-not-have-access.html:
* platform/mac-wk2/TestExpectations:
    http/tests/storageAccess/request-and-grant-access-then-navigate-should-not-have-access.html
    no longer marked as flaky. Note that the wrong test was marked flaky. It should have been
    http/tests/storageAccess/request-and-grant-access-then-detach-should-not-have-access.html.

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

21 months agoGigacage: enable only for WebContent process and token executables
jfbastien@apple.com [Mon, 5 Feb 2018 19:26:49 +0000 (19:26 +0000)]
Gigacage: enable only for WebContent process and token executables
https://bugs.webkit.org/show_bug.cgi?id=182457
<rdar://problem/35875011>

Reviewed by Keith Miller.

Gigacage is a solid security improvement, but it's probably best
to roll it out incrementally to the most valuable targets first
and progressively try out more and more over time rather than
outright enabling it everywhere. We've gotten some reports that it
has some side-effects that weren't expected, so for now let's
enable it for the WebContent process, JSC, and other executables
we know, and then later we'll enable more gigacage uses.

For now I've chosen the following bundles:

  - com.apple.WebKit.WebContent.Development
  - com.apple.WebKit.WebContent
  - com.apple.WebProcess

And the following processes:

  - jsc
  - wasm
  - anything starting with "test", to match the JSC tests

I tried a different approach first, where I add a function to turn
gigacage on or off and crash if gigacage is initialized without
having been told what to do. Doing this in ChildProcess and a
bunch of the process initialization methods isn't sufficient. I
got MiniBrowser working, but some other builds use static globals
which themselves use hash and string which are allocate with
bmalloc and therefore which initialize gigacage before main is
called and before the process gets a chance to opt in our out. It
gets tricky with API calls too, because we have to do the right
thing in any entry an API user could plausibly use, even the
private ones, so I endend up having to initialize gigacage in e.g.
WebPreferencesExperimentalFeatures.cpp.erb.

Another approach could be to create a free-for-all gigacage
entitlement, and opt-in the processes we want..

As a follow-up we can also check that gigacage allocation always
succeeds if it was allowed for that process. With my change I
expect it to always succeed.

* CMakeLists.txt:
* bmalloc.xcodeproj/project.pbxproj:
* bmalloc/BPlatform.h:
* bmalloc/Gigacage.cpp:
(Gigacage::shouldBeEnabled):
* bmalloc/ProcessCheck.h: Added.
(bmalloc::gigacageEnabledForProcess):
* bmalloc/ProcessCheck.mm: Added.
(bmalloc::gigacageEnabledForProcess):

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

21 months agoMultiple bmalloc scavenger threads is unexpected
commit-queue@webkit.org [Mon, 5 Feb 2018 19:18:45 +0000 (19:18 +0000)]
Multiple bmalloc scavenger threads is unexpected
https://bugs.webkit.org/show_bug.cgi?id=182474
<rdar://problem/37175526>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2018-02-05
Reviewed by Filip Pizlo.

* bmalloc/Heap.cpp:
(bmalloc::Heap::Heap):
* bmalloc/IsoDirectoryInlines.h:
(bmalloc::passedNumPages>::takeFirstEligible):
(bmalloc::passedNumPages>::didBecome):
* bmalloc/bmalloc.cpp:
(bmalloc::api::scavenge):
(bmalloc::api::setScavengerThreadQOSClass):
Switch to SafePerProcess for Scavenger to ensure one instance
for the entire process.

* bmalloc/PerProcess.h:
(bmalloc::PerProcess::get):
(bmalloc::PerProcess::getFastCase):
(bmalloc::PerProcess::getSlowCase):
(bmalloc::SafePerProcess::get):
(bmalloc::SafePerProcess::getFastCase):
(bmalloc::SafePerProcess::getSlowCase):
Duplicate the class with a version that can ensure
single instances by requiring exporting symbols that
can be created with macros.

* bmalloc/Scavenger.cpp:
* bmalloc/Scavenger.h:
Export symbols to ensure all images get the same instance.

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

21 months ago[Win] Enable multi CPU building on MSBuild.
commit-queue@webkit.org [Mon, 5 Feb 2018 19:15:10 +0000 (19:15 +0000)]
[Win] Enable multi CPU building on MSBuild.
https://bugs.webkit.org/show_bug.cgi?id=182446

Compiling itself already uses multi cores, but other stuff is still on single core.
This patch enables that by passing an argument to MSBuild.exe.

Patch by Basuke Suzuki <Basuke.Suzuki@sony.com> on 2018-02-05
Reviewed by Alex Christensen.

* Scripts/webkitdirs.pm:
(determineNumberOfCPUs):
(buildVisualStudioProject):

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

21 months agoJavaScriptCore files should not be included relatively
don.olmstead@sony.com [Mon, 5 Feb 2018 19:02:06 +0000 (19:02 +0000)]
JavaScriptCore files should not be included relatively
https://bugs.webkit.org/show_bug.cgi?id=182452

Reviewed by Keith Miller.

* API/JSCallbackConstructor.h:
* CMakeLists.txt:
* disassembler/ARM64Disassembler.cpp:
* disassembler/ARMv7Disassembler.cpp:
* heap/LockDuringMarking.h:
* inspector/InjectedScriptBase.h:
* inspector/InjectedScriptHost.h:
* inspector/JavaScriptCallFrame.h:
* inspector/ScriptArguments.h:
* inspector/ScriptDebugListener.h:
* inspector/ScriptDebugServer.h:
* inspector/agents/InspectorAgent.h:
* inspector/agents/InspectorConsoleAgent.h:
* inspector/agents/InspectorDebuggerAgent.h:
* inspector/agents/InspectorHeapAgent.h:
* inspector/agents/InspectorRuntimeAgent.h:
* inspector/agents/InspectorScriptProfilerAgent.h:
* runtime/RegExp.h:

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

21 months agoSkipped imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-origi...
jlewis3@apple.com [Mon, 5 Feb 2018 18:46:05 +0000 (18:46 +0000)]
Skipped imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-origin.sub.html
https://bugs.webkit.org/show_bug.cgi?id=182422

Unreviewed test gardening.

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

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

21 months agoUse downcast in createLinkPreloadResourceClient
commit-queue@webkit.org [Mon, 5 Feb 2018 18:37:11 +0000 (18:37 +0000)]
Use downcast in createLinkPreloadResourceClient
https://bugs.webkit.org/show_bug.cgi?id=182488

Patch by Youenn Fablet <youenn@apple.com> on 2018-02-05
Reviewed by Antti Koivisto.

No observable change of behavior.

* loader/LinkLoader.cpp:
(WebCore::createLinkPreloadResourceClient):

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

21 months agoUnreviewed, rolling out r228012.
commit-queue@webkit.org [Mon, 5 Feb 2018 18:12:23 +0000 (18:12 +0000)]
Unreviewed, rolling out r228012.
https://bugs.webkit.org/show_bug.cgi?id=182493

"It regressed ARES-6 by 2-4%" (Requested by saamyjoon on
#webkit).

Reverted changeset:

"[JSC] Clean up ArraySpeciesCreate"
https://bugs.webkit.org/show_bug.cgi?id=182434
https://trac.webkit.org/changeset/228012

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

21 months agoLayout Test imported/w3c/web-platform-tests/service-workers/service-worker/register...
cdumez@apple.com [Mon, 5 Feb 2018 18:12:07 +0000 (18:12 +0000)]
Layout Test imported/w3c/web-platform-tests/service-workers/service-worker/register-same-scope-different-script-url.https.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=181166
<rdar://problem/37169508>

Reviewed by Youenn Fablet.

Source/WebCore:

I found out that this test was flakily timing out because our jobQueues would sometimes get stuck
when their current job's connection or service worker (when scheduled by a service worker) would
go away before the job is complete.

This patch makes our job queues operation more robust by:
1. Cancelling all jobs from a given connection when a SWServerConnection goes away
2. Cancelling all jobs from a given service worker when a service worker gets terminated

We also make sure service workers created by a job get properly terminated when a job
is canceled to avoid leaving service workers in limbo.

No new tests, unskipped existing flaky test.

* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::addRegistration):
(WebCore::ServiceWorkerContainer::removeRegistration):
(WebCore::ServiceWorkerContainer::updateRegistration):
* workers/service/ServiceWorkerJobData.cpp:
(WebCore::ServiceWorkerJobData::ServiceWorkerJobData):
(WebCore::ServiceWorkerJobData::isolatedCopy const):
* workers/service/ServiceWorkerJobData.h:
(WebCore::ServiceWorkerJobData::encode const):
(WebCore::ServiceWorkerJobData::decode):
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::startScriptFetch):
(WebCore::SWServer::scriptContextFailedToStart):
(WebCore::SWServer::scriptContextStarted):
(WebCore::SWServer::terminatePreinstallationWorker):
(WebCore::SWServer::installContextData):
(WebCore::SWServer::workerContextTerminated):
(WebCore::SWServer::unregisterConnection):
* workers/service/server/SWServer.h:
* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::removeAllJobsMatching):
(WebCore::SWServerJobQueue::cancelJobsFromConnection):
(WebCore::SWServerJobQueue::cancelJobsFromServiceWorker):
* workers/service/server/SWServerJobQueue.h:
* workers/service/server/SWServerRegistration.cpp:
(WebCore::SWServerRegistration::setPreInstallationWorker):

LayoutTests:

Unskip test that is no longer flaky.

* platform/mac-wk2/TestExpectations:

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

21 months agoDisallow evaluating JavaScript from NPP_Destroy() in WebKit
dbates@webkit.org [Mon, 5 Feb 2018 18:03:58 +0000 (18:03 +0000)]
Disallow evaluating JavaScript from NPP_Destroy() in WebKit
https://bugs.webkit.org/show_bug.cgi?id=181889
<rdar://problem/36674701>

Reviewed by Brent Fulgham.

Source/WebKit:

Make the behavior of WebKit match the behavior of WebKitLegacy on Mac.

* Shared/Plugins/NPObjectMessageReceiver.cpp:
(WebKit::NPObjectMessageReceiver::hasMethod):
(WebKit::NPObjectMessageReceiver::invoke):
(WebKit::NPObjectMessageReceiver::invokeDefault):
(WebKit::NPObjectMessageReceiver::hasProperty):
(WebKit::NPObjectMessageReceiver::getProperty):
(WebKit::NPObjectMessageReceiver::setProperty):
(WebKit::NPObjectMessageReceiver::removeProperty):
(WebKit::NPObjectMessageReceiver::enumerate):
(WebKit::NPObjectMessageReceiver::construct):
Bail out if the plugin is executing NPP_Destroy().

* WebProcess/Plugins/Plugin.cpp:
(WebKit::Plugin::destroyPlugin):
* WebProcess/Plugins/Plugin.h:
(WebKit::Plugin::isBeingDestroyed const):
Move bookkeeping of whether the plugin is being destroyed from PluginView
to here. This makes it straightforward for NPObjectMessageReceiver to query
this information.

* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::~PluginView):
(WebKit::PluginView::destroyPluginAndReset):
(WebKit::PluginView::recreateAndInitialize):
(WebKit::PluginView::protectPluginFromDestruction):
(WebKit::PluginView::unprotectPluginFromDestruction):
Move bookkeeping of whether the plugin is being destroyed from here
to Plugin.

* WebProcess/Plugins/PluginView.h:
(WebKit::PluginView::isBeingDestroyed const): Turn around and ask the plugin if it
is being destroyed, if we have one.

LayoutTests:

Consolidate all the plugin tests that evaluate JavaScript from NPP_Destroy()
and mark them as Wont Fix. In a subsequent change we will look to replace
these tests with tests that ensure that we do not evaluate JavaScript from
NPP_Destroy().

* platform/mac/TestExpectations:
* platform/wk2/TestExpectations:

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

21 months agoAdd support for submitting build request to Buildbot 0.9 server in BuildbotSyncer
aakash_jain@apple.com [Mon, 5 Feb 2018 17:14:13 +0000 (17:14 +0000)]
Add support for submitting build request to Buildbot 0.9 server in BuildbotSyncer
https://bugs.webkit.org/show_bug.cgi?id=182218

Reviewed by Ryosuke Niwa.

* tools/js/buildbot-syncer.js:
(BuildbotSyncer.prototype.scheduleRequest): Added assert to ensure forcescheduler property is always defined. Builds can not
be scheduled on Buildbot without this property. Updated unit-tests and server-tests accordingly.
(BuildbotSyncer.prototype.scheduleBuildOnBuildbotDeprecated): Method to schedule build request on Buildbot 0.8 server.
(BuildbotSyncer.prototype.scheduleBuildOnBuildbot): Method to schedule build request on Buildbot 0.9 server.
(BuildbotSyncer.prototype.pathForForceBuildDeprecated): Path for scheudling build on Buildbot 0.8 server.
(BuildbotSyncer.prototype.pathForForceBuild): Path for scheudling build on Buildbot 0.9 server.
* unit-tests/buildbot-syncer-tests.js:
(smallConfiguration): Added test-case for scheduleBuildOnBuildbot. Also added forcescheduler property in sample data.
* server-tests/resources/mock-data.js: Added forcescheduler property in sample data.
* server-tests/tools-buildbot-triggerable-tests.js: Updated server-tests to take care of added forcescheduler property.

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

21 months agoAdd support for fetching recent builds in Buildbot 0.9 format in BuildbotSyncer
aakash_jain@apple.com [Mon, 5 Feb 2018 16:53:22 +0000 (16:53 +0000)]
Add support for fetching recent builds in Buildbot 0.9 format in BuildbotSyncer
https://bugs.webkit.org/show_bug.cgi?id=179743

Reviewed by Ryosuke Niwa.

* tools/js/buildbot-syncer.js:
(BuildbotSyncer.prototype._pullRecentBuildsDeprecated): Renamed from _pullRecentBuilds. This method fetch
from Buildbot 0.8 server.
(BuildbotSyncer.prototype._pullRecentBuilds): Method to fetch recent builds from Buildbot 0.9 server.
(BuildbotSyncer.prototype.pathForRecentBuilds): URL for fetching recent builds from Buildbot 0.9 server.
(BuildbotSyncer.prototype.pathForBuildJSONDeprecated): Renamed from pathForBuildJSON.
* unit-tests/buildbot-syncer-tests.js:
(_pullRecentBuilds.it): unit-test - should not fetch recent builds when count is zero.
(_pullRecentBuilds.it): unit-test - should pull the right number of recent builds.
(_pullRecentBuilds.it): unit-test - should handle unexpected error while fetching recent builds.
(_pullRecentBuilds.it): unit-test - should create BuildbotBuildEntry after fetching recent builds.

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

21 months ago[Modern Media Controls] Turn media/modern-media-controls tests back on by default
graouts@webkit.org [Mon, 5 Feb 2018 16:33:33 +0000 (16:33 +0000)]
[Modern Media Controls] Turn media/modern-media-controls tests back on by default
https://bugs.webkit.org/show_bug.cgi?id=182482

Reviewed by Eric Carlson.

After updating a significant amount of tests under media/modern-media-controls over the last week, we can stop skipping
tests in this directory by default, and instead skip tests that do not apply on a per-platform basis. This patch does that
along with fixing a few remaining tests and adding some more for the new behavior of display 3, 4, 5 or 6 digits for time
labels depending on the overall video duration.

* TestExpectations:
* http/tests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-live-broadcast-expected.txt:
* http/tests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-live-broadcast.html:
* http/tests/media/modern-media-controls/skip-back-support/skip-back-support-button-click-expected.txt:
* http/tests/media/modern-media-controls/skip-back-support/skip-back-support-button-click.html:
* http/tests/media/modern-media-controls/status-support/status-support-loading-expected.txt:
* http/tests/media/modern-media-controls/status-support/status-support-loading.html:
* http/tests/media/modern-media-controls/time-control/1-to-10-hours-expected.txt: Added.
* http/tests/media/modern-media-controls/time-control/1-to-10-hours.html: Added.
* http/tests/media/modern-media-controls/time-control/10-hours-or-more-expected.txt: Added.
* http/tests/media/modern-media-controls/time-control/10-hours-or-more.html: Added.
* http/tests/media/modern-media-controls/time-control/10-minutes-to-1-hour-expected.txt: Added.
* http/tests/media/modern-media-controls/time-control/10-minutes-to-1-hour.html: Added.
* http/tests/media/modern-media-controls/time-control/less-than-10-minutes-expected.txt: Renamed from LayoutTests/http/tests/media/modern-media-controls/time-labels-support/long-time-expected.txt.
* http/tests/media/modern-media-controls/time-control/less-than-10-minutes.html: Renamed from LayoutTests/http/tests/media/modern-media-controls/time-labels-support/long-time.html.
* media/modern-media-controls/scrubber-support/scrubber-support-drag.html: Make this test more reliable by going a little further
left of the slider's left-most point to ensure we always get a 0-value.
* platform/ios/TestExpectations:
* platform/mac/TestExpectations:

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

21 months agoCrash on sfgate.com because mismatching link preload types
antti@apple.com [Mon, 5 Feb 2018 16:30:02 +0000 (16:30 +0000)]
Crash on sfgate.com because mismatching link preload types
https://bugs.webkit.org/show_bug.cgi?id=182483
<rdar://problem/37065331>

Reviewed by Daniel Bates.

Source/WebCore:

Preloading the same URL with different 'as' types causes some confusion.

Test: http/tests/preload/link-preload-type-mismatch.html

* loader/LinkLoader.cpp:
(WebCore::createLinkPreloadResourceClient):

    Ensure we use the actual resource type when creating the client.

(WebCore::LinkLoader::preloadIfNeeded):

    Don't construct client if the types don't match. This can happen if there is an existing
    preload for the same resource with different type.

LayoutTests:

* http/tests/preload/link-preload-type-mismatch-expected.txt: Added.
* http/tests/preload/link-preload-type-mismatch.html: Added.

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

21 months ago[css-grid] Rename gutter properties to remove "grid-" prefix
rego@igalia.com [Mon, 5 Feb 2018 13:51:24 +0000 (13:51 +0000)]
[css-grid] Rename gutter properties to remove "grid-" prefix
https://bugs.webkit.org/show_bug.cgi?id=180290

Reviewed by Javier Fernandez.

LayoutTests/imported/w3c:

Imported WPT tests from css/css-align/gaps/.
And also update the tests on css/css-grid/alignment/ gutter tests.

* web-platform-tests/css/css-align/gaps/column-gap-animation-001-expected.txt: Added.
* web-platform-tests/css/css-align/gaps/column-gap-animation-001.html: Added.
* web-platform-tests/css/css-align/gaps/column-gap-animation-002-expected.txt: Added.
* web-platform-tests/css/css-align/gaps/column-gap-animation-002.html: Added.
* web-platform-tests/css/css-align/gaps/column-gap-animation-003-expected.txt: Added.
* web-platform-tests/css/css-align/gaps/column-gap-animation-003.html: Added.
* web-platform-tests/css/css-align/gaps/column-gap-parsing-001-expected.txt: Added.
* web-platform-tests/css/css-align/gaps/column-gap-parsing-001.html: Added.
* web-platform-tests/css/css-align/gaps/gap-animation-001-expected.txt: Added.
* web-platform-tests/css/css-align/gaps/gap-animation-001.html: Added.
* web-platform-tests/css/css-align/gaps/gap-animation-002-expected.txt: Added.
* web-platform-tests/css/css-align/gaps/gap-animation-002.html: Added.
* web-platform-tests/css/css-align/gaps/gap-animation-003-expected.txt: Added.
* web-platform-tests/css/css-align/gaps/gap-animation-003.html: Added.
* web-platform-tests/css/css-align/gaps/gap-animation-004-expected.txt: Added.
* web-platform-tests/css/css-align/gaps/gap-animation-004.html: Added.
* web-platform-tests/css/css-align/gaps/gap-parsing-001-expected.txt: Added.
* web-platform-tests/css/css-align/gaps/gap-parsing-001.html: Added.
* web-platform-tests/css/css-align/gaps/grid-column-gap-parsing-001-expected.txt: Added.
* web-platform-tests/css/css-align/gaps/grid-column-gap-parsing-001.html: Added.
* web-platform-tests/css/css-align/gaps/grid-gap-parsing-001-expected.txt: Added.
* web-platform-tests/css/css-align/gaps/grid-gap-parsing-001.html: Added.
* web-platform-tests/css/css-align/gaps/grid-row-gap-parsing-001-expected.txt: Added.
* web-platform-tests/css/css-align/gaps/grid-row-gap-parsing-001.html: Added.
* web-platform-tests/css/css-align/gaps/row-gap-animation-001-expected.txt: Added.
* web-platform-tests/css/css-align/gaps/row-gap-animation-001.html: Added.
* web-platform-tests/css/css-align/gaps/row-gap-animation-002-expected.txt: Added.
* web-platform-tests/css/css-align/gaps/row-gap-animation-002.html: Added.
* web-platform-tests/css/css-align/gaps/row-gap-animation-003-expected.txt: Added.
* web-platform-tests/css/css-align/gaps/row-gap-animation-003.html: Added.
* web-platform-tests/css/css-align/gaps/row-gap-parsing-001-expected.txt: Added.
* web-platform-tests/css/css-align/gaps/row-gap-parsing-001.html: Added.
* web-platform-tests/css/css-align/gaps/w3c-import.log: Added.
* web-platform-tests/css/css-grid/alignment/grid-gutters-001-expected.html:
* web-platform-tests/css/css-grid/alignment/grid-gutters-002-expected.html:
* web-platform-tests/css/css-grid/alignment/grid-gutters-003-expected.html:
* web-platform-tests/css/css-grid/alignment/grid-gutters-004-expected.html:
* web-platform-tests/css/css-grid/alignment/grid-gutters-005-expected.html:
* web-platform-tests/css/css-grid/alignment/grid-gutters-006-expected.html:
* web-platform-tests/css/css-grid/alignment/grid-gutters-007-expected.html:
* web-platform-tests/css/css-grid/alignment/grid-gutters-008-expected.html:
* web-platform-tests/css/css-grid/alignment/grid-gutters-009-expected.html:
* web-platform-tests/css/css-grid/alignment/grid-gutters-010-expected.html:

Source/WebCore:

This patch applies the resoultion of the CSS WG to unprefix
the CSS Grid Layout gutter properties:
https://github.com/w3c/csswg-drafts/issues/1696

column-gap already existed before, as it's part of Multicol.
The patch adds the new properties row-gap and gap, and keep the legacy ones
as aliases:
- grid-column-gap => column-gap
- grid-row-gap => row-gap
- grid-gap => gap

As column-gap was already animatable, this change takes advantage
to make animatable row-gap too.

Tests: imported/w3c/web-platform-tests/css/css-align/gaps/

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSProperties.json:
* css/StyleProperties.cpp:
* css/parser/CSSParserFastPaths.cpp:
(WebCore::isSimpleLengthPropertyID):
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::CSSPropertyParser::parseShorthand):
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::availableSpaceForGutters const):
(WebCore::RenderGrid::gridGap const):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::gridAutoRows const):
(WebCore::RenderStyle::columnGap const):
(WebCore::RenderStyle::rowGap const):
(WebCore::RenderStyle::setGridItemRowEnd):
(WebCore::RenderStyle::setColumnGap):
(WebCore::RenderStyle::setRowGap):
(WebCore::RenderStyle::initialRowGap):
* rendering/style/StyleGridData.cpp:
(WebCore::StyleGridData::StyleGridData):
* rendering/style/StyleGridData.h:
(WebCore::StyleGridData::operator== const):
* rendering/style/StyleMultiColData.cpp:
(WebCore::StyleMultiColData::StyleMultiColData):
(WebCore::StyleMultiColData::operator== const):
* rendering/style/StyleMultiColData.h:
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator== const):
* rendering/style/StyleRareNonInheritedData.h:

LayoutTests:

* TestExpectations: We're now passing some gutters tests,
so removing them from TestExpectations.
* fast/css-grid-layout/grid-gutters-get-set.html: Removed. This is now covered by WPT tests.
* fast/css-grid-layout/grid-shorthand-get-set-expected.txt: Update results for gutter properties
as default value is now "normal".
* fast/css-grid-layout/grid-shorthand-get-set.html: Update checks for gutter properties
as default value is now "normal".

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

21 months agoImplement createImageBitmap(HTMLVideoElement)
Ms2ger@igalia.com [Mon, 5 Feb 2018 10:24:57 +0000 (10:24 +0000)]
Implement createImageBitmap(HTMLVideoElement)
https://bugs.webkit.org/show_bug.cgi?id=182388

Reviewed by Žan Doberšek.

LayoutTests/imported/w3c:

* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt:
* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage.html:
  Update from upstream to make the test pass on macOS.
* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt:

Source/WebCore:

The implementation is inspired by CanvasRenderingContext2DBase::drawImage().

Tests:

- web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage.html
- web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args.html

* html/ImageBitmap.cpp:
(WebCore::taintsOrigin): Add function to help with the implementation.
(WebCore::ImageBitmap::createPromise): Fill in implementation.

LayoutTests:

* platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt:
* platform/ios/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt:

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

21 months agoUnreviewed, rolling out r228085.
zandobersek@gmail.com [Mon, 5 Feb 2018 10:18:51 +0000 (10:18 +0000)]
Unreviewed, rolling out r228085.

Pixel data stride is imposed by OpenGL and shouldn't be
adjusted for Cairo

Reverted changeset:

"[Cairo] Correctly calculate stride in
GraphicsContext3D::paintToCanvas()"
https://bugs.webkit.org/show_bug.cgi?id=182466
https://trac.webkit.org/changeset/228085

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

21 months agoFix bug in MediaTime comparison for negative values with different scale.
aboya@igalia.com [Mon, 5 Feb 2018 09:14:09 +0000 (09:14 +0000)]
Fix bug in MediaTime comparison for negative values with different scale.
https://bugs.webkit.org/show_bug.cgi?id=182433

Source/WTF:

Reviewed by Xabier Rodriguez-Calvar.

* wtf/MediaTime.cpp:
(WTF::MediaTime::compare const):

Tools:

Improved test coverage for MediaTime::compare().

Reviewed by Xabier Rodriguez-Calvar.

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

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

21 months ago[SOUP] WebSockets must use system proxy settings
carlosgc@webkit.org [Mon, 5 Feb 2018 09:02:24 +0000 (09:02 +0000)]
[SOUP] WebSockets must use system proxy settings
https://bugs.webkit.org/show_bug.cgi?id=126384

Reviewed by Michael Catanzaro.

Source/WebCore:

Use soup_session_connect_async() when available to create the WebSockets connection instead of GSocketClient
directly.

* platform/network/soup/SocketStreamHandleImpl.h:
* platform/network/soup/SocketStreamHandleImplSoup.cpp:
(WebCore::wssSocketClientEventCallback):
(WebCore::SocketStreamHandleImpl::create):
(WebCore::SocketStreamHandleImpl::connected):
(WebCore::SocketStreamHandleImpl::connectedCallback):
(WebCore::SocketStreamHandleImpl::platformClose):

Tools:

Check also WebSockets in /webkit2/WebKitWebContext/proxy.

* TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebContext.cpp:
(ProxyTest::webSocketProxyServerCallback):
(ProxyTest::ProxyTest):
(ProxyTest::webSocketConnected):
(ProxyTest::createWebSocketAndWaitUntilConnected):
(webSocketServerCallback):
(testWebContextProxySettings):
* TestWebKitAPI/glib/WebKitGLib/WebKitTestServer.cpp:
(WebKitTestServer::~WebKitTestServer):
(WebKitTestServer::addWebSocketHandler):
(WebKitTestServer::removeWebSocketHandler):
(WebKitTestServer::getWebSocketURIForPath const):
(WebKitTestServer::getURIForPath const):
* TestWebKitAPI/glib/WebKitGLib/WebKitTestServer.h:
(WebKitTestServer::baseURI const):
(WebKitTestServer::baseWebSocketURI const):

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

21 months agoWebDriver: addCookie command should prepend a dot to domain if missing
carlosgc@webkit.org [Mon, 5 Feb 2018 08:46:44 +0000 (08:46 +0000)]
WebDriver: addCookie command should prepend a dot to domain if missing
https://bugs.webkit.org/show_bug.cgi?id=182328
<rdar://problem/37116398>

Reviewed by Michael Catanzaro.

RFC 2965: If an explicitly specified value does not start with a dot, the user agent supplies a leading dot.

Fixes: imported/w3c/webdriver/tests/cookies/add_cookie.py::test_add_domain_cookie

* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::addSingleCookie):

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

21 months agoAdd a way to check if a host is an IP address
carlosgc@webkit.org [Mon, 5 Feb 2018 08:04:30 +0000 (08:04 +0000)]
Add a way to check if a host is an IP address
https://bugs.webkit.org/show_bug.cgi?id=182427

Reviewed by Alex Christensen.

Source/WebCore:

There are several places where this is needed. We currently just assume that any host ending in a digit is an IP
address, except in PublicSuffix where platform specific code is used. This patch adds URL::hostIsIPAddress()
platform specific implementations, falling back to current assumption if there isn't an implementation for the
platform.

* page/OriginAccessEntry.cpp:
(WebCore::OriginAccessEntry::OriginAccessEntry): Use URL::hostIsIPAddress().
* platform/URL.cpp:
(WebCore::URL::hostIsIPAddress): Fallback implementation.
* platform/URL.h:
* platform/mac/PublicSuffixMac.mm:
(WebCore::topPrivatelyControlledDomain): Use URL::hostIsIPAddress().
* platform/mac/URLMac.mm:
(WebCore::URL::hostIsIPAddress): Move implementation from PublicSuffixMac.mm.
* platform/network/curl/CookieUtil.cpp:
(WebCore::CookieUtil::isIPAddress): Use URL::hostIsIPAddress().
* platform/soup/URLSoup.cpp:
(WebCore::URL::hostIsIPAddress): Use g_hostname_is_ip_address().

Tools:

Add unit test for URL::hostIsIPAddress().

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

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

21 months ago[Cairo] Correctly calculate stride in GraphicsContext3D::paintToCanvas()
zandobersek@gmail.com [Mon, 5 Feb 2018 07:38:08 +0000 (07:38 +0000)]
[Cairo] Correctly calculate stride in GraphicsContext3D::paintToCanvas()
https://bugs.webkit.org/show_bug.cgi?id=182466

Reviewed by Michael Catanzaro.

* platform/graphics/cairo/GraphicsContext3DCairo.cpp:
(WebCore::GraphicsContext3D::paintToCanvas):
Use cairo_format_stride_for_width() to obtain stride that Cairo thinks
is appropriate for the given width, taking into account internal
alignment requirements.

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

21 months ago[Cairo] Split TexMap functionality out of GraphicsContext3DCairo
zandobersek@gmail.com [Mon, 5 Feb 2018 07:33:44 +0000 (07:33 +0000)]
[Cairo] Split TexMap functionality out of GraphicsContext3DCairo
https://bugs.webkit.org/show_bug.cgi?id=182465

Reviewed by Michael Catanzaro.

Take the Non-Cairo GraphicsContext3D functionality that's stashed in
GraphicsContext3DCairo and move it into the GraphicsContext3DTextureMapper
file.

In GraphicsContext3DCairo.cpp, only the Cairo-specific GraphicsContext3D
functionality remains, specifically ImageExtractor and paintToCanvas().

Everything else is moved into GraphicsContext3DTextureMapper.cpp. This
filename and its location under platform/graphics/texmap/ was chosen
since all the ports using this file (GTK, WPE, WinCairo) are also using
the TextureMapper module. Various #if-guards are simplified in the
moved-over code to reflect this.

GraphicsContext3DCairo.cpp now better reflects GraphicsContext3DCG.cpp,
with both implementing functionality specific to a 2D painting library,
whereas GraphicsContext3DTextureMapper.cpp reflects
GraphicsContext3DCocoa.cpp in covering functionality needed to integrate
the GraphicsContext3D output into the platform-specific composition
system.

No new tests -- no change in behavior.

* platform/TextureMapper.cmake:
* platform/graphics/cairo/GraphicsContext3DCairo.cpp:
(WebCore::activeContexts): Deleted.
(WebCore::GraphicsContext3D::create): Deleted.
(WebCore::GraphicsContext3D::GraphicsContext3D): Deleted.
(WebCore::GraphicsContext3D::~GraphicsContext3D): Deleted.
(WebCore::GraphicsContext3D::setContextLostCallback): Deleted.
(WebCore::GraphicsContext3D::setErrorMessageCallback): Deleted.
(WebCore::GraphicsContext3D::makeContextCurrent): Deleted.
(WebCore::GraphicsContext3D::checkGPUStatus): Deleted.
(WebCore::GraphicsContext3D::platformGraphicsContext3D): Deleted.
(WebCore::GraphicsContext3D::platformTexture const): Deleted.
(WebCore::GraphicsContext3D::isGLES2Compliant const): Deleted.
(WebCore::GraphicsContext3D::platformLayer const): Deleted.
(WebCore::GraphicsContext3D::getExtensions): Deleted.
* platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp: Copied from Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp.
(WebCore::activeContexts):
(WebCore::GraphicsContext3D::create):
(WebCore::GraphicsContext3D::GraphicsContext3D):
(WebCore::GraphicsContext3D::~GraphicsContext3D):
(WebCore::GraphicsContext3D::setContextLostCallback):
(WebCore::GraphicsContext3D::setErrorMessageCallback):
(WebCore::GraphicsContext3D::makeContextCurrent):
(WebCore::GraphicsContext3D::checkGPUStatus):
(WebCore::GraphicsContext3D::platformGraphicsContext3D):
(WebCore::GraphicsContext3D::platformTexture const):
(WebCore::GraphicsContext3D::isGLES2Compliant const):
(WebCore::GraphicsContext3D::platformLayer const):
(WebCore::GraphicsContext3D::getExtensions):

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

21 months agoSimplify GraphicsContext3D::paintToCanvas()
zandobersek@gmail.com [Sun, 4 Feb 2018 08:18:23 +0000 (08:18 +0000)]
Simplify GraphicsContext3D::paintToCanvas()
https://bugs.webkit.org/show_bug.cgi?id=182459

Reviewed by Michael Catanzaro.

Cairo-specific paintToCanvas() method is dropped in favor of the more
common one that operates on a GraphicsContext object. The platform
context object is then retrieved inside the Cairo-speficic
paintToCanvas() implementation, and not at the call site in
GraphicsContext3D::paintRenderingResultsToCanvas().

GraphicsContext3D::paintToCanvas() is also modified so that the image
and canvas sizes are passed through IntSize objects, and not through
a width-and-height pair of integer values.

No new tests -- no change in behavior.

* platform/graphics/GraphicsContext3D.h:
* platform/graphics/cairo/GraphicsContext3DCairo.cpp:
(WebCore::GraphicsContext3D::paintToCanvas):
* platform/graphics/cg/GraphicsContext3DCG.cpp:
(WebCore::GraphicsContext3D::paintToCanvas):
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):

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

21 months agoLots of build warnings from Source/ThirdParty/openvr
zandobersek@gmail.com [Sun, 4 Feb 2018 08:17:17 +0000 (08:17 +0000)]
Lots of build warnings from Source/ThirdParty/openvr
https://bugs.webkit.org/show_bug.cgi?id=182117

Reviewed by Michael Catanzaro.

Suppress OpenVR compiler warnings by listing -Wno-unknown-pragmas,
-Wno-unused-parameter and -Wno-unused-variable options among the
libopenvr_api.so CXX flags.

CMake configuration warning about default project variables for the
openvr_api project is avoided by removing the openvr_api project and
instead setting the OPENVR_SOURCE_DIR to the path of the OpenVR
source directory under Source/ThirdParty/.

Another compiler warning is removed by fixing the return condition in
the Path_WriteBinaryFile() function to perform an equality comparison
instead of an assignment. This has already been fixed upstream.

All changes to the OpenVR code are reflected in the separately-managed
patch files kept in the patches/ directory.

* openvr/README.webkit:
* openvr/patches/Path_WriteBinaryFile-fix-return-condition.patch: Added.
* openvr/patches/cmake-build.patch:
* openvr/src/CMakeLists.txt:
* openvr/src/vrcommon/pathtools_public.cpp:
(Path_WriteBinaryFile):

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

21 months agoUI process sometimes crashes under -[WKContentView _lookupForWebView:]
timothy_horton@apple.com [Sun, 4 Feb 2018 03:35:18 +0000 (03:35 +0000)]
UI process sometimes crashes under -[WKContentView _lookupForWebView:]
https://bugs.webkit.org/show_bug.cgi?id=182460
<rdar://problem/33260602>

Reviewed by Wenson Hsieh.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _lookupForWebView:]):
If you have a range selection, but no rects for the selection, retrieving
the 0th element of selectionRects will crash the UI process. To fix, in
this case, use the rect for the starting caret instead.

It doesn't seem like the presentationRect is actually currently used for
the Lookup service, so the only impact is that we shouldn't crash anymore.

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

21 months agoTweak availability macros for CAN_DISALLOW_USER_INSTALLED_FONTS
ap@apple.com [Sat, 3 Feb 2018 22:39:10 +0000 (22:39 +0000)]
Tweak availability macros for CAN_DISALLOW_USER_INSTALLED_FONTS

Rubber-stamped by Maciej Stachowiak.

* platform/graphics/cocoa/FontCacheCoreText.cpp:

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

21 months agoAdd libmount to WPE dependencies
cturner@igalia.com [Sat, 3 Feb 2018 14:40:27 +0000 (14:40 +0000)]
Add libmount to WPE dependencies
https://bugs.webkit.org/show_bug.cgi?id=182345

Reviewed by Michael Catanzaro.

* wpe/install-dependencies:

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

21 months agoUnreviewed, follow up for test262 update
utatane.tea@gmail.com [Sat, 3 Feb 2018 09:59:34 +0000 (09:59 +0000)]
Unreviewed, follow up for test262 update
https://bugs.webkit.org/show_bug.cgi?id=182288

* test262.yaml:

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

21 months agoRemove remaining dead !USE(NETWORK_SESSION) code
mcatanzaro@igalia.com [Sat, 3 Feb 2018 04:59:18 +0000 (04:59 +0000)]
Remove remaining dead !USE(NETWORK_SESSION) code
https://bugs.webkit.org/show_bug.cgi?id=182451

Reviewed by Alex Christensen.

DownloadCurl.cpp and AuthenticationManagerSoup.cpp have been dead code since NETWORK_SESSION
became mandatory.

* NetworkProcess/Downloads/curl/DownloadCurl.cpp: Removed.
* PlatformGTK.cmake:
* PlatformWPE.cmake:
* PlatformWin.cmake:
* Shared/Authentication/soup/AuthenticationManagerSoup.cpp: Removed.

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

21 months agoClean up FrameLoader::receivedFirstData()
dbates@webkit.org [Sat, 3 Feb 2018 04:53:47 +0000 (04:53 +0000)]
Clean up FrameLoader::receivedFirstData()
https://bugs.webkit.org/show_bug.cgi?id=182361

Reviewed by Andy Estes.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::receivedFirstData):

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

21 months agoTest fix after r227995
mmaxfield@apple.com [Sat, 3 Feb 2018 04:22:04 +0000 (04:22 +0000)]
Test fix after r227995
https://bugs.webkit.org/show_bug.cgi?id=180951

Unreviewed.

Webfonts shouldn't be run through CTFontDescriptorCreateMatchingFontDescriptor().
Also, unify macOS's and iOS's implementation of FontCache::lastResortFallbackFont().

Covered by existing tests.

* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontDatabase::collectionForFamily):
(WebCore::FontDatabase::fontForPostScriptName):
(WebCore::addAttributesForInstalledFonts):
(WebCore::addAttributesForWebFonts):
(WebCore::installedFontMandatoryAttributes):
(WebCore::FontCache::lastResortFallbackFont):
(WebCore::addAttributesForUserInstalledFonts): Deleted.
(WebCore::mandatoryAttributesForUserInstalledFonts): Deleted.
* platform/graphics/cocoa/FontCacheCoreText.h:
* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::FontCache::lastResortFallbackFont): Deleted.
* platform/graphics/mac/FontCacheMac.mm:
(WebCore::FontCache::lastResortFallbackFont): Deleted.
* platform/graphics/mac/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::fontPlatformData):

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

21 months agoFix build error after r 227457 with VIDEO and WEB_AUDIO disabled
commit-queue@webkit.org [Sat, 3 Feb 2018 02:14:32 +0000 (02:14 +0000)]
Fix build error after r 227457 with VIDEO and WEB_AUDIO disabled
https://bugs.webkit.org/show_bug.cgi?id=182395

Patch by Basuke Suzuki <Basuke.Suzuki@sony.com> on 2018-02-02
Reviewed by Eric Carlson

* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::updateNowPlayingInfoIfNecessary):

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

21 months agoUnreviewed test gardening, skip fast/visual-viewport/resize-event-fired.html on iOS.
ryanhaddad@apple.com [Sat, 3 Feb 2018 02:06:43 +0000 (02:06 +0000)]
Unreviewed test gardening, skip fast/visual-viewport/resize-event-fired.html on iOS.

* platform/ios/TestExpectations:

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

21 months agoCacheStorage should check for origin file presence when computing the origin of a...
commit-queue@webkit.org [Sat, 3 Feb 2018 02:05:54 +0000 (02:05 +0000)]
CacheStorage should check for origin file presence when computing the origin of a folder
https://bugs.webkit.org/show_bug.cgi?id=182454

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

In case caches is opened for an origin but no cache is added, we do not have a caches name file but we do have an origin filename.
We should be checking the origin filename anyway since we will be reading it afterwards.

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

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

21 months agoRebaseline bindings generator tests after r228032.
ryanhaddad@apple.com [Sat, 3 Feb 2018 01:39:14 +0000 (01:39 +0000)]
Rebaseline bindings generator tests after r228032.
https://bugs.webkit.org/show_bug.cgi?id=182445

Unreviewed test gardening.

* Scripts/tests/builtins/expected/WebCoreJSBuiltins.h-result:

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

21 months agoUpdate test262 to Jan 30 version
ryanhaddad@apple.com [Sat, 3 Feb 2018 01:31:49 +0000 (01:31 +0000)]
Update test262 to Jan 30 version
https://bugs.webkit.org/show_bug.cgi?id=182288

Unreviewed test gardening.

* test262.yaml: Remove entry for missing test language/expressions/assignment/white-space.js

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

21 months agoRemove WebCore/ForwardingHeaders directory
don.olmstead@sony.com [Sat, 3 Feb 2018 00:57:02 +0000 (00:57 +0000)]
Remove WebCore/ForwardingHeaders directory
https://bugs.webkit.org/show_bug.cgi?id=182347

Reviewed by Alex Christensen.

Baseline tests updated.

* bindings/scripts/CodeGeneratorJS.pm:
(AddToIncludesForIDLType):
(GenerateEnumerationImplementationContent):
(GenerateDictionaryImplementationContent):
(GenerateHeader):
(GenerateOverloadDispatcher):
(addUnscopableProperties):
(GenerateImplementation):
(GenerateOperationDefinition):
(GenerateSerializerDefinition):
(GenerateConstructorHelperMethods):
* bindings/scripts/test/JS/JSInterfaceName.cpp:
* bindings/scripts/test/JS/JSMapLike.cpp:
* bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
* bindings/scripts/test/JS/JSTestCEReactions.cpp:
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
* bindings/scripts/test/JS/JSTestCallTracer.cpp:
* bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.cpp:
* bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.cpp:
* bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp:
* bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
* bindings/scripts/test/JS/JSTestDOMJIT.cpp:
* bindings/scripts/test/JS/JSTestDOMJIT.h:
* bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
* bindings/scripts/test/JS/JSTestException.cpp:
* bindings/scripts/test/JS/JSTestException.h:
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
* bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
* bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
* bindings/scripts/test/JS/JSTestIterable.cpp:
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
* bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
* bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
* bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
* bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestPluginInterface.cpp:
* bindings/scripts/test/JS/JSTestPluginInterface.h:
* bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
* bindings/scripts/test/JS/JSTestSerialization.cpp:
* bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
* bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
* bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
* bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp:
* bindings/scripts/test/JS/JSTestStringifier.cpp:
* bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
* bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
* bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
* bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
* bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
* bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
* dom/make_event_factory.pl:
(generateImplementation):

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

21 months agoW3C test exporter should allow exporting newly added files
commit-queue@webkit.org [Sat, 3 Feb 2018 00:53:51 +0000 (00:53 +0000)]
W3C test exporter should allow exporting newly added files
https://bugs.webkit.org/show_bug.cgi?id=182369

Patch by Youenn Fablet <youenn@apple.com> on 2018-02-02
Reviewed by Ryosuke Niwa.

* Scripts/webkitpy/common/checkout/scm/git.py:
(Git.apply_mail_patch):

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

21 months agoWebAppManifest scope should default to the containing directory of start_url if ...
david_quesada@apple.com [Sat, 3 Feb 2018 00:49:56 +0000 (00:49 +0000)]
WebAppManifest scope should default to the containing directory of start_url if 'scope' is not specified
https://bugs.webkit.org/show_bug.cgi?id=182363
rdar://problem/37093498

Reviewed by Ryosuke Niwa.

Source/WebCore:

If an app manifest doesn't specify a scope, we should default to the "parent directory" of
the start URL, rather than leaving the app unbounded. This is more reasonable than using the
entire internet as the app scope.

No new tests, updates to the existing tests verify the new behavior.

* Modules/applicationmanifest/ApplicationManifestParser.cpp:
(WebCore::ApplicationManifestParser::parseScope):

Tools:

Updated ApplicationManifestParserTests to account for the new default scope behavior.

* TestWebKitAPI/Tests/WebCore/ApplicationManifestParser.cpp:
(assertManifestHasDefaultValues):
(TEST_F):

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

21 months agoMake various DFG_ASSERTs provide more data to WTFCrashWithInfo
sbarati@apple.com [Sat, 3 Feb 2018 00:43:14 +0000 (00:43 +0000)]
Make various DFG_ASSERTs provide more data to WTFCrashWithInfo
https://bugs.webkit.org/show_bug.cgi?id=182453
<rdar://problem/37174236>

Reviewed by JF Bastien and Mark Lam.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGArgumentsEliminationPhase.cpp:
* dfg/DFGArgumentsUtilities.cpp:
(JSC::DFG::emitCodeToGetArgumentsArrayLength):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupChecksInBlock):
* dfg/DFGFlowIndexing.h:
(JSC::DFG::FlowIndexing::shadowIndex const):
* dfg/DFGLICMPhase.cpp:
(JSC::DFG::LICMPhase::run):
(JSC::DFG::LICMPhase::attemptHoist):
* dfg/DFGLoopPreHeaderCreationPhase.cpp:
(JSC::DFG::LoopPreHeaderCreationPhase::run):
* dfg/DFGPutStackSinkingPhase.cpp:
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileArithAbs):
(JSC::DFG::SpeculativeJIT::compileArithRounding):
(JSC::DFG::SpeculativeJIT::compileToPrimitive):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::fillJSValue):
(JSC::DFG::SpeculativeJIT::fillSpeculateInt32Internal):
(JSC::DFG::SpeculativeJIT::fillSpeculateInt32Strict):
(JSC::DFG::SpeculativeJIT::fillSpeculateInt52):
(JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
(JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGStoreBarrierClusteringPhase.cpp:
* dfg/DFGStoreBarrierInsertionPhase.cpp:
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileGetStack):
(JSC::FTL::DFG::LowerDFGToB3::compileArithClz32):
(JSC::FTL::DFG::LowerDFGToB3::compileArithAbs):
(JSC::FTL::DFG::LowerDFGToB3::compileArithRound):
(JSC::FTL::DFG::LowerDFGToB3::compileArithFloor):
(JSC::FTL::DFG::LowerDFGToB3::compileArithCeil):
(JSC::FTL::DFG::LowerDFGToB3::compileArithTrunc):
(JSC::FTL::DFG::LowerDFGToB3::compileArithNegate):
(JSC::FTL::DFG::LowerDFGToB3::compilePutById):
(JSC::FTL::DFG::LowerDFGToB3::compileGetIndexedPropertyStorage):
(JSC::FTL::DFG::LowerDFGToB3::compileGetByVal):
(JSC::FTL::DFG::LowerDFGToB3::compileStringFromCharCode):
(JSC::FTL::DFG::LowerDFGToB3::compileMultiPutByOffset):
(JSC::FTL::DFG::LowerDFGToB3::compileCompareEq):
(JSC::FTL::DFG::LowerDFGToB3::compileCompareStrictEq):
(JSC::FTL::DFG::LowerDFGToB3::compileIn):
(JSC::FTL::DFG::LowerDFGToB3::compare):
(JSC::FTL::DFG::LowerDFGToB3::switchStringRecurse):
(JSC::FTL::DFG::LowerDFGToB3::lowInt32):
(JSC::FTL::DFG::LowerDFGToB3::lowInt52):
(JSC::FTL::DFG::LowerDFGToB3::lowCell):
(JSC::FTL::DFG::LowerDFGToB3::lowBoolean):
(JSC::FTL::DFG::LowerDFGToB3::lowDouble):
(JSC::FTL::DFG::LowerDFGToB3::lowJSValue):

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

21 months agoClearing all service worker registrations should wait for importing service worker...
commit-queue@webkit.org [Sat, 3 Feb 2018 00:39:31 +0000 (00:39 +0000)]
Clearing all service worker registrations should wait for importing service worker registration to finish
https://bugs.webkit.org/show_bug.cgi?id=182407
<rdar://problem/37167523>

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

* workers/service/server/SWServer.cpp:
(WebCore::SWServer::clear): ensure completion handler is called on early exit case.

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

21 months agoConfigure serviceWorkerRegistrationDirectory on the web site data store and move...
commit-queue@webkit.org [Sat, 3 Feb 2018 00:36:20 +0000 (00:36 +0000)]
Configure serviceWorkerRegistrationDirectory on the web site data store and move it to a Caches subfolder as a default
https://bugs.webkit.org/show_bug.cgi?id=182403
<rdar://problem/36673358>

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

* UIProcess/WebProcessPool.cpp:
(WebKit::legacyWebsiteDataStoreConfiguration): Setting serviceWorkerRegistrationDirectory for legacy stores.

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

21 months agoJS Builtins should include JavaScriptCore headers directly
don.olmstead@sony.com [Fri, 2 Feb 2018 23:37:11 +0000 (23:37 +0000)]
JS Builtins should include JavaScriptCore headers directly
https://bugs.webkit.org/show_bug.cgi?id=182445

Reviewed by Yusuke Suzuki.

* Scripts/builtins/builtins_generator.py:
* Scripts/tests/builtins/expected/WebCore-AnotherGuardedInternalBuiltin-Separate.js-result:
* Scripts/tests/builtins/expected/WebCore-ArbitraryConditionalGuard-Separate.js-result:
* Scripts/tests/builtins/expected/WebCore-GuardedBuiltin-Separate.js-result:
* Scripts/tests/builtins/expected/WebCore-GuardedInternalBuiltin-Separate.js-result:
* Scripts/tests/builtins/expected/WebCore-UnguardedBuiltin-Separate.js-result:
* Scripts/tests/builtins/expected/WebCore-xmlCasingTest-Separate.js-result:

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

21 months agoWhen BytecodeParser inserts Unreachable after ForceOSRExit it needs to update Argumen...
sbarati@apple.com [Fri, 2 Feb 2018 22:55:29 +0000 (22:55 +0000)]
When BytecodeParser inserts Unreachable after ForceOSRExit it needs to update ArgumentPositions for Flushes it inserts
https://bugs.webkit.org/show_bug.cgi?id=182368
<rdar://problem/36932466>

Reviewed by Mark Lam.

JSTests:

* stress/flush-after-force-exit-in-bytecodeparser-needs-to-update-argument-positions.js: Added.
(runNearStackLimit.t):
(runNearStackLimit):
(try.runNearStackLimit):
(catch):

Source/JavaScriptCore:

When preserving liveness when inserting Unreachable nodes after ForceOSRExit,
we must add the VariableAccessData to the given argument position. Otherwise,
we may end up with a VariableAccessData that doesn't respect the shouldNeverUnbox bit.
If we end up with such a situation, it can lead to invalid IR after the
arguments elimination phase optimizes a GetByVal to a GetStack.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::flushImpl):
(JSC::DFG::ByteCodeParser::flushForTerminalImpl):
(JSC::DFG::ByteCodeParser::flush):
(JSC::DFG::ByteCodeParser::flushForTerminal):
(JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
(JSC::DFG::ByteCodeParser::parse):

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

21 months agoWeb Inspector: Styles Redesign: Pasting multiple properties should create properties...
webkit@devinrousso.com [Fri, 2 Feb 2018 22:52:56 +0000 (22:52 +0000)]
Web Inspector: Styles Redesign: Pasting multiple properties should create properties instead of a bad property
https://bugs.webkit.org/show_bug.cgi?id=179622
<rdar://problem/35511170>

Reviewed by Matt Baker.

* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype._remove):
(WI.SpreadsheetStyleProperty.prototype._update):
(WI.SpreadsheetStyleProperty.prototype.spreadsheetTextFieldDidCommit):
(WI.SpreadsheetStyleProperty.prototype._handleNamePaste):
When the user pastes into the name field, parse the text for a list of name-value pairs and
replace the property being edited with the text of those pairs.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
(WI.SpreadsheetCSSStyleDeclarationEditor):
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.layout):
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.addBlankProperty):
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyFocusMoved):
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyAddBlankPropertySoon):
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyRemoved):
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype._propertiesChanged):
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetCSSStyleDeclarationEditorFocusMoved): Deleted.
Calling `addBlankProperty` will trigger a layout on the next frame, but that might be before
the CSSAgent has had a chance to finish refreshing, so we need a way to defer the creation
of a new property until after we have finished the next layout (which is after the refresh).
Drive-by: fix naming of some delegate functions.
* UserInterface/Models/CSSProperty.js:
(WI.CSSProperty.prototype.replaceWithText):
Provide a way for replacing the property with new text.

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