WebKit-https.git
2 years agoUnreviewed WPE gardening. Unskip the SVG tests and generate the
zandobersek@gmail.com [Mon, 23 Oct 2017 17:35:23 +0000 (17:35 +0000)]
Unreviewed WPE gardening. Unskip the SVG tests and generate the
required platform-specific baselines.

* platform/wpe/TestExpectations:
* platform/wpe/svg: Added ~800 baselines.

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

2 years agoUnreviewed, rolling out r223699.
dbates@webkit.org [Mon, 23 Oct 2017 17:28:18 +0000 (17:28 +0000)]
Unreviewed, rolling out r223699.

Caused regressions with right-to-left text selection and
painting of markers in flipped writing mode and in overlapping
lines. Will investigate offline.

Reverted changeset:

"Share logic in InlineTextBox to compute selection rect"
https://bugs.webkit.org/show_bug.cgi?id=178232
https://trac.webkit.org/changeset/223699

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

2 years agoSource/WebCore:
commit-queue@webkit.org [Mon, 23 Oct 2017 17:25:32 +0000 (17:25 +0000)]
Source/WebCore:
Create a Fetch event when ServiceWorker has to handle a fetch
https://bugs.webkit.org/show_bug.cgi?id=178491

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-23
Reviewed by Chris Dumez.

Covered by existing test.

Updating FetchEvent to pass a FetchResponse* within its onResponse callback.
Making it a CompletionHandler.
Fixing a check on respondWith to ensure that event is dispatched when respondWith is called.

Adding ServiceWorkerFetch class to handle the creation of the fetch event, waiting for the fetch event to be responded
and processing when fetch event is responded.
ServiceWorkerFetchTask takes a client to which will be sent the response body or the error.
WebKit implementation of it will be to send the related IPC message back to the WebProcess that made the fetch request.

Adding a method to ServiceWorkerThread to create the fetch event on worker thread and dispatch on the global scope.

* WebCore.xcodeproj/project.pbxproj:
* platform/network/ResourceResponseBase.h:
* testing/Internals.cpp:
(WebCore::Internals::waitForFetchEventToFinish):
* workers/service/FetchEvent.cpp:
(WebCore::FetchEvent::~FetchEvent):
(WebCore::FetchEvent::respondWith):
(WebCore::FetchEvent::onResponse):
(WebCore::FetchEvent::respondWithError):
(WebCore::FetchEvent::processResponse):
(WebCore::FetchEvent::promiseIsSettled):
* workers/service/FetchEvent.h:
* workers/service/context/ServiceWorkerFetch.cpp: Added.
(WebCore::ServiceWorkerFetch::dispatchFetchTask):
(WebCore::ServiceWorkerFetch::processResponse):
* workers/service/context/ServiceWorkerFetch.h: Added.
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::m_workerObjectProxy):
(WebCore::ServiceWorkerThread::dispatchFetchEvent):
* workers/service/context/ServiceWorkerThread.h:

Source/WebKit:
TestController should clear all fetch caches when resetting its state
https://bugs.webkit.org/show_bug.cgi?id=178486
<rdar://problem/35066305>

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-23
Reviewed by Chris Dumez.

Adding a new DidNotHandle message to disambiguate with the DidFail fetch case.
With DidNotHandle, the loading should go the network process.
With DidFail, the loading should return a network error.

On receiving an order to start a fetch, ServiceWorkerThread will dispatch a fetch event.
The client of this event will retrieve the response and return it to the WebProcess through IPC.

* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::didNotHandleFetch):
* StorageProcess/ServiceWorker/WebSWServerConnection.h:
* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::didNotHandleFetch):
* StorageProcess/StorageProcess.h:
* StorageProcess/StorageProcess.messages.in:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Storage/ServiceWorkerClientFetch.cpp:
(WebKit::ServiceWorkerClientFetch::didFail):
(WebKit::ServiceWorkerClientFetch::didNotHandle):
* WebProcess/Storage/ServiceWorkerClientFetch.h:
* WebProcess/Storage/ServiceWorkerClientFetch.messages.in:
* WebProcess/Storage/ServiceWorkerContextManager.cpp:
(WebKit::ServiceWorkerContextManager::startFetch):
* WebProcess/Storage/ServiceWorkerContextManager.h:
* WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp: Added.
(WebKit::WebServiceWorkerFetchTaskClient::~WebServiceWorkerFetchTaskClient):
(WebKit::WebServiceWorkerFetchTaskClient::WebServiceWorkerFetchTaskClient):
(WebKit::WebServiceWorkerFetchTaskClient::didReceiveResponse):
(WebKit::WebServiceWorkerFetchTaskClient::didReceiveData):
(WebKit::WebServiceWorkerFetchTaskClient::didFail):
(WebKit::WebServiceWorkerFetchTaskClient::didFinish):
* WebProcess/Storage/WebServiceWorkerFetchTaskClient.h: Added.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::startFetchInServiceWorker):
* WebProcess/WebProcess.h:

LayoutTests:
TestController should clear all fetch caches when resetting its state
https://bugs.webkit.org/show_bug.cgi?id=178486
<rdar://problem/35066305>

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-23
Reviewed by Chris Dumez.

Beefing up the test by using fetch event handler to return responses
previously hard coded in ServiceWorkerContextManager.

* http/tests/workers/service/basic-fetch.https-expected.txt:
* http/tests/workers/service/resources/basic-fetch-worker.js:
(event.event.request.url.indexOf):
* http/tests/workers/service/resources/basic-fetch.js:

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

2 years ago[Curl] Fix authentication related bugs
commit-queue@webkit.org [Mon, 23 Oct 2017 17:21:08 +0000 (17:21 +0000)]
[Curl] Fix authentication related bugs
https://bugs.webkit.org/show_bug.cgi?id=178652

Patch by Basuke Suzuki <Basuke.Suzuki@sony.com> on 2017-10-23
Reviewed by Alex Christensen.

* platform/network/curl/AuthenticationChallengeCurl.cpp:
(WebCore::AuthenticationChallenge::protectionSpaceFromHandle):
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::setHttpAuthUserPass):
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::setUserPass):
(WebCore::CurlRequest::setupTransfer):
(WebCore::CurlRequest::didReceiveHeader):
* platform/network/curl/CurlRequest.h:

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

2 years agoMark compositing/visible-rect/iframe-no-layers.html as a flaky failure.
ryanhaddad@apple.com [Mon, 23 Oct 2017 17:10:05 +0000 (17:10 +0000)]
Mark compositing/visible-rect/iframe-no-layers.html as a flaky failure.
https://bugs.webkit.org/show_bug.cgi?id=178669

Unreviewed test gardening.

* platform/ios/TestExpectations:

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

2 years agoUnreviewed, rolling out r223820.
jlewis3@apple.com [Mon, 23 Oct 2017 16:44:58 +0000 (16:44 +0000)]
Unreviewed, rolling out r223820.

This caused a build break on Windows.

Reverted changeset:

"Web Inspector: Remove unused Console.setMonitoringXHREnabled"
https://bugs.webkit.org/show_bug.cgi?id=178617
https://trac.webkit.org/changeset/223820

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

2 years agoCall FrameView::scheduleSelectionUpdate when selection needs repainting after layout...
zalan@apple.com [Mon, 23 Oct 2017 15:57:51 +0000 (15:57 +0000)]
Call FrameView::scheduleSelectionUpdate when selection needs repainting after layout instead of setting the RenderView dirty.
https://bugs.webkit.org/show_bug.cgi?id=178651
<rdar://problem/35117448>

Reviewed by Antti Koivisto.

Calling setNeedsLayout() on the RenderView to trigger selection update is problematic in 2 different ways:
1. marking the root renderer dirty does not trigger layout (this is very specific to the root,
other renderers do trigger layout). It means that it works as long as someone else schedules a layout.
2. when a subtree layout is already scheduled and we mark the root renderer dirty, the root gets stuck with
the dirty flag (since the entry point for the subsequent layout is a descendant of the root and not the root itself).

This patch addresses these issues by scheduling/converting subtree layout when needed.

Covered by fast/dynamic/remove-invisible-node-inside-selection.html/remove-node-inside-selection.html

* editing/FrameSelection.cpp:
(WebCore::FrameSelection::respondToNodeModification):
* page/FrameView.cpp:
(WebCore::FrameView::scheduleSelectionUpdate):
* page/FrameView.h:

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

2 years ago[JSC] Use fastJoin in Array#toString
utatane.tea@gmail.com [Mon, 23 Oct 2017 11:50:21 +0000 (11:50 +0000)]
[JSC] Use fastJoin in Array#toString
https://bugs.webkit.org/show_bug.cgi?id=178062

Reviewed by Darin Adler.

JSTests:

* microbenchmarks/contiguous-array-to-string.js: Added.
(target):
* microbenchmarks/double-array-to-string.js: Added.
(target):
* microbenchmarks/int32-array-to-string.js: Added.
(target):

Source/JavaScriptCore:

Array#toString()'s fast path uses original join operation.
But this should use fastJoin if possible.
This patch adds a fast path using fastJoin in Array#toString.
And we also extend fastJoin to perform fast joining for int32
arrays.

                                     baseline                  patched

double-array-to-string          126.6157+-5.8625     ^    103.7343+-4.4968        ^ definitely 1.2206x faster
int32-array-to-string            64.7792+-2.6524           61.2390+-2.1749          might be 1.0578x faster
contiguous-array-to-string       62.6224+-2.6388     ^     56.9899+-2.0852        ^ definitely 1.0988x faster

* runtime/ArrayPrototype.cpp:
(JSC::fastJoin):
(JSC::arrayProtoFuncToString):
(JSC::arrayProtoFuncToLocaleString):
* runtime/JSStringJoiner.h:
(JSC::JSStringJoiner::appendWithoutSideEffects):
(JSC::JSStringJoiner::appendInt32):
(JSC::JSStringJoiner::appendDouble):

Source/WTF:

A bit cleaning up to use StringImpl::copyChars instead of
using for-loop directly.

* wtf/text/StringView.h:
(WTF::StringView::getCharactersWithUpconvert const):

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

2 years ago[TexMap] Remove GraphicsContext3D usage from TextureMapperShaderProgram
magomez@igalia.com [Mon, 23 Oct 2017 10:11:12 +0000 (10:11 +0000)]
[TexMap] Remove GraphicsContext3D usage from TextureMapperShaderProgram
https://bugs.webkit.org/show_bug.cgi?id=175425

Reviewed by Žan Doberšek.

Remove usage of the GraphicsContext3D class in TextureMapperShaderProgram.
Direct OpenGL API calls, types and constants are used instead.

By removing GraphicsContext3D, we don't use ANGLE anymore to perform the
shader adaptation to the used OpenGL/GLES2 version, so we need to do that
inside TextureMapperShaderProgram. The main changes required for this are
adding the #version directive and use in/out to define input/output parameters
when using OpenGL >= 3.2, and defining the default precision only when using
GLES2.

Besides that, now that VideoTextureCopierGStreamer doesn't have its own
GraphicsContext3D, we need to add a VAO to it when using OpenGL >= 3.2.

Based on a previous patch by Žan Doberšek <zdobersek@igalia.com>.

No behavior change.

* platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
(WebCore::VideoTextureCopierGStreamer::VideoTextureCopierGStreamer):
(WebCore::VideoTextureCopierGStreamer::~VideoTextureCopierGStreamer):
(WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture):
* platform/graphics/gstreamer/VideoTextureCopierGStreamer.h:
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGLData::getShaderProgram):
(WebCore::prepareFilterProgram):
(WebCore::TextureMapperGL::drawTexture):
(WebCore::TextureMapperGL::drawFiltered):
* platform/graphics/texmap/TextureMapperShaderProgram.cpp:
(WebCore::TextureMapperShaderProgram::create):
(WebCore::getShaderLog):
(WebCore::getProgramLog):
(WebCore::TextureMapperShaderProgram::TextureMapperShaderProgram):
(WebCore::TextureMapperShaderProgram::~TextureMapperShaderProgram):
(WebCore::TextureMapperShaderProgram::setMatrix):
(WebCore::TextureMapperShaderProgram::getLocation):
* platform/graphics/texmap/TextureMapperShaderProgram.h:
(WebCore::TextureMapperShaderProgram::programID const):

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

2 years agostress/check-string-ident.js is improperly skipped
zandobersek@gmail.com [Mon, 23 Oct 2017 05:27:28 +0000 (05:27 +0000)]
stress/check-string-ident.js is improperly skipped
https://bugs.webkit.org/show_bug.cgi?id=178642

Reviewed by Saam Barati.

* stress/check-string-ident.js: Drop the defaultNoEagerRun directive
since it enforces the run-jsc-stress-tests script to still set up the
test to run, despite the skip directive that's used before.

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

2 years ago[JSC] Remove !(OS(LINUX) && CPU(ARM64)) guards in RegisterState.h
zandobersek@gmail.com [Mon, 23 Oct 2017 05:26:35 +0000 (05:26 +0000)]
[JSC] Remove !(OS(LINUX) && CPU(ARM64)) guards in RegisterState.h
https://bugs.webkit.org/show_bug.cgi?id=178452

Reviewed by Yusuke Suzuki.

* heap/RegisterState.h: Re-enable the custom RegisterState and
ALLOCATE_AND_GET_REGISTER_STATE definitions on ARM64 Linux. These don't
cause any crashes nowadays.

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

2 years ago[Settings] Replace current Settings generation with template file based approach
commit-queue@webkit.org [Mon, 23 Oct 2017 03:13:33 +0000 (03:13 +0000)]
[Settings] Replace current Settings generation with template file based approach
https://bugs.webkit.org/show_bug.cgi?id=178634

Patch by Sam Weinig <sam@webkit.org> on 2017-10-22
Reviewed by Joseph Pecoraro.

This replaces the recently added python based Settings generation with a generator
built in ruby, so we can take advantage of ERB for templating. The result has much
of the logic in the templates and as a result feels much easier to follow and cleaner.

Since I was moving things to ruby, I took the opertunity to switch the Settings definition
file from our .in format to yaml, which is quite a bit easier to read.

* CMakeLists.txt:
* DerivedSources.make:
* Scripts/GenerateSettings: Removed.
* Scripts/GenerateSettings.py: Removed.
* Scripts/GenerateSettings.rb: Added.
* Scripts/GenerateSettings/GenerateInternalSettingsHeaderFile.py: Removed.
* Scripts/GenerateSettings/GenerateInternalSettingsIDLFile.py: Removed.
* Scripts/GenerateSettings/GenerateInternalSettingsImplementationFile.py: Removed.
* Scripts/GenerateSettings/GenerateSettings.py: Removed.
* Scripts/GenerateSettings/GenerateSettingsHeaderFile.py: Removed.
* Scripts/GenerateSettings/GenerateSettingsImplementationFile.py: Removed.
* Scripts/GenerateSettings/Settings.py: Removed.
* Scripts/GenerateSettings/__init__.py: Removed.
* Scripts/SettingsTemplates: Added.
* Scripts/SettingsTemplates/InternalSettingsGenerated.cpp.erb: Added.
* Scripts/SettingsTemplates/InternalSettingsGenerated.h.erb: Added.
* Scripts/SettingsTemplates/InternalSettingsGenerated.idl.erb: Added.
* Scripts/SettingsTemplates/Settings.cpp.erb: Added.
* Scripts/SettingsTemplates/Settings.h.erb: Added.
* WebCore.xcodeproj/project.pbxproj:
* WebCoreMacros.cmake:
* page/Settings.in: Removed.
* page/Settings.yaml: Added.

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

2 years ago[iOS] WebProcess::initializeWebProcess spends ~150ms spinning up AVSystemController...
wenson_hsieh@apple.com [Mon, 23 Oct 2017 02:20:19 +0000 (02:20 +0000)]
[iOS] WebProcess::initializeWebProcess spends ~150ms spinning up AVSystemController on some devices
https://bugs.webkit.org/show_bug.cgi?id=178640
<rdar://problem/35113105>

Reviewed by Youenn Fablet.

In r213933, we added a mechanism to allow the web process to drive media capture, by setting an attribute on the
shared AVSystemController. This requires us to fault in the Celestial framework, which is a slight performance
hit on some hardware. Instead of doing this at the start of every web process launch, we can just do this work
lazily, the first time the web process requests permissions for user media access.

* WebProcess/WebCoreSupport/WebUserMediaClient.cpp:
(WebKit::WebUserMediaClient::requestUserMediaAccess):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::prepareToSendUserMediaPermissionRequest):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::prepareToSendUserMediaPermissionRequest):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):

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

2 years agoREGRESSION(r219675): Web Inspector: CommandLineAPI getEventListeners does not work
commit-queue@webkit.org [Mon, 23 Oct 2017 00:43:38 +0000 (00:43 +0000)]
REGRESSION(r219675): Web Inspector: CommandLineAPI getEventListeners does not work
https://bugs.webkit.org/show_bug.cgi?id=178650
<rdar://problem/35116347>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-10-22
Reviewed by Sam Weinig.

Source/WebCore:

Test: inspector/console/command-line-api-getEventListeners.html

* inspector/CommandLineAPIHost.cpp:
(WebCore::listenerEntriesFromListenerInfo):
Fix typo.

(WebCore::CommandLineAPIHost::getEventListeners):
Fix incorrect early return.

* inspector/CommandLineAPIHost.h:
* inspector/CommandLineAPIHost.idl:
Add more attributes about the listener. These new attributes match output from Chrome.

LayoutTests:

* inspector/console/command-line-api-getEventListeners-expected.txt: Added.
* inspector/console/command-line-api-getEventListeners.html: Added.

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

2 years ago[Web Animations] Add animations to the timeline
commit-queue@webkit.org [Sun, 22 Oct 2017 21:31:24 +0000 (21:31 +0000)]
[Web Animations] Add animations to the timeline
https://bugs.webkit.org/show_bug.cgi?id=178643

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

Source/WebCore:

If a timeline is provided as a parameter to the Animation constructor,
add it to the timeline, and remove it when the object is destroyed.

We also start the basic mechanism to dump the contents of a timeline
as text for testing purposes, currently only logging the number of
animations in a timeline and just logging the class name for animation
themselves.

Test: webanimations/animation-creation-addition.html

* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::description):
* animation/AnimationTimeline.h:
* animation/AnimationTimeline.idl:
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::create):
(WebCore::WebAnimation::~WebAnimation):
(WebCore::WebAnimation::description):
* animation/WebAnimation.h:
* testing/Internals.cpp:
(WebCore::Internals::timelineDescription):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

Add a new test that checks that animations created with a timeline
are added to the provided timeline.

* webanimations/animation-creation-addition-expected.txt: Added.
* webanimations/animation-creation-addition.html: Added.

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

2 years ago[JSC][Baseline] Use linkAllSlowCasesForBytecodeOffset as much as possible to simplify...
utatane.tea@gmail.com [Sun, 22 Oct 2017 18:28:16 +0000 (18:28 +0000)]
[JSC][Baseline] Use linkAllSlowCasesForBytecodeOffset as much as possible to simplify slow cases handling
https://bugs.webkit.org/show_bug.cgi?id=178647

Reviewed by Saam Barati.

There is much code counting slow cases in fast paths to call `linkSlowCase` carefully. This is really error-prone
since the number of slow cases depends on values of instruction's metadata. We have linkAllSlowCasesForBytecodeOffset,
which drains all slow cases for a specified bytecode offset. In typical cases like just calling a slow path function,
this is enough. We use linkAllSlowCasesForBytecodeOffset as much as possible. It significantly simplifies the code.

* jit/JIT.h:
(JSC::JIT::linkAllSlowCases):
* jit/JITArithmetic.cpp:
(JSC::JIT::emitSlow_op_unsigned):
(JSC::JIT::emit_compareAndJump):
(JSC::JIT::emit_compareAndJumpSlow):
(JSC::JIT::emitSlow_op_inc):
(JSC::JIT::emitSlow_op_dec):
(JSC::JIT::emitSlow_op_mod):
(JSC::JIT::emitSlow_op_negate):
(JSC::JIT::emitSlow_op_bitand):
(JSC::JIT::emitSlow_op_bitor):
(JSC::JIT::emitSlow_op_bitxor):
(JSC::JIT::emitSlow_op_lshift):
(JSC::JIT::emitSlow_op_rshift):
(JSC::JIT::emitSlow_op_urshift):
(JSC::JIT::emitSlow_op_add):
(JSC::JIT::emitSlow_op_div):
(JSC::JIT::emitSlow_op_mul):
(JSC::JIT::emitSlow_op_sub):
* jit/JITArithmetic32_64.cpp:
(JSC::JIT::emit_compareAndJumpSlow):
(JSC::JIT::emitSlow_op_unsigned):
(JSC::JIT::emitSlow_op_inc):
(JSC::JIT::emitSlow_op_dec):
(JSC::JIT::emitSlow_op_mod):
* jit/JITCall.cpp:
(JSC::JIT::compileCallEvalSlowCase):
(JSC::JIT::compileOpCallSlowCase):
* jit/JITCall32_64.cpp:
(JSC::JIT::compileCallEvalSlowCase):
(JSC::JIT::compileOpCallSlowCase):
* jit/JITInlines.h:
(JSC::JIT::linkAllSlowCasesForBytecodeOffset):
* jit/JITOpcodes.cpp:
(JSC::JIT::emitSlow_op_new_object):
(JSC::JIT::emitSlow_op_create_this):
(JSC::JIT::emitSlow_op_check_tdz):
(JSC::JIT::emitSlow_op_to_this):
(JSC::JIT::emitSlow_op_to_primitive):
(JSC::JIT::emitSlow_op_not):
(JSC::JIT::emitSlow_op_eq):
(JSC::JIT::emitSlow_op_neq):
(JSC::JIT::emitSlow_op_stricteq):
(JSC::JIT::emitSlow_op_nstricteq):
(JSC::JIT::emitSlow_op_instanceof):
(JSC::JIT::emitSlow_op_instanceof_custom):
(JSC::JIT::emitSlow_op_to_number):
(JSC::JIT::emitSlow_op_to_string):
(JSC::JIT::emitSlow_op_loop_hint):
(JSC::JIT::emitSlow_op_check_traps):
(JSC::JIT::emitSlow_op_has_indexed_property):
(JSC::JIT::emitSlow_op_get_direct_pname):
(JSC::JIT::emitSlow_op_has_structure_property):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emitSlow_op_new_object):
(JSC::JIT::emitSlow_op_instanceof):
(JSC::JIT::emitSlow_op_instanceof_custom):
(JSC::JIT::emitSlow_op_to_primitive):
(JSC::JIT::emitSlow_op_not):
(JSC::JIT::emitSlow_op_stricteq):
(JSC::JIT::emitSlow_op_nstricteq):
(JSC::JIT::emitSlow_op_to_number):
(JSC::JIT::emitSlow_op_to_string):
(JSC::JIT::emitSlow_op_create_this):
(JSC::JIT::emitSlow_op_to_this):
(JSC::JIT::emitSlow_op_check_tdz):
(JSC::JIT::emitSlow_op_has_indexed_property):
(JSC::JIT::emitSlow_op_get_direct_pname):
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emitSlow_op_try_get_by_id):
(JSC::JIT::emitSlow_op_get_by_id):
(JSC::JIT::emitSlow_op_get_by_id_with_this):
(JSC::JIT::emitSlow_op_put_by_id):
(JSC::JIT::emitSlow_op_resolve_scope):
(JSC::JIT::emitSlow_op_get_from_scope):
(JSC::JIT::emitSlow_op_put_to_scope):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emitSlow_op_try_get_by_id):
(JSC::JIT::emitSlow_op_get_by_id):
(JSC::JIT::emitSlow_op_get_by_id_with_this):
(JSC::JIT::emitSlow_op_put_by_id):
(JSC::JIT::emitSlow_op_resolve_scope):
(JSC::JIT::emitSlow_op_get_from_scope):
(JSC::JIT::emitSlow_op_put_to_scope):

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

