WebKit-https.git
23 months agoUpdate TestExpectations for slow WPT encoding LayoutTests.
ryanhaddad@apple.com [Tue, 7 Nov 2017 23:21:38 +0000 (23:21 +0000)]
Update TestExpectations for slow  WPT encoding LayoutTests.

Unreviewed test gardening.

Mark some of the tests as slow on Debug and skip those that time out even though they are already marked as slow.

* TestExpectations:

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

23 months agoImplement "UpdateWorkerState" and use it
beidson@apple.com [Tue, 7 Nov 2017 23:06:55 +0000 (23:06 +0000)]
Implement "UpdateWorkerState" and use it
https://bugs.webkit.org/show_bug.cgi?id=179318

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* web-platform-tests/service-workers/service-worker/update.https-expected.txt:

Source/WebCore:

No new tests (Existing tests and changes there-to).

* workers/service/ServiceWorker.cpp:
(WebCore::ServiceWorker::allWorkers):
(WebCore::ServiceWorker::mutableAllWorkers):
(WebCore::ServiceWorker::ServiceWorker):
(WebCore::ServiceWorker::~ServiceWorker):
(WebCore::ServiceWorker::updateWorkerState):
(WebCore::ServiceWorker::setState): Deleted.
* workers/service/ServiceWorker.h:

* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::updateRegistrationState):
(WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
* workers/service/ServiceWorkerContainer.h:

* workers/service/ServiceWorkerRegistration.cpp:
(WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration):
(WebCore::ServiceWorkerRegistration::~ServiceWorkerRegistration):
(WebCore::ServiceWorkerRegistration::updateStateFromServer):

* workers/service/ServiceWorkerRegistrationData.cpp:
(WebCore::ServiceWorkerRegistrationData::isolatedCopy const):
* workers/service/ServiceWorkerRegistrationData.h:
(WebCore::ServiceWorkerRegistrationData::encode const):
(WebCore::ServiceWorkerRegistrationData::decode):

* workers/service/ServiceWorkerRegistrationKey.cpp:
(WebCore::ServiceWorkerRegistrationKey::loggingString const):
* workers/service/ServiceWorkerRegistrationKey.h:

* workers/service/ServiceWorkerTypes.h:

* workers/service/context/SWContextManager.cpp:
(WebCore::SWContextManager::registerServiceWorkerThreadForInstall):
(WebCore::SWContextManager::registerServiceWorkerThreadForUpdate): Deleted.
* workers/service/context/SWContextManager.h:

* workers/service/server/SWClientConnection.cpp:
(WebCore::SWClientConnection::updateRegistrationState):
(WebCore::SWClientConnection::updateWorkerState):
* workers/service/server/SWClientConnection.h:

* workers/service/server/SWServer.cpp:
(WebCore::SWServer::updateWorker):
* workers/service/server/SWServer.h:
(WebCore::SWServer::workerByID const):

* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::scriptFetchFinished):
(WebCore::SWServerJobQueue::scriptContextStarted):
(WebCore::SWServerJobQueue::install):
(WebCore::SWServerJobQueue::tryClearRegistration):

* workers/service/server/SWServerRegistration.cpp:
(WebCore::SWServerRegistration::updateRegistrationState):
(WebCore::SWServerRegistration::updateWorkerState):
(WebCore::SWServerRegistration::data const):
* workers/service/server/SWServerRegistration.h:
(WebCore::SWServerRegistration::setActiveServiceWorkerIdentifier): Deleted.

* workers/service/server/SWServerWorker.h:
(WebCore::SWServerWorker::state const):
(WebCore::SWServerWorker::setState):

Source/WebKit:

* Scripts/webkit/messages.py:
(headers_for_type):
* Shared/WebCoreArgumentCoders.h:

       * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::updateWorkerStateInClient):
(WebKit::WebSWServerConnection::installServiceWorkerContext):
(WebKit::WebSWServerConnection::setContextConnection):
(WebKit::WebSWServerConnection::updateServiceWorkerContext): Deleted.
* StorageProcess/ServiceWorker/WebSWServerConnection.h:

* WebProcess/Storage/WebSWClientConnection.messages.in:

* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::installServiceWorker):
(WebKit::WebSWContextManagerConnection::updateServiceWorker): Deleted.
* WebProcess/Storage/WebSWContextManagerConnection.h:
* WebProcess/Storage/WebSWContextManagerConnection.messages.in:

Source/WTF:

* wtf/ObjectIdentifier.h:
(WTF::ObjectIdentifier::loggingString const):

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

23 months agoEnable webkitpy EWS bubbles
aakash_jain@apple.com [Tue, 7 Nov 2017 23:04:34 +0000 (23:04 +0000)]
Enable webkitpy EWS bubbles
https://bugs.webkit.org/show_bug.cgi?id=178539

Reviewed by Alexey Proskuryakov.

* QueueStatusServer/config/queues.py: Added webkitpy EWS.

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

23 months agoAdd platform argument for syncing script.
dewei_zhu@apple.com [Tue, 7 Nov 2017 22:57:05 +0000 (22:57 +0000)]
Add platform argument for syncing script.
https://bugs.webkit.org/show_bug.cgi?id=179162

Reviewed by Ryosuke Niwa.

Syncing script should pass platform name to buildbot if platform argument is specified in configuration.

* server-tests/tools-sync-buildbot-integration-tests.js:
(return.createTriggerable.configWithPlatformName.then): Added unit test for platform argument.
* tools/js/buildbot-syncer.js:
(BuildbotSyncer): Add '_platformPropertyName' property.
(BuildbotSyncer.prototype.scheduleRequest): Add '_platformPropertyName' to build property if specified.
(BuildbotSyncer._loadConfig): Read '_plaformPropertyName' from config.

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

23 months agoIntroduce a default RegisterSet constructor so that we can use { } notation.
mark.lam@apple.com [Tue, 7 Nov 2017 22:52:34 +0000 (22:52 +0000)]
Introduce a default RegisterSet constructor so that we can use { } notation.
https://bugs.webkit.org/show_bug.cgi?id=179389

Reviewed by Saam Barati.

I also replaced uses of "RegisterSet()" with "{ }" where the use of "RegisterSet()"
does not add any code documentation value.

* b3/air/AirAllocateRegistersAndStackByLinearScan.cpp:
* b3/air/AirCode.cpp:
(JSC::B3::Air::Code::setRegsInPriorityOrder):
* b3/air/AirPrintSpecial.cpp:
(JSC::B3::Air::PrintSpecial::extraEarlyClobberedRegs):
(JSC::B3::Air::PrintSpecial::extraClobberedRegs):
* b3/air/testair.cpp:
* bytecode/PolymorphicAccess.h:
(JSC::AccessGenerationState::preserveLiveRegistersToStackForCall):
(JSC::AccessGenerationState::restoreLiveRegistersFromStackForCall):
* dfg/DFGJITCode.cpp:
(JSC::DFG::JITCode::liveRegistersToPreserveAtExceptionHandlingCallSite):
* ftl/FTLJITCode.cpp:
(JSC::FTL::JITCode::liveRegistersToPreserveAtExceptionHandlingCallSite):
* jit/JITCode.cpp:
(JSC::JITCode::liveRegistersToPreserveAtExceptionHandlingCallSite):
* jit/RegisterSet.cpp:
(JSC::RegisterSet::reservedHardwareRegisters):
(JSC::RegisterSet::runtimeRegisters):
(JSC::RegisterSet::macroScratchRegisters):
* jit/RegisterSet.h:
(JSC::RegisterSet::RegisterSet):
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::emitTierUpCheck):

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

23 months agoAdd a WinCairo EWS queue
don.olmstead@sony.com [Tue, 7 Nov 2017 22:38:34 +0000 (22:38 +0000)]
Add a WinCairo EWS queue
https://bugs.webkit.org/show_bug.cgi?id=179390

Reviewed by Lucas Forschler.

* QueueStatusServer/config/queues.py:
* QueueStatusServer/model/queues.py:
* Scripts/webkitpy/common/config/ews.json:
* Scripts/webkitpy/common/config/ports.py:
* Scripts/webkitpy/common/config/ports_unittest.py:
* Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py:

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

23 months agofix check-webkit-style errors in webkitpy about not having two spaces before inline...
aakash_jain@apple.com [Tue, 7 Nov 2017 22:33:41 +0000 (22:33 +0000)]
fix check-webkit-style errors in webkitpy about not having two spaces before inline comment
https://bugs.webkit.org/show_bug.cgi?id=171506

Reviewed by Alexey Proskuryakov.

* Scripts/webkitpy/common/checkout/scm/scm_unittest.py:
(SCMTest._shared_test_reverse_diff): Added two spaces before inline comment.
(test_create_patch_is_full_patch): Ditto.
* Scripts/webkitpy/common/thread/messagepump.py:
(MessagePump): Ditto.
* Scripts/webkitpy/layout_tests/servers/http_server.py:
(Lighttpd._prepare_config): Ditto.
* Scripts/webkitpy/style/checker.py: Ditto.
* Scripts/webkitpy/style/checkers/cpp_unittest.py:
(OrderOfIncludesTest.test_check_preprocessor_in_include_section): Ditto.

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

23 months agoAdd support for webkitpy tests EWS
aakash_jain@apple.com [Tue, 7 Nov 2017 22:30:57 +0000 (22:30 +0000)]
Add support for webkitpy tests EWS
https://bugs.webkit.org/show_bug.cgi?id=178480

Reviewed by Alexey Proskuryakov.

* Scripts/webkitpy/common/config/ews.json: Added webkitpy EWS.
* Scripts/webkitpy/common/net/generictestresults.py: Renamed from Scripts/webkitpy/common/net/bindingstestresults.py.
* Scripts/webkitpy/common/net/generictestresults_unittest.py: Renamed from Scripts/webkitpy/common/net/bindingstestresults_unittest.py.
* Scripts/webkitpy/tool/bot/patchanalysistask.py:
(PatchAnalysisTask._test_patch): Do not retry webkitpy test since they are not flaky.
* Scripts/webkitpy/tool/bot/bindingstestresultsreader.py: Updated import for BindingsTestResult.
* Scripts/webkitpy/tool/bot/retrylogic_unittest.py: Ditto.
* Scripts/webkitpy/tool/bot/webkitpytestresultsreader.py: Copied from Scripts/webkitpy/tool/bot/bindingstestresultsreader.py.
* Scripts/webkitpy/tool/commands/earlywarningsystem.py:
(AbstractEarlyWarningSystem.begin_work_queue): Added webkitpy test result reader.
* Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py: Updated unit-tests.
* Scripts/webkitpy/tool/steps/checkpatchrelevance.py: Run webkitpy EWS only for relevant changes.
* Scripts/webkitpy/tool/steps/runtests.py:
(RunTests.run): Run webkitpy tests when --group=webkitpy is passed.
(RunTests._run_webkitpy_tests): Method to invoke webkitpy tests.
* Scripts/webkitpy/tool/steps/steps_unittest.py:
(test_runtests_webkitpy): Added unit-test.

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

23 months ago[LayoutState cleanup] Remove explicit LayoutStateMaintainer::pop calls.
zalan@apple.com [Tue, 7 Nov 2017 21:36:07 +0000 (21:36 +0000)]
[LayoutState cleanup] Remove explicit LayoutStateMaintainer::pop calls.
https://bugs.webkit.org/show_bug.cgi?id=179380
<rdar://problem/35392161>

Reviewed by Antti Koivisto.

Besides the pagination related explicit pops (FIXME), all LayoutStateMaintainer pops are
now in LayoutStateMaintainer's d'tor.

Covered by existing tests.

* rendering/LayoutState.cpp:
(WebCore::LayoutStateMaintainer::~LayoutStateMaintainer):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::simplifiedLayout):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutBlock):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::layout):
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::layoutBlock):
* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::layout):
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::layoutBlock):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutBlock):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::layoutShadowControls):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::layout):
* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::layout):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::calcRowLogicalHeight):
(WebCore::RenderTableSection::layout):
(WebCore::RenderTableSection::layoutRows):
* rendering/RenderVTTCue.cpp:
(WebCore::RenderVTTCue::layout):
* rendering/RenderView.cpp:
(WebCore::RenderView::layout):

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

23 months agoAdd SPI function pointers qualifiers for CPU(ARM64E)
msaboff@apple.com [Tue, 7 Nov 2017 21:19:33 +0000 (21:19 +0000)]
Add SPI function pointers qualifiers for CPU(ARM64E)
https://bugs.webkit.org/show_bug.cgi?id=179383

Reviewed by Mark Lam.

For ARM64E, use the appropriate SPI qualifiers for helper function pointers.

* wtf/BlockPtr.h:
(WTF::BlockPtr<R):

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

23 months agoUnreviewed, rolling out r224512 and r224521.
ryanhaddad@apple.com [Tue, 7 Nov 2017 20:52:40 +0000 (20:52 +0000)]
Unreviewed, rolling out r224512 and r224521.
https://bugs.webkit.org/show_bug.cgi?id=179388

An API test added with this change is failing an assertion on
the bots. (Requested by ryanhaddad on #webkit).

Reverted changesets:

"[Attachment Support] Implement delegate hooks for attachment
element insertion and removal"
https://bugs.webkit.org/show_bug.cgi?id=179016
https://trac.webkit.org/changeset/224512

"Remove stray logging from a newly added API test"
https://trac.webkit.org/changeset/224521

Patch by Commit Queue <commit-queue@webkit.org> on 2017-11-07

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

23 months ago<video> does not respect pointer-events
commit-queue@webkit.org [Tue, 7 Nov 2017 20:17:55 +0000 (20:17 +0000)]
<video> does not respect pointer-events
https://bugs.webkit.org/show_bug.cgi?id=179378
<rdar://problem/34687668>

Patch by Antoine Quint <graouts@apple.com> on 2017-11-07
Reviewed by Simon Fraser.

Source/WebCore:

We now honor the "pointer-events" property value set on the <video> element by setting it to "inherit"
on the media controls shadow root container.

Test: media/modern-media-controls/css/pointer-events-none.html

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

LayoutTests:

Add a new test that checks that settings "pointer-events: none" on the <video> element
correctly reflects that same value on the media controls shadow root container.

* media/modern-media-controls/css/pointer-events-none-expected.txt: Added.
* media/modern-media-controls/css/pointer-events-none.html: Added.
* platform/ios/TestExpectations:

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

23 months ago[Service Workers] Add support for "install" event
cdumez@apple.com [Tue, 7 Nov 2017 20:11:58 +0000 (20:11 +0000)]
[Service Workers] Add support for "install" event
https://bugs.webkit.org/show_bug.cgi?id=179338

Reviewed by Youenn Fablet.

Source/WebCore:

Add support for "install" event as per:
- https://w3c.github.io/ServiceWorker/#installation-algorithm (Step 10)

For now, install always succeeds as our support for ExtendableEvent.waitUntil() is
still incomplete.

Test: http/tests/workers/service/basic-install-event.html

* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::firePostInstallEvents):
* workers/service/ServiceWorkerContainer.h:
* workers/service/context/SWContextManager.cpp:
(WebCore::SWContextManager::fireInstallEvent):
* workers/service/context/SWContextManager.h:
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::fireInstallEvent):
* workers/service/context/ServiceWorkerThread.h:
* workers/service/server/SWClientConnection.cpp:
(WebCore::SWClientConnection::firePostInstallEvents):
* workers/service/server/SWClientConnection.h:
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::Connection::didFinishInstall):
(WebCore::SWServer::didFinishInstall):
(WebCore::SWServer::fireInstallEvent):
* workers/service/server/SWServer.h:
* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::scriptContextStarted):
(WebCore::SWServerJobQueue::install):
(WebCore::SWServerJobQueue::didFinishInstall):
* workers/service/server/SWServerJobQueue.h:
* workers/service/server/SWServerRegistration.cpp:
(WebCore::SWServerRegistration::firePostInstallEvents):
* workers/service/server/SWServerRegistration.h:

Source/WebKit:

* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::firePostInstallEvents):
(WebKit::WebSWServerConnection::fireInstallEvent):
* StorageProcess/ServiceWorker/WebSWServerConnection.h:
* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::didFinishServiceWorkerInstall):
* StorageProcess/StorageProcess.h:
* StorageProcess/StorageProcess.messages.in:
* WebProcess/Storage/WebSWClientConnection.messages.in:
* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::fireInstallEvent):
(WebKit::WebSWContextManagerConnection::didFinishInstall):
* WebProcess/Storage/WebSWContextManagerConnection.h:
* WebProcess/Storage/WebSWContextManagerConnection.messages.in:

LayoutTests:

Add layout test coverage.

* http/tests/workers/service/basic-install-event-expected.txt: Added.
* http/tests/workers/service/basic-install-event.html: Added.
* http/tests/workers/service/resources/basic-install-event-worker.js: Added.
* http/tests/workers/service/resources/sw-test-pre.js:
(waitForState):

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

23 months agoUnreviewed, rolling out r224498.
ryanhaddad@apple.com [Tue, 7 Nov 2017 20:02:48 +0000 (20:02 +0000)]
Unreviewed, rolling out r224498.

The LayoutTest for this change is flaky and affecting EWS
results.

Reverted changeset:

"Add tests to ensure that <source> tags are only preloaded
when the `type`"
https://bugs.webkit.org/show_bug.cgi?id=179231
https://trac.webkit.org/changeset/224498

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

23 months agoWeb Inspector: Add some fast returns in cases where we only call through to a Network...
joepeck@webkit.org [Tue, 7 Nov 2017 20:01:08 +0000 (20:01 +0000)]
Web Inspector: Add some fast returns in cases where we only call through to a NetworkAgent
https://bugs.webkit.org/show_bug.cgi?id=179359

Reviewed by Devin Rousso.

* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::willSendRequest):
(WebCore::InspectorInstrumentation::willSendRequestOfType):
(WebCore::InspectorInstrumentation::didLoadResourceFromMemoryCache):
(WebCore::InspectorInstrumentation::didReceiveThreadableLoaderResponse):
(WebCore::InspectorInstrumentation::didReceiveData):
(WebCore::InspectorInstrumentation::didFinishXHRLoading):
(WebCore::InspectorInstrumentation::willLoadXHRSynchronously):
(WebCore::InspectorInstrumentation::didLoadXHRSynchronously):
(WebCore::InspectorInstrumentation::scriptImported):
(WebCore::InspectorInstrumentation::didReceiveScriptResponse):
Fast return if no frontend in cases that only call into NetworkAgent
because the NetworkAgent is only available if there is a frontend.

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

23 months agoAccessCase::generateImpl() should exclude the result register when restoring register...
mark.lam@apple.com [Tue, 7 Nov 2017 19:33:22 +0000 (19:33 +0000)]
AccessCase::generateImpl() should exclude the result register when restoring registers after a call.
https://bugs.webkit.org/show_bug.cgi?id=179355
<rdar://problem/35263053>

Reviewed by Saam Barati.

JSTests:

* stress/regress-179355.js: Added.

Source/JavaScriptCore:

In the Transition case in AccessCase::generateImpl(), we were restoring registers
using restoreLiveRegistersFromStackForCall() without excluding the scratchGPR
where we previously stashed the reallocated butterfly.  If the generated code is
under heavy register pressure, scratchGPR could have been from the set of preserved
registers, and hence, would be restored by restoreLiveRegistersFromStackForCall().
As a result, the restoration would trash the butterfly result we stored there.
This patch fixes the issue by excluding the scratchGPR in the restoration.

* bytecode/AccessCase.cpp:
(JSC::AccessCase::generateImpl):

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

23 months agoLayoutTest http/tests/security/cross-frame-access-put.html is a flaky failure
cdumez@apple.com [Tue, 7 Nov 2017 19:29:31 +0000 (19:29 +0000)]
LayoutTest http/tests/security/cross-frame-access-put.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=179195

Reviewed by Ryosuke Niwa.

Fix flaky test by calling the testRunner functions as early as possible, not in
the onload event handler.

* http/tests/security/cross-frame-access-put.html:

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

23 months agobmalloc should support strictly type-segregated isolated heaps
fpizlo@apple.com [Tue, 7 Nov 2017 19:21:52 +0000 (19:21 +0000)]
bmalloc should support strictly type-segregated isolated heaps
https://bugs.webkit.org/show_bug.cgi?id=178108

Reviewed by Saam Barati, Simon Fraser, and Ryosuke Niwa.
Source/bmalloc:

This introduces a new allocation API in bmalloc called IsoHeap. An IsoHeap is templatized by
type and created in static storage. When unused, it takes only a few words. When you do use
it, each IsoHeap gets a bag of virtual pages unique to it. This prevents use-after-free bugs
in one IsoHeap from affecting any other memory. At worst, two pointers of the same type will
point to the same object even though they should not have.

IsoHeaps allocate using a first-fit discipline that combines ideas from bmalloc and Riptide
(the JSC GC):

Like Riptide, it uses a bump'n'pop allocator. What Riptide calls blocks, IsoHeaps calls
pages. Pages are collected into directories. Directories track pages using bitvectors, so
that it's easy to quickly find a completely free page or one that has at least one free
object. I think that the bump'n'pop allocator is as fast as the bmalloc Immix-style (page and
line) allocator, but is better at allocating in holes. It's guaranteed to follow a first-fit
discipline. However, the real reason why I wrote it that was is that this is what I'm more
familiar with. This is a part of the design I want to revisit (bug 179278).

Like bmalloc, it uses a deallocation log. This means that the internal IsoHeap data
structures can be locked with a coarse-grained lock, since the deallocator only grabs it when
flushing the log. Similarly, the allocator only grabs it when refilling the bump'n'pop
FreeList.

This adds a unit test for IsoHeaps. In this change, IsoHeaps are adopted only by WebCore's
RenderObject.

Note that despite the use of GC concepts, it's not a goal to make this code directly sharable
with GC. The GC will probably have to do isolated heaps its own way (likely a special
Subspace or something like that).

