WebKit-https.git
9 months ago[LFC][Out-of-flow] Set used vertical margin values when top/height/bottom are non...
zalan@apple.com [Wed, 16 Jan 2019 15:23:24 +0000 (15:23 +0000)]
[LFC][Out-of-flow] Set used vertical margin values when top/height/bottom are non-auto.
https://bugs.webkit.org/show_bug.cgi?id=193470

Reviewed by Antti Koivisto.

Source/WebCore:

Non-auto vertical margin values (which is mostly the case) should be set as used values.

Test: fast/block/block-only/non-auto-top-bottom-height-with-margins.html

* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):

Tools:

* LayoutReloaded/misc/LFC-passing-tests.txt:

LayoutTests:

* fast/block/block-only/non-auto-top-bottom-height-with-margins-expected.txt: Added.
* fast/block/block-only/non-auto-top-bottom-height-with-margins.html: Added.

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

9 months ago[LFC] Adjust margin box verification.
zalan@apple.com [Wed, 16 Jan 2019 14:52:55 +0000 (14:52 +0000)]
[LFC] Adjust margin box verification.
https://bugs.webkit.org/show_bug.cgi?id=193482

Source/WebCore:

Reviewed by Antti Koivisto.

In certain cases, like out-of-flow boxes with margin auto, marginBoxRect() returns 0. It's clearly incorrect,
so let's check the individual margin values instead (and at this point we know that all other boxes match).

Test: fast/block/block-only/non-auto-top-bottom-height-with-auto-margins.html

* layout/Verification.cpp:
(WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):

Tools:

Reviewed by Antti Koivisto.

* LayoutReloaded/misc/LFC-passing-tests.txt:

LayoutTests:

Reviewed by Antti Koivisto.

* fast/block/block-only/non-auto-top-bottom-height-with-auto-margins-expected.txt: Added.
* fast/block/block-only/non-auto-top-bottom-height-with-auto-margins.html: Added.

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

9 months ago[FreeType] Cache the zero-width space glyph in GlyphPage::fill()
zandobersek@gmail.com [Wed, 16 Jan 2019 11:05:08 +0000 (11:05 +0000)]
[FreeType] Cache the zero-width space glyph in GlyphPage::fill()
https://bugs.webkit.org/show_bug.cgi?id=193485

Reviewed by Carlos Garcia Campos.

In FreeType's implementation of GlyphPage::fill(), we can cache the
zero-width space glyph upon first retrieval through the
FcFreeTypeCharIndex() entrypoint, avoiding any subsequent calls
for other ignorable characters.

* platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp:
(WebCore::GlyphPage::fill):

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

9 months ago[WHLSL] Add the high zombie finder
mmaxfield@apple.com [Wed, 16 Jan 2019 10:53:16 +0000 (10:53 +0000)]
[WHLSL] Add the high zombie finder
https://bugs.webkit.org/show_bug.cgi?id=193432

Reviewed by Robin Morisset and Saam Barati.

This is a translation of https://github.com/gpuweb/WHLSL/blob/master/Source/HighZombieFinder.mjs into C++.

No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
of test. When enough of the compiler is present, I'll port the reference implementation's test suite.

* Modules/webgpu/WHLSL/WHLSLHighZombieFinder.cpp: Added.
(WebCore::WHLSL::findHighZombies):
* Modules/webgpu/WHLSL/WHLSLHighZombieFinder.h: Added.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

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

9 months agoUnreviewed WinCairo build fix.
Hironori.Fujii@sony.com [Wed, 16 Jan 2019 06:40:30 +0000 (06:40 +0000)]
Unreviewed WinCairo build fix.

Source/WebCore:

* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::createCurlRequest):
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::receivedCredential):
(WebCore::ResourceHandle::getCredential):

Source/WebKit:

* WebProcess/WebPage/WebPageInspectorTargetController.cpp:
(WebKit::WebPageInspectorTargetController::connectInspector): Use 'auto' instead of unprefixed InspectorTarget.
(WebKit::WebPageInspectorTargetController::disconnectInspector): Ditto.
(WebKit::WebPageInspectorTargetController::sendMessageToTargetBackend): Ditto.

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

9 months agoReduce use of NetworkStorageSession::defaultStorageSession in WebCore
achristensen@apple.com [Wed, 16 Jan 2019 05:03:07 +0000 (05:03 +0000)]
Reduce use of NetworkStorageSession::defaultStorageSession in WebCore
https://bugs.webkit.org/show_bug.cgi?id=193368

Reviewed by Geoff Garen.

Source/WebCore:

The NetworkStorageSession ownership needs to move to the WebKit/WebKitLegacy layer instead of being a process-global static map.

* loader/EmptyClients.cpp:
* platform/network/CredentialStorage.cpp:
(WebCore::CredentialStorage::defaultCredentialStorage): Deleted.
* platform/network/CredentialStorage.h:
* platform/network/NetworkStorageSession.h:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::switchToNewTestingSession):
(WebCore::NetworkStorageSession::ensureSession):
* platform/network/cf/NetworkStorageSessionCFNetWin.cpp:
(WebCore::createPrivateStorageSession):
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::receivedCredential):
(WebCore::ResourceHandle::getCredential):

Source/WebKit:

* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::getAuthenticationInfo):

Source/WebKitLegacy/mac:

* Misc/WebCache.mm:
(+[WebCache clearCachedCredentials]):
* Misc/WebDownload.mm:
(-[WebDownloadInternal download:didReceiveAuthenticationChallenge:]):
* Plugins/WebBaseNetscapePluginView.mm:
(WebKit::getAuthenticationInfo):

Source/WebKitLegacy/win:

* WebDownloadCFNet.cpp:
(WebDownload::didReceiveAuthenticationChallenge):

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

9 months agoRemove more NetworkProcess::singleton use
achristensen@apple.com [Wed, 16 Jan 2019 04:57:54 +0000 (04:57 +0000)]
Remove more NetworkProcess::singleton use
https://bugs.webkit.org/show_bug.cgi?id=193484

Reviewed by Geoffrey Garen.

This removes the use of NetworkProcess::singleton in the LegacyCustomProtocolManager.
This is the kind of awful duct tape code that keeps me awake at night, but it's necessary
because we can't quite remove LegacyCustomProtocolManager yet but we need to allow more than
one NetworkProcess object.  To make it work well enough until we remove LegacyCustomProtocolManager,
use the last NetworkProcess object that has been created.

* NetworkProcess/CustomProtocols/Cocoa/LegacyCustomProtocolManagerCocoa.mm:
(newestNetworkProcess):
(LegacyCustomProtocolManager::networkProcessCreated):
(+[WKCustomProtocol canInitWithRequest:]):
(-[WKCustomProtocol initWithRequest:cachedResponse:client:]):
(-[WKCustomProtocol startLoading]):
(-[WKCustomProtocol stopLoading]):
* NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.cpp:
(WebKit::LegacyCustomProtocolManager::LegacyCustomProtocolManager):
(WebKit::LegacyCustomProtocolManager::startLoading):
(WebKit::LegacyCustomProtocolManager::stopLoading):
* NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::NetworkProcess):

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

9 months agoFix WinCairo build after r240014
achristensen@apple.com [Wed, 16 Jan 2019 04:27:04 +0000 (04:27 +0000)]
Fix WinCairo build after r240014
https://bugs.webkit.org/show_bug.cgi?id=161106

* NetworkProcess/curl/NetworkDataTaskCurl.cpp:

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

9 months agoFix Windows build after r240014
achristensen@apple.com [Wed, 16 Jan 2019 04:20:48 +0000 (04:20 +0000)]
Fix Windows build after r240014
https://bugs.webkit.org/show_bug.cgi?id=161106

* WebView.cpp:

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

9 months agoVisualViewport API should be updated upon opening of keyboard
rniwa@webkit.org [Wed, 16 Jan 2019 03:35:59 +0000 (03:35 +0000)]
VisualViewport API should be updated upon opening of keyboard
https://bugs.webkit.org/show_bug.cgi?id=193475

Reviewed by Simon Fraser.

Source/WebCore:

Added a function to update the visual viewport API and schedule a resize event to FrameView.

Test: fast/visual-viewport/ios/resize-event-for-keyboard.html

* page/FrameView.cpp:
(WebCore::FrameView::didUpdateViewportOverrideRects):
* page/FrameView.h:

Source/WebKit:

The bug was caused by the changes to unobscuredContentRectRespectingInputViewBounds not updating the visual viewport
unless it caused a layout to happen. Added a code to update the visual viewport in WebPage::updateVisibleContentRects.

Also fixed the bug that VisibleContentRectUpdateInfo::operator== was not checking differences in
unobscuredContentRectRespectingInputViewBounds which resulted in the visual viewport override not getting updated
while the keyboard is getting brought up.

* Shared/VisibleContentRectUpdateInfo.h:
(WebKit::operator==):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::updateVisibleContentRects):

LayoutTests:

Added a regression test.

* fast/visual-viewport/ios/resize-event-for-keyboard-expected.txt: Added.
* fast/visual-viewport/ios/resize-event-for-keyboard.html: Added.

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

9 months agoFix build after r240018
mmaxfield@apple.com [Wed, 16 Jan 2019 03:27:11 +0000 (03:27 +0000)]
Fix build after r240018
https://bugs.webkit.org/show_bug.cgi?id=193434

Unreviewed.

* Modules/webgpu/WHLSL/WHLSLLoopChecker.cpp:
(WebCore::WHLSL::checkLoops):
(WebCore::WHLSL::findHighZombies): Deleted.
* Modules/webgpu/WHLSL/WHLSLLoopChecker.h:

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

9 months agoFix API test WebKit.WebsiteDataStoreCustomPathsWithoutPrewarming after 193354
sihui_liu@apple.com [Wed, 16 Jan 2019 03:09:22 +0000 (03:09 +0000)]
Fix API test WebKit.WebsiteDataStoreCustomPathsWithoutPrewarming after 193354
https://bugs.webkit.org/show_bug.cgi?id=193451

Reviewed by Geoffrey Garen.

* TestWebKitAPI/Tests/WebKitCocoa/DuplicateCompletionHandlerCalls.mm:
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm:
(runWebsiteDataStoreCustomPaths):

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

9 months ago[JSC] Use KnownStringUse for GetByVal(Array::String) since AI would offer wider type...
yusukesuzuki@slowstart.org [Wed, 16 Jan 2019 02:17:31 +0000 (02:17 +0000)]
[JSC] Use KnownStringUse for GetByVal(Array::String) since AI would offer wider type information and offer non-string type after removing Check(String)
https://bugs.webkit.org/show_bug.cgi?id=193438
<rdar://problem/45581249>

Reviewed by Saam Barati and Keith Miller.

JSTests:

Under the heavy load (like, compiling WebKit), AI in this code can broaden type information after the 1st run.
Then, GetByVal(String) crashed.

* stress/string-get-by-val-lowering.js: Added.
(shouldBe):
(test):
* stress/type-for-get-by-val-can-be-widen-after-ai.js: Added.
(Hello):
(foo):

Source/JavaScriptCore:

GetByVal(Array::String) emits Check(String) before that. But AI can broaden type constraint in the second run.
After the first run removes Check(String), it would happen that AI starts saying the type of 1st child is not String.
To claim that it *is* a String type, we should use KnownStringUse here.

* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode): StringCharAt and GetByVal(Array::String) share the underlying compiler code. We should
change StringUse => KnownStringUse for StringCharAt too. And StringCharAt and StringCharCodeAt potentially have the same
problem. This patch fixes it too.
* dfg/DFGSSALoweringPhase.cpp:
(JSC::DFG::SSALoweringPhase::lowerBoundsCheck):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileStringCharAt):
(JSC::FTL::DFG::LowerDFGToB3::compileStringCharCodeAt):

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

9 months agoTry ripping out inferred types because it might be a performance improvement
sbarati@apple.com [Wed, 16 Jan 2019 01:41:42 +0000 (01:41 +0000)]
Try ripping out inferred types because it might be a performance improvement
https://bugs.webkit.org/show_bug.cgi?id=190906

Reviewed by Yusuke Suzuki.

This patch removes inferred types from JSC. Initial evidence shows that
this might be around a ~1% speedup on Speedometer2 and JetStream2.

* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* bytecode/AccessCase.cpp:
(JSC::AccessCase::generateImpl):
* bytecode/Fits.h:
* bytecode/PutByIdFlags.cpp:
(WTF::printInternal):
* bytecode/PutByIdFlags.h:
* bytecode/PutByIdStatus.cpp:
(JSC::PutByIdStatus::computeFromLLInt):
(JSC::PutByIdStatus::computeForStubInfo):
(JSC::PutByIdStatus::computeFor):
* bytecode/PutByIdVariant.cpp:
(JSC::PutByIdVariant::operator=):
(JSC::PutByIdVariant::replace):
(JSC::PutByIdVariant::transition):
(JSC::PutByIdVariant::setter):
(JSC::PutByIdVariant::attemptToMerge):
(JSC::PutByIdVariant::dumpInContext const):
* bytecode/PutByIdVariant.h:
(JSC::PutByIdVariant::requiredType const): Deleted.
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGAbstractValue.cpp:
(JSC::DFG::AbstractValue::isType const): Deleted.
* dfg/DFGAbstractValue.h:
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleGetByOffset):
(JSC::DFG::ByteCodeParser::handlePutByOffset):
(JSC::DFG::ByteCodeParser::load):
(JSC::DFG::ByteCodeParser::store):
(JSC::DFG::ByteCodeParser::handlePutById):
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::foldConstants):
(JSC::DFG::ConstantFoldingPhase::emitGetByOffset):
(JSC::DFG::ConstantFoldingPhase::emitPutByOffset):
* dfg/DFGDesiredInferredType.h: Removed.
* dfg/DFGDesiredWatchpoints.cpp:
(JSC::DFG::DesiredWatchpoints::reallyAdd):
(JSC::DFG::DesiredWatchpoints::areStillValid const):
(JSC::DFG::DesiredWatchpoints::dumpInContext const):
(JSC::DFG::InferredTypeAdaptor::add): Deleted.
* dfg/DFGDesiredWatchpoints.h:
(JSC::DFG::DesiredWatchpoints::isWatched):
(JSC::DFG::InferredTypeAdaptor::hasBeenInvalidated): Deleted.
(JSC::DFG::InferredTypeAdaptor::dumpInContext): Deleted.
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::dump):
(JSC::DFG::Graph::inferredValueForProperty):
(JSC::DFG::Graph::inferredTypeFor): Deleted.
* dfg/DFGGraph.h:
(JSC::DFG::Graph::registerInferredType): Deleted.
(JSC::DFG::Graph::inferredTypeForProperty): Deleted.
* dfg/DFGInferredTypeCheck.cpp: Removed.
* dfg/DFGInferredTypeCheck.h: Removed.
* dfg/DFGNode.h:
* dfg/DFGObjectAllocationSinkingPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileMultiPutByOffset):
(JSC::FTL::DFG::LowerDFGToB3::checkInferredType): Deleted.
* generator/DSL.rb:
* heap/Heap.cpp:
(JSC::Heap::finalizeUnconditionalFinalizers):
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::branchIfNotType): Deleted.
* jit/AssemblyHelpers.h:
* jit/Repatch.cpp:
(JSC::tryCachePutByID):
* llint/LLIntOffsetsExtractor.cpp:
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/InferredStructure.cpp:
(JSC::InferredStructure::InferredStructure): Deleted.
* runtime/InferredStructure.h:
(): Deleted.
* runtime/InferredStructureWatchpoint.cpp:
(JSC::InferredStructureWatchpoint::fireInternal): Deleted.
* runtime/InferredType.cpp: Removed.
* runtime/InferredType.h: Removed.
* runtime/InferredTypeInlines.h: Removed.
* runtime/InferredTypeTable.cpp: Removed.
* runtime/InferredTypeTable.h: Removed.
* runtime/JSObjectInlines.h:
(JSC::JSObject::putDirectInternal):
* runtime/Structure.cpp:
(JSC::Structure::materializePropertyTable):
(JSC::Structure::addNewPropertyTransition):
(JSC::Structure::removePropertyTransition):
(JSC::Structure::willStoreValueSlow):
(JSC::Structure::visitChildren):
* runtime/Structure.h:
(JSC::PropertyMapEntry::PropertyMapEntry):
* runtime/StructureInlines.h:
(JSC::Structure::get):
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:

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

9 months agowebkitpy: Support boolean simctl isAvailable
jbedard@apple.com [Wed, 16 Jan 2019 01:35:19 +0000 (01:35 +0000)]
webkitpy: Support boolean simctl isAvailable
https://bugs.webkit.org/show_bug.cgi?id=193472
<rdar://problem/47296150>

Reviewed by Ryosuke Niwa.

* Scripts/webkitpy/xcode/simulated_device.py:
(SimulatedDeviceManager._create_runtimes):
(SimulatedDeviceManager._create_device_with_runtime):

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

9 months agoAdd Reveal support in iOSMac
megan_gardner@apple.com [Wed, 16 Jan 2019 01:19:19 +0000 (01:19 +0000)]
Add Reveal support in iOSMac
https://bugs.webkit.org/show_bug.cgi?id=193408
<rdar://problem/47300699>

Reviewed by Tim Horton.

Source/WebCore:

iOSMac and Reveal are currently not testable.

Add support for the reveal SPI specifically for iOSMac.
Show the controller when called, and implement the delegate to
correctly re-paint the content with the auto-generated highlight from
the reveal framework.

* Configurations/WebCore.xcconfig:
* editing/cocoa/DictionaryLookup.mm:
(-[WebRevealHighlight initWithHighlightRect:view:]):
(-[WebRevealHighlight setImage:]):
(-[WebRevealHighlight highlightRectsForItem:]):
(-[WebRevealHighlight startHighlightingItem:]):
(-[WebRevealHighlight highlightItem:withProgress:]):
(-[WebRevealHighlight completeHighlightingItem:]):
(-[WebRevealHighlight stopHighlightingItem:]):
(-[WebRevealHighlight highlightRangeChangedForItem:]):
(-[WebRevealHighlight highlighting]):
(-[WebRevealHighlight drawHighlightContentForItem:context:]):
(WebCore::showPopupOrCreateAnimationController):
(WebCore::DictionaryLookup::showPopup):
* editing/mac/DictionaryLookup.h:

Source/WebCore/PAL:

Add additional needed SPI.

* pal/spi/cocoa/RevealSPI.h:

Source/WebKit:

Add calls to DictionaryLookup from the appropriate places.

* UIProcess/PageClient.h:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::didPerformDictionaryLookup):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::didPerformDictionaryLookup):
* WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
(WebKit::WebPage::dictionaryPopupInfoForRange):

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

9 months ago[WHLSL] Add ending namespace comments to make namespace boundaries more clear
mmaxfield@apple.com [Wed, 16 Jan 2019 01:14:21 +0000 (01:14 +0000)]
[WHLSL] Add ending namespace comments to make namespace boundaries more clear
https://bugs.webkit.org/show_bug.cgi?id=193471

Reviewed by Saam Barati.

This patch only adds the comments to the files that are too long to fit on a single screen in my editor.

No new tests because there is no behavior change.

* Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp:
* Modules/webgpu/WHLSL/WHLSLChecker.cpp:
* Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp:
* Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.h:
* Modules/webgpu/WHLSL/WHLSLInferTypes.cpp:
* Modules/webgpu/WHLSL/WHLSLIntrinsics.cpp:
* Modules/webgpu/WHLSL/WHLSLIntrinsics.h:
* Modules/webgpu/WHLSL/WHLSLLexer.cpp:
* Modules/webgpu/WHLSL/WHLSLLexer.h:
* Modules/webgpu/WHLSL/WHLSLLoopChecker.cpp:
* Modules/webgpu/WHLSL/WHLSLNameContext.cpp:
* Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
* Modules/webgpu/WHLSL/WHLSLNameResolver.h:
* Modules/webgpu/WHLSL/WHLSLParser.h:
* Modules/webgpu/WHLSL/WHLSLProgram.h:
* Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp:
* Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.cpp:
* Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp:
* Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
* Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp:
* Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp:
* Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
* Modules/webgpu/WHLSL/WHLSLVisitor.h:

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