2 years ago[JSC] Clean up baseline slow path
utatane.tea@gmail.com [Sun, 22 Oct 2017 16:47:01 +0000 (16:47 +0000)]
[JSC] Clean up baseline slow path
https://bugs.webkit.org/show_bug.cgi?id=178646

Reviewed by Saam Barati.

If the given op is just calling a slow path function, we should use DEFINE_SLOW_OP instead.
It is good since (1) we can reduce the manual emitting code and (2) it can clarify which
function is implemented as a slow path call. This patch is an attempt to reduce 32bit specific
code in baseline JIT.

* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
* jit/JIT.h:
* jit/JITArithmetic.cpp:
(JSC::JIT::emit_op_pow): Deleted.
* jit/JITArithmetic32_64.cpp:
(JSC::JIT::emitSlow_op_mod):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_strcat): Deleted.
(JSC::JIT::emit_op_push_with_scope): Deleted.
(JSC::JIT::emit_op_assert): Deleted.
(JSC::JIT::emit_op_create_lexical_environment): Deleted.
(JSC::JIT::emit_op_throw_static_error): Deleted.
(JSC::JIT::emit_op_new_array_with_spread): Deleted.
(JSC::JIT::emit_op_spread): Deleted.
(JSC::JIT::emit_op_get_enumerable_length): Deleted.
(JSC::JIT::emit_op_has_generic_property): Deleted.
(JSC::JIT::emit_op_get_property_enumerator): Deleted.
(JSC::JIT::emit_op_to_index_string): Deleted.
(JSC::JIT::emit_op_create_direct_arguments): Deleted.
(JSC::JIT::emit_op_create_scoped_arguments): Deleted.
(JSC::JIT::emit_op_create_cloned_arguments): Deleted.
(JSC::JIT::emit_op_create_rest): Deleted.
(JSC::JIT::emit_op_unreachable): Deleted.
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_strcat): Deleted.
(JSC::JIT::emit_op_push_with_scope): Deleted.
(JSC::JIT::emit_op_assert): Deleted.
(JSC::JIT::emit_op_create_lexical_environment): Deleted.
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emit_op_put_by_val_with_this): Deleted.
(JSC::JIT::emit_op_get_by_val_with_this): Deleted.
(JSC::JIT::emit_op_put_by_id_with_this): Deleted.
(JSC::JIT::emit_op_resolve_scope_for_hoisting_func_decl_in_eval): Deleted.
(JSC::JIT::emit_op_define_data_property): Deleted.
(JSC::JIT::emit_op_define_accessor_property): Deleted.
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emit_op_resolve_scope_for_hoisting_func_decl_in_eval): Deleted.
(JSC::JIT::emit_op_get_by_val_with_this): Deleted.
(JSC::JIT::emit_op_put_by_id_with_this): Deleted.
(JSC::JIT::emit_op_put_by_val_with_this): Deleted.

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

2 years agoUnreviewed, silence a -Wunused-but-set-variable warning
mcatanzaro@igalia.com [Sun, 22 Oct 2017 03:41:06 +0000 (03:41 +0000)]
Unreviewed, silence a -Wunused-but-set-variable warning

* WebProcess/WebPage/EventDispatcher.cpp:
(WebKit::EventDispatcher::wheelEvent):

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

2 years ago[FrameView::layout cleanup] Drop allowSubtree parameter
zalan@apple.com [Sun, 22 Oct 2017 02:05:17 +0000 (02:05 +0000)]
[FrameView::layout cleanup] Drop allowSubtree parameter
https://bugs.webkit.org/show_bug.cgi?id=178623
<rdar://problem/35111012>

Reviewed by Sam Weinig.

This flag is only set through ::forceLayout(). Let's just convert the subtree layout
to full layout right before calling ::layout().

No change in functionality.

* page/FrameView.cpp:
(WebCore::FrameView::handleLayoutWithFrameFlatteningIfNeeded):
(WebCore::FrameView::layout):
(WebCore::FrameView::startLayoutAtMainFrameViewIfNeeded):
(WebCore::FrameView::forceLayout):
* page/FrameView.h:

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

2 years agoWeb Inspector: Remove unused Console.setMonitoringXHREnabled
commit-queue@webkit.org [Sat, 21 Oct 2017 22:23:00 +0000 (22:23 +0000)]
Web Inspector: Remove unused Console.setMonitoringXHREnabled
https://bugs.webkit.org/show_bug.cgi?id=178617

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-10-21
Reviewed by Sam Weinig.

Source/JavaScriptCore:

* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* inspector/agents/InspectorConsoleAgent.h:
* inspector/agents/JSGlobalObjectConsoleAgent.cpp: Removed.
* inspector/agents/JSGlobalObjectConsoleAgent.h: Removed.
* inspector/protocol/Console.json:
Removed files and method.

* inspector/JSGlobalObjectInspectorController.cpp:
(Inspector::JSGlobalObjectInspectorController::JSGlobalObjectInspectorController):
This can use the base ConsoleAgent now.

Source/WebCore:

* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didFinishXHRLoadingImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didFinishXHRLoading):
* inspector/WebConsoleAgent.cpp:
(WebCore::WebConsoleAgent::setMonitoringXHREnabled): Deleted.
(WebCore::WebConsoleAgent::didFinishXHRLoading): Deleted.
* inspector/WebConsoleAgent.h:
Remove XHR monitoring code.

* xml/XMLHttpRequest.h:
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::send):
(WebCore::XMLHttpRequest::didFinishLoading):
(WebCore::XMLHttpRequest::setLastSendLineAndColumnNumber): Deleted.
* xml/XMLHttpRequest.idl:
Remove now unused state on XHR and ExecState requirement for send().

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

2 years agocreateImageBitmap with basic HTMLImageElement
dino@apple.com [Sat, 21 Oct 2017 21:48:17 +0000 (21:48 +0000)]
createImageBitmap with basic HTMLImageElement
https://bugs.webkit.org/show_bug.cgi?id=178619
<rdar://problem/35104118>

Reviewed by Antoine Quint.

Source/WebCore:

Implement the basic infrastructure for creating
an ImageBitmap from an HTMLImageElement.

Test: http/wpt/2dcontext/imagebitmap/createImageBitmap.html

* html/ImageBitmap.cpp:
(WebCore::ImageBitmap::createPromise): Create the image buffer
and draw the image into its backing store.
* html/ImageBitmap.h:

LayoutTests:

Make a better test for createImageBitmap. This will be
submitted to Web Platform Tests.

* http/wpt/2dcontext/imagebitmap/createImageBitmap-expected.txt: Added.
* http/wpt/2dcontext/imagebitmap/createImageBitmap.html: Added.
* http/wpt/common/canvas-tests.css: Added.
* http/wpt/common/canvas-tests.js: Added.
* http/wpt/images/pattern.png: Added.

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

2 years agoTurn on ccache for Mac cmake builds by default
timothy_horton@apple.com [Sat, 21 Oct 2017 21:42:51 +0000 (21:42 +0000)]
Turn on ccache for Mac cmake builds by default
https://bugs.webkit.org/show_bug.cgi?id=177059

Reviewed by Sam Weinig.

.:

* Source/cmake/WebKitCCache.cmake: Added.
* Source/cmake/WebKitCommon.cmake:
Turn on ccache for Mac CMake builds (Makefile and Ninja generators only)
if it's installed, making use of CMake's ability to wrap the compiler invocation.

Tools:

* ccache/ccache-clang:
* ccache/ccache-wrapper: Added.
Add a pass-through ccache wrapper to be used with CMake, in addition
to the existing faux-clang wrappers.

* Scripts/build-webkit:
Add --use-ccache and --no-use-ccache option, which will define
WK_USE_CCACHE to YES or NO, respectively, which the underlying
build systems respect. We do not define WK_USE_CCACHE if the option
is not specified, because the underlying build systems have different
default values.

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

2 years ago[JSC] Remove per-host-function CTI stub in 32bit environment
utatane.tea@gmail.com [Sat, 21 Oct 2017 15:34:58 +0000 (15:34 +0000)]
[JSC] Remove per-host-function CTI stub in 32bit environment
https://bugs.webkit.org/show_bug.cgi?id=178581

Reviewed by Saam Barati.

JIT::privateCompileCTINativeCall only exists in 32bit environment and it is almost the same to native call CTI stub.
The only difference is that it embed the address of the host function directly in the generated stub. This means
that we have per-host-function CTI stub only in 32bit environment.

This patch just removes it and use one CTI stub instead. This design is the same to the current 64bit implementation.

* jit/JIT.cpp:
(JSC::JIT::compileCTINativeCall): Deleted.
* jit/JIT.h:
* jit/JITOpcodes.cpp:
(JSC::JIT::privateCompileCTINativeCall): Deleted.
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::privateCompileCTINativeCall): Deleted.
* jit/JITThunks.cpp:
(JSC::JITThunks::hostFunctionStub):

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

2 years ago[Web Animations] Add bindings to unified sources
commit-queue@webkit.org [Sat, 21 Oct 2017 14:11:44 +0000 (14:11 +0000)]
[Web Animations] Add bindings to unified sources
https://bugs.webkit.org/show_bug.cgi?id=178620

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

Removing the Web Animations bindings from the WebCore target and adding them to the unified sources list instead.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

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

2 years agoFix the Mac CMake build
timothy_horton@apple.com [Sat, 21 Oct 2017 08:26:19 +0000 (08:26 +0000)]
Fix the Mac CMake build

* PlatformMac.cmake:

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

2 years agoSupport ::before/::after pseudo elements with display:contents
antti@apple.com [Sat, 21 Oct 2017 08:15:10 +0000 (08:15 +0000)]
Support ::before/::after pseudo elements with display:contents
https://bugs.webkit.org/show_bug.cgi?id=178584

Reviewed by Ryosuke Niwa.

Source/WebCore:

This is cases like

::before { display:contents; content:'foo' }

* css/StyleResolver.cpp:
(WebCore::StyleResolver::adjustDisplayContentsStyle): Added.

    Allow display:contents on pseudo elements.
    Factor into function.

(WebCore::StyleResolver::adjustRenderStyle):
* dom/PseudoElement.h:

    Add a weak vector of content renderers.

* style/RenderTreePosition.h:
(WebCore::RenderTreePosition::moveToLastChild):

    Add a way to set a valid render tree position without a node.

* style/RenderTreeUpdaterGeneratedContent.cpp:
(WebCore::createContentRenderers):

    Take RenderTreePosition.

(WebCore::updateStyleForContentRenderers):

    Update based on the content renderer vector instead of doing a tree walk.

(WebCore::removeAndDestroyContentRenderers):

    Helper for destroying content renderers.

(WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):

    In the normal case create a render tree position for the pseudo element renderer and
    use RenderTreePosition::moveToLastChild to make it a valid position. (The existing
    RenderTreePosition interface didn't have way to move to positions in anonymous boxes)

    In the case of a non box generating display:contents pseudo element, use the current
    render tree position instead.

    Ensure that pseudo element renderers are destroyed before creating the new ones since in
    display:contents case they are not descendants of the pseudo renderer and don't get cleared
    automatically.

LayoutTests:

* TestExpectations: Enable imported/w3c/web-platform-tests/css/css-display-3/display-contents-before-after-002.html

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

2 years agoWeb Inspector: Support `async test() { ... }` in Inspector Test Suites
commit-queue@webkit.org [Sat, 21 Oct 2017 06:52:47 +0000 (06:52 +0000)]
Web Inspector: Support `async test() { ... }` in Inspector Test Suites
https://bugs.webkit.org/show_bug.cgi?id=178614

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-10-20
Reviewed by Devin Rousso.

Add the ability to have test functions be async functions. A successful
async test function just needs to complete evaluation. To indicate
failure it should throw an exception.

    suite.addTestCase({
        name: "ExceptionOfNormal",
        async test() {
            InspectorTest.expectThat(...);
        }
    });

    suite.addTestCase({
        name: "ExampleOfRejection",
        async test() {
            let value = await SomeAgent.method();
            if (value.error)
                throw "Exception";
            ...
        }
    });

Using async test functions has the added benefit that a runtime exception
inside of asynchronous test code will reject the current test case instead
of timing out. For example...

    suite.addTestCase({
        name: "ExampleOfRejectionThroughRuntimeException",
        async test() {
            let arr = [];
            arr.this.does.not.exist;
        }
    });

... should will lead to a failure instead of a timeout.

This should allow us to structure some common tests more naturally, like so:

    suite.addTestCase({
        name: "ExampleOfNormalAsyncTest",
        async test() {
            InspectorTest.evaluateInPage(`...`);
            let event = await WI.Manager.awaitEvent(...);
            let resource = event.data.resource;
            InspectorTest.expectEqual(...);
            InspectorTest.expectEqual(...);
            InspectorTest.expectEqual(...);
        }
    });

* inspector/unit-tests/async-test-suite-expected.txt:
* inspector/unit-tests/async-test-suite.html:
* inspector/unit-tests/target-manager.html:

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

2 years agoAdd FIXME comment after r223803
achristensen@apple.com [Sat, 21 Oct 2017 06:16:54 +0000 (06:16 +0000)]
Add FIXME comment after r223803
https://bugs.webkit.org/show_bug.cgi?id=178418

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
We need some work to better support customized persistent data stores.  Add a comment indicating such.

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

2 years agoWeb Inspector: scrolling the editor while debugging shouldn't trigger popovers
mattbaker@apple.com [Sat, 21 Oct 2017 05:04:28 +0000 (05:04 +0000)]
Web Inspector: scrolling the editor while debugging shouldn't trigger popovers
https://bugs.webkit.org/show_bug.cgi?id=178325

Reviewed by Devin Rousso.

Ignore the next "mousemove" event immediately following a "mousewheel",
when determining the hovered item for purposes of triggering a popover.

* UserInterface/Controllers/CodeMirrorTokenTrackingController.js:
(WI.CodeMirrorTokenTrackingController):
(WI.CodeMirrorTokenTrackingController.prototype._startTracking):
(WI.CodeMirrorTokenTrackingController.prototype._stopTracking):
(WI.CodeMirrorTokenTrackingController.prototype.handleEvent):
(WI.CodeMirrorTokenTrackingController.prototype._mouseMovedOverEditor):

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

2 years agoWeb Inspector: preview content view for MIME type application/json should be a collap...
commit-queue@webkit.org [Sat, 21 Oct 2017 05:00:00 +0000 (05:00 +0000)]
Web Inspector: preview content view for MIME type application/json should be a collapsible tree outline
https://bugs.webkit.org/show_bug.cgi?id=158938
<rdar://problem/26891128>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-10-20
Reviewed by Brian Burg.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Main.html:
New files and strings.

* UserInterface/Views/JSONResourceContentView.css: Added.
(.content-view.resource.json):
(.content-view.resource.json .object-tree .prototype-property):
Some padding and scrolling for the JSON content view.

* UserInterface/Views/JSONResourceContentView.js: Added.
(WI.JSONResourceContentView):
(WI.JSONResourceContentView.customContentViewDisplayName):
(WI.JSONResourceContentView.prototype.contentAvailable):
(WI.JSONResourceContentView.prototype.closed):
JSON view evaluates the JSON content on the page and shows an ObjectTree
for the resulting object.

* UserInterface/Views/ResourceClusterContentView.js:
(WI.ResourceClusterContentView):
(WI.ResourceClusterContentView.prototype.get customResponseContentView):
(WI.ResourceClusterContentView.prototype.get selectionPathComponents):
(WI.ResourceClusterContentView.prototype.restoreFromCookie):
(WI.ResourceClusterContentView.prototype.showResponse):
(WI.ResourceClusterContentView.prototype._canShowRequestContentView):
(WI.ResourceClusterContentView.prototype._canShowCustomResponseContentView):
(WI.ResourceClusterContentView.prototype._pathComponentForContentView):
(WI.ResourceClusterContentView.prototype._identifierForContentView):
(WI.ResourceClusterContentView.prototype._showContentViewForIdentifier):
(WI.ResourceClusterContentView.prototype._resourceTypeDidChange):
(WI.ResourceClusterContentView.prototype._resourceLoadingDidFinish):
(WI.ResourceClusterContentView.prototype._tryEnableCustomResponseContentView):
(WI.ResourceClusterContentView.prototype._customContentViewConstructorForResource):
Allow a custom content view to be used for a resource based on the response.
Currently the only custom content view is the JSON content view.

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

2 years ago[FrameView::layout cleanup] Use SetForScope to ensure layout state correctness
zalan@apple.com [Sat, 21 Oct 2017 04:31:46 +0000 (04:31 +0000)]
[FrameView::layout cleanup] Use SetForScope to ensure layout state correctness
https://bugs.webkit.org/show_bug.cgi?id=178604
<rdar://problem/35101890>

Reviewed by Simon Fraser.

SetForScope guarantees state correctness even with nested layouts. This is a lot less
error prone than resetting the state value after each potential recursive call.

Covered by existing tests.

* page/FrameView.cpp:
(WebCore::FrameView::handleDeferredScrollbarsUpdateAfterDirectionChange): This layout state does
not look too useful.
(WebCore::FrameView::layout):
* page/FrameView.h: While performPostLayoutTasks() is somewhat special since it can either be sync or async,
so painting should be allowed in both cases.

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

2 years agoSVGPathElement should cache the built-up Path of its non animating pathByteStream()
commit-queue@webkit.org [Sat, 21 Oct 2017 02:33:53 +0000 (02:33 +0000)]
SVGPathElement should cache the built-up Path of its non animating pathByteStream()
https://bugs.webkit.org/show_bug.cgi?id=178248

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2017-10-20
Reviewed by Simon Fraser.

Instead of creating a Path object from the non animating pathByteStream()
every time we need to updatePathFromPathElement(), the Path object can be
cached once it is created and used for later calls.

* html/canvas/Path2D.h: buildPathFromString() now returns a Path.

* platform/graphics/Path.h:
* platform/graphics/cairo/PathCairo.cpp:
(WebCore::Path::Path):
(WebCore::Path::operator=):
* platform/graphics/cg/PathCG.cpp:
(WebCore::Path::Path):
(WebCore::Path::operator=):
* platform/graphics/win/PathDirect2D.cpp:
(WebCore::Path::Path):
(WebCore::Path::operator=):
Define the move constructor and the move assignment operator for the the
Path class so a statement like "Path path = buildPathFromString()" won't
go through the copy constructor and the copy assignment operator.

* rendering/style/BasicShapes.cpp:
(WebCore::SVGPathTranslatedByteStream::path const):
* rendering/svg/RenderSVGResourceClipper.cpp:
(WebCore::RenderSVGResourceClipper::pathOnlyClipping):
* rendering/svg/RenderSVGShape.cpp:
(WebCore::RenderSVGShape::updateShapeFromElement):
* rendering/svg/RenderSVGTextPath.cpp:
(WebCore::RenderSVGTextPath::layoutPath const):
* rendering/svg/SVGPathData.cpp:
(WebCore::pathFromCircleElement):
(WebCore::pathFromEllipseElement):
(WebCore::pathFromLineElement):
(WebCore::pathFromPathElement):
(WebCore::pathFromPolygonElement):
(WebCore::pathFromPolylineElement):
(WebCore::pathFromRectElement):
(WebCore::pathFromGraphicsElement):
(WebCore::updatePathFromCircleElement): Deleted.
(WebCore::updatePathFromEllipseElement): Deleted.
(WebCore::updatePathFromLineElement): Deleted.
(WebCore::updatePathFromPathElement): Deleted.
(WebCore::updatePathFromPolygonElement): Deleted.
(WebCore::updatePathFromPolylineElement): Deleted.
(WebCore::updatePathFromRectElement): Deleted.
(WebCore::updatePathFromGraphicsElement): Deleted.
* rendering/svg/SVGPathData.h:
* svg/SVGAnimateMotionElement.cpp:
(WebCore::SVGAnimateMotionElement::parseAttribute):
(WebCore::SVGAnimateMotionElement::updateAnimationPath):
* svg/SVGGraphicsElement.cpp:
(WebCore::SVGGraphicsElement::toClipPath):
* svg/SVGGraphicsElement.h:
Rename updatePathFromElement() to pathFromGraphicsElement().

* svg/SVGPathElement.cpp:
(WebCore::SVGPathElement::parseAttribute): Clear the cache when
m_pathByteStream changes.
(WebCore::SVGPathElement::pathForByteStream const): Caches the m_cachedPath
if it is null.
(WebCore::SVGPathElement::pathSegListChanged): Clear the cache when
m_pathByteStream changes.

* svg/SVGPathElement.h:
* svg/SVGPathUtilities.cpp:
(WebCore::buildPathFromString):
(WebCore::buildPathFromByteStream):
* svg/SVGPathUtilities.h:
Make thes buildPathFromString() and buildPathFromByteStream() return Paths.

* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::toClipPath):
* svg/SVGUseElement.h:
Make these toClipPath() return Path.

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

