WebKit-https.git
5 months ago[JSC] Use runtime calls for DFG MakeRope if !CPU(ADDRESS64)
ysuzuki@apple.com [Fri, 1 Mar 2019 21:46:08 +0000 (21:46 +0000)]
[JSC] Use runtime calls for DFG MakeRope if !CPU(ADDRESS64)
https://bugs.webkit.org/show_bug.cgi?id=195221

Reviewed by Mark Lam.

ARM32_64 builds DFG 64bit, but the size of address is 32bit. Make DFG MakeRope a runtime call not only for DFG 32_64,
but also DFG 64 with !CPU(ADDRESS64). This patch unifies compileMakeRope again, and use a runtime call for !CPU(ADDRESS64).

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileMakeRope):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compileMakeRope): Deleted.
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compileMakeRope): Deleted.

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

5 months agoModernize WebKit::AttributedString a little bit
timothy_horton@apple.com [Fri, 1 Mar 2019 21:37:33 +0000 (21:37 +0000)]
Modernize WebKit::AttributedString a little bit
https://bugs.webkit.org/show_bug.cgi?id=195200

Reviewed by Wenson Hsieh.

* Shared/mac/AttributedString.h:
(WebKit::AttributedString::AttributedString):
(WebKit::AttributedString::operator NSAttributedString * const):
* Shared/mac/AttributedString.mm:
(IPC::ArgumentCoder<WebKit::AttributedString>::encode):
(IPC::ArgumentCoder<WebKit::AttributedString>::decode):
(WebKit::AttributedString::encode const): Deleted.
(WebKit::AttributedString::decode): Deleted.
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::attributedSubstringForProposedRange):
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::attributedSubstringForCharacterRangeAsync):
Modern coders, and a constructor and cast operator to/from NSAttributedString.
Also adopt those in a few places just for fun.

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

5 months agoAdjust XMLHttpRequest Content-Type handling
commit-queue@webkit.org [Fri, 1 Mar 2019 21:32:53 +0000 (21:32 +0000)]
Adjust XMLHttpRequest Content-Type handling
https://bugs.webkit.org/show_bug.cgi?id=184645

Patch by Rob Buis <rbuis@igalia.com> on 2019-03-01
Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Sync test and update test expectation (all PASSes).

* web-platform-tests/xhr/send-content-type-charset-expected.txt:
* web-platform-tests/xhr/send-content-type-charset.htm:

Source/WebCore:

Implement steps 4.4.1.2 and 4.4.1.3 of send() [1].

Test: web-platform-tests/xhr/send-content-type-charset.htm

[1] https://xhr.spec.whatwg.org/#dom-xmlhttprequest-send

* platform/network/ParsedContentType.cpp:
(WebCore::ParsedContentType::setCharset):
* platform/network/ParsedContentType.h:
* xml/XMLHttpRequest.cpp:
(WebCore::replaceCharsetInMediaTypeIfNeeded):
(WebCore::XMLHttpRequest::send):
(WebCore::replaceCharsetInMediaType): Deleted.

LayoutTests:

Fix 2 subtest expectations.

* http/tests/xmlhttprequest/request-encoding2.html:

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

5 months agoUpdate originsMatch to handle the case of file origins which enforce file path separation
youenn@apple.com [Fri, 1 Mar 2019 21:31:05 +0000 (21:31 +0000)]
Update originsMatch to handle the case of file origins which enforce file path separation
https://bugs.webkit.org/show_bug.cgi?id=195216

Reviewed by Brady Eidson.

Covered by the assertion and existing tests like fast/xmlhttprequest/xmlhttprequest-no-file-access.html.
Make sure originsMatch returns true if either compared origins are the same object
or they have the same file path separation behavior.

* page/SecurityOrigin.cpp:
(WebCore::areOriginsMatching):
(WebCore::originsMatch):

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

5 months agoContinued gardening of storage/indexeddb/ crashes after r242189
tsavell@apple.com [Fri, 1 Mar 2019 21:00:20 +0000 (21:00 +0000)]
Continued gardening of storage/indexeddb/ crashes after r242189
https://bugs.webkit.org/show_bug.cgi?id=195210

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

5 months agoSerialize IndexedDB::ObjectStoreOverwriteMode as an enum
youenn@apple.com [Fri, 1 Mar 2019 20:36:08 +0000 (20:36 +0000)]
Serialize IndexedDB::ObjectStoreOverwriteMode as an enum
https://bugs.webkit.org/show_bug.cgi?id=195213

Reviewed by Alex Christensen.

Source/WebCore:

Add traits to enable enum IPC encoding.
No change of behavior.

* Modules/indexeddb/IndexedDB.h:

Source/WebKit:

Make use of enum trait to automatically check for correct enum value when receiving a putOrAdd message.

* NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
(WebKit::WebIDBConnectionToClient::putOrAdd):
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
* Scripts/webkit/messages.py:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::putOrAdd):

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

5 months agoUnskip test read-dead-bytecode-locals-in-must-have-handle-values2.js on ARM/MIPS
dinfuehr@igalia.com [Fri, 1 Mar 2019 20:18:39 +0000 (20:18 +0000)]
Unskip test read-dead-bytecode-locals-in-must-have-handle-values2.js on ARM/MIPS
https://bugs.webkit.org/show_bug.cgi?id=195207

Unreviewed. After test runtime was reduced in r242213, test can be
run again on ARM/MIPS.

* stress/read-dead-bytecode-locals-in-must-handle-values2.js:

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

5 months ago[WinCairo] Enable service worker
don.olmstead@sony.com [Fri, 1 Mar 2019 19:58:30 +0000 (19:58 +0000)]
[WinCairo] Enable service worker
https://bugs.webkit.org/show_bug.cgi?id=188318

Reviewed by Youenn Fablet.

.:

* Source/cmake/OptionsWin.cmake:

Source/WebCore:

* WebCorePrefix.h:
* testing/ServiceWorkerInternals.h:
* workers/service/context/SWContextManager.cpp:
(WebCore::SWContextManager::serviceWorkerFailedToTerminate):
* workers/service/context/SWContextManager.h:

Source/WebKit:

* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::terminateProcess):
* WebProcess/Storage/WebSWContextManagerConnection.h:
* config.h:

Tools:

* DumpRenderTree/DumpRenderTreePrefix.h:
* TestWebKitAPI/PlatformWin.cmake:
* TestWebKitAPI/win/TestWebKitAPIPrefix.h:
* WebKitTestRunner/InjectedBundle/win/TestRunnerInjectedBundlePrefix.h:
* WebKitTestRunner/WebKitTestRunnerPrefix.h:

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

5 months agoAdd a quirk for bostongloble.com and latimes.com
sihui_liu@apple.com [Fri, 1 Mar 2019 19:55:48 +0000 (19:55 +0000)]
Add a quirk for bostongloble.com and latimes.com
https://bugs.webkit.org/show_bug.cgi?id=195155

Reviewed by Geoffrey Garen.

Covered by manual testing.

* Modules/webdatabase/DOMWindowWebDatabase.idl:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateRuntimeEnableConditionalString):
* bindings/scripts/IDLAttributes.json:
* bindings/scripts/preprocess-idls.pl:
(GenerateConstructorAttributes):
* page/Quirks.cpp:
(WebCore::Quirks::hasWebSQLSupportQuirk const):
* page/Quirks.h:

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

5 months agoFlaky API Test TestWebKitAPI.ProcessSwap.LoadUnload
cdumez@apple.com [Fri, 1 Mar 2019 19:33:47 +0000 (19:33 +0000)]
Flaky API Test TestWebKitAPI.ProcessSwap.LoadUnload
https://bugs.webkit.org/show_bug.cgi?id=195110

Reviewed by Ryosuke Niwa.

The test was attempting to disable PageCache via view preferences instead of using the
process pool configuration flag. This would fail to disable PageCache because the
usesPageCache preference would not prevent the creation of SuspendedPageProxy objects.
As a result, the firing on the unload event would get delayed until the SuspendedPageProxy
objects would get destroyed, which would lead to flakiness.

This patch updates WebPageProxy::suspendCurrentPageIfPossible() to not create suspended
pages proxies when the usesPageCache preference is set to false.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::suspendCurrentPageIfPossible):

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

5 months agoDFG: Loop-invariant code motion (LICM) should not hoist dead code
rmorisset@apple.com [Fri, 1 Mar 2019 19:24:08 +0000 (19:24 +0000)]
DFG: Loop-invariant code motion (LICM) should not hoist dead code
https://bugs.webkit.org/show_bug.cgi?id=194945
<rdar://problem/48311657>

Reviewed by Saam Barati.

* dfg/DFGLICMPhase.cpp:
(JSC::DFG::LICMPhase::run):

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

5 months ago[ContentChangeObserver] Rename members and move implementation to header.
zalan@apple.com [Fri, 1 Mar 2019 19:23:50 +0000 (19:23 +0000)]
[ContentChangeObserver] Rename members and move implementation to header.
https://bugs.webkit.org/show_bug.cgi?id=195198
<rdar://problem/48499967>

Reviewed by Simon Fraser.

* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
(WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
(WebCore::ContentChangeObserver::startObservingStyleRecalc):
(WebCore::ContentChangeObserver::stopObservingStyleRecalc):
(WebCore::ContentChangeObserver::startObservingContentChanges):
(WebCore::ContentChangeObserver::stopObservingContentChanges):
(WebCore::ContentChangeObserver::StyleRecalcScope::StyleRecalcScope):
(WebCore::ContentChangeObserver::StyleRecalcScope::~StyleRecalcScope):
(WebCore::ContentChangeObserver::startObservingStyleResolve): Deleted.
(WebCore::ContentChangeObserver::stopObservingStyleResolve): Deleted.
(WebCore::ContentChangeObserver::isObservingContentChanges): Deleted.
(WebCore::ContentChangeObserver::startObservingDOMTimerScheduling): Deleted.
(WebCore::ContentChangeObserver::stopObservingDOMTimerScheduling): Deleted.
(WebCore::ContentChangeObserver::isObservingDOMTimerScheduling): Deleted.
(WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling): Deleted.
(WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling): Deleted.
(WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling): Deleted.
(WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc): Deleted.
(WebCore::ContentChangeObserver::shouldObserveNextStyleRecalc): Deleted.
(WebCore::ContentChangeObserver::countOfObservedDOMTimers): Deleted.
(WebCore::ContentChangeObserver::clearObservedDOMTimers): Deleted.
(WebCore::ContentChangeObserver::containsObservedDOMTimer): Deleted.
* page/ios/ContentChangeObserver.h:
(WebCore::ContentChangeObserver::startObservingDOMTimerScheduling):
(WebCore::ContentChangeObserver::stopObservingDOMTimerScheduling):
(WebCore::ContentChangeObserver::isObservingDOMTimerScheduling const):
(WebCore::ContentChangeObserver::containsObservedDOMTimer const):
(WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling):
(WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling):
(WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling const):
(WebCore::ContentChangeObserver::setShouldObserveStyleRecalc):
(WebCore::ContentChangeObserver::shouldObserveStyleRecalc const):
(WebCore::ContentChangeObserver::isObservingContentChanges const):
(WebCore::ContentChangeObserver::countOfObservedDOMTimers const):
(WebCore::ContentChangeObserver::clearObservedDOMTimers):

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

5 months agoCodify the naming convention for fooIfExists
rniwa@webkit.org [Fri, 1 Mar 2019 19:21:15 +0000 (19:21 +0000)]
Codify the naming convention for fooIfExists
https://bugs.webkit.org/show_bug.cgi?id=194930

Reviewed by Darin Adler.

Updating the coding style guideline after the discussion following
https://lists.webkit.org/pipermail/webkit-dev/2013-June/025056.html

* code-style.md:

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

5 months ago[ContentChangeObserver] ContentChangeObserver::StyleChangeScope should not set WKCont...
zalan@apple.com [Fri, 1 Mar 2019 19:14:02 +0000 (19:14 +0000)]
[ContentChangeObserver] ContentChangeObserver::StyleChangeScope should not set WKContentVisibilityChange directly
https://bugs.webkit.org/show_bug.cgi?id=195197
<rdar://problem/48498332>

Reviewed by Simon Fraser.

Add didContentVisibilityChange to hide WKContentVisibilityChange value. We might also want to add some logic to didContentVisibilityChange at some point.

* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::didContentVisibilityChange):
(WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
* page/ios/ContentChangeObserver.h:

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

5 months ago[EME] Make sure the hasSessionSemaphore is set even if HAVE(AVSTREAMSESSION) is false
jer.noble@apple.com [Fri, 1 Mar 2019 19:10:58 +0000 (19:10 +0000)]
[EME] Make sure the hasSessionSemaphore is set even if HAVE(AVSTREAMSESSION) is false
https://bugs.webkit.org/show_bug.cgi?id=195217

Reviewed by Eric Carlson.

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

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

5 months ago[ThreadedCompositor] Simply the compositing run loop worker thread
commit-queue@webkit.org [Fri, 1 Mar 2019 18:08:00 +0000 (18:08 +0000)]
[ThreadedCompositor] Simply the compositing run loop worker thread
https://bugs.webkit.org/show_bug.cgi?id=195208

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2019-03-01
Reviewed by Don Olmstead.

We can remove the WorkQueuePool, since we never really supported more than one thread, and now that single
process model non longer exists it doesn't even make sense. We can simply use a RunLoop instead of a WorkQueue
so that the implementation is not specific to the generic WorkQueue implementation.

* Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
(WebKit::createRunLoop): Helper function to create the RunLoop in a worker thread before m_updateTimer is initialized.
(WebKit::CompositingRunLoop::CompositingRunLoop): Use createRunLoop().
(WebKit::CompositingRunLoop::~CompositingRunLoop): Stop the worker thread run loop in the next main run loop iteration.
(WebKit::CompositingRunLoop::performTask): Use m_runLoop.
(WebKit::CompositingRunLoop::performTaskSync): Ditto.
(WebKit::WorkQueuePool::singleton): Deleted.
(WebKit::WorkQueuePool::dispatch): Deleted.
(WebKit::WorkQueuePool::runLoop): Deleted.
(WebKit::WorkQueuePool::invalidate): Deleted.
(WebKit::WorkQueuePool::WorkQueuePool): Deleted.
(WebKit::WorkQueuePool::getOrCreateWorkQueueForContext): Deleted.
(): Deleted.
* Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:

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

5 months agoEnable WPT Pointer Events tests
commit-queue@webkit.org [Fri, 1 Mar 2019 17:57:56 +0000 (17:57 +0000)]
Enable WPT Pointer Events tests
https://bugs.webkit.org/show_bug.cgi?id=195204
<rdar://problem/48502751>

Patch by Antoine Quint <graouts@apple.com> on 2019-03-01
Reviewed by Dean Jackson.

The touch-action property has been enabled as part of the work on webkit.org/b/195008 but the WPT tests
LayoutTests/imported/w3c:

had not been enabled yet, so we're now adding the progressions made.

* web-platform-tests/pointerevents/extension/pointerevent_touch-action-verification-expected.txt:
* web-platform-tests/pointerevents/pointerevent_touch-action-verification-expected.txt:

LayoutTests:

had not been enabled yet.

* platform/mac/TestExpectations:

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

5 months agoREGRESSION: (r242189): Six Layout Tests in storage/indexeddb/ are crashing after...
tsavell@apple.com [Fri, 1 Mar 2019 17:08:10 +0000 (17:08 +0000)]
REGRESSION: (r242189): Six Layout Tests in storage/indexeddb/ are crashing after r242189
https://bugs.webkit.org/show_bug.cgi?id=195210

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

5 months ago[Web GPU] 32-bit builds broken by attempt to disable WebGPU on 32-bit
justin_fan@apple.com [Fri, 1 Mar 2019 17:05:31 +0000 (17:05 +0000)]
[Web GPU] 32-bit builds broken by attempt to disable WebGPU on 32-bit
https://bugs.webkit.org/show_bug.cgi?id=195191

Rubber-stamped by Dean Jackson.

Dropping support for 32-bit entirely, so I'm intentionally leaving 32-bit broken.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

* Configurations/FeatureDefines.xcconfig:

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

5 months agoFix debug builds with GCC
dinfuehr@igalia.com [Fri, 1 Mar 2019 11:43:32 +0000 (11:43 +0000)]
Fix debug builds with GCC
https://bugs.webkit.org/show_bug.cgi?id=195205

Unreviewed. Fix debug builds in GCC by removing
the constexpr-keyword for this function.

* runtime/CachedTypes.cpp:
(JSC::tagFromSourceCodeType):

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

5 months ago[ARM] Fix assembler warnings in ctiMasmProbeTrampoline
dinfuehr@igalia.com [Fri, 1 Mar 2019 09:50:21 +0000 (09:50 +0000)]
[ARM] Fix assembler warnings in ctiMasmProbeTrampoline
https://bugs.webkit.org/show_bug.cgi?id=195164

Reviewed by Mark Lam.

Short branches in IT blocks are deprecated in AArch32. In addition the
the conditional branch was the only instruction in the IT block. Short
branches are able to encode the condition code themselves, the additional
IT instruction is not needed.

The assembler was also warning that writing into APSR without a bitmask
was deprecated. Therefore use APSR_nzcvq instead, this generates the same
instruction encoding.

* assembler/MacroAssemblerARMv7.cpp:

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

5 months agoUnreviewed, fix lldb webkitpy tests
ysuzuki@apple.com [Fri, 1 Mar 2019 08:41:23 +0000 (08:41 +0000)]
Unreviewed, fix lldb webkitpy tests
https://bugs.webkit.org/show_bug.cgi?id=194375

Since we changed the value of Is8Bit flag in StringImpl, we change lldb webkitpy tests accordingly.

* lldb/lldb_webkit.py:
(WTFStringImplProvider.is_8bit):

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

5 months agoRemove CachedPtr::m_isEmpty and CachedOptional::m_isEmpty fields
tzagallo@apple.com [Fri, 1 Mar 2019 07:31:44 +0000 (07:31 +0000)]
Remove CachedPtr::m_isEmpty and CachedOptional::m_isEmpty fields
https://bugs.webkit.org/show_bug.cgi?id=194999

Reviewed by Saam Barati.

These fields are unnecessary, since we can just check that m_offset
has not been initialized (I added VariableLengthObject::isEmpty for
that). They also add 7-byte padding to these classes, which is pretty
bad given how frequently CachedPtr is used.

* runtime/CachedTypes.cpp:
(JSC::CachedObject::operator new[]):
(JSC::VariableLengthObject::allocate):
(JSC::VariableLengthObject::isEmpty const):
(JSC::CachedPtr::encode):
(JSC::CachedPtr::decode const):
(JSC::CachedPtr::get const):
(JSC::CachedOptional::encode):
(JSC::CachedOptional::decode const):
(JSC::CachedOptional::decodeAsPtr const):

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

5 months agoHTTPSUpgradeList.db database should be opened in readonly mode
Hironori.Fujii@sony.com [Fri, 1 Mar 2019 04:40:56 +0000 (04:40 +0000)]
HTTPSUpgradeList.db database should be opened in readonly mode
https://bugs.webkit.org/show_bug.cgi?id=195194
<rdar://problem/47103889>

Unreviewed build fix for curl.

* platform/network/curl/CookieJarDB.cpp:
(WebCore::CookieJarDB::openDatabase): Removed the second arguemnt of SQLiteDatabase::open.

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

5 months agoUnreviewed Windows build fix after r242251.
cdumez@apple.com [Fri, 1 Mar 2019 03:41:21 +0000 (03:41 +0000)]
Unreviewed Windows build fix after r242251.

* platform/win/SearchPopupMenuDB.cpp:
(WebCore::SearchPopupMenuDB::openDatabase):

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

5 months ago[WinCairo] Turn ENABLE_RESOURCE_LOAD_STATISTICS on
don.olmstead@sony.com [Fri, 1 Mar 2019 03:35:32 +0000 (03:35 +0000)]
[WinCairo] Turn ENABLE_RESOURCE_LOAD_STATISTICS on
https://bugs.webkit.org/show_bug.cgi?id=194267

Reviewed by Brent Fulgham.

* Source/cmake/OptionsWin.cmake:

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

5 months ago[ContentChangeObserver] Move timer removal code from DOMWindow::clearTimeout to DOMTi...
zalan@apple.com [Fri, 1 Mar 2019 03:15:14 +0000 (03:15 +0000)]
[ContentChangeObserver] Move timer removal code from DOMWindow::clearTimeout to DOMTimer::removeById
https://bugs.webkit.org/show_bug.cgi?id=195143
<rdar://problem/48462351>

Reviewed by Simon Fraser.

Currently DOMWindow::clearTimeout() is the only callsite that we are interested in, but this is more future-proof.

* page/DOMTimer.cpp:
(WebCore::DOMTimer::removeById):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::clearTimeout):
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
(WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
(WebCore::ContentChangeObserver::didRemoveDOMTimer):
(WebCore::ContentChangeObserver::removeDOMTimer): Deleted.
* page/ios/ContentChangeObserver.h:

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

5 months ago[JSC] sizeof(JSString) should be 16
ysuzuki@apple.com [Fri, 1 Mar 2019 03:13:31 +0000 (03:13 +0000)]
[JSC] sizeof(JSString) should be 16
https://bugs.webkit.org/show_bug.cgi?id=194375

Reviewed by Saam Barati.

JSTests:

* microbenchmarks/make-rope.js: Added.
(makeRope):
* stress/to-lower-case-intrinsic-on-empty-rope.js: We no longer allow 0 length JSString except for jsEmptyString singleton per VM.
(returnRope.helper): Deleted.
(returnRope): Deleted.

Source/JavaScriptCore:

This patch reduces sizeof(JSString) from 24 to 16 to fit it into GC heap cell atom. And it also reduces sizeof(JSRopeString) from 48 to 32.
Both classes cut 16 bytes per instance in GC allocation. This new layout is used in 64bit architectures which has little endianess.

JSString no longer has length and flags directly. JSString has String, and we query information to this String instead of holding duplicate
information in JSString. We embed isRope bit into this String's pointer so that we can convert JSRopeString to JSString in an atomic manner.
We emit store-store fence before we put String pointer. This should exist even before this patch, so this patch also fixes one concurrency issue.

The old JSRopeString separately had JSString* fibers along with String. In this patch, we merge the first JSString* fiber and String pointer
storage into one to reduce the size of JSRopeString. JSRopeString has three pointer width storage. We pick 48bit effective address of JSString*
fibers to compress three fibers + length + flags into three pointer width storage.

In 64bit architecture, JSString and JSRopeString have the following memory layout to make sizeof(JSString) == 16 and sizeof(JSRopeString) == 32.
JSString has only one pointer. We use it for String. length() and is8Bit() queries go to StringImpl. In JSRopeString, we reuse the above pointer
place for the 1st fiber. JSRopeString has three fibers so its size is 48. To keep length and is8Bit flag information in JSRopeString, JSRopeString
encodes these information into the fiber pointers. is8Bit flag is encoded in the 1st fiber pointer. length is embedded directly, and two fibers
are compressed into 12bytes. isRope information is encoded in the first fiber's LSB.

Since length of JSRopeString should be frequently accessed compared to each fiber, we put length in contiguous 32byte field, and compress 2nd
and 3rd fibers into the following 80byte fields. One problem is that now 2nd and 3rd fibers are split. Storing and loading 2nd and 3rd fibers
are not one pointer load operation. To make concurrent collector work correctly, we must initialize 2nd and 3rd fibers at JSRopeString creation
and we must not modify these part later.

             0                        8        10               16                       32                                     48
JSString     [   ID      ][  header  ][   String pointer      0]
JSRopeString [   ID      ][  header  ][ flags ][ 1st fiber    1][  length  ][2nd lower32][2nd upper16][3rd lower16][3rd upper32]
                                                              ^
                                                           isRope bit

Since fibers in JSRopeString are not initialized in atomic pointer store manner, we must initialize all the fiber fields at JSRopeString creation.
To achieve this, we modify our JSRopeString::RopeBuilder implementation not to create half-baked JSRopeString.

This patch also makes an empty JSString singleton per VM. This makes evaluation of JSString in boolean context one pointer comparison. This is
critical in this change since this patch enlarges the code necessary to get length from JSString in JIT. Without this guarantee, our code of boolean
context evaluation is bloated. This patch hides all the JSString::create and JSRopeString::create in the private permission. JSString and JSRopeString
creation is only allowed from jsString and related helper functions and they return a singleton empty JSString if the length is zero. We also change
JSRopeString::RopeBuilder not to construct an empty JSRopeString.

This patch is performance neutral in Speedometer2 and JetStream2. And it improves RAMification by 2.7%.

* JavaScriptCore.xcodeproj/project.pbxproj:
* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::storeZero16):
* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::storeZero16):
(JSC::MacroAssemblerX86Common::store16):
* bytecode/AccessCase.cpp:
(JSC::AccessCase::generateImpl):
* bytecode/InlineAccess.cpp:
(JSC::InlineAccess::dumpCacheSizesAndCrash):
(JSC::linkCodeInline):
(JSC::InlineAccess::isCacheableStringLength):
(JSC::InlineAccess::generateStringLength):
* bytecode/InlineAccess.h:
(JSC::InlineAccess::sizeForPropertyAccess):
(JSC::InlineAccess::sizeForPropertyReplace):
(JSC::InlineAccess::sizeForLengthAccess):
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileStringSlice):
(JSC::DFG::SpeculativeJIT::compileToLowerCase):
(JSC::DFG::SpeculativeJIT::compileGetCharCodeAt):
(JSC::DFG::SpeculativeJIT::compileGetByValOnString):
(JSC::DFG::SpeculativeJIT::compileStringEquality):
(JSC::DFG::SpeculativeJIT::compileStringZeroLength):
(JSC::DFG::SpeculativeJIT::compileLogicalNotStringOrOther):
(JSC::DFG::SpeculativeJIT::emitStringBranch):
(JSC::DFG::SpeculativeJIT::emitStringOrOtherBranch):
(JSC::DFG::SpeculativeJIT::compileGetIndexedPropertyStorage):
(JSC::DFG::SpeculativeJIT::compileGetArrayLength):
(JSC::DFG::SpeculativeJIT::emitPopulateSliceIndex):
(JSC::DFG::SpeculativeJIT::compileArraySlice):
(JSC::DFG::SpeculativeJIT::compileArrayIndexOf):
(JSC::DFG::SpeculativeJIT::speculateStringIdentAndLoadStorage):
(JSC::DFG::SpeculativeJIT::emitSwitchCharStringJump):
(JSC::DFG::SpeculativeJIT::emitSwitchStringOnString):
(JSC::DFG::SpeculativeJIT::compileMakeRope): Deleted.
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
(JSC::DFG::SpeculativeJIT::compileMakeRope):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
(JSC::DFG::SpeculativeJIT::compileMakeRope):
* ftl/FTLAbstractHeapRepository.cpp:
(JSC::FTL::AbstractHeapRepository::AbstractHeapRepository):
* ftl/FTLAbstractHeapRepository.h:
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileGetIndexedPropertyStorage):
(JSC::FTL::DFG::LowerDFGToB3::compileGetArrayLength):
(JSC::FTL::DFG::LowerDFGToB3::compileMakeRope):
(JSC::FTL::DFG::LowerDFGToB3::compileStringCharAt):
(JSC::FTL::DFG::LowerDFGToB3::compileStringCharCodeAt):
(JSC::FTL::DFG::LowerDFGToB3::compileCompareStrictEq):
(JSC::FTL::DFG::LowerDFGToB3::compileStringToUntypedStrictEquality):
(JSC::FTL::DFG::LowerDFGToB3::compileSwitch):
(JSC::FTL::DFG::LowerDFGToB3::mapHashString):
(JSC::FTL::DFG::LowerDFGToB3::compileMapHash):
(JSC::FTL::DFG::LowerDFGToB3::compileHasOwnProperty):
(JSC::FTL::DFG::LowerDFGToB3::compileStringSlice):
(JSC::FTL::DFG::LowerDFGToB3::compileToLowerCase):
(JSC::FTL::DFG::LowerDFGToB3::stringsEqual):
(JSC::FTL::DFG::LowerDFGToB3::boolify):
(JSC::FTL::DFG::LowerDFGToB3::switchString):
(JSC::FTL::DFG::LowerDFGToB3::isRopeString):
(JSC::FTL::DFG::LowerDFGToB3::isNotRopeString):
(JSC::FTL::DFG::LowerDFGToB3::speculateStringIdent):
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::emitConvertValueToBoolean):
(JSC::AssemblyHelpers::branchIfValue):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::branchIfRopeStringImpl):
(JSC::AssemblyHelpers::branchIfNotRopeStringImpl):
* jit/JITInlines.h:
(JSC::JIT::emitLoadCharacterString):
* jit/Repatch.cpp:
(JSC::tryCacheGetByID):
* jit/ThunkGenerators.cpp:
(JSC::stringGetByValGenerator):
(JSC::stringCharLoad):
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/JSString.cpp:
(JSC::JSString::createEmptyString):
(JSC::JSRopeString::RopeBuilder<RecordOverflow>::expand):
(JSC::JSString::dumpToStream):
(JSC::JSString::estimatedSize):
(JSC::JSString::visitChildren):
(JSC::JSRopeString::resolveRopeInternal8 const):
(JSC::JSRopeString::resolveRopeInternal8NoSubstring const):
(JSC::JSRopeString::resolveRopeInternal16 const):
(JSC::JSRopeString::resolveRopeInternal16NoSubstring const):
(JSC::JSRopeString::resolveRopeToAtomicString const):
(JSC::JSRopeString::convertToNonRope const):
(JSC::JSRopeString::resolveRopeToExistingAtomicString const):
(JSC::JSRopeString::resolveRopeWithFunction const):
(JSC::JSRopeString::resolveRope const):
(JSC::JSRopeString::resolveRopeSlowCase8 const):
(JSC::JSRopeString::resolveRopeSlowCase const):
(JSC::JSRopeString::outOfMemory const):
(JSC::JSRopeString::visitFibers): Deleted.
(JSC::JSRopeString::clearFibers const): Deleted.
* runtime/JSString.h:
(JSC::JSString::uninitializedValueInternal const):
(JSC::JSString::valueInternal const):
(JSC::JSString::JSString):
(JSC::JSString::finishCreation):
(JSC::JSString::create):
(JSC::JSString::offsetOfValue):
(JSC::JSString::isRope const):
(JSC::JSString::is8Bit const):
(JSC::JSString::length const):
(JSC::JSString::tryGetValueImpl const):
(JSC::JSString::toAtomicString const):
(JSC::JSString::toExistingAtomicString const):
(JSC::JSString::value const):
(JSC::JSString::tryGetValue const):
(JSC::JSRopeString::unsafeView const):
(JSC::JSRopeString::viewWithUnderlyingString const):
(JSC::JSString::unsafeView const):
(JSC::JSString::viewWithUnderlyingString const):
(JSC::JSString::offsetOfLength): Deleted.
(JSC::JSString::offsetOfFlags): Deleted.
(JSC::JSString::setIs8Bit const): Deleted.
(JSC::JSString::setLength): Deleted.
(JSC::JSString::string): Deleted.
(JSC::jsStringBuilder): Deleted.
* runtime/JSStringInlines.h:
(JSC::JSString::~JSString):
(JSC::JSString::equal const):
* runtime/ObjectPrototype.cpp:
(JSC::objectProtoFuncToString):
* runtime/RegExpMatchesArray.h:
(JSC::createRegExpMatchesArray):
* runtime/RegExpObjectInlines.h:
(JSC::collectMatches):
* runtime/RegExpPrototype.cpp:
(JSC::regExpProtoFuncSplitFast):
* runtime/SmallStrings.cpp:
(JSC::SmallStrings::initializeCommonStrings):
(JSC::SmallStrings::createEmptyString): Deleted.
* runtime/SmallStrings.h:
* runtime/StringPrototype.cpp:
(JSC::stringProtoFuncSlice):
* runtime/StringPrototypeInlines.h: Added.
(JSC::stringSlice):