9 months ago[SOUP] Remove usage of NetworkProcess::singleton()
achristensen@apple.com [Wed, 16 Jan 2019 00:35:26 +0000 (00:35 +0000)]
[SOUP] Remove usage of NetworkProcess::singleton()
https://bugs.webkit.org/show_bug.cgi?id=193444

Patch by Claudio Saavedra <csaavedra@igalia.com> on 2019-01-15
Reviewed by Michael Catanzaro.

* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::download):
(WebKit::NetworkDataTaskSoup::didWriteDownload):
(WebKit::NetworkDataTaskSoup::didFinishDownload):
(WebKit::NetworkDataTaskSoup::didFailDownload):
* NetworkProcess/soup/NetworkSessionSoup.cpp:
(WebKit::NetworkSessionSoup::NetworkSessionSoup):

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

9 months ago[WHLSL] Implement the loop checker
mmaxfield@apple.com [Wed, 16 Jan 2019 00:27:00 +0000 (00:27 +0000)]
[WHLSL] Implement the loop checker
https://bugs.webkit.org/show_bug.cgi?id=193434

Reviewed by Saam Barati.

This is a translation of https://github.com/gpuweb/WHLSL/blob/master/Source/LoopChecker.mjs into C++.

No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
of test. When enough of the compiler is present, I'll port the reference implementation's test suite.

* Modules/webgpu/WHLSL/WHLSLLoopChecker.cpp: Added.
(WebCore::WHLSL::findHighZombies):
* Modules/webgpu/WHLSL/WHLSLLoopChecker.h: Added.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

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

9 months agoFix incorrect ASSERT added in r239840
eric.carlson@apple.com [Wed, 16 Jan 2019 00:08:52 +0000 (00:08 +0000)]
Fix incorrect ASSERT added in r239840
https://bugs.webkit.org/show_bug.cgi?id=193466
<rdar://problem/47095142>

Reviewed by Youenn Fablet.

* WebProcess/cocoa/UserMediaCaptureManager.cpp:
(WebKit::UserMediaCaptureManager::Source::Source):

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

9 months agoFrequent null-deref under TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded()
timothy_horton@apple.com [Tue, 15 Jan 2019 23:55:36 +0000 (23:55 +0000)]
Frequent null-deref under TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded()
https://bugs.webkit.org/show_bug.cgi?id=193468
<rdar://problem/38645869>

Reviewed by Beth Dakin.

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
I'm not sure why this got *worse*, but we should null-check RenderView.
It's OK to bail from scaleViewToFitDocumentIfNeeded, we'll re-do it
the next time we paint (which will surely happen if we gain a RenderView).

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

9 months agoUnreviewed, rolling out r239993, r239995, r239997, and
cdumez@apple.com [Tue, 15 Jan 2019 23:48:31 +0000 (23:48 +0000)]
Unreviewed, rolling out r239993, r239995, r239997, and
r239999.

Caused assertions under
ViewGestureController::disconnectFromProcess()

Reverted changesets:

"Regression(PSON) View becomes blank after click a cross-site
download link"
https://bugs.webkit.org/show_bug.cgi?id=193361
https://trac.webkit.org/changeset/239993

"Unreviewed iOS build fix after r239993."
https://trac.webkit.org/changeset/239995

"Fix iOS build after r239993"
https://bugs.webkit.org/show_bug.cgi?id=193361
https://trac.webkit.org/changeset/239997

"Unreviewed, revert part of r239997 as it is not needed to fix
the build."
https://trac.webkit.org/changeset/239999

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

9 months agoStop using CookiesStrategy
achristensen@apple.com [Tue, 15 Jan 2019 23:31:33 +0000 (23:31 +0000)]
Stop using CookiesStrategy
https://bugs.webkit.org/show_bug.cgi?id=161106

Reviewed by Don Olmstead and Antti Koivisto.

Source/WebCore:

CookiesStrategy is process-global and makes it difficult to switch NetworkStorageSession from having a process-global map.
Instead, use a CookieJar object in the WebProcess.  This has the additional benefit of making it more clear which code
is used in the WebProcess and which code is used in the NetworkProcess.

* Modules/beacon/NavigatorBeacon.cpp:
* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::processBuffer):
* Modules/websockets/WebSocketHandshake.cpp:
(WebCore::WebSocketHandshake::clientHandshakeRequest const):
(WebCore::WebSocketHandshake::clientHandshakeCookieRequestHeaderFieldProxy const):
* WebCore.xcodeproj/project.pbxproj:
* css/StyleRuleImport.cpp:
(WebCore::StyleRuleImport::requestStyleSheet):
* dom/Document.cpp:
(WebCore::Document::cookie):
(WebCore::Document::setCookie):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerGetRawCookies const):
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::getCookies):
(WebCore::InspectorPageAgent::deleteCookie):
* loader/CookieJar.cpp:
(WebCore::CookieJar::shouldIncludeSecureCookies):
(WebCore::CookieJar::sameSiteInfo):
(WebCore::CookieJar::create):
(WebCore::CookieJar::cookies const):
(WebCore::CookieJar::cookieRequestHeaderFieldProxy):
(WebCore::CookieJar::setCookies):
(WebCore::CookieJar::cookiesEnabled const):
(WebCore::CookieJar::cookieRequestHeaderFieldValue const):
(WebCore::CookieJar::getRawCookies const):
(WebCore::CookieJar::deleteCookie):
(WebCore::shouldIncludeSecureCookies): Deleted.
(WebCore::sameSiteInfo): Deleted.
(WebCore::cookies): Deleted.
(WebCore::cookieRequestHeaderFieldProxy): Deleted.
(WebCore::setCookies): Deleted.
(WebCore::cookiesEnabled): Deleted.
(WebCore::cookieRequestHeaderFieldValue): Deleted.
(WebCore::getRawCookies): Deleted.
(WebCore::deleteCookie): Deleted.
* loader/CookieJar.h:
* loader/EmptyClients.cpp:
(WebCore::pageConfigurationWithEmptyClients):
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::updateFromElement):
* loader/cache/CachedApplicationManifest.cpp:
(WebCore::CachedApplicationManifest::CachedApplicationManifest):
* loader/cache/CachedApplicationManifest.h:
* loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet):
* loader/cache/CachedCSSStyleSheet.h:
* loader/cache/CachedFont.cpp:
(WebCore::CachedFont::CachedFont):
* loader/cache/CachedFont.h:
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::CachedImage):
* loader/cache/CachedImage.h:
* loader/cache/CachedRawResource.cpp:
(WebCore::CachedRawResource::CachedRawResource):
* loader/cache/CachedRawResource.h:
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::CachedResource):
(WebCore::CachedResource::setResponse):
(WebCore::CachedResource::varyHeaderValuesMatch):
* loader/cache/CachedResource.h:
(WebCore::CachedResource::cookieJar const):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::createResource):
(WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
(WebCore::CachedResourceLoader::updateCachedResourceWithCurrentRequest):
(WebCore::CachedResourceLoader::requestResource):
(WebCore::CachedResourceLoader::revalidateResource):
(WebCore::CachedResourceLoader::loadResource):
* loader/cache/CachedResourceLoader.h:
* loader/cache/CachedSVGDocument.cpp:
(WebCore::CachedSVGDocument::CachedSVGDocument):
* loader/cache/CachedSVGDocument.h:
* loader/cache/CachedSVGFont.cpp:
(WebCore::CachedSVGFont::CachedSVGFont):
* loader/cache/CachedSVGFont.h:
* loader/cache/CachedScript.cpp:
(WebCore::CachedScript::CachedScript):
* loader/cache/CachedScript.h:
* loader/cache/CachedTextTrack.cpp:
(WebCore::CachedTextTrack::CachedTextTrack):
* loader/cache/CachedTextTrack.h:
* loader/cache/CachedXSLStyleSheet.cpp:
(WebCore::CachedXSLStyleSheet::CachedXSLStyleSheet):
* loader/cache/CachedXSLStyleSheet.h:
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::addImageToCache):
* loader/cache/MemoryCache.h:
* page/Navigator.cpp:
(WebCore::Navigator::cookieEnabled const):
* page/Page.cpp:
(WebCore::Page::Page):
* page/Page.h:
(WebCore::Page::cookieJar):
* page/PageConfiguration.cpp:
(WebCore::PageConfiguration::PageConfiguration):
* page/PageConfiguration.h:
* platform/CookiesStrategy.h: Removed.
* platform/PlatformStrategies.h:
(WebCore::PlatformStrategies::cookiesStrategy): Deleted.
* platform/network/CacheValidation.cpp:
(WebCore::cookieRequestHeaderFieldValue):
(WebCore::collectVaryingRequestHeaders):
(WebCore::verifyVaryingRequestHeaders):
* platform/network/CacheValidation.h:
* platform/network/CookieRequestHeaderFieldProxy.h:
* platform/network/cf/NetworkStorageSessionCFNetWin.cpp:
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
* platform/network/curl/ResourceHandleCurl.cpp:
* rendering/RenderSnapshottedPlugIn.cpp:
(WebCore::RenderSnapshottedPlugIn::updateSnapshot):
* testing/Internals.cpp:
(WebCore::Internals::getCookies const):

Source/WebKit:

* NetworkProcess/NetworkProcessPlatformStrategies.cpp:
(WebKit::NetworkProcessPlatformStrategies::createCookiesStrategy): Deleted.
* NetworkProcess/NetworkProcessPlatformStrategies.h:
* NetworkProcess/curl/NetworkDataTaskCurl.cpp:
* Scripts/webkit/messages.py:
* Sources.txt:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::WebAutomationSessionProxy::getCookiesForFrame):
(WebKit::WebAutomationSessionProxy::deleteCookie):
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::cookiesForURL):
(WebKit::PluginView::setCookiesForURL):
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::createCookiesStrategy): Deleted.
(WebKit::WebPlatformStrategies::cookiesForDOM): Deleted.
(WebKit::WebPlatformStrategies::setCookiesFromDOM): Deleted.
(WebKit::WebPlatformStrategies::cookiesEnabled): Deleted.
(WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue): Deleted.
(WebKit::WebPlatformStrategies::getRawCookies): Deleted.
(WebKit::WebPlatformStrategies::deleteCookie): Deleted.
* WebProcess/WebCoreSupport/WebPlatformStrategies.h:
* WebProcess/WebPage/WebCookieJar.cpp: Added.
(WebKit::WebCookieJar::cookies const):
(WebKit::WebCookieJar::setCookies):
(WebKit::WebCookieJar::cookiesEnabled const):
(WebKit::WebCookieJar::cookieRequestHeaderFieldValue const):
(WebKit::WebCookieJar::getRawCookies const):
(WebKit::WebCookieJar::deleteCookie):
* WebProcess/WebPage/WebCookieJar.h: Added.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_shouldAttachDrawingAreaOnPageTransition):

Source/WebKitLegacy/mac:

* Misc/WebCache.mm:
(+[WebCache addImageToCache:forURL:forFrame:]):
* Plugins/Hosted/NetscapePluginInstanceProxy.mm:
(WebKit::NetscapePluginInstanceProxy::getCookies):
(WebKit::NetscapePluginInstanceProxy::setCookies):
* Plugins/WebNetscapePluginView.mm:
(-[WebNetscapePluginView getVariable:forURL:value:length:]):
(-[WebNetscapePluginView setVariable:forURL:value:length:]):
* WebCoreSupport/WebPlatformStrategies.h:
* WebCoreSupport/WebPlatformStrategies.mm:
(WebPlatformStrategies::createCookiesStrategy): Deleted.
(WebPlatformStrategies::cookiesForDOM): Deleted.
(WebPlatformStrategies::setCookiesFromDOM): Deleted.
(WebPlatformStrategies::cookiesEnabled): Deleted.
(WebPlatformStrategies::cookieRequestHeaderFieldValue): Deleted.
(WebPlatformStrategies::getRawCookies): Deleted.
(WebPlatformStrategies::deleteCookie): Deleted.
* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
(-[WebView initSimpleHTMLDocumentWithStyle:frame:preferences:groupName:]):

Source/WebKitLegacy/win:

* Plugins/PluginView.cpp:
(WebCore::PluginView::getValueForURL):
(WebCore::PluginView::setValueForURL):
* WebCoreSupport/WebPlatformStrategies.cpp:
(WebPlatformStrategies::createBlobRegistry):
(WebPlatformStrategies::createCookiesStrategy): Deleted.
(WebPlatformStrategies::cookiesForDOM): Deleted.
(WebPlatformStrategies::setCookiesFromDOM): Deleted.
(WebPlatformStrategies::cookiesEnabled): Deleted.
(WebPlatformStrategies::cookieRequestHeaderFieldValue): Deleted.
(WebPlatformStrategies::getRawCookies): Deleted.
(WebPlatformStrategies::deleteCookie): Deleted.
* WebCoreSupport/WebPlatformStrategies.h:
* WebView.cpp:
(WebView::initWithFrame):

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

9 months agoRemove reporting for iOS mach lookups confirmed in-use
pvollan@apple.com [Tue, 15 Jan 2019 23:13:10 +0000 (23:13 +0000)]
Remove reporting for iOS mach lookups confirmed in-use
https://bugs.webkit.org/show_bug.cgi?id=193455
<rdar://problem/47259551>

Reviewed by Brent Fulgham.

* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

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

9 months agoAnimations should only trigger layer recomposite when necessary
simon.fraser@apple.com [Tue, 15 Jan 2019 23:06:11 +0000 (23:06 +0000)]
Animations should only trigger layer recomposite when necessary
https://bugs.webkit.org/show_bug.cgi?id=193450

Reviewed by Antoine Quint.

Animations only need to trigger compositing updates when their states change in a way
that affects compositing. RenderLayerCompositor::requiresCompositingForAnimation() checks for
running animations of properties that can be accelerated, so this patch fixes the legacy
animation logic to only set 'shouldRecompositeLayer' in TreeResolver::createAnimatedElementUpdate()
when the running state of such an animation changes.

ImplicitAnimation::animate() and KeyframeAnimation::animate() now return OptionSet<AnimateChange>.
This contains information about whether the running state changed, so CompositeAnimation::animate()
asks about whether the running state of an accelerated property changed, and returns this in
the AnimationUpdate result.

* page/animation/AnimationBase.h:
(WebCore::AnimationBase::isPausedState):
(WebCore::AnimationBase::isRunningState):
(WebCore::AnimationBase::inPausedState const):
(WebCore::AnimationBase::inRunningState const):
(WebCore::AnimationBase::isAnimatingProperty const):
* page/animation/CSSAnimationController.h:
* page/animation/CompositeAnimation.cpp:
(WebCore::CompositeAnimation::animate):
* page/animation/ImplicitAnimation.cpp:
(WebCore::ImplicitAnimation::animate):
(WebCore::ImplicitAnimation::affectsAcceleratedProperty const):
* page/animation/ImplicitAnimation.h:
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::KeyframeAnimation):
(WebCore::KeyframeAnimation::animate):
(WebCore::KeyframeAnimation::computeStackingContextImpact): Deleted.
* page/animation/KeyframeAnimation.h:
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::createAnimatedElementUpdate):

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

9 months agoClean up code related to the updating of Dashboard and touch event regions
simon.fraser@apple.com [Tue, 15 Jan 2019 22:57:27 +0000 (22:57 +0000)]
Clean up code related to the updating of Dashboard and touch event regions
https://bugs.webkit.org/show_bug.cgi?id=193460

Reviewed by Zalan Bujtas.

In preparation for layout testing that can count the number of event region
updates, move the code related to updating "annotated" (Dashboard) regions, and
touch event regions into bottleneck functions in Document.

Updating these two kinds of regions is generally similar, but there are some code paths
that eagerly update annotated regions.

No behavior change.

* dom/Document.cpp:
(WebCore::Document::updateAnnotatedRegions): Moved from FrameView.
(WebCore::Document::invalidateRenderingDependentRegions):
(WebCore::Document::invalidateScrollbarDependentRegions):
(WebCore::Document::updateZOrderDependentRegions):
* dom/Document.h:
(WebCore::Document::setAnnotatedRegionsDirty):
(WebCore::Document::annotatedRegionsDirty const):
(WebCore::Document::hasAnnotatedRegions const):
* page/FrameView.cpp:
(WebCore::FrameView::didLayout):
(WebCore::FrameView::didPaintContents):
(WebCore::FrameView::updateAnnotatedRegions): Deleted.
* page/FrameView.h:
* rendering/RenderElement.cpp: Drive-by header cleanup.
(WebCore::RenderElement::styleWillChange):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
(WebCore::RenderLayer::setHasHorizontalScrollbar):
(WebCore::RenderLayer::setHasVerticalScrollbar):
(WebCore::RenderLayer::updateScrollbarsAfterLayout):
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::setHasVerticalScrollbar):

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

9 months agoCannot tab out of WKWebView on macOS
timothy_horton@apple.com [Tue, 15 Jan 2019 22:53:39 +0000 (22:53 +0000)]
Cannot tab out of WKWebView on macOS
https://bugs.webkit.org/show_bug.cgi?id=161448
<rdar://problem/28100085>

Reviewed by Dean Jackson.

Source/WebCore/PAL:

* pal/spi/mac/NSViewSPI.h:
* pal/spi/mac/NSWindowSPI.h:
Move some SPI declarations in here from WebKitLegacy.

Source/WebKit:

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::takeFocus):
If the UIDelegate doesn't implement takeFocus, provide a simple default
implementation that just uses AppKit's key view loop to move the focus.

* UIProcess/API/APIUIClient.h:
(API::UIClient::takeFocus):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageUIClient):
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::UIClient::takeFocus):
Make API::UIClient's takeFocus return a bool indicating whether the
client implements it or not.

* UIProcess/PageClient.h:
* UIProcess/mac/PageClientImplMac.h:
* UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::takeFocus):
Plumb takeFocus to WebViewImpl.

* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::takeFocus):
Borrow the relevant portion of WebKitLegacy's implementation of takeFocus,
shifting focus to the next/previous key view in the window.

Source/WebKitLegacy/mac:

* WebCoreSupport/WebChromeClient.mm:
* WebView/WebView.mm:
Make use of SPI headers.

Tools:

Add a test that tabbing into and out of WKWebView works correctly.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/CommandBackForward.mm:
(WebKit2_CommandBackForwardTest::SetUp):
(-[CommandBackForwardOffscreenWindow isKeyWindow]): Deleted.
(-[CommandBackForwardOffscreenWindow isVisible]): Deleted.
* TestWebKitAPI/Tests/WebKitCocoa/TabOutOfWebView.mm: Added.
(-[FocusableView canBecomeKeyView]):
(TEST):
* TestWebKitAPI/mac/OffscreenWindow.h: Added.
* TestWebKitAPI/mac/OffscreenWindow.mm: Added.
(-[OffscreenWindow initWithSize:]):
(-[OffscreenWindow isKeyWindow]):
(-[OffscreenWindow isVisible]):
* TestWebKitAPI/mac/PlatformWebViewMac.mm:
(TestWebKitAPI::PlatformWebView::initialize):
(-[ActiveOffscreenWindow isKeyWindow]): Deleted.
(-[ActiveOffscreenWindow isVisible]): Deleted.
Factor ActiveOffscreenWindow out into OffscreenWindow and share it.

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

9 months agoRemove the specific handling of ephemeral sessions from CacheStorage::Engine::from
youenn@apple.com [Tue, 15 Jan 2019 22:34:34 +0000 (22:34 +0000)]
Remove the specific handling of ephemeral sessions from CacheStorage::Engine::from
https://bugs.webkit.org/show_bug.cgi?id=193400