* bmalloc.xcodeproj/project.pbxproj:
* bmalloc/Algorithm.h:
(bmalloc::findBitInWord):
* bmalloc/AllIsoHeaps.cpp: Added.
(bmalloc::AllIsoHeaps::AllIsoHeaps):
(bmalloc::AllIsoHeaps::add):
(bmalloc::AllIsoHeaps::head):
* bmalloc/AllIsoHeaps.h: Added.
* bmalloc/AllIsoHeapsInlines.h: Added.
(bmalloc::AllIsoHeaps::forEach):
* bmalloc/BMalloced.h: Added.
* bmalloc/Bits.h: Added.
(bmalloc::bitsArrayLength):
(bmalloc::BitsWordView::BitsWordView):
(bmalloc::BitsWordView::numBits const):
(bmalloc::BitsWordView::word const):
(bmalloc::BitsWordOwner::BitsWordOwner):
(bmalloc::BitsWordOwner::view const):
(bmalloc::BitsWordOwner::operator=):
(bmalloc::BitsWordOwner::setAll):
(bmalloc::BitsWordOwner::clearAll):
(bmalloc::BitsWordOwner::set):
(bmalloc::BitsWordOwner::numBits const):
(bmalloc::BitsWordOwner::arrayLength const):
(bmalloc::BitsWordOwner::word const):
(bmalloc::BitsWordOwner::word):
(bmalloc::BitsWordOwner::words const):
(bmalloc::BitsWordOwner::words):
(bmalloc::BitsAndWords::BitsAndWords):
(bmalloc::BitsAndWords::view const):
(bmalloc::BitsAndWords::numBits const):
(bmalloc::BitsAndWords::word const):
(bmalloc::BitsOrWords::BitsOrWords):
(bmalloc::BitsOrWords::view const):
(bmalloc::BitsOrWords::numBits const):
(bmalloc::BitsOrWords::word const):
(bmalloc::BitsNotWords::BitsNotWords):
(bmalloc::BitsNotWords::view const):
(bmalloc::BitsNotWords::numBits const):
(bmalloc::BitsNotWords::word const):
(bmalloc::BitsImpl::BitsImpl):
(bmalloc::BitsImpl::numBits const):
(bmalloc::BitsImpl::size const):
(bmalloc::BitsImpl::arrayLength const):
(bmalloc::BitsImpl::operator== const):
(bmalloc::BitsImpl::operator!= const):
(bmalloc::BitsImpl::at const):
(bmalloc::BitsImpl::operator[] const):
(bmalloc::BitsImpl::isEmpty const):
(bmalloc::BitsImpl::operator& const):
(bmalloc::BitsImpl::operator| const):
(bmalloc::BitsImpl::operator~ const):
(bmalloc::BitsImpl::forEachSetBit const):
(bmalloc::BitsImpl::forEachClearBit const):
(bmalloc::BitsImpl::forEachBit const):
(bmalloc::BitsImpl::findBit const):
(bmalloc::BitsImpl::findSetBit const):
(bmalloc::BitsImpl::findClearBit const):
(bmalloc::BitsImpl::wordView const):
(bmalloc::BitsImpl::atImpl const):
(bmalloc::Bits::Bits):
(bmalloc::Bits::operator=):
(bmalloc::Bits::resize):
(bmalloc::Bits::setAll):
(bmalloc::Bits::clearAll):
(bmalloc::Bits::setAndCheck):
(bmalloc::Bits::operator|=):
(bmalloc::Bits::operator&=):
(bmalloc::Bits::at const):
(bmalloc::Bits::operator[] const):
(bmalloc::Bits::BitReference::BitReference):
(bmalloc::Bits::BitReference::operator bool const):
(bmalloc::Bits::BitReference::operator=):
(bmalloc::Bits::at):
(bmalloc::Bits::operator[]):
* bmalloc/CryptoRandom.cpp: Replaced with Source/bmalloc/bmalloc/CryptoRandom.cpp.
(bmalloc::cryptoRandom):
* bmalloc/CryptoRandom.h: Replaced with Source/bmalloc/bmalloc/CryptoRandom.h.
* bmalloc/DeferredDecommit.h: Added.
* bmalloc/DeferredDecommitInlines.h: Added.
(bmalloc::DeferredDecommit::DeferredDecommit):
* bmalloc/DeferredTrigger.h: Added.
(bmalloc::DeferredTrigger::DeferredTrigger):
* bmalloc/DeferredTriggerInlines.h: Added.
(bmalloc::DeferredTrigger<trigger>::didBecome):
(bmalloc::DeferredTrigger<trigger>::handleDeferral):
* bmalloc/EligibilityResult.h: Added.
(bmalloc::EligibilityResult::EligibilityResult):
* bmalloc/EligibilityResultInlines.h: Added.
(bmalloc::EligibilityResult<Config>::EligibilityResult):
* bmalloc/FixedVector.h:
* bmalloc/FreeList.cpp: Added.
(bmalloc::FreeList::FreeList):
(bmalloc::FreeList::~FreeList):
(bmalloc::FreeList::clear):
(bmalloc::FreeList::initializeList):
(bmalloc::FreeList::initializeBump):
(bmalloc::FreeList::contains const):
* bmalloc/FreeList.h: Added.
(bmalloc::FreeCell::scramble):
(bmalloc::FreeCell::descramble):
(bmalloc::FreeCell::setNext):
(bmalloc::FreeCell::next const):
(bmalloc::FreeList::allocationWillFail const):
(bmalloc::FreeList::allocationWillSucceed const):
(bmalloc::FreeList::originalSize const):
(bmalloc::FreeList::head const):
* bmalloc/FreeListInlines.h: Added.
(bmalloc::FreeList::allocate):
(bmalloc::FreeList::forEach const):
* bmalloc/IsoAllocator.h: Added.
* bmalloc/IsoAllocatorInlines.h: Added.
(bmalloc::IsoAllocator<Config>::IsoAllocator):
(bmalloc::IsoAllocator<Config>::~IsoAllocator):
(bmalloc::IsoAllocator<Config>::allocate):
(bmalloc::IsoAllocator<Config>::allocateSlow):
(bmalloc::IsoAllocator<Config>::scavenge):
* bmalloc/IsoConfig.h: Added.
* bmalloc/IsoDeallocator.h: Added.
* bmalloc/IsoDeallocatorInlines.h: Added.
(bmalloc::IsoDeallocator<Config>::IsoDeallocator):
(bmalloc::IsoDeallocator<Config>::~IsoDeallocator):
(bmalloc::IsoDeallocator<Config>::deallocate):
(bmalloc::IsoDeallocator<Config>::scavenge):
* bmalloc/IsoDirectory.h: Added.
(bmalloc::IsoDirectoryBaseBase::IsoDirectoryBaseBase):
(bmalloc::IsoDirectoryBaseBase::~IsoDirectoryBaseBase):
(bmalloc::IsoDirectoryBase::heap):
* bmalloc/IsoDirectoryInlines.h: Added.
(bmalloc::IsoDirectoryBase<Config>::IsoDirectoryBase):
(bmalloc::passedNumPages>::IsoDirectory):
(bmalloc::passedNumPages>::takeFirstEligible):
(bmalloc::passedNumPages>::didBecome):
(bmalloc::passedNumPages>::didDecommit):
(bmalloc::passedNumPages>::scavenge):
(bmalloc::passedNumPages>::forEachCommittedPage):
* bmalloc/IsoDirectoryPage.h: Added.
(bmalloc::IsoDirectoryPage::index const):
* bmalloc/IsoDirectoryPageInlines.h: Added.
(bmalloc::IsoDirectoryPage<Config>::IsoDirectoryPage):
(bmalloc::IsoDirectoryPage<Config>::pageFor):
* bmalloc/IsoHeap.h: Added.
(bmalloc::api::IsoHeap::allocatorOffset):
(bmalloc::api::IsoHeap::setAllocatorOffset):
(bmalloc::api::IsoHeap::deallocatorOffset):
(bmalloc::api::IsoHeap::setDeallocatorOffset):
* bmalloc/IsoHeapImpl.cpp: Added.
(bmalloc::IsoHeapImplBase::IsoHeapImplBase):
(bmalloc::IsoHeapImplBase::~IsoHeapImplBase):
(bmalloc::IsoHeapImplBase::scavengeNow):
(bmalloc::IsoHeapImplBase::finishScavenging):
* bmalloc/IsoHeapImpl.h: Added.
* bmalloc/IsoHeapImplInlines.h: Added.
(bmalloc::IsoHeapImpl<Config>::IsoHeapImpl):
(bmalloc::IsoHeapImpl<Config>::takeFirstEligible):
(bmalloc::IsoHeapImpl<Config>::didBecomeEligible):
(bmalloc::IsoHeapImpl<Config>::scavenge):
(bmalloc::IsoHeapImpl<Config>::allocatorOffset):
(bmalloc::IsoHeapImpl<Config>::deallocatorOffset):
(bmalloc::IsoHeapImpl<Config>::numLiveObjects):
(bmalloc::IsoHeapImpl<Config>::numCommittedPages):
(bmalloc::IsoHeapImpl<Config>::forEachDirectory):
(bmalloc::IsoHeapImpl<Config>::forEachCommittedPage):
(bmalloc::IsoHeapImpl<Config>::forEachLiveObject):
* bmalloc/IsoHeapInlines.h: Added.
(bmalloc::api::IsoHeap<Type>::allocate):
(bmalloc::api::IsoHeap<Type>::tryAllocate):
(bmalloc::api::IsoHeap<Type>::deallocate):
(bmalloc::api::IsoHeap<Type>::scavenge):
(bmalloc::api::IsoHeap<Type>::isInitialized):
(bmalloc::api::IsoHeap<Type>::impl):
* bmalloc/IsoPage.h: Added.
(bmalloc::IsoPage::index const):
(bmalloc::IsoPage::directory):
(bmalloc::IsoPage::isInUseForAllocation const):
(bmalloc::IsoPage::indexOfFirstObject):
* bmalloc/IsoPageInlines.h: Added.
(bmalloc::IsoPage<Config>::tryCreate):
(bmalloc::IsoPage<Config>::IsoPage):
(bmalloc::IsoPage<Config>::free):
(bmalloc::IsoPage<Config>::startAllocating):
(bmalloc::IsoPage<Config>::stopAllocating):
(bmalloc::IsoPage<Config>::forEachLiveObject):
* bmalloc/IsoPageTrigger.h: Added.
* bmalloc/IsoTLS.cpp: Added.
(bmalloc::IsoTLS::scavenge):
(bmalloc::IsoTLS::IsoTLS):
(bmalloc::IsoTLS::ensureEntries):
(bmalloc::IsoTLS::destructor):
(bmalloc::IsoTLS::sizeForCapacity):
(bmalloc::IsoTLS::capacityForSize):
(bmalloc::IsoTLS::size):
(bmalloc::IsoTLS::forEachEntry):
* bmalloc/IsoTLS.h: Added.
* bmalloc/IsoTLSAllocatorEntry.h: Added.
* bmalloc/IsoTLSAllocatorEntryInlines.h: Added.
(bmalloc::IsoTLSAllocatorEntry<Config>::IsoTLSAllocatorEntry):
(bmalloc::IsoTLSAllocatorEntry<Config>::~IsoTLSAllocatorEntry):
(bmalloc::IsoTLSAllocatorEntry<Config>::construct):
* bmalloc/IsoTLSDeallocatorEntry.h: Added.
* bmalloc/IsoTLSDeallocatorEntryInlines.h: Added.
(bmalloc::IsoTLSDeallocatorEntry<Config>::IsoTLSDeallocatorEntry):
(bmalloc::IsoTLSDeallocatorEntry<Config>::~IsoTLSDeallocatorEntry):
(bmalloc::IsoTLSDeallocatorEntry<Config>::construct):
* bmalloc/IsoTLSEntry.cpp: Added.
(bmalloc::IsoTLSEntry::IsoTLSEntry):
(bmalloc::IsoTLSEntry::~IsoTLSEntry):
* bmalloc/IsoTLSEntry.h: Added.
(bmalloc::IsoTLSEntry::offset const):
(bmalloc::IsoTLSEntry::alignment const):
(bmalloc::IsoTLSEntry::size const):
(bmalloc::IsoTLSEntry::extent const):
* bmalloc/IsoTLSEntryInlines.h: Added.
(bmalloc::IsoTLSEntry::walkUpToInclusive):
(bmalloc::DefaultIsoTLSEntry<EntryType>::DefaultIsoTLSEntry):
(bmalloc::DefaultIsoTLSEntry<EntryType>::~DefaultIsoTLSEntry):
(bmalloc::DefaultIsoTLSEntry<EntryType>::move):
(bmalloc::DefaultIsoTLSEntry<EntryType>::destruct):
(bmalloc::DefaultIsoTLSEntry<EntryType>::scavenge):
* bmalloc/IsoTLSInlines.h: Added.
(bmalloc::IsoTLS::allocate):
(bmalloc::IsoTLS::deallocate):
(bmalloc::IsoTLS::scavenge):
(bmalloc::IsoTLS::allocator):
(bmalloc::IsoTLS::deallocator):
(bmalloc::IsoTLS::get):
(bmalloc::IsoTLS::set):
(bmalloc::IsoTLS::ensureHeap):
(bmalloc::IsoTLS::ensureHeapAndEntries):
* bmalloc/IsoTLSLayout.cpp: Added.
(bmalloc::IsoTLSLayout::IsoTLSLayout):
(bmalloc::IsoTLSLayout::add):
* bmalloc/IsoTLSLayout.h: Added.
(bmalloc::IsoTLSLayout::head const):
* bmalloc/PerHeapKind.h:
* bmalloc/PerProcess.h:
(bmalloc::PerProcess<T>::getFastCase):
* bmalloc/Scavenger.cpp:
(bmalloc::Scavenger::scavenge):
* bmalloc/Scavenger.h:
* bmalloc/bmalloc.h:
(bmalloc::api::scavengeThisThread):
* test: Added.
* test/testbmalloc.cpp: Added.
(hiddenTruthBecauseNoReturnIsStupid):
(usage):
(assertEmptyPointerSet):
(assertHasObjects):
(assertHasOnlyObjects):
(assertClean):
(testIsoSimple):
(testIsoSimpleScavengeBeforeDealloc):
(testIsoFlipFlopFragmentedPages):
(testIsoFlipFlopFragmentedPagesScavengeInMiddle):
(BisoMalloced::BisoMalloced):
(testBisoMalloced):
(BisoMallocedInline::BisoMallocedInline):
(testBisoMallocedInline):
(run):
(main):

Source/WebCore:

No new tests because no new change in behavior. Though, the bmalloc change has a unit test.

Adopting IsoHeap means dropping in macros in both the .h and .cpp file of each class that we
opt in. It's not pretty, but it helps ensure speedy allocation since it means that we never
have to do any kind of switch or dynamic lookup to find the right allocator for a type.

This change is perf-neutral on MotionMark, PLT3, and membuster.

* Sources.txt:
* html/shadow/SliderThumbElement.cpp:
* html/shadow/SliderThumbElement.h:
* html/shadow/mac/ImageControlsButtonElementMac.cpp:
* html/shadow/mac/ImageControlsRootElementMac.cpp:
* rendering/RenderAttachment.cpp:
* rendering/RenderAttachment.h:
* rendering/RenderBlock.cpp:
* rendering/RenderBlock.h:
* rendering/RenderBlockFlow.cpp:
* rendering/RenderBlockFlow.h:
* rendering/RenderBox.cpp:
* rendering/RenderBox.h:
* rendering/RenderBoxModelObject.cpp:
* rendering/RenderBoxModelObject.h:
* rendering/RenderButton.cpp:
* rendering/RenderButton.h:
* rendering/RenderCombineText.cpp:
* rendering/RenderCombineText.h:
* rendering/RenderCounter.cpp:
* rendering/RenderCounter.h:
* rendering/RenderDeprecatedFlexibleBox.cpp:
* rendering/RenderDeprecatedFlexibleBox.h:
* rendering/RenderDetailsMarker.cpp:
* rendering/RenderDetailsMarker.h:
* rendering/RenderElement.cpp:
* rendering/RenderElement.h:
* rendering/RenderEmbeddedObject.cpp:
* rendering/RenderEmbeddedObject.h:
* rendering/RenderFileUploadControl.cpp:
* rendering/RenderFileUploadControl.h:
* rendering/RenderFlexibleBox.cpp:
* rendering/RenderFlexibleBox.h:
* rendering/RenderFragmentContainer.cpp:
* rendering/RenderFragmentContainer.h:
* rendering/RenderFragmentContainerSet.cpp:
* rendering/RenderFragmentContainerSet.h:
* rendering/RenderFragmentedFlow.cpp:
* rendering/RenderFragmentedFlow.h:
* rendering/RenderFrameBase.cpp:
* rendering/RenderFrameBase.h:
* rendering/RenderFrameSet.cpp:
* rendering/RenderFrameSet.h:
* rendering/RenderFullScreen.cpp:
* rendering/RenderFullScreen.h:
* rendering/RenderGrid.cpp:
* rendering/RenderGrid.h:
* rendering/RenderHTMLCanvas.cpp:
* rendering/RenderHTMLCanvas.h:
* rendering/RenderImage.cpp:
* rendering/RenderImage.h:
* rendering/RenderImageResourceStyleImage.cpp:
* rendering/RenderImageResourceStyleImage.h:
* rendering/RenderInline.cpp:
* rendering/RenderInline.h:
* rendering/RenderLayerModelObject.cpp:
* rendering/RenderLayerModelObject.h:
* rendering/RenderLineBreak.cpp:
* rendering/RenderLineBreak.h:
* rendering/RenderListBox.cpp:
* rendering/RenderListBox.h:
* rendering/RenderListItem.cpp:
* rendering/RenderListItem.h:
* rendering/RenderListMarker.cpp:
* rendering/RenderListMarker.h:
* rendering/RenderMedia.cpp:
* rendering/RenderMedia.h:
* rendering/RenderMediaControlElements.cpp:
* rendering/RenderMediaControlElements.h:
* rendering/RenderMenuList.cpp:
* rendering/RenderMenuList.h:
* rendering/RenderMeter.cpp:
* rendering/RenderMeter.h:
* rendering/RenderMultiColumnFlow.cpp:
* rendering/RenderMultiColumnFlow.h:
* rendering/RenderMultiColumnSet.cpp:
* rendering/RenderMultiColumnSet.h:
* rendering/RenderMultiColumnSpannerPlaceholder.cpp:
* rendering/RenderMultiColumnSpannerPlaceholder.h:
* rendering/RenderObject.cpp:
* rendering/RenderObject.h:
* rendering/RenderProgress.cpp:
* rendering/RenderProgress.h:
* rendering/RenderQuote.cpp:
* rendering/RenderQuote.h:
* rendering/RenderReplaced.cpp:
* rendering/RenderReplaced.h:
* rendering/RenderReplica.cpp:
* rendering/RenderReplica.h:
* rendering/RenderRuby.cpp:
* rendering/RenderRuby.h:
* rendering/RenderRubyBase.cpp:
* rendering/RenderRubyBase.h:
* rendering/RenderRubyRun.cpp:
* rendering/RenderRubyRun.h:
* rendering/RenderRubyText.cpp:
* rendering/RenderRubyText.h:
* rendering/RenderScrollbarPart.cpp:
* rendering/RenderScrollbarPart.h:
* rendering/RenderSearchField.cpp:
* rendering/RenderSearchField.h:
* rendering/RenderSlider.cpp:
* rendering/RenderSlider.h:
* rendering/RenderTable.cpp:
* rendering/RenderTable.h:
* rendering/RenderTableCaption.cpp:
* rendering/RenderTableCaption.h:
* rendering/RenderTableCell.cpp:
* rendering/RenderTableCell.h:
* rendering/RenderTableCol.cpp:
* rendering/RenderTableCol.h:
* rendering/RenderTableRow.cpp:
* rendering/RenderTableRow.h:
* rendering/RenderTableSection.cpp:
* rendering/RenderTableSection.h:
* rendering/RenderText.cpp:
* rendering/RenderText.h:
* rendering/RenderTextControl.cpp:
* rendering/RenderTextControl.h:
* rendering/RenderTextControlMultiLine.cpp:
* rendering/RenderTextControlMultiLine.h:
* rendering/RenderTextControlSingleLine.cpp:
* rendering/RenderTextControlSingleLine.h:
* rendering/RenderTextFragment.cpp:
* rendering/RenderTextFragment.h:
* rendering/RenderVTTCue.cpp:
* rendering/RenderVTTCue.h:
* rendering/RenderVideo.cpp:
* rendering/RenderVideo.h:
* rendering/RenderView.cpp:
* rendering/RenderView.h:
* rendering/RenderWidget.cpp:
* rendering/RenderWidget.h:
* rendering/mathml/RenderMathMLBlock.cpp:
* rendering/mathml/RenderMathMLBlock.h:
* rendering/mathml/RenderMathMLFenced.cpp:
* rendering/mathml/RenderMathMLFenced.h:
* rendering/mathml/RenderMathMLFencedOperator.cpp:
* rendering/mathml/RenderMathMLFencedOperator.h:
* rendering/mathml/RenderMathMLFraction.cpp:
* rendering/mathml/RenderMathMLFraction.h:
* rendering/mathml/RenderMathMLMath.cpp:
* rendering/mathml/RenderMathMLMath.h:
* rendering/mathml/RenderMathMLMenclose.cpp:
* rendering/mathml/RenderMathMLMenclose.h:
* rendering/mathml/RenderMathMLOperator.cpp:
* rendering/mathml/RenderMathMLOperator.h:
* rendering/mathml/RenderMathMLPadded.cpp:
* rendering/mathml/RenderMathMLPadded.h:
* rendering/mathml/RenderMathMLRoot.cpp:
* rendering/mathml/RenderMathMLRoot.h:
* rendering/mathml/RenderMathMLRow.cpp:
* rendering/mathml/RenderMathMLRow.h:
* rendering/mathml/RenderMathMLScripts.cpp:
* rendering/mathml/RenderMathMLScripts.h:
* rendering/mathml/RenderMathMLSpace.cpp:
* rendering/mathml/RenderMathMLSpace.h:
* rendering/mathml/RenderMathMLToken.cpp:
* rendering/mathml/RenderMathMLToken.h:
* rendering/mathml/RenderMathMLUnderOver.cpp:
* rendering/mathml/RenderMathMLUnderOver.h:
* rendering/svg/RenderSVGBlock.cpp:
* rendering/svg/RenderSVGBlock.h:
* rendering/svg/RenderSVGContainer.cpp:
* rendering/svg/RenderSVGContainer.h:
* rendering/svg/RenderSVGEllipse.cpp:
* rendering/svg/RenderSVGEllipse.h:
* rendering/svg/RenderSVGForeignObject.cpp:
* rendering/svg/RenderSVGForeignObject.h:
* rendering/svg/RenderSVGGradientStop.cpp:
* rendering/svg/RenderSVGGradientStop.h:
* rendering/svg/RenderSVGHiddenContainer.cpp:
* rendering/svg/RenderSVGHiddenContainer.h:
* rendering/svg/RenderSVGImage.cpp:
* rendering/svg/RenderSVGImage.h:
* rendering/svg/RenderSVGInline.cpp:
* rendering/svg/RenderSVGInline.h:
* rendering/svg/RenderSVGInlineText.cpp:
* rendering/svg/RenderSVGInlineText.h:
* rendering/svg/RenderSVGModelObject.cpp:
* rendering/svg/RenderSVGModelObject.h:
* rendering/svg/RenderSVGPath.cpp:
* rendering/svg/RenderSVGPath.h:
* rendering/svg/RenderSVGRect.cpp:
* rendering/svg/RenderSVGRect.h:
* rendering/svg/RenderSVGResourceClipper.cpp:
* rendering/svg/RenderSVGResourceClipper.h:
* rendering/svg/RenderSVGResourceContainer.cpp:
* rendering/svg/RenderSVGResourceContainer.h:
* rendering/svg/RenderSVGResourceFilter.cpp:
* rendering/svg/RenderSVGResourceFilter.h:
* rendering/svg/RenderSVGResourceFilterPrimitive.cpp:
* rendering/svg/RenderSVGResourceFilterPrimitive.h:
* rendering/svg/RenderSVGResourceGradient.cpp:
* rendering/svg/RenderSVGResourceGradient.h:
* rendering/svg/RenderSVGResourceLinearGradient.cpp:
* rendering/svg/RenderSVGResourceLinearGradient.h:
* rendering/svg/RenderSVGResourceMarker.cpp:
* rendering/svg/RenderSVGResourceMarker.h:
* rendering/svg/RenderSVGResourceMasker.cpp:
* rendering/svg/RenderSVGResourceMasker.h:
* rendering/svg/RenderSVGResourcePattern.cpp:
* rendering/svg/RenderSVGResourcePattern.h:
* rendering/svg/RenderSVGResourceRadialGradient.cpp:
* rendering/svg/RenderSVGResourceRadialGradient.h:
* rendering/svg/RenderSVGRoot.cpp:
* rendering/svg/RenderSVGRoot.h:
* rendering/svg/RenderSVGShape.cpp:
* rendering/svg/RenderSVGShape.h:
* rendering/svg/RenderSVGTSpan.cpp: Added.
* rendering/svg/RenderSVGTSpan.h:
* rendering/svg/RenderSVGText.cpp:
* rendering/svg/RenderSVGText.h:
* rendering/svg/RenderSVGTextPath.cpp:
* rendering/svg/RenderSVGTextPath.h:
* rendering/svg/RenderSVGTransformableContainer.cpp:
* rendering/svg/RenderSVGTransformableContainer.h:
* rendering/svg/RenderSVGViewportContainer.cpp:
* rendering/svg/RenderSVGViewportContainer.h:

Source/WTF:

This just adds an easy way of using the bmalloc IsoHeap API in WebKit. If bmalloc is not
enabled, these macros will just make the object FastMalloced.

* WTF.xcodeproj/project.pbxproj:
* wtf/FastTLS.h:
* wtf/IsoMalloc.h: Added.
* wtf/IsoMallocInlines.h: Added.

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

23 months agoUpdate WPT encoding test suite to the latest version.
mjs@apple.com [Tue, 7 Nov 2017 18:29:46 +0000 (18:29 +0000)]
Update WPT encoding test suite to the latest version.
https://bugs.webkit.org/show_bug.cgi?id=179312

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

* resources/resource-files.json: Mark HTML files that aren't tests
but which are not in resources/ directories.

The remaining changes are updates from upstream.