Source/WTF:

* wtf/text/StringImpl.h:
(WTF::StringImpl::flagIs8Bit):
(WTF::StringImpl::flagIsAtomic):
(WTF::StringImpl::flagIsSymbol):
(WTF::StringImpl::maskStringKind):
* wtf/text/WTFString.cpp:
(WTF::nullString):
* wtf/text/WTFString.h:

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

5 months agoHTTPSUpgradeList.db database should be opened in readonly mode
cdumez@apple.com [Fri, 1 Mar 2019 02:47:33 +0000 (02:47 +0000)]
HTTPSUpgradeList.db database should be opened in readonly mode
https://bugs.webkit.org/show_bug.cgi?id=195194
<rdar://problem/47103889>

Reviewed by Youenn Fablet.

Source/WebCore:

Add parameter to SQLiteDatabase::open() to specific the open flags.

* Modules/webdatabase/Database.cpp:
(WebCore::Database::performOpenAndVerify):
* platform/sql/SQLiteDatabase.cpp:
(WebCore::SQLiteDatabase::open):
* platform/sql/SQLiteDatabase.h:
* platform/sql/SQLiteFileSystem.cpp:
* platform/sql/SQLiteFileSystem.h:

Source/WebKit:

HTTPSUpgradeList.db database should be opened in readonly mode since it is not meant to be
modified by WebKit. Opening it in ReadWrite mode causes sandbox violations.

* NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:
(WebKit::NetworkHTTPSUpgradeChecker::NetworkHTTPSUpgradeChecker):

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

5 months agoFollowup to:
beidson@apple.com [Fri, 1 Mar 2019 02:10:22 +0000 (02:10 +0000)]
Followup to:
Universal links from Google search results pages don't open the app
https://bugs.webkit.org/show_bug.cgi?id=195126

Unreviewed.

* page/SecurityOrigin.cpp:
(WebCore::originsMatch): Remove a bogus assertion (reasoning in bugzilla)

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

5 months ago[iOS] Dark flash when opening Google AMP pages
simon.fraser@apple.com [Fri, 1 Mar 2019 01:54:59 +0000 (01:54 +0000)]
[iOS] Dark flash when opening Google AMP pages
https://bugs.webkit.org/show_bug.cgi?id=195193
rdar://problem/48326442

Reviewed by Zalan Bujtas.

Source/WebCore:

After the incremental compositing updates changes, it was possible for a change in the size
of an overflow:hidden element to fail to update the "ancestor clipping layer" geometry on
a composited descendant that is not a descendant in z-order. When Google search results
create the <iframe> that contain AMP contents, we'd fail to update a zero-sized clipping layer,
leaving the #222 background of an intermediate element visible.

Fix by setting a flag in RenderLayer::updateLayerPosition() (which is called in containing block order)
that sets the "needs geometry update" dirty bit on containing-block-descendant layers. Currently
this flag affects all descendants; in future, we might be able to clear it for grand-children.

Tests: compositing/geometry/ancestor-clip-change-interleaved-stacking-context.html
       compositing/geometry/ancestor-clip-change.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateLayerPositions):
(WebCore::RenderLayer::updateLayerPosition):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateAfterLayout):
* rendering/RenderLayerBacking.h:

LayoutTests:

Tests that change the size of a clipping layer with non-z-order composited descendant, with
a couple of layer tree configurations.

* compositing/geometry/ancestor-clip-change-expected.html: Added.
* compositing/geometry/ancestor-clip-change-interleaved-stacking-context-expected.html: Added.
* compositing/geometry/ancestor-clip-change-interleaved-stacking-context.html: Added.
* compositing/geometry/ancestor-clip-change.html: Added.

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

5 months agoUnreviewed. Attempt windows build fix after r242239.
sbarati@apple.com [Fri, 1 Mar 2019 01:44:22 +0000 (01:44 +0000)]
Unreviewed. Attempt windows build fix after r242239.

* runtime/CachedTypes.cpp:
(JSC::tagFromSourceCodeType):

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

5 months agoWeb Inspector: Timelines: don't show the auto-stop UI when not inspecting a page
drousso@apple.com [Fri, 1 Mar 2019 01:11:56 +0000 (01:11 +0000)]
Web Inspector: Timelines: don't show the auto-stop UI when not inspecting a page
https://bugs.webkit.org/show_bug.cgi?id=195192

Reviewed by Joseph Pecoraro.

* UserInterface/Views/TimelineRecordingContentView.js:
(WI.TimelineRecordingContentView):
(WI.TimelineRecordingContentView.prototype.get navigationItems):

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

5 months agoWeb Inspector: CPU Usage: Worker thread that dies might stay at a high value forever
joepeck@webkit.org [Fri, 1 Mar 2019 00:48:07 +0000 (00:48 +0000)]
Web Inspector: CPU Usage: Worker thread that dies might stay at a high value forever
https://bugs.webkit.org/show_bug.cgi?id=195148

Reviewed by Matt Baker.

* UserInterface/Views/CPUTimelineView.js:
(CPUTimelineView.prototype.layout):
Handle workers dieing or at least zeroing out between records.

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

5 months agoWeb Inspector: CPU Usage Timeline - Make Threads section expandable / collapsable
joepeck@webkit.org [Fri, 1 Mar 2019 00:48:04 +0000 (00:48 +0000)]
Web Inspector: CPU Usage Timeline - Make Threads section expandable / collapsable
https://bugs.webkit.org/show_bug.cgi?id=195085

Reviewed by Matt Baker.

* UserInterface/Base/Setting.js:
New setting to save the Threads expanded/collapsed state.

* UserInterface/Views/CPUTimelineView.css:
(.timeline-view.cpu > .content > .details > .subtitle):
(.timeline-view.cpu > .content > .details > details > .subtitle.threads):
(.timeline-view.cpu > .content > .details > .subtitle): Deleted.
(.timeline-view.cpu > .content > .details > .subtitle.threads): Deleted.
Ensure subtitle styles apply now that one of the subtitles is inside
of a <details> / <summary> element.

* UserInterface/Views/CPUTimelineView.js:
(WI.CPUTimelineView.prototype.initialLayout):
Make the Threads group a <details> / <summary> expandable / collapsed element.

* UserInterface/Views/Main.css:
(summary):
(summary::-webkit-details-marker):
Default styles for <summary>.

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

5 months agoWeb Inspector: View.removeSubview not removing the element properly when not parented
joepeck@webkit.org [Fri, 1 Mar 2019 00:48:01 +0000 (00:48 +0000)]
Web Inspector: View.removeSubview not removing the element properly when not parented
https://bugs.webkit.org/show_bug.cgi?id=195146

Reviewed by Matt Baker.

Source/WebInspectorUI:

* UserInterface/Views/View.js:
(WI.View.prototype.removeSubview):
Since the element may not be a direct child, just use Element.prototype.remove.

LayoutTests:

* inspector/view/basics-expected.txt:
* inspector/view/basics.html:

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

5 months agoIn cloop.rb, rename :int and :uint to :intptr and :uintptr.
mark.lam@apple.com [Fri, 1 Mar 2019 00:04:51 +0000 (00:04 +0000)]
In cloop.rb, rename :int and :uint to :intptr and :uintptr.
https://bugs.webkit.org/show_bug.cgi?id=195183

Reviewed by Yusuke Suzuki.

Also changed intMemRef and uintMemRef to intptrMemRef and uintptrMemRef respectively.

* offlineasm/cloop.rb:

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

5 months agoMake JSScript:cacheBytecodeWithError update the cache when the script changes
sbarati@apple.com [Thu, 28 Feb 2019 23:58:12 +0000 (23:58 +0000)]
Make JSScript:cacheBytecodeWithError update the cache when the script changes
https://bugs.webkit.org/show_bug.cgi?id=194912

Reviewed by Mark Lam.

Prior to this patch, the JSScript SPI would never check if its cached
bytecode were still valid. This would lead the cacheBytecodeWithError
succeeding even if the underlying cache were stale. This patch fixes
that by making JSScript check if the cache is still valid. If it's not,
we will cache bytecode when cacheBytecodeWithError is invoked.

* API/JSScript.mm:
(-[JSScript readCache]):
(-[JSScript writeCache:]):
* API/tests/testapi.mm:
(testBytecodeCacheWithSameCacheFileAndDifferentScript):
(testObjectiveCAPI):
* runtime/CachedTypes.cpp:
(JSC::Decoder::Decoder):
(JSC::VariableLengthObject::buffer const):
(JSC::CachedPtr::decode const):
(JSC::tagFromSourceCodeType):
(JSC::GenericCacheEntry::isUpToDate const):
(JSC::CacheEntry::isStillValid const):
(JSC::GenericCacheEntry::decode const):
(JSC::GenericCacheEntry::isStillValid const):
(JSC::encodeCodeBlock):
(JSC::decodeCodeBlockImpl):
(JSC::isCachedBytecodeStillValid):
* runtime/CachedTypes.h:
* runtime/CodeCache.cpp:
(JSC::sourceCodeKeyForSerializedBytecode):
(JSC::sourceCodeKeyForSerializedProgram):
(JSC::sourceCodeKeyForSerializedModule):
(JSC::serializeBytecode):
* runtime/CodeCache.h:
(JSC::CodeCacheMap::fetchFromDiskImpl):
* runtime/Completion.cpp:
(JSC::generateProgramBytecode):
(JSC::generateBytecode): Deleted.
* runtime/Completion.h:

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

5 months agoUse-after-move in RenderCombineText::combineTextIfNeeded()
mmaxfield@apple.com [Thu, 28 Feb 2019 23:42:22 +0000 (23:42 +0000)]
Use-after-move in RenderCombineText::combineTextIfNeeded()
https://bugs.webkit.org/show_bug.cgi?id=195188

Reviewed by Zalan Bujtas.

Source/WebCore:

r241288 uncovered an existing problem with our text-combine code. r242204 alleviated the
symptom, but this patch fixes the source of the problem (and reverts r242204).

The code in RenderCombineText::combineTextIfNeeded() has a bit that’s like:

FontDescription bestFitDescription;
while (...) {
    FontCascade compressedFont(WTFMove(bestFitDescription), ...);
    ...
}

Clearly this is wrong.

Test: fast/text/text-combine-crash-2.html

* platform/graphics/cocoa/FontDescriptionCocoa.cpp:
(WebCore::FontDescription::platformResolveGenericFamily):
* rendering/RenderCombineText.cpp:
(WebCore::RenderCombineText::combineTextIfNeeded):

LayoutTests:

* fast/text/text-combine-crash-2-expected.html: Added.
* fast/text/text-combine-crash-2.html: Added.

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

5 months agoExpose APINavigationAction.shouldPerformDownload() on WKNavigationAction
david_quesada@apple.com [Thu, 28 Feb 2019 23:37:43 +0000 (23:37 +0000)]
Expose APINavigationAction.shouldPerformDownload() on WKNavigationAction
https://bugs.webkit.org/show_bug.cgi?id=195121
rdar://problem/48450302

Reviewed by Alex Christensen.

Source/WebKit:

* UIProcess/API/Cocoa/WKNavigationAction.mm:
(-[WKNavigationAction _shouldPerformDownload]):
* UIProcess/API/Cocoa/WKNavigationActionPrivate.h:

Tools:

Add API tests for -WKNavigationAction._shouldPerformDownload in various
configurations where the 'download' attribute is absent, blank, or populated
with a filename, and where the anchor element is same-origin or cross-origin
(meaning the 'download' attribute shouldn't be honored).

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/NavigationAction.mm: Added.
(-[NavigationActionTestDelegate init]):
(-[NavigationActionTestDelegate navigationAction]):
(-[NavigationActionTestDelegate waitForNavigationActionCallback]):
(-[NavigationActionTestDelegate waitForDidFinishNavigation]):
(-[NavigationActionTestDelegate webView:decidePolicyForNavigationAction:decisionHandler:]):
(-[NavigationActionTestDelegate webView:didFinishNavigation:]):
(TEST):

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

5 months agoChange CheckedArithmetic to not use std::enable_if_t.
mark.lam@apple.com [Thu, 28 Feb 2019 23:33:08 +0000 (23:33 +0000)]
Change CheckedArithmetic to not use std::enable_if_t.
https://bugs.webkit.org/show_bug.cgi?id=195187
<rdar://problem/48464665>

Reviewed by Keith Miller.

Because C++11 does not like std::enable_if_t and there's a need to use this file with C++11.

* wtf/CheckedArithmetic.h:

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

5 months ago[ContentChangeObserver] Introduce observer subclasses to scope content change observing.
zalan@apple.com [Thu, 28 Feb 2019 23:18:06 +0000 (23:18 +0000)]
[ContentChangeObserver] Introduce observer subclasses to scope content change observing.
https://bugs.webkit.org/show_bug.cgi?id=195172
<rdar://problem/48479259>

Reviewed by Simon Fraser.

Let's scope start/stopObserving call pairs.

* dom/Document.cpp:
(WebCore::Document::updateStyleIfNeeded):
* page/DOMTimer.cpp:
(WebCore::DOMTimer::fired):
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::StyleChangeObserver::StyleChangeObserver):
(WebCore::ContentChangeObserver::StyleChangeObserver::~StyleChangeObserver):
(WebCore::ContentChangeObserver::StyleRecalcObserver::StyleRecalcObserver):
(WebCore::ContentChangeObserver::StyleRecalcObserver::~StyleRecalcObserver):
(WebCore::ContentChangeObserver::DOMTimerObserver::DOMTimerObserver):
(WebCore::ContentChangeObserver::DOMTimerObserver::~DOMTimerObserver):
(WebCore::ContentChangeObserver::StyleChange::StyleChange): Deleted.
(WebCore::ContentChangeObserver::StyleChange::~StyleChange): Deleted.
* page/ios/ContentChangeObserver.h:
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateElementRenderer):

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

5 months agoDisable Web Animations in Safari Technology Preview
commit-queue@webkit.org [Thu, 28 Feb 2019 23:04:07 +0000 (23:04 +0000)]
Disable Web Animations in Safari Technology Preview
https://bugs.webkit.org/show_bug.cgi?id=194748
<rdar://problem/48139481>

Patch by Antoine Quint <graouts@apple.com> on 2019-02-28
Reviewed by Dean Jackson.

The test runners already opt into that feature explicitly, so all that is needed is to turn
the default setting value to false.

* Shared/WebPreferences.yaml:

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

5 months agoEnable the Pointer Events runtime flag by default
commit-queue@webkit.org [Thu, 28 Feb 2019 22:59:14 +0000 (22:59 +0000)]
Enable the Pointer Events runtime flag by default
https://bugs.webkit.org/show_bug.cgi?id=195156

Patch by Antoine Quint <graouts@apple.com> on 2019-02-28
Reviewed by Dean Jackson.

Source/WebCore:

* page/RuntimeEnabledFeatures.h:

Source/WebKit:

* Shared/WebPreferences.yaml:

Source/WebKitLegacy/mac:

* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(enableExperimentalFeatures):

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

5 months agoREGRESSION (r240644): Layout Test inspector/page/overrideSetting-ICECandidateFilterin...
drousso@apple.com [Thu, 28 Feb 2019 22:54:38 +0000 (22:54 +0000)]
REGRESSION (r240644): Layout Test inspector/page/overrideSetting-ICECandidateFilteringEnabled.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=194437
<rdar://problem/48008005>