2 years agoFix API tests after r223791.
achristensen@apple.com [Sat, 21 Oct 2017 01:11:14 +0000 (01:11 +0000)]
Fix API tests after r223791.
https://bugs.webkit.org/show_bug.cgi?id=178418

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
Whatever NetworkSessionInitializationParameters we send with the NetworkProcess initialization message,
that's the default session.  This is needed for WebKit.WebsiteDataStoreCustomPaths.
(WebKit::WebProcessPool::createNewWebProcess):
Don't change behavior or NetworkProcess initialization like I did in r223791.

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

2 years agoRename insertedInto and removedFrom to insertedIntoAncestor and removedFromAncestor
rniwa@webkit.org [Sat, 21 Oct 2017 00:49:21 +0000 (00:49 +0000)]
Rename insertedInto and removedFrom to insertedIntoAncestor and removedFromAncestor
https://bugs.webkit.org/show_bug.cgi?id=178605

Reviewed by Andy Estes.

Renamed insertedInto and removedFrom to insertedIntoAncestor and removedFromAncestor respectively
to make it clear that these functions can be called even when node's immediate parent didn't change.

* dom/ContainerNodeAlgorithms.cpp:
(WebCore::notifyNodeInsertedIntoDocument):
(WebCore::notifyNodeInsertedIntoTree):
(WebCore::notifyNodeRemovedFromDocument):
(WebCore::notifyNodeRemovedFromTree):
(WebCore::notifyChildNodeRemoved):
* dom/ContainerNodeAlgorithms.h:
* dom/Element.cpp:
(WebCore::Element::insertedIntoAncestor): Renamed from insertedInto.
(WebCore::Element::removedFromAncestor): Renamed from removedFrom.
* dom/Element.h:
* dom/Node.cpp:
(WebCore::Node::insertedIntoAncestor):
(WebCore::Node::removedFromAncestor):
(WebCore::Node::removedFrom): Deleted.
* dom/Node.h:
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::insertedIntoAncestor): Renamed from insertedInto.
(WebCore::ProcessingInstruction::removedFromAncestor): Renamed from removedFrom.
* dom/ProcessingInstruction.h:
* dom/ScriptElement.h:
(WebCore::ScriptElement::insertedIntoAncestor const): Renamed from insertedInto.
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::insertedIntoAncestor): Renamed from insertedInto.
(WebCore::ShadowRoot::removedFromAncestor): Renamed from removedFrom.
* dom/ShadowRoot.h:
* html/FormAssociatedElement.cpp:
(WebCore::FormAssociatedElement::insertedIntoAncestor): Renamed from insertedInto.
(WebCore::FormAssociatedElement::removedFromAncestor): Renamed from removedFrom.
* html/FormAssociatedElement.h:
* html/HTMLBaseElement.cpp:
(WebCore::HTMLBaseElement::insertedIntoAncestor): Renamed from insertedInto.
(WebCore::HTMLBaseElement::removedFromAncestor): Renamed from removedFrom.
* html/HTMLBaseElement.h:
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::insertedIntoAncestor): Renamed from insertedInto.
* html/HTMLBodyElement.h:
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::insertedIntoAncestor): Renamed from insertedInto.
(WebCore::HTMLFormControlElement::removedFromAncestor): Renamed from removedFrom.
* html/HTMLFormControlElement.h:
* html/HTMLFormControlElementWithState.cpp:
(WebCore::HTMLFormControlElementWithState::insertedIntoAncestor): Renamed from insertedInto.
(WebCore::HTMLFormControlElementWithState::removedFromAncestor): Renamed from removedFrom.
* html/HTMLFormControlElementWithState.h:
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::insertedIntoAncestor): Renamed from insertedInto.
(WebCore::HTMLFormElement::removedFromAncestor): Renamed from removedFrom.
* html/HTMLFormElement.h:
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::insertedIntoAncestor): Renamed from insertedInto.
* html/HTMLFrameElementBase.h:
* html/HTMLFrameSetElement.cpp:
(WebCore::HTMLFrameSetElement::insertedIntoAncestor): Renamed from insertedInto.
(WebCore::HTMLFrameSetElement::removedFromAncestor): Renamed from removedFrom.
* html/HTMLFrameSetElement.h:
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::insertedIntoAncestor): Renamed from insertedInto.
(WebCore::HTMLImageElement::removedFromAncestor): Renamed from removedFrom.
* html/HTMLImageElement.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::insertedIntoAncestor): Renamed from insertedInto.
(WebCore::HTMLInputElement::removedFromAncestor): Renamed from removedFrom.
* html/HTMLInputElement.h:
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::insertedIntoAncestor): Renamed from insertedInto.
(WebCore::HTMLLinkElement::removedFromAncestor): Renamed from removedFrom.
* html/HTMLLinkElement.h:
* html/HTMLMapElement.cpp:
(WebCore::HTMLMapElement::insertedIntoAncestor): Renamed from insertedInto.
(WebCore::HTMLMapElement::removedFromAncestor): Renamed from removedFrom.
* html/HTMLMapElement.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::insertedIntoAncestor): Renamed from insertedInto.
(WebCore::HTMLMediaElement::removedFromAncestor): Renamed from removedFrom.
* html/HTMLMediaElement.h:
* html/HTMLMetaElement.cpp:
(WebCore::HTMLMetaElement::insertedIntoAncestor): Renamed from insertedInto.
* html/HTMLMetaElement.h:
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::insertedIntoAncestor): Renamed from insertedInto.
(WebCore::HTMLObjectElement::removedFromAncestor): Renamed from removedFrom.
* html/HTMLObjectElement.h:
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::insertedIntoAncestor): Renamed from insertedInto.
* html/HTMLOptionElement.h:
* html/HTMLScriptElement.cpp:
(WebCore::HTMLScriptElement::insertedIntoAncestor): Renamed from insertedInto.
* html/HTMLScriptElement.h:
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::insertedIntoAncestor): Renamed from insertedInto.
* html/HTMLSelectElement.h:
* html/HTMLSlotElement.cpp:
(WebCore::HTMLSlotElement::insertedIntoAncestor): Renamed from insertedInto.
(WebCore::HTMLSlotElement::removedFromAncestor): Renamed from removedFrom.
* html/HTMLSlotElement.h:
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedIntoAncestor): Renamed from insertedInto.
(WebCore::HTMLSourceElement::removedFromAncestor): Renamed from removedFrom.
* html/HTMLSourceElement.h:
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::insertedIntoAncestor): Renamed from insertedInto.
(WebCore::HTMLStyleElement::removedFromAncestor): Renamed from removedFrom.
* html/HTMLStyleElement.h:
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::insertedIntoAncestor): Renamed from insertedInto.
* html/HTMLTextFormControlElement.h:
* html/HTMLTitleElement.cpp:
(WebCore::HTMLTitleElement::insertedIntoAncestor): Renamed from insertedInto.
(WebCore::HTMLTitleElement::removedFromAncestor): Renamed from removedFrom.
* html/HTMLTitleElement.h:
* html/HTMLTrackElement.cpp:
(WebCore::HTMLTrackElement::insertedIntoAncestor): Renamed from insertedInto.
(WebCore::HTMLTrackElement::removedFromAncestor): Renamed from removedFrom.
* html/HTMLTrackElement.h:
* svg/SVGElement.cpp:
(WebCore::SVGElement::removedFromAncestor): Renamed from removedFrom.
(WebCore::SVGElement::insertedIntoAncestor): Renamed from insertedInto.
(WebCore::SVGElement::updateRelativeLengthsInformation):
* svg/SVGElement.h:
* svg/SVGFEImageElement.cpp:
(WebCore::SVGFEImageElement::insertedIntoAncestor): Renamed from insertedInto.
(WebCore::SVGFEImageElement::removedFromAncestor): Renamed from removedFrom.
* svg/SVGFEImageElement.h:
* svg/SVGFontFaceElement.cpp:
(WebCore::SVGFontFaceElement::insertedIntoAncestor): Renamed from insertedInto.
(WebCore::SVGFontFaceElement::removedFromAncestor): Renamed from removedFrom.
* svg/SVGFontFaceElement.h:
* svg/SVGFontFaceUriElement.cpp:
(WebCore::SVGFontFaceUriElement::insertedIntoAncestor): Renamed from insertedInto.
* svg/SVGFontFaceUriElement.h:
* svg/SVGImageElement.cpp:
(WebCore::SVGImageElement::insertedIntoAncestor): Renamed from insertedInto.
* svg/SVGImageElement.h:
* svg/SVGMPathElement.cpp:
(WebCore::SVGMPathElement::insertedIntoAncestor): Renamed from insertedInto.
(WebCore::SVGMPathElement::removedFromAncestor): Renamed from removedFrom.
* svg/SVGMPathElement.h:
* svg/SVGPathElement.cpp:
(WebCore::SVGPathElement::insertedIntoAncestor): Renamed from insertedInto.
(WebCore::SVGPathElement::removedFromAncestor): Renamed from removedFrom.
* svg/SVGPathElement.h:
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::insertedIntoAncestor): Renamed from insertedInto.
(WebCore::SVGSVGElement::removedFromAncestor): Renamed from removedFrom.
* svg/SVGSVGElement.h:
* svg/SVGScriptElement.cpp:
(WebCore::SVGScriptElement::insertedIntoAncestor): Renamed from insertedInto.
* svg/SVGScriptElement.h:
* svg/SVGStyleElement.cpp:
(WebCore::SVGStyleElement::insertedIntoAncestor): Renamed from insertedInto.
(WebCore::SVGStyleElement::removedFromAncestor): Renamed from removedFrom.
* svg/SVGStyleElement.h:
* svg/SVGTRefElement.cpp:
(WebCore::SVGTRefElement::buildPendingResource):
(WebCore::SVGTRefElement::insertedIntoAncestor): Renamed from insertedInto.
(WebCore::SVGTRefElement::removedFromAncestor): Renamed from removedFrom.
* svg/SVGTRefElement.h:
* svg/SVGTextPathElement.cpp:
(WebCore::SVGTextPathElement::insertedIntoAncestor): Renamed from insertedInto.
(WebCore::SVGTextPathElement::removedFromAncestor): Renamed from removedFrom.
* svg/SVGTextPathElement.h:
* svg/SVGTitleElement.cpp:
(WebCore::SVGTitleElement::insertedIntoAncestor): Renamed from insertedInto.
(WebCore::SVGTitleElement::removedFromAncestor): Renamed from removedFrom.
* svg/SVGTitleElement.h:
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::insertedIntoAncestor): Renamed from insertedInto.
(WebCore::SVGUseElement::removedFromAncestor): Renamed from removedFrom.
* svg/SVGUseElement.h:
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::insertedIntoAncestor): Renamed from insertedInto.
(WebCore::SVGSMILElement::removedFromAncestor): Renamed from removedFrom.
* svg/animation/SVGSMILElement.h:

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

2 years agoFix conditions in HTMLSourceElement and HTMLTrackElement's insertedInto and removedFrom
rniwa@webkit.org [Sat, 21 Oct 2017 00:03:18 +0000 (00:03 +0000)]
Fix conditions in HTMLSourceElement and HTMLTrackElement's insertedInto and removedFrom
https://bugs.webkit.org/show_bug.cgi?id=178607

Reviewed by Eric Carlson.

Fixed the conditions in insertedInto and removedFrom of HTMLSourceElement and HTMLTrackElement to be
semantically sensisble. Since these elements are only functional when their immediate parents are
HTMLMediaElement and HTMLPictureElement, we have to check that its immediate parent changed, not when
some of its ancestor had changed by insertion or removal.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
* html/HTMLTrackElement.cpp:
(WebCore::HTMLTrackElement::insertedInto):
(WebCore::HTMLTrackElement::removedFrom):

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

2 years agohttp/tests/security/clipboard/drag-drop-html-cross-origin-iframe-in-same-origin.html...
rniwa@webkit.org [Fri, 20 Oct 2017 23:55:35 +0000 (23:55 +0000)]
http/tests/security/clipboard/drag-drop-html-cross-origin-iframe-in-same-origin.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=178606

Reviewed by Wenson Hsieh.

The bug was caused by the race condition during the page loading of iframes.

Waiting for message event wasn't doing anything useful because it was receiving the message from
source iframe before the drag & drop had started.

Fixed the bug by waiting for the second message event. Also replaced the wait for load event
by the wait for the first message event for clarity.

* http/tests/security/clipboard/drag-drop-html-cross-origin-iframe-in-same-origin.html:

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

2 years ago[iOS] Rebaseline compositing tests
ryanhaddad@apple.com [Fri, 20 Oct 2017 23:40:21 +0000 (23:40 +0000)]
[iOS] Rebaseline compositing tests
https://bugs.webkit.org/show_bug.cgi?id=178492

Unreviewed test gardening.

* platform/ios-wk2/TestExpectations:
* platform/ios/TestExpectations:
* platform/ios/compositing/backing/child-layer-no-backing-expected.txt: Added.
* platform/ios/compositing/contents-scale/animating-expected.txt:
* platform/ios/compositing/geometry/ancestor-overflow-change-expected.txt:
* platform/ios/compositing/geometry/fixed-position-expected.txt:
* platform/ios/compositing/geometry/fixed-position-flipped-writing-mode-expected.txt: Added.
* platform/ios/compositing/geometry/limit-layer-bounds-clipping-ancestor-expected.txt: Added.
* platform/ios/compositing/geometry/limit-layer-bounds-overflow-repaint-expected.txt: Added.
* platform/ios/compositing/geometry/preserve-3d-switching-expected.txt: Added.
* platform/ios/compositing/geometry/tall-page-composited-expected.txt: Added.
* platform/ios/compositing/geometry/video-fixed-scrolling-expected.txt: Added.
* platform/ios/compositing/geometry/video-opacity-overlay-expected.txt: Added.
* platform/ios/compositing/iframes/invisible-nested-iframe-show-expected.txt:
* platform/ios/compositing/iframes/overlapped-nested-iframes-expected.txt: Renamed from LayoutTests/platform/ios-wk2/compositing/iframes/overlapped-nested-iframes-expected.txt.
* platform/ios/compositing/images/direct-image-object-fit-expected.txt: Added.
* platform/ios/compositing/layer-creation/animation-overlap-with-children-expected.txt: Removed.
* platform/ios/compositing/layer-creation/fixed-position-and-transform-expected.txt: Renamed from LayoutTests/platform/ios-wk2/compositing/layer-creation/fixed-position-and-transform-expected.txt.
* platform/ios/compositing/overflow/ancestor-overflow-expected.txt:
* platform/ios/compositing/overflow/clipping-ancestor-with-accelerated-scrolling-ancestor-expected.txt: Added.
* platform/ios/compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants-expected.txt: Added.
* platform/ios/compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants2-expected.txt: Added.
* platform/ios/compositing/overflow/composited-scrolling-creates-a-stacking-container-expected.txt:
* platform/ios/compositing/overflow/fixed-position-ancestor-clip-expected.txt:
* platform/ios/compositing/overflow/overflow-clip-with-accelerated-scrolling-ancestor-expected.txt: Added.
* platform/ios/compositing/reflections/direct-image-object-fit-reflected-expected.txt: Added.
* platform/ios/compositing/reflections/load-video-in-reflection-expected.txt: Added.
* platform/ios/compositing/reflections/nested-reflection-on-overflow-expected.txt:
* platform/ios/compositing/repaint/page-scale-repaint-expected.txt: Added.
* platform/ios/compositing/rtl/rtl-fixed-overflow-scrolled-expected.txt: Renamed from LayoutTests/platform/ios-wk2/compositing/rtl/rtl-fixed-overflow-scrolled-expected.txt.
* platform/ios/compositing/rtl/rtl-overflow-scrolling-expected.txt: Added.
* platform/ios/compositing/self-painting-layers-expected.txt: Added.
* platform/ios/compositing/tiling/huge-layer-img-expected.txt: Added.
* platform/ios/compositing/visible-rect/3d-transform-style-expected.txt: Added.
* platform/ios/compositing/visible-rect/animated-expected.txt: Added.
* platform/ios/compositing/visible-rect/iframe-no-layers-expected.txt: Added.
* platform/ios/compositing/visible-rect/iframe-with-layers-outside-viewport-expected.txt: Added.
* platform/ios/compositing/visible-rect/mask-layer-coverage-expected.txt: Added.

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

2 years agoFix download tests on El Capitan after r223730
achristensen@apple.com [Fri, 20 Oct 2017 23:12:10 +0000 (23:12 +0000)]
Fix download tests on El Capitan after r223730
https://bugs.webkit.org/show_bug.cgi?id=178547

* UIProcess/Downloads/DownloadProxy.cpp:
(WebKit::DownloadProxy::decideDestinationWithSuggestedFilename):
Revert to original behavior.  This uses suggestedFilename, which may have come from places like
the download attribute, instead of always using the filename from CFNetwork.

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

2 years agoDo not run binding tests on multiple EWSes
aakash_jain@apple.com [Fri, 20 Oct 2017 21:56:51 +0000 (21:56 +0000)]
Do not run binding tests on multiple EWSes
https://bugs.webkit.org/show_bug.cgi?id=178599

Reviewed by Alexey Proskuryakov.

Remove old code which runs bindings tests and ignore it's result. We now have
a dedicated bindings test EWS.

* Scripts/webkitpy/tool/steps/runtests.py:
(RunTests.run): Removed bindings tests code.
* Scripts/webkitpy/tool/steps/runtests_unittest.py: Updated unit-tests.
(RunTestsTest.test_webkit_run_unit_tests): Ditto.
* Scripts/webkitpy/tool/steps/steps_unittest.py: Ditto.
* Scripts/webkitpy/tool/commands/download_unittest.py: Ditto.

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

2 years agoUnreviewed, fix windows build.
keith_miller@apple.com [Fri, 20 Oct 2017 21:20:08 +0000 (21:20 +0000)]
Unreviewed, fix windows build.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

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

2 years agoUse "= default" for more default constructors and destructors in WebCore
commit-queue@webkit.org [Fri, 20 Oct 2017 20:58:49 +0000 (20:58 +0000)]
Use "= default" for more default constructors and destructors in WebCore
https://bugs.webkit.org/show_bug.cgi?id=178585

Patch by Daniel Bates <dabates@apple.com> on 2017-10-20
Reviewed by Alex Christensen.

Also remove some destructors that would be implicitly generated.

* Modules/applepay/PaymentMerchantSession.h:
(WebCore::PaymentMerchantSession::~PaymentMerchantSession): Deleted.
* platform/ControlStates.h:
(WebCore::ControlStates::~ControlStates): Deleted.
* platform/PlatformEvent.h:
(WebCore::PlatformEvent::~PlatformEvent): Use default.
* platform/PlatformStrategies.h:
(WebCore::PlatformStrategies::PlatformStrategies): Ditto.
* platform/image-decoders/gif/GIFImageReader.h:
(GIFFrameContext::GIFFrameContext):
(GIFFrameContext::~GIFFrameContext): Deleted.
(GIFImageReader::~GIFImageReader): Deleted.
* rendering/RenderBlockFlow.h:
(WebCore::RenderBlockFlow::RenderBlockFlowRareData::~RenderBlockFlowRareData): Deleted.

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

2 years agoMarked plugins/js-from-destroy.html as flaky.
jlewis3@apple.com [Fri, 20 Oct 2017 20:58:09 +0000 (20:58 +0000)]
Marked plugins/js-from-destroy.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=176881

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

2 years ago[FrameView::layout cleanup] Scheduling layout should be disabled for FrameView::layout
zalan@apple.com [Fri, 20 Oct 2017 20:40:24 +0000 (20:40 +0000)]
[FrameView::layout cleanup] Scheduling layout should be disabled for FrameView::layout
https://bugs.webkit.org/show_bug.cgi?id=178562
<rdar://problem/35089015>

Reviewed by Simon Fraser.

