WebKit-https.git
8 months agoWeb Inspector: "Worker not found" uncaught protocol errors
commit-queue@webkit.org [Wed, 6 Feb 2019 19:57:38 +0000 (19:57 +0000)]
Web Inspector: "Worker not found" uncaught protocol errors
https://bugs.webkit.org/show_bug.cgi?id=194319

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

* UserInterface/Base/Main.js:
(WI.terminatePageTarget):
Remove Worker targets associated with the Page on navigation.
Eventually we will have to associate Workers with their parent
frame, but for now a transition can only happen at the Page
level, so we can eliminate all workers on the page.

* UserInterface/Controllers/WorkerManager.js:
(WI.WorkerManager.prototype.workerCreated):
* UserInterface/Protocol/Connection.js:
(InspectorBackend.WorkerConnection.sendMessageToBackend):
Allow any WorkerAgent domain message to fail silently. This can
happen if a Worker is created and destroyed before the frontend
hears about it and sends messages to the backend for that Worker.

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

8 months ago[JSC] Unify indirectEvalExecutableSpace and directEvalExecutableSpace
ysuzuki@apple.com [Wed, 6 Feb 2019 19:50:12 +0000 (19:50 +0000)]
[JSC] Unify indirectEvalExecutableSpace and directEvalExecutableSpace
https://bugs.webkit.org/show_bug.cgi?id=194339

Reviewed by Michael Saboff.

DirectEvalExecutable and IndirectEvalExecutable have completely same memory layout.
They have even the same structure. This patch unifies the subspaces for them.

* runtime/DirectEvalExecutable.h:
* runtime/EvalExecutable.h:
(JSC::EvalExecutable::subspaceFor):
* runtime/IndirectEvalExecutable.h:
* runtime/VM.cpp:
* runtime/VM.h:
(JSC::VM::forEachScriptExecutableSpace):

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

8 months ago[JSC] NativeExecutable should be smaller
ysuzuki@apple.com [Wed, 6 Feb 2019 19:49:04 +0000 (19:49 +0000)]
[JSC] NativeExecutable should be smaller
https://bugs.webkit.org/show_bug.cgi?id=194331

Reviewed by Michael Saboff.

NativeExecutable takes 88 bytes now. Since our GC rounds the size with 16, it actually takes 96 bytes in IsoSubspaces.
Since a lot of NativeExecutable are allocated, we already has two MarkedBlocks even just after JSGlobalObject initialization.
This patch makes sizeof(NativeExecutable) 64 bytes, which is 32 bytes smaller than 96 bytes. Now our JSGlobalObject initialization
only takes one MarkedBlock for NativeExecutable.

To make NativeExecutable smaller,

1. m_numParametersForCall and m_numParametersForConstruct in ExecutableBase are only meaningful in ScriptExecutable subclasses. Since
   they are not touched from JIT, we can remove them from ExecutableBase and move them to ScriptExecutable.

2. DOMJIT::Signature* is rarely used. Rather than having it in NativeExecutable, we should put it in NativeJITCode. Since NativeExecutable
   always has JITCode, we can safely query the value from NativeExecutable. This patch creates NativeDOMJITCode, which is a subclass of
   NativeJITCode, and instantiated only when DOMJIT::Signature* is given.

3. Move Intrinsic to a member of ScriptExecutable or JITCode. Since JITCode has some paddings to put things, we can leverage this to put
   Intrinsic for NativeExecutable.

We also move "clearCode" code from ExecutableBase to ScriptExecutable since it is only valid for ScriptExecutable subclasses.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/CallVariant.h:
* interpreter/Interpreter.cpp:
* jit/JITCode.cpp:
(JSC::DirectJITCode::DirectJITCode):
(JSC::NativeJITCode::NativeJITCode):
(JSC::NativeDOMJITCode::NativeDOMJITCode):
* jit/JITCode.h:
(JSC::JITCode::signature const):
(JSC::JITCode::intrinsic):
* jit/JITOperations.cpp:
* jit/JITThunks.cpp:
(JSC::JITThunks::hostFunctionStub):
* jit/Repatch.cpp:
* llint/LLIntSlowPaths.cpp:
* runtime/ExecutableBase.cpp:
(JSC::ExecutableBase::dump const):
(JSC::ExecutableBase::hashFor const):
(JSC::ExecutableBase::hasClearableCode const): Deleted.
(JSC::ExecutableBase::clearCode): Deleted.
* runtime/ExecutableBase.h:
(JSC::ExecutableBase::ExecutableBase):
(JSC::ExecutableBase::isModuleProgramExecutable):
(JSC::ExecutableBase::isHostFunction const):
(JSC::ExecutableBase::generatedJITCodeForCall const):
(JSC::ExecutableBase::generatedJITCodeForConstruct const):
(JSC::ExecutableBase::generatedJITCodeFor const):
(JSC::ExecutableBase::generatedJITCodeForCall): Deleted.
(JSC::ExecutableBase::generatedJITCodeForConstruct): Deleted.
(JSC::ExecutableBase::generatedJITCodeFor): Deleted.
(JSC::ExecutableBase::offsetOfNumParametersFor): Deleted.
(JSC::ExecutableBase::hasJITCodeForCall const): Deleted.
(JSC::ExecutableBase::hasJITCodeForConstruct const): Deleted.
(JSC::ExecutableBase::intrinsic const): Deleted.
* runtime/ExecutableBaseInlines.h: Added.
(JSC::ExecutableBase::intrinsic const):
(JSC::ExecutableBase::hasJITCodeForCall const):
(JSC::ExecutableBase::hasJITCodeForConstruct const):
* runtime/JSBoundFunction.cpp:
* runtime/JSType.cpp:
(WTF::printInternal):
* runtime/JSType.h:
* runtime/NativeExecutable.cpp:
(JSC::NativeExecutable::create):
(JSC::NativeExecutable::createStructure):
(JSC::NativeExecutable::NativeExecutable):
(JSC::NativeExecutable::signatureFor const):
(JSC::NativeExecutable::intrinsic const):
* runtime/NativeExecutable.h:
* runtime/ScriptExecutable.cpp:
(JSC::ScriptExecutable::ScriptExecutable):
(JSC::ScriptExecutable::clearCode):
(JSC::ScriptExecutable::installCode):
(JSC::ScriptExecutable::hasClearableCode const):
* runtime/ScriptExecutable.h:
(JSC::ScriptExecutable::intrinsic const):
(JSC::ScriptExecutable::hasJITCodeForCall const):
(JSC::ScriptExecutable::hasJITCodeForConstruct const):
* runtime/VM.cpp:
(JSC::VM::getHostFunction):

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

8 months agoWTR::InjectedBundlePage::willSendRequestForFrame() leaks a WKDataRef
ddkilzer@apple.com [Wed, 6 Feb 2019 19:32:31 +0000 (19:32 +0000)]
WTR::InjectedBundlePage::willSendRequestForFrame() leaks a WKDataRef
<https://webkit.org/b/194286>
<rdar://problem/47815558>

Reviewed by Alexey Proskuryakov.

* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::willSendRequestForFrame): Use
WKRetainPtr<> to avoid leaking the WKDataRef.

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

8 months agoRevert part of r241015 that skipped all WebGL tests
ddkilzer@apple.com [Wed, 6 Feb 2019 18:59:01 +0000 (18:59 +0000)]
Revert part of r241015 that skipped all WebGL tests

* TestExpectations: Revert unintended change to skip all WebGL
tests.

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

8 months ago[iPad] Initial test gardening (Part 2)
jbedard@apple.com [Wed, 6 Feb 2019 18:24:32 +0000 (18:24 +0000)]
[iPad] Initial test gardening (Part 2)
https://bugs.webkit.org/show_bug.cgi?id=193767
<rdar://problem/47515175>

Unreviewed test gardening.

* fast/forms/ios/validation-bubble-dismiss-on-tap.html: Change tap location so test is compatible with iPads.
* platform/ipad/TestExpectations: Associate iPad specific failures with bugs.

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

8 months ago[SVG] fix SVGURIReference build by including SVGElement
commit-queue@webkit.org [Wed, 6 Feb 2019 18:22:37 +0000 (18:22 +0000)]
[SVG] fix SVGURIReference build by including SVGElement
https://bugs.webkit.org/show_bug.cgi?id=194292

Patch by Olivier Blin <olivier.blin@softathome.com> on 2019-02-06
Reviewed by Michael Catanzaro.

* svg/SVGURIReference.h:
SVGURIReference is making use of SVGElement in its constructor, but
it was not declared.

The issue was not seen in unified builds because it was grouped with
other files including SVGElement.

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

8 months agoRoll out parts of r238819 since it is a PLT performance regression.
pvollan@apple.com [Wed, 6 Feb 2019 17:58:23 +0000 (17:58 +0000)]
Roll out parts of r238819 since it is a PLT performance regression.
https://bugs.webkit.org/show_bug.cgi?id=194346

Unreviewed performance fix.

* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(didStartProvisionalLoadForFrame):
(didReceiveServerRedirectForProvisionalLoadForFrame):
(didFinishLoadForFrame):
(globalObjectIsAvailableForFrame):
(didRemoveFrameFromHierarchy):
(didCommitLoadForFrame):
(didFinishDocumentLoadForFrame):
(didFailProvisionalLoadWithErrorForFrame):
(didFailLoadWithErrorForFrame):
(didSameDocumentNavigationForFrame):
(didLayoutForFrame):
(didReachLayoutMilestone):
(didFirstVisuallyNonEmptyLayoutForFrame):
(didHandleOnloadEventsForFrame):
(userAgentForURL):
(setUpPageLoaderClient):
(willSendRequestForFrame):
(didInitiateLoadForResource):
(didFinishLoadForResource):
(didFailLoadForResource):
(setUpResourceLoadClient):
(-[WKWebProcessPlugInBrowserContextController setLoadDelegate:]):
(ResourceLoadClient::ResourceLoadClient): Deleted.
(ResourceLoadClient::loadDelegate const): Deleted.
(ResourceLoadClient::pluginContextController const): Deleted.
(PageLoaderClient::PageLoaderClient): Deleted.
(PageLoaderClient::loadDelegate const): Deleted.
(PageLoaderClient::pluginContextController const): Deleted.
(PageLoaderClient::didStartProvisionalLoadForFrame): Deleted.
(PageLoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame): Deleted.
(PageLoaderClient::didFinishLoadForFrame): Deleted.
(PageLoaderClient::globalObjectIsAvailableForFrame): Deleted.
(PageLoaderClient::didRemoveFrameFromHierarchy): Deleted.
(PageLoaderClient::didCommitLoadForFrame): Deleted.
(PageLoaderClient::didFinishDocumentLoadForFrame): Deleted.
(PageLoaderClient::didFailProvisionalLoadWithErrorForFrame): Deleted.
(PageLoaderClient::didFailLoadWithErrorForFrame): Deleted.
(PageLoaderClient::didSameDocumentNavigationForFrame): Deleted.
(PageLoaderClient::didLayoutForFrame): Deleted.
(PageLoaderClient::didReachLayoutMilestone): Deleted.
(PageLoaderClient::didFirstVisuallyNonEmptyLayoutForFrame): Deleted.
(PageLoaderClient::layoutMilestones const): Deleted.
(PageLoaderClient::didHandleOnloadEventsForFrame): Deleted.
(PageLoaderClient::userAgentForURL const): Deleted.
(ResourceLoadClient::willSendRequestForFrame): Deleted.
(ResourceLoadClient::didInitiateLoadForResource): Deleted.
(ResourceLoadClient::didFinishLoadForResource): Deleted.
(ResourceLoadClient::didFailLoadForResource): Deleted.

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

8 months agoUnreviewed test gardening, rebaseline some tests for iOS after r240713.
ryanhaddad@apple.com [Wed, 6 Feb 2019 17:57:13 +0000 (17:57 +0000)]
Unreviewed test gardening, rebaseline some tests for iOS after r240713.

* fast/events/touch/ios/block-without-overflow-scroll-and-passive-observer-on-block-scrolling-state-expected.txt:
* fast/events/touch/ios/block-without-overflow-scroll-and-passive-observer-on-document-scrolling-state-expected.txt:
* fast/events/touch/ios/block-without-overflow-scroll-scrolling-state-expected.txt:
* fast/events/touch/ios/tap-with-active-touch-end-listener-expected.txt:

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

8 months agoUnreviewed, fix a typo
mcatanzaro@igalia.com [Wed, 6 Feb 2019 17:32:18 +0000 (17:32 +0000)]
Unreviewed, fix a typo

* TestWebKitAPI/Tests/WebKitGLib/TestCookieManager.cpp:

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

8 months ago[LFC][IFC] Move line layout code to a dedicated file
zalan@apple.com [Wed, 6 Feb 2019 17:04:44 +0000 (17:04 +0000)]
[LFC][IFC] Move line layout code to a dedicated file
https://bugs.webkit.org/show_bug.cgi?id=194328

Reviewed by Antti Koivisto.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout const):
(WebCore::Layout::isTrimmableContent): Deleted.
(WebCore::Layout::InlineFormattingContext::initializeNewLine const): Deleted.
(WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const): Deleted.
(WebCore::Layout::InlineFormattingContext::createFinalRuns const): Deleted.
(WebCore::Layout::InlineFormattingContext::postProcessInlineRuns const): Deleted.
(WebCore::Layout::InlineFormattingContext::closeLine const): Deleted.
(WebCore::Layout::InlineFormattingContext::appendContentToLine const): Deleted.
(WebCore::Layout::InlineFormattingContext::layoutInlineContent const): Deleted.
(WebCore::Layout::InlineFormattingContext::computeFloatPosition const): Deleted.
(WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::hasContent const):
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::isClosed const):
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::isFirstLine const):
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::runs):
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::contentLogicalLeft const):
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::availableWidth const):
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::lastRunType const):
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::logicalTop const):
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::logicalBottom const):
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::logicalHeight const):
(WebCore::Layout::InlineFormattingContext::Line::hasContent const): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::isClosed const): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::isFirstLine const): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::runs): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::contentLogicalLeft const): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::availableWidth const): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::lastRunType const): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::logicalTop const): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::logicalBottom const): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::logicalHeight const): Deleted.
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::adjustedLineLogicalLeft): Deleted.
(WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns): Deleted.
(WebCore::Layout::InlineFormattingContext::Geometry::computeExpansionOpportunities): Deleted.
(WebCore::Layout::InlineFormattingContext::Geometry::alignRuns): Deleted.
(WebCore::Layout::InlineFormattingContext::Geometry::runWidth): Deleted.
* layout/inlineformatting/Line.cpp:
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::init):
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::adjustLogicalLeft):
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::adjustLogicalRight):
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::contentLogicalRight const):
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::appendContent):
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::close):
(WebCore::Layout::InlineFormattingContext::Line::init): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::adjustLogicalLeft): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::adjustLogicalRight): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight const): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::appendContent): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::close): Deleted.

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

8 months agoCoreAudioCaptureSource should not configure its audio unit until it starts producing...
youenn@apple.com [Wed, 6 Feb 2019 16:59:41 +0000 (16:59 +0000)]
CoreAudioCaptureSource should not configure its audio unit until it starts producing data
https://bugs.webkit.org/show_bug.cgi?id=194310

Reviewed by Eric Carlson.

Delay the configuration of the audio unit until the source is instructed to start producing data.
This allows the UIProcess to not start changing the audio unit when
checking for constraints during getUserMedia call before the prompt.
Covered by manual testing.

* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
(WebCore::CoreAudioCaptureSource::initializeToStartProducingData):
(WebCore::CoreAudioCaptureSource::startProducingData):
* platform/mediastream/mac/CoreAudioCaptureSource.h:

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

8 months agoDisable audio ducking at Audio Unit setup time
youenn@apple.com [Wed, 6 Feb 2019 16:58:46 +0000 (16:58 +0000)]
Disable audio ducking at Audio Unit setup time
https://bugs.webkit.org/show_bug.cgi?id=194303

Reviewed by Eric Carlson.

When creating a CoreAudioCaptureSource, the audio unit might be
reconfigured if a past audio capture was done.
This might trigger audio ducking which is undone in startInternal.
In some cases, startInternal will never call start.
In that case, the audio unit will continue ducking the other processing.
To ensure ducking is disabled, unduck in setupAudioUnit as well as startInternal.