Reviewed by Joseph Pecoraro.

* inspector/page/overrideSetting-ICECandidateFilteringEnabled.html:
* inspector/page/overrideSetting-ICECandidateFilteringEnabled-expected.txt:
Make sure to close the peer connection and data channel after each phase of the test.
Also add failure logging.

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

5 months agoRevert r232263: it caused processes to crash because process was suspended with locke...
sihui_liu@apple.com [Thu, 28 Feb 2019 22:45:06 +0000 (22:45 +0000)]
Revert r232263: it caused processes to crash because process was suspended with locked file
https://bugs.webkit.org/show_bug.cgi?id=195122
<rdar://problem/48444599>

Reviewed by Geoffrey Garen.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::NetworkProcess):
* NetworkProcess/NetworkProcess.h:
* Shared/WebSQLiteDatabaseTracker.cpp:
(WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker):
(WebKit::WebSQLiteDatabaseTracker::hysteresisUpdated):
* Shared/WebSQLiteDatabaseTracker.h:
* WebProcess/WebProcess.cpp:
(WebKit::m_webSQLiteDatabaseTracker):
(WebKit::m_nonVisibleProcessCleanupTimer): Deleted.
* WebProcess/WebProcess.h:

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

5 months agoWeb Inspector: Debugger: disabled breakpoint color is too dark
mattbaker@apple.com [Thu, 28 Feb 2019 22:32:38 +0000 (22:32 +0000)]
Web Inspector: Debugger: disabled breakpoint color is too dark
https://bugs.webkit.org/show_bug.cgi?id=195103
<rdar://problem/48440678>

Reviewed by Devin Rousso.

Increase the disabled breakpoint contrast, as well as the contrast between
disabled and auto-continue breakpoints. Disabled breakpoints stand out by
being somewhat brighter and less saturated. Using the same strategy for
auto-continue breakpoints is too subtle to provide sufficient contrast.

We can adopt the technique used by Xcode, and overlay a white triangle
marker on the breakpoint arrow to indicate an auto-continue breakpoint.

* UserInterface/Views/BreakpointTreeElement.css:
(.item.breakpoint .status > .status-image):
(.item.breakpoint.selected .status > .status-image.resolved):
Add white outline to make selected breakpoint button stand out.
(.item.breakpoint .status > .status-image.auto-continue::after):
(.item.breakpoint .status > .status-image.disabled):
(.item.breakpoint .status > .status-image.auto-continue): Deleted.

* UserInterface/Views/DOMTreeContentView.css:
(.content-view.dom-tree .tree-outline.dom li .status-image.breakpoint):
(.content-view.dom-tree .tree-outline.dom li .status-image.breakpoint.disabled):
(.content-view.dom-tree .tree-outline.dom li .status-image.breakpoint.subtree):
(.content-view.dom-tree .tree-outline.dom li .status-image.breakpoint.disabled,): Deleted.

* UserInterface/Views/TextEditor.css:
(.text-editor > .CodeMirror .has-breakpoint .CodeMirror-linenumber::before):
(.text-editor > .CodeMirror .breakpoint-auto-continue:not(.execution-line.primary) .CodeMirror-linenumber::after):
(.text-editor > .CodeMirror .breakpoint-disabled .CodeMirror-linenumber::before):
(.text-editor > .CodeMirror .breakpoint-auto-continue:not(.breakpoint-disabled) .CodeMirror-linenumber::before): Deleted.

* UserInterface/Views/Variables.css:
(:root):
Add breakpoint color variables to use across all breakpoint controls.
Use system colors if available, otherwise fall back to hard-coded values
based on sampling the default (blue) accent color on Mojave.

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

5 months ago[ContentChangeObserver] Make observed state reset explicit.
zalan@apple.com [Thu, 28 Feb 2019 22:29:48 +0000 (22:29 +0000)]
[ContentChangeObserver] Make observed state reset explicit.
https://bugs.webkit.org/show_bug.cgi?id=195185
<rdar://problem/48488342>

Reviewed by Simon Fraser.

Use setObservedContentChange only for setting the observed change while observing.

* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::startObservingContentChanges):
(WebCore::ContentChangeObserver::resetObservedContentChange):
(WebCore::ContentChangeObserver::removeObservedDOMTimer):
* page/ios/ContentChangeObserver.h:

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

5 months agoWeb Inspector: Canvas: change tests to not print out dataURLs
drousso@apple.com [Thu, 28 Feb 2019 22:01:24 +0000 (22:01 +0000)]
Web Inspector: Canvas: change tests to not print out dataURLs
https://bugs.webkit.org/show_bug.cgi?id=195136
<rdar://problem/48248697>

Reviewed by Matt Baker.

* inspector/canvas/resources/recording-utilities.js:
(TestPage.registerInitializer.async logRecording):
(TestPage.registerInitializer.window.startRecording):
* inspector/canvas/recording-2d-expected.txt:
* inspector/canvas/recording-bitmaprenderer-expected.txt:
* inspector/canvas/recording-webgl-expected.txt:
* inspector/canvas/recording-webgl-snapshots.html:
* inspector/canvas/recording-webgl-snapshots-expected.txt:

* inspector/canvas/requestContent-2d.html:
* inspector/canvas/requestContent-2d-expected.txt:
* inspector/canvas/requestContent-bitmaprenderer.html:
* inspector/canvas/requestContent-bitmaprenderer-expected.txt:
* inspector/canvas/requestContent-webgl.html:
* inspector/canvas/requestContent-webgl-expected.txt:
* inspector/canvas/requestContent-webgl2.html:
* inspector/canvas/requestContent-webgl2-expected.txt:

* inspector/canvas/setShaderProgramHighlighted.html:
* inspector/canvas/setShaderProgramHighlighted-expected.txt:

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

5 months ago[iOS] Move calls to [UIKeyboard isInHardwareKeyboardMode] to the UI process.
pvollan@apple.com [Thu, 28 Feb 2019 21:39:52 +0000 (21:39 +0000)]
[iOS] Move calls to [UIKeyboard isInHardwareKeyboardMode] to the UI process.
https://bugs.webkit.org/show_bug.cgi?id=193683
<rdar://problem/47634345>

Reviewed by Brent Fulgham.

When a keyboard is attached/deattached or the application becomes foreground, send a message from
the UI process to the WebContent process, notifying whether a keyboard is attached or not. Also,
cache the value of [UIKeyboard isInHardwareKeyboardMode] in the UI process, since this call seems
to be expensive.

* UIProcess/API/Cocoa/WKWebView.mm:
(hardwareKeyboardAvailabilityChangedCallback):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessProxy.h:
(WebKit::WebProcessProxy::setKeyboardIsAttached):
(WebKit::WebProcessProxy::keyboardIsAttached const):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::applicationWillEnterForeground):
(WebKit::WebPageProxy::hardwareKeyboardAvailabilityChanged):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::platformEditorState const):
(WebKit::WebPage::hardwareKeyboardAvailabilityChanged):

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

5 months agoWeb Inspector: Styles: Control-Space should force completion
nvasilyev@apple.com [Thu, 28 Feb 2019 21:19:25 +0000 (21:19 +0000)]
Web Inspector: Styles: Control-Space should force completion
https://bugs.webkit.org/show_bug.cgi?id=194796
<rdar://problem/48180822>

Reviewed by Matt Baker.

Pressing Control-Space when editing CSS property should show completion popover,
even if the value is empty.

* UserInterface/Models/CSSCompletions.js:
(WI.CSSCompletions.prototype.startsWith):
Performance optimization: exit early when `prefix` is empty.

* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype._nameCompletionDataProvider):
(WI.SpreadsheetStyleProperty.prototype._valueCompletionDataProvider):
* UserInterface/Views/SpreadsheetTextField.js:
(WI.SpreadsheetTextField):
(WI.SpreadsheetTextField.prototype._handleKeyDown):
(WI.SpreadsheetTextField.prototype._updateCompletions):

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

5 months agoWeb Inspector: Canvas: enabling auto-capture if the frame count is empty triggers...
drousso@apple.com [Thu, 28 Feb 2019 21:06:59 +0000 (21:06 +0000)]
Web Inspector: Canvas: enabling auto-capture if the frame count is empty triggers an assertion
https://bugs.webkit.org/show_bug.cgi?id=195060

Reviewed by Matt Baker.

* UserInterface/Views/CanvasOverviewContentView.js:
(WI.CanvasOverviewContentView.prototype._setRecordingAutoCaptureFrameCount):
(WI.CanvasOverviewContentView.prototype._updateRecordingAutoCaptureCheckboxLabel):
(WI.CanvasOverviewContentView.prototype._handleRecordingAutoCaptureCheckedDidChange):

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

5 months agoSeveral PasteImage API tests are flaky
wenson_hsieh@apple.com [Thu, 28 Feb 2019 20:52:49 +0000 (20:52 +0000)]
Several PasteImage API tests are flaky
https://bugs.webkit.org/show_bug.cgi?id=195160

Reviewed by Tim Horton.

Some of these tests, such as PasteTIFFImage, don't wait for the inserted image element to finish loading before
querying the image element's size; a few other tests, such as PastePNGFile, are racy since they may begin
listening for a "load" event after image load is already complete.

To address this, make these tests first register a "load" event handler, then run script to insert an image
element into the document, and finally wait until the load event is observed before checking image size.

* TestWebKitAPI/Tests/WebKitCocoa/PasteImage.mm:

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

5 months agocloop.rb shift mask should depend on the word size being shifted.
mark.lam@apple.com [Thu, 28 Feb 2019 20:48:50 +0000 (20:48 +0000)]
cloop.rb shift mask should depend on the word size being shifted.
https://bugs.webkit.org/show_bug.cgi?id=195181
<rdar://problem/48484164>

Reviewed by Yusuke Suzuki.

Previously, we're always masking the shift amount with 0x1f.  This is only correct
for 32-bit words.  For 64-bit words, the mask should be 0x3f.  For pointer sized
shifts, the mask depends on sizeof(uintptr_t).

* offlineasm/cloop.rb:

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

5 months agoUnreviewed, reduce the count in the stress/read-dead-bytecode-locals-in-must-handle...
ysuzuki@apple.com [Thu, 28 Feb 2019 20:17:53 +0000 (20:17 +0000)]
Unreviewed, reduce the count in the stress/read-dead-bytecode-locals-in-must-handle-values2.js
https://bugs.webkit.org/show_bug.cgi?id=195144

1e8 takes too much time in the Debug build. I tried 1e5 with the old Debug build and it successfully reproduced the issue.
Change the number from 1e8 to 1e5.

* stress/read-dead-bytecode-locals-in-must-handle-values2.js:
(foo):

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

5 months agoUnreviewed, rolling out r242210.
zalan@apple.com [Thu, 28 Feb 2019 19:58:11 +0000 (19:58 +0000)]
Unreviewed, rolling out r242210.
https://bugs.webkit.org/show_bug.cgi?id=195179

it broke hover menus on losaltosonline.com (Requested by zalan
on #webkit).

Reverted changeset:

"[ContentChangeObserver] Move timer removal code from
DOMWindow::clearTimeout to DOMTimer::removeById"
https://bugs.webkit.org/show_bug.cgi?id=195143
https://trac.webkit.org/changeset/242210

Patch by Commit Queue <commit-queue@webkit.org> on 2019-02-28

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

5 months ago[ContentChangeObserver] Move timer removal code from DOMWindow::clearTimeout to DOMTi...
zalan@apple.com [Thu, 28 Feb 2019 19:19:51 +0000 (19:19 +0000)]
[ContentChangeObserver] Move timer removal code from DOMWindow::clearTimeout to DOMTimer::removeById
https://bugs.webkit.org/show_bug.cgi?id=195143
<rdar://problem/48462351>

Reviewed by Simon Fraser.

Currently DOMWindow::clearTimeout() is the only callsite that we are interested in, but this is more future-proof.

* page/DOMTimer.cpp:
(WebCore::DOMTimer::removeById):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::clearTimeout):
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
(WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
(WebCore::ContentChangeObserver::didRemoveDOMTimer):
(WebCore::ContentChangeObserver::removeDOMTimer): Deleted.
* page/ios/ContentChangeObserver.h:

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

5 months agoFix Resource Timing buffer edge cases for WPT
commit-queue@webkit.org [Thu, 28 Feb 2019 19:09:32 +0000 (19:09 +0000)]
Fix Resource Timing buffer edge cases for WPT
https://bugs.webkit.org/show_bug.cgi?id=193213

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

LayoutTests/imported/w3c:

* web-platform-tests/resource-timing/buffer-full-add-after-full-event.html:
* web-platform-tests/resource-timing/buffer-full-add-entries-during-callback-that-drop-expected.txt:
* web-platform-tests/resource-timing/buffer-full-add-then-clear-expected.txt:
* web-platform-tests/resource-timing/buffer-full-then-increased-expected.txt:

Source/WebCore:

Test coverage by LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer*.html

* page/Performance.cpp:
(WebCore::Performance::resourceTimingBufferFullTimerFired): Only dispatch the
resourcetimingbufferfull event if the buffer is still full (as it may have been cleared or
expanded). Also, avoid infinite loops if we aren't able to decrease the number of entries in
the secondary buffer.

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

5 months agoFlaky API Test: TestWebKitAPI.ProcessSwap.PageZoomLevelAfterSwap
cdumez@apple.com [Thu, 28 Feb 2019 18:51:55 +0000 (18:51 +0000)]
Flaky API Test: TestWebKitAPI.ProcessSwap.PageZoomLevelAfterSwap
https://bugs.webkit.org/show_bug.cgi?id=195107

Reviewed by Alex Christensen.

Give some time for the zoom level to get restored.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

5 months ago[Curl] HTTP Body is missing with redirection.
commit-queue@webkit.org [Thu, 28 Feb 2019 18:44:49 +0000 (18:44 +0000)]
[Curl] HTTP Body is missing with redirection.
https://bugs.webkit.org/show_bug.cgi?id=191651

Patch by Takashi Komori <Takashi.Komori@sony.com> on 2019-02-28
Reviewed by Don Olmstead.

Source/WebCore:

Implement updateFromDelegatePreservingOldProperties for curl port.

Tests: http/tests/navigation/post-301-response.html
       http/tests/navigation/post-302-response.html
       http/tests/navigation/post-303-response.html
       http/tests/navigation/post-307-response.html
       http/tests/navigation/post-308-response.html

* platform/Curl.cmake:
* platform/network/curl/ResourceRequest.h:
(WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties): Deleted.
* platform/network/curl/ResourceRequestCurl.cpp: Added.
(WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties):

LayoutTests:

* platform/wincairo/TestExpectations:

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

5 months ago[CoordinatedGraphics] Remove COORDINATED_GRAPHICS_THREADED option
commit-queue@webkit.org [Thu, 28 Feb 2019 18:28:01 +0000 (18:28 +0000)]
[CoordinatedGraphics] Remove COORDINATED_GRAPHICS_THREADED option
https://bugs.webkit.org/show_bug.cgi?id=195159

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2019-02-28
Reviewed by Don Olmstead.

.:

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

Source/WebCore:

Use COORDINATED_GRAPHICS instead.

* platform/graphics/GraphicsContext3D.h:
* platform/graphics/PlatformLayer.h:
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBufferData::ImageBufferData):
(WebCore::ImageBufferData::~ImageBufferData):
* platform/graphics/cairo/ImageBufferDataCairo.h:
* platform/graphics/nicosia/NicosiaPaintingEngineThreaded.cpp:
* platform/graphics/nicosia/NicosiaPaintingEngineThreaded.h:
* platform/graphics/nicosia/texmap/NicosiaGC3DLayer.cpp:
(Nicosia::GC3DLayer::swapBuffersIfNeeded):
* platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
(WebCore::GraphicsContext3D::reshapeFBOs):
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::prepareTexture):
* platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
(WebCore::GraphicsContext3D::reshapeFBOs):
* platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp:
(WebCore::GraphicsContext3D::GraphicsContext3D):
(WebCore::GraphicsContext3D::~GraphicsContext3D):
* platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp:
(WebCore::TextureMapperGC3DPlatformLayer::TextureMapperGC3DPlatformLayer):
(WebCore::TextureMapperGC3DPlatformLayer::~TextureMapperGC3DPlatformLayer):
* platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h:
* platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
* platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
* platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
* platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
* platform/graphics/texmap/TextureMapperPlatformLayerProxyProvider.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::setContentsNeedsDisplay):
(WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer):
(WebCore::CoordinatedGraphicsLayer::updatePlatformLayer):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::paintsIntoWindow const):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::shouldCompositeOverflowControls const):