Reviewed by Alex Christensen.

It is no longer needed as we correctly handle ephemeral sessions removal.

* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::from):

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

9 months agoAdjust the arguments passed to run-javascriptcore-tests for the 32-bit JSC bot
ryanhaddad@apple.com [Tue, 15 Jan 2019 22:17:07 +0000 (22:17 +0000)]
Adjust the arguments passed to run-javascriptcore-tests for the 32-bit JSC bot
https://bugs.webkit.org/show_bug.cgi?id=193459

Reviewed by Mark Lam.

* BuildSlaveSupport/build.webkit.org-config/steps.py:
(Run32bitJSCTests): This queue should not run JIT, testair, testb3, or testmasm.

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

9 months agoLet Xcode have its way with the WebCore project
ddkilzer@apple.com [Tue, 15 Jan 2019 22:13:33 +0000 (22:13 +0000)]
Let Xcode have its way with the WebCore project

* WebCore.xcodeproj/project.pbxproj:
- Change the lastKnownFileType for *.gperf and *.idl files from
  "file" to "text".
- Resort source files into UUID order.

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

9 months agoREGRESSION (r239510): Remove duplicate copy of srtpsession.cc from 'webrtcpcrtc'...
ddkilzer@apple.com [Tue, 15 Jan 2019 22:13:30 +0000 (22:13 +0000)]
REGRESSION (r239510): Remove duplicate copy of srtpsession.cc from 'webrtcpcrtc' target in Xcode project

Fixes the following Xcode warning:

    warning: Skipping duplicate build file in Compile Sources build phase: Source/ThirdParty/libwebrtc/Source/webrtc/pc/srtpsession.cc (in target 'webrtcpcrtc')

* libwebrtc.xcodeproj/project.pbxproj: Remove duplicate copy of
srtpsession.cc from 'webrtcpcrtc' target.

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

9 months agoclang-tidy: Fix unnecessary copy of for loop variables in ANGLE
ddkilzer@apple.com [Tue, 15 Jan 2019 21:47:51 +0000 (21:47 +0000)]
clang-tidy: Fix unnecessary copy of for loop variables in ANGLE
<https://webkit.org/b/193443>

Reviewed by Alex Christensen.

Fix unwanted copying of loop variables by making them const
references.

* src/compiler/preprocessor/MacroExpander.cpp:
(pp::MacroExpander::ScopedMacroReenabler::~ScopedMacroReenabler):
- Prevents copy and reference churn of std::shared_ptr<Macro>
  objects.
* src/compiler/translator/Compiler.cpp:
(sh::TCompiler::useAllMembersInUnusedStandardAndSharedBlocks):
- Prevents copy of sh::InterfaceBlock structs.
(sh::TCompiler::initializeOutputVariables):
- Prevents copy of sh::Varying structs.
* src/libANGLE/Program.cpp:
(gl::(anonymous namespace)::IncludeSameArrayElement):
- Prevents copy of std::string objects.

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

9 months agoCorrectly handle rotation for local video playback
youenn@apple.com [Tue, 15 Jan 2019 21:21:02 +0000 (21:21 +0000)]
Correctly handle rotation for local video playback
https://bugs.webkit.org/show_bug.cgi?id=193412

Reviewed by Eric Carlson.

Update AVVideoCaptureSource to compute the size given to settings after rotating the sample.
This ensures computing the size of video elements appropriately.
Also makes sure to notify observers of size change whenever rotation happens as settings() call will provide a different size.
Covered by manual testing as we do not have yet emulation of local capture with rotation.

* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::setIntrinsicSize):
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::settings):
(WebCore::AVVideoCaptureSource::computeSampleRotation):

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

9 months agoUnreviewed, revert part of r239997 as it is not needed to fix the build.
cdumez@apple.com [Tue, 15 Jan 2019 21:16:49 +0000 (21:16 +0000)]
Unreviewed, revert part of r239997 as it is not needed to fix the build.

* wtf/RefCounter.h:

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

9 months agoFix iOS build after r239993
achristensen@apple.com [Tue, 15 Jan 2019 20:29:50 +0000 (20:29 +0000)]
Fix iOS build after r239993
https://bugs.webkit.org/show_bug.cgi?id=193361

Source/WebKit:

* UIProcess/ProvisionalPageProxy.h:
* UIProcess/SuspendedPageProxy.h:

Source/WTF:

* wtf/RefCounter.h:

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

9 months ago[macOS] Adjust logging policy in WebKit's sandbox
pvollan@apple.com [Tue, 15 Jan 2019 20:28:36 +0000 (20:28 +0000)]
[macOS] Adjust logging policy in WebKit's sandbox
https://bugs.webkit.org/show_bug.cgi?id=193454
<rdar://problem/47256325>

Reviewed by Brent Fulgham.

* WebProcess/com.apple.WebProcess.sb.in:

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

9 months agoUnreviewed iOS build fix after r239993.
cdumez@apple.com [Tue, 15 Jan 2019 20:04:38 +0000 (20:04 +0000)]
Unreviewed iOS build fix after r239993.

* UIProcess/SuspendedPageProxy.h:

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

9 months agoAdd allow directive for MTLCompilerService.xpc to PluginProcess and WebContent
pvollan@apple.com [Tue, 15 Jan 2019 19:34:12 +0000 (19:34 +0000)]
Add allow directive for MTLCompilerService.xpc to PluginProcess and WebContent
https://bugs.webkit.org/show_bug.cgi?id=193453
<rdar://problem/47268166>

Reviewed by Brent Fulgham.

* PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
* WebProcess/com.apple.WebProcess.sb.in:

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

9 months agoRegression(PSON) View becomes blank after click a cross-site download link
cdumez@apple.com [Tue, 15 Jan 2019 19:01:43 +0000 (19:01 +0000)]
Regression(PSON) View becomes blank after click a cross-site download link
https://bugs.webkit.org/show_bug.cgi?id=193361
<rdar://problem/47099573>

Reviewed by Geoff Garen.

Source/WebCore:

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::commitProvisionalLoad):
When restoring from PageCache, make sure we notify the client that the load was committed
*before* we tell it that the navigation is complete. This would confuse the ProvisionalPageProxy
logic in the UIProcess.

Source/WebKit:

The issue tracked by rdar://problem/47099573 is that a provisional load may get
canceled (or converted into a download) *after* we've decided to process-swap.
In such cases, the view should keep displaying the current site and it should
still be interactive. However, with the previous PSON model, the view (pageProxy)
would have already swapped to the new process and would end up displaying the
initially empty document.

To address the issue, this patch introduces the concept of a provisional load
in the UIProcess, handled by a ProvisionalPageProxy which has its own privisional
process. The WebPageProxy owns the ProvisionalPageProxy but we do not commit the
provisional page until after the load was committed in the new process. This means
that the view / WebPageProxy keeps using the old process and displays the current
content until a load has committed in the provisional page. If no load commits
in the provisional process (e.g. because the load is cancelled or converted into
a download), then we merely destroy the ProvisionalPageProxy and terminate its
process, without impacting the WebPageProxy.

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
Rename isSwapFromSuspended to isProcessSwap for clarity as we always want to
delay attaching the drawing area in case of a process-swap, no matter what
now that the previous process is kept alive until the provisional load is
committed in the new process.

* Shared/WebPolicyAction.h:
Drop Suspend policy action. At decidePolicyForNavigationAction time, in case of
process-swap, we now tell the previous process to simply ignore the load, while
we create a ProvisionalPageProxy to do the new load in a new process.
Suspension of the previous page in the old process, happens later, when a load
is actually committed in the new process.

* Sources.txt:
Add new ProvisionalPageProxy file.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _killWebContentProcessAndResetState]):
When calling _killWebContentProcessAndResetState on a WKWebView, kill both the current
process and the provisional one, to maintain previous behavior in our API tests.

* UIProcess/PageClient.h:
Tiny build fix.

* UIProcess/ProvisionalPageProxy.cpp: Added.
(WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
(WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
(WebKit::ProvisionalPageProxy::takeDrawingArea):
(WebKit::ProvisionalPageProxy::cancel):
(WebKit::ProvisionalPageProxy::initializeWebPage):
(WebKit::ProvisionalPageProxy::loadDataWithNavigation):
(WebKit::ProvisionalPageProxy::loadRequestWithNavigation):
(WebKit::ProvisionalPageProxy::goToBackForwardItem):
(WebKit::ProvisionalPageProxy::didCreateMainFrame):
(WebKit::ProvisionalPageProxy::didStartProvisionalLoadForFrame):
(WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame):
(WebKit::ProvisionalPageProxy::didCommitLoadForFrame):
(WebKit::ProvisionalPageProxy::didReceiveMessage):
(WebKit::ProvisionalPageProxy::didReceiveSyncMessage):
* UIProcess/ProvisionalPageProxy.h: Added.
(WebKit::ProvisionalPageProxy::page):
(WebKit::ProvisionalPageProxy::mainFrame const):
(WebKit::ProvisionalPageProxy::process):
(WebKit::ProvisionalPageProxy::processSwapRequestedByClient const):
(WebKit::ProvisionalPageProxy::navigationID const):
Add new ProvisionalPageProxy class to wrap the provisional load in the new process
after a swap. The provisional page is owned by the WebPageProxy and we only commit
the provisional page when the load is committed. Until then, the WebPageProxy keeps
using the old process and displaying the current content.

* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::~SuspendedPageProxy):
(WebKit::SuspendedPageProxy::unsuspend):
(WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
Unregister the SuspendedPageProxy as an IPC message receiver a little bit earlier
when we're going to unsuspend it. This avoids conflicting with the ProvisionalPageProxy
which tries to register itself as an IPC message receiver for the same pageID when
a process-swap occurs and we're switching to a suspended page.

* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::isMainFrame const):
WebFrameProxy::isMainFrame() relies on checking that the frame is the WebPageProxy's m_mainFrame.
Now that the WebPageProxy can have a ProvisionalPageProxy, also check if it is the ProvisionalPageProxy's
m_mainFrame to maintain previous behavior.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::swapToWebProcess):
swapToWebProcess() no longer takes care of unsuspending the SuspendedPage because we now call swapToWebProcess()
later, when a load is actually committed in the provisional page / process. swapToWebProcess() now also needs
to initialize some data members such as the drawing area and the main frame as it is transferring them over from
the ProvisionalPageProxy which started the provisional load.

(WebKit::WebPageProxy::finishAttachingToWebProcess):
We no longer need IsSwapFromSuspended parameter as this is called later now, after a load has actually been
committed in the provisional process.

(WebKit::WebPageProxy::initializeWebPage):
- We no longer need IsSwapFromSuspended parameter as this is called later now, after a load has actually been
  committed in the provisional process.
- Factor some code out to WebPageProxy::setDrawingArea() so that it can be shared with swapToWebProcess().

(WebKit::WebPageProxy::loadRequestWithNavigation):
Only call setPendingAPIRequestURL() in loadRequestWithNavigation() only if ShouldTreatAsContinuingLoad is not
Yes. This avoids hitting some assertions as this was already called during the first API call if needed.

(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
In case of process swap, tell the previous process to ignore the load instead of suspending it right away.
Suspension now happens later, only if we end up committing the provisional load in the new process.
Also discard the SuspendedPage if it failed to suspend (we only reuse its process in this case). This used
to happen a bit later but it is clearer if we do this as early as possible I think.

(WebKit::WebPageProxy::commitProvisionalPage):
When the load is committed in the new process, we call WebPageProxy::commitProvisionalPage(). It takes care of:
- Actually swapping the WebPageProxy to the new process by calling processDidTerminate() / swapToWebProcess().
- Suspending the current page.
- Letting the client know the load is comitted
- Destroy the ProvisionalPageProxy.
This work used to happen earlier in continueNavigationInNewProcess().

(WebKit::WebPageProxy::continueNavigationInNewProcess):
Moved some of the logic to commitProvisionalPage(). We now merely start the load in a new ProvisionalPageProxy,
without actually having the WebPageProxy switch to the new process yet.

(WebKit::WebPageProxy::didCreateMainFrame):
(WebKit::WebPageProxy::didCreateWindow):
Drop some code that is no longer needed, now that the ProvisionalPageProxy takes care of this.

(WebKit::WebPageProxy::didDestroyNavigation):
On process-swap, when telling the previous process to ignore the load and starting the new load in a new
ProvisionalPageProxy, the previous WebPage attempts to destroy the navigation. In this case, we ignore
the call since the navigation is merely taken over by the ProvisionalPageProxy.

(WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
Moved some PSON logic to the ProvisionalPageProxy instead.

(WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
When didFailProvisionalLoadForFrame() is called for a ProvisionalPageProxy, destroy it.

(WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
(WebKit::WebPageProxy::decidePolicyForResponse):
Capture the process in the lambda, to make sure we send the policy decision to the same process that
asked for it, so as to not get confused by process swaps.

(WebKit::WebPageProxy::resetState):
Drop some code that is no longer needed.

(WebKit::WebPageProxy::creationParameters):
Move the hasRegisteredServiceWorkers flag initialization from the call site to here now that we have
more than one call site. This was just some bad factoring.

(WebKit::WebPageProxy::PageProcessOverride::PageProcessOverride):
(WebKit::WebPageProxy::PageProcessOverride::~PageProcessOverride):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::temporarilyOverrideProcess):
Add utility class to temporarily override the WebPageProxy's m_process with the provisional one when
the ProvisionalPageProxy interacts with the WebPageProxy.

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::hasProvisionalPageWithID const):
(WebKit::WebProcessProxy::updateBackForwardItem):
Before updating a BackForwardListItem, we normally make sure the process has a WebPageProxy with the
item's pageID. We have to tweak the logic because there may now be no WebPageProxy with this pageID
associated with this process yet, because it is still a ProvisionalPageProxy.

(WebKit::WebProcessProxy::canTerminateChildProcess):
Do not terminate the WebProcess if there are ProvisionalPageProxy objects using it.

* UIProcess/WebProcessProxy.h:
(WebKit::WebProcessProxy::addProvisionalPageProxy):
(WebKit::WebProcessProxy::removeProvisionalPageProxy):

* WebKit.xcodeproj/project.pbxproj:

* WebProcess/WebPage/WebFrame.cpp:
(WebKit::toPolicyAction):
(WebKit::WebFrame::didReceivePolicyDecision):
Stop dealing with WebPolicyAction::Suspend as it no longer exists.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::reinitializeWebPage):
(WebKit::WebPage::didReceivePolicyDecision):

(WebKit::WebPage::setIsSuspended):
Suspend the Page when setIsSuspended(true) is called, now that there is no longer a WebPolicyAction::Suspend.
setIsSuspended(true) IPC is sent when we actually commit the provisional page.

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
(-[PSONNavigationDelegate webView:decidePolicyForNavigationResponse:decisionHandler:]):

LayoutTests:

Skip test testing the cross-process DOMWindow API as I broke it with this patch.
The feature is far from ready and off by default anyway. I will add support back
in a follow-up.

* platform/wk2/TestExpectations:

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

9 months ago[LFC][Out-of-flow] Ignore bottom when the vertical values are over-constrained
zalan@apple.com [Tue, 15 Jan 2019 18:27:06 +0000 (18:27 +0000)]
[LFC][Out-of-flow] Ignore bottom when the vertical values are over-constrained
https://bugs.webkit.org/show_bug.cgi?id=193448

Reviewed by Antti Koivisto.

Source/WebCore:

Add missing check. We should only resolve auto values.

Test: fast/block/block-only/non-auto-top-bottom-left-right-widht-height-out-of-flow.html

* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):

Tools:

* LayoutReloaded/misc/LFC-passing-tests.txt:

LayoutTests:

* fast/block/block-only/non-auto-top-bottom-left-right-widht-height-out-of-flow-expected.txt: Added.
* fast/block/block-only/non-auto-top-bottom-left-right-widht-height-out-of-flow.html: Added.

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

9 months agoUnreviewed, test fix after r239976.
drousso@apple.com [Tue, 15 Jan 2019 18:03:05 +0000 (18:03 +0000)]
Unreviewed, test fix after r239976.

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

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

9 months agowebkitpy: Implement device type specific expected results (Part 1)
jbedard@apple.com [Tue, 15 Jan 2019 17:46:31 +0000 (17:46 +0000)]
webkitpy: Implement device type specific expected results (Part 1)
https://bugs.webkit.org/show_bug.cgi?id=192162

Reviewed by Lucas Forschler.

Device type specific expected results covers two related ideas. The first (covered by this change)
is where to search for -expected.* files. The second is which tests to run based on the
TestExpectations.txt file.

After this change, the baseline search path will be determined by the type of device running a
test. Device type will be passed into any function which picks a file based on the baseline search
path.

* Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py:
(Worker._update_test_input): Pass device_type to self._port.reference_files(...).
* Scripts/webkitpy/layout_tests/controllers/manager.py:
(Manager.run): Print baseline search path for each round of devices.
* Scripts/webkitpy/layout_tests/controllers/single_test_runner.py:
(SingleTestRunner.__init__): Pass device_type into expected_*(...).
(SingleTestRunner._expected_driver_output): Ditto.
(SingleTestRunner._driver_input): Ditto.
* Scripts/webkitpy/layout_tests/views/printing.py:
(Printer.print_config): Move printing of baseline search path to a separate function.
(Printer.print_baseline_search_path): Moved from Printer.print_config.
* Scripts/webkitpy/layout_tests/views/printing_unittest.py:
(Testprinter.test_print_config):
(Testprinter.test_print_baseline_search_path):
* Scripts/webkitpy/port/base.py:
(Port.baseline_search_path): Pass device_type through.
(Port._expected_baselines_for_suffixes): Ditto.
(Port.expected_baselines): Ditto.
(Port.expected_filename): Ditto.
(Port.expected_checksum): Ditto.
(Port.expected_image): Ditto.
(Port.expected_audio): Ditto.
(Port.expected_text): Ditto.
(Port.reference_files): Ditto.
(Port.tests): Ditto.
(Port._expanded_paths): Ditto.
(Port.skipped_layout_tests): Ditto.
(Port.expectations_dict): Ditto.
(Port._port_specific_expectations_files): Ditto.
(Port.expectations_files): Ditto.
(Port.test_search_path): Ditto.
(Port._tests_for_other_platforms): Ditto.
* Scripts/webkitpy/port/base_unittest.py:
(PortTest.test_additional_platform_directory): Accept, but do not use, device_type.
(PortTest.test_nonexistant_expectations): Ditto.
(test_ref_tests_platform_directory): Ditto.
* Scripts/webkitpy/port/darwin.py:
(DarwinPort._port_specific_expectations_files): Accept device_type.
* Scripts/webkitpy/port/driver.py:
(DriverProxy):
(DriverProxy.host): Expose _target_host for device_type information.
* Scripts/webkitpy/port/gtk.py:
(GtkPort._port_specific_expectations_files): Accept, but do not use, device_type.
* Scripts/webkitpy/port/ios.py:
(IOSPort. default_baseline_search_path): Remove memoized, since it does not accept **kwargs.
* Scripts/webkitpy/port/mac.py:
(MacPort. default_baseline_search_path): Ditto.
* Scripts/webkitpy/port/port_testcase.py:
(TestWebKitPort._tests_for_other_platforms): Accept, but do not use, device_type.
* Scripts/webkitpy/port/test.py:
* Scripts/webkitpy/port/watch.py:
(WatchPort. default_baseline_search_path): Remove memoized, since it does not accept **kwargs.
* Scripts/webkitpy/port/win.py:
(WinPort.test_search_path): Accept, but do not use, device_type.
* Scripts/webkitpy/port/wpe.py:
(WPEPort._port_specific_expectations_files): Ditto.
* Scripts/webkitpy/tool/servers/rebaselineserver.py:
(get_test_baselines.AllPlatformsPort.baseline_search_path): Ditto.

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