In addition to that, once a shared unit is created, it stays alive until the UIProcess exits.
This might affect all applications.
Instead, whenever the shared unit is stopped, clean it so as to restore the state as if no capture ever happened.
This has noticeable effects in the quality of audio being played on bluetooth devices.

Covered by manual tests.

* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioSharedUnit::setupAudioUnit):
(WebCore::CoreAudioSharedUnit::unduck):
(WebCore::CoreAudioSharedUnit::startInternal):
(WebCore::CoreAudioSharedUnit::captureFailed):
(WebCore::CoreAudioSharedUnit::stopProducingData):

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

8 months agoVersioning.
kocsen_chung@apple.com [Wed, 6 Feb 2019 16:30:43 +0000 (16:30 +0000)]
Versioning.

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

8 months agoVersioning.
kocsen_chung@apple.com [Wed, 6 Feb 2019 15:59:16 +0000 (15:59 +0000)]
Versioning.

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

8 months agoRELEASE_ASSERT(!m_document.isResolvingTreeStyle()) in com.apple.WebKit.WebContent...
antti@apple.com [Wed, 6 Feb 2019 15:44:28 +0000 (15:44 +0000)]
RELEASE_ASSERT(!m_document.isResolvingTreeStyle()) in com.apple.WebKit.WebContent at WebCore: WebCore::StyleResolver::~StyleResolver
https://bugs.webkit.org/show_bug.cgi?id=194333
<rdar://problem/47822929>

Reviewed by Zalan Bujtas.

Source/WebCore:

Content extensions may mutate the extension stylesheet in the middle of a style resolution as a result of
the legacy animation code triggering a resource load.

Test: http/tests/contentextensions/css-display-none-keyframe.html

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

Avoid clearing the style resolver if we are in the middle of a style resolution.
A better fix that avoid doing this in the first place is tracked by https://bugs.webkit.org/show_bug.cgi?id=194335.

LayoutTests:

* http/tests/contentextensions/css-display-none-keyframe-expected.txt: Added.
* http/tests/contentextensions/css-display-none-keyframe.html: Added.
* http/tests/contentextensions/css-display-none-keyframe.html.json: Added.

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

8 months agoBuild failure after r240315
commit-queue@webkit.org [Wed, 6 Feb 2019 15:40:30 +0000 (15:40 +0000)]
Build failure after r240315
https://bugs.webkit.org/show_bug.cgi?id=194341

Patch by Pablo Saavedra <psaavedra@igalia.com> on 2019-02-06
Reviewed by Wenson Hsieh.

* bindings/js/JSUndoItemCustom.cpp:
(WebCore::JSUndoItemOwner::isReachableFromOpaqueRoots):

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

8 months ago[GTK][WPE] force libpsl build to use ICU in jhbuild
commit-queue@webkit.org [Wed, 6 Feb 2019 13:47:50 +0000 (13:47 +0000)]
[GTK][WPE] force libpsl build to use ICU in jhbuild
https://bugs.webkit.org/show_bug.cgi?id=194288

Patch by Olivier Blin <olivier.blin@softathome.com> on 2019-02-06
Reviewed by Carlos Garcia Campos.

* gtk/jhbuild.modules:
Require ICU for libpsl build in jhbuild, like done in WPE.

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

8 months agoREGRESSION (r240909): Release assert in FrameLoader::loadURL when navigating with...
rniwa@webkit.org [Wed, 6 Feb 2019 09:42:49 +0000 (09:42 +0000)]
REGRESSION (r240909): Release assert in FrameLoader::loadURL when navigating with a non-existent target name
https://bugs.webkit.org/show_bug.cgi?id=194329

Reviewed by Geoffrey Garen.

Source/WebCore:

The bug was caused by the code path for when navigating with a specific target frame name that does not exist
never setting the load type of PolicyChecker. As a result, we would use whatever load type used in the previous
navigation, resulting in this release assertion.

Updating the load type here should in theory fix the underlying bug r240909 was meant to catch & fix.

Test: fast/loader/navigate-with-new-target-after-back-forward-navigation.html

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

LayoutTests:

Added a regression test.

* fast/loader/navigate-with-new-target-after-back-forward-navigation-expected.txt: Added.
* fast/loader/navigate-with-new-target-after-back-forward-navigation.html: Added.

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

8 months agoBuild failure after r240431
commit-queue@webkit.org [Wed, 6 Feb 2019 09:35:16 +0000 (09:35 +0000)]
Build failure after r240431
https://bugs.webkit.org/show_bug.cgi?id=194330

Patch by Pablo Saavedra <psaavedra@igalia.com> on 2019-02-06
Reviewed by Žan Doberšek.

* API/glib/JSCOptions.cpp:

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

8 months agoREGRESSION(r240785): [SOUP] Broke cookie persistent storage
mcatanzaro@igalia.com [Wed, 6 Feb 2019 08:05:57 +0000 (08:05 +0000)]
REGRESSION(r240785): [SOUP] Broke cookie persistent storage
https://bugs.webkit.org/show_bug.cgi?id=194209

Reviewed by Carlos Garcia Campos.

Source/WebKit:

I missed a spot when moving the persistent storage parameters from NetworkProcess to
NetworkSession. They have to be initialized separately for the default session.

* UIProcess/soup/WebProcessPoolSoup.cpp:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):

Tools:

Enhance TestCookieManager to ensure this doesn't happen again.

* TestWebKitAPI/Tests/WebKitGLib/TestCookieManager.cpp:
(testCookieManagerPersistentStorage):
(beforeAll):

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

8 months ago[FreeType] Build fix for Debian stable
csaavedra@igalia.com [Wed, 6 Feb 2019 07:54:43 +0000 (07:54 +0000)]
[FreeType] Build fix for Debian stable

Unreviewed build fix.

Debian stable currently has a version of fontconfig that doesn't
yet have FC_COLOR. #ifdef its use to fix the build.

* platform/graphics/freetype/FontCacheFreeType.cpp:
(WebCore::FontCache::systemFallbackForCharacters):

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

8 months agoWeb Inspector: Styles: PropertiesChanged shouldn't fire when old and new text are...
nvasilyev@apple.com [Wed, 6 Feb 2019 06:54:43 +0000 (06:54 +0000)]
Web Inspector: Styles: PropertiesChanged shouldn't fire when old and new text are both empty
https://bugs.webkit.org/show_bug.cgi?id=194318

Reviewed by Devin Rousso.

Source/WebInspectorUI:

Previously, WI.CSSStyleDeclaration.Event.PropertiesChanged fired when
old text and new text were empty strings.

* UserInterface/Models/CSSStyleDeclaration.js:

LayoutTests:

Fix the flaky test on Debug.

* inspector/css/modify-css-property-race-expected.txt:
* inspector/css/modify-css-property-race.html:

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

8 months ago[iOS] Layout tests editing/pasteboard/smart-paste-007.html and editing/pasteboard...
megan_gardner@apple.com [Wed, 6 Feb 2019 05:52:01 +0000 (05:52 +0000)]
[iOS] Layout tests editing/pasteboard/smart-paste-007.html and editing/pasteboard/smart-paste-008.html are failing
https://bugs.webkit.org/show_bug.cgi?id=194275

Reviewed by Ryosuke Niwa.

Smart paste tests 7 and 8 were outputting more information that was needed
to verify correct functionality. Also cleaned up test 8 to be more similar to
the other smart copy paste tests.

* editing/pasteboard/smart-paste-007.html:
* editing/pasteboard/smart-paste-008.html:
* platform/ios-wk1/editing/pasteboard/smart-paste-007-expected.txt: Removed.
* platform/ios-wk1/editing/pasteboard/smart-paste-008-expected.txt: Removed.
* platform/ios-wk2/editing/pasteboard/smart-paste-008-expected.txt: Removed.
* platform/ios/editing/pasteboard/smart-paste-007-expected.txt: Renamed from LayoutTests/platform/ios-wk2/editing/pasteboard/smart-paste-007-expected.txt.
* platform/ios/editing/pasteboard/smart-paste-008-expected.txt: Added.
* platform/mac/editing/pasteboard/smart-paste-007-expected.txt:
* platform/mac/editing/pasteboard/smart-paste-008-expected.txt:

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

8 months agoRename TestOptions.ignoreSynchronousMessagingTimeoutsForTesting
wenson_hsieh@apple.com [Wed, 6 Feb 2019 04:26:54 +0000 (04:26 +0000)]
Rename TestOptions.ignoreSynchronousMessagingTimeoutsForTesting
https://bugs.webkit.org/show_bug.cgi?id=194324

Reviewed by Andy Estes.

Tools:

Rename ignoreSynchronousMessagingTimeoutsForTesting to just ignoreSynchronousMessagingTimeouts. The -ForTesting
part of the name is already implicit, since this is in testing code in TestOptions.

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::generateContextConfiguration const):
(WTR::updateTestOptionsFromTestHeader):
* WebKitTestRunner/TestOptions.h:
(WTR::TestOptions::hasSameInitializationOptions const):

LayoutTests:

* fast/events/touch/ios/show-modal-alert-during-touch-start.html:

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

8 months agoStop using blobRegistry in NetworkProcess
commit-queue@webkit.org [Wed, 6 Feb 2019 02:10:50 +0000 (02:10 +0000)]
Stop using blobRegistry in NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=194027

Patch by Alex Christensen <achristensen@webkit.org> on 2019-02-05
Reviewed by Youenn Fablet.

Source/WebCore:

Also stop using NetworkBlobRegistry::singleton.
Instead, have the NetworkProcess own a NetworkBlobRegistry which owns a BlobRegistryImpl.
We now have to resolve all blob file references while we still have a
NetworkConnectionToWebProcess/NetworkProcess/NetworkBlobRegistry/BlobRegistryImpl instead of
using the singleton after we have passed everything to the loading code, but it works the same
as it did before.  We must consume the sandbox extension from the BlobRegistryImpl before using
the resolved files, so I pass around a Vector<RefPtr<WebCore::BlobDataFileReference>> so we know
which extensions to revoke.

* platform/network/BlobRegistryImpl.h:
* platform/network/FormData.cpp:
(WebCore::appendBlobResolved):
(WebCore::FormData::resolveBlobReferences):
* platform/network/FormData.h:
* platform/network/cf/FormDataStreamCFNet.cpp:
(WebCore::createHTTPBodyCFReadStream):
* platform/network/curl/CurlFormDataStream.cpp:
(WebCore::CurlFormDataStream::CurlFormDataStream):

Source/WebKit:

* NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::startDownload):
* NetworkProcess/Downloads/PendingDownload.cpp:
(WebKit::PendingDownload::PendingDownload):
* NetworkProcess/Downloads/PendingDownload.h:
* NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
(WebKit::NetworkBlobRegistry::registerFileBlobURL):
(WebKit::NetworkBlobRegistry::registerBlobURL):
(WebKit::NetworkBlobRegistry::registerBlobURLOptionallyFileBacked):
(WebKit::NetworkBlobRegistry::registerBlobURLForSlice):
(WebKit::NetworkBlobRegistry::unregisterBlobURL):
(WebKit::NetworkBlobRegistry::blobSize):
(WebKit::NetworkBlobRegistry::writeBlobsToTemporaryFiles):
(WebKit::NetworkBlobRegistry::writeBlobToFilePath):
(WebKit::NetworkBlobRegistry::connectionToWebProcessDidClose):
(WebKit::NetworkBlobRegistry::filesInBlob):
(WebKit::NetworkBlobRegistry::singleton): Deleted.
* NetworkProcess/FileAPI/NetworkBlobRegistry.h:
(WebKit::NetworkBlobRegistry::blobRegistry):
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::didClose):
(WebKit::NetworkConnectionToWebProcess::resolveBlobReferences):
(WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad):
(WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
(WebKit::NetworkConnectionToWebProcess::loadPing):
(WebKit::NetworkConnectionToWebProcess::preconnectTo):
(WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
(WebKit::NetworkConnectionToWebProcess::registerBlobURL):
(WebKit::NetworkConnectionToWebProcess::registerBlobURLFromURL):
(WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked):
(WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice):
(WebKit::NetworkConnectionToWebProcess::unregisterBlobURL):
(WebKit::NetworkConnectionToWebProcess::blobSize):
(WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
(WebKit::NetworkConnectionToWebProcess::filesInBlob):
(WebKit::NetworkConnectionToWebProcess::blobRegistry):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkDataTask.cpp:
(WebKit::NetworkDataTask::create):
* NetworkProcess/NetworkDataTaskBlob.cpp:
(WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
* NetworkProcess/NetworkDataTaskBlob.h:
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::NetworkLoad):
(WebKit::NetworkLoad::initialize):
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::NetworkProcess):
(WebKit::NetworkProcess::removeNetworkConnectionToWebProcess):
* NetworkProcess/NetworkProcess.h:
(WebKit::NetworkProcess::networkBlobRegistry):
* NetworkProcess/NetworkProcessPlatformStrategies.cpp:
(WebKit::NetworkProcessPlatformStrategies::createBlobRegistry):
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
(WebKit::NetworkResourceLoader::startNetworkLoad):
* NetworkProcess/PreconnectTask.cpp:
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
(WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):

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

8 months agoFix a typo in r241006. Substitute Modifier for Modifiers.
dbates@webkit.org [Wed, 6 Feb 2019 01:44:21 +0000 (01:44 +0000)]
Fix a typo in r241006. Substitute Modifier for Modifiers.

* Shared/mac/NativeWebGestureEventMac.mm:
(WebKit::NativeWebGestureEvent::NativeWebGestureEvent):

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

8 months agoAttempt to fix the build following r241000
dbates@webkit.org [Wed, 6 Feb 2019 01:42:42 +0000 (01:42 +0000)]
Attempt to fix the build following r241000
(https://bugs.webkit.org/show_bug.cgi?id=194241)

Substitute OptionSet<WebEvent::Modifier> for Modifiers.

* Shared/mac/NativeWebGestureEventMac.mm:
(WebKit::NativeWebGestureEvent::NativeWebGestureEvent):
* Shared/mac/WebGestureEvent.h:
(WebKit::WebGestureEvent::WebGestureEvent):

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

8 months agoUnreviewed, rolling out r240984.
tsavell@apple.com [Wed, 6 Feb 2019 01:02:44 +0000 (01:02 +0000)]
Unreviewed, rolling out r240984.

Revision casued two API timeouts

Reverted changeset:

"Stop using blobRegistry in NetworkProcess"
https://bugs.webkit.org/show_bug.cgi?id=194027
https://trac.webkit.org/changeset/240984

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

8 months agoWeb Inspector: Lots of time spent updating related resources in ResourceDetailsSideba...
drousso@apple.com [Wed, 6 Feb 2019 01:01:38 +0000 (01:01 +0000)]
Web Inspector: Lots of time spent updating related resources in ResourceDetailsSidebar when loading a page with lots of resources
https://bugs.webkit.org/show_bug.cgi?id=159577
<rdar://problem/27251461>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/ResourceDetailsSidebarPanel.js:
(WI.ResourceDetailsSidebarPanel.prototype._refreshRelatedResourcesSection):
(WI.ResourceDetailsSidebarPanel.prototype._applyResourceEventListeners):

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

8 months agoWeb Inspector: Elements tab: selection is broken after deleting the selected node
mattbaker@apple.com [Wed, 6 Feb 2019 00:55:28 +0000 (00:55 +0000)]
Web Inspector: Elements tab: selection is broken after deleting the selected node
https://bugs.webkit.org/show_bug.cgi?id=194300
<rdar://problem/47829275>

Reviewed by Devin Rousso.

Deleting a TreeElement can cause an IndexSet including indexes
outside the deleted range to be passed to SelectionController,
corrupting the internal selection state.

* UserInterface/Views/TreeOutline.js:
(WI.TreeOutline.prototype._indexesForSubtree.numberOfElementsInSubtree): Added.
(WI.TreeOutline.prototype._indexesForSubtree):
Finding the last (rightmost leaf) TreeElement in the subtree used
TreeElement.prototype.traverseNextElement to do a depth first traversal.
This method did not stay within the subtree rooted at `treeElement`.

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

8 months agoUserMediaPermissionRequestManagerProxy lambdas should check for 'this' being valid
youenn@apple.com [Wed, 6 Feb 2019 00:49:48 +0000 (00:49 +0000)]
UserMediaPermissionRequestManagerProxy lambdas should check for 'this' being valid
https://bugs.webkit.org/show_bug.cgi?id=194246

Reviewed by Eric Carlson.

With PSON enabled, the manager proxy can be destroyed.
It is thus important for its callbacks to check for 'this' to be valid.

* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
(WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):

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

8 months agoAttempt to fix the build following r241000
dbates@webkit.org [Wed, 6 Feb 2019 00:39:46 +0000 (00:39 +0000)]
Attempt to fix the build following r241000
(https://bugs.webkit.org/show_bug.cgi?id=194241)

Substitute WebEvent::Modifier::CapsLockKey for WebEvent::CapsLockKey.

* Shared/gtk/WebEventFactory.cpp:
(WebKit::modifiersForEvent):
* Shared/mac/WebEventFactory.mm:
(WebKit::modifiersForEvent):
* UIProcess/API/Cocoa/WKNavigationAction.mm:
(toNSEventModifierFlags):
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::protocolModifierToWebEventModifier):
* UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
(WebKit::modifiersToEventState):
* UIProcess/Automation/mac/WebAutomationSessionMac.mm:
(WebKit::WebAutomationSession::platformSimulateMouseInteraction):
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::toNSEventModifierFlags):

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

8 months agoMake WebEvent::Modifiers an OptionSet
dbates@webkit.org [Wed, 6 Feb 2019 00:21:21 +0000 (00:21 +0000)]
Make WebEvent::Modifiers an OptionSet
https://bugs.webkit.org/show_bug.cgi?id=194241

Reviewed by Simon Fraser.

Use an OptionSet to represent the bitmask of keyboard modifier flags. This improves type safety
and makes debugging more enjoyable because our LLDB pretty-printers have built-in support for
OptionSet.

While I am at it, make WebEvent::Modifier an enum class. It is currently an enum. This makes
this enum more closely match WebCore::PlatformEvent::Modifier.

* Shared/API/c/WKSharedAPICast.h:
(WebKit::toAPI):
* Shared/NavigationActionData.cpp:
(WebKit::NavigationActionData::encode const):
(WebKit::NavigationActionData::decode):
* Shared/NavigationActionData.h:
* Shared/WebEvent.cpp:
(WebKit::WebEvent::WebEvent):
* Shared/WebEvent.h:
(WebKit::WebEvent::shiftKey const):
(WebKit::WebEvent::controlKey const):
(WebKit::WebEvent::altKey const):
(WebKit::WebEvent::metaKey const):
(WebKit::WebEvent::capsLockKey const):
(WebKit::WebEvent::modifiers const):
(WebKit::WebTouchEvent::WebTouchEvent):
* Shared/WebEventConversion.cpp:
(WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
* Shared/WebKeyboardEvent.cpp:
(WebKit::WebKeyboardEvent::WebKeyboardEvent):
* Shared/WebMouseEvent.cpp:
(WebKit::WebMouseEvent::WebMouseEvent):
* Shared/WebTouchEvent.cpp:
(WebKit::WebTouchEvent::WebTouchEvent):
* Shared/WebWheelEvent.cpp:
(WebKit::WebWheelEvent::WebWheelEvent):
* Shared/gtk/WebEventFactory.cpp:
(WebKit::modifiersForEvent):
* Shared/ios/NativeWebTouchEventIOS.mm:
(WebKit::NativeWebTouchEvent::NativeWebTouchEvent):
* Shared/ios/WebIOSEventFactory.mm:
(modifiersForEvent):
(WebIOSEventFactory::createWebKeyboardEvent):
(WebIOSEventFactory::createWebMouseEvent):
* Shared/libwpe/WebEventFactory.cpp:
(WebKit::modifiersForEventModifiers):
(WebKit::WebEventFactory::createWebWheelEvent):
(WebKit::WebEventFactory::createWebTouchEvent):
* Shared/mac/WebEventFactory.mm:
(WebKit::modifiersForEvent):
(WebKit::WebEventFactory::createWebMouseEvent):
(WebKit::WebEventFactory::createWebWheelEvent):
(WebKit::WebEventFactory::createWebKeyboardEvent):
* Shared/win/WebEventFactory.cpp:
(WebKit::modifiersForEvent):
(WebKit::modifiersForCurrentKeyState):
(WebKit::WebEventFactory::createWebMouseEvent):
(WebKit::WebEventFactory::createWebWheelEvent):
(WebKit::WebEventFactory::createWebKeyboardEvent):
* UIProcess/API/APINavigationAction.h:
* UIProcess/API/APIUIClient.h:
(API::UIClient::mouseDidMoveOverElement):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageUIClient):
* UIProcess/API/Cocoa/WKNavigationAction.mm:
(toNSEventModifierFlags):
* UIProcess/API/glib/WebKitPrivate.cpp:
(toPlatformModifiers):
* UIProcess/API/glib/WebKitPrivate.h:
* UIProcess/API/glib/WebKitUIClient.cpp:
* UIProcess/API/glib/WebKitWebView.cpp:
(webkitWebViewMouseTargetChanged):
* UIProcess/API/glib/WebKitWebViewPrivate.h:
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::simulateMouseInteraction):
(WebKit::protocolModifierToWebEventModifier):
(WebKit::WebAutomationSession::performMouseInteraction):
* UIProcess/Automation/WebAutomationSession.h:
* UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
(WebKit::modifiersToEventState):
(WebKit::WebAutomationSession::platformSimulateMouseInteraction):
* UIProcess/Automation/mac/WebAutomationSessionMac.mm:
(WebKit::WebAutomationSession::platformSimulateMouseInteraction):
* UIProcess/Automation/wpe/WebAutomationSessionWPE.cpp:
(WebKit::modifiersToEventState):
(WebKit::WebAutomationSession::platformSimulateMouseInteraction):
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::toNSEventModifierFlags):
(WebKit::UIDelegate::UIClient::mouseDidMoveOverElement):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::mouseDidMoveOverElement):
* WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h:
(API::InjectedBundle::PageUIClient::mouseDidMoveOverElement):
* WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
(WebKit::InjectedBundleNavigationAction::modifiersForNavigationAction):
* WebProcess/InjectedBundle/InjectedBundleNavigationAction.h:
(WebKit::InjectedBundleNavigationAction::modifiers const):
* WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
(WebKit::InjectedBundlePageUIClient::mouseDidMoveOverElement):
* WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::showContextMenuAtPoint):
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::createWebEvent const):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::mouseDidMoveOverElement):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::simulateMouseDown):
(WebKit::WebPage::simulateMouseUp):
(WebKit::WebPage::simulateMouseMotion):

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

8 months ago[ews-build] Allow * as platform for builders and workers
aakash_jain@apple.com [Tue, 5 Feb 2019 23:43:15 +0000 (23:43 +0000)]
[ews-build] Allow * as platform for builders and workers
https://bugs.webkit.org/show_bug.cgi?id=188533

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/loadConfig.py:
(checkWorkersAndBuildersForConsistency):

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

8 months agoFix DFG's doesGC() for a few more nodes.
mark.lam@apple.com [Tue, 5 Feb 2019 23:34:05 +0000 (23:34 +0000)]
Fix DFG's doesGC() for a few more nodes.
https://bugs.webkit.org/show_bug.cgi?id=194307
<rdar://problem/47832956>

Reviewed by Yusuke Suzuki.

Fix doesGC() for the following nodes:

    NumberToStringWithValidRadixConstant:
        Calls operationInt32ToStringWithValidRadix(), which calls int32ToString(),
        which can allocate a string.
        Calls operationInt52ToStringWithValidRadix(), which calls int52ToString(),
        which can allocate a string.
        Calls operationDoubleToStringWithValidRadix(), which calls numberToString(),
        which can allocate a string.

    RegExpExecNonGlobalOrSticky: calls createRegExpMatchesArray() which allocates
        memory for all kinds of objects.
    RegExpMatchFast: calls operationRegExpMatchFastString(), which calls
        RegExpObject::execInline() and RegExpObject::matchGlobal().  Both of
        these allocates memory for the match result.
    RegExpMatchFastGlobal: calls operationRegExpMatchFastGlobalString(), which
        calls RegExpObject's collectMatches(), which allocates an array amongst
        other objects.

    StringFromCharCode:
        If the uint32 code to convert is greater than maxSingleCharacterString,
        we'll call operationStringFromCharCode(), which calls jsSingleCharacterString(),
        which allocates a new string if the code is greater than maxSingleCharacterString.

Also fix SpeculativeJIT::compileFromCharCode() and FTL's compileStringFromCharCode()
to use maxSingleCharacterString instead of a literal constant.

* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileFromCharCode):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileStringFromCharCode):

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

8 months agoWeb Inspector: REGRESSION (r240947): Resources tab: can't select main frame after...
mattbaker@apple.com [Tue, 5 Feb 2019 23:33:05 +0000 (23:33 +0000)]
Web Inspector: REGRESSION (r240947): Resources tab: can't select main frame after refreshing page
https://bugs.webkit.org/show_bug.cgi?id=194254
<rdar://problem/47805023>

Reviewed by Devin Rousso.

* UserInterface/Views/TreeOutline.js:
(WI.TreeOutline.prototype.selectionControllerSelectionDidChange):
TreeOutline should always call the TreeElement `select` and `deselect`
methods while processing selection changes. Having notifications
suppressed by `this._suppressNextSelectionDidChangeEvent` should only
affect the dispatching of TreeOutline events.

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

8 months ago[ews-build] Add few bots to config.json
aakash_jain@apple.com [Tue, 5 Feb 2019 23:17:14 +0000 (23:17 +0000)]
[ews-build] Add few bots to config.json
https://bugs.webkit.org/show_bug.cgi?id=194304

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/config.json:

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

8 months agoReproducible crash under WKShareSheet presentWithParameters when cancelling a share
timothy_horton@apple.com [Tue, 5 Feb 2019 23:01:04 +0000 (23:01 +0000)]
Reproducible crash under WKShareSheet presentWithParameters when cancelling a share
https://bugs.webkit.org/show_bug.cgi?id=194301
<rdar://problem/47719379>

Reviewed by Beth Dakin.

* UIProcess/Cocoa/WKShareSheet.mm:
(-[WKShareSheet presentWithParameters:completionHandler:]):
NSSharingServicePicker's delegate callbacks can be called synchronously.
We release the WKShareSheet (which holds our reference to the NSSharingServicePicker)
under sharingServicePicker:didChooseSharingService:. On older versions of macOS,
there was nothing keeping the NSSharingServicePicker alive inside
showRelativeToRect:ofView:preferredEdge:, thus the whole chain of references would
fall and result in sending a message to a released NSSharingServicePicker.
To resolve this, keep an extra reference to the WKShareSheet until
presentation is complete.

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

8 months agoEnable the automatic checking and regenerations of .xcfilelists during builds
krollin@apple.com [Tue, 5 Feb 2019 22:58:19 +0000 (22:58 +0000)]
Enable the automatic checking and regenerations of .xcfilelists during builds
https://bugs.webkit.org/show_bug.cgi?id=194124
<rdar://problem/47721277>

Reviewed by Tim Horton.

Bug 193790 add a facility for checking -- during build time -- that
any needed .xcfilelist files are up-to-date and for updating them if
they are not. This facility was initially opt-in by setting
WK_ENABLE_CHECK_XCFILELISTS until other pieces were in place and until
the process seemed robust. Its now time to enable this facility and
make it opt-out. If there is a need to disable this facility, set and
export WK_DISABLE_CHECK_XCFILELISTS=1 in your environment before
running `make` or `build-webkit`, or before running Xcode from the
command line.

Additionally, remove the step that generates a list of source files
going into the UnifiedSources build step. It's only necessarily to
specify Sources.txt and SourcesCocoa.txt as inputs.

Source/JavaScriptCore:

* JavaScriptCore.xcodeproj/project.pbxproj:
* UnifiedSources-input.xcfilelist: Removed.

Source/WebCore:

No new tests since there should be no observable behavior difference.

* UnifiedSources-input.xcfilelist: Removed.
* WebCore.xcodeproj/project.pbxproj:

Source/WebKit:

* UnifiedSources-input.xcfilelist: Removed.
* WebKit.xcodeproj/project.pbxproj:

Source/WTF:

* Scripts/generate-unified-source-bundles.rb:

Tools:

* Scripts/generate-xcfilelists:

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

8 months agoUpdate .xcfilelist files
krollin@apple.com [Tue, 5 Feb 2019 22:53:58 +0000 (22:53 +0000)]
Update .xcfilelist files
https://bugs.webkit.org/show_bug.cgi?id=194121
<rdar://problem/47720863>

Reviewed by Tim Horton.

Preparatory to enabling the facility for automatically updating the
.xcfilelist files, check in a freshly-updated set so that not everyone
runs up against having to regenerate them themselves.

Source/JavaScriptCore:

* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:

Source/WebCore:

No new tests since there should be no observable behavior difference.

* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:

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

8 months ago[INTL] improve efficiency of Intl.NumberFormat formatToParts
andy@vanwagoner.family [Tue, 5 Feb 2019 22:09:32 +0000 (22:09 +0000)]
[INTL] improve efficiency of Intl.NumberFormat formatToParts
https://bugs.webkit.org/show_bug.cgi?id=185557

Reviewed by Mark Lam.

Since field nesting depth is minimal, this algorithm should be effectively O(n),
where n is the number of characters in the formatted string.
It may be less memory efficient than the previous impl, since the intermediate Vector
is the length of the string, instead of the count of the fields.

* runtime/IntlNumberFormat.cpp:
(JSC::IntlNumberFormat::formatToParts):
* runtime/IntlNumberFormat.h:

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

8 months agoMove DFG nodes that clobberize() says will write(Heap) to the doesGC() list that...
mark.lam@apple.com [Tue, 5 Feb 2019 21:59:52 +0000 (21:59 +0000)]
Move DFG nodes that clobberize() says will write(Heap) to the doesGC() list that returns true.
https://bugs.webkit.org/show_bug.cgi?id=194298
<rdar://problem/47827555>

Reviewed by Saam Barati.

We do this for 3 reasons:
1. It's clearer when reading doesGC()'s code that these nodes will return true.
2. If things change in the future where clobberize() no longer reports these nodes
   as write(Heap), each node should be vetted first to make sure that it can never
   GC before being moved back to the doesGC() list that returns false.
3. This reduces the list of nodes that we need to audit to make sure doesGC() is
   correct in its claims about the nodes' GCing possibility.

The list of nodes moved are:

    ArrayPush
    ArrayPop
    Call
    CallEval
    CallForwardVarargs
    CallVarargs
    Construct
    ConstructForwardVarargs
    ConstructVarargs
    DefineDataProperty
    DefineAccessorProperty
    DeleteById
    DeleteByVal
    DirectCall
    DirectConstruct
    DirectTailCallInlinedCaller
    GetById
    GetByIdDirect
    GetByIdDirectFlush
    GetByIdFlush
    GetByIdWithThis
    GetByValWithThis
    GetDirectPname
    GetDynamicVar
    HasGenericProperty
    HasOwnProperty
    HasStructureProperty
    InById
    InByVal
    InstanceOf
    InstanceOfCustom
    LoadVarargs
    NumberToStringWithRadix
    PutById
    PutByIdDirect
    PutByIdFlush
    PutByIdWithThis
    PutByOffset
    PutByValWithThis
    PutDynamicVar
    PutGetterById
    PutGetterByVal
    PutGetterSetterById
    PutSetterById
    PutSetterByVal
    PutStack
    PutToArguments
    RegExpExec
    RegExpTest
    ResolveScope
    ResolveScopeForHoistingFuncDeclInEval
    TailCall
    TailCallForwardVarargsInlinedCaller
    TailCallInlinedCaller
    TailCallVarargsInlinedCaller
    ToNumber
    ToPrimitive
    ValueNegate

* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):

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

8 months agoAdd a new DownloadMap type that manages taking an assertion automatically.
beidson@apple.com [Tue, 5 Feb 2019 21:27:21 +0000 (21:27 +0000)]
Add a new DownloadMap type that manages taking an assertion automatically.
https://bugs.webkit.org/show_bug.cgi?id=194294

Reviewed by Alex Christensen.

If we don't need the download assertion, we use a vanilla HashMap like today.
If we need the download assertion, we use the new DownloadMap class instead.

The new DownloadMap is a wrapper around a HashMap that also creates/destroys the assertion as needed.

* NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::dataTaskBecameDownloadTask):
(WebKit::DownloadManager::downloadFinished):
* NetworkProcess/Downloads/DownloadManager.h:

* NetworkProcess/Downloads/DownloadMap.cpp: Added.
(WebKit::DownloadMap::get const):
(WebKit::DownloadMap::isEmpty const):
(WebKit::DownloadMap::size const):
(WebKit::DownloadMap::contains const):
(WebKit::DownloadMap::add):
(WebKit::DownloadMap::remove):
* NetworkProcess/Downloads/DownloadMap.h: Added.

* Sources.txt:

* UIProcess/ios/ProcessAssertionIOS.mm:
(WebKit::ProcessAssertion::ProcessAssertion):

* WebKit.xcodeproj/project.pbxproj:

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

8 months agoWeb Inspector: Fix modify-css-property-race.html test failures
nvasilyev@apple.com [Tue, 5 Feb 2019 20:35:10 +0000 (20:35 +0000)]
Web Inspector: Fix modify-css-property-race.html test failures
https://bugs.webkit.org/show_bug.cgi?id=194282

Reviewed by Matt Baker.

Fix test failures introduced by r240946 by providing a message for expectGreaterThan assert,
so it doesn't log the actual values.

* inspector/css/modify-css-property-race-expected.txt:
* inspector/css/modify-css-property-race.html:

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

8 months agoREGRESSION(r238848): ICU upgrade broke jsc-layout-tests.yaml/js/script-tests/intl...
andy@vanwagoner.family [Tue, 5 Feb 2019 20:30:54 +0000 (20:30 +0000)]
REGRESSION(r238848): ICU upgrade broke jsc-layout-tests.yaml/js/script-tests/intl-numberformat.js.layout
https://bugs.webkit.org/show_bug.cgi?id=193620

Reviewed by Michael Catanzaro.

Update NumberFormat tests to be more tolerant of ICU version differences.

* js/intl-numberformat-expected.txt:
* js/script-tests/intl-numberformat.js:
* platform/gtk/TestExpectations:

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

8 months ago[GTK][WPE] force libpsl build to use ICU in jhbuild
commit-queue@webkit.org [Tue, 5 Feb 2019 20:28:47 +0000 (20:28 +0000)]
[GTK][WPE] force libpsl build to use ICU in jhbuild
https://bugs.webkit.org/show_bug.cgi?id=194288

Patch by Olivier Blin <olivier.blin@softathome.com> on 2019-02-05
Reviewed by Philippe Normand.

In jhbuild, libpsl depends on ICU, but its configure script may decide to use libidn instead of ICU.
This can cause build failures if libidn is detected but libunistring is not available.

Make sure that ICU is used for runtime and builtin PSL data.

* gtk/jhbuild.modules:
* wpe/jhbuild.modules:

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

8 months ago[ews-app] Modified timestamp should be updated on updating data
aakash_jain@apple.com [Tue, 5 Feb 2019 20:19:05 +0000 (20:19 +0000)]
[ews-app] Modified timestamp should be updated on updating data
https://bugs.webkit.org/show_bug.cgi?id=194295

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-app/ews/models/build.py:
* BuildSlaveSupport/ews-app/ews/models/buildermapping.py:
* BuildSlaveSupport/ews-app/ews/models/step.py:

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

8 months agoFix iOS simulator build after r240954
beidson@apple.com [Tue, 5 Feb 2019 19:11:57 +0000 (19:11 +0000)]
Fix iOS simulator build after r240954

Unreviewed.

* UIProcess/ios/ProcessAssertionIOS.mm:
(WebKit::ProcessAssertion::ProcessAssertion): Implement the new constructor.

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

8 months agoStop using blobRegistry in NetworkProcess
achristensen@apple.com [Tue, 5 Feb 2019 18:58:21 +0000 (18:58 +0000)]
Stop using blobRegistry in NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=194027

Reviewed by Youenn Fablet.

Source/WebCore:

Also stop using NetworkBlobRegistry::singleton.
Instead, have the NetworkProcess own a NetworkBlobRegistry which owns a BlobRegistryImpl.
We now have to resolve all blob file references while we still have a
NetworkConnectionToWebProcess/NetworkProcess/NetworkBlobRegistry/BlobRegistryImpl instead of
using the singleton after we have passed everything to the loading code, but it works the same
as it did before.  We must consume the sandbox extension from the BlobRegistryImpl before using
the resolved files, so I pass around a Vector<RefPtr<WebCore::BlobDataFileReference>> so we know
which extensions to revoke.

* platform/network/BlobRegistryImpl.h:
* platform/network/FormData.cpp:
(WebCore::appendBlobResolved):
(WebCore::FormData::resolveBlobReferences):
* platform/network/FormData.h:
* platform/network/cf/FormDataStreamCFNet.cpp:
(WebCore::createHTTPBodyCFReadStream):
* platform/network/curl/CurlFormDataStream.cpp:
(WebCore::CurlFormDataStream::CurlFormDataStream):

Source/WebKit:

* NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::startDownload):
* NetworkProcess/Downloads/PendingDownload.cpp:
(WebKit::PendingDownload::PendingDownload):
* NetworkProcess/Downloads/PendingDownload.h:
* NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
(WebKit::NetworkBlobRegistry::registerFileBlobURL):
(WebKit::NetworkBlobRegistry::registerBlobURL):
(WebKit::NetworkBlobRegistry::registerBlobURLOptionallyFileBacked):
(WebKit::NetworkBlobRegistry::registerBlobURLForSlice):
(WebKit::NetworkBlobRegistry::unregisterBlobURL):
(WebKit::NetworkBlobRegistry::blobSize):
(WebKit::NetworkBlobRegistry::writeBlobsToTemporaryFiles):
(WebKit::NetworkBlobRegistry::writeBlobToFilePath):
(WebKit::NetworkBlobRegistry::connectionToWebProcessDidClose):
(WebKit::NetworkBlobRegistry::filesInBlob):
(WebKit::NetworkBlobRegistry::singleton): Deleted.
* NetworkProcess/FileAPI/NetworkBlobRegistry.h:
(WebKit::NetworkBlobRegistry::blobRegistry):
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::didClose):
(WebKit::NetworkConnectionToWebProcess::resolveBlobReferences):
(WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad):
(WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
(WebKit::NetworkConnectionToWebProcess::loadPing):
(WebKit::NetworkConnectionToWebProcess::preconnectTo):
(WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
(WebKit::NetworkConnectionToWebProcess::registerBlobURL):
(WebKit::NetworkConnectionToWebProcess::registerBlobURLFromURL):
(WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked):
(WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice):
(WebKit::NetworkConnectionToWebProcess::unregisterBlobURL):
(WebKit::NetworkConnectionToWebProcess::blobSize):
(WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
(WebKit::NetworkConnectionToWebProcess::filesInBlob):
(WebKit::NetworkConnectionToWebProcess::blobRegistry):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkDataTask.cpp:
(WebKit::NetworkDataTask::create):
* NetworkProcess/NetworkDataTaskBlob.cpp:
(WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
* NetworkProcess/NetworkDataTaskBlob.h:
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::NetworkLoad):
(WebKit::NetworkLoad::initialize):
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::NetworkProcess):
(WebKit::NetworkProcess::removeNetworkConnectionToWebProcess):
* NetworkProcess/NetworkProcess.h:
(WebKit::NetworkProcess::networkBlobRegistry):
* NetworkProcess/NetworkProcessPlatformStrategies.cpp:
(WebKit::NetworkProcessPlatformStrategies::createBlobRegistry):
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
(WebKit::NetworkResourceLoader::startNetworkLoad):
* NetworkProcess/PreconnectTask.cpp:
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
(WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):

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

8 months agoUnreviewed, rolling out r240742.
ryanhaddad@apple.com [Tue, 5 Feb 2019 18:39:36 +0000 (18:39 +0000)]
Unreviewed, rolling out r240742.

Causes crashes on iOS simulator.

Reverted changeset:

"[iOS] Keyups for non-modifier keys identified as "Dead" when
not focused in a content-editable element"
https://bugs.webkit.org/show_bug.cgi?id=192824
https://trac.webkit.org/changeset/240742

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

8 months agorun-webkit-tests emits message "...running None" when running tests
jbedard@apple.com [Tue, 5 Feb 2019 18:33:40 +0000 (18:33 +0000)]
run-webkit-tests emits message "...running None" when running tests
https://bugs.webkit.org/show_bug.cgi?id=194133
<rdar://problem/47724738>

Reviewed by Lucas Forschler.

* Scripts/webkitpy/xcode/device_type.py:
(DeviceType.__str__): Use both version mapping tables and use just the variant
name if no version name is available.
* Scripts/webkitpy/xcode/device_type_unittest.py:
(DeviceTypeTest):
(DeviceTypeTest.test_unmapped_version): Test case where the version does not have
an associated named.

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

8 months ago[JSC] Shrink sizeof(UnlinkedCodeBlock)
ysuzuki@apple.com [Tue, 5 Feb 2019 18:28:33 +0000 (18:28 +0000)]
[JSC] Shrink sizeof(UnlinkedCodeBlock)
https://bugs.webkit.org/show_bug.cgi?id=194281

Reviewed by Michael Saboff.

Source/JavaScriptCore:

This patch first attempts to reduce the size of UnlinkedCodeBlock in a relatively simpler way. Reordering members, remove unused member, and
move rarely used members to RareData. This changes sizeof(UnlinkedCodeBlock) from 312 to 256.

Still we have several chances to reduce sizeof(UnlinkedCodeBlock). Making more Vectors to RefCountedArrays can be done with some restructuring
of generatorification phase. It would be possible to remove m_sourceURLDirective and m_sourceMappingURLDirective from UnlinkedCodeBlock since
they should be in SourceProvider and that should be enough. These changes require some intrusive modifications and we make them as a future work.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::finishCreation):
* bytecode/CodeBlock.h:
(JSC::CodeBlock::bitVectors const): Deleted.
* bytecode/CodeType.h:
* bytecode/UnlinkedCodeBlock.cpp:
(JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):
(JSC::UnlinkedCodeBlock::shrinkToFit):
* bytecode/UnlinkedCodeBlock.h:
(JSC::UnlinkedCodeBlock::bitVector):
(JSC::UnlinkedCodeBlock::addBitVector):
(JSC::UnlinkedCodeBlock::addSetConstant):
(JSC::UnlinkedCodeBlock::constantRegisters):
(JSC::UnlinkedCodeBlock::numberOfConstantIdentifierSets const):
(JSC::UnlinkedCodeBlock::constantIdentifierSets):
(JSC::UnlinkedCodeBlock::codeType const):
(JSC::UnlinkedCodeBlock::didOptimize const):
(JSC::UnlinkedCodeBlock::setDidOptimize):
(JSC::UnlinkedCodeBlock::usesGlobalObject const): Deleted.
(JSC::UnlinkedCodeBlock::setGlobalObjectRegister): Deleted.
(JSC::UnlinkedCodeBlock::globalObjectRegister const): Deleted.
(JSC::UnlinkedCodeBlock::bitVectors const): Deleted.
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitLoad):
(JSC::BytecodeGenerator::emitLoadGlobalObject): Deleted.
* bytecompiler/BytecodeGenerator.h:
* runtime/CachedTypes.cpp:
(JSC::CachedCodeBlockRareData::encode):
(JSC::CachedCodeBlockRareData::decode const):
(JSC::CachedCodeBlock::scopeRegister const):
(JSC::CachedCodeBlock::codeType const):
(JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):
(JSC::CachedCodeBlock<CodeBlockType>::decode const):
(JSC::CachedCodeBlock<CodeBlockType>::encode):
(JSC::CachedCodeBlock::globalObjectRegister const): Deleted.

Source/WTF:

* wtf/TriState.h:

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

8 months ago[WPE] require python3-setuptools for meson build in jhbuild
commit-queue@webkit.org [Tue, 5 Feb 2019 17:44:58 +0000 (17:44 +0000)]
[WPE] require python3-setuptools for meson build in jhbuild
https://bugs.webkit.org/show_bug.cgi?id=194287

Patch by Olivier Blin <olivier.blin@softathome.com> on 2019-02-05
Reviewed by Philippe Normand.

python3-setuptools is needed to build meson in jhbuild.
It is already required by the GTK port.

* wpe/install-dependencies:

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

8 months ago[ews-app] Add method to save BuilderMapping to database
aakash_jain@apple.com [Tue, 5 Feb 2019 17:21:24 +0000 (17:21 +0000)]
[ews-app] Add method to save BuilderMapping to database
https://bugs.webkit.org/show_bug.cgi?id=194264

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-app/ews/models/buildermapping.py:
(BuilderMapping.__str__):
(BuilderMapping):
(BuilderMapping.save_mapping):
(BuilderMapping.update_mapping):
(BuilderMapping.get_existing_mapping):
(BuilderMapping.is_valid_mapping):

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

8 months ago[ews-app] Add timestamp fields for BuilderMappings
aakash_jain@apple.com [Tue, 5 Feb 2019 17:19:31 +0000 (17:19 +0000)]
[ews-app] Add timestamp fields for BuilderMappings
https://bugs.webkit.org/show_bug.cgi?id=194266

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-app/ews/models/buildermapping.py:
(BuilderMapping):

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

8 months ago[LFC][IFC] collectInlineContent should use pre-computed margins, paddings and borders
zalan@apple.com [Tue, 5 Feb 2019 16:01:30 +0000 (16:01 +0000)]
[LFC][IFC] collectInlineContent should use pre-computed margins, paddings and borders
https://bugs.webkit.org/show_bug.cgi?id=194269

Reviewed by Antti Koivisto.

In this patch we pre-compute the margins padding and borders for formatting context roots, replaced boxes and non-replaced containers.
These property values are input to collectInlineContent's inline item detaching logic.

* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::nextInPreOrder):
(WebCore::Layout::InlineFormattingContext::layout const):
(WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPadding const):
(WebCore::Layout::InlineFormattingContext::collectInlineContent const):
* layout/inlineformatting/InlineFormattingContext.h:
* layout/layouttree/LayoutBox.h: ran out bits.

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

8 months agoProtect globalWebSocketStreamMap with a Lock
achristensen@apple.com [Tue, 5 Feb 2019 15:38:20 +0000 (15:38 +0000)]
Protect globalWebSocketStreamMap with a Lock
https://bugs.webkit.org/show_bug.cgi?id=194224
<rdar://problem/47581081>

Reviewed by Ryosuke Niwa.

* WebProcess/Network/WebSocketStream.cpp:
(WebKit::WebSocketStream::streamWithIdentifier):
(WebKit::WebSocketStream::networkProcessCrashed):
(WebKit::WebSocketStream::WebSocketStream):
(WebKit::WebSocketStream::~WebSocketStream):

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

8 months agoAdd Networking Daemon skeleton
achristensen@apple.com [Tue, 5 Feb 2019 15:36:02 +0000 (15:36 +0000)]
Add Networking Daemon skeleton
https://bugs.webkit.org/show_bug.cgi?id=194278

Reviewed by Zalan Bujtas.

Daemon skeletons? This is spooky stuff.

* NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.h: Added.
* NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.mm: Added.
(WebKit::DaemonMain):
* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::restrictRequestReferrerToOriginIfNeeded):
* Shared/API/Cocoa/WKMain.h:
* Shared/API/Cocoa/WKMain.mm:
(WKDaemonMain):
* Shared/EntryPointUtilities/Cocoa/AuxiliaryProcessMain.cpp:
(main):
* SourcesCocoa.txt:
* UnifiedSources-input.xcfilelist:
* WebKit.xcodeproj/project.pbxproj:

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

8 months ago[ARM] Test running out of executable memory
dinfuehr@igalia.com [Tue, 5 Feb 2019 14:45:04 +0000 (14:45 +0000)]
[ARM] Test running out of executable memory
https://bugs.webkit.org/show_bug.cgi?id=194285

Unreviewed. Do no execute test with LLInt disabled, test runs out of
executable memory otherwise.

* stress/class-subclassing-function.js:

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

8 months agoREGRESSION (r240579): com.apple.WebKit.WebContent at WebCore: WebCore::Document:...
commit-queue@webkit.org [Tue, 5 Feb 2019 13:16:54 +0000 (13:16 +0000)]
REGRESSION (r240579): com.apple.WebKit.WebContent at WebCore: WebCore::Document::absoluteEventRegionForNode
https://bugs.webkit.org/show_bug.cgi?id=194284
<rdar://problem/47774298>

Patch by Antoine Quint <graouts@apple.com> on 2019-02-05
Reviewed by Antti Koivisto.