* web-platform-tests/encoding/OWNERS:
* web-platform-tests/encoding/api-invalid-label-expected.txt:
* web-platform-tests/encoding/api-invalid-label.html:
* web-platform-tests/encoding/api-replacement-encodings-expected.txt:
* web-platform-tests/encoding/api-replacement-encodings.html:
* web-platform-tests/encoding/eof-shift_jis-ref.html: Added.
* web-platform-tests/encoding/eof-shift_jis.html: Added.
* web-platform-tests/encoding/eof-utf-8-one-ref.html: Added.
* web-platform-tests/encoding/eof-utf-8-one.html: Added.
* web-platform-tests/encoding/eof-utf-8-three-ref.html: Added.
* web-platform-tests/encoding/eof-utf-8-three.html: Added.
* web-platform-tests/encoding/eof-utf-8-two-ref.html: Added.
* web-platform-tests/encoding/eof-utf-8-two.html: Added.
* web-platform-tests/encoding/idlharness.html:
* web-platform-tests/encoding/iso-2022-jp-decoder-expected.txt:
* web-platform-tests/encoding/iso-2022-jp-decoder.html:
* web-platform-tests/encoding/legacy-mb-japanese: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/jis0208_index.js: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-decode-csshiftjis-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-decode-csshiftjis.html: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-decode-errors-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-decode-errors.html: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-decode-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-decode-ms932-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-decode-ms932.html: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-decode-ms_kanji-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-decode-ms_kanji.html: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-decode-shift-jis-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-decode-shift-jis.html: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-decode-sjis-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-decode-sjis.html: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-decode-windows-31j-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-decode-windows-31j.html: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-decode-x-sjis-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-decode-x-sjis.html: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-decode.html: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-decoder.js: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-form-csshiftjis-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-form-csshiftjis.html: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-form-csshiftjis.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-form-errors-han-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-form-errors-han.html: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-form-errors-han.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-form-errors-hangul-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-form-errors-hangul.html: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-form-errors-hangul.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-form-errors-misc-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-form-errors-misc.html: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-form-errors-misc.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-form-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-form-ms932-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-form-ms932.html: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-form-ms932.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-form-ms_kanji-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-form-ms_kanji.html: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-form-ms_kanji.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-form-shift-jis-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-form-shift-jis.html: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-form-shift-jis.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-form-sjis-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-form-sjis.html: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-form-sjis.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-form-windows-31j-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-form-windows-31j.html: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-form-windows-31j.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-form-x-sjis-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-form-x-sjis.html: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-form-x-sjis.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-form.html: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-form.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-href-errors-han-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-href-errors-han.html: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-href-errors-han.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-href-errors-hangul-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-href-errors-hangul.html: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-href-errors-hangul.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-href-errors-misc-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-href-errors-misc.html: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-href-errors-misc.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-href-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-href.html: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encode-href.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis-encoder.js: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis_chars-csshiftjis.html: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis_chars-csshiftjis.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis_chars-ms932.html: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis_chars-ms932.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis_chars-ms_kanji.html: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis_chars-ms_kanji.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis_chars-shift-jis.html: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis_chars-shift-jis.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis_chars-sjis.html: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis_chars-sjis.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis_chars-windows-31j.html: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis_chars-windows-31j.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis_chars-x-sjis.html: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis_chars-x-sjis.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis_chars.html: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis_chars.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis_errors.html: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/sjis_errors.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-korean: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-decode-cseuckr-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-decode-cseuckr.html: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-decode-csksc56011987-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-decode-csksc56011987.html: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-decode-errors-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-decode-errors.html: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-decode-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-decode-iso-ir-149-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-decode-iso-ir-149.html: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-decode-korean-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-decode-korean.html: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-decode-ks_c_5601-1987-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-decode-ks_c_5601-1987.html: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-decode-ks_c_5601-1989-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-decode-ks_c_5601-1989.html: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-decode-ksc5601-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-decode-ksc5601.html: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-decode-ksc_5601-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-decode-ksc_5601.html: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-decode-windows-949-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-decode-windows-949.html: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-decode.html: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-decoder.js: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-form-cseuckr-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-form-cseuckr.html: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-form-cseuckr.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-form-csksc56011987-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-form-csksc56011987.html: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-form-csksc56011987.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-form-errors-han-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-form-errors-han.html: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-form-errors-han.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-form-errors-hangul-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-form-errors-hangul.html: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-form-errors-hangul.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-form-errors-misc-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-form-errors-misc.html: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-form-errors-misc.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-form-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-form-iso-ir-149-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-form-iso-ir-149.html: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-form-iso-ir-149.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-form-korean-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-form-korean.html: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-form-korean.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-form-ks_c_5601-1987-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-form-ks_c_5601-1987.html: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-form-ks_c_5601-1987.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-form-ks_c_5601-1989-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-form-ks_c_5601-1989.html: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-form-ks_c_5601-1989.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-form-ksc5601-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-form-ksc5601.html: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-form-ksc5601.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-form-ksc_5601-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-form-ksc_5601.html: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-form-ksc_5601.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-form-windows-949-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-form-windows-949.html: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-form-windows-949.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-form.html: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-form.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-href-errors-han-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-href-errors-han.html: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-href-errors-han.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-href-errors-misc-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-href-errors-misc.html: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-href-errors-misc.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-href-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-href.html: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encode-href.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr-encoder.js: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr_chars-cseuckr.html: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr_chars-cseuckr.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr_chars-csksc56011987.html: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr_chars-csksc56011987.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr_chars-iso-ir-149.html: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr_chars-iso-ir-149.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr_chars-korean.html: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr_chars-korean.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr_chars-ks_c_5601-1987.html: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr_chars-ks_c_5601-1987.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr_chars-ks_c_5601-1989.html: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr_chars-ks_c_5601-1989.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr_chars-ksc5601.html: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr_chars-ksc5601.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr_chars-ksc_5601.html: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr_chars-ksc_5601.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr_chars-windows-949.html: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr_chars-windows-949.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr_chars.html: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr_chars.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr_errors.html: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr_errors.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/euckr_index.js: Added.
* web-platform-tests/encoding/legacy-mb-tchinese: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-decode-big5-hkscs-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-decode-big5-hkscs.html: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-decode-cn-big5-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-decode-cn-big5.html: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-decode-csbig5-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-decode-csbig5.html: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-decode-errors-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-decode-errors.html: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-decode-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-decode-extra-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-decode-extra.html: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-decode-x-x-big5-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-decode-x-x-big5.html: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-decode.html: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-decoder.js: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-enc-ascii-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-enc-ascii.html: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-enc-ascii.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-form-big5-hkscs-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-form-big5-hkscs.html: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-form-big5-hkscs.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-form-cn-big5-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-form-cn-big5.html: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-form-cn-big5.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-form-csbig5-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-form-csbig5.html: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-form-csbig5.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-form-errors-extBa-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-form-errors-extBa.html: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-form-errors-extBa.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-form-errors-extBb-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-form-errors-extBb.html: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-form-errors-extBb.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-form-errors-han-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-form-errors-han.html: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-form-errors-han.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-form-errors-hangul-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-form-errors-hangul.html: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-form-errors-hangul.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-form-errors-misc-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-form-errors-misc.html: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-form-errors-misc.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-form-errors-pua-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-form-errors-pua.html: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-form-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-form-x-x-big5-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-form-x-x-big5.html: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-form-x-x-big5.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-form.html: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-form.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-href-errors-han-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-href-errors-han.html: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-href-errors-han.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-href-errors-hangul-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-href-errors-hangul.html: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-href-errors-hangul.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-href-errors-misc-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-href-errors-misc.html: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-href-errors-misc.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-href-expected.txt: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-href.html: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encode-href.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5-encoder.js: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5_chars-big5-hkscs.html: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5_chars-big5-hkscs.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5_chars-cn-big5.html: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5_chars-cn-big5.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5_chars-csbig5.html: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5_chars-csbig5.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5_chars-x-x-big5.html: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5_chars-x-x-big5.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5_chars.html: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5_chars.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5_chars_extra.html: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5_chars_extra.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5_errors.html: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5_errors.html.headers: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/big5_index.js: Added.
* web-platform-tests/encoding/reftest.list: Added.
* web-platform-tests/encoding/replacement-encodings-expected.txt: Added.
* web-platform-tests/encoding/replacement-encodings.html: Added.
* web-platform-tests/encoding/resources/decoding-helpers.js: Added.
* web-platform-tests/encoding/resources/encodings.js:
* web-platform-tests/encoding/resources/utf-32-big-endian-bom.html: Added.
* web-platform-tests/encoding/resources/utf-32-big-endian-bom.xml: Added.
* web-platform-tests/encoding/resources/utf-32-big-endian-nobom.html: Added.
* web-platform-tests/encoding/resources/utf-32-big-endian-nobom.xml: Added.
* web-platform-tests/encoding/resources/utf-32-little-endian-bom.html: Added.
* web-platform-tests/encoding/resources/utf-32-little-endian-bom.xml: Added.
* web-platform-tests/encoding/resources/utf-32-little-endian-nobom.html: Added.
* web-platform-tests/encoding/resources/utf-32-little-endian-nobom.xml: Added.
* web-platform-tests/encoding/single-byte-decoder-expected.txt:
* web-platform-tests/encoding/single-byte-decoder.html:
* web-platform-tests/encoding/textdecoder-copy.any.js: Added.
* web-platform-tests/encoding/textdecoder-fatal-single-byte-expected.txt:
* web-platform-tests/encoding/textdecoder-fatal-single-byte.html:
* web-platform-tests/encoding/textdecoder-labels-expected.txt:
* web-platform-tests/encoding/textdecoder-labels.html:
* web-platform-tests/encoding/textencoder-constructor-non-utf-expected.txt:
* web-platform-tests/encoding/textencoder-constructor-non-utf.html:
* web-platform-tests/encoding/unsupported-encodings-expected.txt: Added.
* web-platform-tests/encoding/unsupported-encodings.html: Added.
* web-platform-tests/encoding/utf-32-expected.txt: Added.
* web-platform-tests/encoding/utf-32.html: Added.

LayoutTests:

* TestExpectations: Mark some WPT enncoding tests as slow (either
globally or on debug builds) based on what times out in EWS.

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

23 months agoDynamic media queries don't update in shadow tree stylesheets
antti@apple.com [Tue, 7 Nov 2017 18:10:40 +0000 (18:10 +0000)]
Dynamic media queries don't update in shadow tree stylesheets
https://bugs.webkit.org/show_bug.cgi?id=179324

Reviewed by Ryosuke Niwa.

Source/WebCore:

Viewport and accessibility queries should work dynamically also in shadow trees.

Test: fast/shadow-dom/media-query-in-shadow-style.html

* page/LayoutContext.cpp:
(WebCore::LayoutContext::updateStyleForLayout):
* page/Page.cpp:
(WebCore::Page::accessibilitySettingsDidChange):

    Evaluate media query list (JS API) unconditionally as it is independent from style queries.
    Remove some logging.

* style/StyleScope.cpp:
(WebCore::Style::Scope::evaluateMediaQueriesForViewportChange):
(WebCore::Style::Scope::evaluateMediaQueriesForAccessibilitySettingsChange):

    Factor into functions in style scope.

(WebCore::Style::Scope::evaluateMediaQueries):

    Evaluate queries in all shadow trees too.

* style/StyleScope.h:

LayoutTests:

* fast/shadow-dom/media-query-in-shadow-style-expected.html: Added.
* fast/shadow-dom/media-query-in-shadow-style.html: Added.
* fast/shadow-dom/resources/media-query-in-shadow-style-frame.html: Added.

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

23 months agoRelease-assert NoEventDispatchAssertion in canExecute, updateLayout, and updateStyle
rniwa@webkit.org [Tue, 7 Nov 2017 17:41:05 +0000 (17:41 +0000)]
Release-assert NoEventDispatchAssertion in canExecute, updateLayout, and updateStyle
https://bugs.webkit.org/show_bug.cgi?id=179281
<rdar://problem/35008993>

Reviewed by Antti Koivisto.

Surgically enable NoEventDispatchAssertion::InMainThread::isEventAllowed() in release builds to prevent
against insecure execution of author scripts.

No new tests since there should be no behavioral changes (other than preventing potential security bugs
from being exploited).

* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::canExecuteScripts): Use the release assert here. This function is consulted
whenever author scripts are executed in event handler, script element, etc... in the main thread so
enabling the release assert here should basically prevent all unwanted script executions protected by
NoEventDispatchAssertion.
* dom/ContainerNode.cpp:
(NoEventDispatchAssertion::s_count): Now always compiled.
* dom/Document.cpp:
(WebCore::Document::updateStyleIfNeeded): Use the release assert here. This assertion would prevent
unwanted style updating. This part of the change can be reverted if it turns out to be too crashy since
just updating the style would not directly introduce a security vulnerability.
(WebCore::Document::updateLayout): Ditto for updating the layout.
* dom/NoEventDispatchAssertion.h:
(WebCore::NoEventDispatchAssertion::NoEventDispatchAssertion): Enabled this in release builds.
(WebCore::NoEventDispatchAssertion::~NoEventDispatchAssertion): Ditto.
(WebCore::NoEventDispatchAssertion::isEventAllowedInMainThread): Ditto.
(WebCore::NoEventDispatchAssertion::InMainThread::InMainThread): Ditto.
(WebCore::NoEventDispatchAssertion::InMainThread::~InMainThread): Ditto.
(WebCore::NoEventDispatchAssertion::InMainThread::isEventDispatchAllowedInSubtree): We still don't enable
this assertion because this check requires O(n) operation. Added a comment to that end.
(WebCore::NoEventDispatchAssertion::InMainThread::isEventAllowed): Enabled this in release builds.
(WebCore::NoEventDispatchAssertion::DisableAssertionsInScope): Ditto.
* dom/ScriptElement.cpp:
(WebCore::ScriptElement::executeClassicScript): Use the release assert here. This is the function used by
the HTML parser to run scripts via HTMLScriptRunner::executePendingScriptAndDispatchEvent. Having a release
assertion here should prevent the rest of the unwanted script executions in the HTML parser not caught by
canExecuteScripts.

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

23 months ago[WPE][GTK] Building with ENABLE_VIDEO=OFF fails to find AudioTrack.idl
aperez@igalia.com [Tue, 7 Nov 2017 16:28:24 +0000 (16:28 +0000)]
[WPE][GTK] Building with ENABLE_VIDEO=OFF fails to find AudioTrack.idl
https://bugs.webkit.org/show_bug.cgi?id=179372

Reviewed by Michael Catanzaro.

Arrange MSE extensions defined in {Audio,Text,Video}TrackMediaSource.idl to be
only used for building when both ENABLE_VIDEO_TRACK and ENABLE_MEDIA_SOURCE are
enabled.

No new tests needed.

* CMakeLists.txt: Add conditional for ENABLE_MEDIA_SOURCE and move the addition
of the IDL files to the build there.
* Sources.txt: Conversely, source unification should skip sources derived from
the IDL files when ENABLE_MEDIA_SOURCE disabled, so add guards as well.

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

23 months agoSupport the case of fetch events that are not responded
commit-queue@webkit.org [Tue, 7 Nov 2017 16:25:58 +0000 (16:25 +0000)]
Support the case of fetch events that are not responded
https://bugs.webkit.org/show_bug.cgi?id=179336

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

Source/WebCore:

Covered by updated test.

Implementing https://w3c.github.io/ServiceWorker/#on-fetch-request-algorithm step 19.
Making FetchEvent cancellable.

* workers/service/FetchEvent.h:
* workers/service/context/ServiceWorkerFetch.cpp:
(WebCore::ServiceWorkerFetch::dispatchFetchEvent):
* workers/service/context/ServiceWorkerFetch.h:

Source/WebKit:

* WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
(WebKit::WebServiceWorkerFetchTaskClient::didNotHandle):
* WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:

LayoutTests:

* 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:
(async.test):

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

23 months ago[WPE] Turn on ENABLE_MEDIA_SOURCE
mcatanzaro@igalia.com [Tue, 7 Nov 2017 14:59:05 +0000 (14:59 +0000)]
[WPE] Turn on ENABLE_MEDIA_SOURCE
https://bugs.webkit.org/show_bug.cgi?id=179093

Reviewed by Carlos Alberto Lopez Perez.

* Source/cmake/OptionsWPE.cmake:

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

23 months agoWeb Inspector: Create inspector agents lazily
commit-queue@webkit.org [Tue, 7 Nov 2017 09:32:14 +0000 (09:32 +0000)]
Web Inspector: Create inspector agents lazily
https://bugs.webkit.org/show_bug.cgi?id=179360

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

* inspector/CommandLineAPIHost.h:
Modernize style.

* inspector/InspectorController.h:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
(WebCore::InspectorController::pageAgentContext):
(WebCore::InspectorController::createLazyAgents):
(WebCore::InspectorController::connectFrontend):
Move many of the agent construction to happen lazily. These
agent's aren't needed until an inspector connects, so defer
creation until an inspector connects.

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

23 months ago[LayoutState cleanup] Move m_layoutState from RenderView to LayoutContext
zalan@apple.com [Tue, 7 Nov 2017 04:09:59 +0000 (04:09 +0000)]
[LayoutState cleanup] Move m_layoutState from RenderView to LayoutContext
https://bugs.webkit.org/show_bug.cgi?id=179282
<rdar://problem/35348653>

Reviewed by Antti Koivisto.

LayoutContext now owns the top level LayoutState object.
It makes RenderView behave like any other renderer by constructing a LayoutStateMaintainer on the stack.
This is mostly moving code from RenderView.h/.cpp to LayoutContext.h/.cpp and fixing the callsites.
(While view().frameView().layoutContext().layoutState() is a bit lengthy, it's
temporary only, since LayoutState is planned to be an argument of the layout() method.

Covered by existing test.

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::notificationPostTimerFired):
* page/LayoutContext.cpp:
(WebCore::LayoutContext::layoutDelta const):
(WebCore::LayoutContext::addLayoutDelta):
(WebCore::LayoutContext::layoutDeltaMatches):
(WebCore::LayoutContext::pushLayoutState):
(WebCore::LayoutContext::pushLayoutStateForPaginationIfNeeded):
(WebCore::LayoutContext::popLayoutState):
(WebCore::LayoutContext::checkLayoutState):
* page/LayoutContext.h:
(WebCore::LayoutContext::layoutState const):
(WebCore::LayoutContext::layoutStateEnabled const):
(WebCore::LayoutContext::disableLayoutState):
(WebCore::LayoutContext::enableLayoutState):
* rendering/LayoutState.cpp:
(WebCore::LayoutState::LayoutState):
(WebCore::LayoutState::computeClipRect):
(WebCore::LayoutStateMaintainer::LayoutStateMaintainer):
(WebCore::LayoutStateMaintainer::push):
(WebCore::LayoutStateMaintainer::pop):
(WebCore::LayoutStateDisabler::LayoutStateDisabler):
(WebCore::LayoutStateDisabler::~LayoutStateDisabler):
(WebCore::SubtreeLayoutStateMaintainer::SubtreeLayoutStateMaintainer):
(WebCore::SubtreeLayoutStateMaintainer::~SubtreeLayoutStateMaintainer):
(WebCore::PaginatedLayoutStateMaintainer::PaginatedLayoutStateMaintainer):
(WebCore::PaginatedLayoutStateMaintainer::~PaginatedLayoutStateMaintainer):
* rendering/LayoutState.h:
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::setLogicalLeftForChild):
(WebCore::RenderBlock::setLogicalTopForChild):
(WebCore::RenderBlock::layoutPositionedObject):
(WebCore::RenderBlock::markForPaginationRelayoutIfNeeded):
(WebCore::RenderBlock::adjustLogicalLeftOffsetForLine const):
(WebCore::RenderBlock::adjustLogicalRightOffsetForLine const):
(WebCore::RenderBlock::offsetFromLogicalTopOfFirstPage const):
(WebCore::RenderBlock::childBoxIsUnsplittableForFragmentation const):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutBlock):
(WebCore::RenderBlockFlow::layoutBlockChildren):
(WebCore::RenderBlockFlow::layoutBlockChild):
(WebCore::RenderBlockFlow::collapseMarginsWithChildInfo):
(WebCore::RenderBlockFlow::estimateLogicalTopPosition):
(WebCore::RenderBlockFlow::applyBeforeBreak):
(WebCore::RenderBlockFlow::applyAfterBreak):
(WebCore::RenderBlockFlow::hasNextPage const):
(WebCore::RenderBlockFlow::pageLogicalTopForOffset const):
(WebCore::RenderBlockFlow::pageLogicalHeightForOffset const):
(WebCore::RenderBlockFlow::pageRemainingLogicalHeightForOffset const):
(WebCore::RenderBlockFlow::repaintOverhangingFloats):
(WebCore::RenderBlockFlow::insertFloatingObject):
(WebCore::RenderBlockFlow::positionNewFloats):
(WebCore::RenderBlockFlow::layoutSimpleLines):
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::layoutRunsAndFloats):
(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
(WebCore::RenderBlockFlow::linkToEndLineIfNeeded):
(WebCore::RenderBlockFlow::layoutLineBoxes):
(WebCore::RenderBlockFlow::determineStartPosition):
(WebCore::RenderBlockFlow::checkPaginationAndFloatsAtEndLine):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::outlineBoundsForRepaint const):
(WebCore::RenderBox::mapLocalToContainer const):
(WebCore::RenderBox::clippedOverflowRectForRepaint const):
(WebCore::RenderBox::computeRectForRepaint const):
(WebCore::RenderBox::offsetFromLogicalTopOfFirstPage const):
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::layoutBlock):
(WebCore::layoutChildIfNeededApplyingDelta):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::insertChildInternal):
(WebCore::RenderElement::takeChildInternal):
* rendering/RenderEmbeddedObject.cpp:
* rendering/RenderFragmentedFlow.cpp:
(WebCore::RenderFragmentedFlow::repaintRectangleInFragments const):
* rendering/RenderGrid.cpp:
* rendering/RenderInline.cpp:
(WebCore::RenderInline::clippedOverflowRectForRepaint const):
(WebCore::RenderInline::computeRectForRepaint const):
(WebCore::RenderInline::mapLocalToContainer const):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateLayerPositions):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::layout):
* rendering/RenderMediaControlElements.cpp:
(WebCore::RenderMediaVolumeSliderContainer::layout):
(WebCore::RenderMediaControlTimelineContainer::layout):
(WebCore::RenderTextTrackContainerElement::layout):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::repaintRectangle const):
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::clippedOverflowRectForRepaint const):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::layout):
(WebCore::RenderTable::markForPaginationRelayoutIfNeeded):
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::clippedOverflowRectForRepaint const):
(WebCore::RenderTableCell::computeRectForRepaint const):
* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::layout):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::calcRowLogicalHeight):
(WebCore::RenderTableSection::layout):
(WebCore::RenderTableSection::layoutRows):
(WebCore::RenderTableSection::setLogicalPositionForCell const):
* rendering/RenderVTTCue.cpp:
* rendering/RenderView.cpp:
(WebCore::RenderView::layout):
(WebCore::RenderView::layoutContent): Deleted.
(WebCore::RenderView::checkLayoutState): Deleted.
(WebCore::RenderView::initializeLayoutState): Deleted.
(WebCore::RenderView::pushLayoutState): Deleted.
(WebCore::RenderView::pushLayoutStateForPaginationIfNeeded): Deleted.
* rendering/RenderView.h:
* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::lineSnapAdjustment const):
* rendering/svg/RenderSVGContainer.cpp:
(WebCore::RenderSVGContainer::layout):
* rendering/svg/RenderSVGForeignObject.cpp:
(WebCore::RenderSVGForeignObject::layout):
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::layout):
* style/RenderTreeUpdaterFirstLetter.cpp:
(WebCore::RenderTreeUpdater::FirstLetter::update):
* style/RenderTreeUpdaterListItem.cpp:
(WebCore::RenderTreeUpdater::ListItem::updateMarker):

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

23 months agoUnreviewed GTK test gardening
mcatanzaro@igalia.com [Tue, 7 Nov 2017 03:22:14 +0000 (03:22 +0000)]
Unreviewed GTK test gardening

* platform/gtk/TestExpectations:

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

23 months ago[CG] Adopt CGContextDrawPathDirect()
commit-queue@webkit.org [Tue, 7 Nov 2017 02:28:45 +0000 (02:28 +0000)]
[CG] Adopt CGContextDrawPathDirect()
https://bugs.webkit.org/show_bug.cgi?id=179339
<rdar://problem/26283575>

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

Source/WebCore:

Adopt this function on macOS >= 10.12 and iOS >= 10.0. Instead of clearing
the current path and creating a new one by calling CGContextBeginPath()
and then adding a CGPath by calling CGContextAddPath() and then calling
one of the drawing path functions, we just call CGContextDrawPathDirect().

* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::drawPath):
(WebCore::GraphicsContext::fillPath):
(WebCore::GraphicsContext::strokePath): Don't call CGContextBeginPath()
and CGContextAddPath() for the drawing CGContext in the case of gradient
shadow because we add the CGPath to the layerContext and at the end we
draw this CGLayer into the drawing context.

Source/WebCore/PAL:

Add CGContextDrawPathDirect() as a new CoreGraphics SPI.

* pal/spi/cg/CoreGraphicsSPI.h:

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

23 months agoWeb Inspector: Styles Redesign: Display warnings
nvasilyev@apple.com [Tue, 7 Nov 2017 01:19:11 +0000 (01:19 +0000)]
Web Inspector: Styles Redesign: Display warnings
https://bugs.webkit.org/show_bug.cgi?id=179215

Reviewed by Brian Burg.

Display warning icons on the right of the property.

For now, the warning icons have only three title messages:
- Invalid property name;
- Invalid property value;
- Duplicate property.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
(.spreadsheet-style-declaration-editor .property):
(.spreadsheet-style-declaration-editor .property-toggle):
(.spreadsheet-style-declaration-editor .property.invalid-value:not(.disabled) .value):
(.spreadsheet-style-declaration-editor .property.has-warning):
(.spreadsheet-style-declaration-editor .property .warning):
Draw the warning arrow and icon using only one HTML element.
Don't set "top" property so the element remains vertically where it would be if it had "position: static".

(.spreadsheet-style-declaration-editor .property.has-warning .warning):
* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype._propertiesChanged):
(WI.SpreadsheetCSSStyleDeclarationEditor):
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.css:
(.spreadsheet-css-declaration):
(.spreadsheet-css-declaration :matches(.header, .header-media)):
(.spreadsheet-css-declaration .close-brace):
Make properties span the entire width of the styles sidebar. Unsupported properties have yellow
background. There should be no gaps between the property element and sidebar left and right edges.

* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty):
(WI.SpreadsheetStyleProperty.prototype.updateStatus):
(WI.SpreadsheetStyleProperty.prototype._update):
(WI.SpreadsheetStyleProperty.prototype.updateClassNames): Deleted.
Rename updateClassNames to updateStatus since it modifies title attribute of the warning element.

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

23 months agoMake ResourceLoader::willSendRequestInternal asynchronous
achristensen@apple.com [Tue, 7 Nov 2017 00:55:47 +0000 (00:55 +0000)]
Make ResourceLoader::willSendRequestInternal asynchronous
https://bugs.webkit.org/show_bug.cgi?id=179251

Reviewed by Andy Estes.

Source/WebCore:

ResourceLoader::willSendRequestInternal is used for redirects, which need to be asynchronous, and for the initial request.
Making it asynchronous requires making load initialization asynchronous, too.

No change in behavior.  This will allow us to make more things asynchronous.

* loader/LoaderStrategy.h:
* loader/NetscapePlugInStreamLoader.cpp:
(WebCore::NetscapePlugInStreamLoader::create):
(WebCore::NetscapePlugInStreamLoader::init):
(WebCore::NetscapePlugInStreamLoader::willSendRequest):
* loader/NetscapePlugInStreamLoader.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::init):
(WebCore::ResourceLoader::willSendRequestInternal):
(WebCore::ResourceLoader::willSendRequest):
(WebCore::ResourceLoader::willSendRequestAsync):
* loader/ResourceLoader.h:
(WebCore::ResourceLoader::startLoading):
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::create):
(WebCore::SubresourceLoader::startLoading):
(WebCore::SubresourceLoader::init):
(WebCore::SubresourceLoader::willSendRequestInternal):
* loader/SubresourceLoader.h:
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::load):
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):
Calling autorelease from a non-main thread was causing crashes.  This is because we need to set up an autorelease pool on that thread, which we have not done.  See:
https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmAutoreleasePools.html#//apple_ref/doc/uid/20000047-1041876
I replaced the calls to RetainPtr::autorelease with RetainPtr::get.  This causes us to keep the NSURLRequest and NSURLResponse alive as long as the request is being
responded to in WebKitLegacy and in El Capitan.  Given the number of ResourceRequest and ResourceResponse copies we store, this shouldn't be a problem memory-wise.
This will all go away once NSURLSession is used for loading in WebKitLegacy, and this is a large step towards that.

Source/WebKit:

* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::loadResource):
(WebKit::WebLoaderStrategy::schedulePluginStreamLoad):
* WebProcess/Network/WebLoaderStrategy.h:
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::Stream::start):