9 months agoWebDriver: update Create Window implementation to support newest specification
bburg@apple.com [Tue, 15 Jan 2019 17:15:44 +0000 (17:15 +0000)]
WebDriver: update Create Window implementation to support newest specification
https://bugs.webkit.org/show_bug.cgi?id=193333
<rdar://problem/45649489>

Reviewed by Carlos Garcia Campos.

link: https://w3c.github.io/webdriver/#create-window
The command as specified returns a value indicating whether the new browsing context
was presented as a new tab or new window. Add a new delegate method to query the current
'presentation' of the browsing context. The presentation can change over time due to
things such as screen orientation, so the value that is returned by the command only
reflects how the browsing context was initially presented to the user.

This is covered by existing WPT and internal tests. More will be added when Selenium
exposes this command in its various bindings.

* UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
Add new SPI delegate method to query the 'presentation' (tab or window) for an automated WKWebView.

* UIProcess/API/APIAutomationSessionClient.h:
(API::AutomationSessionClient::currentPresentationOfPage):
* UIProcess/Cocoa/AutomationSessionClient.h:
* UIProcess/Cocoa/AutomationSessionClient.mm:
(WebKit::AutomationSessionClient::AutomationSessionClient):
(WebKit::toImpl):
(WebKit::AutomationSessionClient::currentPresentationOfPage):
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::toProtocol):
(WebKit::WebAutomationSession::createBrowsingContext):
Add plumbing between ObjC delegate and C++.

* UIProcess/Automation/Automation.json:
Include the initial presentation in the createBrowsingContext command result.

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

9 months agoWeb Inspector: Audit: provide a way to determine whether a give node has event listeners
drousso@apple.com [Tue, 15 Jan 2019 16:31:05 +0000 (16:31 +0000)]
Web Inspector: Audit: provide a way to determine whether a give node has event listeners
https://bugs.webkit.org/show_bug.cgi?id=193226
<rdar://problem/46800005>

Reviewed by Joseph Pecoraro.

Source/WebCore:

Test: inspector/audit/run-dom.html

* inspector/InspectorAuditDOMObject.idl:
* inspector/InspectorAuditDOMObject.h:
* inspector/InspectorAuditDOMObject.cpp:
(WebCore::InspectorAuditDOMObject::hasEventListeners): Added.

LayoutTests:

* inspector/audit/run-dom.html: Added.
* inspector/audit/run-dom-expected.txt: Added.

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

9 months agoWeb Inspector: Audit: provide a way to query for all nodes with a given computed...
drousso@apple.com [Tue, 15 Jan 2019 16:28:37 +0000 (16:28 +0000)]
Web Inspector: Audit: provide a way to query for all nodes with a given computed Accessibility role
https://bugs.webkit.org/show_bug.cgi?id=193228
<rdar://problem/46787787>

Reviewed by Joseph Pecoraro.

Source/WebCore:

Test: inspector/audit/run-accessibility.html

* inspector/InspectorAuditAccessibilityObject.idl:
* inspector/InspectorAuditAccessibilityObject.h:
* inspector/InspectorAuditAccessibilityObject.cpp:
(WebCore::accessiblityObjectForNode): Added.
(WebCore::InspectorAuditAccessibilityObject::getElementsByComputedRole): Added.

LayoutTests:

* inspector/audit/run-accessibility.html: Added.
* inspector/audit/run-accessibility-expected.txt: Added.

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

9 months agoSimplify isRunningAnimationOnRenderer()
simon.fraser@apple.com [Tue, 15 Jan 2019 16:24:57 +0000 (16:24 +0000)]
Simplify isRunningAnimationOnRenderer()
https://bugs.webkit.org/show_bug.cgi?id=193435

Reviewed by Darin Adler.

All callers of CSSAnimationController::isRunningAnimationOnRenderer() pass AnimationBase::Running | AnimationBase::Paused,
so we can remove the parameter and just hardcode this behavior.

This will simplify a later patch that needs to consider state changes between running and not running.

No behavior change.

* page/animation/AnimationBase.h:
(WebCore::AnimationBase::isAnimatingProperty const):
* page/animation/CSSAnimationController.cpp:
(WebCore::CSSAnimationControllerPrivate::isRunningAnimationOnRenderer const):
(WebCore::CSSAnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer const):
(WebCore::CSSAnimationControllerPrivate::computeExtentOfAnimation const):
(WebCore::CSSAnimationController::isRunningAnimationOnRenderer const):
(WebCore::CSSAnimationController::isRunningAcceleratedAnimationOnRenderer const):
* page/animation/CSSAnimationController.h:
* page/animation/CSSAnimationControllerPrivate.h:
* page/animation/CompositeAnimation.cpp:
(WebCore::CompositeAnimation::isAnimatingProperty const):
* page/animation/CompositeAnimation.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::currentTransform const):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGeometry):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingForAnimation const):
(WebCore::RenderLayerCompositor::isRunningTransformAnimation const):

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

9 months agoRemove unused fields from Scrollbar
antti@apple.com [Tue, 15 Jan 2019 15:46:19 +0000 (15:46 +0000)]
Remove unused fields from Scrollbar
https://bugs.webkit.org/show_bug.cgi?id=193442

Reviewed by Zalan Bujtas.

* platform/Scrollbar.cpp:
(WebCore::Scrollbar::Scrollbar):
* platform/Scrollbar.h:
(WebCore::Scrollbar::isCustomScrollbar const):

Make virtual so it doesn't need a bit.

(WebCore::Scrollbar::isAlphaLocked const): Deleted.
(WebCore::Scrollbar::setIsAlphaLocked): Deleted.
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimatorMac::shouldScrollbarParticipateInHitTesting):
* rendering/RenderScrollbar.cpp:
(WebCore::RenderScrollbar::RenderScrollbar):
* rendering/RenderScrollbar.h:

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

9 months ago[LFC] Use the containing block's padding box to position out-of-flow elements.
zalan@apple.com [Tue, 15 Jan 2019 14:48:54 +0000 (14:48 +0000)]
[LFC] Use the containing block's padding box to position out-of-flow elements.
https://bugs.webkit.org/show_bug.cgi?id=193431

Reviewed by Antti Koivisto.

Source/WebCore:

If the element has 'position: absolute', the containing block is established by the nearest ancestor
with a 'position' of 'absolute', 'relative' or 'fixed', in the following way:

1. In the case that the ancestor is an inline element, the containing block is the bounding box around the padding
boxes of the first and the last inline boxes generated for that element. In CSS 2.2, if the inline element is split
across multiple lines, the containing block is undefined.

2. Otherwise, the containing block is formed by the padding edge of the ancestor.

This patch covers #2.

Test: fast/block/block-only/out-of-flow-with-containing-block-border-padding.html

* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::width const):
(WebCore::Display::Box::height const):
(WebCore::Display::Box::contentBoxTop const):
(WebCore::Display::Box::contentBoxLeft const):
(WebCore::Display::Box::paddingBoxTop const):
(WebCore::Display::Box::paddingBoxLeft const):
(WebCore::Display::Box::paddingBoxBottom const):
(WebCore::Display::Box::paddingBoxRight const):
(WebCore::Display::Box::paddingBoxHeight const):
(WebCore::Display::Box::paddingBoxWidth const):
* page/FrameViewLayoutContext.cpp:
(WebCore::layoutUsingFormattingContext):

Tools:

* LayoutReloaded/misc/LFC-passing-tests.txt:

LayoutTests:

* fast/block/block-only/out-of-flow-with-containing-block-border-padding-expected.txt: Added.
* fast/block/block-only/out-of-flow-with-containing-block-border-padding.html: Added.

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

9 months agoUnreviewed, skip JIT tests if it's not enabled
tpopela@redhat.com [Tue, 15 Jan 2019 13:14:27 +0000 (13:14 +0000)]
Unreviewed, skip JIT tests if it's not enabled

* stress/bit-op-with-object-returning-int32.js:

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

9 months agoUnreviewed: Fix the -Wformat compiler warnings
tpopela@redhat.com [Tue, 15 Jan 2019 12:34:35 +0000 (12:34 +0000)]
Unreviewed: Fix the -Wformat compiler warnings

* jsc.cpp:
(jscmain):

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

9 months agoDFGByteCodeParser rules for bitwise operations should consider type of their operands
ticaiolima@gmail.com [Tue, 15 Jan 2019 10:14:31 +0000 (10:14 +0000)]
DFGByteCodeParser rules for bitwise operations should consider type of their operands
https://bugs.webkit.org/show_bug.cgi?id=192966

Reviewed by Yusuke Suzuki.

JSTests:

* stress/bit-op-with-object-returning-int32.js: Added.

Source/JavaScriptCore:

This patch is changing the logic how we lower bitwise operations, to
consider only the type of input nodes and fix them during FixupPhase,
if necessary. We are also changing the prediction propagation rules
for ValueBitOp to use `getHeapPrediction()`.

* dfg/DFGBackwardsPropagationPhase.cpp:
(JSC::DFG::BackwardsPropagationPhase::isWithinPowerOfTwo):
(JSC::DFG::BackwardsPropagationPhase::propagate):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNode.h:
(JSC::DFG::Node::hasInt32Result):
(JSC::DFG::Node::hasNumberOrAnyIntResult):
(JSC::DFG::Node::hasHeapPrediction):
* dfg/DFGPredictionPropagationPhase.cpp:

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

9 months agoSkip a slow test and a flakey test on arm
guijemont@igalia.com [Tue, 15 Jan 2019 09:51:44 +0000 (09:51 +0000)]
Skip a slow test and a flakey test on arm

Unreviewed gardening.

JSTests:

* typeProfiler/getter-richards.js:
this test always times out, it used to be always skipped on arm and
mips, but got accidentally enabled by r237919 now that we have DFG on
arm. Also skipping on mips as we plan to soon enable DFG for it too.

LayoutTests:

* js/script-tests/stack-overflow-regexp.js: flakey on arm.

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

9 months agoSupport parsing of additional values for the touch-action property
graouts@webkit.org [Tue, 15 Jan 2019 08:30:53 +0000 (08:30 +0000)]
Support parsing of additional values for the touch-action property
https://bugs.webkit.org/show_bug.cgi?id=193314
<rdar://problem/47176519>

Reviewed by Dean Jackson.

We add parsing support for the "none", "pan-x", "pan-y" and "pinch-zoom" values of the CSS "touch-action" property.

* WebCore.xcodeproj/project.pbxproj:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::touchActionFlagsToCSSValue):
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator OptionSet<TouchAction> const):
(WebCore::CSSPrimitiveValue::operator TouchAction const): Deleted.
* css/CSSProperties.json:
* css/CSSValueKeywords.in:
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertTouchAction):
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeTouchAction):
* dom/Element.cpp:
(WebCore::Element::allowsDoubleTapGesture const):
* platform/TouchAction.h: Added.
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::touchActions const):
(WebCore::RenderStyle::setTouchActions):
(WebCore::RenderStyle::initialTouchActions):
(WebCore::RenderStyle::touchAction const): Deleted.
(WebCore::RenderStyle::setTouchAction): Deleted.
(WebCore::RenderStyle::initialTouchAction): Deleted.
* rendering/style/RenderStyleConstants.h:
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator== const):
* rendering/style/StyleRareNonInheritedData.h:

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

9 months agoWeb Inspector: Generate the DOMDebugger domain for Augmenting Agents (ObjC protocol)
commit-queue@webkit.org [Tue, 15 Jan 2019 08:27:23 +0000 (08:27 +0000)]
Web Inspector: Generate the DOMDebugger domain for Augmenting Agents (ObjC protocol)
https://bugs.webkit.org/show_bug.cgi?id=193409
<rdar://problem/44349411>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2019-01-15
Reviewed by Devin Rousso.

* inspector/scripts/codegen/objc_generator.py:
(ObjCGenerator):
Generate DOMDebugger domain ObjC interfaces.

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

9 months agoWeb Inspector: Audit: create new IDL type for exposing special functionality in test...
drousso@apple.com [Tue, 15 Jan 2019 08:25:33 +0000 (08:25 +0000)]
Web Inspector: Audit: create new IDL type for exposing special functionality in test context
https://bugs.webkit.org/show_bug.cgi?id=193149
<rdar://problem/46801218>

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

Create a new `AuditAgent` (and various subclasses for different inspection targets)

* inspector/protocol/Audit.json: Added.
Add a `run` command that is a simpler version of `Runtime.evaluate`, except that it expects
a function string instead of an arbitrary JavaScript expression.
Add `setup` and `teardown` commands that create a JavaScript object that will be passed in
to the test as an argument. Keep this object alive so that tests can add to the object and
have later tests use what was added.

* inspector/agents/InspectorAuditAgent.h: Added.
* inspector/agents/InspectorAuditAgent.cpp: Added.
(Inspector::InspectorAuditAgent::InspectorAuditAgent):
(Inspector::InspectorAuditAgent::didCreateFrontendAndBackend):
(Inspector::InspectorAuditAgent::willDestroyFrontendAndBackend):
(Inspector::InspectorAuditAgent::setup):
(Inspector::InspectorAuditAgent::run):
(Inspector::InspectorAuditAgent::teardown):
(Inspector::InspectorAuditAgent::hasActiveAudit):
(Inspector::InspectorAuditAgent::populateAuditObject):

* inspector/agents/JSGlobalObjectAuditAgent.h: Added.
* inspector/agents/JSGlobalObjectAuditAgent.cpp: Added.
(Inspector::JSGlobalObjectAuditAgent::JSGlobalObjectAuditAgent):
(Inspector::JSGlobalObjectAuditAgent::injectedScriptForEval):

* inspector/JSGlobalObjectInspectorController.h:
* inspector/JSGlobalObjectInspectorController.cpp:
(Inspector::JSGlobalObjectInspectorController::JSGlobalObjectInspectorController):
(Inspector::JSGlobalObjectInspectorController::connectFrontend):
(Inspector::JSGlobalObjectInspectorController::jsAgentContext): Added.
(Inspector::JSGlobalObjectInspectorController::createLazyAgents): Added.

* inspector/InjectedScript.h:
* inspector/InjectedScript.cpp:
(Inspector::InjectedScript::execute): Added.
(Inspector::InjectedScript::arrayFromVector): Added.
Create a version of `evaluate` that accepts a list of values to be passed in as arguments
to the function that was created by the `eval` of the given `functionString`.

* inspector/InjectedScriptSource.js:
(InjectedScript.prototype.execute): Added.
(InjectedScript.prototype.evaluate):
(InjectedScript.prototype.evaluateOnCallFrame):
(InjectedScript.prototype._evaluateAndWrap):
(InjectedScript.prototype._wrapAndSaveCall): Added.
(InjectedScript.prototype._wrapCall): Added.
(InjectedScript.prototype._evaluateOn):
Refactor the `eval` and `saveResult` logic to allow for more flexibility for other callers.

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources.make:
* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* UnifiedSources-input.xcfilelist:

Source/WebCore:

Tests: inspector/audit/run.html
       inspector/audit/setup.html
       inspector/audit/teardown.html

Create a new `AuditAgent` (and various subclasses for different inspection targets), as well
as `InspectorAuditAccessibilityObject` and `InspectorAuditDOMObject` objects that will
be injected into the test function to allow for more advanced testing.

* inspector/InspectorAuditAccessibilityObject.idl: Added.
* inspector/InspectorAuditAccessibilityObject.h: Added.
(WebCore::InspectorAuditAccessibilityObject::create):
* inspector/InspectorAuditAccessibilityObject.cpp: Added.
(WebCore::InspectorAuditAccessibilityObject::InspectorAuditAccessibilityObject):

* inspector/InspectorAuditDOMObject.idl: Added.
* inspector/InspectorAuditDOMObject.h: Added.
(WebCore::InspectorAuditDOMObject::create):
* inspector/InspectorAuditDOMObject.cpp: Added.
(WebCore::InspectorAuditDOMObject::InspectorAuditDOMObject):

* inspector/agents/page/PageAuditAgent.h: Added.
* inspector/agents/page/PageAuditAgent.cpp: Added.
(WebCore::PageAuditAgent::PageAuditAgent):
(WebCore::PageAuditAgent::injectedScriptForEval):
(WebCore::PageAuditAgent::populateAuditObject):
(WebCore::PageAuditAgent::muteConsole):
(WebCore::PageAuditAgent::unmuteConsole):

* inspector/agents/worker/WorkerAuditAgent.h: Added.
* inspector/agents/worker/WorkerAuditAgent.cpp: Added.
(WebCore::WorkerAuditAgent::WorkerAuditAgent):
(WebCore::WorkerAuditAgent::injectedScriptForEval):

* inspector/InspectorController.cpp:
(WebCore::InspectorController::createLazyAgents):

* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::createLazyAgents):

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Sources.txt:
* UnifiedSources-input.xcfilelist:
* WebCore.xcodeproj/project.pbxproj:

Source/WebInspectorUI:

Add `AuditAgent` getters and plumbing.

* UserInterface/Protocol/Target.js:
(WI.Target.prototype.get AuditAgent): Added.

* UserInterface/Models/AuditTestCase.js:
(WI.AuditTestCase.prototype.async run):

* UserInterface/Controllers/AuditManager.js:
(WI.AuditManager.prototype.async start):

* .eslintrc:

LayoutTests:

* inspector/audit/resources/audit-utilities.js:
(TestPage.registerInitializer.InspectorTest.Audit.setupAudit): Added.
(TestPage.registerInitializer.InspectorTest.Audit.teardownAudit): Added.

* inspector/audit/run.html: Added.
* inspector/audit/run-expected.txt: Added.
* inspector/audit/setup.html: Added.
* inspector/audit/setup-expected.txt: Added.
* inspector/audit/teardown.html: Added.
* inspector/audit/teardown-expected.txt: Added.

* inspector/canvas/create-context-2d-expected.txt:
* inspector/canvas/create-context-bitmaprenderer-expected.txt:
* inspector/canvas/create-context-webgl-expected.txt:
* inspector/canvas/create-context-webgl2-expected.txt:
* inspector/canvas/create-context-webmetal-expected.txt:
* inspector/canvas/recording-2d-expected.txt:
* inspector/canvas/recording-webgl-expected.txt:
* inspector/canvas/recording-webgl-snapshots-expected.txt:
* inspector/model/remote-object-expected.txt:
* inspector/model/stack-trace-expected.txt:

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

9 months ago[WHLSL] Implement the Type Checker
mmaxfield@apple.com [Tue, 15 Jan 2019 06:01:44 +0000 (06:01 +0000)]
[WHLSL] Implement the Type Checker
https://bugs.webkit.org/show_bug.cgi?id=193080

Reviewed by Dean Jackson.

This is a translation of https://github.com/gpuweb/WHLSL/blob/master/Source/Checker.mjs into C++.

The Checker passes types between nested expressions. An inner expression figures out what type it is, and
passes that information up to an outer expression. This is done via reading/writing into a HashMap,
because all the type information needs to be saved so that the Metal codegen can emit the correct types.

These types can have two forms: A regular type (like "int[]") or a ResolvableType. ResolvableTypes
represent literals, since a literal needs to know its context before it knows what type it should be. So,
if you have a function like "void foo(int x)" and you have a call like "foo(3)", the 3's ResolvableType
gets passed to the CallExpression, which then unifies it with the function's parameter type, thereby
resolving the 3 to be an int.

There are a few examples where multiple expressions will have the same type: "return (foo, 3)." If those
types are regular types, then it's no problem; we can just clone() the type and stick both in the HashMap.
However, if the type is a ResolvableType, an outer expression will only resolve that type once, so the two
ResolvableTypes can't be distinct. The Checker solves this problem by making a reference-counted wrapper
around ResolvableTypes and using that in the HashMap instead.