The m_touchActionElements list needs to be HashSet<RefPtr<Element>> instead of HashSet<Element*>. It was initially storing raw pointers based on m_touchEventTargets
which is an EventTargetSet (typedef’d to HashCountedSet<Node*>), but that's because these nodes have an event listener registered for them and as such are kept alive,
whereas elements with a touch-action property aren’t. Elements are removed from this list from Document::nodeWillBeRemoved() and from Document::updateTouchActionElements(),
the latter being called from Style::TreeResolver::resolveElement().

* dom/Document.cpp:
(WebCore::Document::updateTouchActionElements):
* dom/Document.h:
(WebCore::Document::touchActionElements const):

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

8 months agoWeb Inspector: Styles: remove harmless "property was unlocked" asserts
nvasilyev@apple.com [Tue, 5 Feb 2019 11:18:03 +0000 (11:18 +0000)]
Web Inspector: Styles: remove harmless "property was unlocked" asserts
https://bugs.webkit.org/show_bug.cgi?id=194262

Reviewed by Matt Baker.

* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype.remove):
(WI.SpreadsheetStyleProperty.prototype.update):
(WI.SpreadsheetStyleProperty.prototype._handleNameChange):
(WI.SpreadsheetStyleProperty.prototype._handleValueChange):

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

8 months ago[GLib] Stop URI-escaping file system representations
zandobersek@gmail.com [Tue, 5 Feb 2019 10:49:12 +0000 (10:49 +0000)]
[GLib] Stop URI-escaping file system representations
https://bugs.webkit.org/show_bug.cgi?id=194213

Reviewed by Carlos Garcia Campos.

Stop URI-escaping of file representation strings in
FileSystem::stringFromFileSystemRepresentation(), and URI-unescaping
of strings in FileSystem::fileSystemRepresentation().

This behavior deviates from POSIX and CF implementations and is
currently breaking IndexedDB-specific calculation of database sizes due
to directory components used in that process that are URL-based and are
as such URI-escaped. When unescaped, those single directory components
explode into multiple directory components, leading to incorrect total
database size calculation when iterating the database directory.

FileSystem::stringFromFileSystemRepresentation() now retrieves GLib's
filename charsets and in worst case converts the filesystem
representation to UTF-8 before String::fromUTF8() is used.
FileSystem::fileSystemRepresentation() reverses that process, taking
String's UTF-8 data and converting it to target charset if necessary.

Other FileSystem functions are adjusted to convert passed-in String
objects to filesystem representations.

* wtf/glib/FileSystemGlib.cpp:
(WTF::FileSystemImpl::stringFromFileSystemRepresentation):
(WTF::FileSystemImpl::fileSystemRepresentation):
(WTF::FileSystemImpl::validRepresentation):
(WTF::FileSystemImpl::filenameForDisplay):
(WTF::FileSystemImpl::fileExists):
(WTF::FileSystemImpl::deleteFile):
(WTF::FileSystemImpl::deleteEmptyDirectory):
(WTF::FileSystemImpl::getFileStat):
(WTF::FileSystemImpl::getFileLStat):
(WTF::FileSystemImpl::makeAllDirectories):
(WTF::FileSystemImpl::createSymbolicLink):
(WTF::FileSystemImpl::pathGetFileName):
(WTF::FileSystemImpl::getVolumeFreeSpace):
(WTF::FileSystemImpl::directoryName):
(WTF::FileSystemImpl::listDirectory):
(WTF::FileSystemImpl::openFile):
(WTF::FileSystemImpl::moveFile):
(WTF::FileSystemImpl::hardLinkOrCopyFile):
(WTF::FileSystemImpl::getFileDeviceId): Align with POSIX implementation
and treat input CString as an existing filesystem representation.
(WTF::FileSystemImpl::unescapedFilename): Deleted.

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

8 months agoHit testing functions optimizations
benjamin@webkit.org [Tue, 5 Feb 2019 08:52:04 +0000 (08:52 +0000)]
Hit testing functions optimizations
https://bugs.webkit.org/show_bug.cgi?id=194073
<rdar://problem/47692312>

Reviewed by Zalan Bujtas.

This patch implements some easy optimizations that speed up
hit testing without changing the algorithms.

* page/FrameViewLayoutContext.h:
The code for:
    view().frameView().layoutContext().isPaintOffsetCacheEnabled()
followed by:
    view().frameView().layoutContext().layoutState()
was loading all the intermediate values twice and calling layoutState()
twice.

By marking the function as pure, Clang can CSE the whole thing and
remove the duplicated code.

* platform/graphics/LayoutRect.h:
(WebCore::LayoutRect::isInfinite const):
That one is pretty funny.

Since LayoutRect::isInfinite() was implemented before operator==() is
declared, the compiler was falling back to the implicit convertion to FloatRect()
before doing any comparison.

This explains a bunch of the convertions to float when using LayoutRect.

* rendering/RenderBox.cpp:
(WebCore::RenderBox::mapLocalToContainer const):
Just reoder to make the register nice and clean for the optimization described above.

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

8 months agoWeb Inspector: Uncaught Exception: undefined is not an object (evaluating 'classes...
drousso@apple.com [Tue, 5 Feb 2019 07:48:10 +0000 (07:48 +0000)]
Web Inspector: Uncaught Exception: undefined is not an object (evaluating 'classes.includes')
https://bugs.webkit.org/show_bug.cgi?id=194280
<rdar://problem/47811159>

Reviewed by Matt Baker.

* UserInterface/Views/GeneralStyleDetailsSidebarPanel.js:
(WI.GeneralStyleDetailsSidebarPanel.prototype._populateClassToggles):
Add a fallback value in case the `class` attribute isn't specified for the selected node.

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

8 months agoUnreviewed, add missing exception checks after r240637
ysuzuki@apple.com [Tue, 5 Feb 2019 06:51:29 +0000 (06:51 +0000)]
Unreviewed, add missing exception checks after r240637
https://bugs.webkit.org/show_bug.cgi?id=193546

* tools/JSDollarVM.cpp:
(JSC::functionShadowChickenFunctionsOnStack):

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

8 months ago[JSC] Shrink size of VM by lazily allocating IsoSubspaces for non-common types
ysuzuki@apple.com [Tue, 5 Feb 2019 06:32:08 +0000 (06:32 +0000)]
[JSC] Shrink size of VM by lazily allocating IsoSubspaces for non-common types
https://bugs.webkit.org/show_bug.cgi?id=193993

Reviewed by Keith Miller.

Source/JavaScriptCore:

JSC::VM has a lot of IsoSubspaces, and each takes 504B. This unnecessarily makes VM so large.
And some of them are rarely used. We should allocate it lazily.

In this patch, we make some `IsoSubspaces` `std::unique_ptr<IsoSubspace>`. And we add ensureXXXSpace
functions which allocate IsoSubspaces lazily. This function is used by subspaceFor<> in each class.
And we also add subspaceForConcurrently<> function, which is called from concurrent JIT tiers. This
returns nullptr if the subspace is not allocated yet. JSCell::subspaceFor now takes second template
parameter which tells the function whether subspaceFor is concurrently done. If the IsoSubspace is
lazily created, we may return nullptr for the concurrent access. We ensure the space's initialization
by using WTF::storeStoreFence when lazily allocating it.

In GC's constraint solving, we may touch these lazily allocated spaces. At that time, we check the
existence of the space before touching this. This is not racy because the main thread is stopped when
the constraint solving is working.

This changes sizeof(VM) from 64736 to 56472.

Another interesting thing is that we removed `PreventCollectionScope preventCollectionScope(heap);` in
`Subspace::initialize`. This is really dangerous API since it easily causes dead-lock between the
collector and the mutator if IsoSubspace is dynamically created. We do want to make IsoSubspaces
dynamically-created ones since the requirement of the pre-allocation poses a scalability problem
of IsoSubspace adoption because IsoSubspace is large. Registered Subspace is only touched in the
EndPhase, and the peripheries should be stopped when running EndPhase. Thus, as long as the main thread
can run this IsoSubspace code, the collector is never EndPhase. So this is safe.

* API/JSCallbackFunction.h:
* API/ObjCCallbackFunction.h:
(JSC::ObjCCallbackFunction::subspaceFor):
* API/glib/JSCCallbackFunction.h:
* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::visitChildren):
(JSC::CodeBlock::finalizeUnconditionally):
* bytecode/CodeBlock.h:
* bytecode/EvalCodeBlock.h:
* bytecode/ExecutableToCodeBlockEdge.h:
* bytecode/FunctionCodeBlock.h:
* bytecode/ModuleProgramCodeBlock.h:
* bytecode/ProgramCodeBlock.h:
* bytecode/UnlinkedFunctionExecutable.cpp:
(JSC::UnlinkedFunctionExecutable::unlinkedCodeBlockFor):
* bytecode/UnlinkedFunctionExecutable.h:
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::emitAllocateRawObject):
(JSC::DFG::SpeculativeJIT::compileMakeRope):
(JSC::DFG::SpeculativeJIT::compileNewObject):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileMakeRope):
(JSC::FTL::DFG::LowerDFGToB3::compileMaterializeNewObject):
(JSC::FTL::DFG::LowerDFGToB3::allocateObject):
(JSC::FTL::DFG::LowerDFGToB3::allocateVariableSizedObject):
(JSC::FTL::DFG::LowerDFGToB3::allocateVariableSizedCell):
* heap/Heap.cpp:
(JSC::Heap::finalizeUnconditionalFinalizers):
(JSC::Heap::deleteAllCodeBlocks):
(JSC::Heap::deleteAllUnlinkedCodeBlocks):
(JSC::Heap::addCoreConstraints):
* heap/Subspace.cpp:
(JSC::Subspace::initialize):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::emitAllocateJSObjectWithKnownSize):
(JSC::AssemblyHelpers::emitAllocateVariableSizedCell):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_new_object):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_new_object):
* runtime/DirectArguments.h:
* runtime/DirectEvalExecutable.h:
* runtime/ErrorInstance.h:
(JSC::ErrorInstance::subspaceFor):
* runtime/ExecutableBase.h:
* runtime/FunctionExecutable.h:
* runtime/IndirectEvalExecutable.h:
* runtime/InferredValue.cpp:
(JSC::InferredValue::visitChildren):
* runtime/InferredValue.h:
* runtime/InferredValueInlines.h:
(JSC::InferredValue::finalizeUnconditionally):
* runtime/InternalFunction.h:
* runtime/JSAsyncFunction.h:
* runtime/JSAsyncGeneratorFunction.h:
* runtime/JSBoundFunction.h:
* runtime/JSCell.h:
(JSC::subspaceFor):
(JSC::subspaceForConcurrently):
* runtime/JSCellInlines.h:
(JSC::allocatorForNonVirtualConcurrently):
* runtime/JSCustomGetterSetterFunction.h:
* runtime/JSDestructibleObject.h:
* runtime/JSFunction.h:
* runtime/JSGeneratorFunction.h:
* runtime/JSImmutableButterfly.h:
* runtime/JSLexicalEnvironment.h:
(JSC::JSLexicalEnvironment::subspaceFor):
* runtime/JSNativeStdFunction.h:
* runtime/JSSegmentedVariableObject.h:
* runtime/JSString.h:
* runtime/ModuleProgramExecutable.h:
* runtime/NativeExecutable.h:
* runtime/ProgramExecutable.h:
* runtime/PropertyMapHashTable.h:
* runtime/ProxyRevoke.h:
* runtime/ScopedArguments.h:
* runtime/ScriptExecutable.cpp:
(JSC::ScriptExecutable::clearCode):
(JSC::ScriptExecutable::installCode):
* runtime/Structure.h:
* runtime/StructureRareData.h:
* runtime/SubspaceAccess.h: Copied from Source/JavaScriptCore/runtime/InferredValueInlines.h.
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:
(JSC::VM::SpaceAndSet::SpaceAndSet):
(JSC::VM::SpaceAndSet::setFor):
(JSC::VM::forEachScriptExecutableSpace):
(JSC::VM::SpaceAndFinalizerSet::SpaceAndFinalizerSet): Deleted.
(JSC::VM::SpaceAndFinalizerSet::finalizerSetFor): Deleted.
(JSC::VM::ScriptExecutableSpaceAndSet::ScriptExecutableSpaceAndSet): Deleted.
(JSC::VM::ScriptExecutableSpaceAndSet::clearableCodeSetFor): Deleted.
(JSC::VM::UnlinkedFunctionExecutableSpaceAndSet::UnlinkedFunctionExecutableSpaceAndSet): Deleted.
(JSC::VM::UnlinkedFunctionExecutableSpaceAndSet::clearableCodeSetFor): Deleted.
* runtime/WeakMapImpl.h:
(JSC::WeakMapImpl::subspaceFor):
* wasm/js/JSWebAssemblyCodeBlock.h:
* wasm/js/JSWebAssemblyMemory.h:
* wasm/js/WebAssemblyFunction.h:
* wasm/js/WebAssemblyWrapperFunction.h:

Source/WebCore:

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
* bridge/runtime_method.h:

Source/WebKit:

* WebProcess/Plugins/Netscape/JSNPMethod.h:
* WebProcess/Plugins/Netscape/JSNPObject.h:

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

8 months ago[iPad] Initial test gardening (Part 1)
jbedard@apple.com [Tue, 5 Feb 2019 06:19:50 +0000 (06:19 +0000)]
[iPad] Initial test gardening (Part 1)
https://bugs.webkit.org/show_bug.cgi?id=193767
<rdar://problem/47515175>

Unreviewed test gardening.

A number of tests need to be re-baselined when run on iPad because of the larger screen.

* fast/canvas/canvas-too-large-to-draw.html: iOS userAgent regex should match iPhones and iPads.
* fast/events/touch/ios/target-taller-than-view.html: Move event listener since tabpPointY is the value we should compare against.
* fast/visual-viewport/ios/min-scale-greater-than-one.html: expectedTop depends on the screen size of the device.
* platform/ipad/fast/events: Added.
* platform/ipad/fast/events/ios: Added.
* platform/ipad/fast/events/ios/keyboard-should-not-trigger-resize-expected.txt: Added.
* platform/ipad/fast/events/ios/rotation: Added.
* platform/ipad/fast/events/ios/rotation/zz-no-rotation-expected.txt: Added.
* platform/ipad/fast/events/touch: Added.
* platform/ipad/fast/events/touch/ios: Added.
* platform/ipad/fast/events/touch/ios/target-taller-than-view-expected.txt: Added.
* platform/ipad/fast/scrolling: Added.
* platform/ipad/fast/scrolling/ios: Added.
* platform/ipad/fast/scrolling/ios/clipping-ancestor-with-accelerated-scrolling-ancestor-expected.txt: Added.
* platform/ipad/fast/scrolling/ios/overflow-scrolling-ancestor-clip-expected.txt: Added.
* platform/ipad/fast/scrolling/ios/overflow-scrolling-ancestor-clip-size-expected.txt: Added.
* platform/ipad/fast/scrolling/ios/scrolling-content-clip-to-viewport-expected.txt: Added.
* platform/ipad/fast/scrolling/ios/subpixel-overflow-scrolling-with-ancestor-expected.txt: Added.
* platform/ipad/fast/scrolling/ios/touch-stacking-expected.txt: Added.
* platform/ipad/fast/viewport/ios: Added.
* platform/ipad/fast/viewport/ios/device-width-viewport-after-changing-view-scale-expected.txt: Added.
* platform/ipad/fast/viewport/ios/initial-scale-after-changing-view-scale-expected.txt: Added.
* platform/ipad/fast/viewport/ios/use-minimum-device-width-for-page-without-viewport-meta-expected.txt: Added.
* platform/ipad/fast/viewport/ios/width-is-device-width-expected.txt: Added.
* platform/ipad/fast/viewport/ios/width-is-device-width-overflowing-body-overflow-hidden-expected.txt: Added.
* platform/ipad/fast/viewport/ios/width-is-device-width-overflowing-body-overflow-hidden-tall-expected.txt: Added.
* platform/ipad/fast/viewport/ios/width-is-device-width-overflowing-expected.txt: Added.
* platform/ipad/fast/viewport/ios/width-is-device-width-overflowing-no-shrink-to-fit-expected.txt: Added.
* platform/ipad/platform: Added.
* platform/ipad/platform/ios: Added.
* platform/ipad/platform/ios/ios: Added.
* platform/ipad/platform/ios/ios/fast: Added.
* platform/ipad/platform/ios/ios/fast/text: Added.
* platform/ipad/platform/ios/ios/fast/text/opticalFontWithTextStyle-expected.txt: Added.
* platform/ipad/scrollingcoordinator: Added.
* platform/ipad/scrollingcoordinator/ios: Added.
* platform/ipad/scrollingcoordinator/ios/sync-layer-positions-after-scroll-expected.txt: Added.
* platform/ipad/scrollingcoordinator/ios/ui-scrolling-tree-expected.txt: Added.

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