Source/WebKitLegacy:

* WebCoreSupport/WebResourceLoadScheduler.cpp:
(WebResourceLoadScheduler::loadResource):
(WebResourceLoadScheduler::schedulePluginStreamLoad):
* WebCoreSupport/WebResourceLoadScheduler.h:

Source/WebKitLegacy/mac:

* Plugins/Hosted/HostedNetscapePluginStream.mm:
(WebKit::HostedNetscapePluginStream::start):
* Plugins/WebNetscapePluginStream.mm:
(WebNetscapePluginStream::start):

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

23 months agoRemove stray logging from a newly added API test
wenson_hsieh@apple.com [Tue, 7 Nov 2017 00:55:08 +0000 (00:55 +0000)]
Remove stray logging from a newly added API test

This was only for debugging purposes, and should have been removed before landing.

Rubber-stamped by Tim Horton.

* TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm:
(TestWebKitAPI::TEST):

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

23 months agoWeb Inspector: Two little Layers tab fixes
ross.kirsling@sony.com [Tue, 7 Nov 2017 00:52:47 +0000 (00:52 +0000)]
Web Inspector: Two little Layers tab fixes
https://bugs.webkit.org/show_bug.cgi?id=179273

Reviewed by Devin Rousso.

* UserInterface/Views/LayerDetailsSidebarPanel.js:
(WI.LayerDetailsSidebarPanel.prototype.selectNodeByLayerId):
Even when we suppress refire of the selected event, we still want a popover.

* UserInterface/Views/Layers3DContentView.js:
(WI.Layers3DContentView):
(WI.Layers3DContentView.prototype.shown):
(WI.Layers3DContentView.prototype.hidden):
(WI.Layers3DContentView.prototype.closed):
(WI.Layers3DContentView.prototype._layerTreeDidChange):
Opening WI directly to the Layers tab wasn't fetching layers right away. Let's fetch on every shown() and
prune the hacky logic we were previously using -- it's overkill anyway, now that we're tracking mutations.

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

23 months agoOnly build ImageDiff for mac
jbedard@apple.com [Tue, 7 Nov 2017 00:48:41 +0000 (00:48 +0000)]
Only build ImageDiff for mac
https://bugs.webkit.org/show_bug.cgi?id=179349
<rdar://problem/35376237>

Reviewed by Tim Horton.

* ImageDiff/Makefile:

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

23 months agoUnreviewed, fix the internal build after updating to a newer SDK
wenson_hsieh@apple.com [Tue, 7 Nov 2017 00:45:08 +0000 (00:45 +0000)]
Unreviewed, fix the internal build after updating to a newer SDK

There shouldn't be any need to include and implement these method stubs anymore,
even when building against the shipping iOS 11 SDK.

* TestWebKitAPI/ios/DataInteractionSimulator.mm:
(-[MockDropSession session]): Deleted.

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

23 months ago[Attachment Support] Implement delegate hooks for attachment element insertion and...
wenson_hsieh@apple.com [Mon, 6 Nov 2017 21:46:54 +0000 (21:46 +0000)]
[Attachment Support] Implement delegate hooks for attachment element insertion and removal
https://bugs.webkit.org/show_bug.cgi?id=179016
<rdar://problem/35250890>

Reviewed by Tim Horton.

Source/WebCore:

Implements a mechanism for notifying WebKit2 clients when attachment elements are inserted into or removed from
the document. See per-change comments below for more details.

API tests: WKAttachmentTests.AttachmentElementInsertion
           WKAttachmentTests.AttachmentUpdatesWhenInsertingAndDeletingNewline
           WKAttachmentTests.AttachmentUpdatesWhenUndoingAndRedoing
           WKAttachmentTests.AttachmentUpdatesWhenChangingFontStyles
           WKAttachmentTests.AttachmentUpdatesWhenInsertingLists
           WKAttachmentTests.AttachmentUpdatesWhenInsertingRichMarkup

* editing/Editor.cpp:
(WebCore::Editor::respondToChangedSelection):
(WebCore::Editor::editorUIUpdateTimerFired):

Additionally notify the client of any attachment updates.

(WebCore::Editor::scheduleEditorUIUpdate):

Add a new helper that starts the editor UI update timer with 0 delay, and use it everywhere we schedule an
editor UI update.

(WebCore::Editor::didInsertAttachmentElement):
(WebCore::Editor::didRemoveAttachmentElement):

Maintain two sets of attachment element identifiers -- the first one tracking insertions, and the second one
tracking removals. When an attachment element is inserted, we first check to see if that attachment element has
just been removed; if so, we don't add it to the inserted identifiers set, but instead remove it from the set of
removed identifiers. We perform a similar check in the opposite case. This prevents us from notifying the client
of extraneous insertions and removals during certain editing commands which may reparent and move attachment
elements around. In both cases, we schedule an editor UI update afterwards, where we will notify the client of
attachment updates.

(WebCore::Editor::notifyClientOfAttachmentUpdates):
(WebCore::Editor::insertAttachmentFromFile):
* editing/Editor.h:
* html/HTMLAttachmentElement.cpp:
(WebCore::HTMLAttachmentElement::HTMLAttachmentElement):

Remove the version of HTMLAttachmentElement's constructor that takes a unique identifier.

(WebCore::HTMLAttachmentElement::insertedIntoAncestor):
(WebCore::HTMLAttachmentElement::removedFromAncestor):

Implement these hooks to observe insertion into and removal from the DOM. If the element was attached to or
removed from an ancestor that was connected to the document, call out to the document's frame's editor. This
"document-connected" rule prevents us from calling out to the client in cases where (for instance) we append an
attachment element to a newly created DocumentFragment in preparation for executing a ReplaceSelectionCommand.

(WebCore::HTMLAttachmentElement::uniqueIdentifier const):
(WebCore::HTMLAttachmentElement::setUniqueIdentifier):

Refactor unique identifier to refer to the new attachment identifier attribute instead of a member variable.

* html/HTMLAttachmentElement.h:
* html/HTMLAttributeNames.in:

Add a new attribute representing an attachment element's identifier. This enables us to keep track of particular
attachments as they are destroyed and recreated as different objects, as a result of some editing commands.

* page/EditorClient.h:
(WebCore::EditorClient::didInsertAttachment):
(WebCore::EditorClient::didRemoveAttachment):

Add boilerplate editor client hooks for attachment insertion and removal.

Source/WebKit:

Adds boilerplate plumbing to WebEditorClient, WebPage, and the usual machinery in the UI process to notify
WebKit2 clients when attachment elements have been inserted or removed from the document. See the WebCore
ChangeLog for more details about the implementation, or the Tools ChangeLog for more information about new API
tests.

* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _didInsertAttachment:]):
(-[WKWebView _didRemoveAttachment:]):
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/Cocoa/PageClientImplCocoa.h:
* UIProcess/Cocoa/PageClientImplCocoa.mm:
(WebKit::PageClientImplCocoa::didInsertAttachment):
(WebKit::PageClientImplCocoa::didRemoveAttachment):
* UIProcess/PageClient.h:
(WebKit::PageClient::didInsertAttachment):
(WebKit::PageClient::didRemoveAttachment):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didInsertAttachment):
(WebKit::WebPageProxy::didRemoveAttachment):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::didInsertAttachment):
(WebKit::WebEditorClient::didRemoveAttachment):
* WebProcess/WebCoreSupport/WebEditorClient.h:

Tools:

Introduces new API tests to check that various editing operations will or won't result in the new attachment
insertion and removal delegate hooks being fired. Additionally refactors an existing test to verify that
attachments insertion and removal is observable by the UI delegate.

* TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm:
(-[AttachmentUpdateObserver init]):
(-[AttachmentUpdateObserver inserted]):
(-[AttachmentUpdateObserver removed]):
(-[AttachmentUpdateObserver _webView:didInsertAttachment:]):
(-[AttachmentUpdateObserver _webView:didRemoveAttachment:]):
(TestWebKitAPI::ObserveAttachmentUpdatesForScope::ObserveAttachmentUpdatesForScope):
(TestWebKitAPI::ObserveAttachmentUpdatesForScope::~ObserveAttachmentUpdatesForScope):
(TestWebKitAPI::ObserveAttachmentUpdatesForScope::expectAttachmentUpdates):

Implement a testing mechanism to temporarily bind a UI delegate to a given WKWebView and listen for inserted or
removed attachments over the course of a particular scope. The API tests use this mechanism to check that the UI
delegate hooks added in this patch are invoked with the right attachments when performing edit commands.

(-[TestWKWebView _synchronouslyExecuteEditCommand:argument:]):
(-[TestWKWebView expectUpdatesAfterCommand:withArgument:expectedRemovals:expectedInsertions:]):
(TestWebKitAPI::TEST):

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

23 months agoUnreviewed, rolling out r224494.
ryanhaddad@apple.com [Mon, 6 Nov 2017 21:44:34 +0000 (21:44 +0000)]
Unreviewed, rolling out r224494.

Introduced LayoutTest flakiness on WK1.

Reverted changeset:

"[LayoutState cleanup] Move m_layoutState from RenderView to
LayoutContext"
https://bugs.webkit.org/show_bug.cgi?id=179282
https://trac.webkit.org/changeset/224494

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

23 months agoUIWebView is not rendering content that comes on screen during overflow scroll
simon.fraser@apple.com [Mon, 6 Nov 2017 21:41:12 +0000 (21:41 +0000)]
UIWebView is not rendering content that comes on screen during overflow scroll
https://bugs.webkit.org/show_bug.cgi?id=179277
rdar://problem/34272949

Reviewed by Tim Horton

When page or overflow scrolling happens, we do a traversal of GraphicsLayers to determine
whether the exposed part of tiled layers changed in a way that requires a change in the tile
coverage. If so, we schedule a compositing layer flush.

There was no equivalent logic for computing whether the "backing store detached" state
of a layer changed (which we use to throw away backing store of layers outside the viewport),
so after scrolling an accelerated overflow:scroll which contained composited layers, we
would sometimes fail to recompute that we should re-create backing store for revealed
layers.

Fix by having GraphicsLayerCA::recursiveVisibleRectChangeRequiresFlush() determine
whether 'intersectsCoverageRect' changed, and if so trigger a flush. This requires
tracking CommitState for isViewportConstrained-ness, just like we do during commits.

Also clean up code related to computing the visible rect passed into visibleRectChangeRequiresFlush() and
flushCompositingState(); these diverged for no good reason. Also clean up the logging a little.

Not testable because UIWebView layout tests are unreliable.

* page/ios/FrameIOS.mm:
(WebCore::Frame::viewportOffsetChanged):
(WebCore::Frame::overflowScrollPositionChangedForNode):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::recursiveVisibleRectChangeRequiresFlush const):
(WebCore::GraphicsLayerCA::visibleRectChangeRequiresFlush const):
* platform/graphics/ca/GraphicsLayerCA.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::visibleRectForLayerFlushing const):
(WebCore::RenderLayerCompositor::flushPendingLayerChanges):
(WebCore::RenderLayerCompositor::didChangeVisibleRect):
* rendering/RenderLayerCompositor.h:

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

23 months agoiOS element fullscreen should use a UIGestureRecognizer to detect user interaction.
commit-queue@webkit.org [Mon, 6 Nov 2017 21:35:11 +0000 (21:35 +0000)]
iOS element fullscreen should use a UIGestureRecognizer to detect user interaction.
https://bugs.webkit.org/show_bug.cgi?id=179029
rdar://problem/35307882

Patch by Jeremy Jones <jeremyj@apple.com> on 2017-11-06
Reviewed by Simon Fraser.

Replace _WKTapDelegatingView with a UILongPressGestureRecognizer. When set with a duration of 0, it effectively
recognizes UITouchBegin events.

* UIProcess/ios/WKFullScreenWindowControllerIOS.mm:
(-[_WKFullScreenViewController loadView]):
(-[_WKFullScreenViewController gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
(-[_WKTapDelegatingView setTarget:action:]): Deleted.
(-[_WKTapDelegatingView hitTest:withEvent:]): Deleted.

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

23 months agoWeb Inspector: no way to navigate from Resource tree element to its entry in Network Tab
joepeck@webkit.org [Mon, 6 Nov 2017 21:08:01 +0000 (21:08 +0000)]
Web Inspector: no way to navigate from Resource tree element to its entry in Network Tab
https://bugs.webkit.org/show_bug.cgi?id=179328
<rdar://problem/35367294>

Reviewed by Brian Burg.

* Localizations/en.lproj/localizedStrings.js:
New reveal in network tab string.

* UserInterface/Base/Main.js:
(WI.isShowingNetworkTab):
Utility to know if the network tab is showing.

* UserInterface/Views/ContextMenuUtilities.js:
(WI.appendContextMenuItemsForSourceCode):
(showResourceWithOptions):
(WI.appendContextMenuItemsForURL):
Generalize context menus for just a URL.

* UserInterface/Views/TabBrowser.js:
(WI.TabBrowser.prototype.bestTabContentViewForRepresentedObject):
Support more tab ignore options, this is starting to get icky. We may want to
move to just a preferredTab approach, since that is what some of these want.

* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype._populateTagContextMenu):
Make use of new ContextMenu utility to add menu items for a URL.

* UserInterface/Views/NetworkTabContentView.js:
(WI.NetworkTabContentView.prototype.showRepresentedObject):
* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView.prototype.showRepresentedObject):
Handle showing a Resource in the NetworkTab. We immediately show
the details view for it, otherwise we fallback to the list view.

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

23 months agoUncaught Exception: TypeError: null is not an object (evaluating 'mimeType.endsWith')
commit-queue@webkit.org [Mon, 6 Nov 2017 20:32:06 +0000 (20:32 +0000)]
Uncaught Exception: TypeError: null is not an object (evaluating 'mimeType.endsWith')
https://bugs.webkit.org/show_bug.cgi?id=179325
<rdar://problem/35366896>

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

Source/WebInspectorUI:

* UserInterface/Base/MIMETypeUtilities.js:
(WI.fileExtensionForMIMEType):
(WI.shouldTreatMIMETypeAsText):
Handle null mime types.

LayoutTests:

* inspector/unit-tests/mimetype-utilities-expected.txt:
* inspector/unit-tests/mimetype-utilities.html:
Add tests for null cases.

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

23 months ago[Service Workers] Add proper implementation for 'updatefound' event
cdumez@apple.com [Mon, 6 Nov 2017 20:22:11 +0000 (20:22 +0000)]
[Service Workers] Add proper implementation for 'updatefound' event
https://bugs.webkit.org/show_bug.cgi?id=179302

Reviewed by Brady Eidson.

Source/WebCore:

Add proper implementation for 'updatefound' event instead of faking it.
The 'updatefound' event firing is now triggered from the StorageProcess,
during the install steps, instead of being fired on WebContent process
side in jobResolvedWithRegistration().

Specification:
- https://w3c.github.io/ServiceWorker/#install (step 7)

* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::scheduleJob):
(WebCore::ServiceWorkerContainer::fireUpdateFoundEvent):
(WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
(WebCore::ServiceWorkerContainer::jobDidFinish):
* workers/service/ServiceWorkerContainer.h:
* workers/service/server/SWClientConnection.cpp:
(WebCore::SWClientConnection::fireUpdateFoundEvent):
* workers/service/server/SWClientConnection.h:
* workers/service/server/SWServer.h:
* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::scriptContextStarted):
(WebCore::SWServerJobQueue::install):
* workers/service/server/SWServerJobQueue.h:
* workers/service/server/SWServerRegistration.cpp:
(WebCore::SWServerRegistration::fireUpdateFoundEvent):
* workers/service/server/SWServerRegistration.h:

Source/WebKit:

* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::fireUpdateFoundEvent):
* StorageProcess/ServiceWorker/WebSWServerConnection.h:
* WebProcess/Storage/WebSWClientConnection.messages.in:

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

23 months agoUse enum classes within FileSystem
commit-queue@webkit.org [Mon, 6 Nov 2017 20:20:28 +0000 (20:20 +0000)]
Use enum classes within FileSystem
https://bugs.webkit.org/show_bug.cgi?id=175172

Patch by Christopher Reid <chris.reid@sony.com> on 2017-11-06
Reviewed by Myles C. Maxfield.

Source/WebCore:

No new tests, no change in behavior.

Using enum classes in filesystem to enforce stronger type safety.

* Modules/webdatabase/OriginLock.cpp:
* loader/appcache/ApplicationCacheStorage.cpp:
* platform/FileHandle.h:
* platform/FileStream.cpp:
* platform/FileSystem.cpp:
* platform/FileSystem.h:
* platform/cocoa/FileMonitorCocoa.mm:
* platform/glib/FileSystemGlib.cpp:
* platform/network/curl/CurlCacheEntry.cpp:
* platform/network/curl/CurlCacheManager.cpp:
* platform/posix/FileSystemPOSIX.cpp:
* platform/win/FileSystemWin.cpp:
* rendering/RenderThemeWin.cpp:

Source/WebKit:

* NetworkProcess/Downloads/BlobDownloadClient.cpp:
* NetworkProcess/NetworkDataTaskBlob.cpp:
* NetworkProcess/cache/NetworkCache.cpp:
* NetworkProcess/capture/NetworkCaptureManager.cpp:
* NetworkProcess/capture/NetworkCaptureRecorder.cpp:
* Shared/WebMemorySampler.cpp:
* UIProcess/API/APIContentRuleListStore.cpp:
* UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:

Source/WebKitLegacy/win:

* Plugins/PluginDatabase.cpp:

Source/WTF:

Adding a helper function for converting enum classes to their underlying type when necessary.

* wtf/EnumTraits.h:

Tools:

* TestWebKitAPI/Tests/WebCore/FileMonitor.cpp:
* TestWebKitAPI/Tests/WebCore/cocoa/DatabaseTrackerTest.mm:

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

23 months agoUnreviewed, rolling out r224497.
commit-queue@webkit.org [Mon, 6 Nov 2017 19:50:09 +0000 (19:50 +0000)]
Unreviewed, rolling out r224497.
https://bugs.webkit.org/show_bug.cgi?id=179335

It is breaking internal builds (Requested by youenn on
#webkit).

Reverted changeset:

"Use VCP H264 encoder for platforms supporting it"
https://bugs.webkit.org/show_bug.cgi?id=179076
https://trac.webkit.org/changeset/224497

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

23 months agoScriptExecutionContext::serviceWorkerContainer() should avoid constructing a Navigato...
cdumez@apple.com [Mon, 6 Nov 2017 19:46:35 +0000 (19:46 +0000)]
ScriptExecutionContext::serviceWorkerContainer() should avoid constructing a Navigator object
https://bugs.webkit.org/show_bug.cgi?id=179322

Reviewed by Sam Weinig.

ScriptExecutionContext::serviceWorkerContainer() should avoid constructing a Navigator object
unnecessarily.

* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::serviceWorkerContainer):
* page/DOMWindow.h:

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

23 months agoWeb Inspector: Selecting a DOM Search Result in Search Tab unexpectedly changes Tabs
joepeck@webkit.org [Mon, 6 Nov 2017 18:56:38 +0000 (18:56 +0000)]
Web Inspector: Selecting a DOM Search Result in Search Tab unexpectedly changes Tabs
https://bugs.webkit.org/show_bug.cgi?id=179223
<rdar://problem/33949556>

Reviewed by Devin Rousso.

* Localizations/en.lproj/localizedStrings.js:
New string.

* UserInterface/Views/SearchResultTreeElement.js:
(WI.SearchResultTreeElement.prototype.populateContextMenu):
Add a context menu for search results to jump to a different tab.
These behaviors match the double click behavior for search results.

* UserInterface/Views/SearchTabContentView.js:
(WI.SearchTabContentView.prototype.canShowRepresentedObject):
Always support showing a DOM Tree. Clients should be using
ignoreSearchTab if they don't want to jump here.

* UserInterface/Views/DOMTreeDataGridNode.js:
(WI.DOMTreeDataGridNode.prototype._goToArrowWasClicked):
* UserInterface/Views/LayerTreeDataGridNode.js:
(WI.LayerTreeDataGridNode.prototype._goToArrowWasClicked):
Use ignoreSearchTab just in case when showing a DOM Tree.

* UserInterface/Views/ContentBrowser.js:
(WI.ContentBrowser.prototype.shown):
When showing, update our UI to reflect the values of the current content view, which
for a while may have been owned by another ContentBrowser.

(WI.ContentBrowser.prototype._contentViewSelectionPathComponentDidChange):
(WI.ContentBrowser.prototype._contentViewSupplementalRepresentedObjectsDidChange):
(WI.ContentBrowser.prototype._contentViewNavigationItemsDidChange):
We can avoid work in a few places where we might not be the owning ContentBrowser
of a ContentView that is changing.

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

23 months agoSource/WebCore:
commit-queue@webkit.org [Mon, 6 Nov 2017 17:56:35 +0000 (17:56 +0000)]
Source/WebCore:
Added mime type check to the picture source preloader to avoid downloading incompatible resources.
https://bugs.webkit.org/show_bug.cgi?id=179231

Patch by Colin Bendell <colin@bendell.ca> on 2017-11-06
Reviewed by Alex Christensen.

Test: http/tests/loading/preload-picture-type.html

* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::StartTagScanner::processAttributes): include type match state when selecting candidate imgs
(WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): added type attribute evaluation and matching

LayoutTests:
Add tests to ensure that <source> tags are only preloaded when the `type`
attribute matches.
https://bugs.webkit.org/show_bug.cgi?id=179231

Patch by Colin Bendell <colin@bendell.ca> on 2017-11-06
Reviewed by Alex Christensen.

* http/tests/loading/preload-picture-type-expected.txt: Added.
* http/tests/loading/preload-picture-type.html: Added.

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

23 months agoUse VCP H264 encoder for platforms supporting it
commit-queue@webkit.org [Mon, 6 Nov 2017 17:48:45 +0000 (17:48 +0000)]
Use VCP H264 encoder for platforms supporting it
https://bugs.webkit.org/show_bug.cgi?id=179076
rdar://problem/35180773

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

Source/ThirdParty/libwebrtc:

* Configurations/libwebrtc.iOS.exp:
* Configurations/libwebrtc.iOSsim.exp:
* Configurations/libwebrtc.mac.exp:
* Source/webrtc/sdk/objc/Framework/Classes/VideoProcessing/encoder_vcp.h: Added.
(webrtc::H264VideoToolboxEncoderVCP::SetActive):
* Source/webrtc/sdk/objc/Framework/Classes/VideoProcessing/encoder_vcp.mm: Copied from Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/encoder.mm.
* Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/encoder.mm:
(internal::CFStringToString):
(internal::SetVTSessionProperty):
(internal::CopyVideoFrameToPixelBuffer):
(internal::CreatePixelBuffer):
(internal::VTCompressionOutputCallback):
(internal::ExtractProfile):
* Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/videocodecfactory.h:
* Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/videocodecfactory.mm:
(webrtc::VideoToolboxVideoEncoderFactory::VideoToolboxVideoEncoderFactory):
(webrtc::VideoToolboxVideoEncoderFactory::CreateSupportedVideoEncoder):
* libwebrtc.xcodeproj/project.pbxproj:

Source/WebCore:

Covered by existing test coverage.

* platform/mediastream/libwebrtc/VideoToolBoxEncoderFactory.cpp:
(WebCore::VideoToolboxVideoEncoderFactory::setActive):
(WebCore::VideoToolboxVideoEncoderFactory::CreateSupportedVideoEncoder):
(WebCore::VideoToolboxVideoEncoderFactory::DestroyVideoEncoder):
* platform/mediastream/libwebrtc/VideoToolBoxEncoderFactory.h:

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

23 months agoServiceWorkerContainer should take a PendingActivity while a service worker job is...
cdumez@apple.com [Mon, 6 Nov 2017 17:47:58 +0000 (17:47 +0000)]
ServiceWorkerContainer should take a PendingActivity while a service worker job is pending
https://bugs.webkit.org/show_bug.cgi?id=179321

Reviewed by Youenn Fablet.

ServiceWorkerContainer should take a PendingActivity while a service worker job is pending.
ServiceWorkerContainer is an ActiveDOMObject and taking such pending activity makes sure
the object stays alive while a job is pending (and a promise is not resolved yet). It also
makes sure the document does not get suspended in the middle of a job.

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

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

23 months ago@media rules ignored in user agent style sheet html.css
antti@apple.com [Mon, 6 Nov 2017 17:45:50 +0000 (17:45 +0000)]
@media rules ignored in user agent style sheet html.css
https://bugs.webkit.org/show_bug.cgi?id=169245
<rdar://problem/30885951>

Reviewed by Darin Adler.

To support accessibility features, allow non-trivial @media rules in user agent stylesheet.

This patch creates a special stylesheet consisting of rules with media queries seen on user agent stylesheets.
The queries on this sheet are evaluated with the document's media query evaluator.

No tests as I don't want to add things to UA style just for testing purposes. This will
gain coverage when the feature is used.

 * css/CSSDefaultStyleSheets.cpp:
(WebCore::CSSDefaultStyleSheets::addToDefaultStyle):

    Add a helper.
    Build a new stylesheet that consists of complex media rules seen in user agent sheets.

(WebCore::CSSDefaultStyleSheets::loadFullDefaultStyle):
(WebCore::CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement):
* css/CSSDefaultStyleSheets.h:
* css/DocumentRuleSets.cpp:
(WebCore::DocumentRuleSets::userAgentMediaQueryStyle const):

    Rule set constructed from media queries seen on UA sheet.

(WebCore::DocumentRuleSets::updateUserAgentMediaQueryStyleIfNeeded const):

    Evalute the media queries if needed.
    Re-evaluate if the rule count of the media query stylesheet increases
    (this could happen when additional UA style is added).

(WebCore::DocumentRuleSets::resetUserAgentMediaQueryStyle):
(WebCore::DocumentRuleSets::collectFeatures const):

    Collect the features from userAgentMediaQueryStyle.