This patch extends the scope of m_layoutSchedulingEnabled. Now layout scheduling is disabled for the entire FrameView::layout().
A scheduled layout at the end of FrameView::layout would indicated dirty tree (which is against FrameView::layout's contract).

Covered by existing tests.

* page/FrameView.cpp:
(WebCore::FrameView::layout):

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

2 years agoExpose _boundInterfaceIdentifier and _allowsCellularAccess to WKWebsiteDataStorePrivate
commit-queue@webkit.org [Fri, 20 Oct 2017 20:39:34 +0000 (20:39 +0000)]
Expose _boundInterfaceIdentifier and _allowsCellularAccess to WKWebsiteDataStorePrivate
https://bugs.webkit.org/show_bug.cgi?id=178418
<rdar://problem/29599569>

Patch by Alex Christensen <achristensen@webkit.org> on 2017-10-20
Reviewed by Tim Horton.
Source/WebCore/PAL:

* pal/spi/cf/CFNetworkSPI.h:

Source/WebKit:

In r213747 I introduced allowsCellularAccess to _WKProcessPoolConfiguration because there
was no way to add parameters to the default (and other) NetworkSession constructors.  Since
clients have not adopted this SPI, we can introduce such a way in NetworkSessionCreationParameters
and move the SPI to WKWebsiteDataStore, which is where it and other NetworkSession properties
ought to be instead of making them WKProcessPool global.

We also need to expose access to NSURLRequest.boundInterfaceIdentifier.  Instead of serializing and
deserializing that property for each NSURLRequest and then having subresources mysteriously jump back
to having no bound interface identifiers, I'm adding this to WKWebsiteDataStore, too, to make it a
session networking property.

I manually verified that these properties are being set properly with a custom test app and added logs.
Unfortunately, these properties don't do anything under circumstances anywhere close to what we test.
The architecture change of having NetworkSessionCreationParameters is verified to not have a change in
behavior by existing tests, such as any test that uses TestProtocol (which we should eventually remove).

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession):
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::NetworkProcess):
(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::NetworkProcess::clearCachedCredentials):
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::create):
(WebKit::NetworkSession::defaultSession): Deleted.
* NetworkProcess/NetworkSession.h:
* NetworkProcess/NetworkSessionCreationParameters.h: Added.
(WebKit::NetworkSessionCreationParameters::encode const):
(WebKit::NetworkSessionCreationParameters::decode):
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
(WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
* NetworkProcess/cocoa/NetworkSessionCocoa.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::setSourceApplicationSecondaryIdentifier):
(WebKit::NetworkSessionCocoa::create):
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
(WebKit::NetworkSessionCocoa::setLegacyCustomProtocolManager): Deleted.
(WebKit::NetworkSessionCocoa::setAllowsCellularAccess): Deleted.
(WebKit::NetworkSessionCocoa::defaultSession): Deleted.
* NetworkProcess/mac/RemoteNetworkingContext.mm:
(WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
(WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
* Shared/SessionTracker.cpp:
(WebKit::SessionTracker::networkSession):
(WebKit::SessionTracker::setSession):
* Shared/WebsiteDataStoreParameters.cpp:
(WebKit::WebsiteDataStoreParameters::encode const):
(WebKit::WebsiteDataStoreParameters::decode):
* Shared/WebsiteDataStoreParameters.h:
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _setBoundInterfaceIdentifier:]):
(-[WKWebsiteDataStore _boundInterfaceIdentifier]):
(-[WKWebsiteDataStore _setAllowsCellularAccess:]):
(-[WKWebsiteDataStore _allowsCellularAccess]):
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration allowsCellularAccess]):
(-[_WKProcessPoolConfiguration setAllowsCellularAccess:]):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
(WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
* UIProcess/WebsiteData/WebsiteDataStore.h:
(WebKit::WebsiteDataStore::setBoundInterfaceIdentifier):
(WebKit::WebsiteDataStore::boundInterfaceIdentifier):
(WebKit::WebsiteDataStore::setAllowsCellularAccess):
(WebKit::WebsiteDataStore::allowsCellularAccess):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::setPrivateBrowsingEnabled):
* WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
* WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
(WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
(WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::ensurePrivateBrowsingSession):
(WebKit::WebProcess::clearCachedCredentials):

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

2 years agoAdd ObjC SPI to _WKDownloadDelegate missing from WKContextDownloadClient
achristensen@apple.com [Fri, 20 Oct 2017 20:38:41 +0000 (20:38 +0000)]
Add ObjC SPI to _WKDownloadDelegate missing from WKContextDownloadClient
https://bugs.webkit.org/show_bug.cgi?id=178566
<rdar://problem/23041906>

Reviewed by Brady Eidson.

* UIProcess/API/Cocoa/_WKDownloadDelegate.h:
* UIProcess/Cocoa/DownloadClient.h:
* UIProcess/Cocoa/DownloadClient.mm:
(WebKit::DownloadClient::DownloadClient):
(WebKit::DownloadClient::didReceiveAuthenticationChallenge):
(WebKit::DownloadClient::shouldDecodeSourceDataOfMIMEType):
(WebKit::DownloadClient::didCreateDestination):
(WebKit::DownloadClient::processDidCrash):

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

2 years agoWhen destroying a resource, register "only" the clients who are losing their resource...
commit-queue@webkit.org [Fri, 20 Oct 2017 20:34:27 +0000 (20:34 +0000)]
When destroying a resource, register "only" the clients who are losing their resource as having pending resources
https://bugs.webkit.org/show_bug.cgi?id=178567
<rdar://problem/35064781>

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2017-10-20
Reviewed by Simon Fraser.

SVGResources::resourceDestroyed() will return a bool indicating whether
it had a reference to the destroyed resource or not. If it returns true
SVGResourcesCache::resourceDestroyed() will register the client Element
as having pending resources.

* rendering/svg/SVGResources.cpp:
(WebCore::paintingResourceFromSVGPaint):
(WebCore::SVGResources::removeClientFromCache const):
(WebCore::SVGResources::resourceDestroyed):
(WebCore::SVGResources::buildSetOfResources):
(WebCore::SVGResources::resetClipper):
(WebCore::SVGResources::resetFilter):
(WebCore::SVGResources::resetMarkerStart):
(WebCore::SVGResources::resetMarkerMid):
(WebCore::SVGResources::resetMarkerEnd):
(WebCore::SVGResources::resetMasker):
(WebCore::SVGResources::resetFill):
(WebCore::SVGResources::resetStroke):
(WebCore::SVGResources::resetLinkedResource):
* rendering/svg/SVGResources.h:
(WebCore::SVGResources::isEmpty const):
(WebCore::SVGResources::ClipperFilterMaskerData::ClipperFilterMaskerData): Deleted.
(WebCore::SVGResources::MarkerData::MarkerData): Deleted.
(WebCore::SVGResources::FillStrokeData::FillStrokeData): Deleted.
* rendering/svg/SVGResourcesCache.cpp:
(WebCore::SVGResourcesCache::resourceDestroyed):

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

2 years agoUnify the node removal code in ContainerNode and expand the coverage of NoEventDispat...
rniwa@webkit.org [Fri, 20 Oct 2017 20:20:48 +0000 (20:20 +0000)]
Unify the node removal code in ContainerNode and expand the coverage of NoEventDispatchAssertion
https://bugs.webkit.org/show_bug.cgi?id=178568

Reviewed by Antti Koivisto.

Consolidated the code to remove a child node in ContainerNode into removeAllChildrenWithScriptAssertion
and removeNodeWithScriptAssertion to share code and make the semantics of when it becomes unsafe to run scripts.

Also renamed getChildNodes to collectChildNodes, and made it return NodeVector instead of taking an out argument.

No new tests since there should be no behavioral changes.

* dom/ContainerNode.cpp:
(WebCore::ContainerNode::removeAllChildrenWithScriptAssertion): Added.
(WebCore::ContainerNode::removeNodeWithScriptAssertion): Added.
(WebCore::collectChildrenAndRemoveFromOldParent):
(WebCore::ContainerNode::takeAllChildrenFrom): Deployed removeAllChildrenWithScriptAssertion.
(WebCore::ContainerNode::notifyChildRemoved): Deleted. Merged into removeNodeWithScriptAssertion.
(WebCore::willRemoveChild): Deleted. Ditto.
(WebCore::willRemoveChildren): Deleted. Merged into removeAllChildrenWithScriptAssertion.
(WebCore::ContainerNode::removeChild): Deployed removeNodeWithScriptAssertion.
(WebCore::ContainerNode::parserRemoveChild): Ditto.
(WebCore::ContainerNode::replaceAllChildren): Deployed removeAllChildrenWithScriptAssertion. Now removes the node
outside executeNodeInsertionWithScriptAssertion but that's okay since executeNodeInsertionWithScriptAssertion
doesn't execute any code with a side effect before invoking the callback.
(WebCore::ContainerNode::removeChildren):
(WebCore::dispatchChildRemovalEvents): Refactored to take Ref<Node>&.
* dom/ContainerNode.h:
(WebCore::collectChildNodes): Renamed from getChildNodes. Also removed the useless comment about NodeVector's
initial size and instead prefer to webkit.org/b/80706 where the number 11 was picked.
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
* editing/ReplaceNodeWithSpanCommand.cpp:
(WebCore::swapInNodePreservingAttributesAndChildren):
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::clearShadowTree): Added an assertion exception while tearing down the UA shadow tree.

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

2 years agoAdd a test case for r214334.
mark.lam@apple.com [Fri, 20 Oct 2017 20:08:29 +0000 (20:08 +0000)]
Add a test case for r214334.
https://bugs.webkit.org/show_bug.cgi?id=169941
<rdar://problem/31221258>

Reviewed by JF Bastien.

* stress/regress-169941.js: Added.

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

2 years agoMarked http/tests/loading/resourceLoadStatistics/clear-in-memory-and-persistent-store...
jlewis3@apple.com [Fri, 20 Oct 2017 19:56:37 +0000 (19:56 +0000)]
Marked http/tests/loading/resourceLoadStatistics/clear-in-memory-and-persistent-store-one-hour.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=178536

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

2 years agoResourceResponse should have a ServiceWorker source
commit-queue@webkit.org [Fri, 20 Oct 2017 19:42:19 +0000 (19:42 +0000)]
ResourceResponse should have a ServiceWorker source
https://bugs.webkit.org/show_bug.cgi?id=178593

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

Source/WebCore:

Covered by updated tests.

Added ResourceResponse::Source::ServiceWorker.
Added internals to get FetchResponse source.

* inspector/InspectorNetworkAgent.cpp:
(WebCore::responseSource):
* loader/ResourceLoader.cpp:
(WebCore::logResourceResponseSource):
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::serviceWorkerKey):
* page/DiagnosticLoggingKeys.h:
* platform/network/ResourceResponseBase.h:
* testing/Internals.cpp:
(WebCore::responseSourceToString):
(WebCore::Internals::fetchResponseSource):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit:

* WebProcess/Storage/ServiceWorkerClientFetch.cpp:
(WebKit::ServiceWorkerClientFetch::didReceiveResponse): setting response source to ServiceWorker.
* WebProcess/Storage/ServiceWorkerClientFetch.h:

LayoutTests:

* http/tests/workers/service/basic-fetch.https-expected.txt:
* http/tests/workers/service/resources/basic-fetch.js:
(async.test):

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

2 years agoWebsiteDataStoreCustomPaths.mm is failing after r223718
commit-queue@webkit.org [Fri, 20 Oct 2017 19:26:58 +0000 (19:26 +0000)]
WebsiteDataStoreCustomPaths.mm is failing after r223718
https://bugs.webkit.org/show_bug.cgi?id=178596

Unreviewed.

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-20

* TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm:
(TEST): Making default web site data store creation expected at the end of the test.
We should probably not need need to create it.
This should be fixed as a follow-up.

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

2 years agoGenerated serializers do not properly handle optional interface attributes
aestes@apple.com [Fri, 20 Oct 2017 19:21:51 +0000 (19:21 +0000)]
Generated serializers do not properly handle optional interface attributes
https://bugs.webkit.org/show_bug.cgi?id=178542

Reviewed by Sam Weinig.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateSerializerDefinition):
* bindings/scripts/test/JS/JSTestSerialization.cpp:
(WebCore::JSTestSerialization::serialize):

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

2 years ago[Web Animations] Provide basic timeline and animation interfaces
commit-queue@webkit.org [Fri, 20 Oct 2017 18:41:23 +0000 (18:41 +0000)]
[Web Animations] Provide basic timeline and animation interfaces
https://bugs.webkit.org/show_bug.cgi?id=178526

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

.:

Remove the WEB_ANIMATIONS compile-time flag.

* Source/cmake/OptionsWPE.cmake:
* Source/cmake/OptionsWin.cmake:
* Source/cmake/WebKitFeatures.cmake:
* Source/cmake/tools/vsprops/FeatureDefines.props:
* Source/cmake/tools/vsprops/FeatureDefinesCairo.props:

Source/JavaScriptCore:

Remove the WEB_ANIMATIONS compile-time flag.

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

We're getting Web Animations work started by implementing a very minimal codebase which provides
a DocumentTimeline class which has an instance created for each Document. The parent class,
AnimationTimeline, allows for animations to be added and removed, and animations can be created
using the Animation class, with an optional timeline as parameter.

Tests: webanimations/animation-creation-basic.html
       webanimations/document-timeline.html

* CMakeLists.txt:
* Configurations/FeatureDefines.xcconfig:
* DerivedSources.make:
* PlatformWin.cmake:
* WebCore.xcodeproj/project.pbxproj:
* animation/AnimationTimeline.cpp: Added.
(WebCore::AnimationTimeline::AnimationTimeline):
(WebCore::AnimationTimeline::~AnimationTimeline):
(WebCore::AnimationTimeline::addAnimation):
(WebCore::AnimationTimeline::removeAnimation):
* animation/AnimationTimeline.h: Added.
(WebCore::AnimationTimeline::isDocumentTimeline const):
(WebCore::AnimationTimeline::classType const):
* animation/AnimationTimeline.idl: Added.
* animation/DocumentTimeline.cpp: Added.
(WebCore::DocumentTimeline::create):
(WebCore::DocumentTimeline::DocumentTimeline):
* animation/DocumentTimeline.h: Added.
* animation/DocumentTimeline.idl: Added.
* animation/WebAnimation.cpp: Added.
(WebCore::WebAnimation::create):
(WebCore::WebAnimation::WebAnimation):
(WebCore::WebAnimation::~WebAnimation):
* animation/WebAnimation.h: Added.
* animation/WebAnimation.idl: Added.
* bindings/js/JSAnimationTimelineCustom.cpp: Added.
(WebCore::toJSNewlyCreated):
(WebCore::toJS):
* bindings/js/WebCoreBuiltinNames.h:
* dom/Document.cpp:
(WebCore::Document::timeline):
* dom/Document.h:
* dom/Document.idl:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::webAnimationsEnabled const):

Source/WebCore/PAL:

Remove the WEB_ANIMATIONS compile-time flag.

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

Remove the WEB_ANIMATIONS compile-time flag.

* Configurations/FeatureDefines.xcconfig:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
(WebKit::InjectedBundle::setWebAnimationsEnabled):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

Source/WebKitLegacy/mac:

Remove the WEB_ANIMATIONS compile-time flag.

* Configurations/FeatureDefines.xcconfig:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKitLegacy/win:

Remove the WEB_ANIMATIONS compile-time flag.

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

Source/WTF:

Remove the WEB_ANIMATIONS compile-time flag.

* wtf/FeatureDefines.h:

Tools:

Remove the WEB_ANIMATIONS compile-time flag.

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

LayoutTests:

Basic test coverage to check that we are exposing a DocumentTimeline instance on
the Document and that we can construct Animations, optionally associated with a timeline.

* platform/mac-elcapitan/TestExpectations:
* webanimations/animation-creation-basic-expected.txt: Added.
* webanimations/animation-creation-basic.html: Added.
* webanimations/document-timeline-expected.txt: Added.
* webanimations/document-timeline.html: Added.

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

2 years agoWeb Inspector: Network Tab - Turn on the new tab by default, remove the legacy networ...
commit-queue@webkit.org [Fri, 20 Oct 2017 18:33:27 +0000 (18:33 +0000)]
Web Inspector: Network Tab - Turn on the new tab by default, remove the legacy network tab
https://bugs.webkit.org/show_bug.cgi?id=178559
<rdar://problem/34985503>

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

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Base/Main.js:
(WI.contentLoaded):
* UserInterface/Base/Setting.js:
* UserInterface/Main.html:
* UserInterface/Views/LegacyNetworkSidebarPanel.css: Removed.
* UserInterface/Views/LegacyNetworkSidebarPanel.js: Removed.
* UserInterface/Views/LegacyNetworkTabContentView.js: Removed.
* UserInterface/Views/NetworkGridContentView.css: Removed.
* UserInterface/Views/NetworkGridContentView.js: Removed.
* UserInterface/Views/TabBrowser.js:
(WI.TabBrowser.prototype.bestTabContentViewForRepresentedObject):
Remove LegacyNetwork tab, its NetworkGridContentView, and associated content.

* UserInterface/Views/NetworkTabContentView.js:
(WI.NetworkTabContentView.isTabAllowed):
Simplify now that this is the only Network tab.

* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createExperimentalSettingsView):
Remove experimental setting.

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

2 years agoUnreviewed, rolling out r223744, r223750, and r223751.
jlewis3@apple.com [Fri, 20 Oct 2017 17:58:32 +0000 (17:58 +0000)]
Unreviewed, rolling out r223744, r223750, and r223751.
https://bugs.webkit.org/show_bug.cgi?id=178594

These caused consistent failures in test that existed and were
added in the patches. (Requested by mlewis13 on #webkit).

Reverted changesets:

"[JSC] ScriptFetcher should be notified directly from module
pipeline"
https://bugs.webkit.org/show_bug.cgi?id=178340
https://trac.webkit.org/changeset/223744

"Unreviewed, fix changed line number in test expect files"
https://bugs.webkit.org/show_bug.cgi?id=178340
https://trac.webkit.org/changeset/223750

"Unreviewed, follow up to reflect comments"
https://bugs.webkit.org/show_bug.cgi?id=178340
https://trac.webkit.org/changeset/223751

Patch by Commit Queue <commit-queue@webkit.org> on 2017-10-20

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

2 years ago[FrameView::layout cleanup] Move can-enter-layout logic to a separate function
zalan@apple.com [Fri, 20 Oct 2017 17:54:21 +0000 (17:54 +0000)]
[FrameView::layout cleanup] Move can-enter-layout logic to a separate function
https://bugs.webkit.org/show_bug.cgi?id=178546
<rdar://problem/35083894>

Reviewed by Antti Koivisto.

No change in functionality.

* page/FrameView.cpp:
(WebCore::FrameView::canPerformLayout const):
(WebCore::FrameView::layout): We already assert on certain reentrancy conditions, loggig the reason
does not seem to have high value.
* page/FrameView.h:

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

2 years agoAdd createImageBitmap to Window and Worker
dino@apple.com [Fri, 20 Oct 2017 17:47:09 +0000 (17:47 +0000)]
Add createImageBitmap to Window and Worker
https://bugs.webkit.org/show_bug.cgi?id=178573
<rdar://problem/35092692>

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

Update the expected results now that createImageBitmap exists.

* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt:
* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt:
* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-sizeOverflow-expected.txt:
* web-platform-tests/imagebitmap-renderingcontext/bitmaprenderer-as-imagesource-expected.txt:
* web-platform-tests/imagebitmap-renderingcontext/context-creation-with-alpha-expected.txt:
* web-platform-tests/imagebitmap-renderingcontext/tranferFromImageBitmap-null-expected.txt:
* web-platform-tests/imagebitmap-renderingcontext/transferFromImageBitmap-detached-expected.txt:

Source/WebCore:

Implement the createImageBitmap functions that are exposed on the Window
and Worker objects.

Covered by the Web Platform Tests.

* html/ImageBitmap.cpp: Make sure to call suspendIfNeeded since this is
an ActiveDOMObject.
* html/ImageBitmap.h: Change the order of the classes in the Variant
to match the order of definitions in the IDL.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::createImageBitmap): Call ImageBitmap::createPromise.
* page/DOMWindow.h:
* page/WindowOrWorkerGlobalScope.idl: Add the createImageBitmap methods.
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::createImageBitmap): Call ImageBitmap::createPromise.
* workers/WorkerGlobalScope.h:

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

2 years agoWeb Inspector: consolidate code that hosts the Inspector page inside a WKWebView
bburg@apple.com [Fri, 20 Oct 2017 17:30:04 +0000 (17:30 +0000)]
Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView
https://bugs.webkit.org/show_bug.cgi?id=177661
<rdar://problem/34740286>

Reviewed by Joseph Pecoraro.

Move setup and delegates of the inspector frontend page into implementations of
WebInspectorProxy::platformCreateFrontendPage. The Mac implementation
will be subsumed by WKInspectorViewController, while the GTK implementation
is inherited from the cross-platform version that uses C API. Eventually the
GTK version should use GTK API rather than the soon to be deprecated C API.

* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::createFrontendPage):
(WebKit::webProcessDidCrash): Deleted.
(WebKit::decidePolicyForNavigationAction): Deleted.
(WebKit::getContextMenuFromProposedMenu): Deleted.
* UIProcess/gtk/WebInspectorProxyGtk.cpp:
(WebKit::exceededDatabaseQuota):
(WebKit::webProcessDidCrash):
(WebKit::decidePolicyForNavigationAction):
(WebKit::getContextMenuFromProposedMenu):
(WebKit::WebInspectorProxy::platformCreateFrontendPage):
* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::exceededDatabaseQuota):
(WebKit::webProcessDidCrash):
(WebKit::decidePolicyForNavigationAction):
(WebKit::getContextMenuFromProposedMenu):
(WebKit::WebInspectorProxy::platformCreateFrontendPage):

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

2 years agoWeb Inspector: consolidate code that hosts the Inspector page inside a WKWebView
bburg@apple.com [Fri, 20 Oct 2017 17:29:01 +0000 (17:29 +0000)]
Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView
https://bugs.webkit.org/show_bug.cgi?id=177661
<rdar://problem/34740286>

Reviewed by Joseph Pecoraro.