Source/WebKit:

Use COORDINATED_GRAPHICS instead.

* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::onNewBufferAvailable):
* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
* Shared/CoordinatedGraphics/SimpleViewportController.cpp:
* Shared/CoordinatedGraphics/SimpleViewportController.h:
* Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
* Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.h:
* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::mainFrameContentSizeChanged):
(WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode):
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h:
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::updatePreferences):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::sendViewportAttributesChanged):
(WebKit::WebPage::viewportPropertiesDidChange):
* WebProcess/gtk/WebProcessMainGtk.cpp:

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

5 months agoLocale names can be nullptr
mmaxfield@apple.com [Thu, 28 Feb 2019 18:22:34 +0000 (18:22 +0000)]
Locale names can be nullptr
https://bugs.webkit.org/show_bug.cgi?id=195171
<rdar://problem/48262376>

Reviewed by Dean Jackson.

Nullptr can't be used in keys to HashMaps, so take an early out in this case.

This is a partial revert of r241288.

* platform/graphics/cocoa/FontDescriptionCocoa.cpp:
(WebCore::FontDescription::platformResolveGenericFamily):

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

5 months agoStop using legacy IDB path by default when creating WebProcessPool from websiteDataStore
sihui_liu@apple.com [Thu, 28 Feb 2019 18:15:22 +0000 (18:15 +0000)]
Stop using legacy IDB path by default when creating WebProcessPool from websiteDataStore
https://bugs.webkit.org/show_bug.cgi?id=194958

Reviewed by Geoffrey Garen.

Source/WebKit:

ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration should not use fixed IDB path.

* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
* UIProcess/API/APIWebsiteDataStore.cpp:
(API::WebsiteDataStore::createLegacy):
(API::indexedDBDatabaseDirectory):
* UIProcess/API/APIWebsiteDataStore.h:
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _indexedDBDatabaseDirectory]):
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::legacyWebsiteDataStoreConfiguration):

Tools:

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

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

5 months agoFix timing out tests following r241747
dbates@webkit.org [Thu, 28 Feb 2019 17:45:38 +0000 (17:45 +0000)]
Fix timing out tests following r241747
(https://bugs.webkit.org/show_bug.cgi?id=193599)

Fix up the path to ui-helper.js so that we actually load it.

* fast/forms/ios/focus-button.html:
* fast/forms/ios/focus-checkbox.html:
* fast/forms/ios/focus-checked-checkbox.html:
* fast/forms/ios/focus-checked-radio.html:
* fast/forms/ios/focus-radio.html:
* fast/forms/ios/focus-reset-button.html:
* fast/forms/ios/focus-search-field.html:
* fast/forms/ios/focus-submit-button.html:
* fast/forms/ios/focus-text-field.html:
* fast/forms/ios/focus-textarea.html:

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

5 months agoTest times out on ARM/MIPS
dinfuehr@igalia.com [Thu, 28 Feb 2019 17:34:25 +0000 (17:34 +0000)]
Test times out on ARM/MIPS
https://bugs.webkit.org/show_bug.cgi?id=195168

Unreviewed. Skip test on ARM/MIPS.

* stress/read-dead-bytecode-locals-in-must-handle-values2.js:

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

5 months ago[CoordinatedGraphics] Unify all LayerTreeHost classes
carlosgc@webkit.org [Thu, 28 Feb 2019 13:17:41 +0000 (13:17 +0000)]
[CoordinatedGraphics] Unify all LayerTreeHost classes
https://bugs.webkit.org/show_bug.cgi?id=195094

Reviewed by Žan Doberšek.

There's no reason to have 3 classes, since currently LayerTreeHost is only used by coordinated graphics based
ports.

* PlatformWin.cmake:
* SourcesGTK.txt:
* SourcesWPE.txt:
* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode):
(WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeNow):
* WebProcess/WebPage/AcceleratedDrawingArea.h:
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: Removed.
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: Removed.
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp: Renamed from Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp.
(WebKit::LayerTreeHost::LayerTreeHost):
(WebKit::LayerTreeHost::~LayerTreeHost):
(WebKit::LayerTreeHost::setLayerFlushSchedulingEnabled):
(WebKit::LayerTreeHost::scheduleLayerFlush):
(WebKit::LayerTreeHost::cancelPendingLayerFlush):
(WebKit::LayerTreeHost::layerFlushTimerFired):
(WebKit::LayerTreeHost::setRootCompositingLayer):
(WebKit::LayerTreeHost::setViewOverlayRootLayer):
(WebKit::LayerTreeHost::invalidate):
(WebKit::LayerTreeHost::scrollNonCompositedContents):
(WebKit::LayerTreeHost::forceRepaint):
(WebKit::LayerTreeHost::forceRepaintAsync):
(WebKit::LayerTreeHost::sizeDidChange):
(WebKit::LayerTreeHost::pauseRendering):
(WebKit::LayerTreeHost::resumeRendering):
(WebKit::LayerTreeHost::graphicsLayerFactory):
(WebKit::LayerTreeHost::contentsSizeChanged):
(WebKit::LayerTreeHost::didChangeViewportAttributes):
(WebKit::LayerTreeHost::didChangeViewport):
(WebKit::LayerTreeHost::setIsDiscardable):
(WebKit::LayerTreeHost::setNativeSurfaceHandleForCompositing):
(WebKit::LayerTreeHost::deviceOrPageScaleFactorChanged):
(WebKit::LayerTreeHost::createDisplayRefreshMonitor):
(WebKit::LayerTreeHost::didFlushRootLayer):
(WebKit::LayerTreeHost::commitSceneState):
(WebKit::LayerTreeHost::frameComplete):
(WebKit::LayerTreeHost::nativeSurfaceHandleForCompositing):
(WebKit::LayerTreeHost::didDestroyGLContext):
(WebKit::LayerTreeHost::willRenderFrame):
(WebKit::LayerTreeHost::didRenderFrame):
(WebKit::LayerTreeHost::requestDisplayRefreshMonitorUpdate):
(WebKit::LayerTreeHost::handleDisplayRefreshMonitorUpdate):
(WebKit::LayerTreeHost::renderNextFrame):
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h: Renamed from Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h.
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::setNeedsDisplay):
(WebKit::DrawingAreaImpl::setNeedsDisplayInRect):
* WebProcess/WebPage/LayerTreeHost.cpp: Removed.
* WebProcess/WebPage/LayerTreeHost.h: Removed.
* WebPage/win/LayerTreeHost.h: Added.

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

5 months ago[ews-app] Update method to save build to handle builder_display_name
aakash_jain@apple.com [Thu, 28 Feb 2019 12:28:34 +0000 (12:28 +0000)]
[ews-app] Update method to save build to handle builder_display_name
https://bugs.webkit.org/show_bug.cgi?id=195047

Reviewed by Dewei Zhu.

* BuildSlaveSupport/ews-app/ews/models/build.py: Updated to handle builder_name and builder_display_name.
* BuildSlaveSupport/ews-app/ews/views/results.py: Ditto.

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

5 months agoWeb Inspector: Revert -webkit-border-end changes that are unreliable
commit-queue@webkit.org [Thu, 28 Feb 2019 09:02:43 +0000 (09:02 +0000)]
Web Inspector: Revert -webkit-border-end changes that are unreliable
https://bugs.webkit.org/show_bug.cgi?id=195149

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

* UserInterface/Views/CPUUsageIndicatorView.css:
(.cpu-usage-indicator-view > .details):
(body[dir=ltr] .cpu-usage-indicator-view > .details):
(body[dir=rtl] .cpu-usage-indicator-view > .details):
* UserInterface/Views/CPUUsageStackedView.css:
(.cpu-usage-stacked-view > .details):
(body[dir=ltr] .cpu-usage-stacked-view > .details):
(body[dir=rtl] .cpu-usage-stacked-view > .details):
* UserInterface/Views/CPUUsageView.css:
(.cpu-usage-view > .details):
(body[dir=ltr] .cpu-usage-view > .details):
(body[dir=rtl] .cpu-usage-view > .details):
* UserInterface/Views/MemoryCategoryView.css:
(.memory-category-view > .details):
(body[dir=ltr] .memory-category-view > .details):
(body[dir=rtl] .memory-category-view > .details):

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

5 months ago[Web GPU] Enable Web GPU only on 64-bit
justin_fan@apple.com [Thu, 28 Feb 2019 08:27:37 +0000 (08:27 +0000)]
[Web GPU] Enable Web GPU only on 64-bit
https://bugs.webkit.org/show_bug.cgi?id=195139

Because Metal is only supported on 64 bit apps.

Unreviewed build fix.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

* Configurations/FeatureDefines.xcconfig:

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

5 months agoWeb Inspector: Cleanup some Chart code
commit-queue@webkit.org [Thu, 28 Feb 2019 08:07:16 +0000 (08:07 +0000)]
Web Inspector: Cleanup some Chart code
https://bugs.webkit.org/show_bug.cgi?id=195147

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

* UserInterface/Views/RangeChart.js:
(WI.RangeChart.prototype.layout):
(WI.RangeChart):
* UserInterface/Views/StackedColumnChart.js:
(WI.StackedColumnChart.prototype.layout):
(WI.StackedColumnChart):

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

5 months agoWeb Inspector: Add a new Scanner TimelineMarker to show up when mousing over Timeline...
joepeck@webkit.org [Thu, 28 Feb 2019 06:54:21 +0000 (06:54 +0000)]
Web Inspector: Add a new Scanner TimelineMarker to show up when mousing over TimelineView graphs
https://bugs.webkit.org/show_bug.cgi?id=195079

Reviewed by Devin Rousso.

* UserInterface/Base/Utilities.js:
(Note.prototype.enclosingNodeOrSelfWithClassInArray):
Helper for a set of classes.

* UserInterface/Models/TimelineMarker.js:
Add a new marker type, "Scanner".

* UserInterface/Views/CPUTimelineView.js:
(WI.CPUTimelineView.prototype.initialLayout):
(WI.CPUTimelineView.prototype._graphPositionForMouseEvent):
(WI.CPUTimelineView.prototype._handleGraphMouseMove):
* UserInterface/Views/MemoryTimelineView.js:
(WI.MemoryTimelineView):
(WI.MemoryTimelineView.prototype._graphPositionForMouseEvent):
(WI.MemoryTimelineView.prototype._handleGraphMouseMove):
Update a scanner time when mousing over various graphs that span the entire time range.
These use the containing graph element because there was a single pixel between
adjacent graphs which would cause the scanner to flicker because the mouse event target
was not an svg element.

* UserInterface/Views/TimelineOverview.js:
(WI.TimelineOverview.prototype.hidden):
(WI.TimelineOverview.prototype.updateScannerTime):
(WI.TimelineOverview.prototype.clearScanner):
* UserInterface/Views/TimelineRecordingContentView.js:
(WI.TimelineRecordingContentView):
(WI.TimelineRecordingContentView.prototype._handleTimelineViewScannerTimeDidChange):
(WI.TimelineRecordingContentView.prototype._handleTimelineViewScannerDidClear):
Update the overview's ruler with scanner changes.

* UserInterface/Views/TimelineRuler.css:
(.timeline-ruler > .markers > .marker.scanner):
* UserInterface/Views/TimelineRuler.js:
(WI.TimelineRuler):
(WI.TimelineRuler.prototype.clearMarkers):
(WI.TimelineRuler.prototype.updateScannerTime):
(WI.TimelineRuler.prototype.clearScanner):
(WI.TimelineRuler.prototype._updateMarkers):
Have a special scanner marker that updates.

* UserInterface/Views/TimelineView.js:
New events that a TimelineView can dispatch to update the overview.

* UserInterface/Views/Variables.css:
(:root):
(@media (prefers-color-scheme: dark)):
Scanner marker colors.

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

5 months agoThe parser is failing to record the token location of new in new.target.
mark.lam@apple.com [Thu, 28 Feb 2019 06:44:15 +0000 (06:44 +0000)]
The parser is failing to record the token location of new in new.target.
https://bugs.webkit.org/show_bug.cgi?id=195127
<rdar://problem/39645578>

Reviewed by Yusuke Suzuki.

JSTests:

* stress/parser-should-record-token-location-of-new-dot-target.js: Added.

Source/JavaScriptCore:

Also adjust the token location for the following to be as shown:

    new.target
    ^
    super
    ^
    import.meta
    ^

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

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

5 months ago[JSC] mustHandleValues for dead bytecode locals should be ignored in DFG phases
ysuzuki@apple.com [Thu, 28 Feb 2019 06:25:23 +0000 (06:25 +0000)]
[JSC] mustHandleValues for dead bytecode locals should be ignored in DFG phases
https://bugs.webkit.org/show_bug.cgi?id=195144
<rdar://problem/47595961>

Reviewed by Mark Lam.

JSTests:

* stress/read-dead-bytecode-locals-in-must-handle-values1.js: Added.
(bar):
(foo):
* stress/read-dead-bytecode-locals-in-must-handle-values2.js: Added.
(bar):
(foo):

Source/JavaScriptCore:

DFGMaximalFlushInsertionPhase inserts Flush for all the locals at the end of basic blocks. This enlarges the live ranges of
locals in DFG, and it sometimes makes DFG value live while it is dead in bytecode. The issue happens when we use mustHandleValues
to widen AbstractValue in CFAPhase. At that time, DFG tells "this value is live in DFG", but it may be dead in the bytecode level.
At that time, we attempt to merge AbstractValue with dead mustHandleValue, which is cleared as jsUndefined() in
DFG::Plan::cleanMustHandleValuesIfNecessary before start compilation, and crash because jsUndefined() may be irrelevant to the FlushFormat
in VariableAccessData.

This patch makes the type of mustHandleValues Operands<Optional<JSValue>>. We clear dead JSValues in DFG::Plan::cleanMustHandleValuesIfNecessary.
And we skip handling dead mustHandleValue in DFG phases.

* bytecode/Operands.h:
(JSC::Operands::isLocal const):
(JSC::Operands::isVariable const): Deleted.
* dfg/DFGCFAPhase.cpp:
(JSC::DFG::CFAPhase::injectOSR):
* dfg/DFGDriver.cpp:
(JSC::DFG::compileImpl):
(JSC::DFG::compile):
* dfg/DFGDriver.h:
* dfg/DFGJITCode.cpp:
(JSC::DFG::JITCode::reconstruct):
* dfg/DFGJITCode.h:
* dfg/DFGOperations.cpp:
* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::Plan):
(JSC::DFG::Plan::checkLivenessAndVisitChildren):
(JSC::DFG::Plan::cleanMustHandleValuesIfNecessary):
* dfg/DFGPlan.h:
(JSC::DFG::Plan::mustHandleValues const):
* dfg/DFGPredictionInjectionPhase.cpp:
(JSC::DFG::PredictionInjectionPhase::run):
* dfg/DFGTypeCheckHoistingPhase.cpp:
(JSC::DFG::TypeCheckHoistingPhase::disableHoistingAcrossOSREntries):
* ftl/FTLOSREntry.cpp:
(JSC::FTL::prepareOSREntry):
* jit/JITOperations.cpp:

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