8 months agoMove some macOS/iOS scrolling code into the scrolling/cocoa directory
simon.fraser@apple.com [Tue, 5 Feb 2019 04:34:56 +0000 (04:34 +0000)]
Move some macOS/iOS scrolling code into the scrolling/cocoa directory
https://bugs.webkit.org/show_bug.cgi?id=194245

Reviewed by Zalan Bujtas.

Source/WebCore:

ScrollingTreeFixedNode and ScrollingTreeStickyNode are used on iOS and macOS, so move them to the cocoa
directory.

Standardize on the ordering of ENABLE(ASYNC_SCROLLING) && PLATFORM(MAC).

Stop building ScrollingThread for iOS (it's never used), and stub out some functions so things build.

* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* page/scrolling/ScrollingThread.cpp:
(WebCore::ScrollingThread::initializeRunLoop):
(WebCore::ScrollingThread::wakeUpRunLoop):
(WebCore::ScrollingThread::threadRunLoopSourceCallback):
* page/scrolling/cocoa/ScrollingTreeFixedNode.h: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeFixedNode.h.
* page/scrolling/cocoa/ScrollingTreeFixedNode.mm: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeFixedNode.mm.
* page/scrolling/cocoa/ScrollingTreeStickyNode.h: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeStickyNode.h.
* page/scrolling/cocoa/ScrollingTreeStickyNode.mm: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeStickyNode.mm.
* page/scrolling/mac/ScrollingThreadMac.mm:
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h:
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:

Source/WebKit:

Use PLATFORM(MAC), not !PLATFORM(IOS_FAMILY).

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:

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

8 months ago[GTK][WPE] Need a function to convert internal URI to display ("pretty") URI
mcatanzaro@igalia.com [Tue, 5 Feb 2019 04:04:30 +0000 (04:04 +0000)]
[GTK][WPE] Need a function to convert internal URI to display ("pretty") URI
https://bugs.webkit.org/show_bug.cgi?id=174816

Patch by Ms2ger <Ms2ger@igalia.com> on 2019-02-04
Reviewed by Michael Catanzaro.

Source/WebCore:

Tests: enabled fast/url/user-visible/.

* testing/Internals.cpp:
(WebCore::Internals::userVisibleString): Enable method on all platforms.

Source/WebKit:

Add webkit_uri_for_display for GTK and WPE.

* PlatformGTK.cmake:
* PlatformWPE.cmake:
* SourcesGTK.txt:
* SourcesWPE.txt:
* UIProcess/API/glib/WebKitURIUtilities.cpp: Added.
(webkit_uri_for_display):
* UIProcess/API/gtk/WebKitURIUtilities.h: Added.
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
* UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
* UIProcess/API/gtk/webkit2.h:
* UIProcess/API/wpe/WebKitURIUtilities.h: Added.
* UIProcess/API/wpe/docs/wpe-0.1-sections.txt:
* UIProcess/API/wpe/docs/wpe-docs.sgml:
* UIProcess/API/wpe/webkit.h:

Source/WTF:

Translate userVisibleString and dependent code into platform-neutral C++
in wtf/URLHelpers.{h,cpp}.

* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/URLHelpers.cpp: Added.
(WTF::URLHelpers::loadIDNScriptWhiteList):
(WTF::URLHelpers::isArmenianLookalikeCharacter):
(WTF::URLHelpers::isArmenianScriptCharacter):
(WTF::URLHelpers::isASCIIDigitOrValidHostCharacter):
(WTF::URLHelpers::isLookalikeCharacter):
(WTF::URLHelpers::whiteListIDNScript):
(WTF::URLHelpers::initializeDefaultIDNScriptWhiteList):
(WTF::URLHelpers::allCharactersInIDNScriptWhiteList):
(WTF::URLHelpers::isSecondLevelDomainNameAllowedByTLDRules):
(WTF::URLHelpers::isRussianDomainNameCharacter):
(WTF::URLHelpers::allCharactersAllowedByTLDRules):
(WTF::URLHelpers::mapHostName):
(WTF::URLHelpers::collectRangesThatNeedMapping):
(WTF::URLHelpers::applyHostNameFunctionToMailToURLString):
(WTF::URLHelpers::applyHostNameFunctionToURLString):
(WTF::URLHelpers::mapHostNames):
(WTF::URLHelpers::createStringWithEscapedUnsafeCharacters):
(WTF::URLHelpers::toNormalizationFormC):
(WTF::URLHelpers::userVisibleURL):
* wtf/URLHelpers.h: Added.
* wtf/cocoa/NSURLExtras.mm:
(WTF::URLHelpers::loadIDNScriptWhiteList):
(WTF::decodePercentEscapes):
(WTF::decodeHostName):
(WTF::encodeHostName):
(WTF::URLWithUserTypedString):
(WTF::userVisibleString):

Tools:

Add tests for webkit_uri_for_display().

* TestWebKitAPI/Tests/WebKitGLib/TestWebKitURIUtilities.cpp: Added.
(testURIForDisplayUnaffected):
(testURIForDisplayAffected):
(beforeAll):
(afterAll):
* TestWebKitAPI/glib/CMakeLists.txt:

LayoutTests:

* TestExpectations: Enable fast/url/user-visible/.

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

8 months agovp8e_mr_alloc_mem() leaks LOWER_RES_FRAME_INFO if second memory allocation fails
ddkilzer@apple.com [Tue, 5 Feb 2019 03:24:54 +0000 (03:24 +0000)]
vp8e_mr_alloc_mem() leaks LOWER_RES_FRAME_INFO if second memory allocation fails
<https://webkit.org/b/194265>

Reviewed by Youenn Fablet.

* Source/third_party/libvpx/source/libvpx/vp8/vp8_cx_iface.c:
(vp8e_mr_alloc_mem):
- Initialize `res` to VPX_CODEC_OK instead of 0.
- Return early if first calloc() fails instead of trying the
  second calloc().  The function would crash dereferencing
  nullptr in `shared_mem_loc->mb_info` otherwise.
- Call free(shared_mem_loc) if the second call to calloc()
  fails.  This fixes the leak.
* WebKit/0003-libwebrtc-fix-vp8e_mr_alloc_mem-leak.diff: Add.

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

8 months agoChange llint operand macros to inline functions
keith_miller@apple.com [Tue, 5 Feb 2019 03:23:05 +0000 (03:23 +0000)]
Change llint operand macros to inline functions
https://bugs.webkit.org/show_bug.cgi?id=194248

Reviewed by Mark Lam.

* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::getNonConstantOperand):
(JSC::LLInt::getOperand):
(JSC::LLInt::llint_trace_value):
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
(JSC::LLInt::getByVal):
(JSC::LLInt::genericCall):
(JSC::LLInt::varargsSetup):
(JSC::LLInt::commonCallEval):

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

8 months agowhen lowering AssertNotEmpty, create the value before creating the patchpoint
rmorisset@apple.com [Tue, 5 Feb 2019 01:36:28 +0000 (01:36 +0000)]
when lowering AssertNotEmpty, create the value before creating the patchpoint
https://bugs.webkit.org/show_bug.cgi?id=194231

Reviewed by Saam Barati.

JSTests:

This test is painfully fragile: it tries to test that AssertNotEmpty on a constant produces valid B3 IR.
The problem is that AssertNotEmpty is only created by DFGConstantFolding when it can simplify a CheckStructure, and constant folding is a bit capricious (https://bugs.webkit.org/show_bug.cgi?id=133947)
So even tiny changes to this test can change the path code taken.

* stress/assert-not-empty.js: Added.
(foo):

Source/JavaScriptCore:

This is a very simple change: we should never generate B3 IR where an instruction depends on a value that comes later in the instruction stream.
AssertNotEmpty was generating some such IR, it probably slipped through until now because it is a rather rare and tricky instruction to generate.

* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileAssertNotEmpty):

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

8 months ago[curl] ASSERTION FAILED: !m_didNotifyResponse || m_multipartHandle
Hironori.Fujii@sony.com [Tue, 5 Feb 2019 01:34:39 +0000 (01:34 +0000)]
[curl] ASSERTION FAILED: !m_didNotifyResponse || m_multipartHandle
https://bugs.webkit.org/show_bug.cgi?id=190895

Reviewed by Ross Kirsling.

An assertion was failing in CurlRequest::invokeDidReceiveResponse
because DidReceiveResponse was already dispatched. This condition
was met if CurlRequestScheduler::completeTransfer is called while
waiting for the reply for the first DidReceiveResponse.

No new tests, covered by existing tests.

* platform/network/curl/CurlRequest.h:
(WebCore::CurlRequest::needToInvokeDidReceiveResponse const):
Return true if m_didNotifyResponse is false disregard to
m_didReturnFromNotify.

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

8 months ago[iOS Simulator] pageoverlay/overlay tests are flaky failures
ryanhaddad@apple.com [Tue, 5 Feb 2019 01:31:39 +0000 (01:31 +0000)]
[iOS Simulator] pageoverlay/overlay tests are flaky failures
https://bugs.webkit.org/show_bug.cgi?id=153337

Unreviewed test gardening.

Patch by Shawn Roberts <sroberts@apple.com> on 2019-02-04

* platform/ios/TestExpectations:

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

8 months agoMove XPCService main to a shared file calling a C function
achristensen@apple.com [Tue, 5 Feb 2019 01:31:31 +0000 (01:31 +0000)]
Move XPCService main to a shared file calling a C function
https://bugs.webkit.org/show_bug.cgi?id=194256

Reviewed by Brady Eidson.

This not only reduces a few kilobytes of duplicated binary from the XPCService executables,
It will allow me to introduce a new kind of executable which will need to parse argv and call a different C function.
This is similar to r236075 but more general.

* Shared/API/Cocoa/WKMain.h: Added.
* Shared/API/Cocoa/WKMain.mm: Added.
(WKXPCServiceMain):
* Shared/EntryPointUtilities/Cocoa/AuxiliaryProcessMain.cpp: Added.
(main):
* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
(main): Deleted.
* SourcesCocoa.txt:
* WebKit.xcodeproj/project.pbxproj:

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

8 months agoMake MessageSender functions const
achristensen@apple.com [Tue, 5 Feb 2019 01:30:24 +0000 (01:30 +0000)]
Make MessageSender functions const
https://bugs.webkit.org/show_bug.cgi?id=194247

Reviewed by Brady Eidson.

* NetworkProcess/Downloads/Download.cpp:
(WebKit::Download::messageSenderConnection const):
(WebKit::Download::messageSenderDestinationID const):
(WebKit::Download::messageSenderConnection): Deleted.
(WebKit::Download::messageSenderDestinationID): Deleted.
* NetworkProcess/Downloads/Download.h:
* NetworkProcess/Downloads/PendingDownload.cpp:
(WebKit::PendingDownload::messageSenderConnection const):
(WebKit::PendingDownload::messageSenderDestinationID const):
(WebKit::PendingDownload::messageSenderConnection): Deleted.
(WebKit::PendingDownload::messageSenderDestinationID): Deleted.
* NetworkProcess/Downloads/PendingDownload.h:
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
(WebKit::WebIDBConnectionToClient::messageSenderConnection const):
(WebKit::WebIDBConnectionToClient::messageSenderConnection): Deleted.
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::messageSenderConnection const):
(WebKit::NetworkResourceLoader::messageSenderConnection): Deleted.
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/NetworkSocketStream.cpp:
(WebKit::NetworkSocketStream::messageSenderConnection const):
(WebKit::NetworkSocketStream::messageSenderDestinationID const):
(WebKit::NetworkSocketStream::messageSenderConnection): Deleted.
(WebKit::NetworkSocketStream::messageSenderDestinationID): Deleted.
* NetworkProcess/NetworkSocketStream.h:
* NetworkProcess/ServiceWorker/WebSWServerConnection.h:
* NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
(WebKit::WebSWServerToContextConnection::messageSenderConnection const):
(WebKit::WebSWServerToContextConnection::messageSenderDestinationID const):
(WebKit::WebSWServerToContextConnection::messageSenderConnection): Deleted.
(WebKit::WebSWServerToContextConnection::messageSenderDestinationID): Deleted.
* NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
* Platform/IPC/MessageSender.h:
* Shared/AuxiliaryProcess.cpp:
(WebKit::AuxiliaryProcess::messageSenderConnection const):
(WebKit::AuxiliaryProcess::messageSenderDestinationID const):
(WebKit::AuxiliaryProcess::messageSenderConnection): Deleted.
(WebKit::AuxiliaryProcess::messageSenderDestinationID): Deleted.
* Shared/AuxiliaryProcess.h:
* UIProcess/WebConnectionToWebProcess.cpp:
(WebKit::WebConnectionToWebProcess::messageSenderConnection const):
(WebKit::WebConnectionToWebProcess::messageSenderDestinationID const):
(WebKit::WebConnectionToWebProcess::messageSenderConnection): Deleted.
(WebKit::WebConnectionToWebProcess::messageSenderDestinationID): Deleted.
* UIProcess/WebConnectionToWebProcess.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::messageSenderConnection const):
(WebKit::WebPageProxy::messageSenderDestinationID const):
(WebKit::WebPageProxy::messageSenderConnection): Deleted.
(WebKit::WebPageProxy::messageSenderDestinationID): Deleted.
* UIProcess/WebPageProxy.h:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::messageSenderConnection const):
(WebKit::WebIDBConnectionToServer::messageSenderConnection): Deleted.
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::messageSenderConnection const):
(WebKit::WebResourceLoader::messageSenderDestinationID const):
(WebKit::WebResourceLoader::messageSenderConnection): Deleted.
(WebKit::WebResourceLoader::messageSenderDestinationID): Deleted.
* WebProcess/Network/WebResourceLoader.h:
* WebProcess/Network/WebSocketStream.cpp:
(WebKit::WebSocketStream::messageSenderConnection const):
(WebKit::WebSocketStream::messageSenderDestinationID const):
(WebKit::WebSocketStream::messageSenderConnection): Deleted.
(WebKit::WebSocketStream::messageSenderDestinationID): Deleted.
* WebProcess/Network/WebSocketStream.h:
* WebProcess/Storage/WebSWClientConnection.h:
* WebProcess/WebConnectionToUIProcess.cpp:
(WebKit::WebConnectionToUIProcess::messageSenderConnection const):
(WebKit::WebConnectionToUIProcess::messageSenderDestinationID const):
(WebKit::WebConnectionToUIProcess::messageSenderConnection): Deleted.
(WebKit::WebConnectionToUIProcess::messageSenderDestinationID): Deleted.
* WebProcess/WebConnectionToUIProcess.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::messageSenderConnection const):
(WebKit::WebPage::messageSenderDestinationID const):
(WebKit::WebPage::messageSenderConnection): Deleted.
(WebKit::WebPage::messageSenderDestinationID): Deleted.
* WebProcess/WebPage/WebPage.h:

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

8 months agoTake additional process assertion while downloading.
beidson@apple.com [Tue, 5 Feb 2019 01:27:23 +0000 (01:27 +0000)]
Take additional process assertion while downloading.
<rdar://problem/47741356> and https://bugs.webkit.org/show_bug.cgi?id=194239

Reviewed by Chris Dumez.

When the first download starts, grab this new assertion.
When the last download ends, release it.

* Configurations/Network-iOS.entitlements:

* NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::dataTaskBecameDownloadTask):
(WebKit::DownloadManager::downloadFinished):
* NetworkProcess/Downloads/DownloadManager.h:

* Platform/spi/ios/AssertionServicesSPI.h:

* UIProcess/ProcessAssertion.cpp:
(WebKit::ProcessAssertion::ProcessAssertion):
* UIProcess/ProcessAssertion.h:
(WebKit::ProcessAssertion::ProcessAssertion):

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

* UIProcess/ios/ProcessAssertionIOS.mm:
(WebKit::flagsForState):
(WebKit::reasonForState):
(WebKit::ProcessAssertion::ProcessAssertion):

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