Introduce new platform methods to open and close the frontend page and window.
This matches how RemoteWebInspectorProxy divides work up into platform methods.
Move existing code from platformDidClose, platformOpen, and other methods into
the new platform methods. Move some identical platform code into WebInspectorProxy.cpp.

* UIProcess/WebInspectorProxy.h:
* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::connect):
(WebKit::WebInspectorProxy::showConsole):
(WebKit::WebInspectorProxy::showResources):
(WebKit::WebInspectorProxy::showTimelines):
(WebKit::WebInspectorProxy::showMainResourceForFrame):
(WebKit::WebInspectorProxy::createFrontendPage):
(WebKit::WebInspectorProxy::createInspectorPage):
(WebKit::WebInspectorProxy::open):
(WebKit::WebInspectorProxy::didClose):
(WebKit::WebInspectorProxy::eagerlyCreateInspectorPage): Renamed.

* UIProcess/gtk/WebInspectorProxyGtk.cpp:
(WebKit::WebInspectorProxy::updateInspectorWindowTitle const):
(WebKit::WebInspectorProxy::platformCreateFrontendPage):
Do everything necessary to set up the frontend page WebView.

(WebKit::WebInspectorProxy::platformCreateFrontendWindow):
Do everything necessary to set up the detached NSWindow for the frontend.

(WebKit::WebInspectorProxy::platformCloseFrontendPageAndWindow):
(WebKit::WebInspectorProxy::platformDetach):
(WebKit::WebInspectorProxy::platformCreateInspectorPage): Deleted.
(WebKit::WebInspectorProxy::createInspectorWindow): Deleted.
(WebKit::WebInspectorProxy::platformOpen): Deleted.
(WebKit::WebInspectorProxy::platformDidClose): Deleted.

* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::updateInspectorWindowTitle const):
(WebKit::WebInspectorProxy::platformCreateFrontendPage): Added.
Do everything necessary to set up the frontend page WebView.

(WebKit::WebInspectorProxy::platformCreateFrontendWindow): Added.
Do everything necessary to set up the detached NSWindow for the frontend.

(WebKit::WebInspectorProxy::closeFrontendPage):
(WebKit::WebInspectorProxy::closeFrontendAfterInactivityTimerFired):
(WebKit::WebInspectorProxy::platformCloseFrontendPageAndWindow):
(WebKit::WebInspectorProxy::platformDidCloseForCrash):
(WebKit::WebInspectorProxy::platformInvalidate):
(WebKit::WebInspectorProxy::platformBringToFront): Carry through renamings.

(WebKit::WebInspectorProxy::platformDetach):
Defer to the general open() method to create a window if needed and bring it to front.

(WebKit::WebInspectorProxy::platformCanAttach): Move this below open/close code.

(WebKit::WebInspectorProxy::closeFrontend): Deleted.
(WebKit::WebInspectorProxy::createInspectorWindow): Deleted.
(WebKit::WebInspectorProxy::platformCreateInspectorPage): Deleted.
(WebKit::WebInspectorProxy::platformOpen): Deleted.
(WebKit::WebInspectorProxy::platformDidClose): Deleted.
Defer to the general open() method to create a window if needed and bring it to front.

* UIProcess/wpe/WebInspectorProxyWPE.cpp:
(WebKit::WebInspectorProxy::platformCreateFrontendPage):
(WebKit::WebInspectorProxy::platformCreateFrontendWindow):
(WebKit::WebInspectorProxy::platformCloseFrontendPageAndWindow):
(WebKit::WebInspectorProxy::platformCreateInspectorPage): Deleted.
(WebKit::WebInspectorProxy::createInspectorWindow): Deleted.
(WebKit::WebInspectorProxy::platformOpen): Deleted.
(WebKit::WebInspectorProxy::platformDidClose): Deleted.
Update stubs.

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

2 years agoWeb Inspector: consolidate code that hosts the Inspector page inside a WKWebView
bburg@apple.com [Fri, 20 Oct 2017 17:28:58 +0000 (17:28 +0000)]
Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView
https://bugs.webkit.org/show_bug.cgi?id=177661
<rdar://problem/34740286>

Reviewed by Joseph Pecoraro.

This patch refactors some Cocoa code pathas.
Rename the timer that closes the WebView so it's more obvious what it is for.
Extract the common code to close the frontend window so its not implemented by
the timer callback.

In later patches, this will be extracted further into platform methods to open/close
the frontend and window, like how it is for RemoteWebInspectorProxy.

* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::WebInspectorProxy):
* UIProcess/WebInspectorProxy.h:
* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::closeFrontendAfterInactivityTimerFired):
(WebKit::WebInspectorProxy::closeFrontend):
(WebKit::WebInspectorProxy::platformCreateInspectorPage):
(WebKit::WebInspectorProxy::platformDidClose):
(WebKit::WebInspectorProxy::platformDidCloseForCrash):
(WebKit::WebInspectorProxy::platformInvalidate):
(WebKit::WebInspectorProxy::closeTimerFired): Deleted.

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

2 years agoWeb Inspector: consolidate code that hosts the Inspector page inside a WKWebView
bburg@apple.com [Fri, 20 Oct 2017 17:28:57 +0000 (17:28 +0000)]
Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView
https://bugs.webkit.org/show_bug.cgi?id=177661
<rdar://problem/34740286>

Reviewed by Joseph Pecoraro.

Modernize the ObjC adapter and related code a bit before it is hooked
into WKInspectorViewController.

* UIProcess/API/C/mac/WKInspectorPrivateMac.h: No need for the
ivar to be declared here, move to @implementation.

* UIProcess/WebInspectorProxy.h: Simplify the name to match modern convention.

* UIProcess/mac/WebInspectorProxyMac.mm:
(-[WKWebInspectorProxyObjCAdapter inspectorRef]):
(-[WKWebInspectorProxyObjCAdapter initWithWebInspectorProxy:]):
(-[WKWebInspectorProxyObjCAdapter invalidate]):
(-[WKWebInspectorProxyObjCAdapter windowDidMove:]):
(-[WKWebInspectorProxyObjCAdapter windowDidResize:]):
(-[WKWebInspectorProxyObjCAdapter windowWillClose:]):
(-[WKWebInspectorProxyObjCAdapter windowDidEnterFullScreen:]):
(-[WKWebInspectorProxyObjCAdapter windowDidExitFullScreen:]):
(-[WKWebInspectorProxyObjCAdapter inspectedViewFrameDidChange:]):
Remove unnecessary casts to and from void*.

(WebKit::WebInspectorProxy::attachmentViewDidChange):
(WebKit::WebInspectorProxy::setInspectorWindowFrame):
(WebKit::WebInspectorProxy::closeTimerFired):
(WebKit::WebInspectorProxy::createInspectorWindow):
(WebKit::WebInspectorProxy::platformCreateInspectorPage):
Fix uses of member variable m_objCAdapter.

(-[WKWebInspectorProxyObjCAdapter close]): Deleted.
Rename this to invalidate to match modern convention. In this context,
'close' might trick someone into thinking that this closes a window/page.

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

2 years agoWeb Inspector: consolidate code that hosts the Inspector page inside a WKWebView
bburg@apple.com [Fri, 20 Oct 2017 17:28:53 +0000 (17:28 +0000)]
Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView
https://bugs.webkit.org/show_bug.cgi?id=177661
<rdar://problem/34740286>

Reviewed by Joseph Pecoraro.

Move code that sets up and controls the inspector WebView into WKInspectorViewController.
This will be shared between RemoteWebInspectorProxy and WebInspectorProxy eventually,
but for now just pull out code from RemoteWebInspectorProxy. The next patch will move
over WebInspectorProxy.

WKInspectorViewController uses the ObjC API for setting up the WKWebView's delegates.
Previously, a WKWebView was used but the delegates were set up using the C API. In
a few cases it uses delegate methods to ask the owning [Remote]WebInspectorProxy some
things. In general, WKInspectorViewController doesn't dig into any internals of
WebPageProxy or WebInspectorProxy; that is delegated to the client.

* UIProcess/RemoteWebInspectorProxy.h:
(WebKit::RemoteWebInspectorProxy::isUnderTest const): Add a method stub for now.
We might want to enable tests for a _WKRemoteWebInspectorViewController-based UI
in the future, and WebInspectorProxy has the same method. Add this and connect it
to the view controller delegate method.

(WebKit::RemoteWebInspectorProxy::webView const):
This returns a plain WKWebView type now.

* UIProcess/mac/RemoteWebInspectorProxyMac.mm:
(-[WKRemoteWebInspectorProxyObjCAdapter inspectorViewControllerInspectorDidCrash:]):
(-[WKRemoteWebInspectorProxyObjCAdapter inspectorViewControllerInspectorIsUnderTest:]):
(-[WKRemoteWebInspectorProxyObjCAdapter webViewWebContentProcessDidTerminate:]): Deleted.
(-[WKRemoteWebInspectorProxyObjCAdapter webView:decidePolicyForNavigationAction:decisionHandler:]): Deleted.
Make the ObjCAdapter forward view controller delegate calls to the C++ class.
It no longer needs to be the delegate of the WebView, as the view controller handles that.

(WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
Clean up and move WKWebView setup code into the view controller.

(WebKit::RemoteWebInspectorProxy::platformCloseFrontendPageAndWindow):
The m_inspectorPage is closed by the caller before calling this method, so we don't need to do it here.

(WebKit::RemoteWebInspectorProxy::platformBringToFront):
(WebKit::RemoteWebInspectorProxy::platformSave):
(WebKit::RemoteWebInspectorProxy::platformAppend):
(WebKit::RemoteWebInspectorProxy::platformStartWindowDrag):
Use webView() instead of m_webView.

* UIProcess/mac/WKInspectorViewController.h: Added.
* UIProcess/mac/WKInspectorViewController.mm: Added.
(-[WKInspectorWKWebView tag]):
(-[WKInspectorViewController initWithInspectedPage:]):
(-[WKInspectorViewController dealloc]):
(-[WKInspectorViewController delegate]):
(-[WKInspectorViewController webView]):
(-[WKInspectorViewController setDelegate:]):
(-[WKInspectorViewController configuration]):
(-[WKInspectorViewController _webView:getWindowFrameWithCompletionHandler:]):
(-[WKInspectorViewController _webView:setWindowFrame:]):
(-[WKInspectorViewController webView:runOpenPanelWithParameters:initiatedByFrame:completionHandler:]):
(-[WKInspectorViewController _webView:decideDatabaseQuotaForSecurityOrigin:currentQuota:currentOriginUsage:currentDatabaseUsage:expectedUsage:decisionHandler:]):
(-[WKInspectorViewController webViewWebContentProcessDidTerminate:]):
(-[WKInspectorViewController webView:decidePolicyForNavigationAction:decisionHandler:]):
Move code from RemoteWebInspectorProxyMac into here.

* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::createFrontendWindow):
Remove commented out code left over from the last time that this method got moved around.

* WebKit.xcodeproj/project.pbxproj:
Add new class.

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

2 years agoUnreviewed GTK+ gardening. Adding GTK+-specific baselines for a bunch
zandobersek@gmail.com [Fri, 20 Oct 2017 17:22:52 +0000 (17:22 +0000)]
Unreviewed GTK+ gardening. Adding GTK+-specific baselines for a bunch
of HTTP tests, and adding failure expectations for some others.

* platform/gtk/TestExpectations:
* platform/gtk/http/tests/security/contentSecurityPolicy/1.1: Added.
* platform/gtk/http/tests/security/contentSecurityPolicy/1.1/module-scriptnonce-redirect-expected.txt: Added.
* platform/gtk/http/tests/security/module-no-mime-type-expected.txt:
* platform/gtk/imported/w3c/web-platform-tests/2dcontext: Added.
* platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap: Added.
* platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt: Added.
* platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt: Added.

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

2 years ago[GTK] Update expectations for webkitConvertPoint.html
Ms2ger@igalia.com [Fri, 20 Oct 2017 17:05:42 +0000 (17:05 +0000)]
[GTK] Update expectations for webkitConvertPoint.html
https://bugs.webkit.org/show_bug.cgi?id=178582

Reviewed by Michael Catanzaro.

This at least makes the test useful as a regression test.

* platform/gtk/TestExpectations:
* platform/gtk/fast/dom/Window/webkitConvertPoint-expected.txt:

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

2 years agoMissing some perl packages in install-dependencies
tpopela@redhat.com [Fri, 20 Oct 2017 17:00:14 +0000 (17:00 +0000)]
Missing some perl packages in install-dependencies
https://bugs.webkit.org/show_bug.cgi?id=178571

Reviewed by Žan Doberšek.

Install per-version and perl-Time-HiRes so we can use build-webkit
script. Also add missing backlashes.

* wpe/install-dependencies:

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

2 years agoAX: [ATK] Events missing and state incorrect for aria-activedescendant
jdiggs@igalia.com [Fri, 20 Oct 2017 16:30:20 +0000 (16:30 +0000)]
AX: [ATK] Events missing and state incorrect for aria-activedescendant
https://bugs.webkit.org/show_bug.cgi?id=178523

Reviewed by Chris Fleizach.

Source/WebCore:

When the aria-activedescendant of an element changes, emit object:state-changed:focused.
When a focused element has a valid active descendant, do not expose the focused state on
the element, but rather on the active descendant. Also expose the focusable state on the
active descendant.

Tests: accessibility/gtk/aria-activedescendant-changed-notification.html
       accessibility/gtk/aria-activedescendant.html

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::isActiveDescendantOfFocusedContainer const):
(WebCore::AccessibilityObject::ariaActiveDescendantReferencingElements const):
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::shouldNotifyActiveDescendant const):
* accessibility/atk/AXObjectCacheAtk.cpp:
(WebCore::AXObjectCache::postPlatformNotification):
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(setAtkStateSetFromCoreObject):

LayoutTests:

* accessibility/gtk/aria-activedescendant-changed-notification-expected.txt: Added.
* accessibility/gtk/aria-activedescendant-changed-notification.html: Added.
* accessibility/gtk/aria-activedescendant-expected.txt: Added.
* accessibility/gtk/aria-activedescendant.html: Added.

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

2 years agoUnreviewed, rolling out r222709 and r223572.
commit-queue@webkit.org [Fri, 20 Oct 2017 16:10:06 +0000 (16:10 +0000)]
Unreviewed, rolling out r222709 and r223572.
https://bugs.webkit.org/show_bug.cgi?id=178587

Still getting mac-wk2 EWS bots stuck (Requested by ap on
#webkit).

Reverted changesets:

"Log stack-trace for run-webkit-tests when interrupted"
https://bugs.webkit.org/show_bug.cgi?id=176393
https://trac.webkit.org/changeset/222709

"webkitpy: Hang when workers write to the same stack trace
file"
https://bugs.webkit.org/show_bug.cgi?id=178402
https://trac.webkit.org/changeset/223572

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

2 years ago[Win] Mark http/tests/navigation/keyboard-events-during-provisional-navigation.html and
pvollan@apple.com [Fri, 20 Oct 2017 15:15:58 +0000 (15:15 +0000)]
[Win] Mark http/tests/navigation/keyboard-events-during-provisional-navigation.html and
http/tests/navigation/keyboard-events-during-provisional-subframe-navigation.html as failures.
https://bugs.webkit.org/show_bug.cgi?id=178549

Unreviewed test gardening.

* platform/win/TestExpectations:

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

2 years agoAdd the MAX_CLIENT_WAIT_TIMEOUT_WEBGL constant to WebGL2RenderingContext.
Ms2ger@igalia.com [Fri, 20 Oct 2017 12:45:46 +0000 (12:45 +0000)]
Add the MAX_CLIENT_WAIT_TIMEOUT_WEBGL constant to WebGL2RenderingContext.
https://bugs.webkit.org/show_bug.cgi?id=178572

Reviewed by Žan Doberšek.

Source/WebCore:

Test: fast/canvas/webgl/webgl2/constants.html

* html/canvas/WebGL2RenderingContext.idl:

LayoutTests:

* fast/canvas/webgl/webgl2/constants-expected.txt:
* fast/canvas/webgl/webgl2/constants.html:

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

2 years ago[WK2] Drop 'CoordinatedGraphics' as a platform prefix from generate-forwarding-headers.pl
zandobersek@gmail.com [Fri, 20 Oct 2017 12:23:26 +0000 (12:23 +0000)]
[WK2] Drop 'CoordinatedGraphics' as a platform prefix from generate-forwarding-headers.pl
https://bugs.webkit.org/show_bug.cgi?id=178575

Reviewed by Carlos Garcia Campos.

* Scripts/generate-forwarding-headers.pl: Remove CoordinatedGraphics as
a supported platform prefix. No one invokes the script with this
argument anymore.

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

2 years agoUnreviewed WPE gardening. Managing failure expectations for
zandobersek@gmail.com [Fri, 20 Oct 2017 12:04:43 +0000 (12:04 +0000)]
Unreviewed WPE gardening. Managing failure expectations for
a set of failing HTTP tests.

* platform/wpe/TestExpectations:

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

2 years ago[GTK][WPE] Fix review comments on WEBPImageDecoder
magomez@igalia.com [Fri, 20 Oct 2017 11:08:12 +0000 (11:08 +0000)]
[GTK][WPE] Fix review comments on WEBPImageDecoder
https://bugs.webkit.org/show_bug.cgi?id=178080

Reviewed by Said Abou-Hallawa.

Source/WebCore:

Properly free the demuxer in case of error, improve the code to detect the first
required frame to decode, fix the usage of the DecodingStatus and some styling
changes.

Covered by existent tests.

* platform/image-decoders/webp/WEBPImageDecoder.cpp:
(WebCore::webpFrameAtIndex):
(WebCore::WEBPImageDecoder::findFirstRequiredFrameToDecode):
(WebCore::WEBPImageDecoder::decode):
(WebCore::WEBPImageDecoder::decodeFrame):
(WebCore::WEBPImageDecoder::initFrameBuffer):
(WebCore::WEBPImageDecoder::clearFrameBufferCache):

LayoutTests:

Adjusted test duration.

* fast/images/animated-webp.html:

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

2 years agoUnreviewed WPE gardening. Rebaselining CSS tests that were affected
zandobersek@gmail.com [Fri, 20 Oct 2017 09:23:58 +0000 (09:23 +0000)]
Unreviewed WPE gardening. Rebaselining CSS tests that were affected
by recent font changes.

* platform/wpe/css1/font_properties/font-expected.txt:
* platform/wpe/css1/pseudo/firstline-expected.txt:
* platform/wpe/css1/pseudo/multiple_pseudo_elements-expected.txt:
* platform/wpe/css2.1/t051201-c23-first-line-00-b-expected.txt:
* platform/wpe/css2.1/t051202-c26-psudo-nest-00-c-expected.txt:
* platform/wpe/css2.1/t0905-c5525-fltwidth-00-c-g-expected.txt:
* platform/wpe/css2.1/t1508-c527-font-00-b-expected.txt:
* platform/wpe/css2.1/t1508-c527-font-06-b-expected.txt:
* platform/wpe/css2.1/t1508-c527-font-07-b-expected.txt:
* platform/wpe/css2.1/t1508-c527-font-10-c-expected.txt:

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

2 years ago[Curl] Clean up old style code in old curl files.
commit-queue@webkit.org [Fri, 20 Oct 2017 09:22:54 +0000 (09:22 +0000)]
[Curl] Clean up old style code in old curl files.
https://bugs.webkit.org/show_bug.cgi?id=178569

Patch by Basuke Suzuki <Basuke.Suzuki@sony.com> on 2017-10-20
Reviewed by Ryosuke Niwa.

Source/WebCore:

* platform/network/curl/AuthenticationChallenge.h:
* platform/network/curl/CertificateInfo.h:
* platform/network/curl/CookieJarCurl.h:
* platform/network/curl/CurlCacheEntry.h:
* platform/network/curl/CurlCacheManager.cpp:
(WebCore::CurlCacheManager::singleton):
(WebCore::CurlCacheManager::getInstance): Deleted.
* platform/network/curl/CurlCacheManager.h:
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlContext::singleton):
* platform/network/curl/CurlContext.h:
(WebCore::CurlContext::singleton): Deleted.
* platform/network/curl/CurlJobManager.cpp:
(WebCore::CurlJobManager::singleton):
* platform/network/curl/CurlJobManager.h:
(WebCore::CurlJobManager::singleton): Deleted.
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::setupTransfer):
* platform/network/curl/CurlRequest.h:
* platform/network/curl/CurlRequestDelegate.h:
* platform/network/curl/CurlResponse.h:
(WebCore::CurlResponse::isolatedCopy const):
* platform/network/curl/CurlSSLHandle.h:
* platform/network/curl/CurlSSLVerifier.h:
* platform/network/curl/DownloadBundle.h:
* platform/network/curl/MultipartHandle.h:
* platform/network/curl/ResourceError.h:
* platform/network/curl/ResourceHandleCurlDelegate.cpp:
(WebCore::ResourceHandleCurlDelegate::createCurlRequest):
(WebCore::ResourceHandleCurlDelegate::curlDidReceiveResponse):
(WebCore::ResourceHandleCurlDelegate::curlDidReceiveBuffer):
(WebCore::ResourceHandleCurlDelegate::curlDidComplete):
(WebCore::ResourceHandleCurlDelegate::curlDidFailWithError):
* platform/network/curl/ResourceRequest.h:
(WebCore::ResourceRequest::ResourceRequest):
(WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties):
(WebCore::ResourceRequest::cfURLRequest const):
(WebCore::ResourceRequest::httpPipeliningEnabled):
(WebCore::ResourceRequest::setHTTPPipeliningEnabled):
(WebCore::ResourceRequest::doUpdatePlatformRequest):
(WebCore::ResourceRequest::doUpdateResourceRequest):
(WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
(WebCore::ResourceRequest::doUpdateResourceHTTPBody):
(WebCore::ResourceRequest::doPlatformSetAsIsolatedCopy):
* platform/network/curl/ResourceResponseCurl.cpp:
(WebCore::ResourceResponse::isAppendableHeader):
(WebCore::ResourceResponse::ResourceResponse):

Source/WebKitLegacy/win:

* WebCache.cpp:
(WebCache::cacheFolder):
(WebCache::setCacheFolder):
* WebView.cpp:
(WebView::setCacheModel):

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

2 years agoUnreviewed, follow up to reflect comments
utatane.tea@gmail.com [Fri, 20 Oct 2017 09:02:20 +0000 (09:02 +0000)]
Unreviewed, follow up to reflect comments
https://bugs.webkit.org/show_bug.cgi?id=178340

* runtime/JSModuleLoader.cpp:
(JSC::JSModuleLoader::notifyCompleted):

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

2 years agoUnreviewed, fix changed line number in test expect files
utatane.tea@gmail.com [Fri, 20 Oct 2017 08:59:30 +0000 (08:59 +0000)]
Unreviewed, fix changed line number in test expect files
https://bugs.webkit.org/show_bug.cgi?id=178340

* http/tests/security/contentSecurityPolicy/1.1/module-scriptnonce-redirect-expected.txt:
* http/tests/security/module-no-mime-type-expected.txt:

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

2 years agoRenderLayerCompositor: Move implementation of simple methods into the header file.
commit-queue@webkit.org [Fri, 20 Oct 2017 08:30:31 +0000 (08:30 +0000)]
RenderLayerCompositor: Move implementation of simple methods into the header file.
https://bugs.webkit.org/show_bug.cgi?id=178514

Patch by Frederic Wang <fwang@igalia.com> on 2017-10-20
Reviewed by Darin Adler.

No new tests, behavior unchanged.

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

2 years agoSupport ::before/::after pseudo elements on elements with display:contents
antti@apple.com [Fri, 20 Oct 2017 08:29:03 +0000 (08:29 +0000)]
Support ::before/::after pseudo elements on elements with display:contents
https://bugs.webkit.org/show_bug.cgi?id=178513

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

* web-platform-tests/cssom/getComputedStyle-pseudo-expected.txt:

Source/WebCore:

Add support for

    div { display:contents }
    div::after { content:'foo' }

That is support non-box generating elements with generated content.

* style/RenderTreePosition.cpp:
(WebCore::RenderTreePosition::nextSiblingRenderer const):

    Implement full pseudo-inclusive traversal starting from any element (including pseudo)
    to locate the next rendering sibling. In case of display:content this may need to look
    into descendants.

* style/RenderTreeUpdater.cpp:
(WebCore::textRendererIsNeeded):

    RenderTreePosition::nextSiblingRenderer can no longer be called with a node that already has a renderer.
    Maintain the existing behavior.

* style/RenderTreeUpdaterGeneratedContent.cpp:
(WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
(WebCore::RenderTreeUpdater::GeneratedContent::needsPseudoElement):

    Don't require for host to have a renderer.

* style/RenderTreeUpdaterGeneratedContent.h:
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolvePseudoStyle):

LayoutTests:

* TestExpectations: Enable imported/w3c/web-platform-tests/css/css-display-3/display-contents-before-after-001.html

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

2 years agoMove common bindings files to unified sources
keith_miller@apple.com [Fri, 20 Oct 2017 07:50:29 +0000 (07:50 +0000)]
Move common bindings files to unified sources
https://bugs.webkit.org/show_bug.cgi?id=178561

Rubber-stamped by Ryosuke Niwa.

This patch moves most of the common bindings files to unified sources.

Additionally, it adds a change to make_names to unique a struct
name that caused name conflicts that I missed when I made the
source changes before.

Lastly, add missing reference to WebCoreJSBuiltins.cpp in CMake build.

No new behavior no tests.

* CMakeLists.txt:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/make_names.pl:
(printFactoryCppFile):

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

2 years agoOptimize accesses to how we get the direct prototype
sbarati@apple.com [Fri, 20 Oct 2017 07:50:08 +0000 (07:50 +0000)]
Optimize accesses to how we get the direct prototype
https://bugs.webkit.org/show_bug.cgi?id=178548

Reviewed by Yusuke Suzuki.

Source/JavaScriptCore:

This patch makes JSObject::getPrototypeDirect take VM& as a parameter
so it can use the faster version of the structure accessor function.
The reason for making this change is that JSObjet::getPrototypeDirect
is called on the hot path in property lookup.

* API/JSObjectRef.cpp:
(JSObjectGetPrototype):
* jsc.cpp:
(WTF::DOMJITGetterBaseJSObject::DOMJITAttribute::slowCall):
(WTF::DOMJITGetterBaseJSObject::customGetter):
(functionCreateProxy):
* runtime/ArrayPrototype.cpp:
(JSC::speciesWatchpointIsValid):
* runtime/ErrorInstance.cpp:
(JSC::ErrorInstance::sanitizedToString):
* runtime/JSArray.cpp:
(JSC::JSArray::isIteratorProtocolFastAndNonObservable):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::lastInPrototypeChain):
(JSC::JSGlobalObject::resetPrototype):
(JSC::JSGlobalObject::finishCreation):
* runtime/JSGlobalObjectInlines.h:
(JSC::JSGlobalObject::objectPrototypeIsSane):
(JSC::JSGlobalObject::arrayPrototypeChainIsSane):
(JSC::JSGlobalObject::stringPrototypeChainIsSane):
* runtime/JSLexicalEnvironment.cpp:
(JSC::JSLexicalEnvironment::getOwnPropertySlot):
* runtime/JSMap.cpp:
(JSC::JSMap::isIteratorProtocolFastAndNonObservable):
* runtime/JSObject.cpp:
(JSC::JSObject::calculatedClassName):
(JSC::JSObject::setPrototypeWithCycleCheck):
(JSC::JSObject::getPrototype):
(JSC::JSObject::attemptToInterceptPutByIndexOnHoleForPrototype):
(JSC::JSObject::attemptToInterceptPutByIndexOnHole):
(JSC::JSObject::anyObjectInChainMayInterceptIndexedAccesses const):
(JSC::JSObject::prototypeChainMayInterceptStoreTo):
* runtime/JSObject.h:
(JSC::JSObject::finishCreation):
(JSC::JSObject::getPrototypeDirect const):
(JSC::JSObject::getPrototype):
* runtime/JSObjectInlines.h:
(JSC::JSObject::canPerformFastPutInline):
(JSC::JSObject::getPropertySlot):
(JSC::JSObject::getNonIndexPropertySlot):
* runtime/JSProxy.cpp:
(JSC::JSProxy::setTarget):
* runtime/JSSet.cpp:
(JSC::JSSet::isIteratorProtocolFastAndNonObservable):
* runtime/ProgramExecutable.cpp:
(JSC::ProgramExecutable::initializeGlobalProperties):
* runtime/StructureInlines.h:
(JSC::Structure::isValid const):