5 months agofast/scrolling/ios/hit-testing-iframe-002.html always fails
simon.fraser@apple.com [Thu, 28 Feb 2019 05:27:43 +0000 (05:27 +0000)]
fast/scrolling/ios/hit-testing-iframe-002.html always fails
https://bugs.webkit.org/show_bug.cgi?id=195108

Reviewed by Frédéric Wang.

Errant ; in this.style.background='green;'

* fast/scrolling/ios/hit-testing-iframe-002.html:
* platform/ios-wk2/TestExpectations:

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

5 months ago[ContentChangeObserver] Move WKSetObservedContentChange logic to ContentChangeObserve...
zalan@apple.com [Thu, 28 Feb 2019 04:39:22 +0000 (04:39 +0000)]
[ContentChangeObserver] Move WKSetObservedContentChange logic to ContentChangeObserver class.
https://bugs.webkit.org/show_bug.cgi?id=195128
<rdar://problem/48456752>

Reviewed by Simon Fraser.

Move the final bits over to ContentChangeObserver and delete WKContentObservationInternal.h.

* WebCore.xcodeproj/project.pbxproj:
* page/ios/ContentChangeObserver.mm:
(WebCore::ContentChangeObserver::setObservedContentChange):
* platform/ios/wak/WKContentObservation.cpp:
(WKSetObservedContentChange):
* platform/ios/wak/WKContentObservation.h:
* platform/ios/wak/WKContentObservationInternal.h: Removed.

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

5 months agoRoll out r242014; it caused crashes in compositing logging (webkit.org/b/195141)
simon.fraser@apple.com [Thu, 28 Feb 2019 04:35:25 +0000 (04:35 +0000)]
Roll out r242014; it caused crashes in compositing logging (webkit.org/b/195141)

Source/JavaScriptCore:

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::nameForRegister):

Source/WebCore:

* dom/Document.cpp:
(WebCore::Document::lastModified const):
* html/FTPDirectoryDocument.cpp:
(WebCore::processFileDateString):
* mathml/MathMLElement.cpp:
(WebCore::convertToPercentageIfNeeded):
(WebCore::MathMLElement::collectStyleForPresentationAttribute):
* page/cocoa/ResourceUsageOverlayCocoa.mm:
(WebCore::ResourceUsageOverlay::platformDraw):
* page/linux/ResourceUsageOverlayLinux.cpp:
(WebCore::cpuUsageString):
(WebCore::gcTimerString):
* platform/DateComponents.cpp:
(WebCore::DateComponents::toStringForTime const):
(WebCore::DateComponents::toString const):
* platform/LocalizedStrings.cpp:
(WebCore::localizedString):
* platform/audio/HRTFElevation.cpp:
(WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::drawText):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::logLayerInfo):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::formatMediaControlsTime const):

Source/WebKit:

* UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
(WebKit::LocalAuthenticator::getAssertion):

Source/WebKitLegacy/win:

* FullscreenVideoController.cpp:
(timeToString):

Source/WTF:

* wtf/Assertions.cpp:
(WTF::createWithFormatAndArguments): Deleted.
* wtf/HexNumber.h:
(WTF::StringTypeAdapter<HexNumberBuffer>::toString const):
* wtf/text/StringConcatenate.h:
(WTF::makeString):
(WTF::pad): Deleted.
(WTF::StringTypeAdapter<PaddingSpecification<UnderlyingAdapterType>>::StringTypeAdapter): Deleted.
(WTF::StringTypeAdapter<PaddingSpecification<UnderlyingAdapterType>>::length const): Deleted.
(WTF::StringTypeAdapter<PaddingSpecification<UnderlyingAdapterType>>::is8Bit const): Deleted.
(WTF::StringTypeAdapter<PaddingSpecification<UnderlyingAdapterType>>::writeTo const): Deleted.
* wtf/text/StringConcatenateNumbers.h:
(WTF::FormattedNumber::fixedPrecision):
(WTF::FormattedNumber::fixedWidth):
(WTF::StringTypeAdapter<FormattedNumber>::toString const):
* wtf/text/StringOperators.h:
(WTF::StringAppend::StringAppend):
* wtf/text/StringView.h:
(WTF::StringView::invalidate):
* wtf/text/WTFString.cpp:
(WTF::createWithFormatAndArguments):
(WTF::String::format):
* wtf/text/WTFString.h:

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

5 months agoFlaky API Test: TestWebKitAPI.ServiceWorkers.ServiceWorkerAndCacheStorageSpecificDire...
youenn@apple.com [Thu, 28 Feb 2019 03:42:46 +0000 (03:42 +0000)]
Flaky API Test: TestWebKitAPI.ServiceWorkers.ServiceWorkerAndCacheStorageSpecificDirectories
https://bugs.webkit.org/show_bug.cgi?id=194959

Reviewed by Chris Dumez.

Spin loop until getting the condition to remove flakiness.

* TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:

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

5 months agoUnreviewed, fix -Wformat warning
mcatanzaro@igalia.com [Thu, 28 Feb 2019 02:37:55 +0000 (02:37 +0000)]
Unreviewed, fix -Wformat warning

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

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

5 months agoUnreviewed GTK test gardening
aboya@igalia.com [Thu, 28 Feb 2019 02:22:29 +0000 (02:22 +0000)]
Unreviewed GTK test gardening
https://bugs.webkit.org/show_bug.cgi?id=195138

* platform/gtk/TestExpectations:
* platform/gtk/compositing/visibility/root-visibility-toggle-expected.txt: Added.
* platform/gtk/editing/deleting/smart-delete-001-expected.txt: Removed.
* platform/gtk/editing/deleting/smart-delete-002-expected.txt: Removed.
* platform/gtk/editing/deleting/smart-delete-003-expected.txt: Removed.
* platform/gtk/editing/deleting/smart-delete-004-expected.txt: Removed.
* platform/gtk/fast/css/apple-system-colors-expected.txt: Added.
* platform/gtk/fast/text/ja-sans-serif-expected.png: Added.
* platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt: Added.

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

5 months ago[ews-build] Buildbot should include builder_display_name in the build events
aakash_jain@apple.com [Thu, 28 Feb 2019 01:47:03 +0000 (01:47 +0000)]
[ews-build] Buildbot should include builder_display_name in the build events
https://bugs.webkit.org/show_bug.cgi?id=195045

Reviewed by Dewei Zhu.

* BuildSlaveSupport/ews-build/events.py:
(Events.buildStarted): Included builder_display_name in event data. Also renamed
buildername to builder_name to be consistent in naming style.
(Events.buildFinished): Ditto.

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

5 months ago[ContentChangeObserver] Move _WKObservingContentChanges from global to ContentChangeO...
zalan@apple.com [Thu, 28 Feb 2019 00:58:13 +0000 (00:58 +0000)]
[ContentChangeObserver] Move _WKObservingContentChanges from global to ContentChangeObserver class
https://bugs.webkit.org/show_bug.cgi?id=195091
<rdar://problem/48427271>

Reviewed by Tim Horton.

* page/ios/ContentChangeObserver.h:
* page/ios/ContentChangeObserver.mm:
(WebCore::ContentChangeObserver::startObservingContentChanges):
(WebCore::ContentChangeObserver::stopObservingContentChanges):
(WebCore::ContentChangeObserver::isObservingContentChanges):
* platform/ios/wak/WKContentObservation.cpp:
(WKObservingContentChanges): Deleted.
(WKStartObservingContentChanges): Deleted.
(WKStopObservingContentChanges): Deleted.
* platform/ios/wak/WKContentObservation.h:
* platform/ios/wak/WKContentObservationInternal.h:

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

5 months agoREGRESSION: Crash beneath ResourceLoadObserver::logSubresourceLoading
bfulgham@apple.com [Thu, 28 Feb 2019 00:57:37 +0000 (00:57 +0000)]
REGRESSION: Crash beneath ResourceLoadObserver::logSubresourceLoading
https://bugs.webkit.org/show_bug.cgi?id=195072

Reviewed by Ryosuke Niwa.

ResourceLoadObserver and WebProcess should exist as long as the web page (process) is running. However,
the NetworkProcess connection can close for a variety of reasons. If the ResourceLoadObserver observes
a load or user gesture in the WebProcess, we should attempt to reconnect to the NetworkProcess (if it
was disconnected), just like we do for other message send cases.

This patch switches from using the m_networkProcessConnection member (which might be null) to use the
'ensureNetworkProcessConnection' accessor which ensures we have a valid connection for message sends.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):

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

5 months agoFlaky API Test: TestWebKitAPI.ProcessSwap.SessionStorage
cdumez@apple.com [Thu, 28 Feb 2019 00:54:19 +0000 (00:54 +0000)]
Flaky API Test: TestWebKitAPI.ProcessSwap.SessionStorage
https://bugs.webkit.org/show_bug.cgi?id=194480

Reviewed by Brady Eidson.

Source/WebKit:

The StorageManager would only start listening for IPC on a given connection when
StorageManager::processWillOpenConnection() is called. This gets called from
WebsiteDataStore::webProcessWillOpenConnection() which gets called from
WebProcessLifetimeTracker::webPageEnteringWebProcess().

webPageEnteringWebProcess() was called in WebPageProxy::finishAttachingToWebProcess()
after process-swapping. This means that IPC comming from the *provisional* process
would not get processed and we would only start processing IPC on the provisional
process's connection when it would get committed.

To address the issue, this patch teaches WebProcessLifetimeTracker that a page can
now have several processes. We also make sure that webPageEnteringWebProcess() gets
called for the provisional process as soon as we create the provisional page, instead
of waiting for it to get committed.

* UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
(WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
(WebKit::ProvisionalPageProxy::connectionWillOpen):
* UIProcess/ProvisionalPageProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::finishAttachingToWebProcess):
(WebKit::WebPageProxy::connectionWillOpen):
(WebKit::WebPageProxy::webProcessWillShutDown):
(WebKit::WebPageProxy::processDidTerminate):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::webProcessLifetimeTracker):
* UIProcess/WebProcessLifetimeObserver.cpp:
(WebKit::WebProcessLifetimeObserver::addWebPage):
(WebKit::WebProcessLifetimeObserver::removeWebPage):
* UIProcess/WebProcessLifetimeObserver.h:
* UIProcess/WebProcessLifetimeTracker.cpp:
(WebKit::WebProcessLifetimeTracker::addObserver):
(WebKit::WebProcessLifetimeTracker::webPageEnteringWebProcess):
(WebKit::WebProcessLifetimeTracker::webPageLeavingWebProcess):
(WebKit::WebProcessLifetimeTracker::pageWasInvalidated):
(WebKit::WebProcessLifetimeTracker::processIsRunning):
* UIProcess/WebProcessLifetimeTracker.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::connectionWillOpen):
* UIProcess/WebStorage/StorageManager.cpp:
(WebKit::StorageManager::SessionStorageNamespace::allowedConnections const):
(WebKit::StorageManager::SessionStorageNamespace::addAllowedConnection):
(WebKit::StorageManager::SessionStorageNamespace::removeAllowedConnection):
(WebKit::StorageManager::addAllowedSessionStorageNamespaceConnection):
(WebKit::StorageManager::removeAllowedSessionStorageNamespaceConnection):
(WebKit::StorageManager::processWillOpenConnection):
(WebKit::StorageManager::processDidCloseConnection):
(WebKit::StorageManager::createSessionStorageMap):
(WebKit::StorageManager::SessionStorageNamespace::allowedConnection const): Deleted.
(WebKit::StorageManager::SessionStorageNamespace::setAllowedConnection): Deleted.
(WebKit::StorageManager::setAllowedSessionStorageNamespaceConnection): Deleted.
* UIProcess/WebStorage/StorageManager.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::webPageWillOpenConnection):
(WebKit::WebsiteDataStore::webPageDidCloseConnection):

Tools:

Update existing API test to make it more likely to reproduce the issue.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

5 months agoUniversal links from Google search results pages don't open the app.
beidson@apple.com [Thu, 28 Feb 2019 00:50:30 +0000 (00:50 +0000)]
Universal links from Google search results pages don't open the app.
<rdar://problem/46887179> and https://bugs.webkit.org/show_bug.cgi?id=195126

Reviewed by Geoffrey Garen.

Source/WebCore:

Covered by new API tests.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::shouldOpenExternalURLsPolicyToPropagate const): Propagate the external URL policy from
  an iframe if it is from the same security origin as the main frame.

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/ShouldOpenExternalURLsInNewWindowActions.mm:
* TestWebKitAPI/cocoa/TestNavigationDelegate.h:
* TestWebKitAPI/cocoa/TestNavigationDelegate.mm:
(-[TestNavigationDelegate webView:decidePolicyForNavigationAction:decisionHandler:]):

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

5 months agoFlaky API Test: TestWebKitAPI.ProcessSwap.NumberOfCachedProcesses
cdumez@apple.com [Thu, 28 Feb 2019 00:47:42 +0000 (00:47 +0000)]
Flaky API Test: TestWebKitAPI.ProcessSwap.NumberOfCachedProcesses
https://bugs.webkit.org/show_bug.cgi?id=195102

Reviewed by Geoffrey Garen.

If the number of processes is not yet what we expect, wait a bit and check again to give
processes some time to exit.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

5 months agoFlaky API Test: TestWebKitAPI.ProcessSwap.NavigateToDataURLThenBack
cdumez@apple.com [Thu, 28 Feb 2019 00:43:38 +0000 (00:43 +0000)]
Flaky API Test: TestWebKitAPI.ProcessSwap.NavigateToDataURLThenBack
https://bugs.webkit.org/show_bug.cgi?id=194545

Reviewed by Brady Eidson.

Make sure the test navigates forward and then back only once. Previously, navigating
back would trigger a navigation again in a timer.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

5 months ago[ContentChangeObserver] Move DOMTimer schedule handling from global to ContentChangeO...
zalan@apple.com [Thu, 28 Feb 2019 00:08:20 +0000 (00:08 +0000)]
[ContentChangeObserver] Move DOMTimer schedule handling from global to ContentChangeObserver class
https://bugs.webkit.org/show_bug.cgi?id=195090
<rdar://problem/48426771>

Reviewed by Tim Horton.

Also remove some unused functions from WKContentObservationInternal.

* page/ios/ContentChangeObserver.h:
* page/ios/ContentChangeObserver.mm:
(WebCore::ContentChangeObserver::startObservingDOMTimerScheduling):
(WebCore::ContentChangeObserver::stopObservingDOMTimerScheduling):
(WebCore::ContentChangeObserver::isObservingDOMTimerScheduling):
* platform/ios/wak/WKContentObservation.cpp:
(WKStartObservingDOMTimerScheduling): Deleted.
(WKStopObservingDOMTimerScheduling): Deleted.
(WKIsObservingDOMTimerScheduling): Deleted.
* platform/ios/wak/WKContentObservation.h:
* platform/ios/wak/WKContentObservationInternal.h:

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

5 months agoWeb Inspector: Use Element.closest for internal code
drousso@apple.com [Wed, 27 Feb 2019 23:54:42 +0000 (23:54 +0000)]
Web Inspector: Use Element.closest for internal code
https://bugs.webkit.org/show_bug.cgi?id=173747

Reviewed by Joseph Pecoraro.

Replace usage of added utility functions on the `Node` prototype with the built-in
`Element.prototype.closest` as it's more flexible and is capable of doing the same thing.