8 months agowebkitpy: Precedence of booted devices should match precedence in DEFAULT_DEVICE_TYPES
jbedard@apple.com [Tue, 5 Feb 2019 01:16:28 +0000 (01:16 +0000)]
webkitpy: Precedence of booted devices should match precedence in DEFAULT_DEVICE_TYPES
https://bugs.webkit.org/show_bug.cgi?id=194158
<rdar://problem/47737268>

Rubber-stamped by Aakash Jain.

* Scripts/webkitpy/port/device_port.py:
(DevicePort.supported_device_types): Sort supported device types by the DEFAULT_DEVICE_TYPES.

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

8 months agoWeb Inspector: Resources: missing resource data for document on reload
drousso@apple.com [Tue, 5 Feb 2019 01:11:56 +0000 (01:11 +0000)]
Web Inspector: Resources: missing resource data for document on reload
https://bugs.webkit.org/show_bug.cgi?id=194243
<rdar://problem/47559021>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/ResourceDetailsSidebarPanel.js:
(WI.ResourceDetailsSidebarPanel.prototype.set resource):
(WI.ResourceDetailsSidebarPanel.prototype._applyResourceEventListeners):

* UserInterface/Base/Object.js:
(WI.Object.removeEventListener):
Drive-by: there's no need to iterate over the entire table to check if `thisObject` exists,
as that is handled for us by `ListMultimap`, which we later call anyways.

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

8 months ago[JSC] ExecutableToCodeBlockEdge should be smaller
ysuzuki@apple.com [Tue, 5 Feb 2019 01:09:57 +0000 (01:09 +0000)]
[JSC] ExecutableToCodeBlockEdge should be smaller
https://bugs.webkit.org/show_bug.cgi?id=194244

Reviewed by Michael Saboff.

ExecutableToCodeBlockEdge is allocated so many times. However its memory layout is not efficient.
sizeof(ExecutableToCodeBlockEdge) is 24bytes, but it discards 7bytes due to one bool m_isActive flag.
Because our size classes are rounded by 16bytes, ExecutableToCodeBlockEdge takes 32bytes. So, half of
it is wasted. We should fit it into 16bytes so that we can efficiently allocate it.

In this patch, we leverages TypeInfoMayBePrototype bit in JSTypeInfo. It is a bit special TypeInfo bit
since this is per-cell bit. We rename this to TypeInfoPerCellBit, and use it as a `m_isActive` mark in
ExecutableToCodeBlockEdge. In JSObject subclasses, we use it as MayBePrototype flag.

Since this flag is not changed in CAS style, we must not change this in concurrent threads. This is OK
for ExecutableToCodeBlockEdge's m_isActive flag since this is touched on the main thread (ScriptExecutable::installCode
does not touch it if it is called in non-main threads).

* bytecode/ExecutableToCodeBlockEdge.cpp:
(JSC::ExecutableToCodeBlockEdge::finishCreation):
(JSC::ExecutableToCodeBlockEdge::visitChildren):
(JSC::ExecutableToCodeBlockEdge::activate):
(JSC::ExecutableToCodeBlockEdge::deactivate):
(JSC::ExecutableToCodeBlockEdge::isActive const):
* bytecode/ExecutableToCodeBlockEdge.h:
* runtime/JSCell.h:
* runtime/JSCellInlines.h:
(JSC::JSCell::perCellBit const):
(JSC::JSCell::setPerCellBit):
(JSC::JSCell::mayBePrototype const): Deleted.
(JSC::JSCell::didBecomePrototype): Deleted.
* runtime/JSObject.cpp:
(JSC::JSObject::setPrototypeDirect):
* runtime/JSObject.h:
* runtime/JSObjectInlines.h:
(JSC::JSObject::mayBePrototype const):
(JSC::JSObject::didBecomePrototype):
* runtime/JSTypeInfo.h:
(JSC::TypeInfo::perCellBit):
(JSC::TypeInfo::mergeInlineTypeFlags):
(JSC::TypeInfo::mayBePrototype): Deleted.

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

8 months agoWeb Inspector: REGRESSION: Resources: WI.TreeOutline assertions when refreshing the...
mattbaker@apple.com [Tue, 5 Feb 2019 01:08:40 +0000 (01:08 +0000)]
Web Inspector: REGRESSION: Resources: WI.TreeOutline assertions when refreshing the page
https://bugs.webkit.org/show_bug.cgi?id=194242
<rdar://problem/47802027>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/FolderizedTreeElement.js:
(WI.FolderizedTreeElement.prototype.removeChildren):
FolderTreeElements are removed by the base class call to removeChildren.
Calling `removeChildren` for detached TreeElements is unnecessary.

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

8 months ago[CG] Enable setAdditionalSupportedImageTypes for WK1
said@apple.com [Tue, 5 Feb 2019 00:47:17 +0000 (00:47 +0000)]
[CG] Enable setAdditionalSupportedImageTypes for WK1
https://bugs.webkit.org/show_bug.cgi?id=194190

Reviewed by Tim Horton.

Source/WebCore:

Move the function webCoreStringVectorFromNSStringArray from WebKit to
WebCore so it can be used by both WebKit and WebKitLegacy.

* platform/mac/StringUtilities.h:
* platform/mac/StringUtilities.mm:
(WebCore::webCoreStringVectorFromNSStringArray):

Source/WebKit:

Move the function webCoreStringVectorFromNSStringArray from WebKit to
WebCore so it can be used by both WebKit and WebKitLegacy.

* Platform/mac/StringUtilities.h:
* Platform/mac/StringUtilities.mm:
(WebKit::webCoreStringVectorFromNSStringArray): Deleted.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):

Source/WebKitLegacy/mac:

1. Define the preferences key AdditionalSupportedImageTypes.
2. Add additionalSupportedImageTypes as a private preference property.
3. Define the setter and the getter of the property.
4. Add function to convert from an id to an array of strings.
5. Call WebCore::setAdditionalSupportedImageTypes when preferences change.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(-[WebPreferences _stringArrayValueForKey:]):
(-[WebPreferences _setStringArrayValueForKey:forKey:]):
(-[WebPreferences setAdditionalSupportedImageTypes:]):
(-[WebPreferences additionalSupportedImageTypes]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Tools:

Add a test similar to the one under WebKit Cocoa but make it create a
WebView instead of a WKWebView.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/mac/100x100-red.tga: Added.
* TestWebKitAPI/Tests/mac/AdditionalSupportedImageTypes.html: Added.
* TestWebKitAPI/Tests/mac/AdditionalSupportedImageTypes.mm: Added.
(-[AdditionalSupportedImageTypesTest webView:didFinishLoadForFrame:]):
(TestWebKitAPI::runTest):
(TestWebKitAPI::TEST):

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

8 months agoAdd WebView SPI to temporarily force light or dark appearance on a page.
timothy@apple.com [Tue, 5 Feb 2019 00:28:24 +0000 (00:28 +0000)]
Add WebView SPI to temporarily force light or dark appearance on a page.
https://bugs.webkit.org/show_bug.cgi?id=194230

Reviewed by Tim Horton.

* WebView/WebView.mm:
(-[WebView _useDarkAppearance:]): Added.
(-[WebView _setUseDarkAppearance:]): Added.
* WebView/WebViewPrivate.h:

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

8 months agoWeb Inspector: REGRESSION: clicking a selected call frame doesn't re-scroll
mattbaker@apple.com [Mon, 4 Feb 2019 23:32:46 +0000 (23:32 +0000)]
Web Inspector: REGRESSION: clicking a selected call frame doesn't re-scroll
https://bugs.webkit.org/show_bug.cgi?id=194169
<rdar://problem/47743864>

Reviewed by Devin Rousso.

* UserInterface/Views/TreeOutline.js:
(WI.TreeOutline.prototype._handleMouseDown):
Add a special case for a single-selection TreeOutline with
allowsRepeatSelection enabled. Since the element is already
selected, bypass the SelectionCongroller and dispatch an
event with event.data.selectedByUser set to true.

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

8 months agoWeb Inspector: Styles: fix race conditions when editing
nvasilyev@apple.com [Mon, 4 Feb 2019 23:30:49 +0000 (23:30 +0000)]
Web Inspector: Styles: fix race conditions when editing
https://bugs.webkit.org/show_bug.cgi?id=192739
<rdar://problem/46752925>

Reviewed by Devin Rousso.

Source/WebInspectorUI:

Editing CSS property in the style editor syncronously updates CSSStyleDeclaration on the front-end
and asyncronously updates the backend by calling CSSAgent.setStyleText. After the new style text is applied
on the backend, CSSStyleDeclaration (on the front-end) gets updated.

Unsure there's no race conditions by introducing `_updatesInProgressCount`:

  - Increment it before calling CSSAgent.setStyleText.
  - Decrement it after CSSAgent.setStyleText is finished.

Prevent updates of CSSStyleDeclaration when _updatesInProgressCount isn't 0.

* UserInterface/Models/CSSProperty.js:
(WI.CSSProperty.prototype._updateOwnerStyleText):
* UserInterface/Models/CSSStyleDeclaration.js:
(WI.CSSStyleDeclaration):
(WI.CSSStyleDeclaration.prototype.set text): Removed.
(WI.CSSStyleDeclaration.prototype.setText): Added.
Change the setter to a method since it has side effects including an asynchronous backend call.

* UserInterface/Models/DOMNodeStyles.js:
(WI.DOMNodeStyles.prototype.changeStyleText):

* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype.get nameTextField): Removed.
(WI.SpreadsheetStyleProperty.prototype.get valueTextField): Removed.
Drive-by: remove unused code.
LayoutTests:

* inspector/css/modify-css-property-expected.txt:
* inspector/css/modify-css-property-race-expected.txt: Added.
* inspector/css/modify-css-property-race.html: Added.
* inspector/css/modify-css-property.html:

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

8 months ago[Web GPU] Code clean-up for RenderPipeline backend
justin_fan@apple.com [Mon, 4 Feb 2019 23:12:44 +0000 (23:12 +0000)]
[Web GPU] Code clean-up for RenderPipeline backend
https://bugs.webkit.org/show_bug.cgi?id=194238

Reviewed by Dean Jackson.

Replace dot syntax setters with calls to setter methods, and remove unnecessary setter calls for
the input state's descriptor arrays.

Covered by existing tests; no change in behavior.

* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::tryCreateMtlDepthStencilState): Refactor to use implicit setters rather than dot syntax.
(WebCore::setInputStateForPipelineDescriptor): Ditto, and remove unnecessary setter calls on array objects.

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

8 months agoUse deferrable timer to restart the Responsiveness Timer on each wheel event
benjamin@webkit.org [Mon, 4 Feb 2019 22:30:31 +0000 (22:30 +0000)]
Use deferrable timer to restart the Responsiveness Timer on each wheel event
https://bugs.webkit.org/show_bug.cgi?id=194135
Source/WebCore:

<rdar://problem/47724099>

Reviewed by Simon Fraser.

The original DeferrableOneShotTimer was not really deferrable.
What it allows is to restart the count down from scratch after
firing.

For this optimization, I want to keep the correct timing but avoid
starting a real timer every time.

I renamed DeferrableOneShotTimer to ResettableOneShotTimer and
created a real DeferrableOneShotTimer that support deadlines.

* css/CSSImageGeneratorValue.cpp:
* html/HTMLPlugInImageElement.h:
* loader/cache/CachedResource.h:
* platform/Timer.cpp:
(WebCore::DeferrableOneShotTimer::startOneShot):
(WebCore::DeferrableOneShotTimer::fired):
* platform/Timer.h:
(WebCore::TimerBase::nextFireTime const):
(WebCore::ResettableOneShotTimer::ResettableOneShotTimer):
(WebCore::DeferrableOneShotTimer::DeferrableOneShotTimer):
(WebCore::DeferrableOneShotTimer::stop):
(WebCore::DeferrableOneShotTimer::restart): Deleted.
* platform/graphics/ca/TileController.h:
* platform/graphics/cg/SubimageCacheWithTimer.h:

Source/WebKit:

Reviewed by Simon Fraser.

Simon Fraser suggested a neat improvement over my previous optimization
of ResponsivenessTimer.

Instead of reseting the deadline with every event, we can let the timer
fire and add the missing time from the last start.

I implemented that behavior in the new Deferrable Timer class and use
it from ResponsivenessTimer.

* NetworkProcess/watchos/NetworkProximityAssertion.h:
* UIProcess/ResponsivenessTimer.h:
* WebProcess/Plugins/PluginView.h:

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

8 months agoUse constants for pointer types
graouts@webkit.org [Mon, 4 Feb 2019 22:28:32 +0000 (22:28 +0000)]
Use constants for pointer types
https://bugs.webkit.org/show_bug.cgi?id=194232

Reviewed by Dean Jackson.

We cannot use an enum for the pointer type since a custom pointer type can be created by developers when creating a
pointer event using JavaScript, but we can at least used string constants for the ones created internally.

* dom/PointerEvent.cpp:
(WebCore::PointerEvent::mousePointerType):
(WebCore::PointerEvent::penPointerType):
(WebCore::PointerEvent::touchPointerType):
* dom/PointerEvent.h:
* dom/ios/PointerEventIOS.cpp:

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

8 months ago[First paint] Adjust "finishedParsingMainDocument" flag by taking deferred and async...
zalan@apple.com [Mon, 4 Feb 2019 22:19:41 +0000 (22:19 +0000)]
[First paint] Adjust "finishedParsingMainDocument" flag by taking deferred and async scripts into account.
https://bugs.webkit.org/show_bug.cgi?id=194168

Reviewed by Simon Fraser.

Source/WebCore:

First paint should not be blocked by async or deferred scripts.

* page/FrameView.cpp:
(WebCore::FrameView::qualifiesAsVisuallyNonEmpty const):

Tools:

Test if the firstVisuallyNoneEmpty milestone fires before the deferred script's post-message.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit/FirstVisuallyNonEmptyMilestoneWithDeferredScript.mm: Added.
(-[FirstPaintMessageHandler userContentController:didReceiveScriptMessage:]):
(-[RenderingProgressNavigationDelegate _webView:renderingProgressDidChange:]):
(TEST):
* TestWebKitAPI/Tests/WebKit/deferred-script-load.html: Added.
* TestWebKitAPI/Tests/WebKit/deferred-script.js: Added.

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

8 months agoAsync overflow scroll with border-radius renders incorrectly
simon.fraser@apple.com [Mon, 4 Feb 2019 21:51:32 +0000 (21:51 +0000)]
Async overflow scroll with border-radius renders incorrectly
https://bugs.webkit.org/show_bug.cgi?id=194205
<rdar://problem/47771668>

Reviewed by Zalan Bujtas.

Source/WebCore:

When an element has composited overflow:scroll and border-radius, we need to make a layer
to clip to the inside of the border radius if necessary.

Existing code simply turned off needsDescendantsClippingLayer for composited scrolling
layers, but now we check to see if the inner border is rounded. If we have both a m_childContainmentLayer
and scrolling layers, we need to adjust the location of the scrolling layers (which are parented
in m_childContainmentLayer).

Also fix offsetFromRenderer for these layers; it's positive for layers inset from the top left
of the border box.

Tests: compositing/clipping/border-radius-async-overflow-clipping-layer.html
       compositing/clipping/border-radius-async-overflow-non-stacking.html
       compositing/clipping/border-radius-async-overflow-stacking.html

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateConfiguration):
(WebCore::RenderLayerBacking::updateGeometry):
(WebCore::RenderLayerBacking::updateChildClippingStrategy): Layout is always up-to-date now, so remove the comment.

LayoutTests:

New baselines, mostly correcting offsetFromRenderer.

* compositing/clipping/border-radius-async-overflow-clipping-layer-expected.txt: Added.
* compositing/clipping/border-radius-async-overflow-clipping-layer.html: Added.
* compositing/clipping/border-radius-async-overflow-non-stacking-expected.html: Added.
* compositing/clipping/border-radius-async-overflow-non-stacking.html: Added.
* compositing/clipping/border-radius-async-overflow-stacking-expected.html: Added.
* compositing/clipping/border-radius-async-overflow-stacking.html: Added.
* compositing/scrolling/overflow-scrolling-layers-are-self-painting-expected.txt:
* platform/ios/compositing/overflow/scrolling-without-painting-expected.txt:
* platform/ios/compositing/overflow/textarea-scroll-touch-expected.txt: html.css specifies a border-radius on <textarea> for iOS, so we make additional
clipping layers.
* platform/ios/compositing/rtl/rtl-scrolling-with-transformed-descendants-expected.txt:
* platform/ios/compositing/scrolling/overflow-scrolling-layers-are-self-painting-expected.txt:

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