Source/WebCore:

No new tests: no functionality change.

* bindings/js/JSDOMAbstractOperations.h:
(WebCore::isVisibleNamedProperty):
(WebCore::accessVisibleNamedProperty):
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::toJSDOMWindow):
* bindings/js/JSDOMWindowProperties.cpp:
(WebCore::JSDOMWindowProperties::getOwnPropertySlot):
* bindings/js/JSPluginElementFunctions.cpp:
(WebCore::pluginElementCustomGetOwnPropertySlot):
* bindings/js/WorkerScriptController.cpp:
(WebCore::WorkerScriptController::initScript):
* bindings/scripts/CodeGeneratorJS.pm:
(GeneratePut):
(GeneratePutByIndex):
(GenerateConstructorHelperMethods):
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
(WebCore::JSTestGlobalObjectConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
(WebCore::JSTestNamedAndIndexedSetterNoIdentifier::put):
(WebCore::JSTestNamedAndIndexedSetterNoIdentifier::putByIndex):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
(WebCore::JSTestNamedAndIndexedSetterThrowingException::put):
(WebCore::JSTestNamedAndIndexedSetterThrowingException::putByIndex):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
(WebCore::JSTestNamedAndIndexedSetterWithIdentifier::put):
(WebCore::JSTestNamedAndIndexedSetterWithIdentifier::putByIndex):
* bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
(WebCore::JSTestNamedSetterNoIdentifier::put):
(WebCore::JSTestNamedSetterNoIdentifier::putByIndex):
* bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
(WebCore::JSTestNamedSetterThrowingException::put):
(WebCore::JSTestNamedSetterThrowingException::putByIndex):
* bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
(WebCore::JSTestNamedSetterWithIdentifier::put):
(WebCore::JSTestNamedSetterWithIdentifier::putByIndex):
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
(WebCore::JSTestNamedSetterWithIndexedGetter::put):
(WebCore::JSTestNamedSetterWithIndexedGetter::putByIndex):
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
(WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::put):
(WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::putByIndex):
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
(WebCore::JSTestNamedSetterWithUnforgableProperties::put):
(WebCore::JSTestNamedSetterWithUnforgableProperties::putByIndex):

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

2 years ago[ARM64] static_cast<int32_t>() in BinaryOpNode::emitBytecode() prevents op_unsigned...
utatane.tea@gmail.com [Fri, 20 Oct 2017 07:35:16 +0000 (07:35 +0000)]
[ARM64] static_cast<int32_t>() in BinaryOpNode::emitBytecode() prevents op_unsigned emission
https://bugs.webkit.org/show_bug.cgi?id=178379

Reviewed by Saam Barati.

We reuse jsNumber's checking mechanism here to precisely check the generated number is within uint32_t
in bytecode compiler. This is reasonable since the NumberNode will generate the exact this JSValue.

* bytecompiler/NodesCodegen.cpp:
(JSC::BinaryOpNode::emitBytecode):

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

2 years ago[JSC] ScriptFetcher should be notified directly from module pipeline
utatane.tea@gmail.com [Fri, 20 Oct 2017 07:19:02 +0000 (07:19 +0000)]
[JSC] ScriptFetcher should be notified directly from module pipeline
https://bugs.webkit.org/show_bug.cgi?id=178340

Reviewed by Sam Weinig.

Source/JavaScriptCore:

Previously, we use JSStdFunction to let WebCore inform the module pipeline results.
We setup JSStdFunction to the resulted promise of the module pipeline. It is super
ad-hoc since JSStdFunction's lambda need extra-careful to make it non-cyclic-referenced.
JSStdFunction's lambda can capture variables, but they are not able to be marked by GC.

But now, we have ScriptFetcher. It is introduced after we implemented the module pipeline
notification mechanism by using JSStdFunction. But it is appropriate one to receive notification
from the module pipeline by observer style.

This patch removes the above ad-hoc JSStdFunction use. And now ScriptFetcher receives
completion/failure notifications from the module pipeline.

* builtins/ModuleLoaderPrototype.js:
(loadModule):
(loadAndEvaluateModule):
* runtime/Completion.cpp:
(JSC::loadModule):
* runtime/Completion.h:
* runtime/JSModuleLoader.cpp:
(JSC::jsValueToModuleKey):
(JSC::JSModuleLoader::notifyCompleted):
(JSC::JSModuleLoader::notifyFailed):
* runtime/JSModuleLoader.h:
* runtime/ModuleLoaderPrototype.cpp:
(JSC::moduleLoaderPrototypeNotifyCompleted):
(JSC::moduleLoaderPrototypeNotifyFailed):
* runtime/ScriptFetcher.h:
(JSC::ScriptFetcher::notifyLoadCompleted):
(JSC::ScriptFetcher::notifyLoadFailed):

Source/WebCore:

No behavior change.

* bindings/js/JSMainThreadExecState.h:
(WebCore::JSMainThreadExecState::loadModule):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::loadModuleScriptInWorld):
(WebCore::jsValueToModuleKey): Deleted.
(WebCore::ScriptController::setupModuleScriptHandlers): Deleted.
* bindings/js/ScriptController.h:
* dom/LoadableModuleScript.cpp:
(WebCore::LoadableModuleScript::notifyLoadFailed):
* dom/LoadableModuleScript.h:

LayoutTests:

* http/tests/security/contentSecurityPolicy/1.1/module-scriptnonce-redirect-expected.txt:
* http/tests/security/module-no-mime-type-expected.txt:
* js/dom/modules/module-execution-error-should-be-propagated-to-onerror-expected.txt:

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

2 years agoRemove proprietary constants from WebGL2RenderingContext.
Ms2ger@igalia.com [Fri, 20 Oct 2017 06:17:38 +0000 (06:17 +0000)]
Remove proprietary constants from WebGL2RenderingContext.
https://bugs.webkit.org/show_bug.cgi?id=178511

Reviewed by Ryosuke Niwa.

As far as I can tell, these constants are not in the specification,
and no other browser supports them.

No new tests: just code removal.

* html/canvas/WebGL2RenderingContext.idl:

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

2 years ago[FrameView::layout cleanup] Move style update related logic to a separate function
zalan@apple.com [Fri, 20 Oct 2017 04:52:06 +0000 (04:52 +0000)]
[FrameView::layout cleanup] Move style update related logic to a separate function
https://bugs.webkit.org/show_bug.cgi?id=178558
<rdar://problem/35088218>

Reviewed by Simon Fraser.

No change in functionality.

* page/FrameView.cpp:
(WebCore::FrameView::ensureStyleIsUpToDateForLayout):
(WebCore::FrameView::layout):
* page/FrameView.h:

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

2 years agoRuntime disable gigacage on iOS because it broke WasmBench
sbarati@apple.com [Fri, 20 Oct 2017 03:08:26 +0000 (03:08 +0000)]
Runtime disable gigacage on iOS because it broke WasmBench
https://bugs.webkit.org/show_bug.cgi?id=178556

Reviewed by Keith Miller.

* bmalloc/Gigacage.cpp:
(Gigacage::shouldBeEnabled):

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

2 years agoIntroduce completionHandler-based SPI for _WKDownloadDelegate.decideDestinationWithSu...
achristensen@apple.com [Fri, 20 Oct 2017 02:41:22 +0000 (02:41 +0000)]
Introduce completionHandler-based SPI for _WKDownloadDelegate.decideDestinationWithSuggestedFilename
https://bugs.webkit.org/show_bug.cgi?id=178560

Reviewed by Tim Horton.

* UIProcess/API/Cocoa/_WKDownloadDelegate.h:
* UIProcess/Cocoa/DownloadClient.h:
* UIProcess/Cocoa/DownloadClient.mm:
(WebKit::DownloadClient::DownloadClient):
(WebKit::DownloadClient::didStart):
(WebKit::DownloadClient::didReceiveResponse):
(WebKit::DownloadClient::didReceiveData):
(WebKit::DownloadClient::decideDestinationWithSuggestedFilename):
(WebKit::DownloadClient::didFinish):
(WebKit::DownloadClient::didFail):
(WebKit::DownloadClient::didCancel):
(WebKit::DownloadClient::willSendRequest):

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

2 years agoServiceWorkerContextManager should be an IPC::MessageReceiver
cdumez@apple.com [Fri, 20 Oct 2017 02:39:58 +0000 (02:39 +0000)]
ServiceWorkerContextManager should be an IPC::MessageReceiver
https://bugs.webkit.org/show_bug.cgi?id=178552

Reviewed by Youenn Fablet.

ServiceWorkerContextManager should be an IPC::MessageReceiver, to avoid putting too many
ServiceWorker related methods on WebProcess class.

* DerivedSources.make:
* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::startServiceWorkerContext):
(WebKit::WebSWServerConnection::startFetch):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Storage/ServiceWorkerContextManager.cpp:
(WebKit::ServiceWorkerContextManager::startFetchInServiceWorker):
(WebKit::ServiceWorkerContextManager::startFetch): Deleted.
* WebProcess/Storage/ServiceWorkerContextManager.h:
* WebProcess/Storage/ServiceWorkerContextManager.messages.in: Added.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::didReceiveMessage):
(WebKit::WebProcess::getWorkerContextConnection):
(WebKit::WebProcess::startServiceWorkerContext): Deleted.
(WebKit::WebProcess::startFetchInServiceWorker): Deleted.
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

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

2 years agoWebAssembly: no VM / JS version of everything but Instance
jfbastien@apple.com [Fri, 20 Oct 2017 02:23:29 +0000 (02:23 +0000)]
WebAssembly: no VM / JS version of everything but Instance
https://bugs.webkit.org/show_bug.cgi?id=177473

Reviewed by Filip Pizlo, Saam Barati.

JSTests:

- Exceeding max on memory growth now returns a range error as per
spec. This is a (very minor) breaking change: it used to throw OOM
error. Update the corresponding test.

* wasm/js-api/memory-grow.js:
(assertEq):
* wasm/js-api/table.js:
(assert.throws):

Source/JavaScriptCore:

This change entails cleaning up and splitting a bunch of code which we had
intertwined between C++ classes which represent JS objects, and pure C++
implementation objects. This specific change goes most of the way towards
allowing JSC's WebAssembly to work without VM / JS, up to but excluding
JSWebAssemblyInstance (there's Wasm::Instance, but it's not *the* thing
yet). Because of this we still have a few FIXME identifying places that need to
change. A follow-up change will go the rest of the way.

I went about this change in the simplest way possible: grep the
JavaScriptCore/wasm directory for "JS[^C_]" as well as "VM" and exclude the /js/
sub-directory (which contains the JS implementation of WebAssembly).

None of this change removes the need for a JIT entitlement to be able to use
WebAssembly. We don't have an interpreter, the process therefore still needs to
be allowed to JIT to use these pure-C++ APIs.