* UserInterface/Base/Utilities.js:
(Node.prototype.enclosingNodeOrSelfWithClass): Deleted.
(Node.prototype.enclosingNodeOrSelfWithNodeNameInArray): Deleted.
(Node.prototype.enclosingNodeOrSelfWithNodeName): Deleted.
* UserInterface/Base/Main.js:
(WI.handlePossibleLinkClick):
(WI._focusedContentBrowser):
* UserInterface/Views/CPUTimelineView.js:
(WI.CPUTimelineView.prototype._graphPositionForMouseEvent):
* UserInterface/Views/CompletionSuggestionsView.js:
(WI.CompletionSuggestionsView.prototype.set selectedIndex):
(WI.CompletionSuggestionsView.prototype.update):
(WI.CompletionSuggestionsView.prototype._itemClicked):
* UserInterface/Views/ConsoleGroup.js:
(WI.ConsoleGroup.prototype._titleClicked):
* UserInterface/Views/DOMTreeContentView.js:
(WI.DOMTreeContentView.prototype._mouseWasClicked):
* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype._startEditingTarget):
(WI.DOMTreeElement.prototype._populateTagContextMenu):
* UserInterface/Views/DOMTreeOutline.js:
(WI.DOMTreeOutline.prototype.populateContextMenu):
* UserInterface/Views/DataGrid.js:
(WI.DataGrid.prototype._startEditing):
(WI.DataGrid.prototype._editingCancelled):
(WI.DataGrid.prototype.dataGridNodeFromNode):
(WI.DataGrid.prototype.dataGridNodeFromPoint):
(WI.DataGrid.prototype._headerCellClicked):
(WI.DataGrid.prototype._mouseoverColumnCollapser):
(WI.DataGrid.prototype._mouseoutColumnCollapser):
(WI.DataGrid.prototype._clickInColumnCollapser):
(WI.DataGrid.prototype._contextMenuInHeader):
(WI.DataGrid.prototype._contextMenuInDataTable):
* UserInterface/Views/DataGridNode.js:
(WI.DataGridNode.prototype.isEventWithinDisclosureTriangle):
* UserInterface/Views/LegacyTabBar.js:
(WI.LegacyTabBar.prototype._handleMouseDown):
(WI.LegacyTabBar.prototype._handleClick):
* UserInterface/Views/LogContentView.js:
(WI.LogContentView.prototype._handleContextMenuEvent):
(WI.LogContentView.prototype._mousedown):
(WI.LogContentView.prototype._targetInMessageCanBeSelected):
(WI.LogContentView.prototype._mousemove):
(WI.LogContentView.prototype._mouseup):
(WI.LogContentView.prototype._ondragstart):
* UserInterface/Views/NavigationBar.js:
(WI.NavigationBar.prototype._mouseDown):
(WI.NavigationBar.prototype._mouseMoved):
* UserInterface/Views/Popover.js:
(WI.Popover.prototype.handleEvent):
* UserInterface/Views/TabBar.js:
(WI.TabBar.prototype._handleMouseDown):
(WI.TabBar.prototype._handleClick):
* UserInterface/Views/Table.js:
(WI.Table.prototype._handleMouseDown):
(WI.Table.prototype._handleContextMenu):
* UserInterface/Views/TreeOutline.js:
(WI.TreeOutline.prototype.treeElementFromNode):

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

5 months ago[iOS] Web pages shouldn't be able to present a keyboard after the web view resigns...
wenson_hsieh@apple.com [Wed, 27 Feb 2019 23:54:02 +0000 (23:54 +0000)]
[iOS] Web pages shouldn't be able to present a keyboard after the web view resigns first responder
https://bugs.webkit.org/show_bug.cgi?id=195118
<rdar://problem/43411940>

Reviewed by Tim Horton.

Source/WebKit:

It's currently possible for websites to redirect focus into an editable element on the page by programmatically
requesting focus within the "blur" event handler. This is because our current heuristics:

(1) Allow programmatic focus to show the keyboard when an element is already focused; this is meant to handle
    the case where the page moves focus between different elements on the page.
(2) And also allow programmatic focus to show the keyboard when changing activity state; this is meant to handle
    the case where a focused element should show the keyboard when first responder is restored on a web view
    (e.g. in the case where a modal view controller is dismissed, and the web view regains first responder once
    again).

In both of these scenarios, we actually only want the keyboard to appear if the web view itself is either
becoming the first responder, or is already the first responder. Importantly, when blurring the focused element
by calling -[WKWebViewe resignFirstResponder] (as is the case when dismissing the keyboard by tapping 'Done' or
focusing other platform UI), we don't want to allow the page to show the keyboard due to element focus.

To fix this issue, we enforce that we're either becoming the first responder or already are the first responder
before showing the keyboard due to activity state change or focused element change.

Test: fast/events/ios/do-not-show-keyboard-when-focusing-after-blur.html

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView textInputTraits]):

Quick drive-by tweak: rename _isBlurringFocusedNode to _isBlurringFocusedElement, to match the rest of the
terminology used in WebKit.

(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):

Make our heuristics for determining whether to show the keyboard a tiny bit easier to follow, by moving the
logic into a lambda function and using early returns. See above for more details.

(-[WKContentView _elementDidBlur]):
(-[WKContentView focusedFormControllerDidUpdateSuggestions:]):

LayoutTests:

Add a test to verify that after resigning first responder (e.g. tapping 'Done' on the keyboard, or focusing a
native input field elsewhere in the app), the page cannot force the keyboard to appear by focusing an input
field.

* fast/events/ios/do-not-show-keyboard-when-focusing-after-blur-expected.txt: Added.
* fast/events/ios/do-not-show-keyboard-when-focusing-after-blur.html: Added.

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

5 months ago[ContentChangeObserver] Move style recalc handling from global to ContentChangeObserv...
zalan@apple.com [Wed, 27 Feb 2019 23:29:04 +0000 (23:29 +0000)]
[ContentChangeObserver] Move style recalc handling from global to ContentChangeObserver class
https://bugs.webkit.org/show_bug.cgi?id=195087

Reviewed by Simon Fraser.

Add m_observingNextStyleRecalc/m_observingStyleRecalcScheduling to ContentChangeObserver and move the related code over from WK functions.

* page/ios/ContentChangeObserver.h:
* page/ios/ContentChangeObserver.mm:
(WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling):
(WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling):
(WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling):
(WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc):
(WebCore::ContentChangeObserver::shouldObserveNextStyleRecalc):
(WebCore::ContentChangeObserver::setObservedContentChange):
* platform/ios/wak/WKContentObservation.cpp:
(WKSetObservedContentChange):
(WKStartObservingStyleRecalcScheduling): Deleted.
(WKStopObservingStyleRecalcScheduling): Deleted.
(WKIsObservingStyleRecalcScheduling): Deleted.
(WKSetShouldObserveNextStyleRecalc): Deleted.
(WKShouldObserveNextStyleRecalc): Deleted.
* platform/ios/wak/WKContentObservation.h:

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

5 months ago[ContentChangeObserver] Move DOM timer handling from global to ContentChangeObserver...
zalan@apple.com [Wed, 27 Feb 2019 23:20:44 +0000 (23:20 +0000)]
[ContentChangeObserver] Move DOM timer handling from global to ContentChangeObserver class
https://bugs.webkit.org/show_bug.cgi?id=195070
<rdar://problem/48417650>

Reviewed by Tim Horton.

Add DOM timer list to ContentChangeObserver and move the related code over from WK functions.

* page/ios/ContentChangeObserver.h:
* page/ios/ContentChangeObserver.mm:
(WebCore::ContentChangeObserver::startObservingDOMTimerScheduling):
(WebCore::ContentChangeObserver::countOfObservedDOMTimers):
(WebCore::ContentChangeObserver::clearObservedDOMTimers):
(WebCore::ContentChangeObserver::setObservedContentChange):
(WebCore::ContentChangeObserver::containsObservedDOMTimer):
(WebCore::ContentChangeObserver::addObservedDOMTimer):
(WebCore::ContentChangeObserver::removeObservedDOMTimer):
* platform/ios/wak/WKContentObservation.cpp:
(WKStartObservingDOMTimerScheduling):
(WKSetObservedContentChange):
(WebThreadGetObservedDOMTimers): Deleted.
(WebThreadCountOfObservedDOMTimers): Deleted.
(WebThreadClearObservedDOMTimers): Deleted.
(WebThreadContainsObservedDOMTimer): Deleted.
(WebThreadAddObservedDOMTimer): Deleted.
(WebThreadRemoveObservedDOMTimer): Deleted.
* platform/ios/wak/WKContentObservation.h:

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

5 months agoFix build errors after Web GPU buffer updates changed some IDL fields from unsigned...
justin_fan@apple.com [Wed, 27 Feb 2019 23:09:19 +0000 (23:09 +0000)]
Fix build errors after Web GPU buffer updates changed some IDL fields from unsigned long to unsigned long long.

Unreviewed build fix.

* Modules/webgpu/WebGPUBuffer.cpp:
(WebCore::WebGPUBuffer::setSubData):
* Modules/webgpu/WebGPUBuffer.h:
* Modules/webgpu/WebGPUBufferBinding.h:
* Modules/webgpu/WebGPURenderPassEncoder.idl:
* platform/graphics/gpu/GPUBufferBinding.h:
* platform/graphics/gpu/GPUVertexAttributeDescriptor.h:
* platform/graphics/gpu/GPUVertexInputDescriptor.h:

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

5 months agoWeb Inspector: REGRESSION(r242118): Debugger: event breakpoints have no icon
drousso@apple.com [Wed, 27 Feb 2019 22:24:43 +0000 (22:24 +0000)]
Web Inspector: REGRESSION(r242118): Debugger: event breakpoints have no icon
https://bugs.webkit.org/show_bug.cgi?id=195119

Reviewed by Matt Baker.

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

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

5 months agoHigh Sierra Debug JSC test queue should use faster hardware
ryanhaddad@apple.com [Wed, 27 Feb 2019 21:37:15 +0000 (21:37 +0000)]
High Sierra Debug JSC test queue should use faster hardware
https://bugs.webkit.org/show_bug.cgi?id=194603

Rubber-stamped by Alexey Proskuryakov.

Adjust queues to free up faster hardware for use on the High Sierra Debug JSC queue.

* BuildSlaveSupport/build.webkit.org-config/config.json:
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BubbleQueueServer.js:
(BubbleQueueServer):
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/WebKitBuildbot.js:
(WebKitBuildbot):
* BuildSlaveSupport/build.webkit.org-config/steps_unittest.py:
* QueueStatusServer/config/queues.py:
* Scripts/webkitpy/common/config/ews.json:
* Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py:
(test_ews_name):

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

5 months agoAdopt WebCore::RegistrableDomain in WebCore::ResourceLoadStatistics and WebKit::Netwo...
wilander@apple.com [Wed, 27 Feb 2019 21:34:26 +0000 (21:34 +0000)]
Adopt WebCore::RegistrableDomain in WebCore::ResourceLoadStatistics and WebKit::NetworkProcessProxy
https://bugs.webkit.org/show_bug.cgi?id=195071
<rdar://problem/48417690>

Reviewed by Alex Christensen and Brent Fulgham.

Source/WebCore:

No new tests. This patch maintains functionality covered by plenty of layout
tests under http/tests/resourceLoadStatistics/ and http/tests/storageAccess.

This patch adopts WebCore::RegistrableDomain in WebCore::ResourceLoadStatistics
and makes the necessary infrastructure changes to support that.

The previous HashCountedSets in WebCore::ResourceLoadStatistics are now just
HashSets since we never used the counts for anything. This change simplified
encoding and decoding for IPC and will eventually simplify encoding and
decoding in loader/ResourceLoadStatistics.cpp when we obsolete statistics
model version 14 and below.

The patch also makes WebCore::RegistrableDomain's String constructor private.
A new create function WebCore::RegistrableDomain::uncheckedCreateFromString()
is introduced to better signal to users that creating a registrable domain
object with a string may create an object that doesn't match a registrable
domain in a valid HTTP-family URL. This change (private String constructor)
motivated a change in WebCore::AdClickAttribution where the Source and
Destination structs now take a URL as parameter instead of a String.

Finally, this patch harmonizes parameter and variable naming, going from
"origin" to "domain" and "mainFrame" to "topFrame."

* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::parseAdClickAttribution const):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaSessionTitle const):
* loader/AdClickAttribution.h:
(WebCore::AdClickAttribution::Source::Source):
(WebCore::AdClickAttribution::Source::deletedValue):
(WebCore::AdClickAttribution::Destination::Destination):
(WebCore::AdClickAttribution::Destination::deletedValue):
(WebCore::AdClickAttribution::decode):
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::logSubresourceLoading):
(WebCore::ResourceLoadObserver::logWebSocketLoading):
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
(WebCore::ResourceLoadObserver::statisticsForURL):
(WebCore::ResourceLoadObserver::statisticsForOrigin): Deleted.
* loader/ResourceLoadObserver.h:
* loader/ResourceLoadStatistics.cpp:
(WebCore::encodeHashSet):
(WebCore::ResourceLoadStatistics::encode const):
(WebCore::decodeHashCountedSet):
(WebCore::decodeHashSet):
(WebCore::ResourceLoadStatistics::decode):
(WebCore::appendHashSet):
(WebCore::ResourceLoadStatistics::toString const):
(WebCore::ResourceLoadStatistics::merge):
(WebCore::encodeHashCountedSet): Deleted.
(WebCore::encodeOriginHashSet): Deleted.
(WebCore::decodeOriginHashSet): Deleted.
(WebCore::appendHashCountedSet): Deleted.
* loader/ResourceLoadStatistics.h:
* platform/RegistrableDomain.h:
(WebCore::RegistrableDomain::uncheckedCreateFromString):
(WebCore::RegistrableDomain::RegistrableDomain):
* testing/Internals.cpp:
(WebCore::Internals::resourceLoadStatisticsForURL):
(WebCore::Internals::resourceLoadStatisticsForOrigin): Deleted.
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit:

This patch adopts WebCore::RegistrableDomain in WebKit::NetworkProcessProxy
and makes the necessary infrastructure changes to support that.

The previous HashCountedSets in WebCore::ResourceLoadStatistics are now just
HashSets since we never used the counts for anything. This change simplified
the IPC::ArgumentCoder<ResourceLoadStatistics> encode and decode functions.

The patch also makes WebCore::RegistrableDomain's String constructor private.
A new create function WebCore::RegistrableDomain::uncheckedCreateFromString()
is introduced to better signal to users that creating a registrable domain
object with a string may create an object that doesn't match a registrable
domain in a valid HTTP-family URL.

Finally, this patch harmonizes parameter and variable naming, going from
"origin" to "domain" and "mainFrame" to "topFrame."

* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords):
(WebKit::ResourceLoadStatisticsMemoryStore::recursivelyGetAllDomainsThatHaveRedirectedToThisDomain const):
(WebKit::ResourceLoadStatisticsMemoryStore::markAsPrevalentIfHasRedirectedToPrevalent):
(WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccess):
(WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccessInternal):
(WebKit::ResourceLoadStatisticsMemoryStore::logFrameNavigation):
(WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceLoading):
(WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceRedirect):
(WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsSubresourceUnder const):
(WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsSubFrameUnder const):
(WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsRedirectingTo const):
(WebKit::ResourceLoadStatisticsMemoryStore::setSubframeUnderTopFrameDomain):
(WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUnderTopFrameDomain):
(WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectTo):
(WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectFrom):
(WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectTo):
(WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectFrom):
(WebKit::ResourceLoadStatisticsMemoryStore::createEncoderFromData const):
(WebKit::ResourceLoadStatisticsMemoryStore::hasUserGrantedStorageAccessThroughPrompt):
(WebKit::ResourceLoadStatisticsMemoryStore::hasHadUnexpiredRecentUserInteraction const):
(WebKit::ResourceLoadStatisticsMemoryStore::setSubframeUnderTopFrameOrigin): Deleted.
(WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUnderTopFrameOrigin): Deleted.
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccessGranted):
(WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameDomain):
(WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameDomain):
(WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
(WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin): Deleted.
(WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin): Deleted.
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
* NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp:
(WebKit::sortedPrevalentResourceTelemetry):
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::setSubframeUnderTopFrameDomain):
(WebKit::NetworkProcess::setSubresourceUnderTopFrameDomain):
(WebKit::filterForRegistrableDomains):
(WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
(WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
(WebKit::NetworkProcess::setSubframeUnderTopFrameOrigin): Deleted.
(WebKit::NetworkProcess::setSubresourceUnderTopFrameOrigin): Deleted.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
* NetworkProcess/NetworkSession.h:
* Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
(WebKit::ResourceLoadStatisticsClassifier::calculateResourcePrevalence):
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
(IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetStatisticsSubframeUnderTopFrameOrigin):
(WKWebsiteDataStoreSetStatisticsSubresourceUnderTopFrameOrigin):
* UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm:
(WebKit::ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
(WebKit::NetworkProcessProxy::isPrevalentResource):
(WebKit::NetworkProcessProxy::isVeryPrevalentResource):
(WebKit::NetworkProcessProxy::setPrevalentResource):
(WebKit::NetworkProcessProxy::setPrevalentResourceForDebugMode):
(WebKit::NetworkProcessProxy::setVeryPrevalentResource):
(WebKit::NetworkProcessProxy::setLastSeen):
(WebKit::NetworkProcessProxy::clearPrevalentResource):
(WebKit::NetworkProcessProxy::logUserInteraction):
(WebKit::NetworkProcessProxy::hasHadUserInteraction):
(WebKit::NetworkProcessProxy::clearUserInteraction):
(WebKit::NetworkProcessProxy::setSubframeUnderTopFrameDomain):
(WebKit::NetworkProcessProxy::isRegisteredAsRedirectingTo):
(WebKit::NetworkProcessProxy::isRegisteredAsSubFrameUnder):
(WebKit::NetworkProcessProxy::setSubresourceUnderTopFrameDomain):
(WebKit::NetworkProcessProxy::isRegisteredAsSubresourceUnder):
(WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectTo):
(WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectFrom):
(WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectTo):
(WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectFrom):
(WebKit::NetworkProcessProxy::isGrandfathered):
(WebKit::NetworkProcessProxy::setGrandfathered):
(WebKit::NetworkProcessProxy::hasStorageAccessForFrame):
(WebKit::NetworkProcessProxy::hasStorageAccess):
(WebKit::NetworkProcessProxy::requestStorageAccess):
(WebKit::NetworkProcessProxy::requestStorageAccessConfirm):
(WebKit::NetworkProcessProxy::grantStorageAccess):
(WebKit::NetworkProcessProxy::setSubframeUnderTopFrameOrigin): Deleted.
(WebKit::NetworkProcessProxy::setSubresourceUnderTopFrameOrigin): Deleted.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::requestStorageAccessConfirm):
* UIProcess/WebPageProxy.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::isPrevalentResource):
(WebKit::WebsiteDataStore::setPrevalentResource):
(WebKit::WebsiteDataStore::setPrevalentResourceForDebugMode):
(WebKit::WebsiteDataStore::isVeryPrevalentResource):
(WebKit::WebsiteDataStore::setVeryPrevalentResource):
(WebKit::WebsiteDataStore::setSubframeUnderTopFrameDomain):
(WebKit::WebsiteDataStore::isRegisteredAsSubFrameUnder):
(WebKit::WebsiteDataStore::setSubresourceUnderTopFrameDomain):
(WebKit::WebsiteDataStore::isRegisteredAsSubresourceUnder):
(WebKit::WebsiteDataStore::setSubresourceUniqueRedirectTo):
(WebKit::WebsiteDataStore::setSubresourceUniqueRedirectFrom):
(WebKit::WebsiteDataStore::setTopFrameUniqueRedirectTo):
(WebKit::WebsiteDataStore::setTopFrameUniqueRedirectFrom):
(WebKit::WebsiteDataStore::isRegisteredAsRedirectingTo):
(WebKit::WebsiteDataStore::clearPrevalentResource):
(WebKit::WebsiteDataStore::setLastSeen):
(WebKit::WebsiteDataStore::hasStorageAccess):
(WebKit::WebsiteDataStore::requestStorageAccess):
(WebKit::WebsiteDataStore::grantStorageAccess):
(WebKit::WebsiteDataStore::logUserInteraction):
(WebKit::WebsiteDataStore::hasHadUserInteraction):
(WebKit::WebsiteDataStore::clearUserInteraction):
(WebKit::WebsiteDataStore::setGrandfathered):
(WebKit::WebsiteDataStore::setSubframeUnderTopFrameOrigin): Deleted.
(WebKit::WebsiteDataStore::setSubresourceUnderTopFrameOrigin): Deleted.
* UIProcess/WebsiteData/WebsiteDataStore.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::hasStorageAccess):
(WebKit::WebPage::requestStorageAccess):

Tools:

* TestWebKitAPI/Tests/WebCore/AdClickAttribution.cpp:
(TestWebKitAPI::createURL):
    Convenience function.
(TestWebKitAPI::TEST):
    WebCore::AdClickAttribution now takes a URL when creating Source and
    Destination.
* TestWebKitAPI/Tests/WebCore/RegistrableDomain.cpp:
(TestWebKitAPI::TEST):
    WebCore::AdClickAttribution now takes a URL when creating Source and
    Destination.

LayoutTests:

* http/tests/navigation/resources/redirect-updates-history-item-done-statistics.html:
    Changed from window.internals.resourceLoadStatisticsForOrigin() to
    window.internals.resourceLoadStatisticsForURL() and now submit a URL.

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

5 months agoFix Xcode project UUIDs for TextCheckerCompletion.cpp and TextCheckerCompletion.h
krollin@apple.com [Wed, 27 Feb 2019 21:28:05 +0000 (21:28 +0000)]
Fix Xcode project UUIDs for TextCheckerCompletion.cpp and TextCheckerCompletion.h
https://bugs.webkit.org/show_bug.cgi?id=195109
<rdar://problem/48442272>

Reviewed by Alexey Proskuryakov.

In r144436, TextCheckerCompletion.cpp and TextCheckerCompletion.h were
added to WebKit2.xcodeproj with invalid UUIDs (they included Q's and
Z's in hexadecimal strings). While these UUIDs haven't caused any
problems in practice over the last six years, they are indeed invalid,
and were discovered via an Xcode-project processing tool that did not
anticipate their format. Fix this by removing the files from the
project and re-adding them.

* WebKit.xcodeproj/project.pbxproj:

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

5 months agoWeb Inspector: Dark Mode: unreadable text in bezier curve editor numeric input fields
drousso@apple.com [Wed, 27 Feb 2019 21:24:53 +0000 (21:24 +0000)]
Web Inspector: Dark Mode: unreadable text in bezier curve editor numeric input fields
https://bugs.webkit.org/show_bug.cgi?id=195018
<rdar://problem/48378541>

Reviewed by Matt Baker.

Simplify some styles using `-webkit-*` properties instead of `[dir=ltr]`/`[dir=rtl]` selectors.

* UserInterface/Views/BezierEditor.css:
(.bezier-editor):
(.bezier-editor > .bezier-preview):
(.bezier-editor > .bezier-preview-timing):
(.bezier-editor > .bezier-container .linear-curve):
(.bezier-editor > .bezier-container .bezier-curve):
(.bezier-editor > .bezier-container .control-line):
(.bezier-editor > .bezier-container .control-handle):
(.bezier-editor > .number-input-container):
(.bezier-editor > .number-input-container > input):
(body[dir=ltr] .bezier-editor > .bezier-preview-timing): Deleted.
(body[dir=rtl] .bezier-editor > .bezier-preview-timing): Deleted.
(body[dir=ltr] .bezier-editor > .number-input-container > input): Deleted.
(body[dir=rtl] .bezier-editor > .number-input-container > input): Deleted.
(@media (prefers-color-scheme: dark)): Deleted.
Remove all custom styling on any <input>s, as they look fine with their default styling.

* UserInterface/Views/SpringEditor.css:
(.spring-editor > .spring-preview):
(.spring-editor > .spring-preview > div):
(.spring-editor > .spring-timing > div):

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

5 months ago[Web GPU] Buffer updates part 2: setSubData, GPU/CPU synchronization
justin_fan@apple.com [Wed, 27 Feb 2019 21:10:24 +0000 (21:10 +0000)]
[Web GPU] Buffer updates part 2: setSubData, GPU/CPU synchronization
https://bugs.webkit.org/show_bug.cgi?id=195077
<rdar://problem/47805229>

Reviewed by Dean Jackson.

Source/WebCore:

Implement GPUBuffer.setSubData and prevent the resolving of mapping promises if the buffer is scheduled to be
used on the GPU, and add handlers to resolve such promises after command buffer execution completes. In addition,
update buffer sizes to u64 (unsigned long in C++) as per the updated Web GPU API.

Tests: webgpu/buffer-command-buffer-races.html
       webgpu/map-read-buffers.html

* Modules/webgpu/WebGPUBindGroup.h:
(WebCore::WebGPUBindGroup::bindGroup const):
* Modules/webgpu/WebGPUBindGroupDescriptor.cpp:
(WebCore::WebGPUBindGroupDescriptor::asGPUBindGroupDescriptor const): Rename binding -> bufferBinding to reduce confusion.
* Modules/webgpu/WebGPUBuffer.cpp: Small tweaks.
(WebCore::WebGPUBuffer::setSubData):
(WebCore::WebGPUBuffer::unmap): Correctly fail if buffer is destroyed.
(WebCore::WebGPUBuffer::destroy):
(WebCore::WebGPUBuffer::rejectOrRegisterPromiseCallback):
* Modules/webgpu/WebGPUBuffer.h:
(WebCore::WebGPUBuffer::buffer const): Returned buffer is no longer const so that it can be used in completed handler callbacks.
* Modules/webgpu/WebGPUBuffer.idl: Enable setSubData.
* Modules/webgpu/WebGPUCommandBuffer.cpp:
(WebCore::WebGPUCommandBuffer::beginRenderPass):
* Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
(WebCore::WebGPUProgrammablePassEncoder::setBindGroup const):
* Modules/webgpu/WebGPUProgrammablePassEncoder.h:
* Modules/webgpu/WebGPURenderPassEncoder.cpp:
(WebCore::WebGPURenderPassEncoder::setVertexBuffers):
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/gpu/GPUBuffer.h:
(WebCore::GPUBuffer::isTransferDst const): Added various state and flag getters.
(WebCore::GPUBuffer::isVertex const):
(WebCore::GPUBuffer::isUniform const):
(WebCore::GPUBuffer::isStorage const):
(WebCore::GPUBuffer::isReadOnly const):
(WebCore::GPUBuffer::isMappable const):
(WebCore::GPUBuffer::isMapWrite const):
(WebCore::GPUBuffer::isMapRead const):
(WebCore::GPUBuffer::isMapWriteable const):
(WebCore::GPUBuffer::isMapReadable const):
* platform/graphics/gpu/GPUBufferBinding.h:
* platform/graphics/gpu/GPUCommandBuffer.h:
(WebCore::GPUCommandBuffer::usedBuffers const):
(WebCore::GPUCommandBuffer::useBuffer):
* platform/graphics/gpu/GPUDevice.cpp:
(WebCore::GPUDevice::tryCreateBuffer): Pass Ref of itself for Buffer to request the Queue later, if needed.
(WebCore::GPUDevice::tryCreateBuffer const): Deleted.
* platform/graphics/gpu/GPUDevice.h:
* platform/graphics/gpu/GPUProgrammablePassEncoder.cpp: Retain the encoder's commandBuffer to reference its used resource buffers.
(WebCore::GPUProgrammablePassEncoder::GPUProgrammablePassEncoder):
* platform/graphics/gpu/GPUProgrammablePassEncoder.h:
(WebCore::GPUProgrammablePassEncoder::commandBuffer const):
* platform/graphics/gpu/GPURenderPassEncoder.h:
* platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
(WebCore::GPUBuffer::validateBufferCreate): Move validation out of tryCreate.
(WebCore::GPUBuffer::tryCreate): Create both shared and private buffers, depending on usage.
(WebCore::GPUBuffer::GPUBuffer):
(WebCore::GPUBuffer::~GPUBuffer): Call destroy instead of just unmap.
(WebCore::GPUBuffer::state const):
(WebCore::GPUBuffer::setSubData): Uses a cached collection of staging MTLBuffers to encode data copies to the implementation MTLBuffer.
(WebCore::GPUBuffer::commandBufferCommitted): Register on the GPUBuffer that the provided MTLCommandBuffer uses it, and is about to be committed.
(WebCore::GPUBuffer::commandBufferCompleted): MTLCommandBuffer's onCompletedHandler calls this.
(WebCore::GPUBuffer::reuseSubDataBuffer): SetSubData's blit command buffers call this to return a staging buffer to the pool.
(WebCore::GPUBuffer::registerMappingCallback):
(WebCore::GPUBuffer::runMappingCallback):
(WebCore::GPUBuffer::unmap):
(WebCore::GPUBuffer::destroy):
(WebCore::GPUBuffer::tryCreateSharedBuffer): Deleted.
* platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
(WebCore::GPUProgrammablePassEncoder::setResourceAsBufferOnEncoder):
(WebCore::GPUProgrammablePassEncoder::setBindGroup):
* platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
(WebCore::GPUQueue::submit): Ensure submitted buffers are in the correct state, and add completed handlers for synchronization.
* platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
(WebCore::GPURenderPassEncoder::tryCreate):
(WebCore::GPURenderPassEncoder::GPURenderPassEncoder): Retain the commandBuffer for later reference.
(WebCore::GPURenderPassEncoder::setVertexBuffers): Mark vertex buffers as used before submission.
(WebCore::GPURenderPassEncoder::create): Deleted.

Buffer size updates in the IDL:
* Modules/webgpu/GPUBufferDescriptor.idl:
* Modules/webgpu/WebGPUBuffer.idl:
* Modules/webgpu/WebGPUBufferBinding.idl:
* Modules/webgpu/WebGPUCommandBuffer.idl:
* Modules/webgpu/WebGPURenderPassEncoder.idl:
* Modules/webgpu/WebGPUVertexAttributeDescriptor.idl:
* Modules/webgpu/WebGPUVertexInputDescriptor.idl:

LayoutTests:

Add tests for mapReadAysnc and setSubData calls. Nofity testRunner when done on some drawing tests
that may take more time.

* webgpu/buffer-command-buffer-races-expected.html: Added.
* webgpu/buffer-command-buffer-races.html: Added.
* webgpu/buffer-resource-triangles.html: Use setSubData.
* webgpu/depth-enabled-triangle-strip.html: Ditto.
* webgpu/map-read-buffers-expected.txt: Added.
* webgpu/map-read-buffers.html: Added.
* webgpu/vertex-buffer-triangle-strip.html: Use setSubData.

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

5 months agoRemove LeetCode FetchRequest quirk
youenn@apple.com [Wed, 27 Feb 2019 20:14:20 +0000 (20:14 +0000)]
Remove LeetCode FetchRequest quirk
https://bugs.webkit.org/show_bug.cgi?id=195100

Reviewed by Alex Christensen.

Covered by manual testing.

* Modules/fetch/FetchRequest.cpp:
(WebCore::needsSignalQuirk):

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

5 months agoWeb Inspector: popover colors don't change when transitioning to/from dark mode
drousso@apple.com [Wed, 27 Feb 2019 20:13:14 +0000 (20:13 +0000)]
Web Inspector: popover colors don't change when transitioning to/from dark mode
https://bugs.webkit.org/show_bug.cgi?id=195113
<rdar://problem/48444188>

Reviewed by Timothy Hatcher.

* UserInterface/Views/Popover.js:
(WI.Popover.prototype.dismiss):
(WI.Popover.prototype._addListenersIfNeeded):

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