Once all the ResolvableTypes have been resolved, a second pass runs through the entire HashMap and assigns
the known types to all the expressions. LValues and their associated address spaces are held in a parallel
HashMap, and are assigned to the expression at the same time. The type is an Optional<AddressSpace> because
address spaces are only relevant if the value is an lvalue; if it's nullopt then that means the expression
is an rvalue.

No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
of test. When enough of the compiler is present, I'll port the reference implementation's test suite.

* Modules/webgpu/WHLSL/WHLSLChecker.cpp: Added.
(WebCore::WHLSL::resolveWithOperatorAnderIndexer):
(WebCore::WHLSL::resolveWithOperatorLength):
(WebCore::WHLSL::resolveWithReferenceComparator):
(WebCore::WHLSL::resolveByInstantiation):
(WebCore::WHLSL::checkSemantics):
(WebCore::WHLSL::checkOperatorOverload):
(WebCore::WHLSL::Checker::Checker):
(WebCore::WHLSL::Checker::visit):
(WebCore::WHLSL::Checker::assignTypes):
(WebCore::WHLSL::Checker::checkShaderType):
(WebCore::WHLSL::matchAndCommit):
(WebCore::WHLSL::Checker::recurseAndGetInfo):
(WebCore::WHLSL::Checker::getInfo):
(WebCore::WHLSL::Checker::assignType):
(WebCore::WHLSL::Checker::forwardType):
(WebCore::WHLSL::getUnnamedType):
(WebCore::WHLSL::Checker::finishVisitingPropertyAccess):
(WebCore::WHLSL::Checker::recurseAndWrapBaseType):
(WebCore::WHLSL::Checker::isBoolType):
(WebCore::WHLSL::Checker::recurseAndRequireBoolType):
(WebCore::WHLSL::check):
* Modules/webgpu/WHLSL/WHLSLChecker.h: Added.
* Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp: Added.
(WebCore::WHLSL::Gatherer::Gatherer):
(WebCore::WHLSL::Gatherer::reset):
(WebCore::WHLSL::Gatherer::takeEntryPointItems):
(WebCore::WHLSL::Gatherer::visit):
(WebCore::WHLSL::gatherEntryPointItems):
* Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.h: Added.
(WebCore::WHLSL::EntryPointItem::EntryPointItem):
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

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

9 months agoSplit headerValueForVary into specialized functions for NetworkProcess and WebProcess...
achristensen@apple.com [Tue, 15 Jan 2019 05:15:57 +0000 (05:15 +0000)]
Split headerValueForVary into specialized functions for NetworkProcess and WebProcess/WebKitLegacy
https://bugs.webkit.org/show_bug.cgi?id=193429

Reviewed by Joseph Pecoraro.

Source/WebCore:

headerValueForVary is a strange function that is causing trouble with my NetworkProcess global state removal project.
It currently accesses the cookie storage to see if there's a match in two different ways currently written as fallbacks.
In the WebProcess or in WebKitLegacy, it uses cookiesStrategy to access cookies via IPC or directly, respectively,
depending on the PlatformStrategies implementation of cookiesStrategy for that process.
In the NetworkProcess, it uses WebCore::NetworkStorageSession to access cookies directly.
Both of these cookie accessing methods use global state in the process, and I must split them to refactor them separately.
This patch does the split by passing in the method of cookie access: a CookiesStrategy& or a NetworkStorageSession&.
Further refactoring will be done in bug 193368 and bug 161106 to build on this and replace the global state with
member variables of the correct containing objects.

* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::setResponse):
(WebCore::CachedResource::varyHeaderValuesMatch):
* platform/network/CacheValidation.cpp:
(WebCore::cookieRequestHeaderFieldValue):
(WebCore::headerValueForVary):
(WebCore::collectVaryingRequestHeaders):
(WebCore::verifyVaryingRequestHeaders):
* platform/network/CacheValidation.h:

Source/WebKit:

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::makeUseDecision):
(WebKit::NetworkCache::Cache::retrieve):
(WebKit::NetworkCache::Cache::makeEntry):
(WebKit::NetworkCache::Cache::makeRedirectEntry):
(WebKit::NetworkCache::Cache::update):

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

9 months agoMove a test implementation file that got misplaced in the Xcode project
timothy_horton@apple.com [Tue, 15 Jan 2019 04:11:15 +0000 (04:11 +0000)]
Move a test implementation file that got misplaced in the Xcode project

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:

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

9 months agoFix a style mistake in PageClientImplMac
timothy_horton@apple.com [Tue, 15 Jan 2019 04:03:28 +0000 (04:03 +0000)]
Fix a style mistake in PageClientImplMac

* UIProcess/mac/PageClientImplMac.h:
Somehow these methods ended up above the members.

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

9 months agoOnly run the node comparison code in FrameSelection::respondToNodeModification()...
simon.fraser@apple.com [Tue, 15 Jan 2019 03:31:41 +0000 (03:31 +0000)]
Only run the node comparison code in FrameSelection::respondToNodeModification() for range selections
https://bugs.webkit.org/show_bug.cgi?id=193416

Reviewed by Wenson Hsieh.

The code inside the m_selection.firstRange() clause needs to only run for non-collapsed selections, and
it shows up on Speedometer profiles so optimize to only run this code if we have a selection range.

* editing/FrameSelection.cpp:
(WebCore::FrameSelection::respondToNodeModification):

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

9 months agoUse unorm2_normalize instead of precomposedStringWithCanonicalMapping in userVisibleS...
mcatanzaro@igalia.com [Tue, 15 Jan 2019 03:26:04 +0000 (03:26 +0000)]
Use unorm2_normalize instead of precomposedStringWithCanonicalMapping in userVisibleString
https://bugs.webkit.org/show_bug.cgi?id=192945

Reviewed by Alex Christensen.

Replace use of the nice NSString function precomposedStringWithCanonicalMapping with the ICU
API unorm2_normalize. This is to prep the code for translation to cross-platform C++. Of
course this is much worse than the preexisting code, but this is just a transitional
measure and not the final state of the code. It wouldn't make sense to do this if the code
were to remain Objective C++.

* wtf/cocoa/NSURLExtras.mm:
(WTF::toNormalizationFormC):
(WTF::userVisibleString):

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

9 months agoAdd option to JSC to dump memory footprint on script completion
msaboff@apple.com [Tue, 15 Jan 2019 03:01:31 +0000 (03:01 +0000)]
Add option to JSC to dump memory footprint on script completion
https://bugs.webkit.org/show_bug.cgi?id=193422

Reviewed by Mark Lam.

Added the --footprint option to dump peak and current memory usage.  This uses the same
OS calls added in r2362362.

* jsc.cpp:
(printUsageStatement):
(CommandLine::parseArguments):
(jscmain):

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

9 months agoSkip type-check-hoisting-phase-hoist... with no jit
keith_miller@apple.com [Tue, 15 Jan 2019 02:37:33 +0000 (02:37 +0000)]
Skip type-check-hoisting-phase-hoist... with no jit
https://bugs.webkit.org/show_bug.cgi?id=193421

Reviewed by Mark Lam.

It's timing out the 32-bit bots and takes 330 seconds
on my machine when run by itself.

* stress/type-check-hoisting-phase-hoist-check-structure-on-tdz-this-value.js:

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

9 months agoBulgarian TLD should not punycode-encode URLs with Bulgarian Cyrillic characters
achristensen@apple.com [Tue, 15 Jan 2019 02:14:16 +0000 (02:14 +0000)]
Bulgarian TLD should not punycode-encode URLs with Bulgarian Cyrillic characters
https://bugs.webkit.org/show_bug.cgi?id=193411
<rdar://problem/47215929>

Reviewed by Alexey Proskuryakov.

Source/WTF:

* wtf/cocoa/NSURLExtras.mm:
(WTF::allCharactersAllowedByTLDRules):

LayoutTests:

* fast/url/user-visible/cyrillic-NFD-expected.txt:
* fast/url/user-visible/cyrillic-NFD.html:

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

9 months agoRestructure http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html to...
wilander@apple.com [Tue, 15 Jan 2019 01:51:13 +0000 (01:51 +0000)]
Restructure http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html to address flakiness
https://bugs.webkit.org/show_bug.cgi?id=191211
<rdar://problem/45818606>

Unreviewed test gardening.

This test is flaky on the MacOS WK2 bot. The patch avoids a page navigation and
redirect which may avoid the code that changed in
https://trac.webkit.org/changeset/237735/webkit and made the test more flaky.

* http/tests/resourceLoadStatistics/remove-blocking-in-redirect-expected.txt:
* http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html:

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

9 months agoAnimation and other code is too aggressive about invalidating layer composition
simon.fraser@apple.com [Tue, 15 Jan 2019 01:31:48 +0000 (01:31 +0000)]
Animation and other code is too aggressive about invalidating layer composition
https://bugs.webkit.org/show_bug.cgi?id=193343

Reviewed by Antoine Quint.

Source/WebCore:

We used to have the concept of a "SyntheticStyleChange", which was used to trigger
style updates for animation, and also to get compositing updated.

That morphed into a call to Element::invalidateStyleAndLayerComposition(), which causes
a style update to result in a "RecompositeLayer" diff, which in turn triggers compositing work,
and dirties DOM touch event regions (which can be expensive to update).

However, not all the callers of Element::invalidateStyleAndLayerComposition() need to trigger
compositing, and doing so from animations caused excessive touch event regions on yahoo.com,
which has several visibility:hidden elements with background-position animation.

So fix callers of invalidateStyleAndLayerComposition() which don't care about compositing to instead
call just invalidateStyle().

Also fix KeyframeAnimation::animate to correctly return true when animation state changes—it failed to
do so, because fireAnimationEventsIfNeeded() can run the state machine and change state.

* animation/KeyframeEffect.cpp:
(WebCore::invalidateElement):
* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::setNeedsStyleRecalc):
* page/animation/CSSAnimationController.cpp:
(WebCore::CSSAnimationControllerPrivate::updateAnimations):
(WebCore::CSSAnimationControllerPrivate::fireEventsAndUpdateStyle):
(WebCore::CSSAnimationControllerPrivate::pauseAnimationAtTime):
(WebCore::CSSAnimationControllerPrivate::pauseTransitionAtTime):
(WebCore::CSSAnimationController::cancelAnimations):
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::animate):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::imageChanged):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects const):
* rendering/svg/SVGResourcesCache.cpp:
(WebCore::SVGResourcesCache::clientStyleChanged):
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::createAnimatedElementUpdate):
* svg/SVGAnimateElementBase.cpp:
(WebCore::applyCSSPropertyToTarget):
(WebCore::removeCSSPropertyFromTarget):

LayoutTests:

This test was clobbering the 'box' class on the animating element and therefore making it disappear.

* legacy-animation-engine/compositing/animation/animation-compositing.html:

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

9 months ago[JSC] AI should check the given constant's array type when folding GetByVal into...
yusukesuzuki@slowstart.org [Tue, 15 Jan 2019 01:26:43 +0000 (01:26 +0000)]
[JSC] AI should check the given constant's array type when folding GetByVal into constant
https://bugs.webkit.org/show_bug.cgi?id=193413
<rdar://problem/46092389>

Reviewed by Keith Miller.

JSTests:

This test is super flaky. It causes crash in r238109, but it does not crash with `--useConcurrentJIT=false`.
It does not cause any crashes on the latest revision too. Basically, it highly depends on the timing, and
without this patch, the root cause is not fixed yet. If GetLocal is turned into JSConstant in AI,
but GetByVal does not have appropriate ArrayModes, JSC crashes.

* stress/ai-should-perform-array-check-on-get-by-val-constant-folding.js: Added.
(compareArray):

Source/JavaScriptCore:

If GetByVal's DFG::ArrayMode's type is Array::Double, we expect that the result of GetByVal is Double, since we already performed CheckStructure or CheckArray
to ensure this array type. But this assumption on the given value becomes wrong in AI, since CheckStructure may not perform filtering. And the proven AbstractValue
in GetByVal would not be expected one.

We have the graph before performing constant folding.