Interesting things to note:

  - Remove VM from Plan and associated places. It can just live as a capture in
    the callback lambda if it's needed.
  - Wasm::Memory shouldn't require a VM. It was only used to ask the GC to
    collect. We now instead pass two lambdas at construction time for this
    purpose: one to notify of memory pressure, and the other to ask for
    syncrhonous memory reclamation. This allows whoever creates the memory to
    dictate how to react to both these cases, and for a JS embedding that's to
    call the GC (async or sync, respectively).
  - Move grow logic from JSWebAssemblyMemory to Wasm::Memory::grow. Use Expected
    there, with an enum class for failure types.
  - Exceeding max on memory growth now returns a range error as per spec. This
    is a (very minor) breaking change: it used to throw OOM error. Update the
    corresponding test.
  - When generating the grow_memory opcode, no need to get the VM. Instead,
    reach directly for Wasm::Memory and grow it.
  - JSWebAssemblyMemory::grow can now always throw on failure, because it's only
    ever called from JS (not from grow_memory as before).
  - Wasm::Memory now takes a callback for successful growth. This allows JS
    wrappers to register themselves when growth succeeds without Wasm::Memory
    knowning anything about JS. It'll also allow creating a list of callbacks
    for when we add thread support (we'll want to notify many wrappers, all
    under a lock).
  - Wasm::Memory is now back to being the source of truth about address / size,
    used directly by generated code instead of JSWebAssemblyMemory.
  - Move wasmToJS from the general WasmBinding header to its own header under
    wasm/js. It's only used by wasm/js/JSWebAssemblyCodeBlock.cpp, and uses VM,
    and therefore isn't general WebAssembly.
  - Make Wasm::Context an actual type (just a struct holding a
    JSWebAssemlyInstance for now) instead of an alias for that. Notably this
    doesn't add anything to the Context and doesn't change what actually gets
    passed around in JIT code (fast TLS or registers) because these changes
    potentially impact performance. The entire purpose of this change is to
    allow passing Wasm::Context around without having to know about VM. Since VM
    contains a Wasm::Context the JS embedding is effectively the same, but with
    this setup a non-JS embedding is much better off.
  - Move JSWebAssembly into the JS folder.
  - OMGPlan: use Wasm::CodeBlock directly instead of JSWebAssemblyCodeBlock.
  - wasm->JS stubs are now on the instance's tail as raw pointers, instead of
    being on JSWebAssemblyCodeBlock, and are now called wasm->Embedder
    stubs. The owned reference is still on JSWebAssemblyCodeBlock, and is still
    called wasm->JS stub. This move means that the embedder must, after creating
    a Wasm::CodeBlock, somehow create the stubs to call back into the
    embedder. This removes an indirection in the generated code because
    the B3 IR generator now reaches into the instance instead of
    JSWebAssemblyCodeBlock.
  - Move more CodeBlock things. Compilation completion is now marked by its own
    atomic<bool> flag instead of a nullptr plan: that required using a lock, and
    was causing a deadlock in stack-trace.js because before my changes
    JSWebAssemblyCodeBlock did its own completion checking separately from
    Wasm::CodeBlock, without getting the lock. Now that everything points to
    Wasm::CodeBlock and there's no cached completion marker, the lock was being
    acquired in a sanity-check assertion.
  - Embedder -> Wasm wrappers are now generated through a function that's passed
    in at compilation time, instead of being hard-coded as a JS -> Wasm wrapper.
  - WasmMemory doens't need to know about fault handling thunks. Only the IR
    generator should know, and should make sure that the exception throwing
    thunk is generated if any memory is present (note: with signal handling not
    all of them generate an exception check).
  - Make exception throwing pluggable: instead of having a hard-coded
    JS-specific lambda we now have a regular C++ function being called from JIT
    code when a WebAssembly exception is thrown. This allows any embedder to get
    called as they wish. For now a process can only have a single of these
    functions (i.e. only one embedder per process) because the trap handler is a
    singleton. That can be fixed in in #177475.
  - Create WasmEmbedder.h where all embedder plugging will live.
  - Split up JSWebAssemblyTable into Wasm::Table which is
    refcounted. JSWebAssemblyTable now only contains the JS functions in the
    table, and Wasm::Table is what's used by the JIT code to lookup where to
    call and do the instance check (for context switch). Note that this creates
    an extra allocation for all the instances in Wasm::Table, and in exchange
    removes an indirection in JIT code because the instance used to be obtained
    off of the JS function. Also note that it's the embedder than keeps the
    instances alive, not Wasm::Table (which holds a dumb pointer to the
    instance), because doing otherwise would cause reference cycles.
   - Add WasmInstance. It doesn't do much for now, owns globals.
   - JSWebAssembly instance now doesn't just contain the imported functions as
     JSObjects, it also has the corresponding import's instance and wasm
     entrypoint. This triples the space allocated per instance's imported
     function, but there shouldn't be that many imports. This has two upsides: it
     creates smaller and faster code, and makes is easier to disassociate
     embedder-specific things from embedder-neutral things. The small / faster
     win is in two places: B3 IR generator only needs offsetOfImportFunction for
     the call opcode (when the called index is an import) to know whether the
     import is wasm->wasm or wasm->embedder (this isn't known at compile-time
     because it's dependent on the import object), this is now done by seeing if
     that import function has an associated target instance (only wasm->wasm
     does); the other place is wasmBinding which uses offsetOfImportFunction to
     figure out the wasm->wasm target instance, and then gets
     WebAssemblyFunction::offsetOfWasmEntrypointLoadLocation to do a tail
     call. The disassociation comes because the target instance can be
     Wasm::Instance once we change what the Context is, and
     WasmEntrypointLoadLocation is already embedder-independent. As a next step I
     can move this tail allocation from JSWebAssemblyInstance to Wasm::Instance,
     and leave importFunction in as an opaque pointer which is embedder-specific,
     and in JS will remain WriteBarrier<JSObject>.
   - Rename VMEntryFrame to EntryFrame, and in many places pass a pointer to it
     around instead of VM. This is a first step in allowing entry frames which
     aren't stored on VM, but which are instead stored in an embedder-specific
     location. That change won't really affect JS except through code churn, but
     will allow WebAssembly to use some machinery in a generic manner without
     having a VM.

* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* bytecode/PolymorphicAccess.cpp:
(JSC::AccessGenerationState::emitExplicitExceptionHandler):
* debugger/Debugger.cpp:
(JSC::Debugger::stepOutOfFunction):
(JSC::Debugger::returnEvent):
(JSC::Debugger::unwindEvent):
(JSC::Debugger::didExecuteProgram):
* dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::compileExceptionHandlers):
* dfg/DFGOSREntry.cpp:
(JSC::DFG::prepareOSREntry):
* dfg/DFGOSRExit.cpp:
(JSC::DFG::OSRExit::compileOSRExit):
(JSC::DFG::OSRExit::compileExit):
* dfg/DFGThunks.cpp:
(JSC::DFG::osrEntryThunkGenerator):
* ftl/FTLCompile.cpp:
(JSC::FTL::compile):
* ftl/FTLLink.cpp:
(JSC::FTL::link):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::lower):
* ftl/FTLOSRExitCompiler.cpp:
(JSC::FTL::compileStub):
* interpreter/CallFrame.cpp:
(JSC::CallFrame::wasmAwareLexicalGlobalObject):
(JSC::CallFrame::callerFrame):
(JSC::CallFrame::unsafeCallerFrame):
* interpreter/CallFrame.h:
(JSC::ExecState::callerFrame const):
(JSC::ExecState::callerFrameOrEntryFrame const):
(JSC::ExecState::unsafeCallerFrameOrEntryFrame const):
* interpreter/FrameTracers.h:
(JSC::NativeCallFrameTracer::NativeCallFrameTracer):
(JSC::NativeCallFrameTracerWithRestore::NativeCallFrameTracerWithRestore):
(JSC::NativeCallFrameTracerWithRestore::~NativeCallFrameTracerWithRestore):
* interpreter/Interpreter.cpp:
(JSC::UnwindFunctor::operator() const):
(JSC::UnwindFunctor::copyCalleeSavesToEntryFrameCalleeSavesBuffer const):
(JSC::Interpreter::unwind):
* interpreter/StackVisitor.cpp:
(JSC::StackVisitor::StackVisitor):
(JSC::StackVisitor::gotoNextFrame):
(JSC::StackVisitor::readNonInlinedFrame):
(JSC::StackVisitor::Frame::dump const):
* interpreter/StackVisitor.h:
(JSC::StackVisitor::Frame::callerIsEntryFrame const):
* interpreter/VMEntryRecord.h:
(JSC::VMEntryRecord::prevTopEntryFrame):
(JSC::VMEntryRecord::unsafePrevTopEntryFrame):
(JSC::EntryFrame::vmEntryRecordOffset):
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::restoreCalleeSavesFromEntryFrameCalleeSavesBuffer):
(JSC::AssemblyHelpers::loadWasmContextInstance):
(JSC::AssemblyHelpers::storeWasmContextInstance):
(JSC::AssemblyHelpers::loadWasmContextInstanceNeedsMacroScratchRegister):
(JSC::AssemblyHelpers::storeWasmContextInstanceNeedsMacroScratchRegister):
(JSC::AssemblyHelpers::copyCalleeSavesToEntryFrameCalleeSavesBufferImpl):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::copyCalleeSavesToVMEntryFrameCalleeSavesBuffer):
(JSC::AssemblyHelpers::copyCalleeSavesToEntryFrameCalleeSavesBuffer):
(JSC::AssemblyHelpers::copyCalleeSavesFromFrameOrRegisterToEntryFrameCalleeSavesBuffer):
* jit/JIT.cpp:
(JSC::JIT::emitEnterOptimizationCheck):
(JSC::JIT::privateCompileExceptionHandlers):
* jit/JITExceptions.cpp:
(JSC::genericUnwind):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_throw):
(JSC::JIT::emit_op_catch):
(JSC::JIT::emitSlow_op_loop_hint):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_throw):
(JSC::JIT::emit_op_catch):
* jit/JITOperations.cpp:
* jit/ThunkGenerators.cpp:
(JSC::throwExceptionFromCallSlowPathGenerator):
(JSC::nativeForGenerator):
* jsc.cpp:
(functionDumpCallFrame):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* llint/LLIntThunks.cpp:
(JSC::vmEntryRecord):
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/Options.cpp:
(JSC::recomputeDependentOptions):
* runtime/Options.h:
* runtime/SamplingProfiler.cpp:
(JSC::FrameWalker::FrameWalker):
(JSC::FrameWalker::advanceToParentFrame):
(JSC::SamplingProfiler::processUnverifiedStackTraces):
* runtime/ThrowScope.cpp:
(JSC::ThrowScope::~ThrowScope):
* runtime/VM.cpp:
(JSC::VM::VM):
(JSC::VM::~VM):
* runtime/VM.h:
(JSC::VM::topEntryFrameOffset):
* runtime/VMTraps.cpp:
(JSC::isSaneFrame):
(JSC::VMTraps::tryInstallTrapBreakpoints):
(JSC::VMTraps::invalidateCodeBlocksOnStack):
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::restoreWasmContextInstance):
(JSC::Wasm::B3IRGenerator::B3IRGenerator):
(JSC::Wasm::B3IRGenerator::restoreWebAssemblyGlobalState):
(JSC::Wasm::B3IRGenerator::addGrowMemory):
(JSC::Wasm::B3IRGenerator::addCurrentMemory):
(JSC::Wasm::B3IRGenerator::addCall):
(JSC::Wasm::B3IRGenerator::addCallIndirect):
(JSC::Wasm::parseAndCompile):
* wasm/WasmB3IRGenerator.h:
* wasm/WasmBBQPlan.cpp:
(JSC::Wasm::BBQPlan::BBQPlan):
(JSC::Wasm::BBQPlan::compileFunctions):
(JSC::Wasm::BBQPlan::complete):
* wasm/WasmBBQPlan.h:
* wasm/WasmBBQPlanInlines.h:
(JSC::Wasm::BBQPlan::initializeCallees):
* wasm/WasmBinding.cpp:
(JSC::Wasm::wasmToWasm):
* wasm/WasmBinding.h:
* wasm/WasmCodeBlock.cpp:
(JSC::Wasm::CodeBlock::create):
(JSC::Wasm::CodeBlock::CodeBlock):
(JSC::Wasm::CodeBlock::compileAsync):
(JSC::Wasm::CodeBlock::setCompilationFinished):
* wasm/WasmCodeBlock.h:
(JSC::Wasm::CodeBlock::offsetOfImportStubs):
(JSC::Wasm::CodeBlock::allocationSize):
(JSC::Wasm::CodeBlock::importWasmToEmbedderStub):
(JSC::Wasm::CodeBlock::offsetOfImportWasmToEmbedderStub):
(JSC::Wasm::CodeBlock::wasmToJSCallStubForImport):
(JSC::Wasm::CodeBlock::compilationFinished):
(JSC::Wasm::CodeBlock::jsEntrypointCalleeFromFunctionIndexSpace):
(JSC::Wasm::CodeBlock::wasmEntrypointCalleeFromFunctionIndexSpace):
* wasm/WasmContext.cpp:
(JSC::Wasm::Context::useFastTLS):
(JSC::Wasm::Context::load const):
(JSC::Wasm::Context::store):
* wasm/WasmContext.h:
* wasm/WasmEmbedder.h: Copied from Source/JavaScriptCore/wasm/WasmContext.h.
* wasm/WasmFaultSignalHandler.cpp:
* wasm/WasmFaultSignalHandler.h:
* wasm/WasmFormat.h:
* wasm/WasmInstance.cpp: Copied from Source/JavaScriptCore/wasm/WasmFaultSignalHandler.h.
(JSC::Wasm::Instance::Instance):
(JSC::Wasm::Instance::~Instance):
(JSC::Wasm::Instance::extraMemoryAllocated const):
* wasm/WasmInstance.h: Added.
(JSC::Wasm::Instance::create):
(JSC::Wasm::Instance::finalizeCreation):
(JSC::Wasm::Instance::module):
(JSC::Wasm::Instance::codeBlock):
(JSC::Wasm::Instance::memory):
(JSC::Wasm::Instance::table):
(JSC::Wasm::Instance::loadI32Global const):
(JSC::Wasm::Instance::loadI64Global const):
(JSC::Wasm::Instance::loadF32Global const):
(JSC::Wasm::Instance::loadF64Global const):
(JSC::Wasm::Instance::setGlobal):
(JSC::Wasm::Instance::offsetOfCachedStackLimit):
(JSC::Wasm::Instance::cachedStackLimit const):
(JSC::Wasm::Instance::setCachedStackLimit):
* wasm/WasmMemory.cpp:
(JSC::Wasm::Memory::Memory):
(JSC::Wasm::Memory::create):
(JSC::Wasm::Memory::~Memory):
(JSC::Wasm::Memory::grow):
* wasm/WasmMemory.h:
(JSC::Wasm::Memory::offsetOfMemory):
(JSC::Wasm::Memory::offsetOfSize):
* wasm/WasmMemoryInformation.cpp:
(JSC::Wasm::PinnedRegisterInfo::get):
(JSC::Wasm::PinnedRegisterInfo::PinnedRegisterInfo):
* wasm/WasmMemoryInformation.h:
(JSC::Wasm::PinnedRegisterInfo::toSave const):
* wasm/WasmMemoryMode.cpp: Copied from Source/JavaScriptCore/wasm/WasmFaultSignalHandler.h.
(JSC::Wasm::makeString):
* wasm/WasmMemoryMode.h: Copied from Source/JavaScriptCore/wasm/WasmFaultSignalHandler.h.
* wasm/WasmModule.cpp:
(JSC::Wasm::makeValidationCallback):
(JSC::Wasm::Module::validateSync):
(JSC::Wasm::Module::validateAsync):
(JSC::Wasm::Module::getOrCreateCodeBlock):
(JSC::Wasm::Module::compileSync):
(JSC::Wasm::Module::compileAsync):
* wasm/WasmModule.h:
* wasm/WasmModuleParser.cpp:
(JSC::Wasm::ModuleParser::parseTableHelper):
* wasm/WasmOMGPlan.cpp:
(JSC::Wasm::OMGPlan::OMGPlan):
(JSC::Wasm::OMGPlan::runForIndex):
* wasm/WasmOMGPlan.h:
* wasm/WasmPageCount.h:
(JSC::Wasm::PageCount::isValid const):
* wasm/WasmPlan.cpp:
(JSC::Wasm::Plan::Plan):
(JSC::Wasm::Plan::runCompletionTasks):
(JSC::Wasm::Plan::addCompletionTask):
(JSC::Wasm::Plan::tryRemoveContextAndCancelIfLast):
* wasm/WasmPlan.h:
(JSC::Wasm::Plan::dontFinalize):
* wasm/WasmSignature.cpp:
* wasm/WasmSignature.h:
* wasm/WasmTable.cpp: Added.
(JSC::Wasm::Table::create):
(JSC::Wasm::Table::~Table):
(JSC::Wasm::Table::Table):
(JSC::Wasm::Table::grow):
(JSC::Wasm::Table::clearFunction):
(JSC::Wasm::Table::setFunction):
* wasm/WasmTable.h: Copied from Source/JavaScriptCore/wasm/js/JSWebAssemblyTable.h.
(JSC::Wasm::Table::maximum const):
(JSC::Wasm::Table::size const):
(JSC::Wasm::Table::offsetOfSize):
(JSC::Wasm::Table::offsetOfFunctions):
(JSC::Wasm::Table::offsetOfInstances):
(JSC::Wasm::Table::isValidSize):
* wasm/WasmThunks.cpp:
(JSC::Wasm::throwExceptionFromWasmThunkGenerator):
(JSC::Wasm::triggerOMGTierUpThunkGenerator):
(JSC::Wasm::Thunks::setThrowWasmException):
(JSC::Wasm::Thunks::throwWasmException):
* wasm/WasmThunks.h:
* wasm/WasmWorklist.cpp:
(JSC::Wasm::Worklist::stopAllPlansForContext):
* wasm/WasmWorklist.h:
* wasm/js/JSToWasm.cpp: Added.
(JSC::Wasm::createJSToWasmWrapper):
* wasm/js/JSToWasm.h: Copied from Source/JavaScriptCore/wasm/WasmBinding.h.
* wasm/js/JSWebAssembly.cpp: Renamed from Source/JavaScriptCore/wasm/JSWebAssembly.cpp.
* wasm/js/JSWebAssembly.h: Renamed from Source/JavaScriptCore/wasm/JSWebAssembly.h.
* wasm/js/JSWebAssemblyCodeBlock.cpp:
(JSC::JSWebAssemblyCodeBlock::create):
(JSC::JSWebAssemblyCodeBlock::JSWebAssemblyCodeBlock):
* wasm/js/JSWebAssemblyCodeBlock.h:
* wasm/js/JSWebAssemblyInstance.cpp:
(JSC::JSWebAssemblyInstance::JSWebAssemblyInstance):
(JSC::JSWebAssemblyInstance::finishCreation):
(JSC::JSWebAssemblyInstance::visitChildren):
(JSC::JSWebAssemblyInstance::finalizeCreation):
(JSC::JSWebAssemblyInstance::create):
* wasm/js/JSWebAssemblyInstance.h:
(JSC::JSWebAssemblyInstance::instance):
(JSC::JSWebAssemblyInstance::context const):
(JSC::JSWebAssemblyInstance::table):
(JSC::JSWebAssemblyInstance::webAssemblyToJSCallee):
(JSC::JSWebAssemblyInstance::setMemory):
(JSC::JSWebAssemblyInstance::offsetOfTail):
(JSC::JSWebAssemblyInstance::importFunctionInfo):
(JSC::JSWebAssemblyInstance::offsetOfTargetInstance):
(JSC::JSWebAssemblyInstance::offsetOfWasmEntrypoint):
(JSC::JSWebAssemblyInstance::offsetOfImportFunction):
(JSC::JSWebAssemblyInstance::importFunction):
(JSC::JSWebAssemblyInstance::internalMemory):
(JSC::JSWebAssemblyInstance::wasmCodeBlock const):
(JSC::JSWebAssemblyInstance::offsetOfWasmTable):
(JSC::JSWebAssemblyInstance::offsetOfCallee):
(JSC::JSWebAssemblyInstance::offsetOfGlobals):
(JSC::JSWebAssemblyInstance::offsetOfWasmCodeBlock):
(JSC::JSWebAssemblyInstance::offsetOfWasmMemory):
(JSC::JSWebAssemblyInstance::cachedStackLimit const):
(JSC::JSWebAssemblyInstance::setCachedStackLimit):
(JSC::JSWebAssemblyInstance::wasmMemory):
(JSC::JSWebAssemblyInstance::wasmModule):
(JSC::JSWebAssemblyInstance::allocationSize):
(JSC::JSWebAssemblyInstance::module const):
* wasm/js/JSWebAssemblyMemory.cpp:
(JSC::JSWebAssemblyMemory::create):
(JSC::JSWebAssemblyMemory::adopt):
(JSC::JSWebAssemblyMemory::JSWebAssemblyMemory):
(JSC::JSWebAssemblyMemory::grow):
(JSC::JSWebAssemblyMemory::growSuccessCallback):
* wasm/js/JSWebAssemblyMemory.h:
* wasm/js/JSWebAssemblyModule.cpp:
(JSC::JSWebAssemblyModule::moduleInformation const):
(JSC::JSWebAssemblyModule::exportSymbolTable const):
(JSC::JSWebAssemblyModule::signatureIndexFromFunctionIndexSpace const):
(JSC::JSWebAssemblyModule::callee const):
(JSC::JSWebAssemblyModule::codeBlock):
(JSC::JSWebAssemblyModule::module):
* wasm/js/JSWebAssemblyModule.h:
* wasm/js/JSWebAssemblyTable.cpp:
(JSC::JSWebAssemblyTable::create):
(JSC::JSWebAssemblyTable::JSWebAssemblyTable):
(JSC::JSWebAssemblyTable::visitChildren):
(JSC::JSWebAssemblyTable::grow):
(JSC::JSWebAssemblyTable::getFunction):
(JSC::JSWebAssemblyTable::clearFunction):
(JSC::JSWebAssemblyTable::setFunction):
* wasm/js/JSWebAssemblyTable.h:
(JSC::JSWebAssemblyTable::isValidSize):
(JSC::JSWebAssemblyTable::maximum const):
(JSC::JSWebAssemblyTable::size const):
(JSC::JSWebAssemblyTable::table):
* wasm/js/WasmToJS.cpp: Copied from Source/JavaScriptCore/wasm/WasmBinding.cpp.
(JSC::Wasm::materializeImportJSCell):
(JSC::Wasm::wasmToJS):
(JSC::Wasm::wasmToJSException):
* wasm/js/WasmToJS.h: Copied from Source/JavaScriptCore/wasm/WasmBinding.h.
* wasm/js/WebAssemblyFunction.cpp:
(JSC::callWebAssemblyFunction):
* wasm/js/WebAssemblyInstanceConstructor.cpp:
(JSC::constructJSWebAssemblyInstance):
* wasm/js/WebAssemblyMemoryConstructor.cpp:
(JSC::constructJSWebAssemblyMemory):
* wasm/js/WebAssemblyMemoryPrototype.cpp:
(JSC::webAssemblyMemoryProtoFuncGrow):
* wasm/js/WebAssemblyModuleConstructor.cpp:
(JSC::constructJSWebAssemblyModule):
(JSC::WebAssemblyModuleConstructor::createModule):
* wasm/js/WebAssemblyModuleConstructor.h:
* wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::WebAssemblyModuleRecord::link):
(JSC::WebAssemblyModuleRecord::evaluate):
* wasm/js/WebAssemblyPrototype.cpp:
(JSC::webAssemblyCompileFunc):
(JSC::instantiate):
(JSC::compileAndInstantiate):
(JSC::webAssemblyValidateFunc):
* wasm/js/WebAssemblyTableConstructor.cpp:
(JSC::constructJSWebAssemblyTable):
* wasm/js/WebAssemblyWrapperFunction.cpp:
(JSC::WebAssemblyWrapperFunction::create):

Source/WebCore:

* ForwardingHeaders/wasm/WasmModule.h: Added. This used to be
included in JSWebAssemblyModule.h.
* bindings/js/SerializedScriptValue.cpp: Update postMessage code
according to C++ API changes.

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

2 years agoModernize authentication challenge handling in WebKit
achristensen@apple.com [Fri, 20 Oct 2017 02:17:46 +0000 (02:17 +0000)]
Modernize authentication challenge handling in WebKit
https://bugs.webkit.org/show_bug.cgi?id=178555

Reviewed by Tim Horton.

* UIProcess/API/APILoaderClient.h:
(API::LoaderClient::didReceiveAuthenticationChallengeInFrame):
* UIProcess/API/APINavigationClient.h:
(API::NavigationClient::didReceiveAuthenticationChallenge):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageLoaderClient):
(WKPageSetPageNavigationClient):
* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::canAuthenticateAgainstProtectionSpace):
(WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didReceiveAuthenticationChallengeProxy):

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

2 years agoUnreviewed localized strings update.
joepeck@webkit.org [Fri, 20 Oct 2017 02:12:44 +0000 (02:12 +0000)]
Unreviewed localized strings update.

* Localizations/en.lproj/localizedStrings.js:
Add missing string after r223735.

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

2 years agoWeb Inspector: Network Tab: Metrics Detail View
joepeck@webkit.org [Fri, 20 Oct 2017 02:11:31 +0000 (02:11 +0000)]
Web Inspector: Network Tab: Metrics Detail View
https://bugs.webkit.org/show_bug.cgi?id=178323
<rdar://problem/34071929>

Reviewed by Devin Rousso.

Provide a Metrics detail view for resources in the Network tab.
This detail view shows:

  - Transfer Size information (Header + Body bytes)
  - Resource Size information (Compression, MIME)
  - Timing information (ResourceTiming, Waterfall breakdown)

