WebKit-https.git
8 months agoRemove commit.h copying build steps
commit-queue@webkit.org [Mon, 16 Sep 2019 08:46:46 +0000 (08:46 +0000)]
Remove commit.h copying build steps
https://bugs.webkit.org/show_bug.cgi?id=201785

Patch by James Darpinian <jdarpinian@chromium.org> on 2019-09-16
Reviewed by Alex Christensen.

* ANGLE.xcodeproj/project.pbxproj: Remove leftover build step
* CMakeLists.txt: Remove commit.h copying
* src/common/version.h: Restore to upstream version
* src/id/commit.h: Added.
* update-angle.sh: Copy commit.h to id/commit.h at import time

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

8 months agoStore sessionID on the NetworkConnectionToWebProcess now that there is one session...
cdumez@apple.com [Mon, 16 Sep 2019 08:01:38 +0000 (08:01 +0000)]
Store sessionID on the NetworkConnectionToWebProcess now that there is one session per WebProcess
https://bugs.webkit.org/show_bug.cgi?id=201789

Reviewed by Alex Christensen.

Store sessionID on the NetworkConnectionToWebProcess now that there is one session per WebProcess.
As a result, we no longer need to pass the sessionID in each IPC from the WebProcess to the
NetworkProcess.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::create):
(WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
(WebKit::NetworkConnectionToWebProcess::~NetworkConnectionToWebProcess):
(WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
(WebKit::NetworkConnectionToWebProcess::didReceiveSyncMessage):
(WebKit::NetworkConnectionToWebProcess::didClose):
(WebKit::NetworkConnectionToWebProcess::createSocketStream):
(WebKit::NetworkConnectionToWebProcess::createSocketChannel):
(WebKit::NetworkConnectionToWebProcess::networkSession):
(WebKit::NetworkConnectionToWebProcess::resolveBlobReferences):
(WebKit::NetworkConnectionToWebProcess::storageSession):
(WebKit::NetworkConnectionToWebProcess::startDownload):
(WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
(WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
(WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
(WebKit::NetworkConnectionToWebProcess::cookiesEnabled):
(WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
(WebKit::NetworkConnectionToWebProcess::getRawCookies):
(WebKit::NetworkConnectionToWebProcess::deleteCookie):
(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::removeStorageAccessForFrame):
(WebKit::NetworkConnectionToWebProcess::clearPageSpecificDataForResourceLoadStatistics):
(WebKit::NetworkConnectionToWebProcess::logUserInteraction):
(WebKit::NetworkConnectionToWebProcess::hasStorageAccess):
(WebKit::NetworkConnectionToWebProcess::requestStorageAccess):
(WebKit::NetworkConnectionToWebProcess::requestStorageAccessUnderOpener):
(WebKit::NetworkConnectionToWebProcess::startTrackingResourceLoad):
(WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
(WebKit::NetworkConnectionToWebProcess::unregisterSWConnection):
(WebKit::NetworkConnectionToWebProcess::establishSWServerConnection):
(WebKit::NetworkConnectionToWebProcess::establishSWContextConnection):
* NetworkProcess/NetworkConnectionToWebProcess.h:
(WebKit::NetworkConnectionToWebProcess::sessionID const):
(WebKit::NetworkConnectionToWebProcess::startDownload):
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::start):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::openNetworkProcessConnection):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::sessionID const):
* UIProcess/WebProcessProxy.h:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
* WebProcess/FileAPI/BlobRegistryProxy.cpp:
(WebKit::BlobRegistryProxy::registerFileBlobURL):
(WebKit::BlobRegistryProxy::registerBlobURL):
(WebKit::BlobRegistryProxy::registerBlobURLOptionallyFileBacked):
(WebKit::BlobRegistryProxy::unregisterBlobURL):
(WebKit::BlobRegistryProxy::registerBlobURLForSlice):
(WebKit::BlobRegistryProxy::blobSize):
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles):
* WebProcess/Network/WebSocketChannel.cpp:
(WebKit::WebSocketChannel::connect):
* WebProcess/Network/WebSocketStream.cpp:
(WebKit::WebSocketStream::WebSocketStream):
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::WebSWClientConnection):
* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::m_userAgent):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::detachedFromParent2):
(WebKit::WebFrameLoaderClient::dispatchWillChangeDocument):
* WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp:
(WebKit::WebResourceLoadObserver::requestStorageAccessUnderOpener):
(WebKit::WebResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
* WebProcess/WebPage/WebCookieJar.cpp:
(WebKit::WebCookieJar::cookies const):
(WebKit::WebCookieJar::setCookies):
(WebKit::WebCookieJar::cookiesEnabled const):
(WebKit::WebCookieJar::cookieRequestHeaderFieldValue const):
(WebKit::WebCookieJar::getRawCookies const):
(WebKit::WebCookieJar::deleteCookie):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::startDownload):
(WebKit::WebFrame::convertMainResourceLoadToDownload):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::close):
(WebKit::WebPage::hasStorageAccess):
(WebKit::WebPage::requestStorageAccess):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::createWebPage):
(WebKit::WebProcess::removeWebPage):
* WebProcess/WebProcess.h:
(WebKit::WebProcess::sessionID const):

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

8 months agoREGRESSION(r249142): [GTK] Epiphany delayed page loads continue indefinitely
carlosgc@webkit.org [Mon, 16 Sep 2019 07:49:10 +0000 (07:49 +0000)]
REGRESSION(r249142): [GTK] Epiphany delayed page loads continue indefinitely
https://bugs.webkit.org/show_bug.cgi?id=201544

Reviewed by Michael Catanzaro.

Source/WebKit:

WebPageProxy::loadAlternateHTML() is an exception, because it's an API request but always sets the navigationID
to 0. We always want to reset the pending API request URL when alternate HTML load starts.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared): Check also that it's an API alternate HTML load
to reset the pending API request URL.

Tools:

Add new test cases.

* TestWebKitAPI/Tests/WebKitGLib/TestLoaderClient.cpp:
(testWebViewActiveURI):
(testWebViewIsLoading):
* TestWebKitAPI/glib/WebKitGLib/LoadTrackingTest.cpp:
(loadChangedCallback):
(LoadTrackingTest::loadAlternateHTML):
(LoadTrackingTest::reset):
* TestWebKitAPI/glib/WebKitGLib/LoadTrackingTest.h:

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

8 months agoREGRESSION (r248592): Leak of CFDictionaryRef in WebKit::NetworkRTCProvider::proxyInf...
ddkilzer@apple.com [Mon, 16 Sep 2019 05:51:49 +0000 (05:51 +0000)]
REGRESSION (r248592): Leak of CFDictionaryRef in WebKit::NetworkRTCProvider::proxyInfoFromSession()
<https://webkit.org/b/201811>

Reviewed by Youenn Fablet.

* NetworkProcess/webrtc/NetworkRTCProvider.mm:
(WebKit::NetworkRTCProvider::proxyInfoFromSession): Use
RetainPtr<> to fix the leak.

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

8 months ago[WebIDL] Derived dictionaries should inherit their inherited dictionaries' partials
aestes@apple.com [Mon, 16 Sep 2019 00:41:07 +0000 (00:41 +0000)]
[WebIDL] Derived dictionaries should inherit their inherited dictionaries' partials
https://bugs.webkit.org/show_bug.cgi?id=201802

Reviewed by Sam Weinig.

Prior to this change, a dictionary D that inherits from dictionary B would not inherit B's
partial dictionaries. Fixed this by moving supplemental dependencies processing from
generate-bindings.pl to CodeGenerator.pm and reusing it in GetDictionaryByType.

Added new bindings tests.

* bindings/scripts/CodeGenerator.pm:
(new):
(ProcessDocument):
(ProcessSupplementalDependencies):
(shouldPropertyBeExposed):
(GetDictionaryByType):
* bindings/scripts/generate-bindings.pl:
(generateBindings):
(shouldPropertyBeExposed): Deleted.
* bindings/scripts/test/JS/JSTestDerivedDictionary.cpp: Added.
(WebCore::convertDictionary<TestDerivedDictionary>):
(WebCore::convertDictionaryToJS):
* bindings/scripts/test/JS/JSTestDerivedDictionary.h: Added.
* bindings/scripts/test/JS/JSTestInheritedDictionary.cpp: Added.
(WebCore::convertDictionary<TestInheritedDictionary>):
(WebCore::convertDictionaryToJS):
* bindings/scripts/test/JS/JSTestInheritedDictionary.h: Added.
* bindings/scripts/test/TestDerivedDictionary.idl: Added.
* bindings/scripts/test/TestInheritedDictionary.idl: Added.
* bindings/scripts/test/TestSupplemental.idl:

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