* css/DocumentRuleSets.h:
(WebCore::DocumentRuleSets::setIsForShadowScope):
* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::ElementRuleCollector):
(WebCore::ElementRuleCollector::matchUARules):

    Also match rules in userAgentMediaQueryStyle.

* css/ElementRuleCollector.h:
* css/InspectorCSSOMWrappers.cpp:
(WebCore::InspectorCSSOMWrappers::collectDocumentWrappers):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::StyleResolver):
* style/StyleScope.cpp:
(WebCore::Style::Scope::resolver):

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

23 months ago[LayoutState cleanup] Move m_layoutState from RenderView to LayoutContext
zalan@apple.com [Mon, 6 Nov 2017 17:45:09 +0000 (17:45 +0000)]
[LayoutState cleanup] Move m_layoutState from RenderView to LayoutContext
https://bugs.webkit.org/show_bug.cgi?id=179282
<rdar://problem/35348653>

Reviewed by Antti Koivisto.

LayoutContext now owns the top level LayoutState object.
It makes RenderView behave like any other renderer by constructing a LayoutStateMaintainer on the stack.
This is mostly moving code from RenderView.h/.cpp to LayoutContext.h/.cpp and fixing the callsites.
(While view().frameView().layoutContext().layoutState() is a bit lengthy, it's
temporary only, since LayoutState is planned to be an argument of the layout() method.

Covered by existing test.

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::notificationPostTimerFired):
* page/LayoutContext.cpp:
(WebCore::LayoutContext::layoutDelta const):
(WebCore::LayoutContext::addLayoutDelta):
(WebCore::LayoutContext::layoutDeltaMatches):
(WebCore::LayoutContext::pushLayoutState):
(WebCore::LayoutContext::pushLayoutStateForPaginationIfNeeded):
(WebCore::LayoutContext::popLayoutState):
(WebCore::LayoutContext::checkLayoutState):
* page/LayoutContext.h:
(WebCore::LayoutContext::layoutState const):
(WebCore::LayoutContext::layoutStateEnabled const):
(WebCore::LayoutContext::disableLayoutState):
(WebCore::LayoutContext::enableLayoutState):
* rendering/LayoutState.cpp:
(WebCore::LayoutState::LayoutState):
(WebCore::LayoutState::computeClipRect):
(WebCore::LayoutStateMaintainer::LayoutStateMaintainer):
(WebCore::LayoutStateMaintainer::push):
(WebCore::LayoutStateMaintainer::pop):
(WebCore::LayoutStateDisabler::LayoutStateDisabler):
(WebCore::LayoutStateDisabler::~LayoutStateDisabler):
(WebCore::SubtreeLayoutStateMaintainer::SubtreeLayoutStateMaintainer):
(WebCore::SubtreeLayoutStateMaintainer::~SubtreeLayoutStateMaintainer):
(WebCore::PaginatedLayoutStateMaintainer::PaginatedLayoutStateMaintainer):
(WebCore::PaginatedLayoutStateMaintainer::~PaginatedLayoutStateMaintainer):
* rendering/LayoutState.h:
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::setLogicalLeftForChild):
(WebCore::RenderBlock::setLogicalTopForChild):
(WebCore::RenderBlock::layoutPositionedObject):
(WebCore::RenderBlock::markForPaginationRelayoutIfNeeded):
(WebCore::RenderBlock::adjustLogicalLeftOffsetForLine const):
(WebCore::RenderBlock::adjustLogicalRightOffsetForLine const):
(WebCore::RenderBlock::offsetFromLogicalTopOfFirstPage const):
(WebCore::RenderBlock::childBoxIsUnsplittableForFragmentation const):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutBlock):
(WebCore::RenderBlockFlow::layoutBlockChildren):
(WebCore::RenderBlockFlow::layoutBlockChild):
(WebCore::RenderBlockFlow::collapseMarginsWithChildInfo):
(WebCore::RenderBlockFlow::estimateLogicalTopPosition):
(WebCore::RenderBlockFlow::applyBeforeBreak):
(WebCore::RenderBlockFlow::applyAfterBreak):
(WebCore::RenderBlockFlow::hasNextPage const):
(WebCore::RenderBlockFlow::pageLogicalTopForOffset const):
(WebCore::RenderBlockFlow::pageLogicalHeightForOffset const):
(WebCore::RenderBlockFlow::pageRemainingLogicalHeightForOffset const):
(WebCore::RenderBlockFlow::repaintOverhangingFloats):
(WebCore::RenderBlockFlow::insertFloatingObject):
(WebCore::RenderBlockFlow::positionNewFloats):
(WebCore::RenderBlockFlow::layoutSimpleLines):
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::layoutRunsAndFloats):
(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
(WebCore::RenderBlockFlow::linkToEndLineIfNeeded):
(WebCore::RenderBlockFlow::layoutLineBoxes):
(WebCore::RenderBlockFlow::determineStartPosition):
(WebCore::RenderBlockFlow::checkPaginationAndFloatsAtEndLine):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::outlineBoundsForRepaint const):
(WebCore::RenderBox::mapLocalToContainer const):
(WebCore::RenderBox::clippedOverflowRectForRepaint const):
(WebCore::RenderBox::computeRectForRepaint const):
(WebCore::RenderBox::offsetFromLogicalTopOfFirstPage const):
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::layoutBlock):
(WebCore::layoutChildIfNeededApplyingDelta):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::insertChildInternal):
(WebCore::RenderElement::takeChildInternal):
* rendering/RenderEmbeddedObject.cpp:
* rendering/RenderFragmentedFlow.cpp:
(WebCore::RenderFragmentedFlow::repaintRectangleInFragments const):
* rendering/RenderGrid.cpp:
* rendering/RenderInline.cpp:
(WebCore::RenderInline::clippedOverflowRectForRepaint const):
(WebCore::RenderInline::computeRectForRepaint const):
(WebCore::RenderInline::mapLocalToContainer const):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateLayerPositions):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::layout):
* rendering/RenderMediaControlElements.cpp:
(WebCore::RenderMediaVolumeSliderContainer::layout):
(WebCore::RenderMediaControlTimelineContainer::layout):
(WebCore::RenderTextTrackContainerElement::layout):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::repaintRectangle const):
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::clippedOverflowRectForRepaint const):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::layout):
(WebCore::RenderTable::markForPaginationRelayoutIfNeeded):
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::clippedOverflowRectForRepaint const):
(WebCore::RenderTableCell::computeRectForRepaint const):
* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::layout):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::calcRowLogicalHeight):
(WebCore::RenderTableSection::layout):
(WebCore::RenderTableSection::layoutRows):
(WebCore::RenderTableSection::setLogicalPositionForCell const):
* rendering/RenderVTTCue.cpp:
* rendering/RenderView.cpp:
(WebCore::RenderView::layout):
(WebCore::RenderView::layoutContent): Deleted.
(WebCore::RenderView::checkLayoutState): Deleted.
(WebCore::RenderView::initializeLayoutState): Deleted.
(WebCore::RenderView::pushLayoutState): Deleted.
(WebCore::RenderView::pushLayoutStateForPaginationIfNeeded): Deleted.
* rendering/RenderView.h:
* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::lineSnapAdjustment const):
* rendering/svg/RenderSVGContainer.cpp:
(WebCore::RenderSVGContainer::layout):
* rendering/svg/RenderSVGForeignObject.cpp:
(WebCore::RenderSVGForeignObject::layout):
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::layout):
* style/RenderTreeUpdaterFirstLetter.cpp:
(WebCore::RenderTreeUpdater::FirstLetter::update):
* style/RenderTreeUpdaterListItem.cpp:
(WebCore::RenderTreeUpdater::ListItem::updateMarker):

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

23 months agoUnreviewed, fix WPE build after r224492
mcatanzaro@igalia.com [Mon, 6 Nov 2017 16:36:45 +0000 (16:36 +0000)]
Unreviewed, fix WPE build after r224492
https://bugs.webkit.org/show_bug.cgi?id=179009

* Source/cmake/OptionsWPE.cmake:

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

23 months ago[WPE] Clean up OptionsWPE.cmake
mcatanzaro@igalia.com [Mon, 6 Nov 2017 16:27:25 +0000 (16:27 +0000)]
[WPE] Clean up OptionsWPE.cmake
https://bugs.webkit.org/show_bug.cgi?id=179009

Reviewed by Žan Doberšek.

* Source/cmake/OptionsWPE.cmake:

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

23 months agoCodeBlock::usesOpcode() is dead code
rmorisset@apple.com [Mon, 6 Nov 2017 14:55:31 +0000 (14:55 +0000)]
CodeBlock::usesOpcode() is dead code
https://bugs.webkit.org/show_bug.cgi?id=179316

Reviewed by Yusuke Suzuki.

Remove CodeBlock::usesOpcode which is dead code

* bytecode/CodeBlock.cpp:
* bytecode/CodeBlock.h:

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

23 months ago[WPE][GTK] Always use SET_AND_EXPOSE_TO_BUILD to set build variables
mcatanzaro@igalia.com [Mon, 6 Nov 2017 14:43:36 +0000 (14:43 +0000)]
[WPE][GTK] Always use SET_AND_EXPOSE_TO_BUILD to set build variables
https://bugs.webkit.org/show_bug.cgi?id=179038

Reviewed by Žan Doberšek.

.:

* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsWPE.cmake:

Source/WTF:

* wtf/Platform.h:

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

23 months ago[WPE] Properly use SYSTEM_INCLUDE_DIRECTORIES for WebKit build target
mcatanzaro@igalia.com [Mon, 6 Nov 2017 14:43:32 +0000 (14:43 +0000)]
[WPE] Properly use SYSTEM_INCLUDE_DIRECTORIES for WebKit build target
https://bugs.webkit.org/show_bug.cgi?id=179097

Reviewed by Žan Doberšek.

* PlatformWPE.cmake:

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

23 months ago[WPE] -Wsign-compare warning in EventSenderProxyWPE.cpp
mcatanzaro@igalia.com [Mon, 6 Nov 2017 14:42:55 +0000 (14:42 +0000)]
[WPE] -Wsign-compare warning in EventSenderProxyWPE.cpp
https://bugs.webkit.org/show_bug.cgi?id=179039

Reviewed by Žan Doberšek.

* WebKitTestRunner/wpe/EventSenderProxyWPE.cpp:
(WTR::EventSenderProxy::updateTouchPoint):
(WTR::EventSenderProxy::releaseTouchPoint):

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

23 months agoJIT call inline caches should cache calls to objects with getCallData/getConstructDat...
utatane.tea@gmail.com [Mon, 6 Nov 2017 14:40:08 +0000 (14:40 +0000)]
JIT call inline caches should cache calls to objects with getCallData/getConstructData traps
https://bugs.webkit.org/show_bug.cgi?id=144458

Reviewed by Saam Barati.

JSTests:

* microbenchmarks/dfg-internal-function-call.js: Added.
(target):
* microbenchmarks/dfg-internal-function-construct.js: Added.
(target):
* microbenchmarks/dfg-internal-function-not-handled-call.js: Added.
(target):
* microbenchmarks/dfg-internal-function-not-handled-construct.js: Added.
(target):
* stress/dfg-internal-function-call.js: Added.
(shouldBe):
(target):
* stress/dfg-internal-function-construct.js: Added.
(shouldBe):
(target):
* stress/internal-function-call.js: Added.
(shouldBe):
* stress/internal-function-construct.js: Added.
(shouldBe):

Source/JavaScriptCore:

Previously only JSFunction is handled by CallLinkInfo's caching mechanism. This means that
InternalFunction calls are not cached and they always go to the slow path. This is not good because

1. We need to query getCallData/getConstructData every time in the slow path.
2. CallLinkInfo tells nothing in the higher tier JITs.

This patch starts handling InternalFunction in CallLinkInfo's caching mechanism. We change InternalFunction
to hold pointers to the functions for call and construct. We have new stubs that can call/construct
InternalFunction. And we return this code pointer as a result of setup call to use CallLinkInfo mechanism.

This patch is critical to optimizing derived Array construction[1] since it starts using CallLinkInfo
for InternalFunction. Previously we did not record any information to CallLinkInfo. Except for the
case that DFGByteCodeParser figures out InternalFunction constant, we cannot attempt to emit DFG
nodes for these InternalFunctions since CallLinkInfo tells us nothing.

Attached microbenchmarks show performance improvement.

                                                   baseline                  patched

dfg-internal-function-construct                 1.6439+-0.0826     ^      1.2829+-0.0727        ^ definitely 1.2813x faster
dfg-internal-function-not-handled-construct     2.1862+-0.1361            2.0696+-0.1201          might be 1.0564x faster
dfg-internal-function-not-handled-call         20.7592+-0.9085           19.7369+-0.7921          might be 1.0518x faster
dfg-internal-function-call                      1.6856+-0.0967     ^      1.2771+-0.0744        ^ definitely 1.3198x faster

[1]: https://bugs.webkit.org/show_bug.cgi?id=178064

* API/JSCallbackFunction.cpp:
(JSC::JSCallbackFunction::JSCallbackFunction):
(JSC::JSCallbackFunction::getCallData): Deleted.
* API/JSCallbackFunction.h:
(JSC::JSCallbackFunction::createStructure):
* API/ObjCCallbackFunction.h:
(JSC::ObjCCallbackFunction::createStructure):
* API/ObjCCallbackFunction.mm:
(JSC::ObjCCallbackFunction::ObjCCallbackFunction):
(JSC::ObjCCallbackFunction::getCallData): Deleted.
(JSC::ObjCCallbackFunction::getConstructData): Deleted.
* bytecode/BytecodeDumper.cpp:
(JSC::BytecodeDumper<Block>::printCallOp):
* bytecode/BytecodeList.json:
* bytecode/CallLinkInfo.cpp:
(JSC::CallLinkInfo::setCallee):
(JSC::CallLinkInfo::callee):
(JSC::CallLinkInfo::setLastSeenCallee):
(JSC::CallLinkInfo::lastSeenCallee):
(JSC::CallLinkInfo::visitWeak):
* bytecode/CallLinkInfo.h:
* bytecode/CallLinkStatus.cpp:
(JSC::CallLinkStatus::computeFromCallLinkInfo):
* bytecode/LLIntCallLinkInfo.h:
* jit/JITOperations.cpp:
* jit/JITThunks.cpp:
(JSC::JITThunks::ctiInternalFunctionCall):
(JSC::JITThunks::ctiInternalFunctionConstruct):
* jit/JITThunks.h:
* jit/Repatch.cpp:
(JSC::linkFor):
(JSC::linkPolymorphicCall):
* jit/Repatch.h:
* jit/ThunkGenerators.cpp:
(JSC::virtualThunkFor):
(JSC::nativeForGenerator):
(JSC::nativeCallGenerator):
(JSC::nativeTailCallGenerator):
(JSC::nativeTailCallWithoutSavedTagsGenerator):
(JSC::nativeConstructGenerator):
(JSC::internalFunctionCallGenerator):
(JSC::internalFunctionConstructGenerator):
* jit/ThunkGenerators.h:
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::setUpCall):
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/ArrayConstructor.cpp:
(JSC::ArrayConstructor::ArrayConstructor):
(JSC::ArrayConstructor::getConstructData): Deleted.
(JSC::ArrayConstructor::getCallData): Deleted.
* runtime/ArrayConstructor.h:
(JSC::ArrayConstructor::createStructure):
* runtime/AsyncFunctionConstructor.cpp:
(JSC::AsyncFunctionConstructor::AsyncFunctionConstructor):
(JSC::AsyncFunctionConstructor::finishCreation):
(JSC::AsyncFunctionConstructor::getCallData): Deleted.
(JSC::AsyncFunctionConstructor::getConstructData): Deleted.
* runtime/AsyncFunctionConstructor.h:
(JSC::AsyncFunctionConstructor::createStructure):
* runtime/AsyncGeneratorFunctionConstructor.cpp:
(JSC::AsyncGeneratorFunctionConstructor::AsyncGeneratorFunctionConstructor):
(JSC::AsyncGeneratorFunctionConstructor::finishCreation):
(JSC::AsyncGeneratorFunctionConstructor::getCallData): Deleted.
(JSC::AsyncGeneratorFunctionConstructor::getConstructData): Deleted.
* runtime/AsyncGeneratorFunctionConstructor.h:
(JSC::AsyncGeneratorFunctionConstructor::createStructure):
* runtime/BooleanConstructor.cpp:
(JSC::callBooleanConstructor):
(JSC::BooleanConstructor::BooleanConstructor):
(JSC::BooleanConstructor::finishCreation):
(JSC::BooleanConstructor::getConstructData): Deleted.
(JSC::BooleanConstructor::getCallData): Deleted.
* runtime/BooleanConstructor.h:
(JSC::BooleanConstructor::createStructure):
* runtime/DateConstructor.cpp:
(JSC::DateConstructor::DateConstructor):
(JSC::DateConstructor::getConstructData): Deleted.
(JSC::DateConstructor::getCallData): Deleted.
* runtime/DateConstructor.h:
(JSC::DateConstructor::createStructure):
* runtime/Error.h:
(JSC::StrictModeTypeErrorFunction::StrictModeTypeErrorFunction):
(JSC::StrictModeTypeErrorFunction::createStructure):
(JSC::StrictModeTypeErrorFunction::getConstructData): Deleted.
(JSC::StrictModeTypeErrorFunction::getCallData): Deleted.
* runtime/ErrorConstructor.cpp:
(JSC::ErrorConstructor::ErrorConstructor):
(JSC::ErrorConstructor::getConstructData): Deleted.
(JSC::ErrorConstructor::getCallData): Deleted.
* runtime/ErrorConstructor.h:
(JSC::ErrorConstructor::createStructure):
* runtime/FunctionConstructor.cpp:
(JSC::FunctionConstructor::FunctionConstructor):
(JSC::FunctionConstructor::finishCreation):
(JSC::FunctionConstructor::getConstructData): Deleted.
(JSC::FunctionConstructor::getCallData): Deleted.
* runtime/FunctionConstructor.h:
(JSC::FunctionConstructor::createStructure):
* runtime/FunctionPrototype.cpp:
(JSC::callFunctionPrototype):
(JSC::FunctionPrototype::FunctionPrototype):
(JSC::FunctionPrototype::getCallData): Deleted.
* runtime/FunctionPrototype.h:
(JSC::FunctionPrototype::createStructure):
* runtime/GeneratorFunctionConstructor.cpp:
(JSC::GeneratorFunctionConstructor::GeneratorFunctionConstructor):
(JSC::GeneratorFunctionConstructor::finishCreation):
(JSC::GeneratorFunctionConstructor::getCallData): Deleted.
(JSC::GeneratorFunctionConstructor::getConstructData): Deleted.
* runtime/GeneratorFunctionConstructor.h:
(JSC::GeneratorFunctionConstructor::createStructure):
* runtime/InternalFunction.cpp:
(JSC::InternalFunction::InternalFunction):
(JSC::InternalFunction::finishCreation):
(JSC::InternalFunction::getCallData):
(JSC::InternalFunction::getConstructData):
* runtime/InternalFunction.h:
(JSC::InternalFunction::createStructure):
(JSC::InternalFunction::nativeFunctionFor):
(JSC::InternalFunction::offsetOfNativeFunctionFor):
* runtime/IntlCollatorConstructor.cpp:
(JSC::IntlCollatorConstructor::createStructure):
(JSC::IntlCollatorConstructor::IntlCollatorConstructor):
(JSC::IntlCollatorConstructor::getConstructData): Deleted.
(JSC::IntlCollatorConstructor::getCallData): Deleted.
* runtime/IntlCollatorConstructor.h:
* runtime/IntlDateTimeFormatConstructor.cpp:
(JSC::IntlDateTimeFormatConstructor::createStructure):
(JSC::IntlDateTimeFormatConstructor::IntlDateTimeFormatConstructor):
(JSC::IntlDateTimeFormatConstructor::getConstructData): Deleted.
(JSC::IntlDateTimeFormatConstructor::getCallData): Deleted.
* runtime/IntlDateTimeFormatConstructor.h:
* runtime/IntlNumberFormatConstructor.cpp:
(JSC::IntlNumberFormatConstructor::createStructure):
(JSC::IntlNumberFormatConstructor::IntlNumberFormatConstructor):
(JSC::IntlNumberFormatConstructor::getConstructData): Deleted.
(JSC::IntlNumberFormatConstructor::getCallData): Deleted.
* runtime/IntlNumberFormatConstructor.h:
* runtime/JSArrayBufferConstructor.cpp:
(JSC::JSArrayBufferConstructor::JSArrayBufferConstructor):
(JSC::JSArrayBufferConstructor::createStructure):
(JSC::JSArrayBufferConstructor::getConstructData): Deleted.
(JSC::JSArrayBufferConstructor::getCallData): Deleted.
* runtime/JSArrayBufferConstructor.h:
* runtime/JSGenericTypedArrayViewConstructor.h:
* runtime/JSGenericTypedArrayViewConstructorInlines.h:
(JSC::JSGenericTypedArrayViewConstructor<ViewClass>::JSGenericTypedArrayViewConstructor):
(JSC::JSGenericTypedArrayViewConstructor<ViewClass>::createStructure):
(JSC::JSGenericTypedArrayViewConstructor<ViewClass>::getConstructData): Deleted.
(JSC::JSGenericTypedArrayViewConstructor<ViewClass>::getCallData): Deleted.
* runtime/JSInternalPromiseConstructor.cpp:
(JSC::JSInternalPromiseConstructor::createStructure):
(JSC::JSInternalPromiseConstructor::JSInternalPromiseConstructor):
(JSC::JSInternalPromiseConstructor::getConstructData): Deleted.
(JSC::JSInternalPromiseConstructor::getCallData): Deleted.
* runtime/JSInternalPromiseConstructor.h:
* runtime/JSPromiseConstructor.cpp:
(JSC::JSPromiseConstructor::createStructure):
(JSC::JSPromiseConstructor::JSPromiseConstructor):
(JSC::JSPromiseConstructor::getConstructData): Deleted.
(JSC::JSPromiseConstructor::getCallData): Deleted.
* runtime/JSPromiseConstructor.h:
* runtime/JSType.h:
* runtime/JSTypedArrayViewConstructor.cpp:
(JSC::JSTypedArrayViewConstructor::JSTypedArrayViewConstructor):
(JSC::JSTypedArrayViewConstructor::createStructure):
(JSC::JSTypedArrayViewConstructor::getConstructData): Deleted.
(JSC::JSTypedArrayViewConstructor::getCallData): Deleted.
* runtime/JSTypedArrayViewConstructor.h:
* runtime/MapConstructor.cpp:
(JSC::MapConstructor::MapConstructor):
(JSC::MapConstructor::getConstructData): Deleted.
(JSC::MapConstructor::getCallData): Deleted.
* runtime/MapConstructor.h:
(JSC::MapConstructor::createStructure):
(JSC::MapConstructor::MapConstructor): Deleted.
* runtime/NativeErrorConstructor.cpp:
(JSC::NativeErrorConstructor::NativeErrorConstructor):
(JSC::NativeErrorConstructor::getConstructData): Deleted.
(JSC::NativeErrorConstructor::getCallData): Deleted.
* runtime/NativeErrorConstructor.h:
(JSC::NativeErrorConstructor::createStructure):
* runtime/NullGetterFunction.cpp:
(JSC::NullGetterFunction::NullGetterFunction):
(JSC::NullGetterFunction::getCallData): Deleted.
(JSC::NullGetterFunction::getConstructData): Deleted.
* runtime/NullGetterFunction.h:
(JSC::NullGetterFunction::createStructure):
(JSC::NullGetterFunction::NullGetterFunction): Deleted.
* runtime/NullSetterFunction.cpp:
(JSC::NullSetterFunction::NullSetterFunction):
(JSC::NullSetterFunction::getCallData): Deleted.
(JSC::NullSetterFunction::getConstructData): Deleted.
* runtime/NullSetterFunction.h:
(JSC::NullSetterFunction::createStructure):
(JSC::NullSetterFunction::NullSetterFunction): Deleted.
* runtime/NumberConstructor.cpp:
(JSC::NumberConstructor::NumberConstructor):
(JSC::constructNumberConstructor):
(JSC::constructWithNumberConstructor): Deleted.
(JSC::NumberConstructor::getConstructData): Deleted.
(JSC::NumberConstructor::getCallData): Deleted.
* runtime/NumberConstructor.h:
(JSC::NumberConstructor::createStructure):
* runtime/ObjectConstructor.cpp:
(JSC::ObjectConstructor::ObjectConstructor):
(JSC::ObjectConstructor::getConstructData): Deleted.
(JSC::ObjectConstructor::getCallData): Deleted.
* runtime/ObjectConstructor.h:
(JSC::ObjectConstructor::createStructure):
* runtime/ProxyConstructor.cpp:
(JSC::ProxyConstructor::ProxyConstructor):
(JSC::ProxyConstructor::getConstructData): Deleted.
(JSC::ProxyConstructor::getCallData): Deleted.
* runtime/ProxyConstructor.h:
(JSC::ProxyConstructor::createStructure):
* runtime/ProxyRevoke.cpp:
(JSC::ProxyRevoke::ProxyRevoke):
(JSC::ProxyRevoke::getCallData): Deleted.
* runtime/ProxyRevoke.h:
(JSC::ProxyRevoke::createStructure):
* runtime/RegExpConstructor.cpp:
(JSC::RegExpConstructor::RegExpConstructor):
(JSC::RegExpConstructor::getConstructData): Deleted.
(JSC::RegExpConstructor::getCallData): Deleted.
* runtime/RegExpConstructor.h:
(JSC::RegExpConstructor::createStructure):
* runtime/SetConstructor.cpp:
(JSC::SetConstructor::SetConstructor):
(JSC::SetConstructor::getConstructData): Deleted.
(JSC::SetConstructor::getCallData): Deleted.
* runtime/SetConstructor.h:
(JSC::SetConstructor::createStructure):
(JSC::SetConstructor::SetConstructor): Deleted.
* runtime/StringConstructor.cpp:
(JSC::StringConstructor::StringConstructor):
(JSC::StringConstructor::getConstructData): Deleted.
(JSC::StringConstructor::getCallData): Deleted.
* runtime/StringConstructor.h:
(JSC::StringConstructor::createStructure):
* runtime/SymbolConstructor.cpp:
(JSC::SymbolConstructor::SymbolConstructor):
(JSC::SymbolConstructor::getConstructData): Deleted.
(JSC::SymbolConstructor::getCallData): Deleted.
* runtime/SymbolConstructor.h:
(JSC::SymbolConstructor::createStructure):
* runtime/VM.cpp:
(JSC::VM::VM):
(JSC::VM::getCTIInternalFunctionTrampolineFor):
* runtime/VM.h:
* runtime/WeakMapConstructor.cpp:
(JSC::WeakMapConstructor::WeakMapConstructor):
(JSC::WeakMapConstructor::getConstructData): Deleted.
(JSC::WeakMapConstructor::getCallData): Deleted.
* runtime/WeakMapConstructor.h:
(JSC::WeakMapConstructor::createStructure):
(JSC::WeakMapConstructor::WeakMapConstructor): Deleted.
* runtime/WeakSetConstructor.cpp:
(JSC::WeakSetConstructor::WeakSetConstructor):
(JSC::WeakSetConstructor::getConstructData): Deleted.
(JSC::WeakSetConstructor::getCallData): Deleted.
* runtime/WeakSetConstructor.h:
(JSC::WeakSetConstructor::createStructure):
(JSC::WeakSetConstructor::WeakSetConstructor): Deleted.
* wasm/js/WebAssemblyCompileErrorConstructor.cpp:
(JSC::WebAssemblyCompileErrorConstructor::createStructure):
(JSC::WebAssemblyCompileErrorConstructor::WebAssemblyCompileErrorConstructor):
(JSC::WebAssemblyCompileErrorConstructor::getConstructData): Deleted.
(JSC::WebAssemblyCompileErrorConstructor::getCallData): Deleted.
* wasm/js/WebAssemblyCompileErrorConstructor.h:
* wasm/js/WebAssemblyInstanceConstructor.cpp:
(JSC::WebAssemblyInstanceConstructor::createStructure):
(JSC::WebAssemblyInstanceConstructor::WebAssemblyInstanceConstructor):
(JSC::WebAssemblyInstanceConstructor::getConstructData): Deleted.
(JSC::WebAssemblyInstanceConstructor::getCallData): Deleted.
* wasm/js/WebAssemblyInstanceConstructor.h:
* wasm/js/WebAssemblyLinkErrorConstructor.cpp:
(JSC::WebAssemblyLinkErrorConstructor::createStructure):
(JSC::WebAssemblyLinkErrorConstructor::WebAssemblyLinkErrorConstructor):
(JSC::WebAssemblyLinkErrorConstructor::getConstructData): Deleted.
(JSC::WebAssemblyLinkErrorConstructor::getCallData): Deleted.
* wasm/js/WebAssemblyLinkErrorConstructor.h:
* wasm/js/WebAssemblyMemoryConstructor.cpp:
(JSC::WebAssemblyMemoryConstructor::createStructure):
(JSC::WebAssemblyMemoryConstructor::WebAssemblyMemoryConstructor):
(JSC::WebAssemblyMemoryConstructor::getConstructData): Deleted.
(JSC::WebAssemblyMemoryConstructor::getCallData): Deleted.
* wasm/js/WebAssemblyMemoryConstructor.h:
* wasm/js/WebAssemblyModuleConstructor.cpp:
(JSC::WebAssemblyModuleConstructor::createStructure):
(JSC::WebAssemblyModuleConstructor::WebAssemblyModuleConstructor):
(JSC::WebAssemblyModuleConstructor::getConstructData): Deleted.
(JSC::WebAssemblyModuleConstructor::getCallData): Deleted.
* wasm/js/WebAssemblyModuleConstructor.h:
* wasm/js/WebAssemblyRuntimeErrorConstructor.cpp:
(JSC::WebAssemblyRuntimeErrorConstructor::createStructure):
(JSC::WebAssemblyRuntimeErrorConstructor::WebAssemblyRuntimeErrorConstructor):
(JSC::WebAssemblyRuntimeErrorConstructor::getConstructData): Deleted.
(JSC::WebAssemblyRuntimeErrorConstructor::getCallData): Deleted.
* wasm/js/WebAssemblyRuntimeErrorConstructor.h:
* wasm/js/WebAssemblyTableConstructor.cpp:
(JSC::WebAssemblyTableConstructor::createStructure):
(JSC::WebAssemblyTableConstructor::WebAssemblyTableConstructor):
(JSC::WebAssemblyTableConstructor::getConstructData): Deleted.
(JSC::WebAssemblyTableConstructor::getCallData): Deleted.
* wasm/js/WebAssemblyTableConstructor.h:

Source/WebCore:

* bridge/runtime_method.cpp:
(JSC::RuntimeMethod::RuntimeMethod):
(JSC::RuntimeMethod::getCallData): Deleted.
* bridge/runtime_method.h:

Source/WebKit:

* WebProcess/Plugins/Netscape/JSNPMethod.cpp:
(WebKit::JSNPMethod::JSNPMethod):
(WebKit::JSNPMethod::getCallData): Deleted.
* WebProcess/Plugins/Netscape/JSNPMethod.h:
(WebKit::JSNPMethod::createStructure):

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

23 months agoAdd a third benchmark to TailBench
rmorisset@apple.com [Mon, 6 Nov 2017 12:58:42 +0000 (12:58 +0000)]
Add a third benchmark to TailBench
https://bugs.webkit.org/show_bug.cgi?id=178815

Reviewed by Saam Barati.

Add a new benchmark to TailBench: a BF interpreter written in a weird kinda functional style

PerformanceTests:

* TailBench9000/bf-interpreter.js: Added.
(lookForMatchingBracket):
(evalRec):
(infiniteTape):
(evalShort):

Tools:

* Scripts/run-jsc-benchmarks:

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

23 months agoPerformanceTests/TailBench9000/merge-sort.js does not actually sort any of the large...
rmorisset@apple.com [Mon, 6 Nov 2017 12:56:51 +0000 (12:56 +0000)]
PerformanceTests/TailBench9000/merge-sort.js does not actually sort any of the large arrays it allocates
https://bugs.webkit.org/show_bug.cgi?id=178817

Reviewed by Saam Barati.

* TailBench9000/merge-sort.js:
(TEST_mergeSort):

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

23 months agoCanonical name of EUC-KR encoding should be EUC-KR, not windows-949
mjs@apple.com [Mon, 6 Nov 2017 08:31:44 +0000 (08:31 +0000)]
Canonical name of EUC-KR encoding should be EUC-KR, not windows-949
https://bugs.webkit.org/show_bug.cgi?id=179305

Reviewed by Alexey Proskuryakov.

LayoutTests/imported/w3c:

* web-platform-tests/encoding/textdecoder-labels-expected.txt: Updated expected results. The test already correctly covered this.
* web-platform-tests/encoding/textencoder-constructor-non-utf-expected.txt: ditto

Source/WebCore:

Already covered by:
LayoutTests/imported/w3c/web-platform-tests/encoding/textdecoder-labels.html
LayoutTests/imported/w3c/web-platform-tests/encoding/textencoder-constructor-non-utf-expected.html
LayoutTests/fast/encoding/charset-decode.html

* platform/text/TextCodecICU.cpp: Change registration so the EUC-KR name
is canonical.
(WebCore::TextCodecICU::registerCodecs): However, we still want to use the windows-949
decoder. It's not exactly the same, but the spec calls for that.

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

23 months ago[Cairo] CairoGlyphToPathTranslator::path() shouldn't fill out the glyph path
zandobersek@gmail.com [Mon, 6 Nov 2017 08:05:52 +0000 (08:05 +0000)]
[Cairo] CairoGlyphToPathTranslator::path() shouldn't fill out the glyph path
https://bugs.webkit.org/show_bug.cgi?id=179159

Reviewed by Michael Catanzaro.

In case of non-zero synthetic bold offset in CairoGlyphToPathTranslator::path(),
cairo_glyph_path() should be called just like in the generic case.
cairo_show_glyphs() performs the actual rasterization of the glyph, but we're
only interested in the generated path operations.

No new tests -- covered by existing tests.

* platform/graphics/cairo/FontCairo.cpp:
(WebCore::CairoGlyphToPathTranslator::path):

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

23 months agoUnreviewed. Remove stray conflict markers from ChangeLog.
mjs@apple.com [Mon, 6 Nov 2017 07:53:40 +0000 (07:53 +0000)]
Unreviewed. Remove stray conflict markers from ChangeLog.

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

23 months agoREGRESSION (r221338): Web Inspector: NavigationBar incorrectly calculates minimumWidth
nvasilyev@apple.com [Mon, 6 Nov 2017 07:04:02 +0000 (07:04 +0000)]
REGRESSION (r221338): Web Inspector: NavigationBar incorrectly calculates minimumWidth
https://bugs.webkit.org/show_bug.cgi?id=179292

Reviewed by Devin Rousso.

* UserInterface/Views/NavigationBar.js:
(WI.NavigationBar.prototype._calculateMinimumWidth):
totalItemWidth was the minimumWidth of the last item.

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

23 months ago[WinCairo] Fix build after r224463
commit-queue@webkit.org [Mon, 6 Nov 2017 03:59:43 +0000 (03:59 +0000)]
[WinCairo] Fix build after r224463
https://bugs.webkit.org/show_bug.cgi?id=179310

Unreviewed build fix.

No new tests (No behavior change).

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-11-05

* platform/graphics/win/GraphicsContextCairoWin.cpp: Include "GraphicsContextImpl.h".

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

23 months agoWeb Inspector: Canvas Tab: selecting Frame tree element should update preview/slider...
webkit@devinrousso.com [Mon, 6 Nov 2017 03:47:05 +0000 (03:47 +0000)]
Web Inspector: Canvas Tab: selecting Frame tree element should update preview/slider, does nothing
https://bugs.webkit.org/show_bug.cgi?id=179072
<rdar://problem/35278711>

Reviewed by Matt Baker.

* UserInterface/Views/CanvasTabContentView.js:
(WI.CanvasTabContentView.prototype._navigationSidebarTreeOutlineSelectionChanged):

* UserInterface/Views/RecordingActionTreeElement.css:
(.item.action > .titles .parameter.swizzled):
(.tree-outline:not(:focus, .force-focus) .item.action:not(.initial-state, .parent, .invalid) > .icon): Deleted.
(body:not(.window-inactive, .window-docked-inactive) .item.action > .titles .parameter.swizzled): Deleted.
Drive-by: remove extra :focus selectors to prevent icon flashing when the window is blurred.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224475 268f45cc-cd09-0410-ab3c-d52691b4dbfc

23 months ago[Web Animations] Schedule animations registered on the document timeline
graouts@webkit.org [Sun, 5 Nov 2017 22:34:10 +0000 (22:34 +0000)]
[Web Animations] Schedule animations registered on the document timeline
https://bugs.webkit.org/show_bug.cgi?id=179236
<rdar://problem/35332669>

Reviewed by Dean Jackson.

Source/WebCore:

We now schedule animations contained in the document timeline using a three-step approach.

1. Each time an object that is part of the timing model changes one of its timing properties, we call
   animationTimingModelDidChange() on the document timeline. This schedules performInvalidationTask()
   to be called when the current run loop completes, such that we invalidate the timing model just once
   per run loop.

2. Once performInvalidationTask() is called, the timing model is invalidated in updateAnimationSchedule().
   We iterate over the registered animations on the timineline and identify the shortest interval between
   the current time and the next moment one of the animations requires a tick to update its value. If we
   find a value below 15ms, we schedule animations to be resolved with scheduleAnimationResolution() right
   away. If the value is above 15ms, and not inifinity, we schedule a one-shot timer for that interval to
   call scheduleAnimationResolution().

3. Once scheduleAnimationResolution() is called, we call scheduleAnimation() on the shared DisplayRefreshMonitorManager
   to be notified when the next display refresh occurs to actually resolve animations with resolveAnimations().

Note that, in this patch, resolveAnimations() does nothing, we will add support for interpolating values in
a future patch.

Another important thing to note is that every time the document timeline's current time is requested, we cache
it for the duration of the run loop such that the timing model always uses the same value during a given run loop.

Finally, to support tests where we check the state of the timing model by manually advancing time, we expose a
new pause() method on AnimationTimeline for tests to call to avoid the timeline to self-advance.

* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::addAnimation): Mark that the timing model changed as a result of adding an animation.
(WebCore::AnimationTimeline::removeAnimation): Mark that the timing model changed as a result of removing an animation.
(WebCore::AnimationTimeline::bindingsCurrentTime): Update the method signature to no longer be const and call into
currentTime() instead of reading directly from the m_currentTime member variable since a subclass, like DocumentTimeline,
may have a custom currentTime() implementation.
(WebCore::AnimationTimeline::setCurrentTime): Mark that the timing model changed as a result of the timeline current time
changing.
(WebCore::AnimationTimeline::bindingsCurrentTime const): Deleted.
* animation/AnimationTimeline.h:
(WebCore::AnimationTimeline::currentTime): Change both methods signatures to no longer be const so that DocumentTimeline's
implementation of currentTime() may cache the current time in a member variable, enqueuing a callback when the run loop
completes for this member variable to be reset, and updating some states.
(WebCore::AnimationTimeline::pause): To be implemented by subclasses.
(WebCore::AnimationTimeline::animationTimingModelDidChange): Add a new virtual method to indicate that the timing model
needs invalidating.
(WebCore::AnimationTimeline::animations const): Add an accessor to allow animations to be accessed by a subclass.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::create):
(WebCore::DocumentTimeline::DocumentTimeline): Update the constructor signature to receive a Document and a PlatformDisplayID
since we need a reference to the Document to get at the nowTime() and a PlatformDisplayID to create the DisplayRefreshMonitor.
(WebCore::DocumentTimeline::~DocumentTimeline): Close the task queue when the timeline gets destroyed.
(WebCore::DocumentTimeline::currentTime): If we don't have a current cahed current time, compute one and schedule
the invalidation task if needed so that we may reset the cached value as the run loop completes.
(WebCore::DocumentTimeline::pause): Allows the timeline not to self-advance, for testing purposes only.
(WebCore::DocumentTimeline::animationTimingModelDidChange): If we haven't already done so, mark that we need to update our
animation schedule in the invalidation task and schedule that task if not scheduled yet.
(WebCore::DocumentTimeline::scheduleInvalidationTaskIfNeeded): Schedule the invalidation task to run as the run loop completes
if we haven't already done so.
(WebCore::DocumentTimeline::performInvalidationTask): Update the animation schedule if needed and reset the cached current
time value.
(WebCore::DocumentTimeline::updateAnimationSchedule): Iterate over registed animations and find the shortest interval until
one of them needs to update their animation. If the shortest interval is below 15ms, schedule the animation resolution right
away. If the shortest inverval is finite and above 15ms, then schedule a one-shot timer for that interval to perform the
animation resolution then.
(WebCore::DocumentTimeline::animationScheduleTimerFired): The one-shot timer to perform the animation resolution has fired,
we call scheduleAnimationResolution().
(WebCore::DocumentTimeline::scheduleAnimationResolution): We call scheduleAnimation() on the shared DisplayRefreshMonitorManager
so that we may resolve animations on the next display refresh, or start a timer if the DisplayRefreshMonitorManager is not available.
(WebCore::DocumentTimeline::displayRefreshFired): The display is about to refresh, we call resolveAnimations().
(WebCore::DocumentTimeline::animationResolutionTimerFired): The fallback animation resolution timer has fired, we call resolveAnimations().
(WebCore::DocumentTimeline::resolveAnimations): Currently do nothing, this is where we'll iterate over registered animations to
update them with the current time.
(WebCore::DocumentTimeline::windowScreenDidChange): Notify the shared DisplayRefreshMonitorManager that the PlatformDisplayID
changed.
(WebCore::DocumentTimeline::createDisplayRefreshMonitor const): Provide a DisplayRefreshMonitor as part of the
DisplayRefreshMonitorClient protocol.
* animation/DocumentTimeline.h:
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::create): Remove extra white space.
(WebCore::WebAnimation::setStartTime): Mark that the timing model changed as a result of changing this animation's start time.
(WebCore::WebAnimation::timeToNextRequiredTick const): Compute the interval until the next time we need to resolve this animation.
If the provided current time is before this animation's start time, compute the delay until the start time. If the current time
is after the animation's start time but before the animation's end time, indicate that we want to resolve the animation again
right away and return 0ms. In any other case, return an infinite interval to indicate that we don't need to be refreshed after
the provided time.
* animation/WebAnimation.h:
* dom/Document.cpp:
(WebCore::Document::windowScreenDidChange): Notify the document timeline that the PlatformDisplayID changed.
(WebCore::Document::timeline): Provide the Document and the PlatformDisplayID to the DocumentTimeline.
* testing/Internals.cpp:
(WebCore::Internals::pauseTimeline):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

Adopt the new internals.pauseTimeline() method to ensure that the existing
tests do not have a self-advancing timeline since we're interested in checking
the timing model state based on manually setting the timeline current time.

Also update some WPT expectations with some progressions.

* TestExpectations: Mark two tests as flaky due to the sample time being logged
in the failure.
* http/wpt/web-animations/interfaces/AnimationTimeline/document-timeline-expected.txt:
* http/wpt/web-animations/timing-model/animations/current-time-expected.txt:
* http/wpt/web-animations/timing-model/animations/set-the-animation-start-time-expected.txt:
* http/wpt/wk-web-animations/timing-model/animation-creation-basic.html:
* http/wpt/wk-web-animations/timing-model/animation-current-time.html:
* http/wpt/wk-web-animations/timing-model/animation-effect-timing.html:
* http/wpt/wk-web-animations/timing-model/animation-effect.html:
* http/wpt/wk-web-animations/timing-model/animation-interface-effect-property.html:
* http/wpt/wk-web-animations/timing-model/animation-interface-start-time-property.html:
* http/wpt/wk-web-animations/timing-model/animation-playback-rate.html:
* http/wpt/wk-web-animations/timing-model/document-timeline.html:
* http/wpt/wk-web-animations/timing-model/keyframe-effect-interface-timing-duration.html:
* http/wpt/wk-web-animations/timing-model/keyframe-effect.html:
* http/wpt/wk-web-animations/timing-model/timeline-current-time.html:

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

23 months agoMark http/tests/security/xss-DENIED-xsl-external-entity.xml as a flaky failure on...
pvollan@apple.com [Sun, 5 Nov 2017 22:17:04 +0000 (22:17 +0000)]
Mark http/tests/security/xss-DENIED-xsl-external-entity.xml as a flaky failure on Windows.
https://bugs.webkit.org/show_bug.cgi?id=179301

Unreviewed test gardening.

* platform/win/TestExpectations:

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

23 months agoMark fast/html/menuitem-element.html as failure on Windows.
pvollan@apple.com [Sun, 5 Nov 2017 20:32:51 +0000 (20:32 +0000)]
Mark fast/html/menuitem-element.html as failure on Windows.
https://bugs.webkit.org/show_bug.cgi?id=179299

Unreviewed test gardening.

* platform/win/TestExpectations:

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

23 months agoImplement ServiceWorkerRegistration.update()
cdumez@apple.com [Sun, 5 Nov 2017 20:18:17 +0000 (20:18 +0000)]
Implement ServiceWorkerRegistration.update()
https://bugs.webkit.org/show_bug.cgi?id=179270

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Rebaseline WPT tests now that more are passing or at least failing later.

* web-platform-tests/service-workers/service-worker/claim-affect-other-registration.https-expected.txt:
* web-platform-tests/service-workers/service-worker/claim-with-redirect.https-expected.txt:
* web-platform-tests/service-workers/service-worker/import-scripts-redirect.https-expected.txt:
* web-platform-tests/service-workers/service-worker/multiple-register.https-expected.txt:
* web-platform-tests/service-workers/service-worker/multiple-update.https-expected.txt:
* web-platform-tests/service-workers/service-worker/postmessage-from-waiting-serviceworker.https-expected.txt:
* web-platform-tests/service-workers/service-worker/ready.https-expected.txt:
* web-platform-tests/service-workers/service-worker/registration-script.https-expected.txt:
* web-platform-tests/service-workers/service-worker/skip-waiting.https-expected.txt:
* web-platform-tests/service-workers/service-worker/unregister-then-register.https-expected.txt:

* web-platform-tests/service-workers/service-worker/update.https-expected.txt:
I investigated this test and it is still failing later on because we clear registrations too
aggressively on the StorageProcess side we are supposed to make sure the registration does
not have a newestWorker before clearing it when a script fetch fails or a script syntax error
occurs. We properly have those if (!newestWorker) checks in the code but service workers
are not yet populated on the SWServerRegistration object so SWServerRegistration::getNewestWorker()
alwasy returns null.

Source/WebCore:

Implement ServiceWorkerRegistration.update():
- https://w3c.github.io/ServiceWorker/#service-worker-registration-update

We already had support for the Update algorithm in SWServerJobQueue but
this patch enhances our support a bit to get us closer to the specification:
- https://w3c.github.io/ServiceWorker/#update-algorithm

No new tests, rebaselined existing tests.

* workers/service/ServiceWorker.h:
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::updateRegistration):
(WebCore::ServiceWorkerContainer::getRegistration):
(WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerJobData.h:
(WebCore::ServiceWorkerJobData::encode const):
(WebCore::ServiceWorkerJobData::decode):
* workers/service/ServiceWorkerJobType.h:
* workers/service/ServiceWorkerRegistration.cpp:
(WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration):
(WebCore::ServiceWorkerRegistration::installing):
(WebCore::ServiceWorkerRegistration::waiting):
(WebCore::ServiceWorkerRegistration::active):
(WebCore::ServiceWorkerRegistration::setInstallingWorker):
(WebCore::ServiceWorkerRegistration::setWaitingWorker):
(WebCore::ServiceWorkerRegistration::setActiveWorker):
(WebCore::ServiceWorkerRegistration::getNewestWorker):
(WebCore::ServiceWorkerRegistration::update):
* workers/service/ServiceWorkerRegistration.h:
* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::scriptFetchFinished):
(WebCore::SWServerJobQueue::scriptContextFailedToStart):
(WebCore::SWServerJobQueue::runNextJobSynchronously):
(WebCore::SWServerJobQueue::runUpdateJob):

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

23 months ago[Win] Skip stress/regress-178385.js.
pvollan@apple.com [Sun, 5 Nov 2017 19:20:53 +0000 (19:20 +0000)]
[Win] Skip stress/regress-178385.js.
https://bugs.webkit.org/show_bug.cgi?id=179298

Unreviewed test gardening.

* stress/regress-178385.js:

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

23 months agoMark fast/loader/empty-embed-src-attribute.html as a flaky crash on Windows.
pvollan@apple.com [Sun, 5 Nov 2017 17:51:33 +0000 (17:51 +0000)]
Mark fast/loader/empty-embed-src-attribute.html as a flaky crash on Windows.
https://bugs.webkit.org/show_bug.cgi?id=179297

Unreviewed test gardening.

* platform/win/TestExpectations:

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

23 months agoMark fast/css/object-fit/object-fit-embed.html and related tests as failing on Windows.
pvollan@apple.com [Sun, 5 Nov 2017 17:06:45 +0000 (17:06 +0000)]
Mark fast/css/object-fit/object-fit-embed.html and related tests as failing on Windows.
https://bugs.webkit.org/show_bug.cgi?id=179296

Unreviewed test gardening.

* platform/win/TestExpectations:

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

23 months agoMove code that maps a CompositeOperator and BlendMode to a CGBlendMode into a helper...
simon.fraser@apple.com [Sun, 5 Nov 2017 05:40:16 +0000 (05:40 +0000)]
Move code that maps a CompositeOperator and BlendMode to a CGBlendMode into a helper function
https://bugs.webkit.org/show_bug.cgi?id=179290

Reviewed by Darin Adler.

Move the code, and use nested switch rather than conditionals.

* platform/graphics/GraphicsTypes.h:
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::compositeAndBlendToCGBlendMode):
(WebCore::GraphicsContext::setPlatformCompositeOperation):

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

23 months agoIndex properties on cross origin Window objects should be enumerable
cdumez@apple.com [Sun, 5 Nov 2017 00:54:32 +0000 (00:54 +0000)]
Index properties on cross origin Window objects should be enumerable
https://bugs.webkit.org/show_bug.cgi?id=179289

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Re-sync WPT test after:
- https://github.com/w3c/web-platform-tests/pull/8045

Rebaseline a couple of WPT tests now that more checks are passing.

* web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt:
* web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects.html:
* web-platform-tests/html/browsers/the-window-object/window-indexed-properties-expected.txt:

Source/WebCore:

Index properties on cross origin Window objects should be enumerable:
- https://github.com/whatwg/html/pull/3186
- https://github.com/w3c/web-platform-tests/pull/8045

All exposed properties used to be enumerable but we had to revert this in
r224287 because it was not Web-compatible. The HTML specification has now
been updated so that only index properties are enumerable cross origin.

No new tests, rebaselined existing tests.

* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
(WebCore::JSDOMWindow::getOwnPropertyNames):

LayoutTests:

Update / rebaseline existing test to match new expected behavior.

* js/dom/getOwnPropertyDescriptor-expected.txt:
* js/resources/getOwnPropertyDescriptor.js:

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

23 months agoAdd a GraphicsContextImpl and use it for DispayList::Recorder
simon.fraser@apple.com [Sat, 4 Nov 2017 23:43:55 +0000 (23:43 +0000)]
Add a GraphicsContextImpl and use it for DispayList::Recorder
https://bugs.webkit.org/show_bug.cgi?id=179286