The display of timing information isn't quite final. But this
is a good starting point for all the information.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Main.html:
New resources and strings.

* UserInterface/Base/MIMETypeUtilities.js:
(WI.shouldTreatMIMETypeAsText):
Helper for detecting text resources.

* UserInterface/Images/Receiving.svg: Added.
* UserInterface/Images/Sending.svg: Added.
* UserInterface/Images/gtk/Receiving.svg: Added.
* UserInterface/Images/gtk/Sending.svg: Added.
Same images for main and linux ports with different licenses.

* UserInterface/Views/NetworkResourceDetailView.js:
(WI.NetworkResourceDetailView):
(WI.NetworkResourceDetailView.prototype.metricsContentViewGoToHeaders):
(WI.NetworkResourceDetailView.prototype.metricsContentViewGoToRequestBody):
(WI.NetworkResourceDetailView.prototype.metricsContentViewGoToResponseBody):
(WI.NetworkResourceDetailView.prototype.initialLayout):
(WI.NetworkResourceDetailView.prototype._showPreferredContentView):
(WI.NetworkResourceDetailView.prototype._showContentViewForNavigationItem):
Replace "Timing" and "Details" stubs with a single "Metrics" section.
Handle delegate cases from the Metrics content view.

* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView.displayNameForResource):
(WI.NetworkTableContentView.prototype._displayType): Deleted.
(WI.NetworkTableContentView.prototype._entryForResource):
Promote this to a static helper in case anyone else wants it.

(WI.NetworkTableContentView.prototype.closed):
(WI.NetworkTableContentView.prototype.reset):
(WI.NetworkTableContentView.prototype.networkResourceDetailViewClose):
Reorder code a bit to reduce work since hiding the detail view currently
forces a layout.

* UserInterface/Views/ResourceHeadersContentView.js:
(WI.ResourceHeadersContentView):
(WI.ResourceHeadersContentView.prototype._refreshRequestDataSection):
(WI.ResourceHeadersContentView.prototype._resourceResponseReceived):
(WI.ResourceHeadersContentView.prototype._goToRequestDataClicked): Deleted.
Simplify by making the delegate required.

* UserInterface/Views/ResourceMetricsContentView.css: Added.
(.resource-metrics):
(.resource-metrics > .content):
(.resource-metrics > .content .label):
General metrics styles.

(.resource-metrics > .content > section):
(.resource-metrics > .content > section .subtitle):
(.resource-metrics > .content > section:not(:last-of-type)):
(.resource-metrics > .content > section.split):
(.resource-metrics > .content > section.split > .subsection):
(.resource-metrics > .content > section.split > .subsection > table):
(.resource-metrics > .content > section.split > .divider):
(.resource-metrics > .content > section.network > .subsection > .container):
(.resource-metrics > .content > section.network .bytes-group):
(.resource-metrics > .content > section.network .bytes):
(body[dir=ltr] .resource-metrics > .content > section.network table > tr > td.label):
(body[dir=rtl] .resource-metrics > .content > section.network table > tr > td.label):
(.resource-metrics > .content > section.network .suffix):
(.resource-metrics > .content > section.network img):
(.resource-metrics > .content > section.network .go-to-arrow):
(.resource-metrics > .content > section.network .warning):
Styles for Sizes sections.

(.resource-metrics > .content > section.timing):
(.resource-metrics > .content > section.timing .subtitle):
(.resource-metrics > .content > section.timing > ul):
(.resource-metrics > .content > section.timing > ul > li):
(.resource-metrics > .content > section.timing > .waterfall):
(.resource-metrics > .content > section.timing > .waterfall .block):
(.resource-metrics > .content > section.timing > ul > li > .row-label):
(body[dir=ltr] .resource-metrics > .content > section.timing > ul > li > .row-label):
(body[dir=rtl] .resource-metrics > .content > section.timing > ul > li > .row-label):
(.resource-metrics > .content > section.timing > ul > li > .time-label):
(.resource-metrics > .content > section.timing > ul > li.total .block):
(.resource-metrics > .content > section.timing > ul > li.total .time-label):
(.resource-metrics > .content > section.timing .indeterminate-progress-spinner):
(.resource-metrics > .content > section.timing .empty):
Styles for Timing section.

* UserInterface/Views/ResourceMetricsContentView.js: Added.
(WI.ResourceMetricsContentView):
(WI.ResourceMetricsContentView.prototype.initialLayout.createSizeComponents):
(WI.ResourceMetricsContentView.prototype.initialLayout):
(WI.ResourceMetricsContentView.prototype.layout):
(WI.ResourceMetricsContentView.prototype.closed):
(WI.ResourceMetricsContentView.prototype._sizeComponents):
(WI.ResourceMetricsContentView.prototype._refreshTransferSizeSections.appendGoToArrow):
(WI.ResourceMetricsContentView.prototype._refreshTransferSizeSections):
(WI.ResourceMetricsContentView.prototype._refreshResourceSizeSection):
(WI.ResourceMetricsContentView.prototype._refreshTimingSection.createBlock):
(WI.ResourceMetricsContentView.prototype._refreshTimingSection.createTimeLabel):
(WI.ResourceMetricsContentView.prototype._refreshTimingSection.createRow):
(WI.ResourceMetricsContentView.prototype._refreshTimingSection):
(WI.ResourceMetricsContentView.prototype._resourceSizeDidChange):
(WI.ResourceMetricsContentView.prototype._resourceTransferSizeDidChange):
(WI.ResourceMetricsContentView.prototype._resourceMetricsDidChange):
(WI.ResourceMetricsContentView.prototype._resourceTimestampsDidChange):
Metrics content. This just creates all of the elements, and saves a
few to get populated with data later on.

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

2 years agoWeb Inspector: Network Tab - Improve graphical representation of network waterfall
joepeck@webkit.org [Fri, 20 Oct 2017 02:11:27 +0000 (02:11 +0000)]
Web Inspector: Network Tab - Improve graphical representation of network waterfall
https://bugs.webkit.org/show_bug.cgi?id=147897
<rdar://problem/27482198>

Reviewed by Brian Burg.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Main.html:
New strings and resources.

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

* UserInterface/Views/NetworkTableContentView.css:
(.network-table .header .cell.waterfall):
(.network-table .timeline-ruler):
(.network-table .timeline-ruler > .header):
Styles for having a TimelineRuler in the Waterfall's table header.

(.network-table :not(.header) .cell.waterfall):
(.network-table :not(.header) .cell.waterfall .waterfall-container):
(.waterfall .block):
(.waterfall .block.request,):
(.waterfall .block.mouse):
(.waterfall .block.queue):
(.waterfall .block.dns):
(.waterfall .block.connect):
(.waterfall .block.secure):
(.waterfall .block.request):
(.waterfall .block.response):
Waterfall styles inside the Network Table.

* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView):
(WI.NetworkTableContentView.prototype.reset):
(WI.NetworkTableContentView.prototype.tablePopulateCell):
(WI.NetworkTableContentView.prototype.initialLayout):
(WI.NetworkTableContentView.prototype._updateWaterfallTimelineRuler):
(WI.NetworkTableContentView.prototype._updateEntryForResource):
(WI.NetworkTableContentView.prototype._resourceLoadingDidFinish):
(WI.NetworkTableContentView.prototype._resourceLoadingDidFail):
(WI.NetworkTableContentView.prototype._networkTimelineRecordAdded):
(WI.NetworkTableContentView.prototype._tableWaterfallColumnDidChangeWidth):
Update the TimelineRuler and Waterfall column when the column's
size changes or the time bounds change. The time bounds right now
are the earliest and latest time of resources. Later we hope to
bound this by a timeline selection.

(WI.NetworkTableContentView.prototype._waterfallPopoverContentForResource):
(WI.NetworkTableContentView.prototype._handleMousedownWaterfall):
(WI.NetworkTableContentView.prototype._populateWaterfallGraph.appendBlock):
(WI.NetworkTableContentView.prototype._populateWaterfallGraph):
(WI.NetworkTableContentView.prototype._hidePopover):
Create and manage a popover for the waterfall column.

* UserInterface/Views/Popover.js:
(WI.Popover):
(WI.Popover.prototype.get element):
(WI.Popover.prototype.get visible):
(WI.Popover.prototype.get backgroundStyle):
(WI.Popover.prototype.set backgroundStyle):
(WI.Popover.prototype._drawBackground):
Provide an option to have a white background popover.

* UserInterface/Views/ResourceTimingBreakdownView.css: Added.
(.resource-timing-breakdown):
(.resource-timing-breakdown .waterfall):
(.resource-timing-breakdown .waterfall .block):
(.resource-timing-breakdown .waterfall .block.request):
(body[dir=ltr] .resource-timing-breakdown .waterfall .block.queue,):
(body[dir=ltr] .resource-timing-breakdown .waterfall .block.response):
(body[dir=rtl] .resource-timing-breakdown .waterfall .block.queue,):
(body[dir=rtl] .resource-timing-breakdown .waterfall .block.response):
(.resource-timing-breakdown .numbers):
(body[dir=ltr] .resource-timing-breakdown .numbers):
(body[dir=rtl] .resource-timing-breakdown .numbers):
Waterfall styles and sizes in the popover's breakdown view.

(.resource-timing-breakdown .numbers > p):
(.resource-timing-breakdown .numbers > p > .swatch):
(.resource-timing-breakdown .numbers .swatch.queue):
(.resource-timing-breakdown .numbers .swatch.dns):
(.resource-timing-breakdown .numbers .swatch.connect):
(.resource-timing-breakdown .numbers .swatch.secure):
(.resource-timing-breakdown .numbers .swatch.request):
(.resource-timing-breakdown .numbers .swatch.response):
(.resource-timing-breakdown .numbers > p > .label):
(.resource-timing-breakdown .numbers > p.total):
Number and label styles in the popover's breakdown view.

* UserInterface/Views/ResourceTimingBreakdownView.js: Added.
(WI.ResourceTimingBreakdownView):
(WI.ResourceTimingBreakdownView.prototype.initialLayout):
(WI.ResourceTimingBreakdownView.prototype.initialLayout.appendBlock):
(WI.ResourceTimingBreakdownView.prototype.initialLayout.appendRow):
Show a section for a waterfall visualization and a section for the numbers.

* UserInterface/Views/Table.js:
(WI.Table.prototype.reloadVisibleColumnCells):
(WI.Table.prototype.cellForRowAndColumn):
(WI.Table.prototype.addColumn):
(WI.Table.prototype.showColumn):
(WI.Table.prototype.hideColumn):
(WI.Table.prototype.resizerDragging):
(WI.Table.prototype.resizerDragEnded):
(WI.Table.prototype._resizeColumnsAndFiller):
(WI.Table.prototype._applyColumnWidths):
(WI.Table.prototype._positionHeaderViews):
* UserInterface/Views/TableColumn.js:
(WI.TableColumn.prototype.get headerView):
Provide a way to include a WI.View with a TableColumn Header. This
matches what we do with DataGrid, and ends up being pretty concise.

* UserInterface/Views/TimelineRuler.css:
(.timeline-ruler > .header):
Make the height a variable so that other code can work off of it.

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

2 years ago-Wsign-compare triggered by MallocBench
mcatanzaro@igalia.com [Fri, 20 Oct 2017 01:47:57 +0000 (01:47 +0000)]
-Wsign-compare triggered by MallocBench
https://bugs.webkit.org/show_bug.cgi?id=178544

Reviewed by Ryosuke Niwa.

* MallocBench/MallocBench/Interpreter.cpp:
(Interpreter::Interpreter):

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

2 years agoSerializedScriptValue passed to postMessage() cannot be null
cdumez@apple.com [Fri, 20 Oct 2017 01:34:03 +0000 (01:34 +0000)]
SerializedScriptValue passed to postMessage() cannot be null
https://bugs.webkit.org/show_bug.cgi?id=178550

Reviewed by Youenn Fablet.

SerializedScriptValue passed to postMessage() cannot be null. Therefore, we
should use Ref<> type, not RefPtr<>.

* dom/MessagePortChannel.h:
* dom/default/PlatformMessagePortChannel.cpp:
(WebCore::MessagePortChannel::postMessageToRemote):
* workers/WorkerGlobalScopeProxy.h:
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::postMessageToWorkerObject):
(WebCore::WorkerMessagingProxy::postMessageToWorkerGlobalScope):
* workers/WorkerMessagingProxy.h:
* workers/WorkerObjectProxy.h:
* workers/service/context/ServiceWorkerThread.cpp:

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

2 years agoStringifier::appendStringifiedValue() is missing an exception check.
mark.lam@apple.com [Fri, 20 Oct 2017 00:47:04 +0000 (00:47 +0000)]
Stringifier::appendStringifiedValue() is missing an exception check.
https://bugs.webkit.org/show_bug.cgi?id=178386
<rdar://problem/35027610>

Reviewed by Saam Barati.

JSTests:

* stress/regress-178386.js: Added.

Source/JavaScriptCore:

* runtime/JSONObject.cpp:
(JSC::Stringifier::appendStringifiedValue):

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

2 years agoModernize API::DownloadClient
achristensen@apple.com [Fri, 20 Oct 2017 00:09:38 +0000 (00:09 +0000)]
Modernize API::DownloadClient
https://bugs.webkit.org/show_bug.cgi?id=178547

Reviewed by Andy Estes.

Use more C++ references instead of pointers because they're never null.

Remove canAuthenticateAgainstProtectionSpace because there are no implementations
except the default implementation which always returns true and we don't intend to
add this to the SPI because that's just a legacy call anyways from when NSURLConnection
hadn't fully evolved, and we're moving away from NSURLConnection, especially in our API design.

Separate the NetworkSession-only and pre-NetworkSession-only callbacks.  All the synchronous
IPC messages are only used in the pre-NetworkSession code, so once we remove it we can remove them!

Make API::DownloadClient calls that NetworkSession uses use a completion handler so we will be able to
design an asynchronous API.

* NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::continueCanAuthenticateAgainstProtectionSpace): Deleted.
* NetworkProcess/Downloads/DownloadManager.h:
* NetworkProcess/Downloads/PendingDownload.cpp:
(WebKit::PendingDownload::canAuthenticateAgainstProtectionSpaceAsync):
(WebKit::PendingDownload::continueCanAuthenticateAgainstProtectionSpace): Deleted.
* NetworkProcess/Downloads/PendingDownload.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpaceDownload): Deleted.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* UIProcess/API/APIDownloadClient.h:
(API::DownloadClient::didStart):
(API::DownloadClient::didReceiveAuthenticationChallenge):
(API::DownloadClient::didReceiveResponse):
(API::DownloadClient::didReceiveData):
(API::DownloadClient::shouldDecodeSourceDataOfMIMEType):
(API::DownloadClient::decideDestinationWithSuggestedFilename):
(API::DownloadClient::didCreateDestination):
(API::DownloadClient::didFinish):
(API::DownloadClient::didFail):
(API::DownloadClient::didCancel):
(API::DownloadClient::processDidCrash):
(API::DownloadClient::willSendRequest):
(API::DownloadClient::canAuthenticateAgainstProtectionSpace): Deleted.
* UIProcess/API/C/WKContext.cpp:
(WKContextSetDownloadClient):
* UIProcess/API/glib/WebKitDownloadClient.cpp:
* UIProcess/Cocoa/DownloadClient.h:
* UIProcess/Cocoa/DownloadClient.mm:
(WebKit::DownloadClient::didStart):
(WebKit::DownloadClient::didReceiveResponse):
(WebKit::DownloadClient::didReceiveData):
(WebKit::DownloadClient::decideDestinationWithSuggestedFilename):
(WebKit::DownloadClient::didFinish):
(WebKit::DownloadClient::didFail):
(WebKit::DownloadClient::didCancel):
(WebKit::DownloadClient::willSendRequest):
* UIProcess/Downloads/DownloadProxy.cpp:
(WebKit::DownloadProxy::processDidClose):
(WebKit::DownloadProxy::didStart):
(WebKit::DownloadProxy::didReceiveAuthenticationChallenge):
(WebKit::DownloadProxy::willSendRequest):
(WebKit::DownloadProxy::didReceiveResponse):
(WebKit::DownloadProxy::didReceiveData):
(WebKit::DownloadProxy::shouldDecodeSourceDataOfMIMEType):
(WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync):
(WebKit::DownloadProxy::decideDestinationWithSuggestedFilename):
(WebKit::DownloadProxy::didCreateDestination):
(WebKit::DownloadProxy::didFinish):
(WebKit::DownloadProxy::didFail):
(WebKit::DownloadProxy::didCancel):
(WebKit::DownloadProxy::canAuthenticateAgainstProtectionSpace): Deleted.
* UIProcess/Downloads/DownloadProxy.h:
* UIProcess/Downloads/DownloadProxy.messages.in:

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

2 years agoREGRESSION(r223691): DFGByteCodeParser.cpp:1483:83: warning: comparison is always...
sbarati@apple.com [Thu, 19 Oct 2017 23:49:23 +0000 (23:49 +0000)]
REGRESSION(r223691): DFGByteCodeParser.cpp:1483:83: warning: comparison is always false due to limited range of data type [-Wtype-limits]
https://bugs.webkit.org/show_bug.cgi?id=178543

Reviewed by Filip Pizlo.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleRecursiveTailCall):

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

2 years agoUse "= default" to denote default constructor or destructor
dbates@webkit.org [Thu, 19 Oct 2017 23:48:45 +0000 (23:48 +0000)]
Use "= default" to denote default constructor or destructor
https://bugs.webkit.org/show_bug.cgi?id=178528

Rubber-stamped by Andy Estes.

Source/WebCore:

* Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.h:
* Modules/applepay/ApplePayError.cpp:
* Modules/applepay/ApplePayPaymentAuthorizedEvent.cpp:
* Modules/applepay/ApplePayPaymentMethodSelectedEvent.cpp:
* Modules/applepay/ApplePaySession.cpp:
* Modules/applepay/ApplePaySessionPaymentRequest.cpp:
* Modules/applepay/ApplePayShippingContactSelectedEvent.cpp:
* Modules/applepay/ApplePayShippingMethodSelectedEvent.cpp:
* Modules/applepay/ApplePayValidateMerchantEvent.cpp:
* Modules/applepay/Payment.h:
* Modules/applepay/PaymentCoordinatorClient.h:
* Modules/credentials/BasicCredential.cpp:
* Modules/credentials/FederatedCredential.cpp:
* Modules/credentials/NavigatorCredentials.cpp:
* Modules/credentials/PasswordCredential.cpp:
* Modules/encryptedmedia/CDMClient.h:
* Modules/encryptedmedia/legacy/LegacyCDM.cpp:
* Modules/encryptedmedia/legacy/LegacyCDM.h:
* Modules/encryptedmedia/legacy/LegacyCDMPrivate.h:
* Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.h:
* Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.h:
* Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
* Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.cpp:
* Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.cpp:
* Modules/entriesapi/DOMFileSystem.cpp:
* Modules/entriesapi/FileSystemDirectoryReader.cpp:
* Modules/entriesapi/FileSystemEntry.cpp:
* Modules/fetch/FetchLoaderClient.h:
* Modules/gamepad/Gamepad.cpp:
* Modules/gamepad/GamepadEvent.h:
* Modules/gamepad/deprecated/Gamepad.cpp:
[ truncated ]

Source/WebCore/PAL:

* pal/Logger.h:
(PAL::Logger::Observer::~Observer): Deleted.
* pal/crypto/gcrypt/CryptoDigestGCrypt.cpp:
* pal/system/SleepDisabler.cpp:
* pal/system/SystemSleepListener.h:

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

2 years agore-inline ObjectAllocationProfile::initializeProfile
sbarati@apple.com [Thu, 19 Oct 2017 23:34:20 +0000 (23:34 +0000)]
re-inline ObjectAllocationProfile::initializeProfile
https://bugs.webkit.org/show_bug.cgi?id=178532

Rubber stamped by Michael Saboff.

I un-inlined this function when implementing poly proto.
This patch re-inlines it. In my testing, it looks like it
might be a 0.5% speedometer progression to inline it.

* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* bytecode/CodeBlock.cpp:
* bytecode/ObjectAllocationProfile.cpp: Removed.
* bytecode/ObjectAllocationProfileInlines.h: Copied from Source/JavaScriptCore/bytecode/ObjectAllocationProfile.cpp.
(JSC::ObjectAllocationProfile::initializeProfile):
(JSC::ObjectAllocationProfile::possibleDefaultPropertyCount):
* runtime/FunctionRareData.cpp:

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

2 years agoAX: Provide a way for Accessibility to cache the selection while retrieving rects...
n_wang@apple.com [Thu, 19 Oct 2017 23:34:16 +0000 (23:34 +0000)]
AX: Provide a way for Accessibility to cache the selection while retrieving rects for speak selection
https://bugs.webkit.org/show_bug.cgi?id=176247
<rdar://problem/34217143>

Reviewed by Ryosuke Niwa.

Source/WebKit:

When getting the rects for highlighting the spoken text within a selection range on iOS, we can get a
list of totally wrong rects if the user changed the selection to some other text. This is because the
calculation is based on the current selection range. Therefore, we need to provide a way for accessibility
codepath to store the selection during a speaking session.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _accessibilityStoreSelection]):
(-[WKWebView _accessibilityClearSelection]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _accessibilityStoreSelection]):
(-[WKContentView _accessibilityClearSelection]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::storeSelectionForAccessibility):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getRectsForGranularityWithSelectionOffset):
(WebKit::WebPage::storeSelectionForAccessibility):
(WebKit::WebPage::getRectsAtSelectionOffsetWithText):

Tools:

* TestWebKitAPI/Tests/ios/AccessibilityTestsIOS.mm:
(TestWebKitAPI::TEST):

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