8 months agoMissing call to [self init] in -[WebScrollbarPartAnimation initWithScrollbar:featureT...
ddkilzer@apple.com [Sun, 15 Sep 2019 21:43:27 +0000 (21:43 +0000)]
Missing call to [self init] in -[WebScrollbarPartAnimation initWithScrollbar:featureToAnimate:animateFrom:animateTo:duration:]
<https://webkit.org/b/201806>

Reviewed by Simon Fraser.

* platform/mac/ScrollAnimatorMac.mm:
(-[WebScrollbarPartAnimation initWithScrollbar:featureToAnimate:animateFrom:animateTo:duration:]):
Call [self init] and return early if the result is nil.

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

8 months agoRe-sync HTML web-platform-tests from upstream
cdumez@apple.com [Sun, 15 Sep 2019 19:25:50 +0000 (19:25 +0000)]
Re-sync HTML web-platform-tests from upstream
https://bugs.webkit.org/show_bug.cgi?id=201753

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Re-sync HTML web-platform-tests from upstream 8893b1bcfc2ca0675f4e81.

* web-platform-tests/html/*: Updated.

LayoutTests:

* TestExpectations:
* platform/gtk/TestExpectations:
* platform/ios-wk1/TestExpectations:
* platform/ios/TestExpectations:
* platform/mac-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/type-change-state-expected.txt:
* platform/mac/TestExpectations:
* platform/mac/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location_hash-expected.txt:
* platform/win/TestExpectations:
* tests-options.json:

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

8 months agoLeak of NSMapTable in -[JSVirtualMachine addManagedReference:withOwner:]
ddkilzer@apple.com [Sun, 15 Sep 2019 17:17:02 +0000 (17:17 +0000)]
Leak of NSMapTable in -[JSVirtualMachine addManagedReference:withOwner:]
<https://webkit.org/b/201803>

Reviewed by Dan Bernstein.

* API/JSVirtualMachine.mm:
(-[JSVirtualMachine addManagedReference:withOwner:]): Use
RetainPtr<> to fix the leak.

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

8 months agoblock-spammers should obtain credentials the same way as webkit-patch
ddkilzer@apple.com [Sun, 15 Sep 2019 14:14:59 +0000 (14:14 +0000)]
block-spammers should obtain credentials the same way as webkit-patch
<https://webkit.org/b/201733>

Reviewed by Lucas Forschler.

* Scripts/block-spammers: Import Credentials from webkitpy.
Remove unused imports.  Enable logging at info level to match
webkit-patch.
(get_bugzilla_token): Use Credentials module to get
bugs.webkit.org credentials.
* Scripts/webkitpy/common/net/credentials.py:
(Credentials._run_security_tool): Change logging level from
error to info since multiple attempts are made at reading the
keychain.  Fix typos in comment.
(Credentials._credentials_from_security_command): Extract common
logic from Credentials._credentials_from_keychain into new
method.
(Credentials._credentials_from_keychain): Make fallback logic
for checking for credentials in the keychain more consistent and
easier to read.  Add error logging if no credentials are found.

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

8 months ago[GTK][WPE] Do not run the Bubblewrap executable when configuring for cross-compilation
aperez@igalia.com [Sun, 15 Sep 2019 13:30:01 +0000 (13:30 +0000)]
[GTK][WPE] Do not run the Bubblewrap executable when configuring for cross-compilation
https://bugs.webkit.org/show_bug.cgi?id=201340

Reviewed by Konstantin Tokarev.

* Source/cmake/BubblewrapSandboxChecks.cmake: Do not run the
Bubblewrap executable when cross-compiling to guess its version.
Emit a warning instead and trust that valid run-time paths will
be set using the BWRAP_EXECUTABLE and DBUS_PROXY_EXECUTABLE
variables. While at it, fix the regular expression used to match
the version string in the Bubblewrap output when not cross-compiling.

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

8 months ago[GTK][WPE] Check for a Snap sandbox a bit harder
aperez@igalia.com [Sat, 14 Sep 2019 22:45:30 +0000 (22:45 +0000)]
[GTK][WPE] Check for a Snap sandbox a bit harder
https://bugs.webkit.org/show_bug.cgi?id=201793

Reviewed by Michael Catanzaro.

* UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
(WebKit::isInsideSnap): Check whether the SNAP_NAME and SNAP_REVISION
environment variables are defined as well.

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

8 months ago[WebGPU] Make WebGPURenderPipeline and WebGPUComputePipeline inherit from GPUObjectBase
justin_fan@apple.com [Sat, 14 Sep 2019 22:31:02 +0000 (22:31 +0000)]
[WebGPU] Make WebGPURenderPipeline and WebGPUComputePipeline inherit from GPUObjectBase
https://bugs.webkit.org/show_bug.cgi?id=201207

Reviewed by Dean Jackson.

Make remaining WebGPU "client" classes manage their error scopes, instead of the internal classes.
Matches Web/GPUBuffer, and allows "invalid" WebGPU objects to create errors.

Covered by existing tests.

* Modules/webgpu/WebGPUComputePipeline.cpp:
(WebCore::WebGPUComputePipeline::create):
(WebCore::WebGPUComputePipeline::WebGPUComputePipeline):
* Modules/webgpu/WebGPUComputePipeline.h:
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createRenderPipeline const):
(WebCore::WebGPUDevice::createComputePipeline const):
* Modules/webgpu/WebGPURenderPipeline.cpp:
(WebCore::WebGPURenderPipeline::create):
(WebCore::WebGPURenderPipeline::WebGPURenderPipeline):
* Modules/webgpu/WebGPURenderPipeline.h:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/gpu/GPUComputePipeline.h:
* platform/graphics/gpu/GPURenderPipeline.h:
* platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm:
(WebCore::GPUComputePipeline::tryCreate):
(WebCore::GPUComputePipeline::GPUComputePipeline):
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::GPURenderPipeline::tryCreate):
(WebCore::GPURenderPipeline::GPURenderPipeline):

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

8 months agoRetire x86 32bit JIT support
ysuzuki@apple.com [Sat, 14 Sep 2019 19:36:29 +0000 (19:36 +0000)]
Retire x86 32bit JIT support
https://bugs.webkit.org/show_bug.cgi?id=201790

Reviewed by Mark Lam.

Source/JavaScriptCore:

Now, Xcode no longer has ability to build 32bit binary, so we cannot even test it on macOS.
Fedora stops shipping x86 32bit kernel. Our x86/x86_64 JIT requires SSE2, and so such relatively modern CPUs
can use JIT by switching x86 to x86_64. And these CPUs are modern enough to run CLoop at high speed.
WebKit already disabled x86 JIT by default while the implementation exists. So literary, it is not tested.

While x86 32bit becomes less useful, x86 32bit JIT backend is very complicated and is being a major maintenance burden.
This is due to very few # of registers. Which scatters a lot of isX86 / CPU(X86) in Baseline, DFG, and Yarr.

This patch retires x86 JIT support from JavaScriptCore and CSS JIT. We still keep MacroAssembler and GPRInfo / FPRInfo,
MachineContext information since they are useful even though JIT is not supported.

* dfg/DFGArrayMode.cpp:
(JSC::DFG::ArrayMode::refine const):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::compileExceptionHandlers):
* dfg/DFGOSRExitCompilerCommon.cpp:
(JSC::DFG::osrWriteBarrier):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileArithDiv):
(JSC::DFG::SpeculativeJIT::compileArithMod):
(JSC::DFG::SpeculativeJIT::compileCreateRest):
(JSC::DFG::SpeculativeJIT::compileGetDirectPname):
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::emitCall):
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGThunks.cpp:
(JSC::DFG::osrExitGenerationThunkGenerator):
* ftl/FTLThunks.cpp:
(JSC::FTL::slowPathCallThunkGenerator):
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::callExceptionFuzz):
(JSC::AssemblyHelpers::debugCall):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::emitComputeButterflyIndexingMask):
* jit/CCallHelpers.h:
(JSC::CCallHelpers::setupArgumentsImpl):
(JSC::CCallHelpers::prepareForTailCallSlow):
* jit/CallFrameShuffler.cpp:
(JSC::CallFrameShuffler::prepareForTailCall):
* jit/JIT.cpp:
(JSC::JIT::privateCompileExceptionHandlers):
* jit/JITArithmetic32_64.cpp:
(JSC::JIT::emit_op_mod):
(JSC::JIT::emitSlow_op_mod):
* jit/SlowPathCall.h:
(JSC::JITSlowPathCall::call):
* jit/ThunkGenerators.cpp:
(JSC::nativeForGenerator):
(JSC::arityFixupGenerator):
* wasm/WasmAirIRGenerator.cpp:
(JSC::Wasm::AirIRGenerator::emitModOrDiv):
* yarr/YarrJIT.cpp:
(JSC::Yarr::YarrGenerator::generateDotStarEnclosure):
(JSC::Yarr::YarrGenerator::generateEnter):
(JSC::Yarr::YarrGenerator::generateReturn):
(JSC::Yarr::YarrGenerator::compile):
* yarr/YarrJIT.h:

Source/WebCore:

* cssjit/FunctionCall.h:
(WebCore::FunctionCall::callAndBranchOnBooleanReturnValue):
(WebCore::FunctionCall::swapArguments):

Source/WTF:

* wtf/Platform.h:

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

8 months ago[LFC] FormattingContext::Geometry::inFlowPositionedPositionOffset should not read...
zalan@apple.com [Sat, 14 Sep 2019 18:52:02 +0000 (18:52 +0000)]
[LFC] FormattingContext::Geometry::inFlowPositionedPositionOffset should not read containing block's width
https://bugs.webkit.org/show_bug.cgi?id=201797
<rdar://problem/55366244>

Reviewed by Antti Koivisto.

This is in preparation for using constraint values instead of querying the display tree for containing block geometry information.
See webkit.org/b/201795

* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::inFlowPositionedPositionOffset const):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren):
* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns const):

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

8 months ago[LFC] FormattingContext::Geometry::inlineReplacedHeightAndMargin should not read...
zalan@apple.com [Sat, 14 Sep 2019 18:05:58 +0000 (18:05 +0000)]
[LFC] FormattingContext::Geometry::inlineReplacedHeightAndMargin should not read containing block's width
https://bugs.webkit.org/show_bug.cgi?id=201796
<rdar://problem/55366109>

Reviewed by Antti Koivisto.

This is in preparation for using constraint values instead of querying the display tree for containing block geometry information.
See webkit.org/b/201795

* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry const):
(WebCore::Layout::FormattingContext::Geometry::complicatedCases const):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin const):
(WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin const):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin const):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin):
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeHeightAndMargin):
* layout/inlineformatting/InlineFormattingContext.h:
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin const):

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

8 months ago[LFC] FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry should not read...
zalan@apple.com [Sat, 14 Sep 2019 17:23:28 +0000 (17:23 +0000)]
[LFC] FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry should not read containing block's width.
https://bugs.webkit.org/show_bug.cgi?id=201794
<rdar://problem/55365669>

Reviewed by Antti Koivisto.

This is in preparation for using constraint values instead of querying the display tree for containing block geometry information.
See webkit.org/b/201795

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry):
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry const):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry const):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry const):

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

8 months agonewController may be moved several times under SWClientConnection::notifyClientsOfCon...
cdumez@apple.com [Sat, 14 Sep 2019 16:00:56 +0000 (16:00 +0000)]
newController may be moved several times under SWClientConnection::notifyClientsOfControllerChange()
https://bugs.webkit.org/show_bug.cgi?id=201792
<rdar://problem/55351284>

Reviewed by Youenn Fablet.

Stop WTFMove()'ing inside the for loop.

* workers/service/SWClientConnection.cpp:
(WebCore::SWClientConnection::notifyClientsOfControllerChange):

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

8 months ago[LFC] FormattingContext::Geometry::computedHeightValue should not read containing...
zalan@apple.com [Sat, 14 Sep 2019 13:55:34 +0000 (13:55 +0000)]
[LFC] FormattingContext::Geometry::computedHeightValue should not read containing block's height.
https://bugs.webkit.org/show_bug.cgi?id=201791
<rdar://problem/55361695>

Reviewed by Antti Koivisto.

While sizing/positioning a particular box, we oftentimes need some containing block geometry information.
The idea here is that instead of calling formattingContext().geometry(containingBlock), these constraint values
would be pushed in to those compute* functions. It helps controlling the access to the display box tree and
prevents formatting context escaping.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry):
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::computedHeightValue const):
(WebCore::Layout::FormattingContext::Geometry::computedMaxHeight const):
(WebCore::Layout::FormattingContext::Geometry::computedMinHeight const):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry const):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry const):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry const):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin const):
* layout/LayoutUnits.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin):

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

8 months agoAdd release logging in WebLoaderStrategy to check that a load is going through servic...
youenn@apple.com [Sat, 14 Sep 2019 10:11:23 +0000 (10:11 +0000)]
Add release logging in WebLoaderStrategy to check that a load is going through service worker
https://bugs.webkit.org/show_bug.cgi?id=201761

Reviewed by Chris Dumez.

This allows identifying whether a load remains pending on the service worker fetch path.

* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoad):

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

8 months agoASSERTION FAILED: !renderer() in WebCore::Text::~Text
antti@apple.com [Sat, 14 Sep 2019 08:52:50 +0000 (08:52 +0000)]
ASSERTION FAILED: !renderer() in  WebCore::Text::~Text
https://bugs.webkit.org/show_bug.cgi?id=172514
<rdar://problem/32470509>

Unreviewed, this assert should be fixed now.

* TestExpectations:

Unskipping imported/w3c/web-platform-tests/innerText/getter.html on debug

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

8 months agoWPT importer should check META global tag in .any.js files to generate the valid...
youenn@apple.com [Sat, 14 Sep 2019 06:23:43 +0000 (06:23 +0000)]
WPT importer should check META global tag in .any.js files to generate the valid .html stub files
https://bugs.webkit.org/show_bug.cgi?id=201718

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* web-platform-tests/infrastructure/server/context.any.serviceworker-expected.txt: Added.
* web-platform-tests/infrastructure/server/context.any.serviceworker.html: Added.
* web-platform-tests/infrastructure/server/secure-context.https.any.serviceworker-expected.txt: Added.
* web-platform-tests/infrastructure/server/secure-context.https.any.serviceworker.html: Added.

Tools:

Read meta tag information to select the environments where the any.js template tests will be run.
Added support to run service worker tests from any.js template tests.

Covered by unit test.
Since we import only a single repository nowadays, use a test config file with just one repository
to simplify the new test.

* Scripts/webkitpy/w3c/test_importer.py:
(TestImporter.__init__):
(TestImporter.readEnvironmentsForTemplateTest):
(TestImporter.write_html_files_for_templated_js_tests):
* Scripts/webkitpy/w3c/test_importer_unittest.py:
(TestImporterTest.test_import_dir_with_no_tests_and_no_hg):
(TestImporterTest.test_import_dir_with_no_tests):
(TestImporterTest.test_import_dir_with_empty_init_py):
(TestImporterTest.test_harnesslinks_conversion):
(TestImporterTest.test_submodules_generation):
(test_checkout_directory):
(test_clean_directory_option):
(test_git_ignore_generation):
(test_initpy_generation):
(test_remove_obsolete_content):
(test_manual_slow_test):
(test_webkit_test_runner_options):
(test_webkit_test_runner_import_reftests_with_absolute_paths_download):
(test_webkit_test_runner_import_reftests_with_absolute_paths_from_source_dir):
(test_template_test):

LayoutTests:

* platform/mac-wk1/TestExpectations:
Skipping service worker tests.

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

8 months ago[MacOS/iOS] imported/w3c/web-platform-tests/service-workers/cache-storage/servicework...
youenn@apple.com [Sat, 14 Sep 2019 05:14:13 +0000 (05:14 +0000)]
[MacOS/iOS] imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-abort.https.html is sometimes crashing in Debug
https://bugs.webkit.org/show_bug.cgi?id=201686

Reviewed by Alexey Proskuryakov.

A load might be cancelled shortly after being started in network process.
In that case, NetworkDataTaskCocoa might be destroyed, thus removed from the ID to task map
but some handlers might still be called until the NSURLSessionTask is finished cancelling.
This happens for authentication challenges.
In case where the NSURLSessionTask is cancelling, return early instead of processing the challenge.

Covered by LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-abort.https.html and LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-abort.https.html no longer crashing in debug.

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):

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

8 months agojsc -d stopped working.
mark.lam@apple.com [Sat, 14 Sep 2019 02:22:49 +0000 (02:22 +0000)]
jsc -d stopped working.
https://bugs.webkit.org/show_bug.cgi?id=201787

Reviewed by Joseph Pecoraro.

The reason is because, in this case, the jsc shell is trying to set an option
after the VM has been instantiated.  The fix is simply to move all options
initialization before the VM is instantiated.

* jsc.cpp:
(runWithOptions):
(jscmain):

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

8 months agoWeb Inspector: HTML Formatter - XML mode
joepeck@webkit.org [Sat, 14 Sep 2019 02:16:00 +0000 (02:16 +0000)]
Web Inspector: HTML Formatter - XML mode
https://bugs.webkit.org/show_bug.cgi?id=201758

Reviewed by Devin Rousso.

Source/WebInspectorUI:

* Tools/HTMLFormatter/index.html:
* Tools/SourceMaps/index.html:
Update Tools to more easily test XML.

* UserInterface/Proxies/FormatterWorkerProxy.js:
(WI.FormatterWorkerProxy.prototype.formatXML):
* UserInterface/Views/TextEditor.js:
(WI.TextEditor.prototype.hasFormatter):
(WI.TextEditor.prototype._startWorkerPrettyPrint):
Allow formatting XML content.

* UserInterface/Workers/Formatter/FormatterWorker.js:
(FormatterWorker.prototype.formatHTML):
(FormatterWorker.prototype.formatXML):
Expose "formatXML".

* UserInterface/Workers/Formatter/HTMLFormatter.js:
(HTMLFormatter.let.dom):
(HTMLFormatter):
(HTMLFormatter.prototype._shouldHaveNoChildren):
(HTMLFormatter.prototype._before):
(HTMLFormatter.prototype._after):
* UserInterface/Workers/Formatter/HTMLParser.js:
(HTMLParser.prototype.parseDocument):
* UserInterface/Workers/Formatter/HTMLTreeBuilderFormatter.js:
(HTMLTreeBuilderFormatter.prototype._isEmptyNode):
Give the HTMLFormatter and related classes an XML mode that
has less of the smarts of XML.

LayoutTests:

* inspector/formatting/formatting-xml-expected.txt: Added.
* inspector/formatting/formatting-xml.html: Added.
* inspector/formatting/resources/formatting-utilities.js:
(TestPage.registerInitializer.async.runFormattingTest):
* inspector/formatting/resources/xml-tests/atom-expected.xml: Added.
* inspector/formatting/resources/xml-tests/atom.xml: Added.
* inspector/formatting/resources/xml-tests/basic-expected.xml: Added.
* inspector/formatting/resources/xml-tests/basic.xml: Added.
* inspector/formatting/resources/xml-tests/rss-expected.xml: Added.
* inspector/formatting/resources/xml-tests/rss.xml: Added.
* inspector/formatting/resources/xml-tests/valid-html-invalid-xml-expected.xml: Added.
* inspector/formatting/resources/xml-tests/valid-html-invalid-xml.xml: Added.
* inspector/formatting/resources/xml-tests/xslt-expected.xml: Added.
* inspector/formatting/resources/xml-tests/xslt.xml: Added.

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

8 months agoWeb Inspector: HTML Formatting: Handle infinite loop for incomplete script data
joepeck@webkit.org [Sat, 14 Sep 2019 01:57:35 +0000 (01:57 +0000)]
Web Inspector: HTML Formatting: Handle infinite loop for incomplete script data
https://bugs.webkit.org/show_bug.cgi?id=201769

Reviewed by Devin Rousso.

Source/WebInspectorUI:

* UserInterface/Workers/Formatter/HTMLParser.js:
(HTMLParser):
Handle EOF in the script data's loop.
Better handle EOF at the end of text data.

LayoutTests:

* inspector/formatting/formatting-html-expected.txt:
* inspector/formatting/formatting-html.html:
* inspector/formatting/resources/html-tests/eof-7-expected.html: Added.
* inspector/formatting/resources/html-tests/eof-7.html: Added.
* inspector/formatting/resources/html-tests/eof-8-expected.html: Added.
* inspector/formatting/resources/html-tests/eof-8.html: Added.
* inspector/formatting/resources/html-tests/eof-9-expected.html: Added.
* inspector/formatting/resources/html-tests/eof-9.html: Added.

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

8 months agowatchOS requires PageSize alignment of 16K for JSC::Config.
mark.lam@apple.com [Sat, 14 Sep 2019 01:52:16 +0000 (01:52 +0000)]
watchOS requires PageSize alignment of 16K for JSC::Config.
https://bugs.webkit.org/show_bug.cgi?id=201786
<rdar://problem/55357890>

Reviewed by Yusuke Suzuki.

* runtime/JSCConfig.h:

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

8 months agoUnreviewed, follow-up fix after r249842
ysuzuki@apple.com [Sat, 14 Sep 2019 01:12:15 +0000 (01:12 +0000)]
Unreviewed, follow-up fix after r249842
https://bugs.webkit.org/show_bug.cgi?id=201750

Michael reviewed this offline. When performing nearCall, we need to invalidate cache registers.

* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::nearCall):
(JSC::MacroAssemblerARM64::threadSafePatchableNearCall):

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

8 months agoWeb Inspector: Improve auto completion typing performance by avoiding global forced...
joepeck@webkit.org [Sat, 14 Sep 2019 00:50:27 +0000 (00:50 +0000)]
Web Inspector: Improve auto completion typing performance by avoiding global forced layouts
https://bugs.webkit.org/show_bug.cgi?id=201735

Reviewed by Devin Rousso.

* UserInterface/Views/Main.css:
(#layout-measurement-container):
* UserInterface/Base/Main.js:
(WI.measureElement):
Provide a helper for measuring an element in a hidden container
that helps avoid more global layout.

* UserInterface/Views/CompletionSuggestionsView.js:
(WI.CompletionSuggestionsView.prototype.show):
Use measure element to avoid a global forced layout.

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

8 months agoProvide a prototype for AR QuickLook to trigger processing in the originating page
dino@apple.com [Sat, 14 Sep 2019 00:35:57 +0000 (00:35 +0000)]
Provide a prototype for AR QuickLook to trigger processing in the originating page
https://bugs.webkit.org/show_bug.cgi?id=201371
<rdar://54904781>

Disable the test for the moment.

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

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

8 months agoDate.prototype.toJSON does not execute steps 1-2
commit-queue@webkit.org [Sat, 14 Sep 2019 00:24:23 +0000 (00:24 +0000)]
Date.prototype.toJSON does not execute steps 1-2
https://bugs.webkit.org/show_bug.cgi?id=105282

Patch by Alexey Shvayka <shvaikalesh@gmail.com> on 2019-09-13
Reviewed by Ross Kirsling.

JSTests:

* test262/expectations.yaml: Mark 2 test cases as passing.

Source/JavaScriptCore:

According to https://tc39.es/ecma262/#sec-built-in-function-objects, built-in methods must be
strict mode functions. Before this change, `this` value in Date.prototype.toJSON was resolved
using sloppy mode semantics, resulting in `toISOString` being called on global object if `this`
value equals `null` or `undefined`.

* runtime/DatePrototype.cpp:
(JSC::dateProtoFuncToJSON): Resolve thisValue using strict semantics and simplify std::isfinite check.

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

8 months agoLayout Test webgl/2.0.0/conformance/glsl/misc/shaders-with-invariance.html is failing...
russell_e@apple.com [Sat, 14 Sep 2019 00:12:51 +0000 (00:12 +0000)]
Layout Test webgl/2.0.0/conformance/glsl/misc/shaders-with-invariance.html is failing on iOS.
https://bugs.webkit.org/show_bug.cgi?id=201784

Unreviewed Test Gardening.

* platform/ios/TestExpectations: Marked Test as Failing.

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

8 months agoiOS 13: Some SPI targets 13.1
jbedard@apple.com [Sat, 14 Sep 2019 00:00:44 +0000 (00:00 +0000)]
iOS 13: Some SPI targets 13.1
https://bugs.webkit.org/show_bug.cgi?id=201777

Reviewed by Alexey Proskuryakov.

* wtf/Platform.h:

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

8 months agoperformJITMemcpy() should do its !Gigacage assertion on exit.
mark.lam@apple.com [Fri, 13 Sep 2019 23:45:16 +0000 (23:45 +0000)]
performJITMemcpy() should do its !Gigacage assertion on exit.
https://bugs.webkit.org/show_bug.cgi?id=201780
<rdar://problem/55354867>

Reviewed by Robin Morisset.

Re-doing previous fix.

* jit/ExecutableAllocator.h:
(JSC::performJITMemcpy):
(JSC::GigacageAssertScope::GigacageAssertScope): Deleted.
(JSC::GigacageAssertScope::~GigacageAssertScope): Deleted.

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

8 months agoperformJITMemcpy() should do its !Gigacage assertion on exit.
mark.lam@apple.com [Fri, 13 Sep 2019 23:18:51 +0000 (23:18 +0000)]
performJITMemcpy() should do its !Gigacage assertion on exit.
https://bugs.webkit.org/show_bug.cgi?id=201780
<rdar://problem/55354867>

Reviewed by Robin Morisset.

* jit/ExecutableAllocator.h:
(JSC::GigacageAssertScope::GigacageAssertScope):
(JSC::GigacageAssertScope::~GigacageAssertScope):
(JSC::performJITMemcpy):

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

8 months agoWe should never fail to allocate VA for the Gigacage.
mark.lam@apple.com [Fri, 13 Sep 2019 22:06:51 +0000 (22:06 +0000)]
We should never fail to allocate VA for the Gigacage.
https://bugs.webkit.org/show_bug.cgi?id=201774
<rdar://problem/55352042>

Reviewed by Yusuke Suzuki.

Unfortunately, this is still not true for OS(LINUX).  So, I'll leave the
GIGACAGE_ALLOCATION_CAN_FAIL code in place but disable it for everything else.

* bmalloc/Gigacage.h:

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

8 months agoProvide a prototype for AR QuickLook to trigger processing in the originating page
dino@apple.com [Fri, 13 Sep 2019 21:43:18 +0000 (21:43 +0000)]
Provide a prototype for AR QuickLook to trigger processing in the originating page
https://bugs.webkit.org/show_bug.cgi?id=201371
<rdar://54904781>

Reviewed by Simon Fraser.

Source/WebCore:

* dom/Document.cpp:
(WebCore::Document::dispatchSystemPreviewActionEvent): Create and dispatch a MessageEvent.
* dom/Document.h:

* html/HTMLAnchorElement.cpp: Send along the page and frame identifiers for this
object to ensure that any reply goes to the correct place.
(WebCore::HTMLAnchorElement::handleClick):

* loader/FrameLoadRequest.h: Use the new SystemPreviewInfo type.
(WebCore::FrameLoadRequest::isSystemPreview const):
(WebCore::FrameLoadRequest::systemPreviewInfo const):
(WebCore::FrameLoadRequest::systemPreviewRect const): Deleted.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):

* loader/FrameLoaderTypes.h: Provide encoders for the type.
(WebCore::SystemPreviewInfo::encode const):
(WebCore::SystemPreviewInfo::decode):

* platform/network/ResourceRequestBase.cpp: Use the new type.
(WebCore::ResourceRequestBase::isSystemPreview const):
(WebCore::ResourceRequestBase::systemPreviewInfo const):
(WebCore::ResourceRequestBase::setSystemPreviewInfo):
(WebCore::ResourceRequestBase::setSystemPreview): Deleted.
(WebCore::ResourceRequestBase::systemPreviewRect const): Deleted.
(WebCore::ResourceRequestBase::setSystemPreviewRect): Deleted.
* platform/network/ResourceRequestBase.h:

* testing/Internals.cpp: Expose the frame and page identifiers to testing.
(WebCore::Internals::frameIdentifier const):
(WebCore::Internals::pageIdentifier const):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit:

Provide a way for a Web page to know if an action in the AR scene
was performed, if and only if the system AR library calls a delegate with
particular parameters. Post a message to the originating frame so
the page can detect the action.

* Scripts/webkit/messages.py: Include the right header for SystemPreviewInfo.

* Shared/WebCoreArgumentCoders.cpp: Use SystemPreviewInfo.
(IPC::ArgumentCoder<ResourceRequest>::encode):
(IPC::ArgumentCoder<ResourceRequest>::decode):

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _triggerSystemPreviewActionOnFrame:page:]): New helper/test function
to trigger the system preview action.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:

* UIProcess/Cocoa/DownloadClient.mm: Use new type.
(WebKit::DownloadClient::didStart):

* UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: Implement the delegate so that
we can detect an action. When it happens, tell the WebPageProxy to send a message.

* UIProcess/Downloads/DownloadProxy.h: Use SystemPreviewInfo type.
(WebKit::DownloadProxy::systemPreviewDownloadInfo const):
(WebKit::DownloadProxy::systemPreviewDownloadRect const): Deleted.

* UIProcess/SystemPreviewController.h:
(WebKit::SystemPreviewController::previewInfo const):

* UIProcess/WebPageProxy.cpp: Send it over to the Web Process.
(WebKit::WebPageProxy::systemPreviewActionTriggered const):
* UIProcess/WebPageProxy.h:

* WebProcess/WebPage/WebPage.cpp: Check the destination still exists, and then talk
to the Document.
(WebKit::WebPage::systemPreviewActionTriggered):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

Tools:

* TestWebKitAPI/Tools/TestWebKitAPI/Tests/WebKitCocoa/SystemPreview.mm:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/system-preview-trigger.html: Added.

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

8 months agoCrash under WebCore::firstPositionInNode()
cdumez@apple.com [Fri, 13 Sep 2019 20:59:50 +0000 (20:59 +0000)]
Crash under WebCore::firstPositionInNode()
https://bugs.webkit.org/show_bug.cgi?id=201764
<rdar://problem/54823754>

Reviewed by Wenson Hsieh and Geoff Garen.

Make sure to keep a Ref<> to the textNode when we call insertNodeAtTabSpanPosition()
or insertNodeAt().

Test: editing/firstPositionInNode-crash.html

* editing/InsertTextCommand.cpp:
(WebCore::InsertTextCommand::positionInsideTextNode):

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

8 months agoPartition processes running service workers by session ID
youenn@apple.com [Fri, 13 Sep 2019 20:36:07 +0000 (20:36 +0000)]
Partition processes running service workers by session ID
https://bugs.webkit.org/show_bug.cgi?id=201643

Reviewed by Chris Dumez.

Source/WebCore:

Move the creation of service worker context connection management to SWServer.
This allows to partition service worker context connections by registrable domain and sessionID.
WebKit2 is still responsible to create the IPC creation through a Function given to SWServer at construction
time.
SWServer now keeps a map of registrable domain -> context connection to use for running workers.
It also keeps a map of being-created connections.
In case a context connection is removed from the SWServer, the SWServer will notify all related worker instances
that they are not running. The SWServer will also recreate a context connection if needed.

This allows removing the global server context connection map.
Make SWServerToContextConnection no longer refcounted to simplify the lifetime management.

Covered by API test.

* workers/service/server/SWServer.cpp:
(WebCore::SWServer::SWServer):
(WebCore::SWServer::tryInstallContextData):
(WebCore::SWServer::contextConnectionCreated):
(WebCore::SWServer::unregisterServiceWorkerClient):
(WebCore::SWServer::needsContextConnectionForRegistrableDomain const):
(WebCore::SWServer::addContextConnection):
(WebCore::SWServer::removeContextConnection):
(WebCore::SWServer::createContextConnection):
* workers/service/server/SWServer.h:
(WebCore::SWServer::contextConnectionForRegistrableDomain):
* workers/service/server/SWServerToContextConnection.cpp:
(WebCore::SWServerToContextConnection::SWServerToContextConnection):
(WebCore::SWServerToContextConnection::~SWServerToContextConnection):
* workers/service/server/SWServerToContextConnection.h:
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::contextConnection):

Source/WebKit:

Remove the management of server context connections from NetworkProcess.
The WebProcessPool service worker process map is now keyed by both registrable domain and sessionID.
Update WebProcessPool to only expose the number of service worker processes instead of the full map.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::didClose):
(WebKit::NetworkConnectionToWebProcess::establishSWContextConnection):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::swServerForSession):
* NetworkProcess/NetworkProcess.h:
(WebKit::NetworkProcess::swServerForSessionIfExists):
* NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::startFetch):
(WebKit::WebSWServerConnection::postMessageToServiceWorker):
(WebKit::WebSWServerConnection::scheduleJobInServer):
(WebKit::WebSWServerConnection::updateThrottleState):
(WebKit::WebSWServerConnection::contextConnectionCreated):
* NetworkProcess/ServiceWorker/WebSWServerConnection.h:
* NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
(WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
(WebKit::WebSWServerToContextConnection::~WebSWServerToContextConnection):
(WebKit::WebSWServerToContextConnection::connectionIsNoLongerNeeded):
* NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _webPageContentProcessCount]):
(-[WKProcessPool _serviceWorkerProcessCount]):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
(WebKit::WebProcessPool::disconnectProcess):
* UIProcess/WebProcessPool.h:
* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::WebSWContextManagerConnection):
(WebKit::m_userAgent):
* WebProcess/Storage/WebSWContextManagerConnection.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::establishWorkerContextConnectionToNetworkProcess):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:

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

8 months agoUnreviewed, fix ChangeLog entry for r249730
annulen@yandex.ru [Fri, 13 Sep 2019 19:48:01 +0000 (19:48 +0000)]
Unreviewed, fix ChangeLog entry for r249730

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

8 months agoRe-add myself to the list of committers
zimmermann@webkit.org [Fri, 13 Sep 2019 19:46:57 +0000 (19:46 +0000)]
Re-add myself to the list of committers

Unreviewed.

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

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

8 months agoLayout Test imported/w3c/web-platform-tests/service-workers/service-worker/getregistr...
cdumez@apple.com [Fri, 13 Sep 2019 19:17:21 +0000 (19:17 +0000)]
Layout Test imported/w3c/web-platform-tests/service-workers/service-worker/getregistrations.https.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=201661
<rdar://problem/55240851>

Reviewed by Alex Christensen.

The last test's cleanup step was very complex (involving waiting for a promise to get resolved) and WebKit's
completion handler in testharnessreport.js was often getting called before the promise resolution, leaving
the test frame in the output when we call notifyDone(). This seems like a potential bug in testharness.js.
To address the issue for now, do the unregistration in the test's body and only remove the test frame in
the cleanup step.

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

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

8 months ago[LFC] Do not create FormattingContext unless the root has child boxes.
zalan@apple.com [Fri, 13 Sep 2019 19:15:48 +0000 (19:15 +0000)]
[LFC] Do not create FormattingContext unless the root has child boxes.
https://bugs.webkit.org/show_bug.cgi?id=201766
<rdar://problem/55344449>

Reviewed by Antti Koivisto.

Just because a box establishes a formatting context, it does not necessarily mean we need to create a formatting context object for it.
The established formatting context is responsible for laying out the descendant content. The formatting context root itself is
laid out in the formatting context it lives in. So if there's no descendent content, we don't need to construct the context objects.

<body><div style="float: left;"></div></body> <- this div establishes a block formatting context (float) but it does not have any content so laying
it out simply means sizing and positioning it in the initial block formatting context.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::FormattingContext):
(WebCore::Layout::FormattingContext::layoutOutOfFlowContent):
(WebCore::Layout::FormattingContext::mapTopToFormattingContextRoot const):
(WebCore::Layout::FormattingContext::mapLeftToFormattingContextRoot const):
(WebCore::Layout::FormattingContext::mapRightToFormattingContextRoot const):
(WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
* layout/FormattingContext.h:
(WebCore::Layout::FormattingContext::root const):
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const):
(WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
* layout/LayoutState.cpp:
(WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
(WebCore::Layout::LayoutState::establishedFormattingState const):
(WebCore::Layout::LayoutState::createFormattingStateForFormattingRootIfNeeded):
(WebCore::Layout::LayoutState::createFormattingContext):
* layout/LayoutState.h:
(WebCore::Layout::LayoutState::hasFormattingState const):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::BlockFormattingContext):
(WebCore::Layout::BlockFormattingContext::layoutInFlowContent):
(WebCore::Layout::BlockFormattingContext::usedAvailableWidthForFloatAvoider const):
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot):
(WebCore::Layout::BlockFormattingContext::computedIntrinsicWidthConstraints):
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints):
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough const):
* layout/floats/FloatingContext.h:
(WebCore::Layout::FloatingContext::root const):
* layout/floats/FloatingState.cpp:
(WebCore::Layout::FloatingState::FloatingState):
(WebCore::Layout::FloatingState::bottom const):
(WebCore::Layout::FloatingState::top const):
* layout/floats/FloatingState.h:
(WebCore::Layout::FloatingState::create):
(WebCore::Layout::FloatingState::root const):
(WebCore::Layout::FloatingState::leftBottom const):
(WebCore::Layout::FloatingState::rightBottom const):
(WebCore::Layout::FloatingState::bottom const):
(WebCore::Layout::FloatingState::FloatItem::isDescendantOfFormattingRoot const):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::InlineFormattingContext):
(WebCore::Layout::InlineFormattingContext::layoutInFlowContent):
(WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints):
(WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot):
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot):
(WebCore::Layout::InlineFormattingContext::collectInlineContent const):
* layout/inlineformatting/InlineFormattingContext.h:
(WebCore::Layout::InlineFormattingContext::InlineLayout::formattingRoot const):
* layout/inlineformatting/InlineFormattingContextQuirks.cpp:
(WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::close):
(WebCore::Layout::Line::adjustBaselineAndLineHeight):
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::TableFormattingContext):
(WebCore::Layout::TableFormattingContext::layoutTableCellBox):
(WebCore::Layout::TableFormattingContext::setComputedGeometryForSections):
(WebCore::Layout::TableFormattingContext::ensureTableGrid):
(WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns):
* layout/tableformatting/TableFormattingContext.h:

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

8 months agoWeb Inspector: Tighter autocomplete bubbles
joepeck@webkit.org [Fri, 13 Sep 2019 19:08:49 +0000 (19:08 +0000)]
Web Inspector: Tighter autocomplete bubbles
https://bugs.webkit.org/show_bug.cgi?id=201742

Reviewed by Timothy Hatcher.

* UserInterface/Views/CompletionSuggestionsView.js:
(WI.CompletionSuggestionsView.prototype.show):
Eliminate the trailing space. Use bounding client rect to get
fractional widths and raise the value so we are at an even number.

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

8 months agoREGRESSION: Web Inspector: Layout Timeline View does not show popover for initiator...
pecoraro@apple.com [Fri, 13 Sep 2019 19:02:59 +0000 (19:02 +0000)]
REGRESSION: Web Inspector: Layout Timeline View does not show popover for initiator data
https://bugs.webkit.org/show_bug.cgi?id=201732
<rdar://problem/55312339>

Reviewed by Devin Rousso.

* UserInterface/Views/LayoutTimelineDataGrid.js:
(WI.LayoutTimelineDataGrid.prototype.callFramePopoverAnchorElement):
(WI.LayoutTimelineDataGrid.prototype.shouldShowCallFramePopover):
The column name was incorrect.

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

8 months agoUncaught Exception: null is not an object (evaluating 'Object.keys(propertyNames...
joepeck@webkit.org [Fri, 13 Sep 2019 18:58:30 +0000 (18:58 +0000)]
Uncaught Exception: null is not an object (evaluating 'Object.keys(propertyNames)​')​ (at JavaScriptRuntimeCompletionProvider.js:​244:​57)​
https://bugs.webkit.org/show_bug.cgi?id=201729

Reviewed by Devin Rousso.

* UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
(WI.JavaScriptRuntimeCompletionProvider):
(WI.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded):
Don't clear the completion object group until all ongoing requests have completed.
Percision for the lifetime of the object group objects is not important, but we
surely don't want to delete an object too soon.

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

8 months agoIntersectionObserverEntry#intersectionRatio can be larger than 1
ajuma@chromium.org [Fri, 13 Sep 2019 18:46:56 +0000 (18:46 +0000)]
IntersectionObserverEntry#intersectionRatio can be larger than 1
https://bugs.webkit.org/show_bug.cgi?id=200776

Reviewed by Simon Fraser.

Source/WebCore:

When computing the intersection between a target and an intersection observer's
root, RenderBox::computeVisibleRectInContainer is used to map the target rect
up the containing block chain, clipping along the way. When a RenderBox has
a transform, this method expands the given rect to the enclosing rect in device
pixels. This is fine for the use case of computing an invalidation rect, but for
the intersection observer use case it means that it is possible for the computed
intersection rect to be slightly larger than the original target rect, resulting
in an intersection ratio greater than 1.

Fix this by performing a final intersection between the intersection rect as
computed above and the target rect.

Test: intersection-observer/intersection-clipped-to-target.html

* dom/Document.cpp:
(WebCore::computeIntersectionState):

LayoutTests:

* intersection-observer/intersection-clipped-to-target-expected.txt: Added.
* intersection-observer/intersection-clipped-to-target.html: Added.

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

8 months agoLayout Test http/tests/appcache/remove-cache.html is a flaky failure.
russell_e@apple.com [Fri, 13 Sep 2019 18:46:32 +0000 (18:46 +0000)]
Layout Test http/tests/appcache/remove-cache.html is a flaky failure.
https://bugs.webkit.org/show_bug.cgi?id=199124

Unreviewed Test Gardening..

* platform/mac/TestExpectations: Marked Test as Flaky.

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

8 months agoSMIL animations of SVG <view> element have no effect
commit-queue@webkit.org [Fri, 13 Sep 2019 18:21:14 +0000 (18:21 +0000)]
SMIL animations of SVG <view> element have no effect
https://bugs.webkit.org/show_bug.cgi?id=94469

Patch by Nikolas Zimmermann <zimmermann@kde.org> on 2019-09-13
Reviewed by Said Abou-Hallawa.

Source/WebCore:

SMIL animations of the attributes associated with SVGViewElement work fine, but without any
visual effect. When loading an SVG document with a given fragment identifier
(e.g. test.svg#customView) where 'customView' references to an embedded SVGViewElement, the
viewBox/preserveAspectRatio settings should be taken from the SVGViewElement. Currently
there is no link between the SVGViewElement and the SVGSVGElement. The settings from the
SVGViewElement are only pasrsed onco in SVGSVGElement::scrollToFragment(). Dynamic updates
of the 'viewBox' and 'preserveAspectRatio' attributes of the SVGViewElement thus have no
visual effect, since the SVGSVGElement does not re-evaluates its viewBox.

Store a RefPtr to the currently used SVGViewElement in SVGSVGElement, and a WeakPtr back
to the SVGSVGElement that currently references the SVGViewElement. This allows us to
propagate SVGViewElement attribute changes to SVGSVGElement and re-evaluate the viewBox
stored in SVGSVGElement and trigger visual updates.

Tests: svg/custom/animation-on-view-element.html
       svg/custom/multiple-view-elements.html

* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::scrollToFragment):
* svg/SVGSVGElement.h:
* svg/SVGViewElement.cpp:
(WebCore::SVGViewElement::svgAttributeChanged): Add missing implementation, tracked by
webkit.org/b/196554. Correctly handle SVGFitToViewBox property changes. Update the viewBox
stored in the SVGSVGElement, that references the SVGViewElement. Afterwards invalidate the
renderer associated with the SVGSVGElement, which properly triggers visual updates.
* svg/SVGViewElement.h:

LayoutTests:

Add new layout tests to verify that dynamic modifications of the <view> element cause
visual updates. Previously SVGSVGElement was never notified about changes of the
SVGViewElement and thus did not update the stored viewBox.

* svg/custom/animation-on-view-element-expected.html: Added.
* svg/custom/animation-on-view-element.html: Added. This is a new reftest
demonstrating that animations of SVG <view> elements now behave as expected.
* svg/custom/multiple-view-elements-expected.html: Added.
* svg/custom/multiple-view-elements.html: Added.
* svg/dom/SVGViewSpec-multiple-views-expected.txt:
* svg/dom/SVGViewSpec-multiple-views.html: Extend to cover dynamic modifications.

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

8 months ago[JSC] Micro-optimize YarrJIT's surrogate pair handling
ysuzuki@apple.com [Fri, 13 Sep 2019 18:01:14 +0000 (18:01 +0000)]
[JSC] Micro-optimize YarrJIT's surrogate pair handling
https://bugs.webkit.org/show_bug.cgi?id=201750

Reviewed by Michael Saboff.

Optimize sequence of machine code used to get code-point with unicode flag.

* yarr/YarrJIT.cpp:
(JSC::Yarr::YarrGenerator::tryReadUnicodeCharImpl):

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

8 months agoWe should assert $vm is enabled on entry and exit in its functions.
mark.lam@apple.com [Fri, 13 Sep 2019 17:54:02 +0000 (17:54 +0000)]
We should assert $vm is enabled on entry and exit in its functions.
https://bugs.webkit.org/show_bug.cgi?id=201762
<rdar://problem/55338742>

Rubber-stamped by Michael Saboff.

1. Also do the same for FunctionOverrides.
2. Added the DollarVMAssertScope and FunctionOverridesAssertScope to achieve this.
3. Also added assertions to lambda functions in $vm.

* tools/FunctionOverrides.cpp:
(JSC::FunctionOverridesAssertScope::FunctionOverridesAssertScope):
(JSC::FunctionOverridesAssertScope::~FunctionOverridesAssertScope):
(JSC::FunctionOverrides::overrides):
(JSC::FunctionOverrides::FunctionOverrides):
(JSC::FunctionOverrides::reinstallOverrides):
(JSC::initializeOverrideInfo):
(JSC::FunctionOverrides::initializeOverrideFor):
(JSC::parseClause):
(JSC::FunctionOverrides::parseOverridesInFile):
* tools/JSDollarVM.cpp:
(JSC::JSDollarVMCallFrame::JSDollarVMCallFrame):
(JSC::JSDollarVMCallFrame::createStructure):
(JSC::JSDollarVMCallFrame::create):
(JSC::JSDollarVMCallFrame::finishCreation):
(JSC::JSDollarVMCallFrame::addProperty):
(JSC::Element::Element):
(JSC::Element::create):
(JSC::Element::visitChildren):
(JSC::Element::createStructure):
(JSC::Root::Root):
(JSC::Root::setElement):
(JSC::Root::create):
(JSC::Root::createStructure):
(JSC::Root::visitChildren):
(JSC::SimpleObject::SimpleObject):
(JSC::SimpleObject::create):
(JSC::SimpleObject::visitChildren):
(JSC::SimpleObject::createStructure):
(JSC::ImpureGetter::ImpureGetter):
(JSC::ImpureGetter::createStructure):
(JSC::ImpureGetter::create):
(JSC::ImpureGetter::finishCreation):
(JSC::ImpureGetter::getOwnPropertySlot):
(JSC::ImpureGetter::visitChildren):
(JSC::CustomGetter::CustomGetter):
(JSC::CustomGetter::createStructure):
(JSC::CustomGetter::create):
(JSC::CustomGetter::getOwnPropertySlot):
(JSC::CustomGetter::customGetter):
(JSC::CustomGetter::customGetterAcessor):
(JSC::RuntimeArray::create):
(JSC::RuntimeArray::destroy):
(JSC::RuntimeArray::getOwnPropertySlot):
(JSC::RuntimeArray::getOwnPropertySlotByIndex):
(JSC::RuntimeArray::createPrototype):
(JSC::RuntimeArray::createStructure):
(JSC::RuntimeArray::finishCreation):
(JSC::RuntimeArray::RuntimeArray):
(JSC::RuntimeArray::lengthGetter):
(JSC::DOMJITNode::DOMJITNode):
(JSC::DOMJITNode::createStructure):
(JSC::DOMJITNode::checkSubClassSnippet):
(JSC::DOMJITNode::create):
(JSC::DOMJITGetter::DOMJITGetter):
(JSC::DOMJITGetter::createStructure):
(JSC::DOMJITGetter::create):
(JSC::DOMJITGetter::DOMJITAttribute::slowCall):
(JSC::DOMJITGetter::DOMJITAttribute::callDOMGetter):
(JSC::DOMJITGetter::customGetter):
(JSC::DOMJITGetter::finishCreation):
(JSC::DOMJITGetterComplex::DOMJITGetterComplex):
(JSC::DOMJITGetterComplex::createStructure):
(JSC::DOMJITGetterComplex::create):
(JSC::DOMJITGetterComplex::DOMJITAttribute::slowCall):
(JSC::DOMJITGetterComplex::DOMJITAttribute::callDOMGetter):
(JSC::DOMJITGetterComplex::functionEnableException):
(JSC::DOMJITGetterComplex::customGetter):
(JSC::DOMJITGetterComplex::finishCreation):
(JSC::DOMJITFunctionObject::DOMJITFunctionObject):
(JSC::DOMJITFunctionObject::createStructure):
(JSC::DOMJITFunctionObject::create):
(JSC::DOMJITFunctionObject::functionWithTypeCheck):
(JSC::DOMJITFunctionObject::functionWithoutTypeCheck):
(JSC::DOMJITFunctionObject::checkSubClassSnippet):
(JSC::DOMJITFunctionObject::finishCreation):
(JSC::DOMJITCheckSubClassObject::DOMJITCheckSubClassObject):
(JSC::DOMJITCheckSubClassObject::createStructure):
(JSC::DOMJITCheckSubClassObject::create):
(JSC::DOMJITCheckSubClassObject::functionWithTypeCheck):
(JSC::DOMJITCheckSubClassObject::functionWithoutTypeCheck):
(JSC::DOMJITCheckSubClassObject::finishCreation):
(JSC::DOMJITGetterBaseJSObject::DOMJITGetterBaseJSObject):
(JSC::DOMJITGetterBaseJSObject::createStructure):
(JSC::DOMJITGetterBaseJSObject::create):
(JSC::DOMJITGetterBaseJSObject::DOMJITAttribute::slowCall):
(JSC::DOMJITGetterBaseJSObject::DOMJITAttribute::callDOMGetter):
(JSC::DOMJITGetterBaseJSObject::customGetter):
(JSC::DOMJITGetterBaseJSObject::finishCreation):
(JSC::JSTestCustomGetterSetter::JSTestCustomGetterSetter):
(JSC::JSTestCustomGetterSetter::create):
(JSC::JSTestCustomGetterSetter::createStructure):
(JSC::customSetAccessor):
(JSC::customSetValue):
(JSC::JSTestCustomGetterSetter::finishCreation):
(JSC::Element::handleOwner):
(JSC::Element::finishCreation):
(JSC::WasmStreamingParser::WasmStreamingParser):
(JSC::WasmStreamingParser::create):
(JSC::WasmStreamingParser::createStructure):
(JSC::WasmStreamingParser::finishCreation):
(JSC::functionWasmStreamingParserAddBytes):
(JSC::functionWasmStreamingParserFinalize):
(JSC::functionCrash):
(JSC::functionBreakpoint):
(JSC::functionDFGTrue):
(JSC::functionFTLTrue):
(JSC::functionCpuMfence):
(JSC::functionCpuRdtsc):
(JSC::functionCpuCpuid):
(JSC::functionCpuPause):
(JSC::functionCpuClflush):
(JSC::CallerFrameJITTypeFunctor::CallerFrameJITTypeFunctor):
(JSC::getExecutableForFunction):
(JSC::functionLLintTrue):
(JSC::functionJITTrue):
(JSC::functionNoInline):
(JSC::functionGC):
(JSC::functionEdenGC):
(JSC::functionDumpSubspaceHashes):
(JSC::functionCallFrame):
(JSC::functionCodeBlockForFrame):
(JSC::codeBlockFromArg):
(JSC::functionCodeBlockFor):
(JSC::functionDumpSourceFor):
(JSC::functionDumpBytecodeFor):
(JSC::doPrint):
(JSC::functionDataLog):
(JSC::functionPrint):
(JSC::functionDumpCallFrame):
(JSC::functionDumpStack):
(JSC::functionDumpRegisters):
(JSC::functionDumpCell):
(JSC::functionIndexingMode):
(JSC::functionInlineCapacity):
(JSC::functionValue):
(JSC::functionGetPID):
(JSC::functionHaveABadTime):
(JSC::functionIsHavingABadTime):
(JSC::functionCreateGlobalObject):
(JSC::functionCreateProxy):
(JSC::functionCreateRuntimeArray):
(JSC::functionCreateNullRopeString):
(JSC::functionCreateImpureGetter):
(JSC::functionCreateCustomGetterObject):
(JSC::functionCreateDOMJITNodeObject):
(JSC::functionCreateDOMJITGetterObject):
(JSC::functionCreateDOMJITGetterComplexObject):
(JSC::functionCreateDOMJITFunctionObject):
(JSC::functionCreateDOMJITCheckSubClassObject):
(JSC::functionCreateDOMJITGetterBaseJSObject):
(JSC::functionCreateWasmStreamingParser):
(JSC::functionSetImpureGetterDelegate):
(JSC::functionCreateBuiltin):
(JSC::functionGetPrivateProperty):
(JSC::functionCreateRoot):
(JSC::functionCreateElement):
(JSC::functionGetElement):
(JSC::functionCreateSimpleObject):
(JSC::functionGetHiddenValue):
(JSC::functionSetHiddenValue):
(JSC::functionShadowChickenFunctionsOnStack):
(JSC::functionSetGlobalConstRedeclarationShouldNotThrow):
(JSC::functionFindTypeForExpression):
(JSC::functionReturnTypeFor):
(JSC::functionFlattenDictionaryObject):
(JSC::functionDumpBasicBlockExecutionRanges):
(JSC::functionHasBasicBlockExecuted):
(JSC::functionBasicBlockExecutionCount):
(JSC::functionEnableExceptionFuzz):
(JSC::changeDebuggerModeWhenIdle):
(JSC::functionEnableDebuggerModeWhenIdle):
(JSC::functionDisableDebuggerModeWhenIdle):
(JSC::functionDeleteAllCodeWhenIdle):
(JSC::functionGlobalObjectCount):
(JSC::functionGlobalObjectForObject):
(JSC::functionGetGetterSetter):
(JSC::functionLoadGetterFromGetterSetter):
(JSC::functionCreateCustomTestGetterSetter):
(JSC::functionDeltaBetweenButterflies):
(JSC::functionTotalGCTime):
(JSC::functionParseCount):
(JSC::functionIsWasmSupported):
(JSC::JSDollarVM::finishCreation):
(JSC::JSDollarVM::addFunction):
(JSC::JSDollarVM::addConstructibleFunction):
* tools/JSDollarVM.h:
(JSC::DollarVMAssertScope::DollarVMAssertScope):
(JSC::DollarVMAssertScope::~DollarVMAssertScope):

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

8 months agoUnreviewd test gardening after r249817.
ryanhaddad@apple.com [Fri, 13 Sep 2019 17:30:32 +0000 (17:30 +0000)]
Unreviewd test gardening after r249817.

* platform/ios/TestExpectations: Remove failure expectation that was overriding the skip in platform/wk2/TestExpectations.

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

8 months ago[FTW] ImageBuffer/ImageBufferData is highly inefficient
bfulgham@apple.com [Fri, 13 Sep 2019 17:14:24 +0000 (17:14 +0000)]
[FTW] ImageBuffer/ImageBufferData is highly inefficient
https://bugs.webkit.org/show_bug.cgi?id=201594

Reviewed by Said Abou-Hallawa.

My initial implementation of ImageBuffer and ImageBufferData for Direct2D involves too
much moving of data from GPU to CPU and back. We only need to make a renderable version
of the ImageBuffer when ImageBuffer::sinkIntoNativeImage or ImageBuffer::copyNativeImage
are called.

Currently, each ImageBuffer putData operation uploads the data to the GPU, and each
ImageBuffer getData pulls the data from the GPU.

This patch does the following:

1. It makes the assumption that the ID2D1Bitmap it holds is under its control (i.e.,
   external draw operations do not manipulate the bitmap without marking it dirty).
2. It holds a CPU copy of the data from the ID2D1Bitmap originally used to create it.
   It uses this data for all manipulations, and uploads to the bitmap only when
   an ID2D1Bitmap is requested for drawing, and before a drawing operation is performed
   on the associated ImageBuffer context.
3. It does not read back from the ID2D1Bitmap unless it is told that it is dirty.
4. It does not call 'ID2D1RenderTarget::SetTags' if ASSERTS are disabled because
   they are costly, and don't help in release builds.

* platform/graphics/win/Direct2DOperations.cpp:
(WebCore::Direct2D::fillRect): Use new 'setTags' method.
(WebCore::Direct2D::fillRoundedRect): Ditto.
(WebCore::Direct2D::fillRectWithRoundedHole): Ditto.
(WebCore::Direct2D::fillRectWithGradient): Ditto.
(WebCore::Direct2D::fillPath): Ditto.
(WebCore::Direct2D::strokeRect): Ditto.
(WebCore::Direct2D::strokePath): Ditto.
(WebCore::Direct2D::drawPath): Ditto.
(WebCore::Direct2D::drawWithShadow): Notify observers before and after we drew.
(WebCore::Direct2D::drawWithoutShadow): Ditto.
(WebCore::Direct2D::clearRect): Use new 'setTags' method.
(WebCore::Direct2D::drawGlyphs): Ditto.
(WebCore::Direct2D::drawNativeImage): Ditto.
(WebCore::Direct2D::drawRect): Ditto.
(WebCore::Direct2D::drawLine): Ditto.
(WebCore::Direct2D::fillEllipse): Ditto.
(WebCore::Direct2D::drawEllipse): Ditto.
(WebCore::Direct2D::flush): Notify observer after we drew.
* platform/graphics/win/GradientDirect2D.cpp:
(WebCore::Gradient::fill): Don't call SetTags in non-ASSERT builds.
* platform/graphics/win/ImageBufferDataDirect2D.cpp:
(WebCore::ImageBufferData::ensureBackingStore const): Added.
(WebCore::ImageBufferData::getData const): Only read from the GPU if the in-memory
store is empty or out-of-sync.
(WebCore::ImageBufferData::putData): Mark the bitmap as out-of-sync, but don't
upload the data yet.
(WebCore::ImageBufferData::loadDataToBitmapIfNeeded): Helper function to upload data to the GPU.
(WebCore::ImageBufferData::compatibleBitmap): Only upload data if the relevant
bitmap is out of date.
* platform/graphics/win/ImageBufferDataDirect2D.h:
* platform/graphics/win/ImageBufferDirect2D.cpp:
(WebCore::ImageBuffer::ImageBuffer): Update constructor to register the ImageBufferData
lambdas as observer for draw operations.
* platform/graphics/win/PlatformContextDirect2D.cpp:
(WebCore::PlatformContextDirect2D::PlatformContextDirect2D): Update constructor to accept
lambdas to run before and after draw operations.
(WebCore::PlatformContextDirect2D::setTags): Added.
(WebCore::PlatformContextDirect2D::notifyPreDrawObserver): Added.
(WebCore::PlatformContextDirect2D::notifyPostDrawObserver): Added.
* platform/graphics/win/PlatformContextDirect2D.h:
(WebCore::PlatformContextDirect2D::PlatformContextDirect2D):

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

8 months agoUnreviewed, rolling out r249709.
russell_e@apple.com [Fri, 13 Sep 2019 16:53:19 +0000 (16:53 +0000)]
Unreviewed, rolling out r249709.

Layout test added in this patch has been consistently failing
since it landed.

Reverted changeset:

"Option + arrow moves caret past whitespace on iOS"
https://bugs.webkit.org/show_bug.cgi?id=201575
https://trac.webkit.org/changeset/249709

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

8 months ago[LFC] Rename FormattingContext::layout to layoutInFlowContent()
zalan@apple.com [Fri, 13 Sep 2019 16:40:40 +0000 (16:40 +0000)]
[LFC] Rename FormattingContext::layout to layoutInFlowContent()
https://bugs.webkit.org/show_bug.cgi?id=201763
<rdar://problem/55340435>

Reviewed by Antti Koivisto.

FormattingContext::layout() only takes care of the inflow content. Out-out-flow boxes are laid out through FormattingContext::layoutOutOfFlowContent.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::layoutOutOfFlowContent):
* layout/FormattingContext.h:
* layout/LayoutState.cpp:
(WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layoutInFlowContent):
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot):
(WebCore::Layout::BlockFormattingContext::layout): Deleted.
* layout/blockformatting/BlockFormattingContext.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layoutInFlowContent):
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot):
(WebCore::Layout::InlineFormattingContext::layout): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::layoutInFlowContent):
(WebCore::Layout::TableFormattingContext::layoutTableCellBox):
(WebCore::Layout::TableFormattingContext::layout): Deleted.
* layout/tableformatting/TableFormattingContext.h:

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

8 months ago[iOS] TestWebKitAPI.WebKit.TLSVersionWebSocket is a flaky failure
commit-queue@webkit.org [Fri, 13 Sep 2019 16:13:30 +0000 (16:13 +0000)]
[iOS] TestWebKitAPI.WebKit.TLSVersionWebSocket is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=201745

Patch by Alex Christensen <achristensen@webkit.org> on 2019-09-13
Reviewed by Chris Dumez.

* TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm:
(TestWebKitAPI::TEST):
The exact message isn't important.  The fact that the TLS handshake failed is, which is checked by the TCPServer.

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

8 months agoAuxiliaryProcessProxy::sendWithAsyncReply should queue up messages if sent while...
achristensen@apple.com [Fri, 13 Sep 2019 16:03:17 +0000 (16:03 +0000)]
AuxiliaryProcessProxy::sendWithAsyncReply should queue up messages if sent while the process is starting like it does messages without replies
https://bugs.webkit.org/show_bug.cgi?id=201746

Reviewed by Youenn Fablet.

* UIProcess/AuxiliaryProcessProxy.cpp:
(WebKit::AuxiliaryProcessProxy::sendMessage):
(WebKit::AuxiliaryProcessProxy::didFinishLaunching):
* UIProcess/AuxiliaryProcessProxy.h:
(WebKit::AuxiliaryProcessProxy::sendWithAsyncReply):

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

8 months ago[LFC] FormattingContext::displayBoxForLayoutBox should be split into 2 functions
zalan@apple.com [Fri, 13 Sep 2019 15:42:28 +0000 (15:42 +0000)]
[LFC] FormattingContext::displayBoxForLayoutBox should be split into 2 functions
https://bugs.webkit.org/show_bug.cgi?id=201754
<rdar://problem/55328753>

Reviewed by Antti Koivisto.

1. FormattingContext::geometryForBox() returns a const Display::Box. Use this function to access
already computed geometry such as the containing block's content box width.
This function can escape the current formatting context in certain cases and read geometry from parent/ancestor formatting contexts.
2. FormattingState::displayBox() returns a non-const version of the Display::Box. Use this function to
create/get the display box of a particular layout box to set computed values. This call should never escape the
current formatting context (as no one should mutate ancestor boxes).

Normally while laying out a particular box, we need to collect some geometry information from other boxes in the tree like previous sibling, containing block.
<div style="width: 100px"><div></div></div> <- the inner div's used width is based on the outer div's width.
However we should never mutate the geometry information on those other boxes (outer div). This patch helps avoiding accidental mutation on ancestors by
returning a const version of the Display::Box.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry):
(WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry):
(WebCore::Layout::FormattingContext::computeBorderAndPadding):
(WebCore::Layout::mapHorizontalPositionToAncestor):
(WebCore::Layout::FormattingContext::mapTopToFormattingContextRoot const):
(WebCore::Layout::FormattingContext::mapLeftToFormattingContextRoot const):
(WebCore::Layout::FormattingContext::mapRightToFormattingContextRoot const):
(WebCore::Layout::FormattingContext::geometryForBox const):
(WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
(WebCore::Layout::FormattingContext::displayBoxForLayoutBox const): Deleted.
* layout/FormattingContext.h:
(WebCore::Layout::FormattingContext::hasDisplayBox const): Deleted.
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::computedHeightValue const):
(WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const):
(WebCore::Layout::FormattingContext::Geometry::staticVerticalPositionForOutOfFlowPositioned const):
(WebCore::Layout::FormattingContext::Geometry::staticHorizontalPositionForOutOfFlowPositioned const):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry const):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry const):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry const):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin const):
(WebCore::Layout::FormattingContext::Geometry::inFlowPositionedPositionOffset const):
* layout/FormattingContextQuirks.cpp:
(WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
* layout/FormattingState.cpp:
(WebCore::Layout::FormattingState::displayBox const):
* layout/FormattingState.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::usedAvailableWidthForFloatAvoider const):
(WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren):
(WebCore::Layout::BlockFormattingContext::computeStaticVerticalPosition):
(WebCore::Layout::BlockFormattingContext::computeStaticHorizontalPosition):
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition):
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFloatClear):
(WebCore::Layout::BlockFormattingContext::computeFloatingPosition):
(WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats):
(WebCore::Layout::BlockFormattingContext::computeWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::verticalPositionWithMargin const):
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin const):
(WebCore::Layout::BlockFormattingContext::Geometry::staticVerticalPosition const):
(WebCore::Layout::BlockFormattingContext::Geometry::staticHorizontalPosition const):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
* layout/blockformatting/BlockFormattingContextQuirks.cpp:
(WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::hasClearance const):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore const):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter const):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore const):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance const):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter const):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::updateMarginAfterForPreviousSibling const):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::updatePositiveNegativeMarginValues):
(WebCore::Layout::hasClearance): Deleted.
* layout/floats/FloatingContext.cpp:
(WebCore::Layout::FloatingContext::positionForFloat const):
(WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
(WebCore::Layout::FloatingContext::absoluteDisplayBoxCoordinates const):
(WebCore::Layout::FloatingContext::mapToFloatingStateRoot const):
(WebCore::Layout::FloatingContext::mapTopToFloatingStateRoot const):
(WebCore::Layout::FloatingContext::mapPointFromFormattingContextRootToFloatingStateRoot const):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout):
(WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints):
(WebCore::Layout::InlineFormattingContext::initializeMarginBorderAndPaddingForGenericInlineBox):
(WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPaddingForInlineContainer):
(WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot):
(WebCore::Layout::InlineFormattingContext::computeHorizontalMargin):
(WebCore::Layout::InlineFormattingContext::computeWidthAndMargin):
(WebCore::Layout::InlineFormattingContext::computeHeightAndMargin):
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot):
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin const):
* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::inlineItemWidth):
(WebCore::Layout::LineLayout::placeInlineItem):
(WebCore::Layout::InlineFormattingContext::InlineLayout::layout const):
(WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
(WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns const):
* layout/inlineformatting/InlineFormattingContextQuirks.cpp:
(WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::isInlineContainerConsideredEmpty):
(WebCore::Layout::Line::isVisuallyEmpty const):
(WebCore::Layout::Line::close):
(WebCore::Layout::Line::appendNonReplacedInlineBox):
(WebCore::Layout::Line::inlineItemContentHeight const):
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::layout):
(WebCore::Layout::TableFormattingContext::layoutTableCellBox):
(WebCore::Layout::TableFormattingContext::positionTableCells):
(WebCore::Layout::TableFormattingContext::setComputedGeometryForRows):
(WebCore::Layout::TableFormattingContext::setComputedGeometryForSections):
(WebCore::Layout::TableFormattingContext::computedTableWidth):

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

8 months agoStop using testRunner.setPrivateBrowsingEnabled_DEPRECATED() in http/tests/security...
cdumez@apple.com [Fri, 13 Sep 2019 14:42:14 +0000 (14:42 +0000)]
Stop using testRunner.setPrivateBrowsingEnabled_DEPRECATED() in http/tests/security/appcache-in-private-browsing.html
https://bugs.webkit.org/show_bug.cgi?id=201704

Reviewed by Youenn Fablet.

Stop using testRunner.setPrivateBrowsingEnabled_DEPRECATED() in http/tests/security/appcache-in-private-browsing.html
and use the new useEphemeralSession WKTR / DRT flag instead.

* http/tests/security/appcache-in-private-browsing-expected.txt:
* http/tests/security/appcache-in-private-browsing.html:
* http/tests/security/resources/frame-for-appcache-in-private-browsing.html:
* platform/mac-wk2/TestExpectations:

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

8 months agoUse WebProcess processIdentifier to identify Service Worker connections
youenn@apple.com [Fri, 13 Sep 2019 12:32:49 +0000 (12:32 +0000)]
Use WebProcess processIdentifier to identify Service Worker connections
https://bugs.webkit.org/show_bug.cgi?id=201459

Reviewed by Chris Dumez.

Source/WebCore:

No observable change of behavior.

* workers/service/ServiceWorkerClient.cpp:
(WebCore::ServiceWorkerClient::postMessage):
Pass sessionID to ease NetworkProcess selection of the client process connection.
* workers/service/ServiceWorkerTypes.h:
Mark server connection identifier be process identifier based.
* workers/service/context/SWContextManager.h:
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::Connection::Connection):
* workers/service/server/SWServer.h:
Let connection identifier be set in constructor instead of generated.

Source/WebCore/PAL:

* pal/SessionID.h:
(PAL::SessionID::SessionID):

Source/WebKit:

Make WebSWServerConnection be stored in NetworkConnectionToWebProcess.
They are now keyed by session IDs hence why WebSWClientConnection is using the session ID as message connection ID.
Creation no longer requires a sync IPC since the connection is uniquely identified by its session ID and its process ID.
These IDs are stable over network process crash.
Within NetworkProcess, a server connection is managed by a SWServer which is session ID specific.
In that case, the process identifier uniquely identifies the connection.

Move WebSWServerToContextConnection be owned by NetworkConnectionToWebProcess.
Instead of creating it when webprocess is connecting to network process, use a dedicated IPC message.
This is similar to WebSWServerConnection once WebProcess asks to create it.
This will allow existing WebProcess, in cache or running pages, to run service workers as well.
A context connection map is kept in Network Process to reuse context connections since these connections are not sessionID specific.

Migrate from a single boolean to a HashSet to track whether some connections are in the process of being created.
Previously if two requests to create connections were done shortly one after the other on different registrable
domains, the second request would not be processed.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
(WebKit::NetworkConnectionToWebProcess::didReceiveSyncMessage):
(WebKit::NetworkConnectionToWebProcess::didClose):
(WebKit::NetworkConnectionToWebProcess::establishSWServerConnection):
(WebKit::NetworkConnectionToWebProcess::establishSWContextConnection):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::didReceiveMessage):
(WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
(WebKit::NetworkProcess::forEachSWServer):
(WebKit::NetworkProcess::needsServerToContextConnectionForRegistrableDomain const):
(WebKit::NetworkProcess::createServerToContextConnection):
(WebKit::NetworkProcess::postMessageToServiceWorkerClient):
(WebKit::NetworkProcess::registerSWServerConnection):
(WebKit::NetworkProcess::unregisterSWServerConnection):
(WebKit::NetworkProcess::registerSWContextConnection):
(WebKit::NetworkProcess::unregisterSWContextConnection):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::WebSWServerConnection):
(WebKit::WebSWServerConnection::postMessageToServiceWorkerClient):
* NetworkProcess/ServiceWorker/WebSWServerConnection.h:
* NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
(WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
(WebKit::WebSWServerToContextConnection::~WebSWServerToContextConnection):
(WebKit::WebSWServerToContextConnection::postMessageToServiceWorkerClient):
(WebKit::WebSWServerToContextConnection::connectionMayNoLongerBeNeeded):
* NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
* NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::openNetworkProcessConnection):
(WebKit::NetworkProcessProxy::establishWorkerContextConnectionToNetworkProcess):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::establishServiceWorkerContext):
* UIProcess/WebProcessProxy.h:
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::didReceiveMessage):
(WebKit::NetworkProcessConnection::didClose):
(WebKit::NetworkProcessConnection::serviceWorkerConnectionForSession):
* WebProcess/Network/NetworkProcessConnection.h:
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::WebSWClientConnection):
(WebKit::WebSWClientConnection::~WebSWClientConnection):
(WebKit::WebSWClientConnection::messageSenderConnection const):
(WebKit::WebSWClientConnection::scheduleJobInServer):
(WebKit::WebSWClientConnection::finishFetchingScriptInServer):
(WebKit::WebSWClientConnection::addServiceWorkerRegistrationInServer):
(WebKit::WebSWClientConnection::removeServiceWorkerRegistrationInServer):
(WebKit::WebSWClientConnection::postMessageToServiceWorker):
(WebKit::WebSWClientConnection::registerServiceWorkerClient):
(WebKit::WebSWClientConnection::unregisterServiceWorkerClient):
(WebKit::WebSWClientConnection::didResolveRegistrationPromise):
(WebKit::WebSWClientConnection::matchRegistration):
(WebKit::WebSWClientConnection::runOrDelayTaskForImport):
(WebKit::WebSWClientConnection::whenRegistrationReady):
(WebKit::WebSWClientConnection::getRegistrations):
(WebKit::WebSWClientConnection::startFetch):
(WebKit::WebSWClientConnection::cancelFetch):
(WebKit::WebSWClientConnection::continueDidReceiveFetchResponse):
(WebKit::WebSWClientConnection::connectionToServerLost):
(WebKit::WebSWClientConnection::clear):
(WebKit::WebSWClientConnection::syncTerminateWorker):
(WebKit::WebSWClientConnection::updateThrottleState):
(WebKit::WebSWClientConnection::storeRegistrationsOnDiskForTesting):
* WebProcess/Storage/WebSWClientConnection.h:
* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::WebSWContextManagerConnection):
(WebKit::m_userAgent):
(WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient):
* WebProcess/Storage/WebSWContextManagerConnection.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::establishWorkerContextConnectionToNetworkProcess):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

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

8 months agoWeb Inspector: Formatter: Pretty Print HTML resources (including inline <script>...
pecoraro@apple.com [Fri, 13 Sep 2019 10:05:36 +0000 (10:05 +0000)]
Web Inspector: Formatter: Pretty Print HTML resources (including inline <script>/<style>)
https://bugs.webkit.org/show_bug.cgi?id=201535
<rdar://problem/29119232>

Reviewed by Devin Rousso.

Source/JavaScriptCore:

* debugger/Debugger.cpp:
(JSC::Debugger::resolveBreakpoint):
When resolving a breakpoint inside of an inline <script> we need to adjust
based on the starting position of the <script> in the HTML resource.

Source/WebInspectorUI:

Introduce HTMLFormatter, HTMLParser, and HTMLTreeBuilderFormatter.

    - HTMLParser tokenizes HTML content and passes it to a tree builder.
    - HTMLTreeBuilderFormatter uses those tokens to create a formatted dom tree of fake nodes.
    - HTMLFormatter then builds formatted content and a FormatterSourceMap from that DOM tree.

The output of HTMLFormatter is intended to just modify whitespace. So it won't be a
100% compatible DOM, but will be useful for debugging and reading inline <style>
and <script>, which is a more common debugging scenario. It also maintains original
author attribute quotations or lack therefore, because again it tries to only
change whitespace. A separate tree builder could be used for tidying content.

This introduces a few tools for working with formatting:

    - Tools/HTMLFormatter - debug the parser, tree builder, and output format
    - Tools/SourceMaps - debug formatted content and source mappings

This also:

    - renames "EsprimaFormatter" to "JSFormatter"
    - eliminates an extra trailing newline in CSSFormatter output

* Tools/HTMLFormatter/HTMLTreeBuilderDebug.js: Added.
* Tools/HTMLFormatter/index.html: Added.
* Tools/HTMLFormatter/styles.css: Added.
Tool for debugging the HTML formatter components.

* Tools/SourceMaps/.gitignore: Added.
* Tools/SourceMaps/index.html: Added.
* Tools/SourceMaps/setup.sh: Added.
* Tools/SourceMaps/styles.css: Added.
Tool for debugging Formatter generated Source Maps.

* Tools/JSFormatter/JSFormatterDebug.js: Renamed from Source/WebInspectorUI/Tools/Formatting/EsprimaFormatterDebug.js.
* Tools/JSFormatter/codemirror-additions.css: Renamed from Source/WebInspectorUI/Tools/Formatting/codemirror-additions.css.
* Tools/JSFormatter/index.html: Renamed from Source/WebInspectorUI/Tools/Formatting/index.html.
Renamed this tool. EsprimaFormatter => JSFormatter.

* UserInterface/Controllers/FormatterSourceMap.js:
(WI.FormatterSourceMap.prototype.originalPositionToFormattedPosition):
(WI.FormatterSourceMap.prototype.formattedPositionToOriginalPosition):
New APIs used by tools and tests for translating "position" offsets and not line/columns.

* UserInterface/Workers/Formatter/JSFormatter.js: Renamed from Source/WebInspectorUI/UserInterface/Workers/Formatter/EsprimaFormatter.js.
(JSFormatter):
* UserInterface/Workers/Formatter/CSSFormatter.js:
(CSSFormatter):
Allow using a supplied builder, which is useful when formatting
inline content from HTMLFormatter (<style> / <script>).

* UserInterface/Workers/Formatter/FormatterContentBuilder.js:
(FormatterContentBuilder.prototype.get indentString):
(FormatterContentBuilder.prototype.get originalContent):
(FormatterContentBuilder.prototype.get indentLevel):
(FormatterContentBuilder.prototype.get originalOffset):
(FormatterContentBuilder.prototype.set originalOffset):
(FormatterContentBuilder.prototype.appendNonToken):
(FormatterContentBuilder.prototype.appendToken):
(FormatterContentBuilder.prototype.appendTokenWithPossibleNewlines):
(FormatterContentBuilder.prototype.appendMapping):
(FormatterContentBuilder.prototype.indentToLevel):
(FormatterContentBuilder.prototype.finish):
Provide API for getting / setting the original offset and indent level.
This is useful when the HTMLFormatter runs the CSSFormatter/JSFormatter
in a nested context (<style> / <script>). Add a few more APIs for
conveniences when appending tokens or important positions.

* UserInterface/Workers/Formatter/HTMLParser.js: Added.
(HTMLParser.prototype.parseDocument):
(HTMLParser.prototype._isEOF):
(HTMLParser.prototype._peek):
(HTMLParser.prototype._peekCharacterRegex):
(HTMLParser.prototype._peekString):
(HTMLParser.prototype._peekCaseInsensitiveString):
(HTMLParser.prototype._consumeWhitespace):
(HTMLParser.prototype._consumeUntilString):
(HTMLParser.prototype._consumeUntilRegex):
(HTMLParser.prototype._consumeDoubleQuotedString):
(HTMLParser):
Tokenize HTML content into nodes.

* UserInterface/Workers/Formatter/HTMLTreeBuilderFormatter.js: Added.
(HTMLTreeBuilderFormatter.prototype.get dom):
(HTMLTreeBuilderFormatter.prototype.begin):
(HTMLTreeBuilderFormatter.prototype.pushParserNode):
(HTMLTreeBuilderFormatter.prototype.end):
(HTMLTreeBuilderFormatter.prototype._pushParserNodeTopLevel):
(HTMLTreeBuilderFormatter.prototype._pushParserNodeStack):
(HTMLTreeBuilderFormatter.prototype._isEmptyNode):
(HTMLTreeBuilderFormatter.prototype._buildDOMNodeFromOpenTag):
(HTMLTreeBuilderFormatter.prototype._buildErrorNodeFromCloseTag):
(HTMLTreeBuilderFormatter.prototype._buildSimpleNodeFromParserNode):
(HTMLTreeBuilderFormatter):
Build a simple DOM tree from parser nodes.

* UserInterface/Workers/Formatter/HTMLFormatter.js: Added.
(HTMLFormatter.let.dom):
(HTMLFormatter):
(HTMLFormatter.prototype.get success):
(HTMLFormatter.prototype.get formattedText):
(HTMLFormatter.prototype.get sourceMapData):
(HTMLFormatter.prototype._walk):
(HTMLFormatter.prototype._walkChildren):
(HTMLFormatter.prototype._isNodeSelfClosing):
(HTMLFormatter.prototype._shouldHaveInlineContent):
(HTMLFormatter.prototype._hasMultipleNewLines):
(HTMLFormatter.prototype._buildAttributeString):
(HTMLFormatter.prototype._before):
(HTMLFormatter.prototype._after):
(HTMLFormatter.prototype._formatWithNestedFormatter):
(HTMLFormatter.prototype._formatScript):
(HTMLFormatter.prototype._formatStyle):
Output pretty printed text from a HTMLTreeBuilderFormatter dom tree.

* UserInterface/Proxies/FormatterWorkerProxy.js:
(WI.FormatterWorkerProxy.prototype.formatHTML):
* UserInterface/Workers/Formatter/FormatterWorker.js:
(FormatterWorker.prototype.formatJavaScript):
(FormatterWorker.prototype.formatCSS):
(FormatterWorker.prototype.formatHTML):
* UserInterface/Views/TextEditor.js:
(WI.TextEditor.prototype.hasFormatter):
(WI.TextEditor.prototype._canUseFormatterWorker):
(WI.TextEditor.prototype._startWorkerPrettyPrint):
Allow pretty printing HTML resources.

* UserInterface/Main.html:
* UserInterface/Test.html:
New resources.

LayoutTests:

* TestExpectations:
Mark slow test.

* inspector/formatting/formatting-css.html:
* inspector/formatting/formatting-html-expected.txt: Added.
* inspector/formatting/formatting-html.html: Added.
* inspector/formatting/formatting-javascript-expected.txt:
* inspector/formatting/formatting-javascript.html:
* inspector/formatting/formatting-json-expected.txt:
* inspector/formatting/formatting-json.html:
* inspector/formatting/resources/formatting-utilities.js: Renamed from LayoutTests/inspector/formatting/resources/utilities.js.
Update formatting tests to use new path to utilities.

* inspector/formatting/resources/css-tests/basic-expected.css:
* inspector/formatting/resources/css-tests/gradient-expected.css:
* inspector/formatting/resources/css-tests/keyframes-expected.css:
* inspector/formatting/resources/css-tests/media-query-expected.css:
* inspector/formatting/resources/css-tests/selectors-expected.css:
* inspector/formatting/resources/css-tests/wrapping-expected.css:
* inspector/codemirror/resources/prettyprinting/css-tests/basic-expected.css:
* inspector/codemirror/resources/prettyprinting/css-tests/calc-expected.css:
* inspector/codemirror/resources/prettyprinting/css-tests/gradient-expected.css:
* inspector/codemirror/resources/prettyprinting/css-tests/keyframes-expected.css:
* inspector/codemirror/resources/prettyprinting/css-tests/media-query-expected.css:
* inspector/codemirror/resources/prettyprinting/css-tests/selectors-expected.css:
* inspector/codemirror/resources/prettyprinting/css-tests/wrapping-expected.css:
Eliminate an extra trailing newline in CSS formatted results.

* inspector/formatting/resources/html-tests/attributes-expected.html: Added.
* inspector/formatting/resources/html-tests/attributes.html: Added.
* inspector/formatting/resources/html-tests/auto-close-expected.html: Added.
* inspector/formatting/resources/html-tests/auto-close.html: Added.
* inspector/formatting/resources/html-tests/basic-1-expected.html: Added.
* inspector/formatting/resources/html-tests/basic-1.html: Added.
* inspector/formatting/resources/html-tests/basic-2-expected.html: Added.
* inspector/formatting/resources/html-tests/basic-2.html: Added.
* inspector/formatting/resources/html-tests/comments-expected.html: Added.
* inspector/formatting/resources/html-tests/comments.html: Added.
* inspector/formatting/resources/html-tests/eof-1-expected.html: Added.
* inspector/formatting/resources/html-tests/eof-1.html: Added.
* inspector/formatting/resources/html-tests/eof-2-expected.html: Added.
* inspector/formatting/resources/html-tests/eof-2.html: Added.
* inspector/formatting/resources/html-tests/eof-3-expected.html: Added.
* inspector/formatting/resources/html-tests/eof-3.html: Added.
* inspector/formatting/resources/html-tests/eof-4-expected.html: Added.
* inspector/formatting/resources/html-tests/eof-4.html: Added.
* inspector/formatting/resources/html-tests/eof-5-expected.html: Added.
* inspector/formatting/resources/html-tests/eof-5.html: Added.
* inspector/formatting/resources/html-tests/eof-6-expected.html: Added.
* inspector/formatting/resources/html-tests/eof-6.html: Added.
* inspector/formatting/resources/html-tests/inline-script-expected.html: Added.
* inspector/formatting/resources/html-tests/inline-script.html: Added.
* inspector/formatting/resources/html-tests/inline-style-expected.html: Added.
* inspector/formatting/resources/html-tests/inline-style.html: Added.
* inspector/formatting/resources/html-tests/list-expected.html: Added.
* inspector/formatting/resources/html-tests/list.html: Added.
* inspector/formatting/resources/html-tests/not-well-formed-1-expected.html: Added.
* inspector/formatting/resources/html-tests/not-well-formed-1.html: Added.
* inspector/formatting/resources/html-tests/not-well-formed-2-expected.html: Added.
* inspector/formatting/resources/html-tests/not-well-formed-2.html: Added.
* inspector/formatting/resources/html-tests/not-well-formed-3-expected.html: Added.
* inspector/formatting/resources/html-tests/not-well-formed-3.html: Added.
* inspector/formatting/resources/html-tests/self-closing-expected.html: Added.
* inspector/formatting/resources/html-tests/self-closing.html: Added.
HTMLFormatter tests.

* inspector/formatting/resources/html-source-map-tests/1.html: Added.
* inspector/formatting/resources/html-source-map-tests/2.html: Added.
* inspector/formatting/resources/css-source-map-tests/1.css: Added.
* inspector/formatting/resources/javascript-source-map-tests/1.js: Added.
* inspector/formatting/source-map-css-1-expected.txt: Added.
* inspector/formatting/source-map-css-1.html: Added.
* inspector/formatting/source-map-html-1-expected.txt: Added.
* inspector/formatting/source-map-html-1.html: Added.
* inspector/formatting/source-map-html-2-expected.txt: Added.
* inspector/formatting/source-map-html-2.html: Added.
* inspector/formatting/source-map-javascript-1-expected.txt: Added.
* inspector/formatting/source-map-javascript-1.html: Added.
* inspector/formatting/resources/source-map-utilities.js: Added.
(TestPage.registerInitializer.logLocationWithContext):
(TestPage.registerInitializer.async.runSourceMapTest):
(TestPage.registerInitializer.):
(TestPage.registerInitializer.async.loadFormattedContentAndSourceMap):
(TestPage.registerInitializer.async.loadSourceMapTestResource):
(TestPage.registerInitializer.window.addSourceMapTest):
(TestPage.registerInitializer):
New formatter source map tests to ensure we can go back and forth reasonably
between formatted content and original content.

* inspector/debugger/breakpoints/resolved-dump-all-inline-script-pause-locations-expected.txt: Added.
* inspector/debugger/breakpoints/resolved-dump-all-inline-script-pause-locations.html: Added.
* inspector/debugger/breakpoints/resources/dump-inline-scripts.html: Added.
* inspector/debugger/breakpoints/resources/dump.js:
(TestPage.registerInitializer.window.addDumpAllPauseLocationsTestCase):
(TestPage.registerInitializer.addDumpAllPauseLocationsTestCaseForScript):
(TestPage.registerInitializer):
* inspector/debugger/resources/log-pause-location.js:
(TestPage.registerInitializer.window.findScript):
(TestPage.registerInitializer.window.findResource):
Test for resolving breakpoints at column locations in <script> which was
not previously possible and would not have worked previously.

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

8 months ago[JSC] X86Registers.h callee-save register definition is wrong
ysuzuki@apple.com [Fri, 13 Sep 2019 09:20:26 +0000 (09:20 +0000)]
[JSC] X86Registers.h callee-save register definition is wrong
https://bugs.webkit.org/show_bug.cgi?id=201756

Reviewed by Mark Lam.

I think nobody is using X86 JIT backend, but it is simply wrong.
edi and esi should be callee-save.

* assembler/X86Registers.h:

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

8 months ago[WinCairo][WK1] Accelerated Compositing can't be disabled by using WebPreferences...
Hironori.Fujii@sony.com [Fri, 13 Sep 2019 08:20:48 +0000 (08:20 +0000)]
[WinCairo][WK1] Accelerated Compositing can't be disabled by using WebPreferences::setAcceleratedCompositingEnabled
https://bugs.webkit.org/show_bug.cgi?id=201749

Reviewed by Don Olmstead.

WebPreferences::acceleratedCompositingEnabled always returned TRUE
for !USE(CA). It should reflect the pref value set by
setAcceleratedCompositingEnabled.

* WebPreferences.cpp:
(WebPreferences::initializeDefaultSettings): Set kCFBooleanTrue to WebKitAcceleratedCompositingEnabledPreferenceKey even for !USE(CG).
(WebPreferences::acceleratedCompositingEnabled): Return the pref value for !USE(CA).

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

8 months agoWeb Inspector: [Overrides] Command-Z doesn't undo changes after page reload
pecoraro@apple.com [Fri, 13 Sep 2019 08:15:58 +0000 (08:15 +0000)]
Web Inspector: [Overrides] Command-Z doesn't undo changes after page reload
https://bugs.webkit.org/show_bug.cgi?id=201698
<rdar://problem/55276645>

Reviewed by Devin Rousso.

* UserInterface/Views/ContentViewContainer.js:
(WI.ContentViewContainer.prototype.closeAllContentViews):
Provide a filter to opt out of closing some content views.

* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel.prototype._closeContentViewsFilter):
(WI.SourcesNavigationSidebarPanel.prototype._updateMainFrameTreeElement):
Avoid closing ContentViews for local resource overrides. This keeps the
SourceCodeTextEditor around and thus its undo/redo stack.

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

8 months ago[JHBuild] Fix building gst-plugins-good against glibc 2.30
pgriffis@igalia.com [Fri, 13 Sep 2019 08:11:10 +0000 (08:11 +0000)]
[JHBuild] Fix building gst-plugins-good against glibc 2.30
https://bugs.webkit.org/show_bug.cgi?id=201715

Reviewed by Xabier Rodriguez-Calvar.

* gstreamer/patches/gst-plugins-good-glibc-2.30-compat.patch: Added.

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

8 months agoFactor out duplicated functions from HTTPParsers.cpp and HTTPHeaderField.cpp
aperez@igalia.com [Fri, 13 Sep 2019 07:57:55 +0000 (07:57 +0000)]
Factor out duplicated functions from HTTPParsers.cpp and HTTPHeaderField.cpp
https://bugs.webkit.org/show_bug.cgi?id=201721

Reviewed by Don Olmstead.

No new tests needed.

* loader/HTTPHeaderField.cpp: Remove "static" from prototypes of functions needed in HTTPParsers.cpp.
(WebCore::RFC7230::isDelimiter):
(WebCore::RFC7230::isQuotedPairSecondOctet):
(WebCore::RFC7230::isCommentText):
* loader/HTTPHeaderField.h: Add prototypes of functions needed in HTTPParsers.cpp.
* platform/network/HTTPParsers.cpp: Use functionality from WebCore::RFC7230 where possible.
(WebCore::skipWhile): Moved to allow implementing skipWhiteSpace() in terms of skipWhile().
(WebCore::skipWhiteSpace): Implement using skipWhile() and the RFC7230::isWhitespace() predicate.
(WebCore::isValidAcceptHeaderValue): Replace usage of isDelimiterCharacter() with RFC7230::isDelimiter().
(WebCore::isValidHTTPToken): Replace usage of isHTTPTokenCharacter() with RFC7230::isTokenCharacter().
(WebCore::skipQuotedPair): Partially reimplement in terms of RFC7230::isQuotedPairSecondOctet().
(WebCore::skipComment): Replace usage of isCommentTextCharacter() with RFC7230::isCommentText().
(WebCore::skipHTTPToken): Replace usage of isHTTPTokenCharacter() with RFC7230::isTokenCharacter().

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

8 months agoUnreviewed debug build fix for GLib-based ports.
zandobersek@gmail.com [Fri, 13 Sep 2019 06:15:42 +0000 (06:15 +0000)]
Unreviewed debug build fix for GLib-based ports.

* platform/glib/UserAgentGLib.cpp: Add the HTTPParsers.h header
inclusion to bring in the isValidUserAgentHeaderValue() declaration as
required for an assertion check.

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

8 months ago[Win][WK1] Invert Colors inverts a part of the viewport in high DPI
Hironori.Fujii@sony.com [Fri, 13 Sep 2019 02:03:23 +0000 (02:03 +0000)]
[Win][WK1] Invert Colors inverts a part of the viewport in high DPI
https://bugs.webkit.org/show_bug.cgi?id=201719

Reviewed by Don Olmstead.

* WebView.cpp:
(WebView::paintWithDirect2D):
(WebView::paintIntoBackingStore):
Call gc.restore() after inverting the dirty rect.

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

8 months agoUpdate ANGLE
achristensen@apple.com [Fri, 13 Sep 2019 00:59:59 +0000 (00:59 +0000)]
Update ANGLE
https://bugs.webkit.org/show_bug.cgi?id=201156

Patch by James Darpinian <jdarpinian@chromium.org> on 2019-09-12
Reviewed by Alex Christensen.

Update to 2019-9-9, revision 79ad0411911b2fc84834c3705f55707be9e4b498
I merged a bunch of changes to upstream ANGLE, to minimize the changes
necessary when updating ANGLE in WebKit.

* ANGLE.plist: Update commit hashes
* ANGLE.txt: Removed in favor of LICENSE
* ANGLE.xcodeproj/project.pbxproj: Updated with upstream changes
  Also, copy src/commit.h to id/commit.h during build
* CMakeLists.txt: Updated with upstream changes
  Also, copy src/commit.h to id/commit.h during build
* Compiler.cmake: Updated with upstream changes
* GLESv2.cmake: Updated with upstream changes
* adjust-angle-include-paths-rule: Support "" as well as <> for includes
* adjust-angle-include-paths.sh: Support "" as well as <> for includes
* changes.diff: Pared down to just legal disclaimer and warning flag changes
* update-angle.sh: Update ANGLE.plist

* Many other files modified/added/removed upstream

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

8 months agoSVGLengthValue should use two enums for 'type' and 'mode' instead of one unsigned...
commit-queue@webkit.org [Fri, 13 Sep 2019 00:39:54 +0000 (00:39 +0000)]
SVGLengthValue should use two enums for 'type' and 'mode' instead of one unsigned for 'units'
https://bugs.webkit.org/show_bug.cgi?id=201663

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-09-12
Reviewed by Simon Fraser, Nikolas Zimmermann.

SVGLengthValue had one unsigned to store SVGLengthMode and SVGLengthType.
It used to allocate the least significant 4 bits of this unsigned to the
SVGLengthMode while it leaves the rest for SVGLengthType.

This will not be needed if SVGLengthMode and SVGLengthType are made of
size uint_8.

Also in this patch:

-- SVGLengthNegativeValuesMode is made enum class.

-- SVGLengthValue::blend() is moved to SVGLengthValue.cpp so we do not
   need to include SVGLengthContext.h in SVGLengthValue.h.

-- SVGLengthType and SVGLengthMode are moved to SVGLengthValue.h. Instead
   of having SVGLengthValue.h includes SVGLengthConttext.h, the opposite
   will happen.

-- SVGAnimatedPropertyDescription.h is deleted. It should have been deleted
   with the SVG tear off objects removal.

-- SVGPropertyTraits<SVGAngleValue> and SVGPropertyTraits<SVGLengthValue>
   are deleted. They should have been deleted with SVGAnimatedType removal.

-- SVGLengthValue::lengthModeForAnimatedLengthAttribute() is deleted. It
   was only called from SVGPropertyTraits<SVGLengthValue>.

* WebCore.xcodeproj/project.pbxproj:
* css/StyleResolver.h:
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc):
* rendering/style/SVGRenderStyle.h:
(WebCore::SVGRenderStyle::initialBaselineShiftValue):
(WebCore::SVGRenderStyle::initialKerning):
* rendering/svg/RenderSVGEllipse.cpp:
(WebCore::RenderSVGEllipse::calculateRadiiAndCenter):
* rendering/svg/RenderSVGRect.cpp:
(WebCore::RenderSVGRect::updateShapeFromElement):
* rendering/svg/SVGPathData.cpp:
(WebCore::pathFromCircleElement):
(WebCore::pathFromEllipseElement):
(WebCore::pathFromRectElement):
* rendering/svg/SVGTextLayoutEngineBaseline.cpp:
(WebCore::SVGTextLayoutEngineBaseline::calculateBaselineShift const):
* rendering/svg/SVGTextLayoutEngineSpacing.cpp:
(WebCore::SVGTextLayoutEngineSpacing::calculateCSSKerningAndSpacing):
* svg/LinearGradientAttributes.h:
(WebCore::LinearGradientAttributes::LinearGradientAttributes):
* svg/RadialGradientAttributes.h:
(WebCore::RadialGradientAttributes::RadialGradientAttributes):
* svg/SVGAngleValue.h:
(WebCore::SVGPropertyTraits<SVGAngleValue>::initialValue): Deleted.
(WebCore::SVGPropertyTraits<SVGAngleValue>::toString): Deleted.
* svg/SVGCircleElement.cpp:
(WebCore::SVGCircleElement::parseAttribute):
* svg/SVGCircleElement.h:
* svg/SVGCursorElement.cpp:
(WebCore::SVGCursorElement::parseAttribute):
* svg/SVGCursorElement.h:
* svg/SVGEllipseElement.cpp:
(WebCore::SVGEllipseElement::parseAttribute):
* svg/SVGEllipseElement.h:
* svg/SVGFilterElement.cpp:
(WebCore::SVGFilterElement::parseAttribute):
* svg/SVGFilterElement.h:
* svg/SVGFilterPrimitiveStandardAttributes.cpp:
(WebCore::SVGFilterPrimitiveStandardAttributes::parseAttribute):
* svg/SVGFilterPrimitiveStandardAttributes.h:
* svg/SVGForeignObjectElement.cpp:
(WebCore::SVGForeignObjectElement::parseAttribute):
* svg/SVGForeignObjectElement.h:
* svg/SVGImageElement.cpp:
(WebCore::SVGImageElement::parseAttribute):
* svg/SVGImageElement.h:
* svg/SVGLength.h:
(WebCore::SVGLength::unitType const):
(WebCore::SVGLength::setValueForBindings):
(WebCore::SVGLength::newValueSpecifiedUnits):
(WebCore::SVGLength::convertToSpecifiedUnits):
(WebCore::SVGLength::unitType): Deleted.
* svg/SVGLengthContext.cpp:
(WebCore::SVGLengthContext::valueForLength):
(WebCore::SVGLengthContext::convertValueToUserUnits const):
(WebCore::SVGLengthContext::convertValueFromUserUnits const):
(WebCore::SVGLengthContext::convertValueFromUserUnitsToPercentage const):
(WebCore::SVGLengthContext::convertValueFromPercentageToUserUnits const):
* svg/SVGLengthContext.h:
(): Deleted.
* svg/SVGLengthList.h:
(WebCore::SVGLengthList::create):
* svg/SVGLengthValue.cpp:
(WebCore::lengthTypeToString):
(WebCore::parseLengthType):
(WebCore::primitiveTypeToLengthType):
(WebCore::lengthTypeToPrimitiveType):
(WebCore::SVGLengthValue::SVGLengthValue):
(WebCore::SVGLengthValue::construct):
(WebCore::SVGLengthValue::blend):
(WebCore::SVGLengthValue::fromCSSPrimitiveValue):
(WebCore::SVGLengthValue::toCSSPrimitiveValue):
(WebCore::SVGLengthValue::setValueAsString):
(WebCore::SVGLengthValue::valueAsString const):
(WebCore::SVGLengthValue::valueForBindings const):
(WebCore::SVGLengthValue::setValue):
(WebCore::SVGLengthValue::convertToSpecifiedUnits):
(WebCore::storeUnit): Deleted.
(WebCore::extractMode): Deleted.
(WebCore::extractType): Deleted.
(WebCore::SVGLengthValue::operator== const): Deleted.
(WebCore::SVGLengthValue::operator!= const): Deleted.
(WebCore::SVGLengthValue::unitType const): Deleted.
(WebCore::SVGLengthValue::unitMode const): Deleted.
(WebCore::SVGLengthValue::valueAsPercentage const): Deleted.
(WebCore::SVGLengthValue::newValueSpecifiedUnits): Deleted.
(WebCore::SVGLengthValue::lengthModeForAnimatedLengthAttribute): Deleted.
* svg/SVGLengthValue.h:
(WebCore::SVGLengthValue::lengthType const):
(WebCore::SVGLengthValue::lengthMode const):
(WebCore::SVGLengthValue::isZero const):
(WebCore::SVGLengthValue::isRelative const):
(WebCore::SVGLengthValue::valueAsPercentage const):
(WebCore::SVGLengthValue::valueInSpecifiedUnits const):
(WebCore::operator==):
(WebCore::operator!=):
(WebCore::SVGLengthValue::blend const): Deleted.
(WebCore::SVGPropertyTraits<SVGLengthValue>::initialValue): Deleted.
(WebCore::SVGPropertyTraits<SVGLengthValue>::parse): Deleted.
(WebCore::SVGPropertyTraits<SVGLengthValue>::toString): Deleted.
* svg/SVGLineElement.cpp:
(WebCore::SVGLineElement::parseAttribute):
* svg/SVGLineElement.h:
* svg/SVGLinearGradientElement.cpp:
(WebCore::SVGLinearGradientElement::parseAttribute):
* svg/SVGLinearGradientElement.h:
* svg/SVGMarkerElement.cpp:
(WebCore::SVGMarkerElement::parseAttribute):
* svg/SVGMarkerElement.h:
* svg/SVGMaskElement.cpp:
(WebCore::SVGMaskElement::parseAttribute):
* svg/SVGMaskElement.h:
* svg/SVGPatternElement.cpp:
(WebCore::SVGPatternElement::parseAttribute):
* svg/SVGPatternElement.h:
* svg/SVGRadialGradientElement.cpp:
(WebCore::SVGRadialGradientElement::parseAttribute):
* svg/SVGRadialGradientElement.h:
* svg/SVGRectElement.cpp:
(WebCore::SVGRectElement::parseAttribute):
* svg/SVGRectElement.h:
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::parseAttribute):
(WebCore::SVGSVGElement::hasIntrinsicWidth const):
(WebCore::SVGSVGElement::hasIntrinsicHeight const):
(WebCore::SVGSVGElement::intrinsicWidth const):
(WebCore::SVGSVGElement::intrinsicHeight const):
* svg/SVGSVGElement.h:
* svg/SVGTextContentElement.cpp:
(WebCore::SVGTextContentElement::parseAttribute):
(WebCore::SVGTextContentElement::textLengthAnimated):
* svg/SVGTextContentElement.h:
* svg/SVGTextPathElement.cpp:
(WebCore::SVGTextPathElement::parseAttribute):
* svg/SVGTextPathElement.h:
* svg/SVGTextPositioningElement.h:
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::parseAttribute):
* svg/SVGUseElement.h:
* svg/properties/SVGAnimatedPropertyAccessorImpl.h:
* svg/properties/SVGAnimatedPropertyDescription.h: Removed.
* svg/properties/SVGAnimationAdditiveListFunctionImpl.h:
(WebCore::SVGAnimationLengthListFunction::animate):
* svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
(WebCore::SVGAnimationLengthFunction::animate):
* svg/properties/SVGValuePropertyAnimatorImpl.h:
* svg/properties/SVGValuePropertyListAnimatorImpl.h:

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

8 months agoNode.replaceChild()'s pre-replacement validations are not done in the right order
cdumez@apple.com [Fri, 13 Sep 2019 00:01:45 +0000 (00:01 +0000)]
Node.replaceChild()'s pre-replacement validations are not done in the right order
https://bugs.webkit.org/show_bug.cgi?id=201741

Reviewed by Geoffrey Garen.

LayoutTests/imported/w3c:

Rebaseline WPT test now that more checks are passing.

* web-platform-tests/dom/nodes/Node-replaceChild-expected.txt:

Source/WebCore:

Node.replaceChild()'s pre-replacement validations are not done in the right order (spec order):
- https://dom.spec.whatwg.org/#concept-node-replace

In particular, we do not do check 3 (If child’s parent is not parent, then throw a
"NotFoundError" DOMException.) at the right time, because we were making this check
*after* checkPreReplacementValidity(), instead of *during*.

No new tests, rebaselined existing test.

* dom/ContainerNode.cpp:
(WebCore::checkAcceptChild):
(WebCore::ContainerNode::ensurePreInsertionValidity):
(WebCore::checkPreReplacementValidity):
(WebCore::ContainerNode::replaceChild):

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

8 months agoUnreviewed, rolling out r249801.
ryanhaddad@apple.com [Thu, 12 Sep 2019 23:59:32 +0000 (23:59 +0000)]
Unreviewed, rolling out r249801.

Caused two servier worker layout tests to become flaky.

Reverted changeset:

"Use WebProcess processIdentifier to identify Service Worker
connections"
https://bugs.webkit.org/show_bug.cgi?id=201459
https://trac.webkit.org/changeset/249801

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

8 months agoUnreviewed test gardening, rebaseline inspector/model/remote-object.html for WK1...
ryanhaddad@apple.com [Thu, 12 Sep 2019 22:55:38 +0000 (22:55 +0000)]
Unreviewed test gardening, rebaseline inspector/model/remote-object.html for WK1 after r249808.

* platform/mac-wk1/inspector/model/remote-object-expected.txt: Added.

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

8 months agoPass sessionID to WebProcess with other WebProcessDataStoreParameters
cdumez@apple.com [Thu, 12 Sep 2019 22:46:20 +0000 (22:46 +0000)]
Pass sessionID to WebProcess with other WebProcessDataStoreParameters
https://bugs.webkit.org/show_bug.cgi?id=201730

Reviewed by Alex Christensen.

Pass sessionID to WebProcess with other WebProcessDataStoreParameters and store
it on the WebProcess object. In follow-up patches, I will use this sessionID
more and leverage the fact that we have one sessionID per Webprocess to simplify
the WebKit2-layer code.

* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode const):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* Shared/WebProcessDataStoreParameters.h:
(WebKit::WebProcessDataStoreParameters::encode const):
(WebKit::WebProcessDataStoreParameters::decode):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::tryTakePrewarmedProcess):
(WebKit::WebProcessPool::webProcessDataStoreParameters):
(WebKit::WebProcessPool::initializeNewWebProcess):
(WebKit::WebProcessPool::sendWebProcessDataStoreParameters): Deleted.
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::setWebsiteDataStore):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
(WebKit::WebProcess::setWebsiteDataStoreParameters):
* WebProcess/WebProcess.h:
(WebKit::WebProcess::sessionID const):

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

8 months ago[WKTR] Drop TestRunner.setPrivateBrowsingEnabled_DEPRECATED()
cdumez@apple.com [Thu, 12 Sep 2019 22:12:25 +0000 (22:12 +0000)]
[WKTR] Drop TestRunner.setPrivateBrowsingEnabled_DEPRECATED()
https://bugs.webkit.org/show_bug.cgi?id=201546

Reviewed by Alex Christensen.

Drop TestRunner.setPrivateBrowsingEnabled_DEPRECATED() from WebKitTestRunner as it does not do
the right thing for WebKit2 and tests have been rewritten to not use it.

Source/WebCore:

* page/PageGroup.cpp:
(WebCore::PageGroup::addPage):
(WebCore::PageGroup::setSessionIDForTesting): Deleted.
* page/PageGroup.h:
(): Deleted.

Source/WebKit:

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession): Deleted.
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* WebProcess/InjectedBundle/API/c/WKBundle.cpp:
(WKBundleSetPrivateBrowsingEnabled): Deleted.
* WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::setPrivateBrowsingEnabled): Deleted.
* WebProcess/InjectedBundle/InjectedBundle.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::ensureLegacyPrivateBrowsingSessionInNetworkProcess): Deleted.
* WebProcess/WebProcess.h:
* WebProcess/WebStorage/StorageNamespaceImpl.cpp:
(WebKit::StorageNamespaceImpl::setSessionIDForTesting):

Tools:

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setPrivateBrowsingEnabled_DEPRECATED): Deleted.
* WebKitTestRunner/InjectedBundle/TestRunner.h:

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

8 months ago[WHLSL] Slim down WSLMatrix and inline constructors in native code
sbarati@apple.com [Thu, 12 Sep 2019 21:47:25 +0000 (21:47 +0000)]
[WHLSL] Slim down WSLMatrix and inline constructors in native code
https://bugs.webkit.org/show_bug.cgi?id=201568

Reviewed by Robin Morisset.

Before, our WSL Matrix in MSL had templates to figure out how we're
constructing it. For example, with a list of elements, or a list of
columns. However, we can remove this template code since when we're
emitting Metal code, we know exactly how we're constructing the WSL
matrix. So the NativeFunctionWriter now inlines the proper stores
into the WSLMatrix elements.

This patch speeds up Metal compile times in boids by ~4ms (16%) with
a p-value of 0.0001.

Covered by existing tests.

* Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.cpp:
(WebCore::WHLSL::Metal::metalCodePrologue):
* Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
(WebCore::WHLSL::Metal::inlineNativeFunction):

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

8 months agoREGRESSION (iOS 13): Top fixed element on apple.com flickers in size while pinching in
simon.fraser@apple.com [Thu, 12 Sep 2019 20:18:07 +0000 (20:18 +0000)]
REGRESSION (iOS 13): Top fixed element on apple.com flickers in size while pinching in
https://bugs.webkit.org/show_bug.cgi?id=201668
rdar://problem/51934041

Reviewed by Frédéric Wang.

Source/WebCore:

When computing the new layout viewport rect in ScrollingTreeFrameScrollingNode, use
"StickToDocumentBounds" mode, not "StickToViewportBounds", because otherwise we'll compute
a layout viewport that has negative top/left offsets which causes fixed elements to jump outside
the viewport. The only code that should be moving things outside the viewport (a temporary effect
that happens when pinching) is the 'isBelowMinimumScale' path in WebPageProxy::computeCustomFixedPositionRect().

With this change ScrollingTreeFrameScrollingNode no longer needs m_behaviorForFixed; it can be removed later.

Not currently testable, since it involves pinching in past minimum zoom and transients state.

* page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
(WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition const):

Source/WebKit:

The UI process can have transient state that pushes scrolling-tree-managed layers into custom
locations while pinch-zooming. We have to apply this state both when the visible rects
in the UI process change (existing code in -[WKContentView didUpdateVisibleRect:...]) and when
we get new layers from the web process (added in RemoteLayerTreeDrawingAreaProxy::commitLayerTree()
in this patch).

Move some code into WebPageProxy to create functions that we can call from both places.

For manual testing, visit a page with fixed banners, pinch in slightly, then pinch out and,
while keeping your fingers down, move the contents around.

* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::unconstrainedLayoutViewportRect const):
(WebKit::WebPageProxy::adjustLayersForLayoutViewport):

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

8 months agoUnreviewed test gardening, rebaseline inspector/model/remote-object.html after r249808.
ryanhaddad@apple.com [Thu, 12 Sep 2019 20:10:43 +0000 (20:10 +0000)]
Unreviewed test gardening, rebaseline inspector/model/remote-object.html after r249808.

* inspector/model/remote-object-expected.txt:

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

8 months ago[Cocoa] Text indicator for an image link on the front page of apple.com looks wrong
wenson_hsieh@apple.com [Thu, 12 Sep 2019 19:36:00 +0000 (19:36 +0000)]
[Cocoa] Text indicator for an image link on the front page of apple.com looks wrong
https://bugs.webkit.org/show_bug.cgi?id=201724
<rdar://problem/54622894>

Reviewed by Tim Horton.

Source/WebCore:

When computing the bounds of the range (<a>, 0) to (<a>, 1) for a text indicator snapshot where <a> is a link
with a single non-breaking whitespace character, we currently use the text rect of the single space. This leads
to a confusing text indicator, as the resulting snapshot is a tiny blank square in the top left corner of the
link. This problem manifests when starting a drag or showing the system context menu on iOS, or force clicking
or three-finger tapping to show a preview on macOS.

To address this scenario, tweak the heuristic in the case where the text indicator option
TextIndicatorOptionUseBoundingRectAndPaintAllContentForComplexRanges is specified, such that we consider a range
containing only text with whitespaces to be "complex"; additionally, instead of falling back to the range's
bounding rect (which in this case is still tiny), fall back to the common ancestor container's bounding rect,
which encompasses not only the text inside the range but also the element containing the range (in this case,
the anchor element).

Test: fast/text-indicator/text-indicator-empty-link.html

* page/TextIndicator.cpp:
(WebCore::containsOnlyWhiteSpaceText):

Add a helper to determine whether a Range is comprised only of rendered text that only contains whitespace
characters.

(WebCore::initializeIndicator):

See ChangeLog entry above for more detail.

LayoutTests:

Add a new layout test to exercise this scenario.

* fast/text-indicator/text-indicator-empty-link-expected.txt: Added.
* fast/text-indicator/text-indicator-empty-link.html: Added.

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

8 months agoPDF exporting on iOS should include URL rects.
beidson@apple.com [Thu, 12 Sep 2019 16:55:52 +0000 (16:55 +0000)]
PDF exporting on iOS should include URL rects.
<rdar://problem/54900133> and https://bugs.webkit.org/show_bug.cgi?id=201693

Reviewed by Tim Horton.

Source/WebCore:

Turns out that PDF exporting on iOS works fine.

Tracking back through history it was disabled at least pre-2014.

It was almost certainly disabled because it didn't work way back then,
but it works great now.

* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::setURLForRect): Remove the iOS platform exclusion.

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/PDFSnapshot.mm:
(TestWebKitAPI::TEST): Enable on iOS.

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

8 months agoRe-sync dom web-platform-tests from upstream
cdumez@apple.com [Thu, 12 Sep 2019 16:39:02 +0000 (16:39 +0000)]
Re-sync dom web-platform-tests from upstream
https://bugs.webkit.org/show_bug.cgi?id=201697

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Re-sync dom web-platform-tests from upstream ab331d317554a3ba61.

* web-platform-tests/dom/META.yml: Added.
* web-platform-tests/dom/OWNERS: Removed.
* web-platform-tests/dom/abort/w3c-import.log:
* web-platform-tests/dom/collections/HTMLCollection-as-proto-length-get-throws-expected.txt: Removed.
* web-platform-tests/dom/collections/HTMLCollection-as-proto-length-get-throws.html: Removed.
* web-platform-tests/dom/collections/HTMLCollection-as-prototype-expected.txt: Added.
* web-platform-tests/dom/collections/HTMLCollection-as-prototype.html: Added.
* web-platform-tests/dom/collections/HTMLCollection-delete-expected.txt: Added.
* web-platform-tests/dom/collections/HTMLCollection-delete.html: Added.
* web-platform-tests/dom/collections/w3c-import.log:
* web-platform-tests/dom/historical-expected.txt:
* web-platform-tests/dom/historical.html:
* web-platform-tests/dom/idlharness.any.html: Added.
* web-platform-tests/dom/idlharness.any.js: Added.
* web-platform-tests/dom/idlharness.any.worker-expected.txt: Added.
* web-platform-tests/dom/idlharness.any.worker.html: Added.
* web-platform-tests/dom/idlharness.window-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt.
* web-platform-tests/dom/idlharness.window.html: Added.
* web-platform-tests/dom/idlharness.window.js: Added.
* web-platform-tests/dom/interfaces.html: Removed.
* web-platform-tests/dom/lists/DOMTokenList-coverage-for-attributes-expected.txt:
* web-platform-tests/dom/lists/DOMTokenList-coverage-for-attributes.html:
* web-platform-tests/dom/lists/w3c-import.log:
* web-platform-tests/dom/nodes/Comment-Text-constructor.js:
* web-platform-tests/dom/nodes/DOMImplementation-createDocument-expected.txt:
* web-platform-tests/dom/nodes/Document-Element-getElementsByTagName.js:
(test_getElementsByTagName):
* web-platform-tests/dom/nodes/Document-Element-getElementsByTagNameNS.js:
(test_getElementsByTagNameNS):
* web-platform-tests/dom/nodes/Document-URL-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-URL.sub-expected.txt.
* web-platform-tests/dom/nodes/Document-URL.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-URL.sub.html.
* web-platform-tests/dom/nodes/Document-constructor-expected.txt:
* web-platform-tests/dom/nodes/Document-constructor-svg.svg: Removed.
* web-platform-tests/dom/nodes/Document-constructor.html:
* web-platform-tests/dom/nodes/Document-contentType/contentType/w3c-import.log:
* web-platform-tests/dom/nodes/Document-contentType/resources/w3c-import.log:
* web-platform-tests/dom/nodes/Document-contentType/support/w3c-import.log:
* web-platform-tests/dom/nodes/Document-createAttribute-expected.txt:
* web-platform-tests/dom/nodes/Document-createAttribute.html:
* web-platform-tests/dom/nodes/Document-createElement-expected.txt:
* web-platform-tests/dom/nodes/Document-createElement-namespace-tests/w3c-import.log:
* web-platform-tests/dom/nodes/Document-createElement-namespace.html:
* web-platform-tests/dom/nodes/Document-createElement.html:
* web-platform-tests/dom/nodes/Document-createElementNS-expected.txt:
* web-platform-tests/dom/nodes/Document-createElementNS.js:
* web-platform-tests/dom/nodes/Document-createEvent.https-expected.txt: Added.
* web-platform-tests/dom/nodes/Document-createEvent.https.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createEvent.html.
* web-platform-tests/dom/nodes/Document-getElementsByClassName-expected.txt: Added.
* web-platform-tests/dom/nodes/Document-getElementsByClassName.html: Added.
* web-platform-tests/dom/nodes/Document-getElementsByTagName-expected.txt:
* web-platform-tests/dom/nodes/Document-getElementsByTagNameNS-expected.txt:
* web-platform-tests/dom/nodes/Element-getElementsByClassName-expected.txt:
* web-platform-tests/dom/nodes/Element-getElementsByClassName.html:
* web-platform-tests/dom/nodes/Element-getElementsByTagName-expected.txt:
* web-platform-tests/dom/nodes/Element-getElementsByTagNameNS-expected.txt:
* web-platform-tests/dom/nodes/Element-matches-expected.txt:
* web-platform-tests/dom/nodes/Element-webkitMatchesSelector-expected.txt:
* web-platform-tests/dom/nodes/Node-childNodes-expected.txt:
* web-platform-tests/dom/nodes/Node-childNodes.html:
* web-platform-tests/dom/nodes/Node-cloneNode-expected.txt:
* web-platform-tests/dom/nodes/Node-cloneNode.html:
* web-platform-tests/dom/nodes/Node-insertBefore-expected.txt:
* web-platform-tests/dom/nodes/Node-insertBefore.html:
* web-platform-tests/dom/nodes/Node-normalize-expected.txt:
* web-platform-tests/dom/nodes/Node-normalize.html:
* web-platform-tests/dom/nodes/Node-replaceChild-expected.txt:
* web-platform-tests/dom/nodes/Node-replaceChild.html:
* web-platform-tests/dom/nodes/Node-textContent.html:
* web-platform-tests/dom/nodes/ParentNode-children-expected.txt: Added.
* web-platform-tests/dom/nodes/ParentNode-children.html: Added.
* web-platform-tests/dom/nodes/ParentNode-querySelector-All-expected.txt:
* web-platform-tests/dom/nodes/ParentNode-querySelector-All-xht-expected.txt:
* web-platform-tests/dom/nodes/ParentNode-querySelector-All-xht.xht:
* web-platform-tests/dom/nodes/ParentNode-querySelector-All.html:
* web-platform-tests/dom/nodes/aria-element-reflection.tentative-expected.txt: Added.
* web-platform-tests/dom/nodes/aria-element-reflection.tentative.html: Added.
* web-platform-tests/dom/nodes/attributes.html:
* web-platform-tests/dom/nodes/pre-insertion-checks.js: Added.
(getNonParentNodes):
(getNonInsertableNodes):
(getNonDocumentParentNodes):
(test):
* web-platform-tests/dom/nodes/productions.js:
* web-platform-tests/dom/nodes/query-target-in-load-event-expected.txt: Added.
* web-platform-tests/dom/nodes/query-target-in-load-event.html: Added.
* web-platform-tests/dom/nodes/query-target-in-load-event.part.html: Added.
* web-platform-tests/dom/nodes/remove-and-adopt-crash-expected.txt: Added.
* web-platform-tests/dom/nodes/remove-and-adopt-crash.html: Added.
* web-platform-tests/dom/nodes/rootNode-expected.txt:
* web-platform-tests/dom/nodes/rootNode.html:
* web-platform-tests/dom/nodes/selectors.js:
* web-platform-tests/dom/nodes/w3c-import.log:
* web-platform-tests/dom/ranges/Range-intersectsNode-2-expected.txt: Added.
* web-platform-tests/dom/ranges/Range-intersectsNode-2.html: Added.
* web-platform-tests/dom/ranges/w3c-import.log:
* web-platform-tests/dom/w3c-import.log:

LayoutTests:

* TestExpectations:
* platform/mac-wk2/imported/w3c/web-platform-tests/dom/nodes/Node-cloneNode-expected.txt:
* tests-options.json:

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

8 months ago[GTK][WPE] webkit_settings_set_user_agent() allows content forbidden in HTTP headers
aperez@igalia.com [Thu, 12 Sep 2019 15:33:31 +0000 (15:33 +0000)]
[GTK][WPE] webkit_settings_set_user_agent() allows content forbidden in HTTP headers
https://bugs.webkit.org/show_bug.cgi?id=201077

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Add a function to validate whether a string contains a valid value
which can be used in a HTTP User-Agent header.

Covered by new WebCore API test HTTPParsers.ValidateUserAgentValues.

* platform/glib/UserAgentGLib.cpp:
(WebCore::standardUserAgent): Assert that the returned string is a valid User-Agent.
(WebCore::standardUserAgentForURL): Ditto.
* platform/network/HTTPParsers.cpp: Added a series of helper functions which skip over
characters of a string, which can be used to scan over the different elements of an
User-Agent value; all of them receive the position from the input string where to start
scanning, updating it to the position right after the scanned item (this follow the
convention already in use by other functions in the source file). Each of them has
been annotated with the RFC number and section which contains the definition of the
scanned item, and the corresponding BNF rules to make the code easier to follow.
(WebCore::skipWhile): Added.
(WebCore::isVisibleCharacter): Added.
(WebCore::isOctectInFieldContentCharacter): Added.
(WebCore::isCommentTextCharacter): Added.
(WebCore::isHTTPTokenCharacter): Added.
(WebCore::isValidHTTPToken): Refactored to use the new isHTTPTokenCharacter()
helper function instead of having the test inside the loop.
(WebCore::skipCharacter): Added.
(WebCore::skipQuotedPair): Added.
(WebCore::skipComment): Added.
(WebCore::skipHTTPToken): Added.
(WebCore::skipUserAgentProduct): Added.
(WebCore::isValidUserAgentHeaderValue): Added.
* platform/network/HTTPParsers.h: Add prototype for isValidUserAgentHeaderValue().

Source/WebKit:

* UIProcess/API/glib/WebKitSettings.cpp:
(webkit_settings_set_user_agent): Check the passed string using the new
WebCore::isValidUserAgentHeaderValue() function, and return early without
changing the setting if the string is not usable in the User-Agent HTTP
header.

Tools:

* TestWebKitAPI/CMakeLists.txt: Add missing HTTPParsers.cpp to be built into TestWebCore.
* TestWebKitAPI/Tests/WebCore/HTTPParsers.cpp:
(TestWebKitAPI::TEST): Add tests for WebCore::isValidUserAgentHeaderValue().

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

8 months agoREGRESSION? (r249786): inspector/canvas/context-attributes.html is failing on macOS WK1
drousso@apple.com [Thu, 12 Sep 2019 15:09:31 +0000 (15:09 +0000)]
REGRESSION? (r249786): inspector/canvas/context-attributes.html is failing on macOS WK1
https://bugs.webkit.org/show_bug.cgi?id=201714
<rdar://problem/55290473>

Reviewed by Joseph Pecoraro.

* inspector/canvas/context-attributes.html:
* inspector/canvas/context-attributes-expected.txt:

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

8 months agoHarden JSC against the abuse of runtime options.
mark.lam@apple.com [Thu, 12 Sep 2019 15:04:29 +0000 (15:04 +0000)]
Harden JSC against the abuse of runtime options.
https://bugs.webkit.org/show_bug.cgi?id=201597
<rdar://problem/55167068>

Reviewed by Filip Pizlo.

JSTests:

Remove the call to forceGCSlowPaths().  This utility function will be removed.
The modern way to set the required option is to use //@ requireOptions.

* stress/ftl-try-catch-oom-error-lazy-slow-path.js:

Source/JavaScriptCore:

Linux parts contributed by Carlos Garcia Campos <cgarcia@igalia.com>.

1. Introduce a JSC::Config struct that will be protected as ReadOnly once the
   first VM instance is constructed.  The end of the VM constructor calls
   Config::permanentlyFreeze() which will make the Config ReadOnly.

   Note: this is currently only supported for OS(DARWIN) and OS(LINUX).
   OS(WINDOWS) will need to implement some missing pieces before it can enable
   this hardening (see FIXME in JSCConfig.cpp).

   The hardening strategy here is to put immutable global values into the Config.
   Any modifications that need to be made to these values must be done before the
   first VM instance is done instantiating.  This ensures that no script will
   ever run while the Config is still writable.

   Also, the policy for this hardening is that a process is opted in by default.
   If there's a valid need to disable this hardening (e.g. for some test
   environments), the relevant process will need to opt itself out by calling
   Config::configureForTesting().

   The jsc shell, WK2 UI and WebContent processes are opted in by default.
   Only test processes may be opt out.

2. Put all JSC::Options in the Config.  This enforces the invariant that options
   can only be changed before we instantiate a VM.  Once a VM is instantiated,
   the options are immutable.

3. Remove functionForceGCSlowPaths() from the jsc shell.  Setting
   Options::forceGCSlowPaths this way is no longer allowed.

4. Re-factored the Options code (Options.h) into:
   - OptionEntry.h: the data structure that stores the option values.
   - OptionsList.h: the list of options.
   - Options.h: the Options singleton object which is the interface for accessing options.

   Renamed the JSC_OPTIONS macro to FOR_EACH_JSC_OPTION, because
   "FOR_EACH_JSC_OPTION(SET_OPTION_VALUE)" reads a lot better than
   "JSC_OPTIONS(FOR_EACH_OPTION)".

5. Change testapi to call Config::configureForTesting().  Parts of testapi makes
   use of setting options in its tests.  Hence, this hardening is disabled for
   testapi.

   Note: the jsc shell does enable this hardening.

6. Put ExecutableAllocator's immutable globals in the Config.

7. RELEASE_ASSERT that restrictedOptionsEnabled in order to use the
   FunctionOverrides test utility.

8. RELEASE_ASSERT that Options::useDollarVM() is enabled in order to use the $vm.

   We must RELEASE_ASSERT(Options::useDollarVM()) in all JSDollarVM functions
   that are non-trivial at an eye's glance.  This includes (but is not limited to):
       constructors
       create() factory
       createStructure() factory
       finishCreation()
       HOST_CALL or operation functions
       Constructors and methods of utility and test classes

   The only exception are some constexpr constructors used for instantiating
   globals (since these must have trivial constructors) e.g. DOMJITAttribute.
   Instead, these constructors should always be ALWAYS_INLINE.

* API/glib/JSCOptions.cpp:
(jscOptionsSetValue):
(jscOptionsGetValue):
(jsc_options_foreach):
(jsc_options_get_option_group):
* API/tests/testapi.c:
(main):
* API/tests/testapi.cpp:
(configureJSCForTesting):
* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* jit/ExecutableAllocator.cpp:
(JSC::isJITEnabled):
(JSC::ExecutableAllocator::setJITEnabled):
(JSC::ExecutableAllocator::initializeUnderlyingAllocator):
(JSC::ExecutableAllocator::isValid const):
(JSC::ExecutableAllocator::underMemoryPressure):
(JSC::ExecutableAllocator::memoryPressureMultiplier):
(JSC::ExecutableAllocator::allocate):
(JSC::ExecutableAllocator::isValidExecutableMemory):
(JSC::ExecutableAllocator::getLock const):
(JSC::ExecutableAllocator::committedByteCount):
(JSC::ExecutableAllocator::dumpProfile):
(JSC::startOfFixedExecutableMemoryPoolImpl):
(JSC::endOfFixedExecutableMemoryPoolImpl):
(JSC::isJITPC):
(JSC::dumpJITMemory):
(JSC::ExecutableAllocator::initialize):
(JSC::ExecutableAllocator::singleton):
* jit/ExecutableAllocator.h:
(JSC::performJITMemcpy):
* jsc.cpp:
(GlobalObject::finishCreation):
(functionJSCOptions):
(jscmain):
(functionForceGCSlowPaths): Deleted.
* runtime/ConfigFile.cpp:
(JSC::ConfigFile::parse):
* runtime/InitializeThreading.cpp:
(JSC::initializeThreading):
* runtime/JSCConfig.cpp: Added.
(JSC::Config::disableFreezingForTesting):
(JSC::Config::enableRestrictedOptions):
(JSC::Config::permanentlyFreeze):
* runtime/JSCConfig.h: Added.
(JSC::Config::configureForTesting):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::exposeDollarVM):
* runtime/OptionEntry.h: Added.
(JSC::OptionRange::operator= ):
(JSC::OptionRange::rangeString const):
* runtime/Options.cpp:
(JSC::Options::isAvailable):
(JSC::scaleJITPolicy):
(JSC::Options::initialize):
(JSC::Options::setOptions):
(JSC::Options::setOptionWithoutAlias):
(JSC::Options::setAliasedOption):
(JSC::Option::dump const):
(JSC::Option::operator== const):
(): Deleted.
(JSC::Options::enableRestrictedOptions): Deleted.
* runtime/Options.h:
(JSC::Option::Option):
(JSC::Option::defaultOption const):
(JSC::Option::boolVal):
(JSC::Option::unsignedVal):
(JSC::Option::doubleVal):
(JSC::Option::int32Val):
(JSC::Option::optionRangeVal):
(JSC::Option::optionStringVal):
(JSC::Option::gcLogLevelVal):
(JSC::OptionRange::operator= ): Deleted.
(JSC::OptionRange::rangeString const): Deleted.
* runtime/OptionsList.h: Added.
(JSC::countNumberOfJSCOptions):
* runtime/VM.cpp:
(JSC::VM::VM):
* tools/FunctionOverrides.cpp:
(JSC::FunctionOverrides::FunctionOverrides):
(JSC::FunctionOverrides::reinstallOverrides):
(JSC::FunctionOverrides::initializeOverrideFor):
(JSC::FunctionOverrides::parseOverridesInFile):
* tools/JSDollarVM.cpp:
(JSC::JSDollarVMCallFrame::JSDollarVMCallFrame):
(JSC::JSDollarVMCallFrame::createStructure):
(JSC::JSDollarVMCallFrame::create):
(JSC::JSDollarVMCallFrame::finishCreation):
(JSC::JSDollarVMCallFrame::addProperty):
(JSC::Element::Element):
(JSC::Element::create):
(JSC::Element::createStructure):
(JSC::Root::Root):
(JSC::Root::create):
(JSC::Root::createStructure):
(JSC::SimpleObject::SimpleObject):
(JSC::SimpleObject::create):
(JSC::SimpleObject::createStructure):
(JSC::ImpureGetter::ImpureGetter):
(JSC::ImpureGetter::createStructure):
(JSC::ImpureGetter::create):
(JSC::ImpureGetter::finishCreation):
(JSC::ImpureGetter::getOwnPropertySlot):
(JSC::CustomGetter::CustomGetter):
(JSC::CustomGetter::createStructure):
(JSC::CustomGetter::create):
(JSC::CustomGetter::getOwnPropertySlot):
(JSC::CustomGetter::customGetter):
(JSC::CustomGetter::customGetterAcessor):
(JSC::RuntimeArray::create):
(JSC::RuntimeArray::destroy):
(JSC::RuntimeArray::getOwnPropertySlot):
(JSC::RuntimeArray::getOwnPropertySlotByIndex):
(JSC::RuntimeArray::createPrototype):
(JSC::RuntimeArray::createStructure):
(JSC::RuntimeArray::finishCreation):
(JSC::RuntimeArray::RuntimeArray):
(JSC::RuntimeArray::lengthGetter):
(JSC::DOMJITNode::DOMJITNode):
(JSC::DOMJITNode::createStructure):
(JSC::DOMJITNode::checkSubClassSnippet):
(JSC::DOMJITNode::create):
(JSC::DOMJITGetter::DOMJITGetter):
(JSC::DOMJITGetter::createStructure):
(JSC::DOMJITGetter::create):
(JSC::DOMJITGetter::DOMJITAttribute::DOMJITAttribute):
(JSC::DOMJITGetter::DOMJITAttribute::slowCall):
(JSC::DOMJITGetter::DOMJITAttribute::callDOMGetter):
(JSC::DOMJITGetter::customGetter):
(JSC::DOMJITGetter::finishCreation):
(JSC::DOMJITGetterComplex::DOMJITGetterComplex):
(JSC::DOMJITGetterComplex::createStructure):
(JSC::DOMJITGetterComplex::create):
(JSC::DOMJITGetterComplex::DOMJITAttribute::DOMJITAttribute):
(JSC::DOMJITGetterComplex::DOMJITAttribute::slowCall):
(JSC::DOMJITGetterComplex::DOMJITAttribute::callDOMGetter):
(JSC::DOMJITGetterComplex::functionEnableException):
(JSC::DOMJITGetterComplex::customGetter):
(JSC::DOMJITGetterComplex::finishCreation):
(JSC::DOMJITFunctionObject::DOMJITFunctionObject):
(JSC::DOMJITFunctionObject::createStructure):
(JSC::DOMJITFunctionObject::create):
(JSC::DOMJITFunctionObject::functionWithTypeCheck):
(JSC::DOMJITFunctionObject::functionWithoutTypeCheck):
(JSC::DOMJITFunctionObject::checkSubClassSnippet):
(JSC::DOMJITFunctionObject::finishCreation):
(JSC::DOMJITCheckSubClassObject::DOMJITCheckSubClassObject):
(JSC::DOMJITCheckSubClassObject::createStructure):
(JSC::DOMJITCheckSubClassObject::create):
(JSC::DOMJITCheckSubClassObject::functionWithTypeCheck):
(JSC::DOMJITCheckSubClassObject::functionWithoutTypeCheck):
(JSC::DOMJITCheckSubClassObject::finishCreation):
(JSC::DOMJITGetterBaseJSObject::DOMJITGetterBaseJSObject):
(JSC::DOMJITGetterBaseJSObject::createStructure):
(JSC::DOMJITGetterBaseJSObject::create):
(JSC::DOMJITGetterBaseJSObject::DOMJITAttribute::DOMJITAttribute):
(JSC::DOMJITGetterBaseJSObject::DOMJITAttribute::slowCall):
(JSC::DOMJITGetterBaseJSObject::DOMJITAttribute::callDOMGetter):
(JSC::DOMJITGetterBaseJSObject::customGetter):
(JSC::DOMJITGetterBaseJSObject::finishCreation):
(JSC::JSTestCustomGetterSetter::JSTestCustomGetterSetter):
(JSC::JSTestCustomGetterSetter::create):
(JSC::JSTestCustomGetterSetter::createStructure):
(JSC::customSetAccessor):
(JSC::customSetValue):
(JSC::JSTestCustomGetterSetter::finishCreation):
(JSC::Element::handleOwner):
(JSC::Element::finishCreation):
(JSC::WasmStreamingParser::WasmStreamingParser):
(JSC::WasmStreamingParser::create):
(JSC::WasmStreamingParser::createStructure):
(JSC::WasmStreamingParser::finishCreation):
(JSC::functionWasmStreamingParserAddBytes):
(JSC::functionWasmStreamingParserFinalize):
(JSC::functionCrash):
(JSC::functionBreakpoint):
(JSC::functionDFGTrue):
(JSC::functionFTLTrue):
(JSC::functionCpuMfence):
(JSC::functionCpuRdtsc):
(JSC::functionCpuCpuid):
(JSC::functionCpuPause):
(JSC::functionCpuClflush):
(JSC::CallerFrameJITTypeFunctor::CallerFrameJITTypeFunctor):
(JSC::getExecutableForFunction):
(JSC::functionLLintTrue):
(JSC::functionJITTrue):
(JSC::functionNoInline):
(JSC::functionGC):
(JSC::functionEdenGC):
(JSC::functionDumpSubspaceHashes):
(JSC::functionCallFrame):
(JSC::functionCodeBlockForFrame):
(JSC::codeBlockFromArg):
(JSC::functionCodeBlockFor):
(JSC::functionDumpSourceFor):
(JSC::functionDumpBytecodeFor):
(JSC::doPrint):
(JSC::functionDataLog):
(JSC::functionPrint):
(JSC::functionDumpCallFrame):
(JSC::functionDumpStack):
(JSC::functionDumpRegisters):
(JSC::functionDumpCell):
(JSC::functionIndexingMode):
(JSC::functionInlineCapacity):
(JSC::functionValue):
(JSC::functionGetPID):
(JSC::functionHaveABadTime):
(JSC::functionIsHavingABadTime):
(JSC::functionCreateGlobalObject):
(JSC::functionCreateProxy):
(JSC::functionCreateRuntimeArray):
(JSC::functionCreateNullRopeString):
(JSC::functionCreateImpureGetter):
(JSC::functionCreateCustomGetterObject):
(JSC::functionCreateDOMJITNodeObject):
(JSC::functionCreateDOMJITGetterObject):
(JSC::functionCreateDOMJITGetterComplexObject):
(JSC::functionCreateDOMJITFunctionObject):
(JSC::functionCreateDOMJITCheckSubClassObject):
(JSC::functionCreateDOMJITGetterBaseJSObject):
(JSC::functionCreateWasmStreamingParser):
(JSC::functionSetImpureGetterDelegate):
(JSC::functionCreateBuiltin):
(JSC::functionGetPrivateProperty):
(JSC::functionCreateRoot):
(JSC::functionCreateElement):
(JSC::functionGetElement):
(JSC::functionCreateSimpleObject):
(JSC::functionGetHiddenValue):
(JSC::functionSetHiddenValue):
(JSC::functionShadowChickenFunctionsOnStack):
(JSC::functionSetGlobalConstRedeclarationShouldNotThrow):
(JSC::functionFindTypeForExpression):
(JSC::functionReturnTypeFor):
(JSC::functionFlattenDictionaryObject):
(JSC::functionDumpBasicBlockExecutionRanges):
(JSC::functionHasBasicBlockExecuted):
(JSC::functionBasicBlockExecutionCount):
(JSC::functionEnableExceptionFuzz):
(JSC::changeDebuggerModeWhenIdle):
(JSC::functionEnableDebuggerModeWhenIdle):
(JSC::functionDisableDebuggerModeWhenIdle):
(JSC::functionDeleteAllCodeWhenIdle):
(JSC::functionGlobalObjectCount):
(JSC::functionGlobalObjectForObject):
(JSC::functionGetGetterSetter):
(JSC::functionLoadGetterFromGetterSetter):
(JSC::functionCreateCustomTestGetterSetter):
(JSC::functionDeltaBetweenButterflies):
(JSC::functionTotalGCTime):
(JSC::functionParseCount):
(JSC::functionIsWasmSupported):
(JSC::JSDollarVM::finishCreation):
(JSC::JSDollarVM::addFunction):
(JSC::JSDollarVM::addConstructibleFunction):
* tools/JSDollarVM.h:

Source/WebCore:

No new tests.  Covered by existing tests.

Enable Options::useDollarVM before we tell the JSGlobalObject to exposeDollarVM().
The $vm utility is now hardened to require that Options::useDollarVM be
enabled in order for it to be used.

* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::injectInternalsObject):

Source/WebKit:

Linux parts contributed by Carlos Garcia Campos <cgarcia@igalia.com>.

1. Add plumbing to allow WK2 tests to configureJSCForTesting().
2. Removed the call enable Options::useBigInt in WebInspectorUI.
   WebInspectorUI doesn't really need it for now.

* PluginProcess/unix/PluginProcessMainUnix.cpp:
* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h:
(WebKit::XPCServiceInitializer):
* Shared/unix/AuxiliaryProcessMain.cpp:
(WebKit::AuxiliaryProcessMainBase::parseCommandLine):
* Shared/unix/AuxiliaryProcessMain.h:
(WebKit::AuxiliaryProcessMain):
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/C/WKContextConfigurationRef.cpp:
(WKContextConfigurationSetShouldConfigureJSCForTesting):
* UIProcess/API/C/WKContextConfigurationRef.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration configureJSCForTesting]):
(-[_WKProcessPoolConfiguration setConfigureJSCForTesting:]):
* UIProcess/Launcher/ProcessLauncher.h:
(WebKit::ProcessLauncher::Client::shouldConfigureJSCForTesting const):
* UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::shouldConfigureJSCForTesting const):
* UIProcess/WebProcessProxy.h:
* WebProcess/WebPage/WebInspectorUI.cpp:
(WebKit::WebInspectorUI::WebInspectorUI):

Source/WTF:

Add a source file that was missing so that Xcode can search its contents too.

* WTF.xcodeproj/project.pbxproj:

Tools:

Linux parts contributed by Carlos Garcia Campos <cgarcia@igalia.com>.
Windows parts contributed by Fujii Hironori <Hironori.Fujii@sony.com>.

Call JSC::Config::configureForTesting() in test harnesses or at the top of tests
to disable the hardening on test runs.  Tests rely on setting options to enable
test features.

* DumpRenderTree/mac/DumpRenderTree.mm:
(dumpRenderTree):
* DumpRenderTree/win/DumpRenderTree.cpp:
(initialize):
* TestWebKitAPI/PlatformUtilities.cpp:
(TestWebKitAPI::Util::createContextWithInjectedBundle):
* TestWebKitAPI/Tests/JavaScriptCore/glib/TestJSC.cpp:
(main):
* TestWebKitAPI/Tests/WebKitCocoa/ApplePay.mm:
(TestWebKitAPI::TEST):
(TestWebKitAPI::runActiveSessionTest):
* TestWebKitAPI/Tests/WebKitCocoa/WKWebViewDiagnosticLogging.mm:
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm:
(TEST):
* TestWebKitAPI/Tests/mac/MediaPlaybackSleepAssertion.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/WKWebViewConfigurationExtras.h:
* TestWebKitAPI/WKWebViewConfigurationExtras.mm:
(+[WKWebViewConfiguration _test_configurationWithTestPlugInClassName:]):
(+[WKWebViewConfiguration _test_configurationWithTestPlugInClassName:configureJSCForTesting:]):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::generateContextConfiguration const):

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

8 months agoFix PDFKit references in TestWebKitAPI
krollin@apple.com [Thu, 12 Sep 2019 14:13:28 +0000 (14:13 +0000)]
Fix PDFKit references in TestWebKitAPI
https://bugs.webkit.org/show_bug.cgi?id=201700
<rdar://problem/55279539>

Reviewed by Youenn Fablet.

These references fail in watchOS and tvOS, so remove them on those
platforms.

* TestWebKitAPI/Configurations/TestWebKitAPI.xcconfig:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/PDFSnapshot.mm:
* TestWebKitAPI/cocoa/TestPDFDocument.h:
* TestWebKitAPI/cocoa/TestPDFDocument.mm:
* TestWebKitAPI/config.h:

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

8 months agoFix accidental copies in NetworkLoadChecker.cpp
mcatanzaro@igalia.com [Thu, 12 Sep 2019 13:52:59 +0000 (13:52 +0000)]
Fix accidental copies in NetworkLoadChecker.cpp
https://bugs.webkit.org/show_bug.cgi?id=199528

Reviewed by Youenn Fablet.

Coverity noticed that we are copying a ResourceRequest and a ContentExtensionResultOrError
in NetworkLoadChecker::checkRequest by mistake, when the intent was to move them as rvalue
references.

* NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::checkRequest):
* NetworkProcess/NetworkLoadChecker.h:

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

8 months agoWeb Inspector: Crashes when intercept response continues with original content
pecoraro@apple.com [Thu, 12 Sep 2019 10:59:09 +0000 (10:59 +0000)]
Web Inspector: Crashes when intercept response continues with original content
https://bugs.webkit.org/show_bug.cgi?id=201707
<rdar://problem/55261857>

Reviewed by David Kilzer.

* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::didReceiveData):
Copy the data for the callback since the deferral may run it much later.

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

8 months agoLayout Test http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-invalidstaterro...
commit-queue@webkit.org [Thu, 12 Sep 2019 10:53:59 +0000 (10:53 +0000)]
Layout Test http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-invalidstaterror.html is flaky.
https://bugs.webkit.org/show_bug.cgi?id=199075

Patch by Russell Epstein <repstein@apple.com> on 2019-09-12
Reviewed by Youenn Fablet.

Currently, this test includes js-test.js twice, which is causing the test to be flaky.

* http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-invalidstaterror.html: Removed second instance.

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

8 months agoUse typed identifiers for IDB connection identifiers
youenn@apple.com [Thu, 12 Sep 2019 08:47:31 +0000 (08:47 +0000)]
Use typed identifiers for IDB connection identifiers
https://bugs.webkit.org/show_bug.cgi?id=201682

Reviewed by Chris Dumez.

Source/WebCore:

Migrate from uint64_t to a typed identifier for IDB connection identifiers.
The identifier is reusing the process identifier type.
No change of behavior.

* Modules/indexeddb/client/IDBConnectionProxy.h:
(WebCore::IDBClient::IDBConnectionProxy::serverConnectionIdentifier const):
* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::identifier const):
* Modules/indexeddb/client/IDBConnectionToServer.h:
* Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
* Modules/indexeddb/server/IDBConnectionToClient.cpp:
(WebCore::IDBServer::IDBConnectionToClient::identifier const):
* Modules/indexeddb/server/IDBConnectionToClient.h:
* Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::getAllDatabaseNames):
(WebCore::IDBServer::IDBServer::performGetAllDatabaseNames):
(WebCore::IDBServer::IDBServer::didGetAllDatabaseNames):
* Modules/indexeddb/server/IDBServer.h:
* Modules/indexeddb/shared/IDBRequestData.cpp:
(WebCore::IDBRequestData::serverConnectionIdentifier const):
* Modules/indexeddb/shared/IDBRequestData.h:
* Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
(WebCore::IDBResourceIdentifier::IDBResourceIdentifier):
(WebCore::IDBResourceIdentifier::emptyValue):
(WebCore::IDBResourceIdentifier::deletedValue):
(WebCore::IDBResourceIdentifier::isHashTableDeletedValue const):
(WebCore::IDBResourceIdentifier::loggingString const):
* Modules/indexeddb/shared/IDBResourceIdentifier.h:
(WebCore::IDBResourceIdentifier::hash const):
(WebCore::IDBResourceIdentifier::connectionIdentifier const):
(WTF::crossThreadCopy):
* Modules/indexeddb/shared/InProcessIDBServer.cpp:
(WebCore::InProcessIDBServer::identifier const):
* Modules/indexeddb/shared/InProcessIDBServer.h:

Source/WebKit:

Remove no longer needed conversion from process identifier to idb connection identifier.

* NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::identifier const):
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:

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

8 months ago[GTK] Allow CacheStore::destroyEngine to destroy default engine for soup.
cturner@igalia.com [Thu, 12 Sep 2019 08:44:09 +0000 (08:44 +0000)]
[GTK] Allow CacheStore::destroyEngine to destroy default engine for soup.
https://bugs.webkit.org/show_bug.cgi?id=201690

Reviewed by Carlos Garcia Campos.

* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::destroyEngine): As we do for
NetworkProcess::destroySession, also allow destroying the engine
for the default session for the same reason.

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

8 months agoUse WebProcess processIdentifier to identify Service Worker connections
youenn@apple.com [Thu, 12 Sep 2019 08:18:15 +0000 (08:18 +0000)]
Use WebProcess processIdentifier to identify Service Worker connections
https://bugs.webkit.org/show_bug.cgi?id=201459

Reviewed by Chris Dumez.

Source/WebCore:

No observable change of behavior.

* workers/service/ServiceWorkerClient.cpp:
(WebCore::ServiceWorkerClient::postMessage):
Pass sessionID to ease NetworkProcess selection of the client process connection.
* workers/service/ServiceWorkerTypes.h:
Mark server connection identifier be process identifier based.
* workers/service/context/SWContextManager.h:
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::Connection::Connection):
* workers/service/server/SWServer.h:
Let connection identifier be set in constructor instead of generated.

Source/WebCore/PAL:

* pal/SessionID.h:
(PAL::SessionID::SessionID):

Source/WebKit:

Make WebSWServerConnection be stored in NetworkConnectionToWebProcess.
They are now keyed by session IDs hence why WebSWClientConnection is using the session ID as message connection ID.
Creation no longer requires a sync IPC since the connection is uniquely identified by its session ID and its process ID.
These IDs are stable over network process crash.
Within NetworkProcess, a server connection is managed by a SWServer which is session ID specific.
In that case, the process identifier uniquely identifies the connection.

Move WebSWServerToContextConnection be owned by NetworkConnectionToWebProcess.
Instead of creating it when webprocess is connecting to network process, use a dedicated IPC message.
This is similar to WebSWServerConnection once WebProcess asks to create it.
This will allow existing WebProcess, in cache or running pages, to run service workers as well.
A context connection map is kept in Network Process to reuse context connections since these connections are not sessionID specific.

Migrate from a single boolean to a HashSet to track whether some connections are in the process of being created.
Previously if two requests to create connections were done shortly one after the other on different registrable
domains, the second request would not be processed.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
(WebKit::NetworkConnectionToWebProcess::didReceiveSyncMessage):
(WebKit::NetworkConnectionToWebProcess::didClose):
(WebKit::NetworkConnectionToWebProcess::establishSWServerConnection):
(WebKit::NetworkConnectionToWebProcess::establishSWContextConnection):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::didReceiveMessage):
(WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
(WebKit::NetworkProcess::forEachSWServer):
(WebKit::NetworkProcess::needsServerToContextConnectionForRegistrableDomain const):
(WebKit::NetworkProcess::createServerToContextConnection):
(WebKit::NetworkProcess::postMessageToServiceWorkerClient):
(WebKit::NetworkProcess::registerSWServerConnection):
(WebKit::NetworkProcess::unregisterSWServerConnection):
(WebKit::NetworkProcess::registerSWContextConnection):
(WebKit::NetworkProcess::unregisterSWContextConnection):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::WebSWServerConnection):
(WebKit::WebSWServerConnection::postMessageToServiceWorkerClient):
* NetworkProcess/ServiceWorker/WebSWServerConnection.h:
* NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
(WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
(WebKit::WebSWServerToContextConnection::~WebSWServerToContextConnection):
(WebKit::WebSWServerToContextConnection::postMessageToServiceWorkerClient):
(WebKit::WebSWServerToContextConnection::connectionMayNoLongerBeNeeded):
* NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
* NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::openNetworkProcessConnection):
(WebKit::NetworkProcessProxy::establishWorkerContextConnectionToNetworkProcess):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::establishServiceWorkerContext):
* UIProcess/WebProcessProxy.h:
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::didReceiveMessage):
(WebKit::NetworkProcessConnection::didClose):
(WebKit::NetworkProcessConnection::serviceWorkerConnectionForSession):
* WebProcess/Network/NetworkProcessConnection.h:
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::WebSWClientConnection):
(WebKit::WebSWClientConnection::~WebSWClientConnection):
(WebKit::WebSWClientConnection::messageSenderConnection const):
(WebKit::WebSWClientConnection::scheduleJobInServer):
(WebKit::WebSWClientConnection::finishFetchingScriptInServer):
(WebKit::WebSWClientConnection::addServiceWorkerRegistrationInServer):
(WebKit::WebSWClientConnection::removeServiceWorkerRegistrationInServer):
(WebKit::WebSWClientConnection::postMessageToServiceWorker):
(WebKit::WebSWClientConnection::registerServiceWorkerClient):
(WebKit::WebSWClientConnection::unregisterServiceWorkerClient):
(WebKit::WebSWClientConnection::didResolveRegistrationPromise):
(WebKit::WebSWClientConnection::matchRegistration):
(WebKit::WebSWClientConnection::runOrDelayTaskForImport):
(WebKit::WebSWClientConnection::whenRegistrationReady):
(WebKit::WebSWClientConnection::getRegistrations):
(WebKit::WebSWClientConnection::startFetch):
(WebKit::WebSWClientConnection::cancelFetch):
(WebKit::WebSWClientConnection::continueDidReceiveFetchResponse):
(WebKit::WebSWClientConnection::connectionToServerLost):
(WebKit::WebSWClientConnection::clear):
(WebKit::WebSWClientConnection::syncTerminateWorker):
(WebKit::WebSWClientConnection::updateThrottleState):
(WebKit::WebSWClientConnection::storeRegistrationsOnDiskForTesting):
* WebProcess/Storage/WebSWClientConnection.h:
* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::WebSWContextManagerConnection):
(WebKit::m_userAgent):
(WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient):
* WebProcess/Storage/WebSWContextManagerConnection.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::establishWorkerContextConnectionToNetworkProcess):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

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

8 months agoUncaught Exception: TypeError: null is not an object (evaluating 'selectedTreeElement...
pecoraro@apple.com [Thu, 12 Sep 2019 07:50:18 +0000 (07:50 +0000)]
Uncaught Exception: TypeError: null is not an object (evaluating 'selectedTreeElement.representedObject')
https://bugs.webkit.org/show_bug.cgi?id=201716
<rdar://problem/55292615>

Reviewed by Devin Rousso.

* UserInterface/Views/DebuggerSidebarPanel.js:
(WI.DebuggerSidebarPanel.prototype._handleBreakpointElementAddedOrRemoved):
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel.prototype._handleBreakpointElementAddedOrRemoved):
If a breakpoint was removed without a selection in the breakpoint tree outline
then there may be no selected tree element.

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

8 months agoWeb Inspector: REGRESSION: Inspector Timeline always starts at about 500ms mark on...
joepeck@webkit.org [Thu, 12 Sep 2019 06:55:26 +0000 (06:55 +0000)]
Web Inspector: REGRESSION: Inspector Timeline always starts at about 500ms mark on a reload
https://bugs.webkit.org/show_bug.cgi?id=200637
<rdar://problem/54218967>

Reviewed by Devin Rousso.

The Timeline was getting a startTime value from before the user started
the timeline recording because of artificial adjustments that were made
to CPUTimelineRecords. Ignore adjusted values when updating the Timeline's
start and end times.

* UserInterface/Models/Timeline.js:
(WI.Timeline.prototype._updateTimesIfNeeded):
Use unadjusted times, which should fall in the user started / stopped
timeline range.

* UserInterface/Models/TimelineRecord.js:
(WI.TimelineRecord.prototype.get unadjustedStartTime):
(WI.TimelineRecord.prototype.get unadjustedEndTime):
Default implementation uses startTime/endTime.

* UserInterface/Models/CPUTimelineRecord.js:
(WI.CPUTimelineRecord.prototype.get unadjustedStartTime):
* UserInterface/Models/MemoryTimelineRecord.js:
(WI.MemoryTimelineRecord.prototype.get unadjustedStartTime):
Each of these adjusted their startTime.

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

8 months agoSource/ThirdParty/libwebrtc:
youenn@apple.com [Thu, 12 Sep 2019 06:51:46 +0000 (06:51 +0000)]
Source/ThirdParty/libwebrtc:
Disable DTLS1.0
https://bugs.webkit.org/show_bug.cgi?id=201679

Reviewed by Alex Christensen.

* Source/webrtc/rtc_base/opensslstreamadapter.cc:
Set minimum version to DTLS1.2 when DTLS1.2 is supported.
This makes sure any client will never downgrade to DTLS1.0.

Source/WebCore:
Disable DTLS1.0
https://bugs.webkit.org/show_bug.cgi?id=201679

Reviewed by Alex Christensen.

Add an option to force to use DTLS1.0 and nothing else.
Add internals API to enter in that mode to verify that normal configurations cannot communicate with DTLS1.0.

Test: webrtc/datachannel/dtls10.html

* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
(WebCore::LibWebRTCProvider::setEnableWebRTCEncryption):
(WebCore::LibWebRTCProvider::setUseDTLS10):
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:
* testing/Internals.cpp:
(WebCore::Internals::setUseDTLS10):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:
Disable DTLS10
https://bugs.webkit.org/show_bug.cgi?id=201679

Reviewed by Alex Christensen.

* webrtc/datachannel/dtls10-expected.txt: Added.
* webrtc/datachannel/dtls10.html: Added.

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

8 months agoWeb Inspector: REGRESSION: CPU: Overlay Markers for Thread views are off by 500ms
pecoraro@apple.com [Thu, 12 Sep 2019 06:04:09 +0000 (06:04 +0000)]
Web Inspector: REGRESSION: CPU: Overlay Markers for Thread views are off by 500ms
https://bugs.webkit.org/show_bug.cgi?id=201709
<rdar://problem/55289279>

Reviewed by Devin Rousso.

* UserInterface/Views/CPUTimelineView.js:
(WI.CPUTimelineView.prototype.layout):
Use the CPUTimelineRecord's timestamp (same as the record's endTime) as the
point when the CPU sample is taken. This aligns with the rest of the UI that
assumes that the 500ms before the sample point leads up to the sample value.

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

8 months agoWeb Inspector: Do not show override actions unless Sources tab is enabled
pecoraro@apple.com [Thu, 12 Sep 2019 05:47:26 +0000 (05:47 +0000)]
Web Inspector: Do not show override actions unless Sources tab is enabled
https://bugs.webkit.org/show_bug.cgi?id=201708

Reviewed by Devin Rousso.

* UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager.supportsLocalResourceOverrides):

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

8 months agoLog timeoutValue passed on to CFNetwork
krollin@apple.com [Thu, 12 Sep 2019 05:40:12 +0000 (05:40 +0000)]
Log timeoutValue passed on to CFNetwork
https://bugs.webkit.org/show_bug.cgi?id=201701
<rdar://problem/55279683>

Reviewed by Chris Dumez.

Source/WebCore:

Export ResourceRequest::timeoutValue for use in WebKit.

No new tests -- no new or changed functionality.

* platform/network/ResourceRequestBase.h:

Source/WebKit:

We occasionally see cases where resource-loads into CFNetwork take a
long time. Rather than timing out after the default of 60s, they stay
pending for many minutes. To better understand why this is happening,
log the timeoutValue we pass to CFNetwork when loading resources.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::startNetworkLoad):

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

8 months ago[WHLSL] Remove null from the standard library
sbarati@apple.com [Thu, 12 Sep 2019 05:29:01 +0000 (05:29 +0000)]
[WHLSL] Remove null from the standard library
https://bugs.webkit.org/show_bug.cgi?id=201672

Reviewed by Robin Morisset.

I meant to remove `null` from the standard library in r249351, but
I had omitted the code I wrote to do that when I rebased that patch.
This patch removes it and ensures all tests pass when parsing the entire
standard library.

* Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt:

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

8 months agoUnreviewed, rolling out r249791.
ryanhaddad@apple.com [Thu, 12 Sep 2019 05:06:34 +0000 (05:06 +0000)]
Unreviewed, rolling out r249791.

Breaks internal production builds.

Reverted changeset:

"Update ANGLE"
https://bugs.webkit.org/show_bug.cgi?id=201156
https://trac.webkit.org/changeset/249791

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

8 months agoUse same parser for <meta http-equiv="refresh"> and `Refresh` HTTP header
cdumez@apple.com [Thu, 12 Sep 2019 04:32:29 +0000 (04:32 +0000)]
Use same parser for <meta http-equiv="refresh"> and `Refresh` HTTP header
https://bugs.webkit.org/show_bug.cgi?id=201694

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Rebaseline WPT test now that it is passing.

* web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/parsing-expected.txt:

Source/WebCore:

Use same parser for <meta http-equiv="refresh"> and `Refresh` HTTP header. This aligns
our behavior with Blink and makes us more compliant on web-platform-tests. This also
simplifies our code.

No new tests, rebaselined existing test.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::receivedFirstData):
* platform/network/HTTPParsers.cpp:
(WebCore::parseHTTPRefresh): Deleted.
* platform/network/HTTPParsers.h:

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

8 months agoUpdate ANGLE
achristensen@apple.com [Thu, 12 Sep 2019 03:08:03 +0000 (03:08 +0000)]
Update ANGLE
https://bugs.webkit.org/show_bug.cgi?id=201156

Patch by James Darpinian <jdarpinian@chromium.org> on 2019-09-11
Reviewed by Alex Christensen.

Update to 2019-9-9, revision 79ad0411911b2fc84834c3705f55707be9e4b498
I merged a bunch of changes to upstream ANGLE, to minimize the changes
necessary when updating ANGLE in WebKit.

* ANGLE.plist: Update commit hashes
* ANGLE.txt: Removed in favor of LICENSE
* ANGLE.xcodeproj/project.pbxproj: Updated with upstream changes
Also, copy src/commit.h to id/commit.h during build
* CMakeLists.txt: Updated with upstream changes
Also, copy src/commit.h to id/commit.h during build
* Compiler.cmake: Updated with upstream changes
* GLESv2.cmake: Updated with upstream changes
* adjust-angle-include-paths-rule: Support "" as well as <> for includes
* adjust-angle-include-paths.sh: Support "" as well as <> for includes
* changes.diff: Pared down to just legal disclaimer and warning flag changes
* update-angle.sh: Update ANGLE.plist

* Many other files modified/added/removed upstream

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