Reviewed by Sam Weinig.

Start moving towards a model when GraphicsContext has a pointer to an implementation
("pimpl") by adding GraphicsContextImpl, and converting display list recording to
be an implementation of a GraphicsContextImpl.

No behavior change.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::DisplayListDrawingContext::DisplayListDrawingContext):
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::GraphicsContext):
(WebCore::GraphicsContext::save):
(WebCore::GraphicsContext::restore):
(WebCore::GraphicsContext::setStrokeThickness):
(WebCore::GraphicsContext::setStrokeStyle):
(WebCore::GraphicsContext::setStrokeColor):
(WebCore::GraphicsContext::setShadow):
(WebCore::GraphicsContext::setLegacyShadow):
(WebCore::GraphicsContext::clearShadow):
(WebCore::GraphicsContext::setFillColor):
(WebCore::GraphicsContext::setShadowsIgnoreTransforms):
(WebCore::GraphicsContext::setShouldAntialias):
(WebCore::GraphicsContext::setShouldSmoothFonts):
(WebCore::GraphicsContext::setShouldSubpixelQuantizeFonts):
(WebCore::GraphicsContext::setImageInterpolationQuality):
(WebCore::GraphicsContext::setStrokePattern):
(WebCore::GraphicsContext::setFillPattern):
(WebCore::GraphicsContext::setStrokeGradient):
(WebCore::GraphicsContext::setFillRule):
(WebCore::GraphicsContext::setFillGradient):
(WebCore::GraphicsContext::beginTransparencyLayer):
(WebCore::GraphicsContext::endTransparencyLayer):
(WebCore::GraphicsContext::drawGlyphs):
(WebCore::GraphicsContext::drawImage):
(WebCore::GraphicsContext::drawTiledImage):
(WebCore::GraphicsContext::setTextDrawingMode):
(WebCore::GraphicsContext::fillRect):
(WebCore::GraphicsContext::fillRoundedRect):
(WebCore::GraphicsContext::setAlpha):
(WebCore::GraphicsContext::setCompositeOperation):
(WebCore::GraphicsContext::setDrawLuminanceMask):
(WebCore::GraphicsContext::applyDeviceScaleFactor):
(WebCore::GraphicsContext::fillEllipse):
(WebCore::GraphicsContext::strokeEllipse):
* platform/graphics/GraphicsContext.h:
(WebCore::GraphicsContext::hasPlatformContext const):
(WebCore::GraphicsContext::paintingDisabled const):
(WebCore::GraphicsContext::setDisplayListRecorder): Deleted.
(WebCore::GraphicsContext::isRecording const): Deleted.
* platform/graphics/GraphicsContextImpl.cpp: Added.
(WebCore::GraphicsContextImpl::GraphicsContextImpl):
(WebCore::GraphicsContextImpl::~GraphicsContextImpl):
* platform/graphics/GraphicsContextImpl.h: Added.
(WebCore::GraphicsContextImpl::graphicsContext const):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::recursiveCommitChanges):
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::getCTM const):
(WebCore::GraphicsContext::savePlatformState):
(WebCore::GraphicsContext::restorePlatformState):
(WebCore::GraphicsContext::drawRect):
(WebCore::GraphicsContext::drawNativeImage):
(WebCore::GraphicsContext::drawLine):
(WebCore::GraphicsContext::drawEllipse):
(WebCore::GraphicsContext::fillPath):
(WebCore::GraphicsContext::strokePath):
(WebCore::GraphicsContext::fillRect):
(WebCore::GraphicsContext::clip):
(WebCore::GraphicsContext::clipPath):
(WebCore::GraphicsContext::clipBounds const):
(WebCore::GraphicsContext::drawLinesForText):
(WebCore::GraphicsContext::roundToDevicePixels):
(WebCore::GraphicsContext::translate):
(WebCore::GraphicsContext::setPlatformStrokeThickness):
(WebCore::GraphicsContext::setPlatformStrokeStyle):
(WebCore::GraphicsContext::concatCTM):
(WebCore::GraphicsContext::setCTM):
(WebCore::GraphicsContext::beginPlatformTransparencyLayer):
(WebCore::GraphicsContext::endPlatformTransparencyLayer):
(WebCore::GraphicsContext::clearRect):
(WebCore::GraphicsContext::strokeRect):
(WebCore::GraphicsContext::setLineCap):
(WebCore::GraphicsContext::setLineDash):
(WebCore::GraphicsContext::setLineJoin):
(WebCore::GraphicsContext::setMiterLimit):
(WebCore::GraphicsContext::clipOut):
(WebCore::GraphicsContext::rotate):
(WebCore::GraphicsContext::scale):
(WebCore::GraphicsContext::platformFillRoundedRect):
(WebCore::GraphicsContext::fillRectWithRoundedHole):
(WebCore::GraphicsContext::drawPattern):
(WebCore::GraphicsContext::setPlatformShouldAntialias):
(WebCore::GraphicsContext::setPlatformImageInterpolationQuality):
(WebCore::GraphicsContext::isAcceleratedContext const):
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::savePlatformState):
(WebCore::GraphicsContext::restorePlatformState):
(WebCore::GraphicsContext::drawNativeImage):
(WebCore::GraphicsContext::drawPattern):
(WebCore::GraphicsContext::drawRect):
(WebCore::GraphicsContext::drawLine):
(WebCore::GraphicsContext::drawEllipse):
(WebCore::GraphicsContext::applyStrokePattern):
(WebCore::GraphicsContext::applyFillPattern):
(WebCore::GraphicsContext::drawPath):
(WebCore::GraphicsContext::fillPath):
(WebCore::GraphicsContext::strokePath):
(WebCore::GraphicsContext::fillRect):
(WebCore::GraphicsContext::platformFillRoundedRect):
(WebCore::GraphicsContext::fillRectWithRoundedHole):
(WebCore::GraphicsContext::clip):
(WebCore::GraphicsContext::clipOut):
(WebCore::GraphicsContext::clipPath):
(WebCore::GraphicsContext::clipBounds const):
(WebCore::GraphicsContext::beginPlatformTransparencyLayer):
(WebCore::GraphicsContext::endPlatformTransparencyLayer):
(WebCore::GraphicsContext::setPlatformShadow):
(WebCore::GraphicsContext::setMiterLimit):
(WebCore::GraphicsContext::clearRect):
(WebCore::GraphicsContext::strokeRect):
(WebCore::GraphicsContext::setLineCap):
(WebCore::GraphicsContext::setLineDash):
(WebCore::GraphicsContext::setLineJoin):
(WebCore::GraphicsContext::scale):
(WebCore::GraphicsContext::rotate):
(WebCore::GraphicsContext::translate):
(WebCore::GraphicsContext::concatCTM):
(WebCore::GraphicsContext::setCTM):
(WebCore::GraphicsContext::getCTM const):
(WebCore::GraphicsContext::roundToDevicePixels):
(WebCore::GraphicsContext::drawLinesForText):
(WebCore::GraphicsContext::setURLForRect):
(WebCore::GraphicsContext::setIsCALayerContext):
(WebCore::GraphicsContext::isCALayerContext const):
(WebCore::GraphicsContext::setIsAcceleratedContext):
(WebCore::GraphicsContext::isAcceleratedContext const):
(WebCore::GraphicsContext::setPlatformTextDrawingMode):
(WebCore::GraphicsContext::setPlatformStrokeColor):
(WebCore::GraphicsContext::setPlatformStrokeThickness):
(WebCore::GraphicsContext::setPlatformFillColor):
(WebCore::GraphicsContext::setPlatformShouldAntialias):
(WebCore::GraphicsContext::setPlatformShouldSmoothFonts):
(WebCore::GraphicsContext::setPlatformAlpha):
(WebCore::GraphicsContext::setPlatformCompositeOperation):
(WebCore::GraphicsContext::platformApplyDeviceScaleFactor):
(WebCore::GraphicsContext::platformFillEllipse):
(WebCore::GraphicsContext::platformStrokeEllipse):
(WebCore::GraphicsContext::setDestinationForRect):
(WebCore::GraphicsContext::addDestinationAtPoint):
* platform/graphics/cocoa/GraphicsContextCocoa.mm:
(WebCore::GraphicsContext::drawFocusRing):
* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::Recorder):
(WebCore::DisplayList::Recorder::updateItemExtent const):
(WebCore::DisplayList::Recorder::extentFromLocalBounds const):
* platform/graphics/displaylists/DisplayListRecorder.h:
(WebCore::DisplayList::Recorder::itemCount const):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paint):

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

23 months agoREGRESSION(r223718): Leaking WebProcessPool after reconfiguration
cdumez@apple.com [Sat, 4 Nov 2017 23:01:56 +0000 (23:01 +0000)]
REGRESSION(r223718): Leaking WebProcessPool after reconfiguration
https://bugs.webkit.org/show_bug.cgi?id=179123
<rdar://problem/35294685>

Reviewed by Geoff Garen.

Make sure we destroy the ServiceWorker WebProcess once all other WebProcesses
go away at there is no use keeping it running at this point. Also, this prevents
leaking the WebProcessPool since the WebProcessProxy holds a strong reference
to the WebProcessPool.

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::disconnectProcess):

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

23 months ago[LayoutState cleanup] Move all LayoutState* classes to LayoutState.h/cpp
zalan@apple.com [Sat, 4 Nov 2017 22:02:39 +0000 (22:02 +0000)]
[LayoutState cleanup] Move all LayoutState* classes to LayoutState.h/cpp
https://bugs.webkit.org/show_bug.cgi?id=179280
<rdar://problem/35348452>

Reviewed by Antti Koivisto.

No change in functionality.

* page/LayoutContext.cpp:
(WebCore::SubtreeLayoutStateMaintainer::SubtreeLayoutStateMaintainer): Deleted.
(WebCore::SubtreeLayoutStateMaintainer::~SubtreeLayoutStateMaintainer): Deleted.
(WebCore::SubtreeLayoutStateMaintainer::shouldDisableLayoutStateForSubtree): Deleted.
* rendering/LayoutState.cpp:
(WebCore::LayoutStateMaintainer::LayoutStateMaintainer):
(WebCore::LayoutStateMaintainer::~LayoutStateMaintainer):
(WebCore::LayoutStateMaintainer::push):
(WebCore::LayoutStateMaintainer::pop):
(WebCore::LayoutStateDisabler::LayoutStateDisabler):
(WebCore::LayoutStateDisabler::~LayoutStateDisabler):
(WebCore::shouldDisableLayoutStateForSubtree):
(WebCore::SubtreeLayoutStateMaintainer::SubtreeLayoutStateMaintainer):
(WebCore::SubtreeLayoutStateMaintainer::~SubtreeLayoutStateMaintainer):
(WebCore::PaginatedLayoutStateMaintainer::PaginatedLayoutStateMaintainer):
(WebCore::PaginatedLayoutStateMaintainer::~PaginatedLayoutStateMaintainer):
* rendering/LayoutState.h:
(WebCore::LayoutStateMaintainer::didPush const):
* rendering/RenderBlockFlow.cpp:
(WebCore::PaginatedLayoutStateMaintainer::PaginatedLayoutStateMaintainer): Deleted.
(WebCore::PaginatedLayoutStateMaintainer::~PaginatedLayoutStateMaintainer): Deleted.
(): Deleted.
* rendering/RenderView.h:
(WebCore::LayoutStateMaintainer::LayoutStateMaintainer): Deleted.
(WebCore::LayoutStateMaintainer::~LayoutStateMaintainer): Deleted.
(WebCore::LayoutStateMaintainer::push): Deleted.
(WebCore::LayoutStateMaintainer::pop): Deleted.
(WebCore::LayoutStateMaintainer::didPush const): Deleted.
(WebCore::LayoutStateDisabler::LayoutStateDisabler): Deleted.
(WebCore::LayoutStateDisabler::~LayoutStateDisabler): Deleted.

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

23 months ago[LayoutState cleanup] Move offset/cliprect/pagination code to dedicate methods
zalan@apple.com [Sat, 4 Nov 2017 21:41:10 +0000 (21:41 +0000)]
[LayoutState cleanup] Move offset/cliprect/pagination code to dedicate methods
https://bugs.webkit.org/show_bug.cgi?id=179279
<rdar://problem/35348171>

Reviewed by Antti Koivisto.

This is in preparation for creating the initial LayoutSate through LayoutStateMaintainer.

Moving code around. No change in functionality.

* rendering/LayoutState.cpp:
(WebCore::LayoutState::LayoutState):
(WebCore::LayoutState::computeOffsets):
(WebCore::LayoutState::computeClipRect):
(WebCore::LayoutState::computePaginationInformation):
* rendering/LayoutState.h:

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

23 months agoSimplify event dispatch code and make it a bit more consistent
darin@apple.com [Sat, 4 Nov 2017 21:19:11 +0000 (21:19 +0000)]
Simplify event dispatch code and make it a bit more consistent
https://bugs.webkit.org/show_bug.cgi?id=178991

Reviewed by Chris Dumez.

Source/WebCore:

Straighten out event dispatch code in three ways:

1) Add an Event::resetAfterDispatch function, and use it instead of the multiple
   separate functions that were used before to reset after dispatching. This fixed
   an extremely minor bug where we would leave some kinds of state on some event
   objects in unusual cases after dispatching the events.

2) Remove IDBEventDispatcher and make its callers use EventDispatcher instead.
   This leaves us with one less event dispatch code path to maintain, more shared code.

3) Remove boolean return values from functions that take event objects and
   dispatch the events. The return values are redundant with various things that
   can be checked by looking at the event itself. The legacy return value indicates
   whether the event has its "canceled flag" set, which means that the default
   behavior should be prevented. If that is what we need to check, it's easier
   to read the code and see that it's correct if it calls the named function
   "defaultPrevented" directly. More importantly, callers can also call whatever
   other function is appropriate to ask the specific relevant question to their needs.
   The general rule is that default behavior that we want to allow even with an
   untrusted event can be inside a default event handler function. Default behavior
   that should only happen for the browser-generated event can and should be done
   after dispatching the event, in the code that dispatches it; but that requires
   explicitly checking "defaultPrevented".

* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::dispatchEvent): Removed boolean return value.
* Modules/indexeddb/IDBDatabase.h: Ditto.

* Modules/indexeddb/IDBEventDispatcher.cpp: Removed.
* Modules/indexeddb/IDBEventDispatcher.h: Removed.

* Modules/indexeddb/IDBOpenDBRequest.cpp:
(WebCore::IDBOpenDBRequest::dispatchEvent): Removed boolean return value.
Added protection for "this" since the function accesses it after dispatching the event.
* Modules/indexeddb/IDBOpenDBRequest.h: Ditto.

* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::dispatchEvent): Removed boolean return value. Instead of using
IDBEventDispatcher, use EventDispatcher's new function that takes an initializer_list
with a list of event targets. Added protection for "this" since the function accesses
it after dispatching the event.
* Modules/indexeddb/IDBRequest.h: Ditto.
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::dispatchEvent): Ditto.
* Modules/indexeddb/IDBTransaction.h: Ditto.

* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::dispatchEvent): Removed boolean return value.
* Modules/mediastream/RTCPeerConnection.h: Ditto.
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::shippingAddressChanged): Don't dispatch an event if
m_isUpdating is true; preserves behavior that was implemented in
PaymentRequest::dispatchEvent before. Since this is the source of the trusted
event, cleaner to implement the rule here instead of overriding dispatchEvent.
(WebCore::PaymentRequest::shippingOptionChanged): Ditto.
(WebCore::PaymentRequest::dispatchEvent): Deleted.
* Modules/paymentrequest/PaymentRequest.h: Ditto.

* Sources.txt: Removed IDBEventDispatcher.cpp.
* WebCore.xcodeproj/project.pbxproj: Removed IDBEventDispatcher.h/cpp.

* dom/Element.cpp:
(WebCore::Element::dispatchMouseEvent): Updated to call defaultPrevented
directly instead of using the return value of dispatchEvent.
(WebCore::Element::dispatchWheelEvent): Ditto.
(WebCore::Element::dispatchKeyEvent): Ditto.
(WebCore::Element::dispatchFocusInEvent): Removed assertion, since the
underlying event dispatching takes care of it.
(WebCore::Element::dispatchFocusOutEvent): Ditto.
(WebCore::Element::dispatchFocusEvent): Call dispatchEvent instead of
calling EventDispatcher::dispatchEvent. There is no good reason to use
EventDispatcher directly.
(WebCore::Element::dispatchBlurEvent): Ditto.

* dom/Event.cpp:
(WebCore::Event::eventInterface const): Deleted. Moved into header since this is
short and if called in a non-polymorphic context it's good to have it be inlined.
(WebCore::Event::isUIEvent const): Ditto.
(WebCore::Event::isMouseEvent const): Ditto.
(WebCore::Event::isFocusEvent const): Ditto.
(WebCore::Event::isKeyboardEvent const): Ditto.
(WebCore::Event::isInputEvent const): Ditto.
(WebCore::Event::isCompositionEvent const): Ditto.
(WebCore::Event::isTouchEvent const): Ditto.
(WebCore::Event::isClipboardEvent const): Ditto.
(WebCore::Event::isBeforeTextInsertedEvent const): Ditto.
(WebCore::Event::isBeforeUnloadEvent const): Ditto.
(WebCore::Event::isErrorEvent const): Ditto.
(WebCore::Event::isTextEvent const): Ditto.
(WebCore::Event::isWheelEvent const): Ditto.
(WebCore::Event::receivedTarget): Ditto.
(WebCore::Event::resetAfterDispatch): Added. Replaces functions like
clearEventPath and resetPropagationFlags, covering all the things we need to clear
after dispatching an event.

* dom/Event.h: Removed some unneeded includes and forward declarations. Moved bodies
of multi-line inline member functions out of the class definition. Changed argument
type of setEventPhase and m_eventPhase to an enum rather than just an integer, since
only the getter is for use from the bindings. Removed clearEventPath, srcElement, and
resetPropagationFlags. Sorted the isXXX functions alphabetically and removed previous
attempts to make categories out of them. Marked the constructor explicit since it has
a single argument. Moved trivially short bodies into the class definition.

* dom/Event.idl: Use ImplementedAs to implement srcElement so we don't need it in
the C++ code.

* dom/EventContext.cpp:
(WebCore::EventContext::EventContext): Removed assertion since we now handle event
contexts without nodes so we can use this to dispatch events for IDB, for example.
(WebCore::EventContext::handleLocalEvents const): Add code to handle non-node event
targets by calling fireEventListeners directly.
(WebCore::MouseOrFocusEventContext::MouseOrFocusEventContext): Take a reference
insetad of a pointer for the node.
(WebCore::TouchEventContext::TouchEventContext): Ditto.
(WebCore::TouchEventContext::handleLocalEvents const): Streamline a bit by improving
the checkReachability function to be easier to call. Also removed an unneeded assertion
just before calling downcast<>, the same assertion that downcast<> itself does.
(WebCore::TouchEventContext::checkReachability const): Chagned argument type to take
a Ref& so the caller doesn't have to call get() or ptr().

* dom/EventContext.h: Removed unneeded FIXME and currentTargetSameAsTarget function.
Changed arguemnt types to use Node& instead of Node* as appropriate. Removed unused
functions from TouchEventContext, made more private, and changed data members to Ref
instead of RefPtr. Removed unused NotTouchList value from TouchListType enumeration.
Changed touchList function to return a reference instead of a pointer.

* dom/EventDispatcher.cpp: Removed unneeded includes.
(WebCore::dispatchEventInDOM): Removed use of currentTargetSameAsTarget since it's
clearer if written out.
(WebCore::EventDispatcher::dispatchEvent): Changed no-event dispatch assertion to
use RELEASE_ASSERT_WITH_SECURITY_IMPLICATION since the style checker says so, but
it still doesn't assert anything in release builds because the check in
NoEventDispatchAssertion itself is debug-only. Moved the calls to EventPath's
setRelatedTarget and retargetTouchLists functions inside the EventPath constructor.
Removed the second no-event dispatch assertion because we only need one. Replaced
calls to clearEventPath, setCurrentTarget(nullptr), resetPropagationFlags,
and setEventPhase(NONE) and with a call to resetAfterDispatch. Moved the code that
temporarily sets the target to a different value when calling default event handlers
into the block that calls the default event handlers. Added a new overload that
takes an initializer list of event targets so we can dispatch events that are not
being sent to nodes.

* dom/EventDispatcher.h: Fixed misleading copyright dates and names since this file
just contains a couple of function declarations. Added new overload of dispatchEvent.

* dom/EventPath.cpp:
(WebCore::WindowEventContext::WindowEventContext): Take references instead of pointers.
(WebCore::EventPath::EventPath): Moved the bulk of construction into a new function
named buildPath, so it can still use "return" without skipping the additions here.
Added calls to setRelatedTarget and retargetTouchLists and now both can be private.
Also added a new overload that takes event targets that are not nodes.
(WebCore::EventPath::buildPath): Added. Contains what used to be in the constructor.
But use some references instead of pointers and refactor a bit using lambdas.
(WebCore::EventPath::retargetTouchList): Added. Makes the retargetTouchLists function
shorter and less repetetive.
(WebCore::EventPath::retargetTouchLists): Updated to call retargetTouchList.
(WebCore::EventPath::hasEventListeners const): Deleted. This was unused.
* dom/EventPath.h: Added a constructor that takes an initializer list of event targets.
Made retargetTouchEvents and setRelatedTarget private and used them in the constructor
insead of expecting clients to call them. Removed unused hasEventListeners and
lastContextIfExists functions. Moved body of the eventTargetRespectingTargetRules
function out of the class definition.

* dom/EventTarget.cpp:
(WebCore::EventTarget::dispatchEventForBindings): Updated so it does not expect
dispatchEvent to return a boolean. Instead call a function on the event after dispatching.
Decided to use legacyReturnValue instead of !defaultPrevented, because this is exactly
the return value that the returnValue property is referring to.
(WebCore::EventTarget::dispatchEvent): Removed return value. Replaced calls to
resetPropagationFlags and setEventPhase(NONE) with a call to resetAfterDispatch.
I noticed that there was a local boolean here named "defaultPrevented", which was
backwards; the value in that local was "default not prevented". Doesn't matter since
the boolean return value was removed.
(WebCore::EventTarget::fireEventListeners): Removed the boolean return value.

* dom/EventTarget.h: Added initial values to members of ListenerOptions and
AddEventListenerOptions; maybe we can get rid of the constructors some day.
Removed booelan return values from dispatchEvent and fireEventListeners.

* dom/KeyboardEvent.cpp: Removed unneeded include of EventDispatcher.h.

* dom/Node.cpp:
(WebCore::Node::dispatchEvent): Got rid of boolean return value.
Removed special case code that sometimes called dispatchTouchEvent, since that
just turns around and calls EventDispatcher::dispatchEvent just like this function.
(WebCore::Node::dispatchDOMActivateEvent): Removed boolean return value, removed
integer detail argument and moved the logic to compute the value of the detail
peroprty and to call setDefaultHandled on the underlying click event in here.
This is a private helper function used only in one place.
(WebCore::Node::dispatchTouchEvent): Deleted.
(WebCore::Node::defaultEventHandler): Updated for change to dispatchDOMActivateEvent.
* dom/Node.h: Updated for the above changes.

* dom/RejectedPromiseTracker.cpp:
(WebCore::RejectedPromiseTracker::reportUnhandledRejections): Use defaultPrevented
directly instead of the return value from dispatchEvent.

* dom/ScopedEventQueue.cpp:
(WebCore::ScopedEventQueue::enqueueEvent): Moved assertions here ...
(WebCore::ScopedEventQueue::dispatchEvent const): ... from here. Also changed this
to call Node::dispatchEvent instead of calling EventDispatcher::dispatchEvent directly.

* dom/SimulatedClick.cpp:
(WebCore::simulateMouseEvent): Call Element::dispatchEvent instead of calling
EventDispatcher::dispatchEvent directly.

* editing/Editor.cpp:
(WebCore::dispatchBeforeInputEvent): Use defaultPrevented directly instead of the
return value from dispatchEvent.
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::selectAll): Ditto.
(WebCore::FrameSelection::dispatchSelectStart): Ditto.

* html/CheckboxInputType.cpp:
(WebCore::CheckboxInputType::didDispatchClick): Take a reference instead of a pointer.
* html/CheckboxInputType.h: Updated for above and to use final instead of override.

* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::checkValidity): Use defaultPrevented directly instead
of the return value from dispatchEvent.

* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::prepareForSubmission): Use defaultPrevented directly instead
of the return value from dispatchEvent.
(WebCore::HTMLFormElement::reset): Ditto.

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::didDispatchClickEvent): Updated to pass references instead
of pointer.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::dispatchEvent): Got rid of boolean return value.
* html/HTMLMediaElement.h: Ditto.

* html/HTMLPlugInElement.h: Use "delete" instead of just a private function for something
that should never be called.

* html/InputType.cpp:
(WebCore::InputType::didDispatchClick): Take a reference instead of a pointer.
* html/InputType.h: Ditto.
* html/RadioInputType.cpp:
(WebCore::RadioInputType::didDispatchClick): Ditto.
* html/RadioInputType.h: Updated for above and to use final instead of override.

* html/track/TextTrackCue.cpp:
(WebCore::TextTrackCue::dispatchEvent): Got rid of boolean return value.
* html/track/TextTrackCue.h: Ditto.

* inspector/InspectorInstrumentation.cpp: Removed unneeded include of EventDispatcher.h.

* page/DOMWindow.cpp:
(WebCore::DOMWindow::dispatchLoadEvent): Streamlined code a bit so we only have a single
call to dispatchEvent. Improved comments.
(WebCore::DOMWindow::dispatchEvent): Removed return value. Added comments. Replaced
calls to setCurrentTarget(null), setEventPhase(NONE), and resetPropagationFlags with
a call to resetAfterDispatch.
* page/DOMWindow.h: Updated to get rid of the boolean return value.