53:<!0:->     GetLocal(Check:Untyped:@77, JS|MustGen|UseAsOther, Array, arg2(C<Array>/FlushedCell), R:Stack(7), bc#37, ExitValid)  predicting Array
54:< 1:->     JSConstant(JS|PureNum|UseAsOther|UseAsInt|ReallyWantsInt, BoolInt32, Int32: 0, bc#37, ExitValid)
93:<!0:->     CheckStructure(Cell:@53, MustGen, [%C7:Array], R:JSCell_structureID, Exits, bc#37, ExitValid)
94:< 1:->     GetButterfly(Check:Cell:@53, Storage|PureInt, R:JSObject_butterfly, Exits, bc#37, ExitValid)
55:<!0:->     GetByVal(Check:KnownCell:@53, Check:Int32:@54, Check:Untyped:@94, Double|MustGen|VarArgs|PureInt, AnyIntAsDouble|NonIntAsdouble, Double+OriginalCopyOnWriteArray+SaneChain+AsIs+Read, R:Butterfly_publicLength,IndexedDoubleProperties, Exits, bc#37, ExitValid)  predicting StringIdent|NonIntAsdouble

And 53 is converted to JSConstant in the constant folding. It leads to constant folding attempt in GetByVal.

53:< 1:->     JSConstant(JS|UseAsOther, Array, Weak:Object: 0x117fb4370 with butterfly 0x8000e4050 (Structure %BV:Array), StructureID: 104, bc#37, ExitValid)
54:< 1:->     JSConstant(JS|PureNum|UseAsOther|UseAsInt|ReallyWantsInt, BoolInt32, Int32: 0, bc#37, ExitValid)
93:<!0:->     CheckStructure(Cell:@53, MustGen, [%C7:Array], R:JSCell_structureID, Exits, bc#37, ExitValid)
94:< 1:->     GetButterfly(Check:Cell:@53, Storage|PureInt, R:JSObject_butterfly, Exits, bc#37, ExitValid)
55:<!0:->     GetByVal(Check:KnownCell:@53, Check:Int32:@54, Check:Untyped:@94, Double|MustGen|VarArgs|PureInt, AnyIntAsDouble|NonIntAsdouble, Double+OriginalCopyOnWriteArray+SaneChain+AsIs+Read, R:Butterfly_publicLength,IndexedDoubleProperties, Exits, bc#37, ExitValid)  predicting StringIdent|NonIntAsdouble

GetByVal gets constant Array from @53, and attempt to perform constant folding by leverating CoW state: if the given array's butterfly is CoW and we performed CoW array check for this GetByVal, the array would not be changed as long as the check works.
However, CheckStructure for @53 does not filter anything at AI. So, if @53 is CopyOnWrite | Contiguous array (not CopyOnWrite | Double array!), GetByVal will get a JSValue. But it does not meet the requirement of GetByVal since it has Double Array mode, and says it returns Double.
Here, CheckStructure is valid because structure of the constant object would be changed. What we should do is additional CoW & ArrayShape check in GetByVal when folding since this node leverages CoW's interesting feature,
"If CoW array check (CheckStructure etc.) is emitted by GetByVal's DFG::ArrayMode, the content is not changed from the creation!".

This patch adds ArrayShape check in addition to CoW status check in GetByVal.

Unfortunately, this crash is very flaky. In the above case, if @53 stays GetLocal after the constant folding phase, this issue does not occur. We can see this crash in r238109, but it is really hard to reproduce it in the current ToT.
I verified this fix works in r238109 with the attached test.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGAbstractValue.cpp:
(JSC::DFG::AbstractValue::fixTypeForRepresentation):

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

9 months ago[macOS] Remove reporting for mach lookups confirmed in-use
pvollan@apple.com [Tue, 15 Jan 2019 00:55:51 +0000 (00:55 +0000)]
[macOS] Remove reporting for mach lookups confirmed in-use
https://bugs.webkit.org/show_bug.cgi?id=193415
<rdar://problem/47266542>

Reviewed by Brent Fulgham.

Also, start denying the services which have not been confirmed to be in use.

* WebProcess/com.apple.WebProcess.sb.in:

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

9 months ago[BigInt] Literal parsing is crashing when used inside a Object Literal
ticaiolima@gmail.com [Tue, 15 Jan 2019 00:39:28 +0000 (00:39 +0000)]
[BigInt] Literal parsing is crashing when used inside a Object Literal
https://bugs.webkit.org/show_bug.cgi?id=193404

Reviewed by Yusuke Suzuki.

JSTests:

* stress/big-int-literal-inside-literal-object.js: Added.

Source/JavaScriptCore:

Former implementation was relying into token.m_data.radix after the
call of `next()` into Parser.cpp. This is not safe because next
clobbers token.m_data.radix in some cases (e.g is CLOSEBRACE).
Now we get radix value before calling `next()` into parser and store
in a local variable.

* parser/Parser.cpp:
(JSC::Parser<LexerType>::parsePrimaryExpression):

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

9 months agoIndexedDB: When deleting databases, some open databases might be missed
sihui_liu@apple.com [Tue, 15 Jan 2019 00:19:17 +0000 (00:19 +0000)]
IndexedDB: When deleting databases, some open databases might be missed
https://bugs.webkit.org/show_bug.cgi?id=193090

Reviewed by Brady Eidson.

We should close all databases with an open backing store instead of looking at which ones have an open database
connection. This is because a database might be in the process of getting a backing store before its connection
has been created.

* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince):
(WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesForOrigins):

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

9 months agoImport current Resource-Timing WPTs
commit-queue@webkit.org [Tue, 15 Jan 2019 00:00:04 +0000 (00:00 +0000)]
Import current Resource-Timing WPTs
https://bugs.webkit.org/show_bug.cgi?id=193302

Patch by Charles Vazac <cvazac@akamai.com> on 2019-01-14
Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

* web-platform-tests/resource-timing/SyntheticResponse.py:
(main):
* web-platform-tests/resource-timing/buffer-full-add-after-full-event-expected.txt: Added.
* web-platform-tests/resource-timing/buffer-full-add-after-full-event.html: Added.
* web-platform-tests/resource-timing/buffer-full-add-entries-during-callback-expected.txt: Added.
* web-platform-tests/resource-timing/buffer-full-add-entries-during-callback-that-drop.html: Added.
* web-platform-tests/resource-timing/buffer-full-add-entries-during-callback.html: Added.
* web-platform-tests/resource-timing/buffer-full-add-then-clear-expected.txt: Added.
* web-platform-tests/resource-timing/buffer-full-add-then-clear.html: Added.
* web-platform-tests/resource-timing/buffer-full-decrease-buffer-during-callback.html: Added.
* web-platform-tests/resource-timing/buffer-full-increase-buffer-during-callback-expected.txt: Added.
* web-platform-tests/resource-timing/buffer-full-increase-buffer-during-callback.html: Added.
* web-platform-tests/resource-timing/buffer-full-inspect-buffer-during-callback-expected.txt: Added.
* web-platform-tests/resource-timing/buffer-full-inspect-buffer-during-callback.html: Added.
* web-platform-tests/resource-timing/buffer-full-set-to-current-buffer-expected.txt: Added.
* web-platform-tests/resource-timing/buffer-full-set-to-current-buffer.html: Added.
* web-platform-tests/resource-timing/buffer-full-store-and-clear-during-callback-expected.txt: Added.
* web-platform-tests/resource-timing/buffer-full-store-and-clear-during-callback.html: Added.
* web-platform-tests/resource-timing/buffer-full-then-increased-expected.txt: Added.
* web-platform-tests/resource-timing/buffer-full-then-increased.html: Added.
* web-platform-tests/resource-timing/buffer-full-when-populate-entries-expected.txt: Added.
* web-platform-tests/resource-timing/buffer-full-when-populate-entries.html: Added.
* web-platform-tests/resource-timing/document-domain-no-impact-loader.sub-expected.txt: Added.
* web-platform-tests/resource-timing/document-domain-no-impact-loader.sub.html: Added.
* web-platform-tests/resource-timing/no-entries-for-cross-origin-css-fetched.sub-expected.txt: Added.
* web-platform-tests/resource-timing/no-entries-for-cross-origin-css-fetched.sub.html: Added.
* web-platform-tests/resource-timing/resource-timing-level1.js: Renamed from LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource-timing.js.
(assertInvariants):
(window.onload):
* web-platform-tests/resource-timing/resource-timing-level1.sub-expected.txt: Added.
* web-platform-tests/resource-timing/resource-timing-level1.sub.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource-timing.html.
* web-platform-tests/resource-timing/resource_connection_reuse.html:
* web-platform-tests/resource-timing/resource_timing.worker.js:
* web-platform-tests/resource-timing/resource_timing_buffer_full_when_populate_entries-expected.txt: Removed.
* web-platform-tests/resource-timing/resource_timing_buffer_full_when_populate_entries.html: Removed.
* web-platform-tests/resource-timing/resource_timing_store_and_clear_during_callback-expected.txt: Removed.
* web-platform-tests/resource-timing/resource_timing_store_and_clear_during_callback.html: Removed.
* web-platform-tests/resource-timing/resources/buffer-full-utilities.js: Added.
(let.appendScript):
(let.waitForNextTask):
(let.waitForEventToFire.return.new.Promise):
(let.waitForEventToFire):
* web-platform-tests/resource-timing/resources/document-domain-no-impact.sub.html: Added.
* web-platform-tests/resource-timing/resources/iframe-setdomain.sub.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/resource-timing/iframe-setdomain.sub.html.
* web-platform-tests/resource-timing/resources/w3c-import.log:
* web-platform-tests/resource-timing/resources/webperftestharness.js:
(wp_test):
(test_namespace):
* web-platform-tests/resource-timing/resources/webperftestharnessextension.js:
(test_resource_entries):
(performance_entrylist_checker): Deleted.
* web-platform-tests/resource-timing/single-entry-per-resource.html:
* web-platform-tests/resource-timing/supported_resource_type.any-expected.txt: Added.
* web-platform-tests/resource-timing/supported_resource_type.any.html: Added.
* web-platform-tests/resource-timing/supported_resource_type.any.js: Added.
(test):
* web-platform-tests/resource-timing/supported_resource_type.any.worker-expected.txt: Added.
* web-platform-tests/resource-timing/supported_resource_type.any.worker.html: Added.
* web-platform-tests/resource-timing/test_resource_timing.https-expected.txt: Added.
* web-platform-tests/resource-timing/test_resource_timing.https.html: Added.
* web-platform-tests/resource-timing/test_resource_timing.js:
(resource_load):
* web-platform-tests/resource-timing/w3c-import.log:

LayoutTests:

* TestExpectations:
* tests-options.json:

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

9 months agoUnreviewed, test fixes after r239852.
jiewen_tan@apple.com [Mon, 14 Jan 2019 23:45:41 +0000 (23:45 +0000)]
Unreviewed, test fixes after r239852.

* http/wpt/webauthn/public-key-credential-create-success-hid.https.html:
* http/wpt/webauthn/public-key-credential-create-success-u2f.https.html:
* http/wpt/webauthn/public-key-credential-get-success-hid.https.html:
* http/wpt/webauthn/public-key-credential-get-success-u2f.https.html:

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

9 months agoWeb Inspector: Event breakpoints: typing uppercase "DOM" doesn't show completions...
drousso@apple.com [Mon, 14 Jan 2019 23:22:46 +0000 (23:22 +0000)]
Web Inspector: Event breakpoints: typing uppercase "DOM" doesn't show completions for events that start with "DOM"
https://bugs.webkit.org/show_bug.cgi?id=193384

Reviewed by Joseph Pecoraro.

* UserInterface/Views/EventBreakpointPopover.js:
(WI.EventBreakpointPopover.prototype.show):

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

9 months agoWeb Inspector: Event breakpoints: text field and completion popover fonts should...
drousso@apple.com [Mon, 14 Jan 2019 22:52:31 +0000 (22:52 +0000)]
Web Inspector: Event breakpoints: text field and completion popover fonts should match
https://bugs.webkit.org/show_bug.cgi?id=193249

Reviewed by Matt Baker.

* UserInterface/Views/EventBreakpointPopover.css:
(.popover .event-breakpoint-content > .event-type > input): Added.
(.popover .event-breakpoint-content > .event-type > input::placeholder): Added.
* UserInterface/Views/EventBreakpointPopover.js:
(WI.EventBreakpointPopover.prototype.show):
(WI.EventBreakpointPopover.prototype._showSuggestionsView):
Subtract the <input> border and padding from the bounds position so the <input> text lines
up with the `WI.CompletionSuggestionsView` text.

* UserInterface/Views/CompletionSuggestionsView.js:
(WI.CompletionSuggestionsView):
Drive-by: force `dir=ltr` to match the `text-align: left;` CSS styling.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239953 268f45cc-cd09-0410-ab3c-d52691b4dbfc

9 months agoRemove redundant check for alignAttr and hiddenAttr in various isPresentationAttribut...
rniwa@webkit.org [Mon, 14 Jan 2019 22:51:56 +0000 (22:51 +0000)]
Remove redundant check for alignAttr and hiddenAttr in various isPresentationAttribute overrides
https://bugs.webkit.org/show_bug.cgi?id=193410

Reviewed by Simon Fraser.

Removed redundant checks for check for alignAttr and hiddenAttr in isPresentationAttribute overrides
in HTMLElement subclasses since HTMLElement::isPresentationAttribute already checks for those attributes.

* html/HTMLDivElement.cpp:
(WebCore::HTMLDivElement::isPresentationAttribute const): Deleted.
* html/HTMLDivElement.h:
* html/HTMLEmbedElement.cpp:
(WebCore::HTMLEmbedElement::isPresentationAttribute const): Deleted.
* html/HTMLEmbedElement.h:
* html/HTMLHRElement.cpp:
(WebCore::HTMLHRElement::isPresentationAttribute const):
* html/HTMLIFrameElement.cpp:
(WebCore::HTMLIFrameElement::isPresentationAttribute const):
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::isPresentationAttribute const):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::isPresentationAttribute const):
* html/HTMLParagraphElement.cpp:
(WebCore::HTMLParagraphElement::isPresentationAttribute const): Deleted.
* html/HTMLParagraphElement.h:
* html/HTMLTableCaptionElement.cpp:
(WebCore::HTMLTableCaptionElement::isPresentationAttribute const): Deleted.
* html/HTMLTableCaptionElement.h:
* html/HTMLTableElement.cpp:
(WebCore::HTMLTableElement::isPresentationAttribute const):
* html/HTMLTablePartElement.cpp:
(WebCore::HTMLTablePartElement::isPresentationAttribute const):

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

9 months ago[JSC] Do not use asArrayModes() with Structures because it discards TypedArray inform...
yusukesuzuki@slowstart.org [Mon, 14 Jan 2019 22:31:06 +0000 (22:31 +0000)]
[JSC] Do not use asArrayModes() with Structures because it discards TypedArray information
https://bugs.webkit.org/show_bug.cgi?id=193372

Reviewed by Saam Barati.

JSTests:

* stress/typed-array-array-modes-profile.js: Added.
(foo):

Source/JavaScriptCore:

When RegisteredStructureSet is filtered with AbstractValue, we use structure, SpeculationType, and ArrayModes.
However, we use asArrayModes() function with IndexingMode to compute the ArrayModes in AbstractValue. This is
wrong since this discards TypedArray ArrayModes. As a result, if RegisteredStructureSet with TypedArrays is
filtered with ArrayModes of AbstractValue populated from TypedArrays, we filter all the structures out since
AbstractValue's ArrayModes become NonArray, which is wrong with the TypedArrays' ArrayModes. This leads to
incorrect FTL code generation with MultiGetByOffset etc. nodes because,

1. AI think that this MultiGetByOffset never succeeds since all the values of RegisteredStructureSet are filtered out by the AbstractValue.
2. AI says the state of MultiGetByOffset is invalid since AI think it never succeeds.
3. So subsequent code becomes FTL crash code since AI think the execution should do OSR exit.
4. Then, FTL emits the code for MultiGetByOffset, and emits crash after that.
5. But in reality, the incoming value can match to the one of the RegisteredStructureSet value since (1)'s structures are incorrectly filtered by the incorrect ArrayModes.
6. Then, the execution goes on, and falls into the FTL crash.

This patch fixes the incorrect ArrayModes calculation by the following changes

1. Rename asArrayModes to asArrayModesIgnoringTypedArrays.
2. Fix incorrect asArrayModesIgnoringTypedArrays use in our code. Use arrayModesFromStructure instead.
3. Fix OSR exit code which stores incorrect ArrayModes to the profiles.

* bytecode/ArrayProfile.cpp:
(JSC::dumpArrayModes):
(JSC::ArrayProfile::computeUpdatedPrediction):
* bytecode/ArrayProfile.h:
(JSC::asArrayModesIgnoringTypedArrays):
(JSC::arrayModesFromStructure):
(JSC::arrayModesIncludeIgnoringTypedArrays):
(JSC::shouldUseSlowPutArrayStorage):
(JSC::shouldUseFastArrayStorage):
(JSC::shouldUseContiguous):
(JSC::shouldUseDouble):
(JSC::shouldUseInt32):
(JSC::asArrayModes): Deleted.
(JSC::arrayModeFromStructure): Deleted.
(JSC::arrayModesInclude): Deleted.
* dfg/DFGAbstractValue.cpp:
(JSC::DFG::AbstractValue::observeTransitions):
(JSC::DFG::AbstractValue::set):
(JSC::DFG::AbstractValue::mergeOSREntryValue):
(JSC::DFG::AbstractValue::contains const):
* dfg/DFGAbstractValue.h:
(JSC::DFG::AbstractValue::observeTransition):
(JSC::DFG::AbstractValue::validate const):
(JSC::DFG::AbstractValue::observeIndexingTypeTransition):
* dfg/DFGArrayMode.cpp:
(JSC::DFG::ArrayMode::fromObserved):
(JSC::DFG::ArrayMode::alreadyChecked const):
* dfg/DFGArrayMode.h:
(JSC::DFG::ArrayMode::structureWouldPassArrayModeFiltering):
(JSC::DFG::ArrayMode::arrayModesThatPassFiltering const):
(JSC::DFG::ArrayMode::arrayModesWithIndexingShape const):
* dfg/DFGOSRExit.cpp:
(JSC::DFG::OSRExit::executeOSRExit):
(JSC::DFG::OSRExit::compileExit):
* dfg/DFGRegisteredStructureSet.cpp:
(JSC::DFG::RegisteredStructureSet::filterArrayModes):
(JSC::DFG::RegisteredStructureSet::arrayModesFromStructures const):
* ftl/FTLOSRExitCompiler.cpp:
(JSC::FTL::compileStub):
* jit/JITInlines.h:
(JSC::JIT::chooseArrayMode):
(JSC::arrayProfileSaw): Deleted.
* runtime/JSType.h:
(JSC::isTypedArrayType):

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

9 months agoUnreviewed, rolling out r239901, r239909, r239910, r239912,
commit-queue@webkit.org [Mon, 14 Jan 2019 22:19:50 +0000 (22:19 +0000)]
Unreviewed, rolling out r239901, r239909, r239910, r239912,
r239913, and r239914.
https://bugs.webkit.org/show_bug.cgi?id=193407

These revisions caused an internal failure (Requested by
Truitt on #webkit).

Reverted changesets:

"[Cocoa] Avoid importing directly from subumbrella frameworks"
https://bugs.webkit.org/show_bug.cgi?id=186016
https://trac.webkit.org/changeset/239901

"Tried to fix USE(APPLE_INTERNAL_SDK) builds after r239901."
https://trac.webkit.org/changeset/239909

"Tried to fix the build."
https://trac.webkit.org/changeset/239910

"Fixed iOS builds after r239910."
https://trac.webkit.org/changeset/239912

"More build fixing."
https://trac.webkit.org/changeset/239913

"Tried to fix USE(APPLE_INTERNAL_SDK) 32-bit builds."
https://trac.webkit.org/changeset/239914

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

9 months agoRe-enable ability to build --cloop builds.
mark.lam@apple.com [Mon, 14 Jan 2019 22:16:50 +0000 (22:16 +0000)]
Re-enable ability to build --cloop builds.
https://bugs.webkit.org/show_bug.cgi?id=192955
Source/JavaScriptCore:

<rdar://problem/46882363>

Reviewed by Saam barati and Keith Miller.

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

Reviewed by Saam barati and Keith Miller.

* Configurations/FeatureDefines.xcconfig:

Source/WebCore/PAL:

<rdar://problem/46882363>

Reviewed by Saam barati and Keith Miller.

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

<rdar://problem/46882363>

Reviewed by Saam barati and Keith Miller.

* Configurations/FeatureDefines.xcconfig:

Source/WebKitLegacy/mac:

<rdar://problem/46882363>

Reviewed by Saam barati and Keith Miller.

* Configurations/FeatureDefines.xcconfig:

Tools:

<rdar://problem/46882363>

Reviewed by Saam barati and Keith Miller.

The --cloop build option was being ignored this whole time since r236381.
This patch makes it possible to build CLoop builds again.

* Scripts/build-jsc:
* Scripts/webkitperl/FeatureList.pm:
* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

9 months agohttps://bugs.webkit.org/show_bug.cgi?id=193403
jer.noble@apple.com [Mon, 14 Jan 2019 22:10:18 +0000 (22:10 +0000)]
https://bugs.webkit.org/show_bug.cgi?id=193403
<rdar://problem/46750743>

Continue fix in r239711 by using WeakPtr in SourceBufferPrivateAVFObjC.

Reviewed by Eric Carlson.

* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::setCDMSession):

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

9 months agowebkitpy: Expose device_type from host-like objects
jbedard@apple.com [Mon, 14 Jan 2019 22:02:18 +0000 (22:02 +0000)]
webkitpy: Expose device_type from host-like objects
https://bugs.webkit.org/show_bug.cgi?id=193406
<rdar://problem/47262305>

Reviewed by Lucas Forschler.

Devices should expose device_type. As a result, all host objects should
provide a device_type property, even if they do not yet define a device_type.

* Scripts/webkitpy/common/system/systemhost.py:
(SystemHost):
(SystemHost.device_type):
* Scripts/webkitpy/common/system/systemhost_mock.py:
(MockSystemHost):
(MockSystemHost.device_type):
* Scripts/webkitpy/port/device.py:
(Device):
(Device.device_type):
* Scripts/webkitpy/xcode/simulated_device.py:
(SimulatedDeviceManager._find_exisiting_device_for_request):
(SimulatedDeviceManager._disambiguate_device_type):
(SimulatedDeviceManager._does_fulfill_request):
(SimulatedDeviceManager.device_count_for_type):
(SimulatedDeviceManager.initialize_devices):
* Scripts/webkitpy/xcode/simulated_device_unittest.py:
(test_available_devices):
(test_swapping_devices):

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

9 months ago[WebGPU] Map WebGPUBindGroupLayoutBindings from the BindGroupLayoutDescriptor for...
justin_fan@apple.com [Mon, 14 Jan 2019 21:56:07 +0000 (21:56 +0000)]
[WebGPU] Map WebGPUBindGroupLayoutBindings from the BindGroupLayoutDescriptor for error checking and later referencing
https://bugs.webkit.org/show_bug.cgi?id=193405

Reviewed by Dean Jackson.

Source/WebCore:

When creating a WebGPUBindGroupLayout, cache the WebGPUBindGroupLayoutDescriptor's list of BindGroupLayoutBindings
in a HashMap, keyed by binding number, for quick reference during the WebGPUProgrammablePassEncoder::setBindGroups
implementation to follow. Also add error-checking e.g. detecting duplicate binding numbers in the same WebGPUBindGroupLayout
and non-existent binding numbers when creating the WebGPUBindGroup.

No new tests. BindGroups and BindGroupLayouts reflect the (canonical?) strategy of returning empty
objects upon creation failure and reporting errors elswhere. Since error reporting is not yet implemented,
the error checks aren't testable from LayoutTests right now. Expected behavior unchanged and covered by existing tests.

* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createBindGroup const):
        Number of bindings must be consistent between bindings and layout bindings.
        BindGroupBindings should only refer to existing BindGroupLayoutBindings.
* platform/graphics/gpu/GPUBindGroup.h:
* platform/graphics/gpu/GPUBindGroupLayout.h:
(WebCore::GPUBindGroupLayout::bindingsMap const): Added. Cache map of BindGroupLayoutBindings.
* platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm: Disallow duplicate binding numbers in BindGroupLayoutBindings.
(WebCore::GPUBindGroupLayout::tryCreate):
(WebCore::GPUBindGroupLayout::GPUBindGroupLayout):

LayoutTests:

Small fixes that do not alter behavior.

* webgpu/bind-groups.html:
* webgpu/pipeline-layouts.html:

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

9 months agoFix all CLoop JSC test failures (including some LLInt bugs due to recent bytecode...
mark.lam@apple.com [Mon, 14 Jan 2019 21:34:47 +0000 (21:34 +0000)]
Fix all CLoop JSC test failures (including some LLInt bugs due to recent bytecode format change).
https://bugs.webkit.org/show_bug.cgi?id=193402
<rdar://problem/46012309>

Reviewed by Keith Miller.

JSTests:

* stress/regexp-compile-oom.js:
- Skip this test for !$jitTests because it is tuned for stack usage when the JIT
  is enabled.  As a result, it will fail on cloop builds though there is no bug.

Source/JavaScriptCore:

The CLoop builds via build-jsc were previously completely disabled after our
change to enable ASM LLInt build without the JIT.  As a result, JSC tests have
regressed on CLoop builds.  The CLoop builds and tests will be re-enabled when
the fix for https://bugs.webkit.org/show_bug.cgi?id=192955 lands.  This patch
fixes all the regressions (and some old bugs) so that the CLoop test bots won't
be red when CLoop build gets re-enabled.

In this patch, we do the following:

1. Change CLoopStack::grow() to set the new CLoop stack top at the maximum
   allocated capacity (after discounting the reserved zone) as opposed to setting
   it only at the level that the client requested.

   This fixes a small performance bug that I happened to noticed when I was
   debugging a stack issue.  It does not affect correctness.

2. In LowLevelInterpreter32_64.asm:

   1. Fix loadConstantOrVariableTag() to use subi for computing the constant
      index because the VirtualRegister offset and FirstConstantRegisterIndex
      values it is operating on are both signed ints.  This is just to be
      pedantic.  The previous use of subu will still produce a correct value.

   2. Fix llintOpWithReturn() to use getu (instead of get) for reading
      OpIsCellWithType::type because it is of type JSType, which is a uint8_t.

   3. Fix llintOpWithMetadata() to use loadis for loading
      OpGetById::Metadata::modeMetadata.protoLoadMode.cachedOffset[t5] because it
      is of type PropertyOffset, which is a signed int.

   4. Fix commonCallOp() to use getu for loading fields argv and argc because they
      are  of type unsigned for OpCall, OpConstruct, and OpTailCall, which are the
      clients of commonCallOp.

   5. Fix llintOpWithMetadata() and getClosureVar() to use loadp for loading
      OpGetFromScope::Metadata::operand because it is of type uintptr_t.

3. In LowLevelInterpreter64.asm:

   1. Fix llintOpWithReturn() to use getu for reading OpIsCellWithType::type
      because it is of type JSType, which is a uint8_t.

   2. Fix llintOpWithMetadata() to use loadi for loading
      OpGetById::Metadata::modeMetadata.protoLoadMode.structure[t2] because it is
      of type StructureID, which is a uint32_t.

      Fix llintOpWithMetadata() to use loadis for loading
      OpGetById::Metadata::modeMetadata.protoLoadMode.cachedOffset[t2] because it
      is of type PropertyOffset, which is a signed int.

   3. commonOp() should reload the metadataTable for op_catch because unlike
      for the ASM LLInt, the exception unwinding code is not able to restore
      "callee saved registers" for the CLoop interpreter because the CLoop uses
      pseudo-registers (see the CLoopRegister class).

      This was the source of many exotic Cloop failures after the bytecode format
      change (which introduced the metadataTable callee saved register).  Hence,
      we fix it by reloading metadataTable's value on re-entry via op_catch for
      exception handling.  We already take care of restoring it in op_ret.

   4. Fix llintOpWithMetadata() and getClosureVar() to use loadp for loading
      OpGetFromScope::Metadata::operand because it is of type uintptr_t.

4. In LowLevelInterpreter.asm:

   Fix metadata() to use loadi for loading metadataTable offsets because they are
   of type unsigned.  This was also a source of many exotic CLoop test failures.

5. Change CLoopRegister into a class with a uintptr_t as its storage element.
   Previously, we were using a union to convert between various value types that
   we would store in this pseudo-register.  This method of type conversion is
   undefined behavior according to the C++ spec.  As a result, the C++ compiler
   may choose to elide some CLoop statements, thereby resulting in some exotic
   bugs.

   We fix this by now always using accessor methods and assignment operators to
   ensure that we use bitwise_cast to do the type conversions.  Since bitwise_cast
   uses a memcpy, this ensures that there's no undefined behavior, and that CLoop
   statements won't get elided willy-nilly by the compiler.

   Ditto for the CloopDobleRegisters.

   Similarly, use bitwise_cast for ints2Double() and double2Ints() utility
   functions.

   Also use bitwise_cast (instead of reinterpret_cast) for the CLoop CAST macro.

6. Fix cloop.rb to use the new CLoopRegister and CLoopDoubleRegister classes.

   Add a clLValue accessor for offlineasm operand types to distinguish
   LValue use of the operands from RValue uses.

   Replace the use of clearHighWord() with simply casting to uint32_t.  This is
   more efficient for the C++ compiler (and help speed up debug build runs).

   Also fix 32-bit arithmetic operations to only set the lower 32-bit value of
   the pseudo registers.  This fixes some CLoop JSC test failures.

This patch has been manually tested with the JSC tests on the following builds:
64bit X86 ASM LLLint (without JIT), 64bit and 32bit X86 CLoop, and ARMv7 Cloop.

* interpreter/CLoopStack.cpp:
(JSC::CLoopStack::grow):
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter.cpp:
(JSC::CLoopRegister::i const):
(JSC::CLoopRegister::u const):
(JSC::CLoopRegister::i32 const):
(JSC::CLoopRegister::u32 const):
(JSC::CLoopRegister::i8 const):
(JSC::CLoopRegister::u8 const):
(JSC::CLoopRegister::ip const):
(JSC::CLoopRegister::i8p const):
(JSC::CLoopRegister::vp const):
(JSC::CLoopRegister::cvp const):
(JSC::CLoopRegister::callFrame const):
(JSC::CLoopRegister::execState const):
(JSC::CLoopRegister::instruction const):
(JSC::CLoopRegister::vm const):
(JSC::CLoopRegister::cell const):
(JSC::CLoopRegister::protoCallFrame const):
(JSC::CLoopRegister::nativeFunc const):
(JSC::CLoopRegister::i64 const):
(JSC::CLoopRegister::u64 const):
(JSC::CLoopRegister::encodedJSValue const):
(JSC::CLoopRegister::opcode const):
(JSC::CLoopRegister::operator ExecState*):
(JSC::CLoopRegister::operator const Instruction*):
(JSC::CLoopRegister::operator JSCell*):
(JSC::CLoopRegister::operator ProtoCallFrame*):
(JSC::CLoopRegister::operator Register*):
(JSC::CLoopRegister::operator VM*):
(JSC::CLoopRegister::operator=):
(JSC::CLoopRegister::bitsAsDouble const):
(JSC::CLoopRegister::bitsAsInt64 const):
(JSC::CLoopDoubleRegister::operator T const):
(JSC::CLoopDoubleRegister::d const):
(JSC::CLoopDoubleRegister::bitsAsInt64 const):
(JSC::CLoopDoubleRegister::operator=):
(JSC::LLInt::ints2Double):
(JSC::LLInt::double2Ints):
(JSC::LLInt::decodeResult):
(JSC::CLoop::execute):
(JSC::LLInt::Ints2Double): Deleted.
(JSC::LLInt::Double2Ints): Deleted.
(JSC::CLoopRegister::CLoopRegister): Deleted.
(JSC::CLoopRegister::clearHighWord): Deleted.
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* offlineasm/cloop.rb:

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

9 months agowebkitpy: Support alternate simctl device list output (Follow-up fix)
jbedard@apple.com [Mon, 14 Jan 2019 21:32:49 +0000 (21:32 +0000)]
webkitpy: Support alternate simctl device list output (Follow-up fix)
https://bugs.webkit.org/show_bug.cgi?id=193362
<rdar://problem/47122965>

Rubber-stamped by Lucas Forschler.

* Scripts/webkitpy/xcode/simulated_device.py:
(SimulatedDeviceManager.populate_available_devices):

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

9 months agoRemove unused networking entitlement from iOS WebProcess entitlements
commit-queue@webkit.org [Mon, 14 Jan 2019 21:27:59 +0000 (21:27 +0000)]
Remove unused networking entitlement from iOS WebProcess entitlements
https://bugs.webkit.org/show_bug.cgi?id=193267

Patch by Alex Christensen <achristensen@webkit.org> on 2019-01-14
Reviewed by Dean Jackson.

* Configurations/WebContent-iOS.entitlements:
This gave access to VPN stuff.  It's not needed any more.

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

9 months agoEnable MDNS ICE candidate support by default
youenn@apple.com [Mon, 14 Jan 2019 21:13:26 +0000 (21:13 +0000)]
Enable MDNS ICE candidate support by default
https://bugs.webkit.org/show_bug.cgi?id=193358

Reviewed by Geoffrey Garen.

* Shared/WebPreferences.yaml:

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

9 months agoWeb Inspector: Styles: pressing Down key on empty value field shouldn't discard compl...
nvasilyev@apple.com [Mon, 14 Jan 2019 21:07:57 +0000 (21:07 +0000)]
Web Inspector: Styles: pressing Down key on empty value field shouldn't discard completion popover
https://bugs.webkit.org/show_bug.cgi?id=193098
<rdar://problem/47016036>

Reviewed by Devin Rousso.

Hide CompletionSuggestionsView when SpreadsheetTextField moves, e.g. by scrolling or resizing the sidebar.
Update CompletionSuggestionsView position after pressing Up or Down key, because SpreadsheetTextField may
move from wrapping text.

* UserInterface/Views/CompletionSuggestionsView.js:
(WI.CompletionSuggestionsView.prototype.hide):
(WI.CompletionSuggestionsView.prototype.show):
(WI.CompletionSuggestionsView.prototype.showUntilAnchorMoves): Removed.
(WI.CompletionSuggestionsView.prototype.hideWhenElementMoves): Added.
(WI.CompletionSuggestionsView.prototype._stopMoveTimer): Added.
(WI.CompletionSuggestionsView):

* UserInterface/Views/SpreadsheetTextField.js:
(WI.SpreadsheetTextField.prototype.set suggestionHint):
(WI.SpreadsheetTextField.prototype.completionSuggestionsSelectedCompletion):
(WI.SpreadsheetTextField.prototype._handleKeyDownForSuggestionView):
(WI.SpreadsheetTextField.prototype._updateCompletions):
(WI.SpreadsheetTextField.prototype._showSuggestionsView): Added.

(WI.SpreadsheetTextField.prototype._reAttachSuggestionHint):
Drive-by: abstract out repeating code into a private method.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239935 268f45cc-cd09-0410-ab3c-d52691b4dbfc

9 months agoExpose preference for site-specific quirks on iOS
mrajca@apple.com [Mon, 14 Jan 2019 21:01:43 +0000 (21:01 +0000)]
Expose preference for site-specific quirks on iOS
https://bugs.webkit.org/show_bug.cgi?id=193353

Reviewed by Dean Jackson.

* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _setNeedsSiteSpecificQuirks:]):
(-[WKPreferences _needsSiteSpecificQuirks]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:

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

9 months agoJSC should have a module loader API
keith_miller@apple.com [Mon, 14 Jan 2019 20:27:17 +0000 (20:27 +0000)]
JSC should have a module loader API
https://bugs.webkit.org/show_bug.cgi?id=191121

Reviewed by Michael Saboff.

This patch adds a new delegate to JSContext that is called to fetch
any resolved module. The resolution of a module identifier is computed
as if it were a URL on the web with the caveat that it must be a file URL.

A new class JSScript has also been added that is similar to JSScriptRef.
Right now all JSScripts are copied into memory. In the future we should
mmap the provided file into memory so the OS can evict it to disk under
pressure. Additionally, the API does not make use of the code signing path
nor the bytecode caching path, which we will add in subsequent patches.

Lastly, a couple of new convenience methods have been added. C API
conversion, can now toRef a JSValue with just a vm rather than
requiring an ExecState. Secondly, there is now a call wrapper that
does not require CallData and CallType since many places don't
care about this.

* API/APICast.h:
(toRef):
* API/JSAPIGlobalObject.cpp: Copied from Source/JavaScriptCore/API/JSVirtualMachineInternal.h.
* API/JSAPIGlobalObject.h: Added.
(JSC::JSAPIGlobalObject::create):
(JSC::JSAPIGlobalObject::createStructure):
(JSC::JSAPIGlobalObject::JSAPIGlobalObject):
* API/JSAPIGlobalObject.mm: Added.
(JSC::JSAPIGlobalObject::moduleLoaderResolve):
(JSC::JSAPIGlobalObject::moduleLoaderImportModule):
(JSC::JSAPIGlobalObject::moduleLoaderFetch):
(JSC::JSAPIGlobalObject::moduleLoaderCreateImportMetaProperties):
* API/JSAPIValueWrapper.h:
(JSC::jsAPIValueWrapper): Deleted.
* API/JSContext.h:
* API/JSContext.mm:
(-[JSContext moduleLoaderDelegate]):
(-[JSContext setModuleLoaderDelegate:]):
* API/JSContextInternal.h:
* API/JSContextPrivate.h:
* API/JSContextRef.cpp:
(JSGlobalContextCreateInGroup):
* API/JSScript.h: Added.
* API/JSScript.mm: Added.
(+[JSScript scriptWithSource:inVirtualMachine:]):
(fillBufferWithContentsOfFile):
(+[JSScript scriptFromUTF8File:inVirtualMachine:withCodeSigning:andBytecodeCache:]):
(getJSScriptSourceCode):
* API/JSScriptInternal.h: Copied from Source/JavaScriptCore/API/JSVirtualMachineInternal.h.
* API/JSValueInternal.h:
* API/JSVirtualMachineInternal.h:
* API/tests/testapi.mm:
(+[JSContextFetchDelegate contextWithBlockForFetch:]):
(-[JSContextFetchDelegate context:fetchModuleForIdentifier:withResolveHandler:andRejectHandler:]):
(checkModuleCodeRan):
(checkModuleWasRejected):
(testFetch):
(testFetchWithTwoCycle):
(testFetchWithThreeCycle):
(testLoaderResolvesAbsoluteScriptURL):
(testLoaderRejectsNilScriptURL):
(testLoaderRejectsFailedFetch):
(testImportModuleTwice):
(+[JSContextFileLoaderDelegate newContext]):
(resolvePathToScripts):
(-[JSContextFileLoaderDelegate context:fetchModuleForIdentifier:withResolveHandler:andRejectHandler:]):
(testLoadBasicFile):
(testObjectiveCAPI):
* API/tests/testapiScripts/basic.js: Copied from Source/JavaScriptCore/API/JSVirtualMachineInternal.h.
* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* SourcesCocoa.txt:
* config.h:
* postprocess-headers.sh:
* runtime/CallData.cpp:
(JSC::call):
* runtime/CallData.h:
* runtime/Completion.cpp:
(JSC::loadAndEvaluateModule):
* runtime/Completion.h:
* runtime/JSCast.h:
(JSC::jsSecureCast):
* runtime/JSGlobalObject.cpp:
(JSC::createProxyProperty):

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

9 months agoWeb Inspector: Settings: group titles should vertically align with the first editor
drousso@apple.com [Mon, 14 Jan 2019 20:17:24 +0000 (20:17 +0000)]
Web Inspector: Settings: group titles should vertically align with the first editor
https://bugs.webkit.org/show_bug.cgi?id=193391

Reviewed by Dean Jackson.

* UserInterface/Views/SettingsTabContentView.css:
(.content-view.settings > .settings-view > .container):
(.content-view.settings > .settings-view > .container > .editor-group > .editor): Added.
(.content-view.settings > .settings-view > .container > .editor-group > .editor:first-child > *): Added.
(.content-view.settings > .settings-view > .container > .editor-group > .editor select):
(.content-view.settings > .settings-view > .container > .editor-group > .editor input[type="number"]):

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

9 months ago[iOS] Expose SPI to access the current sentence boundary and selection state
wenson_hsieh@apple.com [Mon, 14 Jan 2019 20:09:58 +0000 (20:09 +0000)]
[iOS] Expose SPI to access the current sentence boundary and selection state
https://bugs.webkit.org/show_bug.cgi?id=193398
<rdar://problem/45893108>

Reviewed by Dean Jackson.

Source/WebKit:

Expose SPI on WKWebView for internal clients to grab information about attributes at the current selection; so
far, this only includes whether the selection is a caret or a range, and whether or not the start of the
selection is at the start of a new sentence.

Test: EditorStateTests.ObserveSelectionAttributeChanges

* Shared/EditorState.cpp:
(WebKit::EditorState::PostLayoutData::encode const):
(WebKit::EditorState::PostLayoutData::decode):
* Shared/EditorState.h:

Add a new bit in EditorState on iOS to compute whether or not the start of the selection is at the start of a
new sentence. This is computed and set when sending post-layout data in `WebPageIOS.mm`.

* UIProcess/API/Cocoa/WKWebView.mm:
(selectionAttributes):
(-[WKWebView _didChangeEditorState]):
(-[WKWebView _selectionAttributes]):

Make the new SPI property support KVO by invoking `-willChangeValueForKey:` and `-didChangeValueForKey:`
whenever the selection attributes change.

* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::platformEditorState const):

Tools:

Add an API test to verify that an SPI client can observe changes in the `@"_selectionAttributes"` key path on
WKWebView, and that inserting text, deleting, and changing the selection cause selection attributes to change as
expected.

* TestWebKitAPI/EditingTestHarness.h:
* TestWebKitAPI/EditingTestHarness.mm:
(-[EditingTestHarness moveBackward]):
(-[EditingTestHarness moveForward]):
(-[EditingTestHarness moveForwardAndExpectEditorStateWith:]):

Add a couple of new helper methods on EditingTestHarness.

* TestWebKitAPI/Tests/WebKitCocoa/EditorStateTests.mm:
(-[SelectionChangeObserver initWithWebView:]):
(-[SelectionChangeObserver webView]):
(-[SelectionChangeObserver observeValueForKeyPath:ofObject:change:context:]):
(-[SelectionChangeObserver currentSelectionAttributes]):

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

9 months ago[WHLSL] Assorted cleanup
mmaxfield@apple.com [Mon, 14 Jan 2019 19:21:50 +0000 (19:21 +0000)]
[WHLSL] Assorted cleanup
https://bugs.webkit.org/show_bug.cgi?id=193389

Reviewed by Dean Jackson.

This is a bunch of non-behavior-changing cleanup.

- The compiler uses UniqueRef all over the place, and UniqueRef has an implicit operator T&. Therefore,
  we don't need to static_cast<T&> everywhere.
- ConstantExpressionEnumerationMemberReference is the exact same thing as EnumerationMemberLiteral, so
  this patch deletes the longer-named class in favor of the shorter-named class.
- Because of the header dependency tree, this patch moves EntryPointType into its own file so it can be
  used by files that FunctionDeclaration depends on. Same thing for AddressSpace.
- EnumTypes have to have non-null base types. The parser will make sure this is always true.

No new tests because there is no behavior change.

* Modules/webgpu/WHLSL/AST/WHLSLAddressSpace.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h.
* Modules/webgpu/WHLSL/AST/WHLSLArrayType.h:
(WebCore::WHLSL::AST::ArrayType::type const):
(WebCore::WHLSL::AST::ArrayType::type):
* Modules/webgpu/WHLSL/AST/WHLSLAssignmentExpression.h:
(WebCore::WHLSL::AST::AssignmentExpression::left):
(WebCore::WHLSL::AST::AssignmentExpression::right):
* Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h:
* Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.cpp:
(WebCore::WHLSL::AST::BuiltInSemantic::isAcceptableForShaderItemDirection const):
* Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h:
* Modules/webgpu/WHLSL/AST/WHLSLConstantExpression.h:
(WebCore::WHLSL::AST::ConstantExpression::ConstantExpression):
(WebCore::WHLSL::AST::ConstantExpression::clone const):
(WebCore::WHLSL::AST::ConstantExpression::matches const):
* Modules/webgpu/WHLSL/AST/WHLSLConstantExpressionEnumerationMemberReference.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLDereferenceExpression.h:
(WebCore::WHLSL::AST::DereferenceExpression::pointer):
* Modules/webgpu/WHLSL/AST/WHLSLDoWhileLoop.h:
(WebCore::WHLSL::AST::DoWhileLoop::body):
(WebCore::WHLSL::AST::DoWhileLoop::conditional):
* Modules/webgpu/WHLSL/AST/WHLSLEffectfulExpressionStatement.h:
(WebCore::WHLSL::AST::EffectfulExpressionStatement::effectfulExpression):
* Modules/webgpu/WHLSL/AST/WHLSLEntryPointType.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h.
* Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h:
(WebCore::WHLSL::AST::EnumerationDefinition::EnumerationDefinition):
(WebCore::WHLSL::AST::EnumerationDefinition::type):
* Modules/webgpu/WHLSL/AST/WHLSLEnumerationMemberLiteral.h:
(WebCore::WHLSL::AST::EnumerationMemberLiteral::EnumerationMemberLiteral):
(WebCore::WHLSL::AST::EnumerationMemberLiteral::wrap):
(WebCore::WHLSL::AST::EnumerationMemberLiteral::left const):
(WebCore::WHLSL::AST::EnumerationMemberLiteral::right const):
(WebCore::WHLSL::AST::EnumerationMemberLiteral::clone const):
(WebCore::WHLSL::AST::EnumerationMemberLiteral::enumerationDefinition):
(WebCore::WHLSL::AST::EnumerationMemberLiteral::enumerationDefinition const):
(WebCore::WHLSL::AST::EnumerationMemberLiteral::enumerationMember):
(WebCore::WHLSL::AST::EnumerationMemberLiteral::enumerationMember const):
(WebCore::WHLSL::AST::EnumerationMemberLiteral::setEnumerationMember):
* Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
(WebCore::WHLSL::AST::Expression::type):
(WebCore::WHLSL::AST::Expression::setType):
(WebCore::WHLSL::AST::Expression::addressSpace const):
(WebCore::WHLSL::AST::Expression::setAddressSpace):
* Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.cpp:
(WebCore::WHLSL::AST::FloatLiteralType::conversionCost const):
* Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h:
(WebCore::WHLSL::AST::FloatLiteralType::preferredType):
* Modules/webgpu/WHLSL/AST/WHLSLForLoop.h:
(WebCore::WHLSL::AST::ForLoop::condition):
(WebCore::WHLSL::AST::ForLoop::increment):
(WebCore::WHLSL::AST::ForLoop::body):
* Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h:
(WebCore::WHLSL::AST::FunctionDeclaration::type const):
(WebCore::WHLSL::AST::FunctionDeclaration::type):
* Modules/webgpu/WHLSL/AST/WHLSLIfStatement.h:
(WebCore::WHLSL::AST::IfStatement::conditional):
(WebCore::WHLSL::AST::IfStatement::body):
(WebCore::WHLSL::AST::IfStatement::elseBody):
* Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h:
(WebCore::WHLSL::AST::IndexExpression::indexExpression):
* Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp:
(WebCore::WHLSL::AST::IntegerLiteralType::conversionCost const):
* Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h:
(WebCore::WHLSL::AST::IntegerLiteralType::preferredType):
* Modules/webgpu/WHLSL/AST/WHLSLLogicalExpression.h:
(WebCore::WHLSL::AST::LogicalExpression::left):
(WebCore::WHLSL::AST::LogicalExpression::right):
* Modules/webgpu/WHLSL/AST/WHLSLLogicalNotExpression.h:
(WebCore::WHLSL::AST::LogicalNotExpression::operand):
* Modules/webgpu/WHLSL/AST/WHLSLMakeArrayReferenceExpression.h:
(WebCore::WHLSL::AST::MakeArrayReferenceExpression::lValue):
* Modules/webgpu/WHLSL/AST/WHLSLMakePointerExpression.h:
(WebCore::WHLSL::AST::MakePointerExpression::lValue):
* Modules/webgpu/WHLSL/AST/WHLSLPropertyAccessExpression.h:
(WebCore::WHLSL::AST::PropertyAccessExpression::base):
* Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h:
(WebCore::WHLSL::AST::ReadModifyWriteExpression::lValue):
(WebCore::WHLSL::AST::ReadModifyWriteExpression::newValueExpression):
(WebCore::WHLSL::AST::ReadModifyWriteExpression::resultExpression):
* Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h:
(WebCore::WHLSL::AST::ReferenceType::elementType const):
(WebCore::WHLSL::AST::ReferenceType::elementType):
* Modules/webgpu/WHLSL/AST/WHLSLResolvableType.h:
(WebCore::WHLSL::AST::ResolvableType::resolvedType const):
(WebCore::WHLSL::AST::ResolvableType::resolvedType):
* Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp:
(WebCore::WHLSL::AST::ResourceSemantic::isAcceptableType const):
(WebCore::WHLSL::AST::ResourceSemantic::isAcceptableForShaderItemDirection const):
* Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.h:
* Modules/webgpu/WHLSL/AST/WHLSLReturn.h:
(WebCore::WHLSL::AST::Return::value):
* Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp:
(WebCore::WHLSL::AST::SpecializationConstantSemantic::isAcceptableForShaderItemDirection const):
* Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.h:
* Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp:
(WebCore::WHLSL::AST::StageInOutSemantic::isAcceptableForShaderItemDirection const):
* Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.h:
* Modules/webgpu/WHLSL/AST/WHLSLStructureElement.h:
(WebCore::WHLSL::AST::StructureElement::type):
* Modules/webgpu/WHLSL/AST/WHLSLSwitchStatement.h:
(WebCore::WHLSL::AST::SwitchStatement::value):
* Modules/webgpu/WHLSL/AST/WHLSLTernaryExpression.h:
(WebCore::WHLSL::AST::TernaryExpression::predicate):
(WebCore::WHLSL::AST::TernaryExpression::bodyExpression):
(WebCore::WHLSL::AST::TernaryExpression::elseExpression):
* Modules/webgpu/WHLSL/AST/WHLSLTypeDefinition.h:
(WebCore::WHLSL::AST::TypeDefinition::type):
* Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp:
(WebCore::WHLSL::AST::UnsignedIntegerLiteralType::conversionCost const):
* Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h:
(WebCore::WHLSL::AST::UnsignedIntegerLiteralType::preferredType):
* Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h:
(WebCore::WHLSL::AST::VariableDeclaration::type):
(WebCore::WHLSL::AST::VariableDeclaration::initializer):
(WebCore::WHLSL::AST::VariableDeclaration::isAnonymous const):
* Modules/webgpu/WHLSL/AST/WHLSLWhileLoop.h:
(WebCore::WHLSL::AST::WhileLoop::conditional):
(WebCore::WHLSL::AST::WhileLoop::body):
* Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp:
(WebCore::WHLSL::checkDuplicateFunctions):
* Modules/webgpu/WHLSL/WHLSLInferTypes.cpp:
(WebCore::WHLSL::commit):
(WebCore::WHLSL::inferTypesForTypeArguments):
(WebCore::WHLSL::inferTypesForCall):
* Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
(WebCore::WHLSL::NameResolver::visit):
(WebCore::WHLSL::resolveNamesInTypes):
(WebCore::WHLSL::resolveNamesInFunctions):
* Modules/webgpu/WHLSL/WHLSLNameResolver.h:
* Modules/webgpu/WHLSL/WHLSLParser.h:
* Modules/webgpu/WHLSL/WHLSLProgram.h:
(WebCore::WHLSL::Program::append):
* Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp:
(WebCore::WHLSL::synthesizeEnumerationFunctions):
* Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp:
(WebCore::WHLSL::synthesizeStructureAccessors):
* Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
(WebCore::WHLSL::Visitor::visit):
* Modules/webgpu/WHLSL/WHLSLVisitor.h:
* WebCore.xcodeproj/project.pbxproj:

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

9 months agoFix property access on ARM with the baseline JIT
dinfuehr@igalia.com [Mon, 14 Jan 2019 18:41:21 +0000 (18:41 +0000)]
Fix property access on ARM with the baseline JIT
https://bugs.webkit.org/show_bug.cgi?id=193393

Reviewed by Yusuke Suzuki.

Code was still using currentInstruction[4] to access the instruction's metadata.
Updated to use metadata.getPutInfo and metadata.resolveType.

* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emit_op_resolve_scope):
(JSC::JIT::emit_op_get_from_scope):
(JSC::JIT::emit_op_put_to_scope):

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

9 months agoDOMCacheStorage: use-after-move in doSequentialMatch()
zandobersek@gmail.com [Mon, 14 Jan 2019 15:51:41 +0000 (15:51 +0000)]
DOMCacheStorage: use-after-move in doSequentialMatch()
https://bugs.webkit.org/show_bug.cgi?id=193396

Reviewed by Youenn Fablet.

Depending on the platform- and compiler-specific calling conventions,
the doSequentialMatch() code can move out the Vector<Ref<DOMCache>>
object into the callback lambda before the DOMCache object at the
specified index is retrieved for the DOMCache::doMatch() invocation.

This problem is now avoided by retrieving reference to the target
DOMCache object in an earlier expression.

* Modules/cache/DOMCacheStorage.cpp:
(WebCore::doSequentialMatch):

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

9 months ago[LFC][BFC] Add basic box-sizing support.
zalan@apple.com [Mon, 14 Jan 2019 15:42:21 +0000 (15:42 +0000)]
[LFC][BFC] Add basic box-sizing support.
https://bugs.webkit.org/show_bug.cgi?id=193392

Reviewed by Antti Koivisto.

Source/WebCore:

No min/max support yet.

Test: fast/block/block-only/box-sizing-inflow-out-of-flow-simple.html

* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
* page/FrameViewLayoutContext.cpp:
(WebCore::layoutUsingFormattingContext):

Tools:

* LayoutReloaded/misc/LFC-passing-tests.txt:

LayoutTests:

* fast/block/block-only/box-sizing-inflow-out-of-flow-simple-expected.txt: Added.
* fast/block/block-only/box-sizing-inflow-out-of-flow-simple.html: Added.

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

9 months ago[GStreamer][WebRTC] Override DeviceType() in RealtimeMediaSource implementations
commit-queue@webkit.org [Mon, 14 Jan 2019 15:22:43 +0000 (15:22 +0000)]
[GStreamer][WebRTC] Override DeviceType() in RealtimeMediaSource implementations
https://bugs.webkit.org/show_bug.cgi?id=193397

This was necessary but wasn't done.

Patch by Thibault Saunier <tsaunier@igalia.com> on 2019-01-14
Reviewed by Philippe Normand.

No test required as this fixes a regression in all WebRTC tests when built in debug mode.

* platform/mediastream/gstreamer/GStreamerAudioCaptureSource.h:
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:

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

9 months agoUnreviewed WPE debug build fix after r239921.
zandobersek@gmail.com [Mon, 14 Jan 2019 15:09:56 +0000 (15:09 +0000)]
Unreviewed WPE debug build fix after r239921.

* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
(webKitMediaClearKeyDecryptorDecrypt): Fix the assert that checks the
size of the mapped buffer containing IV data.

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

9 months agoUnreviewed WPE gardening. Updating baselines for failures that in
zandobersek@gmail.com [Mon, 14 Jan 2019 12:41:36 +0000 (12:41 +0000)]
Unreviewed WPE gardening. Updating baselines for failures that in
majority of cases can be tracked down to the test fonts bump in r239436.

* platform/wpe/animations/lineheight-animation-expected.txt:
* platform/wpe/animations/simultaneous-start-transform-expected.txt:
* platform/wpe/animations/width-using-ems-expected.txt:
* platform/wpe/css1/font_properties/font-expected.txt:
* platform/wpe/css3/unicode-bidi-isolate-basic-expected.txt:
* platform/wpe/fast/css/line-height-determined-by-primary-font-expected.txt:
* platform/wpe/fast/css/rtl-ordering-expected.txt:
* platform/wpe/fast/css/text-overflow-ellipsis-bidi-expected.txt:
* platform/wpe/fast/css/text-overflow-ellipsis-expected.txt:
* platform/wpe/fast/css/text-overflow-ellipsis-strict-expected.txt:
* platform/wpe/fast/css/word-space-extra-expected.txt:
* platform/wpe/fast/dom/34176-expected.txt:
* platform/wpe/fast/dom/52776-expected.txt:
* platform/wpe/fast/inline/inline-box-background-expected.txt:
* platform/wpe/fast/inline/inline-box-background-long-image-expected.txt:
* platform/wpe/fast/inline/inline-box-background-repeat-x-expected.txt:
* platform/wpe/fast/inline/inline-box-background-repeat-y-expected.txt:
* platform/wpe/fast/inline/inline-content-with-float-and-margin-expected.txt: Added.
* platform/wpe/fast/inline/simple-inline-inflow-positioned-expected.txt: Added.
* platform/wpe/fast/inline/simple-inline-with-out-of-flow-descendant-expected.txt: Added.
* platform/wpe/fast/inline/simple-inline-with-out-of-flow-descendant2-expected.txt: Added.
* platform/wpe/svg/W3C-I18N/text-anchor-dirLTR-anchorEnd-expected.txt:
* platform/wpe/svg/W3C-I18N/text-anchor-dirLTR-anchorMiddle-expected.txt:
* platform/wpe/svg/W3C-I18N/text-anchor-dirLTR-anchorStart-expected.txt:
* platform/wpe/svg/W3C-I18N/text-anchor-dirNone-anchorEnd-expected.txt:
* platform/wpe/svg/W3C-I18N/text-anchor-dirNone-anchorMiddle-expected.txt:
* platform/wpe/svg/W3C-I18N/text-anchor-dirNone-anchorStart-expected.txt:
* platform/wpe/svg/W3C-I18N/text-anchor-dirRTL-anchorEnd-expected.txt:
* platform/wpe/svg/W3C-I18N/text-anchor-dirRTL-anchorMiddle-expected.txt:
* platform/wpe/svg/W3C-I18N/text-anchor-dirRTL-anchorStart-expected.txt:
* platform/wpe/svg/W3C-I18N/text-anchor-inherited-dirLTR-anchorEnd-expected.txt:
* platform/wpe/svg/W3C-I18N/text-anchor-inherited-dirLTR-anchorMiddle-expected.txt:
* platform/wpe/svg/W3C-I18N/text-anchor-inherited-dirLTR-anchorStart-expected.txt:
* platform/wpe/svg/W3C-I18N/text-anchor-inherited-dirRTL-anchorEnd-expected.txt:
* platform/wpe/svg/W3C-I18N/text-anchor-inherited-dirRTL-anchorMiddle-expected.txt:
* platform/wpe/svg/W3C-I18N/text-anchor-inherited-dirRTL-anchorStart-expected.txt:
* platform/wpe/svg/W3C-I18N/text-anchor-no-markup-expected.txt:
* platform/wpe/svg/W3C-SVG-1.1-SE/svgdom-over-01-f-expected.txt:
* platform/wpe/svg/W3C-SVG-1.1-SE/text-intro-02-b-expected.txt:
* platform/wpe/svg/W3C-SVG-1.1-SE/text-intro-09-b-expected.txt:
* platform/wpe/svg/W3C-SVG-1.1/text-tselect-02-f-expected.txt:
* platform/wpe/svg/custom/glyph-selection-bidi-mirror-expected.txt:
* platform/wpe/svg/custom/svg-fonts-fallback-expected.txt:
* platform/wpe/svg/hixie/perf/007-expected.txt:
* platform/wpe/svg/text/bidi-embedded-direction-expected.txt:
* platform/wpe/svg/text/bidi-reorder-value-lists-expected.txt: Added.
* platform/wpe/svg/text/bidi-text-anchor-direction-expected.txt:
* platform/wpe/svg/text/text-tselect-02-f-expected.txt:
* platform/wpe/tables/mozilla/marvin/backgr_layers-opacity-expected.txt:
* platform/wpe/tables/mozilla/marvin/backgr_position-table-expected.txt:
* platform/wpe/tables/mozilla/marvin/backgr_simple-table-cell-expected.txt:
* platform/wpe/tables/mozilla/marvin/backgr_simple-table-column-expected.txt:
* platform/wpe/tables/mozilla/marvin/backgr_simple-table-column-group-expected.txt:
* platform/wpe/tables/mozilla/marvin/backgr_simple-table-expected.txt:
* platform/wpe/tables/mozilla/marvin/backgr_simple-table-row-expected.txt:
* platform/wpe/tables/mozilla/marvin/backgr_simple-table-row-group-expected.txt:
* platform/wpe/tables/mozilla_expected_failures/marvin/backgr_border-table-cell-expected.txt:
* platform/wpe/tables/mozilla_expected_failures/marvin/backgr_border-table-column-expected.txt:
* platform/wpe/tables/mozilla_expected_failures/marvin/backgr_border-table-column-group-expected.txt:
* platform/wpe/tables/mozilla_expected_failures/marvin/backgr_border-table-expected.txt:
* platform/wpe/tables/mozilla_expected_failures/marvin/backgr_border-table-quirks-expected.txt:
* platform/wpe/tables/mozilla_expected_failures/marvin/backgr_border-table-row-expected.txt:
* platform/wpe/tables/mozilla_expected_failures/marvin/backgr_border-table-row-group-expected.txt:
* platform/wpe/tables/mozilla_expected_failures/marvin/backgr_fixed-bg-expected.txt:
* platform/wpe/tables/mozilla_expected_failures/marvin/backgr_layers-hide-expected.txt:
* platform/wpe/tables/mozilla_expected_failures/marvin/backgr_layers-show-expected.txt:
* platform/wpe/tables/mozilla_expected_failures/marvin/backgr_position-table-cell-expected.txt:
* platform/wpe/tables/mozilla_expected_failures/marvin/backgr_position-table-column-expected.txt:
* platform/wpe/tables/mozilla_expected_failures/marvin/backgr_position-table-column-group-expected.txt:
* platform/wpe/tables/mozilla_expected_failures/marvin/backgr_position-table-row-expected.txt:
* platform/wpe/tables/mozilla_expected_failures/marvin/backgr_position-table-row-group-expected.txt:

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

9 months ago[WPE] API test gardening
cturner@igalia.com [Mon, 14 Jan 2019 12:41:01 +0000 (12:41 +0000)]
[WPE] API test gardening
https://bugs.webkit.org/show_bug.cgi?id=193319

Reviewed by Michael Catanzaro.

* TestWebKitAPI/glib/TestExpectations.json: Remove some now
passing tests.

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

9 months ago[GStreamer] Add sharedBuffer utility to GstMappedBuffer, and a testsuite
cturner@igalia.com [Mon, 14 Jan 2019 12:31:13 +0000 (12:31 +0000)]
[GStreamer] Add sharedBuffer utility to GstMappedBuffer, and a testsuite
https://bugs.webkit.org/show_bug.cgi?id=192977

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Add a utility method on GstMappedBuffer to return a SharedBuffer
view over the mapped data with no copies.

This patch also introduces a new gstreamer port API test
directory, and includes some tests for GstMappedBuffer.

New tests in the API section.

* platform/SharedBuffer.cpp: Add a new overload for
GstMappedBuffer that allows sharing the mapped GStreamer buffers
with zero copies.
(WebCore::SharedBuffer::create):
(WebCore::SharedBuffer::SharedBuffer):
(WebCore::SharedBuffer::DataSegment::data const):
(WebCore::SharedBuffer::DataSegment::size const):
* platform/SharedBuffer.h:
* platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
(webKitWebAudioSrcAllocateBuffersAndRenderAudio): Update to new
API.
* platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::GstMappedBuffer::createSharedBuffer): Return a shared
buffer sharing this mapped buffer. The buffer must be shareable to
use this method.
* platform/graphics/gstreamer/GStreamerCommon.h:
(WebCore::GstMappedBuffer::create): Make GstMappedBuffer RefCounted
(WebCore::GstMappedBuffer::~GstMappedBuffer):
(WebCore::GstMappedBuffer::data):
(WebCore::GstMappedBuffer::data const):
(WebCore::GstMappedBuffer::size const):
(WebCore::GstMappedBuffer::isSharable const): New predicate to
check whether this buffer can be shared (i.e., is not writable)
(WebCore::GstMappedBuffer::GstMappedBuffer):
(WebCore::GstMappedBuffer::operator bool const): Deleted.
* platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
(WebCore::InbandTextTrackPrivateGStreamer::notifyTrackOfSample):
Update to use new API.
* platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h:
(WebCore::InitData::InitData): Ditto.
* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
(webKitMediaClearKeyDecryptorFindAndSetKey): Ditto.
(webKitMediaClearKeyDecryptorDecrypt): Ditto.
* platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:
(WebCore::WrappedMockRealtimeAudioSource::render): Ditto.
* platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
(WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData): Ditto.
* platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.cpp:
(WebCore::RealtimeOutgoingVideoSourceLibWebRTC::createBlackFrame): Ditto.
* platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
(WebCore::GStreamerVideoEncoder::Fragmentize): Ditto.

Tools:

* TestWebKitAPI/PlatformGTK.cmake: Build the new GStreamer test harness
* TestWebKitAPI/PlatformWPE.cmake: Ditto.
* TestWebKitAPI/Tests/WebCore/gstreamer/GStreamerTest.cpp: Added.
(TestWebKitAPI::GStreamerTest::SetUp):
(TestWebKitAPI::GStreamerTest::TearDown):
* TestWebKitAPI/Tests/WebCore/gstreamer/GStreamerTest.h: Added.
* TestWebKitAPI/Tests/WebCore/gstreamer/GstMappedBuffer.cpp: Added.
(TestWebKitAPI::TEST_F):

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

9 months ago[WPE] Workaround for incorrect template specialization being selected when UChar...
cturner@igalia.com [Mon, 14 Jan 2019 10:59:06 +0000 (10:59 +0000)]
[WPE] Workaround for incorrect template specialization being selected when UChar=char16_t
https://bugs.webkit.org/show_bug.cgi?id=193332

Reviewed by Michael Catanzaro.

* TestWebKitAPI/Tests/WTF/StringConcatenate.cpp: When UChar is
defined as a char16_t, which changed in ICU 59, the
StringTypeAdapter<UnsignedInt, ...> overload catches casts to
unsigned short. This test is relying on the behaviour that
UChar=unsigned short, which doesn't hold across platforms and ICU
library versions. The full fix would be a special syntax for
literal characters so that these ambiguities do not arise. That
work is proposed in https://bugs.webkit.org/show_bug.cgi?id=193101.
(TestWebKitAPI::TEST):

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