8 months agoPageOverlayController's layers should be created lazily
simon.fraser@apple.com [Mon, 4 Feb 2019 21:16:22 +0000 (21:16 +0000)]
PageOverlayController's layers should be created lazily
https://bugs.webkit.org/show_bug.cgi?id=194199
Source/WebCore:

Reviewed by Tim Horton.

Expose PageOverlayController::hasDocumentOverlays() and hasViewOverlays()
and use them to only parent the overlay-hosting layers when necessary.

For document overlays, RenderLayerCompositor::appendDocumentOverlayLayers() can
simply do nothing if there are none. Updates are triggered via Page::installedPageOverlaysChanged(),
which calls FrameView::setNeedsCompositingConfigurationUpdate() to trigger the root layer
compositing updates that parents the layerWithDocumentOverlays().

View overlays are added to the layer tree via the DrawingArea. When we go between having
none and some view overlays, Page::installedPageOverlaysChanged() calls attachViewOverlayGraphicsLayer()
on the ChromeClient, and the DrawingArea responds by calling updateRootLayers() and scheduling a
compositing flush (this has to be done manually because view overlay layers are outside the
subtree managed by RenderLayerCompositor).

Now that GraphicsLayers are ref-counted, we can let the DrawingArea simply retain its m_viewOverlayRootLayer;
there is no need for RenderLayerCompositor::attachRootLayer()/detachRootLayer() to do anything with view
overlay layers. This implies that a page can navigate (new FrameView) and view overlays will persist, without
having to be manually removed and re-added. We can also remove the Frame argument to attachViewOverlayGraphicsLayer().

* loader/EmptyClients.h:
* page/ChromeClient.h:
* page/FrameView.cpp:
(WebCore::FrameView::setNeedsCompositingConfigurationUpdate): These functions need to schedule a compositing flush
because there may be nothing else that does.
(WebCore::FrameView::setNeedsCompositingGeometryUpdate):
* page/Page.cpp:
(WebCore::Page::installedPageOverlaysChanged):
* page/Page.h:
* page/PageOverlayController.cpp:
(WebCore::PageOverlayController::hasDocumentOverlays const):
(WebCore::PageOverlayController::hasViewOverlays const):
(WebCore::PageOverlayController::attachViewOverlayLayers): PageOverlayController has the Page so it
might as well be the one to call through the ChromeClient.
(WebCore::PageOverlayController::detachViewOverlayLayers):
(WebCore::PageOverlayController::installPageOverlay):
(WebCore::PageOverlayController::uninstallPageOverlay):
* page/PageOverlayController.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingLayers): isFullUpdate is always true; remove it.
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):

Source/WebKit:

rdar://problem/46571593

Reviewed by Tim Horton.

Expose PageOverlayController::hasDocumentOverlays() and hasViewOverlays()
and use them to only parent the overlay-hosting layers when necessary.

For document overlays, RenderLayerCompositor::appendDocumentOverlayLayers() can
simply do nothing if there are none. Updates are triggered via Page::installedPageOverlaysChanged(),
which calls FrameView::setNeedsCompositingConfigurationUpdate() to trigger the root layer
compositing updates that parents the layerWithDocumentOverlays().

View overlays are added to the layer tree via the DrawingArea. When we go between having
none and some view overlays, Page::installedPageOverlaysChanged() calls attachViewOverlayGraphicsLayer()
on the ChromeClient, and the DrawingArea responds by calling updateRootLayers() and scheduling a
compositing flush (this has to be done manually because view overlay layers are outside the
subtree managed by RenderLayerCompositor).

Now that GraphicsLayers are ref-counted, we can let the DrawingArea simply retain its m_viewOverlayRootLayer;
there is no need for RenderLayerCompositor::attachRootLayer()/detachRootLayer() to do anything with view
overlay layers. This implies that a page can navigate (new FrameView) and view overlays will persist, without
having to be manually removed and re-added. We can also remove the Frame argument to attachViewOverlayGraphicsLayer().

* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::attachViewOverlayGraphicsLayer):
* WebProcess/WebPage/AcceleratedDrawingArea.h:
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
(WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):

Source/WebKitLegacy/mac:

rdar://problem/46571593

Reviewed by Tim Horton.

* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::attachViewOverlayGraphicsLayer):

Source/WebKitLegacy/win:

rdar://problem/46571593

Reviewed by Tim Horton.

Expose PageOverlayController::hasDocumentOverlays() and hasViewOverlays()
and use them to only parent the overlay-hosting layers when necessary.

For document overlays, RenderLayerCompositor::appendDocumentOverlayLayers() can
simply do nothing if there are none. Updates are triggered via Page::installedPageOverlaysChanged(),
which calls FrameView::setNeedsCompositingConfigurationUpdate() to trigger the root layer
compositing updates that parents the layerWithDocumentOverlays().

View overlays are added to the layer tree via the DrawingArea. When we go between having
none and some view overlays, Page::installedPageOverlaysChanged() calls attachViewOverlayGraphicsLayer()
on the ChromeClient, and the DrawingArea responds by calling updateRootLayers() and scheduling a
compositing flush (this has to be done manually because view overlay layers are outside the
subtree managed by RenderLayerCompositor).

Now that GraphicsLayers are ref-counted, we can let the DrawingArea simply retain its m_viewOverlayRootLayer;
there is no need for RenderLayerCompositor::attachRootLayer()/detachRootLayer() to do anything with view
overlay layers. This implies that a page can navigate (new FrameView) and view overlays will persist, without
having to be manually removed and re-added. We can also remove the Frame argument to attachViewOverlayGraphicsLayer().

* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::attachViewOverlayGraphicsLayer):
* WebCoreSupport/WebChromeClient.h:

LayoutTests:

rdar://problem/46571593

Reviewed by Tim Horton.

* pageoverlay/overlay-remove-reinsert-view-expected.txt: We no longer unparent the overlays
on view removal, so new results.
* platform/ios-wk2/TestExpectations: Unskip some iOS tests.
* platform/ios-wk2/pageoverlay/overlay-installation-expected.txt: Added.
* platform/ios-wk2/pageoverlay/overlay-large-document-expected.txt: Added.
* platform/ios-wk2/pageoverlay/overlay-large-document-scrolled-expected.txt: Added.
* platform/ios/TestExpectations: Unskip some iOS tests.

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

8 months agoSource/WebCore:
commit-queue@webkit.org [Mon, 4 Feb 2019 21:03:20 +0000 (21:03 +0000)]
Source/WebCore:
When performing Increment or Decrement on sliders, check to see if the slider is disabled.
https://bugs.webkit.org/show_bug.cgi?id=173497

Patch by Eric Liang <ericliang@apple.com> on 2019-02-04
Reviewed by Chris Fleizach.

Test: accessibility/set-value-not-work-for-disabled-sliders.html

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::alterSliderValue):

LayoutTests:
Check if slider value changed after calling AX Increment or Decrement on disabled sliders.
https://bugs.webkit.org/show_bug.cgi?id=193497

Patch by Eric Liang <ericliang@apple.com> on 2019-02-04
Reviewed by Chris Fleizach.

* accessibility/set-value-not-work-for-disabled-sliders.html: Added.

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

8 months ago[JSC] Shrink size of FunctionExecutable
ysuzuki@apple.com [Mon, 4 Feb 2019 21:02:27 +0000 (21:02 +0000)]
[JSC] Shrink size of FunctionExecutable
https://bugs.webkit.org/show_bug.cgi?id=194191

Reviewed by Michael Saboff.

This patch reduces the size of FunctionExecutable. Since it is allocated in IsoSubspace, reducing the size directly
improves the allocation efficiency.

1. ScriptExecutable (base class of FunctionExecutable) has several members, but it is meaningful only in FunctionExecutable.
   We remove this from ScriptExecutable, and move it to FunctionExecutable.

2. FunctionExecutable has several data which are rarely used. One for FunctionOverrides functionality, which is typically
   used for JSC debugging purpose, and another is TypeSet and offsets for type profiler. We move them to RareData and reduce
   the size of FunctionExecutable in the common case.

This patch changes the size of FunctionExecutable from 176 to 144.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dumpSource):
(JSC::CodeBlock::finishCreation):
* dfg/DFGNode.h:
(JSC::DFG::Node::OpInfoWrapper::as const):
* interpreter/StackVisitor.cpp:
(JSC::StackVisitor::Frame::computeLineAndColumn const):
* runtime/ExecutableBase.h:
* runtime/FunctionExecutable.cpp:
(JSC::FunctionExecutable::FunctionExecutable):
(JSC::FunctionExecutable::ensureRareDataSlow):
* runtime/FunctionExecutable.h:
* runtime/Intrinsic.h:
* runtime/ModuleProgramExecutable.cpp:
(JSC::ModuleProgramExecutable::ModuleProgramExecutable):
* runtime/ProgramExecutable.cpp:
(JSC::ProgramExecutable::ProgramExecutable):
* runtime/ScriptExecutable.cpp:
(JSC::ScriptExecutable::ScriptExecutable):
(JSC::ScriptExecutable::overrideLineNumber const):
(JSC::ScriptExecutable::typeProfilingStartOffset const):
(JSC::ScriptExecutable::typeProfilingEndOffset const):
* runtime/ScriptExecutable.h:
(JSC::ScriptExecutable::firstLine const):
(JSC::ScriptExecutable::setOverrideLineNumber): Deleted.
(JSC::ScriptExecutable::hasOverrideLineNumber const): Deleted.
(JSC::ScriptExecutable::overrideLineNumber const): Deleted.
(JSC::ScriptExecutable::typeProfilingStartOffset const): Deleted.
(JSC::ScriptExecutable::typeProfilingEndOffset const): Deleted.
* runtime/StackFrame.cpp:
(JSC::StackFrame::computeLineAndColumn const):
* tools/JSDollarVM.cpp:
(JSC::functionReturnTypeFor):

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

8 months agoUnreviewed, improve preprocessor guard
mcatanzaro@igalia.com [Mon, 4 Feb 2019 20:49:37 +0000 (20:49 +0000)]
Unreviewed, improve preprocessor guard
https://bugs.webkit.org/show_bug.cgi?id=194166
<rdar://problem/47694328>

AC mode is only optional in GTK port. Requested by Zan.

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

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

8 months agoREGRESSION (r237269): webkit-patch what-broke is broken
dean_johnson@apple.com [Mon, 4 Feb 2019 19:49:08 +0000 (19:49 +0000)]
REGRESSION (r237269): webkit-patch what-broke is broken
https://bugs.webkit.org/show_bug.cgi?id=193025

Reviewed by Aakash Jain.

* Scripts/webkitpy/common/host.py:
(Host.buildbot):
(Host.bugzilla): Renamed to 'buildbot'.

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

8 months ago[iOS] API test WKAttachmentTests.InsertAndRemoveDuplicateAttachment is failing after...
wenson_hsieh@apple.com [Mon, 4 Feb 2019 18:59:40 +0000 (18:59 +0000)]
[iOS] API test WKAttachmentTests.InsertAndRemoveDuplicateAttachment is failing after r240902
https://bugs.webkit.org/show_bug.cgi?id=194207

Reviewed by Tim Horton.

Fix this API test by making it robust against smart paste on iOS. Currently, this test pastes an attachment
element and assumes that the pasted attachment is adjacent to the original one. However, after enabling smart
paste, we now insert an extra space in between. Instead of executing "DeleteBackward" twice to test removing the
attachment elements, we delete backwards once to remove the pasted attachment, and move the selection to the
start and delete forwards to remove the original attachment.

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

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

8 months agoAdd demos for Intersection Observer API
jond@apple.com [Mon, 4 Feb 2019 18:55:31 +0000 (18:55 +0000)]
Add demos for Intersection Observer API
https://bugs.webkit.org/show_bug.cgi?id=194219

Reviewed by Simon Fraser.

* demos/intersection-observer/lazy-image-load/index.html: Added.
* demos/intersection-observer/lazy-image-load/scripts.js: Added.
(ImageLoader):
(ImageLoader.prototype.findImages):
(ImageLoader.prototype.smallURLForImage):
(ImageLoader.prototype.largeURLForImage):
(ImageLoader.prototype.setupObserver):
(ImageLoader.prototype.intersectionsChanged):
* demos/intersection-observer/lazy-image-load/style.css: Added.
(body):
(section):
(header):
(.main):
(.main img):
(.stories):
(.world, .local):
(.world):
(.local):
(.ad):
(.contents):
(.sidebar):
(.links):
(.main-story):
(.main-story img):
(.top-story):
(.top-story img):
(.mid-story img):
(.link-group):
(.link-group img):
(.link-group ul):
(.link-group li):
(footer):
(footer ul):
(footer a):
(.footer-col):
* demos/intersection-observer/simple/script.js: Added.
(addToLog):
(clearLog):
(stringFromRect):
(intersectedCallback):
* demos/intersection-observer/simple/simple-observer-iframe.html: Added.
* demos/intersection-observer/simple/simple-observer-root-margin.html: Added.
* demos/intersection-observer/simple/simple-observer.html: Added.
* demos/intersection-observer/simple/styles.css: Added.
(body):
(.results):
(.results button):
(h2):
(#logging):
* demos/intersection-observer/triggered-animation/index.html: Added.
* demos/intersection-observer/triggered-animation/script.js: Added.
(AnimationManager):
(AnimationManager.prototype.setupObserver):
(AnimationManager.prototype.intersectionsChanged):
* demos/intersection-observer/triggered-animation/style.css: Added.
(body):
(p):
(.animation-container h1):
(.animation-container):
(.animation-container .box):
(.slide.box):
(.animation-container.visible > .slide.box):
(.slide.animation-container div:nth-of-type(1)):
(.slide.animation-container div:nth-of-type(2)):
(.slide.animation-container div:nth-of-type(3)):
(.spin):
(.animation-container.visible .spin):
(@keyframes spin):
(to):
(.animation-container.svg):
(.animation-container.svg path):
(.animation-container.svg.visible):
(@keyframes stroke-move):
(.animation-container.svg circle):
(.animation-container.svg.visible circle):
(.animation-container.svg circle:nth-of-type(2)):
(.animation-container.svg circle:nth-of-type(3)):
(.animation-container.svg circle:nth-of-type(4)):
(.animation-container.svg circle:nth-of-type(5)):
(@keyframes circle-scale):

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

8 months agoIndexedDB: leak WebIDBConnectionToServer in layout tests
sihui_liu@apple.com [Mon, 4 Feb 2019 18:51:19 +0000 (18:51 +0000)]
IndexedDB: leak WebIDBConnectionToServer in layout tests
https://bugs.webkit.org/show_bug.cgi?id=193688
<rdar://problem/47353263>

Reviewed by Geoffrey Garen.

Source/WebCore:

Let IDBConnectionToServer keep a WeakPtr of IDBConnectionToServerDelegate.

* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::IDBConnectionToServer):
* Modules/indexeddb/client/IDBConnectionToServer.h:
* Modules/indexeddb/client/IDBConnectionToServerDelegate.h:

Source/WebKit:

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::didClose):
(WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
(WebKit::NetworkConnectionToWebProcess::removeIDBConnectionToServer): Deleted.
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::~WebIDBConnectionToServer):

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

8 months agoMake sure to remove the device observer in AVVideoCaptureSource
youenn@apple.com [Mon, 4 Feb 2019 18:47:23 +0000 (18:47 +0000)]
Make sure to remove the device observer in AVVideoCaptureSource
https://bugs.webkit.org/show_bug.cgi?id=194181
<rdar://problem/47739247>

Reviewed by Eric Carlson.

Make sure to remove the device observer when the observer is destroyed.
To simplify things, add the observer in AVVideoCaptureSource constructor and remove it in the destructor.

Make also sure the session observer is also removed whenever the session is released by AVVideoCaptureSource.

Covered by manual test.

       * platform/mediastream/mac/AVVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
(WebCore::AVVideoCaptureSource::~AVVideoCaptureSource):
(WebCore::AVVideoCaptureSource::initializeSession):
(WebCore::AVVideoCaptureSource::clearSession):
(WebCore::AVVideoCaptureSource::stopProducingData):
(WebCore::AVVideoCaptureSource::setupSession):

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