* page/DragController.cpp:
(WebCore::DragController::dispatchTextInputEventFor): Use defaultPrevented directly instead
of the return value from dispatchEvent.

* page/EventHandler.cpp:
(WebCore::dispatchSelectStart): Use defaultPrevented directly instead
of the return value from dispatchEvent.
(WebCore::EventHandler::accessibilityPreventsEventPropagation): Fixed spelling error in the
name of this function.
(WebCore::EventHandler::dispatchDragSrcEvent): Got rid of boolean return value.
(WebCore::EventHandler::handleTouchEvent): Call dispatchEvent instead of dispatchTouchEvent;
there was no difference between the two except that dispatchTouchEvent required downcasting
and might some day lead to us missing some behavior implemented in an override to dispatchEvent.
* page/EventHandler.h: Updated for above changes.

* platform/graphics/filters/FilterOperation.h:
(WebCore::FilterOperation::clone): Removed dead code that was causing a compiler warning.

* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::postExceptionToWorkerObject): Use defaultPrevented
directly instead of the return value from dispatchEvent.

Source/WebKit:

* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp:
(webkit_dom_event_get_src_element): Call target instead of srcElement.

Source/WebKitLegacy/mac:

* DOM/DOMEvent.mm:
(-[DOMEvent srcElement]): Call target instead of srcElement.

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

23 months ago[GTK] Fix gtk-doc generation with gtk-doc master
mcatanzaro@igalia.com [Sat, 4 Nov 2017 16:47:46 +0000 (16:47 +0000)]
[GTK] Fix gtk-doc generation with gtk-doc master
https://bugs.webkit.org/show_bug.cgi?id=179252

Reviewed by Carlos Garcia Campos.

gtkdoc-scangobj has changed to no longer use a shell when executing its subcommands. In
particular, this means we can no longer rely on shell stuff in our run command that we use
to run the scanner. We currently use the RUN envvar to set LD_LIBRARY_PATH, and the end
result is gtkdoc-scangobj now attempts to execute our environment variable instead of the
scanner itself. We can just set LD_LIBRARY_PATH directly, instead of using RUN, in order to
make documentation generation work again.

* gtk/gtkdoc.py:
(GTKDoc._run_gtkdoc_scangobj):

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

23 months ago[Touch Bar Web API] Add support for menuitem tag
commit-queue@webkit.org [Sat, 4 Nov 2017 08:20:03 +0000 (08:20 +0000)]
[Touch Bar Web API] Add support for menuitem tag
https://bugs.webkit.org/show_bug.cgi?id=179020

Patch by Aishwarya Nirmal <anirmal@apple.com> on 2017-11-04
Reviewed by Ryosuke Niwa.

Source/WebCore:

The Touch Bar Web API will make use of the menu and menuitem tags
to represent the NSTouchBar and NSTouchBarItem respectively.
Since WebKit currently does not offer support for the menuitem tag,
this change adds it in. There is a runtime flag for this tag, which
is set to false by default.

A specification for the menuitem element can be found at
https://www.w3.org/TR/2013/WD-html51-20130528/interactive-elements.html#the-menuitem-element.
More attributes of this element will be implemented in future patches.

Test: fast/html/menuitem-element.html

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* html/HTMLElementsAllInOne.cpp:
* html/HTMLMenuItemElement.cpp: Added.
(WebCore::HTMLMenuItemElement::HTMLMenuItemElement):
(WebCore::HTMLMenuItemElement::create):
* html/HTMLMenuItemElement.h: Added.
* html/HTMLMenuItemElement.idl: Added.
* html/HTMLTagNames.in:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setMenuItemElementEnabled):
(WebCore::RuntimeEnabledFeatures::menuItemElementEnabled const):

Source/WebKit:

Adds in the MenuItemElementEnabled flag so that the menu item element is a runtime-
enabled feature. It has a default value of false.

* Shared/WebPreferences.yaml:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetMenuItemElementEnabled):
(WKPreferencesGetMenuItemElementEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:

Source/WebKitLegacy/mac:

Adds in properties and methods that allow the menuitem runtime feature
to be enabled or disabled.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(-[WebPreferences menuItemElementEnabled]):
(-[WebPreferences setMenuItemElementEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Tools:

Defines flags for the menu item test so that the element is recognized
only while its test is being run.

* DumpRenderTree/TestOptions.h:
* DumpRenderTree/TestOptions.mm:
(TestOptions::TestOptions):
* DumpRenderTree/mac/DumpRenderTree.mm:
(setWebPreferencesForTestOptions):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):
(WTR::updateTestOptionsFromTestHeader):
* WebKitTestRunner/TestOptions.h:
(WTR::TestOptions::hasSameInitializationOptions const):

LayoutTests:

This test ensures that the menuitem element is recognized when
its runtime feature is turned on.

* fast/html/menuitem-element-expected.txt: Added.
* fast/html/menuitem-element.html: Added.

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

23 months agoWeb Inspector: add contextmenu item to arbitrarily add HTML/Child to DOMTree
webkit@devinrousso.com [Sat, 4 Nov 2017 08:03:32 +0000 (08:03 +0000)]
Web Inspector: add contextmenu item to arbitrarily add HTML/Child to DOMTree
https://bugs.webkit.org/show_bug.cgi?id=179042

Reviewed by Joseph Pecoraro.

* Localizations/en.lproj/localizedStrings.js:

* UserInterface/Models/DOMNode.js:
(WI.DOMNode.prototype.insertAdjacentHTML.inspectedPage_node_insertAdjacentHTML):
(WI.DOMNode.prototype.insertAdjacentHTML):
Call-through to `insertAdjacentHTML` on the corresponding node in the inspected page.

* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement):
(WI.DOMTreeElement.prototype._populateNodeContextMenu):
(WI.DOMTreeElement.prototype._startEditingAsHTML.dispose):
(WI.DOMTreeElement.prototype._startEditingAsHTML):
(WI.DOMTreeElement.prototype._insertAdjacentHTML.commitCallback):
(WI.DOMTreeElement.prototype._insertAdjacentHTML):
(WI.DOMTreeElement.prototype.updateTitle):
(WI.DOMTreeElement.prototype._singleTextChild):
(WI.DOMTreeElement.prototype._nodeTitleInfo):
(WI.DOMTreeElement.prototype._addHTML):
(WI.DOMTreeElement.prototype._addPreviousSibling):
(WI.DOMTreeElement.prototype._addNextSibling):
(WI.DOMTreeElement.prototype._editAsHTML):
Adjust where the editing element is placed depending on the options passed to `_editAsHTML`.
If the placement is as a child, put it inside the child list. If the placement is as a
sibling, place it before/after the selected TreeElement. Otherwise, add it as a child.

* UserInterface/Views/DOMTreeOutline.css:
(.tree-outline.dom):
(.tree-outline.dom li):
(.tree-outline.dom li:not(.editing)):
(.tree-outline.dom li.editing):
(body[dir=ltr] .tree-outline.dom li): Deleted.
(body[dir=rtl] .tree-outline.dom li): Deleted.
Don't add padding when the list item is being edited.

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

23 months agoLayoutState should take RenderBox reference.
zalan@apple.com [Sat, 4 Nov 2017 05:40:22 +0000 (05:40 +0000)]
LayoutState should take RenderBox reference.
https://bugs.webkit.org/show_bug.cgi?id=179272
<rdar://problem/35345247>

Reviewed by Simon Fraser.

No change in functionality.

* rendering/LayoutState.cpp:
(WebCore::LayoutState::LayoutState):
(WebCore::LayoutState::propagateLineGridInfo):
(WebCore::LayoutState::establishLineGrid):
* rendering/LayoutState.h: type tightening.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::offsetFromLogicalTopOfFirstPage const):
* rendering/RenderView.cpp:
(WebCore::RenderView::pushLayoutState):
* rendering/RenderView.h:

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

23 months agoUnreviewed, rolling out r224438.
cdumez@apple.com [Sat, 4 Nov 2017 05:19:45 +0000 (05:19 +0000)]
Unreviewed, rolling out r224438.

Has caused assertions on the bots

Reverted changeset:

"REGRESSION(r223718): Leaking WebProcessPool after
reconfiguration"
https://bugs.webkit.org/show_bug.cgi?id=179123
https://trac.webkit.org/changeset/224438

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

23 months agoImplement ServiceWorkerContainer.getRegistration
cdumez@apple.com [Sat, 4 Nov 2017 02:12:06 +0000 (02:12 +0000)]
Implement ServiceWorkerContainer.getRegistration
https://bugs.webkit.org/show_bug.cgi?id=179253

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

LayoutTests/imported/w3c:

* web-platform-tests/service-workers/service-worker/activation.https-expected.txt:
* web-platform-tests/service-workers/service-worker/claim-affect-other-registration.https-expected.txt:
* web-platform-tests/service-workers/service-worker/claim-with-redirect.https-expected.txt:
* web-platform-tests/service-workers/service-worker/getregistration.https-expected.txt:
* web-platform-tests/service-workers/service-worker/multi-globals/url-parsing.https-expected.txt:
* web-platform-tests/service-workers/service-worker/navigate-window.https-expected.txt:
* web-platform-tests/service-workers/service-worker/registration-iframe.https-expected.txt:
* web-platform-tests/service-workers/service-worker/skip-waiting-without-using-registration.https-expected.txt:
* web-platform-tests/service-workers/service-worker/synced-state.https-expected.txt:

Source/WebCore:

Test: http/tests/workers/service/service-worker-getRegistration.html

Added a map of ServiceWorkerRegistration in ServiceWorkerContainer.
Removing a similar map from SWClientConnection as it is more convenient to have this map per ScriptExecutionContext.

This map allows returning the same JS object for different getRegistration.
Delegating the actual matching to SWServer::Connection which is implemented on the StorageProcess through IPC.

* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::getRegistration):
(WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
(WebCore::ServiceWorkerContainer::jobDidFinish):
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerContainer.idl:
* workers/service/ServiceWorkerRegistration.cpp:
(WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration):
(WebCore::ServiceWorkerRegistration::~ServiceWorkerRegistration):
* workers/service/ServiceWorkerRegistration.h:
* workers/service/server/SWClientConnection.cpp:
(WebCore::SWClientConnection::updateRegistrationState):
(WebCore::SWClientConnection::addServiceWorkerRegistration): Deleted.
(WebCore::SWClientConnection::removeServiceWorkerRegistration): Deleted.
* workers/service/server/SWClientConnection.h:

LayoutTests:

* TestExpectations:
* http/tests/workers/service/resources/service-worker-getRegistration-worker.js: Added.
* http/tests/workers/service/resources/service-worker-getRegistration.js: Added.
* http/tests/workers/service/service-worker-getRegistration-expected.txt: Added.
* http/tests/workers/service/service-worker-getRegistration.html: Added.

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

23 months ago[iOS-WK1] Fix thread safety issue in WebSQLiteDatabaseTrackerClient
cdumez@apple.com [Sat, 4 Nov 2017 01:57:57 +0000 (01:57 +0000)]
[iOS-WK1] Fix thread safety issue in WebSQLiteDatabaseTrackerClient
https://bugs.webkit.org/show_bug.cgi?id=179190

Reviewed by David Kilzer.

WebSQLiteDatabaseTrackerClient and its HystererisActivity member are constructed on the UIThread. The
HystererisActivity activity also fires on the UIThread, which means that WebSQLiteDatabaseTrackerClient::hysteresisUpdated()
gets called on the UIThread.

However, the code in WebSQLiteDatabaseTrackerClient::willBeginFirstTransaction() / WebSQLiteDatabaseTrackerClient::didFinishLastTransaction()
uses callOnMainThread() before calling methods on the HysteresisActivity. callOnMainThread() dispatches to the WebThread on WK1 iOS, which
would lead to crashes when calling methods of the HystererisActivity object:
*** -[CFRunLoopTimer respondsToSelector:]: message sent to deallocated instance 0x1c0b6a500

To address the issue, we now dispatch_async() to the main queue in willBeginFirstTransaction() / didFinishLastTransaction()
instead of using callOnMainThread(). I also added assertions to catch issues like these.

* platform/ios/WebSQLiteDatabaseTrackerClient.mm:
(WebCore::WebSQLiteDatabaseTrackerClient::willBeginFirstTransaction):
(WebCore::WebSQLiteDatabaseTrackerClient::didFinishLastTransaction):
(WebCore::WebSQLiteDatabaseTrackerClient::hysteresisUpdated):

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

23 months agoASSERTION FAILED: NoEventDispatchAssertion::InMainThread::isEventAllowed() || (frameV...
rniwa@webkit.org [Sat, 4 Nov 2017 00:36:08 +0000 (00:36 +0000)]
ASSERTION FAILED: NoEventDispatchAssertion::InMainThread::isEventAllowed() || (frameView && frameView->isInChildFrameWithFrameFlattening())
https://bugs.webkit.org/show_bug.cgi?id=179259

Reviewed by Youenn Fablet.

Avoid updating the layout inside HTMLMediaElement::stop() and MediaElementSession::~MediaElementSession

No new tests since existing tests cover this.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::userCancelledLoad): Don't update VTT cues when the active DOM objects are being stopped.
* platform/audio/mac/MediaSessionManagerMac.mm:
(WebCore::MediaSessionManagerMac::removeSession): Update the updateNowPlayingInfo asynchronously
since this function can be called inside HTMLMediaElement::~HTMLMediaElement.

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

23 months agoAdd WEBCORE_EXPORT to CachedResourceHandleBase
achristensen@apple.com [Sat, 4 Nov 2017 00:35:08 +0000 (00:35 +0000)]
Add WEBCORE_EXPORT to CachedResourceHandleBase
https://bugs.webkit.org/show_bug.cgi?id=179251

* loader/cache/CachedResourceHandle.h:
(WebCore::CachedResourceHandleBase::get const): Deleted.
(WebCore::CachedResourceHandleBase::operator! const): Deleted.
(WebCore::CachedResourceHandleBase::operator UnspecifiedBoolType const): Deleted.
(WebCore::CachedResourceHandleBase::operator=): Deleted.
I'll need this soon for bug 179251, and having to touch CachedResourceHandle.h causes me to rebuild everything.
Committing it separately greatly increases my debugging and comparison speed.

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

23 months agoUnreviewed, rolling out r224428, r224435, and r224440.
ryanhaddad@apple.com [Fri, 3 Nov 2017 23:32:07 +0000 (23:32 +0000)]
Unreviewed, rolling out r224428, r224435, and r224440.
https://bugs.webkit.org/show_bug.cgi?id=179274

Broke iOS and internal builds (Requested by ryanhaddad on
#webkit).

Reverted changesets:

"Use VCP H264 encoder for platforms supporting it"
https://bugs.webkit.org/show_bug.cgi?id=179076
https://trac.webkit.org/changeset/224428

"Use VCP H264 encoder for platforms supporting it"
https://bugs.webkit.org/show_bug.cgi?id=179076
https://trac.webkit.org/changeset/224435

"Use VCP H264 encoder for platforms supporting it"
https://bugs.webkit.org/show_bug.cgi?id=179076
https://trac.webkit.org/changeset/224440

Patch by Commit Queue <commit-queue@webkit.org> on 2017-11-03

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

23 months agoWeb Inspector: Uncaught Exception: null is not an object (evaluating 'selector.specif...
nvasilyev@apple.com [Fri, 3 Nov 2017 23:31:50 +0000 (23:31 +0000)]
Web Inspector: Uncaught Exception: null is not an object (evaluating 'selector.specificity.map') (at SpreadsheetCSSStyleDeclarationSection.js:199:51)
https://bugs.webkit.org/show_bug.cgi?id=179225
<rdar://problem/35329019>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._renderSelector):
selector.specificity may not exist when the selector is dynamic and doesn't match the selected element.

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

23 months agoUse VCP H264 encoder for platforms supporting it
commit-queue@webkit.org [Fri, 3 Nov 2017 23:21:47 +0000 (23:21 +0000)]
Use VCP H264 encoder for platforms supporting it
https://bugs.webkit.org/show_bug.cgi?id=179076
rdar://problem/35180773

Unreviewed.

Patch by Youenn Fablet <youenn@apple.com> on 2017-11-03

* Source/webrtc/sdk/objc/Framework/Classes/VideoProcessing/encoder_vcp.h: build fix for iOS.

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

23 months agoRequests handled by Service Worker should not go through preflighting
commit-queue@webkit.org [Fri, 3 Nov 2017 23:09:28 +0000 (23:09 +0000)]
Requests handled by Service Worker should not go through preflighting
https://bugs.webkit.org/show_bug.cgi?id=179250

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

Source/WebCore:

Test: http/tests/workers/service/service-worker-crossorigin-fetch.html
In case of cross origin requests needed preflighting that may be served through SW, the following is done:
- Bypass preflight
- Put service workers mode as Only so that if SW is not handling the request, the load will fail
- If load fails, restart DocumentThreadableLoader load with preflight.

Additional testing should be added when we properly handle the case where no fetch event handler is registered in the service worker.

* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
(WebCore::DocumentThreadableLoader::didFail):
* loader/DocumentThreadableLoader.h:
* loader/ResourceLoaderOptions.h:
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::setSelectedServiceWorkerIdentifierIfNeeded):
* platform/network/ResourceErrorBase.h:

Source/WebKit:

* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoad):
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::startFetch):
* WebProcess/Storage/WebServiceWorkerProvider.cpp:
(WebKit::shouldHandleFetch):

LayoutTests:

* http/tests/workers/service/resources/service-worker-crossorigin-fetch-worker.js: Added.
(event.event.request.url.indexOf):
(event.event.request.url.endsWith):
* http/tests/workers/service/resources/service-worker-crossorigin-fetch.js: Added.
(done):
(async.logStatus):
(async.test):
* http/tests/workers/service/service-worker-crossorigin-fetch-expected.txt: Added.
* http/tests/workers/service/service-worker-crossorigin-fetch.html: Added.

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

23 months agoREGRESSION(r223718): Leaking WebProcessPool after reconfiguration
cdumez@apple.com [Fri, 3 Nov 2017 23:02:16 +0000 (23:02 +0000)]
REGRESSION(r223718): Leaking WebProcessPool after reconfiguration
https://bugs.webkit.org/show_bug.cgi?id=179123
<rdar://problem/35294685>

Reviewed by Geoffrey Garen.

Make sure we destroy the ServiceWorker WebProcess once all other WebProcesses
go away at there is no use keeping it running at this point. Also, this prevents
leaking the WebProcessPool since the WebProcessProxy holds a strong reference
to the WebProcessPool.

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::disconnectProcess):

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

23 months ago[iOS] Append the platform name to the product directory on all embedded platforms
aestes@apple.com [Fri, 3 Nov 2017 22:49:17 +0000 (22:49 +0000)]
[iOS] Append the platform name to the product directory on all embedded platforms
https://bugs.webkit.org/show_bug.cgi?id=179271

Reviewed by Joseph Pecoraro.

* Scripts/webkitdirs.pm:
(determineConfigurationProductDir):

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

23 months agoRemove redundant LayoutStateMaintainer argument (RenderView&)
zalan@apple.com [Fri, 3 Nov 2017 22:42:13 +0000 (22:42 +0000)]
Remove redundant LayoutStateMaintainer argument (RenderView&)
https://bugs.webkit.org/show_bug.cgi?id=179269
<rdar://problem/35344397>

Reviewed by Simon Fraser.

No change in functionality.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::simplifiedLayout):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutBlock):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::layout):
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::layoutBlock):
* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::layout):
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::layoutBlock):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutBlock):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::layoutShadowControls):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::layout):
* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::layout):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::layout):
(WebCore::RenderTableSection::layoutRows):
* rendering/RenderVTTCue.cpp:
(WebCore::RenderVTTCue::layout):
* rendering/RenderView.h:
(WebCore::LayoutStateMaintainer::LayoutStateMaintainer):

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

23 months agoUse VCP H264 encoder for platforms supporting it
commit-queue@webkit.org [Fri, 3 Nov 2017 22:03:30 +0000 (22:03 +0000)]
Use VCP H264 encoder for platforms supporting it
https://bugs.webkit.org/show_bug.cgi?id=179076
rdar://problem/35180773

Unreviewed.

Patch by Youenn Fablet <youenn@apple.com> on 2017-11-03

* Source/webrtc/sdk/objc/Framework/Classes/VideoProcessing/encoder_vcp.h: build fix.

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

23 months agoWeb Inspector: Move Show Compositing Borders/Paint Flashing buttons from Elements...
ross.kirsling@sony.com [Fri, 3 Nov 2017 21:53:42 +0000 (21:53 +0000)]
Web Inspector: Move Show Compositing Borders/Paint Flashing buttons from Elements tab to Layers tab
https://bugs.webkit.org/show_bug.cgi?id=179211

Reviewed by Joseph Pecoraro.

* UserInterface/Views/DOMTreeContentView.js:
(WI.DOMTreeContentView.prototype.get navigationItems):
(WI.DOMTreeContentView.prototype._updateCompositingBordersButtonToMatchPageSettings):
Guard old buttons with experimental flag.

* UserInterface/Views/Layers3DContentView.js:
(WI.Layers3DContentView):
(WI.Layers3DContentView.prototype.get navigationItems):
(WI.Layers3DContentView.prototype.shown):
(WI.Layers3DContentView.prototype.closed):
(WI.Layers3DContentView.prototype._showPaintRectsSettingChanged):
(WI.Layers3DContentView.prototype._togglePaintFlashing):
(WI.Layers3DContentView.prototype._updateCompositingBordersButtonState):
(WI.Layers3DContentView.prototype._toggleCompositingBorders):
Add buttons to new home.
No need to guard for get/setCompositingBordersVisible anymore, as these were introduced in iOS 7.

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

23 months agoWeb Inspector: move top-level namespace functions in ImageUtilities to static class
webkit@devinrousso.com [Fri, 3 Nov 2017 21:43:32 +0000 (21:43 +0000)]
Web Inspector: move top-level namespace functions in ImageUtilities to static class
https://bugs.webkit.org/show_bug.cgi?id=179207

Reviewed by Brian Burg.

* .eslintrc:
* UserInterface/Base/ImageUtilities.js:
(WI.ImageUtilities.useSVGSymbol):
(WI.ImageUtilities.scratchCanvasContext2D):
(WI.ImageUtilities.imageFromImageData):
(WI.ImageUtilities.imageFromCanvasGradient):
(WI.ImageUtilities):
(useSVGSymbol): Deleted.
(WI.scratchCanvasContext2D): Deleted.
(WI.imageFromImageData): Deleted.
(WI.imageFromCanvasGradient): Deleted.

* UserInterface/Models/Recording.js:
(WI.Recording.prototype.async swizzle):
* UserInterface/Views/ButtonNavigationItem.js:
(WI.ButtonNavigationItem.prototype.set image):
* UserInterface/Views/CallFrameTreeElement.js:
(WI.CallFrameTreeElement.prototype._updateStatus):
* UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
(WI.DOMNodeDetailsSidebarPanel.prototype.initialLayout):
* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype._updateBreakpointStatus):
* UserInterface/Views/MultipleScopeBarItem.js:
(WI.MultipleScopeBarItem):
* UserInterface/Views/RecordingActionTreeElement.js:
(WI.RecordingActionTreeElement._generateDOM):
(WI.RecordingActionTreeElement.prototype._handleHasVisibleEffectChanged):
* UserInterface/Views/RecordingStateDetailsSidebarPanel.js:
(WI.RecordingStateDetailsSidebarPanel.prototype._generateDetailsCanvas2D):
* UserInterface/Views/ResourceMetricsContentView.js:
(WI.ResourceMetricsContentView.prototype._refreshResourceSizeSection):
* UserInterface/Views/ScopeRadioButtonNavigationItem.js:
(WI.ScopeRadioButtonNavigationItem):
* UserInterface/Views/ThreadTreeElement.js:
(WI.ThreadTreeElement.prototype._updateStatus):
* UserInterface/Views/TimelineTreeElement.js:
(WI.TimelineTreeElement.prototype._showCloseButton):
* UserInterface/Views/VisualStyleCommaSeparatedKeywordEditor.js:
(WI.VisualStyleCommaSeparatedKeywordEditor):
* UserInterface/Views/VisualStyleKeywordIconList.js:
(WI.VisualStyleKeywordIconList):
* UserInterface/Views/VisualStylePropertyEditorLink.js:
(WI.VisualStylePropertyEditorLink):
* UserInterface/Views/VisualStyleSelectorSection.js:
(WI.VisualStyleSelectorSection):
* UserInterface/Views/WebSocketDataGridNode.js:
(WI.WebSocketDataGridNode.prototype.createCellContent):

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

23 months agoLayoutTest http/tests/loading/basic-auth-resend-wrong-credentials.html is flaky on WK2
achristensen@apple.com [Fri, 3 Nov 2017 21:30:08 +0000 (21:30 +0000)]
LayoutTest http/tests/loading/basic-auth-resend-wrong-credentials.html is flaky on WK2
https://bugs.webkit.org/show_bug.cgi?id=159884

Reviewed by Darin Adler.

* http/tests/loading/basic-auth-resend-wrong-credentials-expected.txt:
* http/tests/loading/basic-auth-resend-wrong-credentials.html:
* platform/wk2/http/tests/loading/basic-auth-resend-wrong-credentials-expected.txt:

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

23 months agoWeb Inspector: Hide legacy Layers sidebar on Search tab
ross.kirsling@sony.com [Fri, 3 Nov 2017 21:26:59 +0000 (21:26 +0000)]
Web Inspector: Hide legacy Layers sidebar on Search tab
https://bugs.webkit.org/show_bug.cgi?id=179257

Reviewed by Joseph Pecoraro.

* UserInterface/Views/SearchTabContentView.js:
(WI.SearchTabContentView):

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