WebKit.git
10 months agoMerge parseAccessControlExposeHeadersAllowList into parseAccessControlAllowList
commit-queue@webkit.org [Wed, 19 Dec 2018 08:00:27 +0000 (08:00 +0000)]
Merge parseAccessControlExposeHeadersAllowList into parseAccessControlAllowList
https://bugs.webkit.org/show_bug.cgi?id=192288

Patch by Rob Buis <rbuis@igalia.com> on 2018-12-19
Reviewed by Frédéric Wang.

Prefer return value to out parameter for parseAccessControlAllowList.

* loader/CrossOriginPreflightResultCache.cpp:
(WebCore::CrossOriginPreflightResultCacheItem::parse):
* platform/network/HTTPParsers.h:
(WebCore::parseAccessControlAllowList):
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::filter):
(WebCore::ResourceResponseBase::sanitizeHTTPHeaderFieldsAccordingToTainting):

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

10 months agoREGRESSION(r235165): [GTK][WPE] Garbled rendering on GitLab
zandobersek@gmail.com [Wed, 19 Dec 2018 07:41:19 +0000 (07:41 +0000)]
REGRESSION(r235165): [GTK][WPE] Garbled rendering on GitLab
https://bugs.webkit.org/show_bug.cgi?id=192230

Reviewed by Carlos Garcia Campos.

Single tile can after r235165 be assigned multiple content updates
without a commit occurring between each update, whereas before these
commits were done for each update.

To avoid repeating updates for a single tile purging information about
the previous update, these updates are now accumulated inside a Vector
and then iterated over during the commit phase.

* platform/graphics/texmap/coordinated/CoordinatedBackingStore.cpp:
(WebCore::CoordinatedBackingStoreTile::addUpdate):
(WebCore::CoordinatedBackingStoreTile::swapBuffers):
(WebCore::CoordinatedBackingStore::updateTile):
(WebCore::CoordinatedBackingStoreTile::setBackBuffer): Deleted.
* platform/graphics/texmap/coordinated/CoordinatedBackingStore.h:
(WebCore::CoordinatedBackingStoreTile::scale const):

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

10 months agoError message for `-x ** y` contains a typo.
ross.kirsling@sony.com [Wed, 19 Dec 2018 06:37:46 +0000 (06:37 +0000)]
Error message for `-x ** y` contains a typo.
https://bugs.webkit.org/show_bug.cgi?id=192832

Reviewed by Saam Barati.

JSTests:

* ChakraCore/test/UnitTestFramework/UnitTestFramework.js:
(assert.assert.return.throws):
* stress/pow-expects-update-expression-on-lhs.js:
(throw.new.Error):
Update test expectations which match against the exact error message.

Source/JavaScriptCore:

* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseBinaryExpression):
Make corrections to error message: "amiguous" -> "ambiguous", "parenthesis" -> "parentheses"

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

10 months ago[iOS] A copied text selection is pasted as a web archive attachment in the entry...
wenson_hsieh@apple.com [Wed, 19 Dec 2018 06:10:28 +0000 (06:10 +0000)]
[iOS] A copied text selection is pasted as a web archive attachment in the entry view in Messages
https://bugs.webkit.org/show_bug.cgi?id=192842
<rdar://problem/46823586>

Reviewed by Tim Horton.

Source/WebCore:

Temporarily revert a behavior change introduced by r238661, where we now add "com.apple.webarchive" as a
registered UTI when dragging or copying a text selection. This broke the Messages app on iOS, which currently
inserts a copied or dragged text selection from WebKit-based views as a web archive file attachment. A fix for
this is internally tracked in <rdar://problem/46830277>.

* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::write):

Tools:

Adjusts an existing API test to verify that "com.apple.webarchive" is not one of the types registered to the
item provider when dragging a rich text selection.

* TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm:

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

10 months agoUnreviewed, add a missing UNUSED_PARAM()
mcatanzaro@igalia.com [Wed, 19 Dec 2018 05:31:11 +0000 (05:31 +0000)]
Unreviewed, add a missing UNUSED_PARAM()

* Modules/mediarecorder/MediaRecorder.cpp:
(WebCore::MediaRecorder::getPrivateImpl):

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

10 months agoREGRESSION(r239134) iOS safe browsing warning unable to show details
achristensen@apple.com [Wed, 19 Dec 2018 05:01:04 +0000 (05:01 +0000)]
REGRESSION(r239134) iOS safe browsing warning unable to show details
https://bugs.webkit.org/show_bug.cgi?id=192837

Reviewed by Tim Horton.

* UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
(-[WKSafeBrowsingWarning addContent]):
I had a fragile design that relied on the internal view heirarchy structure of UIScrollView,
which I changed in r239134 by introducing a layout which changed where its scrollbars were in the view heirarchy.
I now have a more robust design that saves a WeakObjCPtr to the view I need to traverse to.
Testing is problematic because this had to do with scrollbars and UIScrollView internals which seem to behave
differently in TestWebKitAPI, but I verified manually that this fixes the issue.

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

10 months ago[Win][Clang] Fix compilation warnings under Source/WebKit directory
Hironori.Fujii@sony.com [Wed, 19 Dec 2018 04:35:34 +0000 (04:35 +0000)]
[Win][Clang] Fix compilation warnings under Source/WebKit directory
https://bugs.webkit.org/show_bug.cgi?id=192695

Reviewed by Alex Christensen.

* NetworkProcess/cache/NetworkCacheData.cpp:
(makeSalt): Enclosed by #if !OS(WINDOWS).
* NetworkProcess/cache/NetworkCacheFileSystem.cpp:
(WebKit::NetworkCache::directoryEntryType): Ditto.
* Platform/win/ModuleWin.cpp:
(WebKit::Module::platformFunctionPointer const): Cast a function pointer with reinterpret_cast<void*>().
* UIProcess/DrawingAreaProxyImpl.cpp:
(WebKit::DrawingAreaProxyImpl::DrawingMonitor::DrawingMonitor):
Moved the initializer of m_webPage in order to be encluded by #if PLATFORM(GTK).
* UIProcess/DrawingAreaProxyImpl.h: Ditto.
* UIProcess/Launcher/win/ProcessLauncherWin.cpp:
(WebKit::processName): Removed the duplicated 'const' type qualifier.
* UIProcess/win/WebInspectorProxyWin.cpp:
(WebKit::WebInspectorProxy::platformAttach): Removed an unused variable.
(WebKit::WebInspectorProxy::platformDetach): Ditto.
* UIProcess/win/WebPopupMenuProxyWin.cpp: Ditto.
* UIProcess/win/WebView.cpp:
(WebKit::WebView::paint): Ditto.
(WebKit::WebPopupMenu::setUpPlatformData): Ditto.
* UIProcess/win/WebPopupMenuProxyWin.h: Marked override methods with 'override'.
* WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.h: Ditto.
* WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp: Removed an unused variable.

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

10 months agoUpdate CSS Properties and Values API to use new cycle fallback behaviour
justin_michaud@apple.com [Wed, 19 Dec 2018 03:21:15 +0000 (03:21 +0000)]
Update CSS Properties and Values API to use new cycle fallback behaviour
https://bugs.webkit.org/show_bug.cgi?id=192800

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

Re-import tests and adjust expected results. Some of the tests go from pass to fail because
this patch adds some extra dependency checking to property registrations to fix a crash, but
now unsupported syntaxes like <length-percentage> do not register properly.

* web-platform-tests/css/css-properties-values-api/register-property-expected.txt:
* web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing-expected.txt:
* web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing.html:
* web-platform-tests/css/css-properties-values-api/register-property.html:
* web-platform-tests/css/css-properties-values-api/registered-properties-inheritance-expected.txt:
* web-platform-tests/css/css-properties-values-api/registered-properties-inheritance.html:
* web-platform-tests/css/css-properties-values-api/registered-property-computation-expected.txt:
* web-platform-tests/css/css-properties-values-api/registered-property-computation.html:
* web-platform-tests/css/css-properties-values-api/registered-property-cssom-expected.txt:
* web-platform-tests/css/css-properties-values-api/registered-property-cssom.html:
* web-platform-tests/css/css-properties-values-api/registered-property-initial-expected.txt:
* web-platform-tests/css/css-properties-values-api/registered-property-initial.html:
* web-platform-tests/css/css-properties-values-api/resources/utils.js: Added.
(generate_name):
(any_initial_value):
(generate_property):
(all_syntaxes):
* web-platform-tests/css/css-properties-values-api/resources/w3c-import.log: Added.
* web-platform-tests/css/css-properties-values-api/self-utils-expected.txt: Added.
* web-platform-tests/css/css-properties-values-api/self-utils.html: Added.
* web-platform-tests/css/css-properties-values-api/typedom.tentative-expected.txt:
* web-platform-tests/css/css-properties-values-api/typedom.tentative.html:
* web-platform-tests/css/css-properties-values-api/unit-cycles-expected.txt:
* web-platform-tests/css/css-properties-values-api/unit-cycles.html:
* web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-cycles.html:
* web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-expected.txt:
* web-platform-tests/css/css-properties-values-api/var-reference-registered-properties.html:
* web-platform-tests/css/css-properties-values-api/w3c-import.log:

Source/WebCore:

Make CSS variables that are registered and involved in a cycle be treated as invalid. This also fixes a crash in the
wpt tests where relative units and calc() in a registered property's initial value would break things instead of failing.

* css/CSSCustomPropertyValue.h:
* css/CSSVariableReferenceValue.cpp:
(WebCore::resolveVariableReference):
* css/DOMCSSRegisterCustomProperty.cpp:
(WebCore::DOMCSSRegisterCustomProperty::registerProperty):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::applyCascadedCustomProperty):
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseTypedCustomPropertyValue):

LayoutTests:

* css-custom-properties-api/crash.html:
* css-custom-properties-api/inherits-expected.txt:
* css-custom-properties-api/inherits.html:
* css-custom-properties-api/registerProperty-expected.txt:
* css-custom-properties-api/registerProperty.html:

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

10 months agoUpdate ARM64EHash
sbarati@apple.com [Wed, 19 Dec 2018 02:27:00 +0000 (02:27 +0000)]
Update ARM64EHash
https://bugs.webkit.org/show_bug.cgi?id=192823
<rdar://problem/45468257>

Reviewed by Mark Lam.

* assembler/ARM64Assembler.h:
(JSC::ARM64Assembler::ARM64Assembler):
* assembler/AbstractMacroAssembler.h:
(JSC::AbstractMacroAssembler::AbstractMacroAssembler):
* assembler/AssemblerBuffer.h:
(JSC::ARM64EHash::update):
(JSC::ARM64EHash::finalHash const):
(JSC::AssemblerBuffer::AssemblerBuffer):
(JSC::AssemblerBuffer::putIntegralUnchecked):
(JSC::ARM64EHash::ARM64EHash): Deleted.
(JSC::ARM64EHash::hash const): Deleted.
(JSC::ARM64EHash::randomSeed const): Deleted.
* assembler/LinkBuffer.cpp:
(JSC::LinkBuffer::copyCompactAndLinkCode):

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

10 months ago[macOS] fast/forms/datalist/datalist-textinput-suggestions-order.html sometimes crash...
wenson_hsieh@apple.com [Wed, 19 Dec 2018 02:11:58 +0000 (02:11 +0000)]
[macOS] fast/forms/datalist/datalist-textinput-suggestions-order.html sometimes crashes after r239337
https://bugs.webkit.org/show_bug.cgi?id=192836
<rdar://problem/45321184>

Reviewed by Tim Horton.

r239337 exposed a subtle issue in the implementation of `-[WKDataListSuggestionsView updateWithInformation:]`,
wherein we might end up recomputing information for table view cells at rows that no longer exist. This currently
happens because we first set the datalist's `_suggestions`, then change the table view's frame, and then finally
reload the table view; however, in the case where the number of suggestions decreased and the frame changed
(which prompts AppKit to ask us again for table cell views), we'll attempt to access an out-of-bounds index in
the `_suggestions` vector.

To address this, we change our suggestions and immediately reload the table view before updating `NSTableView`'s
frame, so that we only provide table view cells for rows that actually correspond to items in `_suggestions`.

* UIProcess/mac/WebDataListSuggestionsDropdownMac.mm:
(-[WKDataListSuggestionsView updateWithInformation:]):

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

10 months ago[Mac] Layout Test http/wpt/webauthn/public-key-credential-create-success-hid.https...
jiewen_tan@apple.com [Wed, 19 Dec 2018 01:25:52 +0000 (01:25 +0000)]
[Mac] Layout Test http/wpt/webauthn/public-key-credential-create-success-hid.https.html and http/wpt/webauthn/public-key-credential-get-success-hid.https.html are flaky
https://bugs.webkit.org/show_bug.cgi?id=192061

Reviewed by Dewei Zhu.

Part 4.

Add some additional temporary logging info to determine if the time out value passed to the timer is right.
Once the bug is determined and fixed, we should remove all logging added in this patch.

* UIProcess/WebAuthentication/AuthenticatorManager.cpp:
(WebKit::AuthenticatorManager::initTimeOutTimer):

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

10 months agoWrong value for key property in keydown and keyup events generated holding Control key
dbates@webkit.org [Wed, 19 Dec 2018 00:23:21 +0000 (00:23 +0000)]
Wrong value for key property in keydown and keyup events generated holding Control key
https://bugs.webkit.org/show_bug.cgi?id=192788
<rdar://problem/46795214>

Reviewed by Wenson Hsieh.

Similar to what we do on Mac, compute the DOM key property from the characters ignoring
modifier keys input string when the Control key is held down.

* platform/ios/PlatformEventFactoryIOS.mm:
(WebCore::keyForKeyEvent):
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::keyForKeyEvent):

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

10 months agoGardening: test options fix.
mark.lam@apple.com [Wed, 19 Dec 2018 00:02:45 +0000 (00:02 +0000)]
Gardening: test options fix.
https://bugs.webkit.org/show_bug.cgi?id=192822

Unreviewed.

* stress/json-stringify-string-builder-overflow.js:

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

10 months agoREGRESSION: [iOS] API test TestWebKitAPI._WKDownload.OriginatingWebView is a flaky...
david_quesada@apple.com [Tue, 18 Dec 2018 23:59:34 +0000 (23:59 +0000)]
REGRESSION: [iOS] API test TestWebKitAPI._WKDownload.OriginatingWebView is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=192810
<rdar://problem/46812536>

Reviewed by Alex Christensen.

* TestWebKitAPI/Tests/WebKitCocoa/Download.mm:
(-[OriginatingWebViewDownloadDelegate _downloadDidStart:]):
    After releasing our reference to the web view, wait until the next turn of the runloop
    before checking that the originatingWebView has been zeroed, since the web view might
    still be referenced in the autorelease pool. This _WKDownload unit test isn't about
    testing general memory management of WKWebViews, only that _WKDownload does not retain
    its web view via the 'originatingWebView' property.

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

10 months agoClean up IndexedDB files between tests
sihui_liu@apple.com [Tue, 18 Dec 2018 23:56:23 +0000 (23:56 +0000)]
Clean up IndexedDB files between tests
https://bugs.webkit.org/show_bug.cgi?id=192796

Reviewed by Geoffrey Garen.

Source/WebCore:

We should clean up the IndexedDB files between tests to make sure each test is independent of others.

This patch also fixes some issues in IDB.

Covered by existing tests.

* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince):
We should shut down all open databases instead of databases from open database connections before deleting
files, because database starts accessing files before connection to database is established.

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::shutdownForClose):
We should shutdown database after tasks in queue are completed, because tasks have pointer of UniqueIDBDatabase
and UniqueIDBDatabase can be destructed after shutdown.

(WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
didDeleteBackingStore can be posted to main thread after immediateCloseForUserDelete, and timer should not be
invoked during the hard close.

(WebCore::IDBServer::UniqueIDBDatabase::handleDatabaseOperations):
Tasks like didOpenBackingStore could be posted from database thread to main thread after
immediateCloseForUserDelete, but we know the backing store will be deleted soon, so no need to handle any
database operation.

(WebCore::IDBServer::UniqueIDBDatabase::performPrefetchCursor):
performPrefetchCursor needs to be aware of whether UniqueIDBDatabase is being closed, so that it will not access
m_backingStore when m_backingStore may already be deleted.

(WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
immediateCloseForUserDelete does not handle transactions that are in the process of commit or abort.
m_objectStoreTransactionCounts and m_objectStoreWriteTransactions may be used by those transactions in
transactionCompleted, so they do not need to be cleared here.

Source/WebKit:

* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreRemoveAllIndexedDatabasesSync):
* UIProcess/API/C/WKWebsiteDataStoreRef.h:

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(runTest):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetStateToConsistentValues):
(WTR::RemoveAllIndexedDatabasesCallbackContext::RemoveAllIndexedDatabasesCallbackContext):
(WTR::RemoveAllIndexedDatabasesCallback):
(WTR::TestController::ClearIndexedDatabases):
* WebKitTestRunner/TestController.h:

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

10 months agoThick overlines and line-throughs grow in the wrong direction
mmaxfield@apple.com [Tue, 18 Dec 2018 23:38:54 +0000 (23:38 +0000)]
Thick overlines and line-throughs grow in the wrong direction
https://bugs.webkit.org/show_bug.cgi?id=192264

Reviewed by Dean Jackson.

Source/WebCore:

Overlines should grow upward, and line-throughs should stay centered.

Test: fast/css3-text/css3-text-decoration/text-decoration-thicknes-overline-grow-direction.html

* rendering/TextDecorationPainter.cpp:
(WebCore::TextDecorationPainter::paintTextDecoration):
* style/InlineTextBoxStyle.cpp:
(WebCore::visualOverflowForDecorations):

LayoutTests:

I can't figure out a way to test the line-through, so this just tests the overline.

* fast/css3-text/css3-text-decoration/text-decoration-thicknes-overline-grow-direction-expected.html: Added.
* fast/css3-text/css3-text-decoration/text-decoration-thicknes-overline-grow-direction.html: Added.

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

10 months agoFix API test introduced in r239339 on iOS.
achristensen@apple.com [Tue, 18 Dec 2018 23:02:16 +0000 (23:02 +0000)]
Fix API test introduced in r239339 on iOS.
https://bugs.webkit.org/show_bug.cgi?id=192675

* TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm:
(TEST):
The iOS implementation of the safe browsing warning is a little different.
It does some element creation when it is added to the window so it knows how big it is.
To test these elements, we need to simulate adding it to the window.
A similar technique is done in other iOS API tests, such as SafeBrowsing.ShowWarningSPI.

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

10 months agoJSON.stringify() should throw OOM on StringBuilder overflows.
mark.lam@apple.com [Tue, 18 Dec 2018 22:24:33 +0000 (22:24 +0000)]
JSON.stringify() should throw OOM on StringBuilder overflows.
https://bugs.webkit.org/show_bug.cgi?id=192822
<rdar://problem/46670577>

Reviewed by Saam Barati.

JSTests:

* stress/json-stringify-string-builder-overflow.js: Added.

Source/JavaScriptCore:

* runtime/JSONObject.cpp:
(JSC::Stringifier::stringify):
(JSC::Stringifier::appendStringifiedValue):
(JSC::Stringifier::Holder::appendNextProperty):

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

10 months agoRedeclaration of var over let/const/class should be a syntax error.
ross.kirsling@sony.com [Tue, 18 Dec 2018 22:14:20 +0000 (22:14 +0000)]
Redeclaration of var over let/const/class should be a syntax error.
https://bugs.webkit.org/show_bug.cgi?id=192298

Reviewed by Keith Miller.

JSTests:

* test262.yaml:
* test262/expectations.yaml:
Mark 46 tests as passing.

* stress/block-scope-redeclarations.js:
Add some new tests.

* stress/for-in-invalidate-context-weird-assignments.js:
* stress/for-in-tests.js:
Replace tests for outdated behavior with tests for SyntaxError.

* ChakraCore/test/LetConst/defer3.baseline-jsc:
* ChakraCore/test/LetConst/letvar.baseline-jsc:
Update expectations.

Source/JavaScriptCore:

From https://tc39.github.io/ecma262/#sec-block-static-semantics-early-errors:
It is a Syntax Error if any element of the LexicallyDeclaredNames of StatementList also occurs in the
VarDeclaredNames of StatementList.

Accordingly, this patch ensures that { let x; { var x; } } and { { var x; } let x; } are syntax errors.

For the "var after" scenario:
When checking for existing lexically-declared names, we can't simply check the current var scope;
we need to check *all* enclosing scopes up to (and including) the current var scope. In so doing,
we must also avoid violating the Annex B.3.5 condition that allows `try {} catch (e) { var e; }`.

For the "var before" scenario:
We ensure that lexical scopes always keep track of the vars being hoisted over them; this gives us
a simple way to check the current block's var-declared names prior to making a lexical declaration.

* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseTryStatement):
* parser/Parser.h:
(JSC::Scope::Scope):
(JSC::Scope::setIsSimpleCatchParameterScope): Added.
(JSC::Scope::isSimpleCatchParameterScope): Added.
(JSC::Scope::declareVariable):
(JSC::Scope::addVariableBeingHoisted): Added.
(JSC::Scope::declareLexicalVariable):
(JSC::Scope::hasDeclaredVariable):
(JSC::Scope::hasLexicallyDeclaredVariable): Added.
(JSC::Parser::declareHoistedVariable): Added.
(JSC::Parser::declareVariable):

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

10 months agoSome iOS app crash in FrameLoader::checkCompleted
rniwa@webkit.org [Tue, 18 Dec 2018 22:03:07 +0000 (22:03 +0000)]
Some iOS app crash in FrameLoader::checkCompleted
https://bugs.webkit.org/show_bug.cgi?id=192804
<rdar://problem/44240573>

Reviewed by Tim Horton.

It's possible for the main thread to call into WebCore / UIWebView selectors while Web thread
is trying to send a delegate message. Disable the release assertion while this is happening
so that iOS app would not crash.

Unfortunately no new test as there is no way to easily test UIWebView in iOS,
and this requires a race between the web thread & the main thread.

* dom/ScriptDisallowedScope.h:
(WebCore::ScriptDisallowedScope::InMainThread::isScriptAllowed):
* platform/ios/wak/WebCoreThread.h:
* platform/ios/wak/WebCoreThread.mm:
(WebThreadDelegateMessageScope::WebThreadDelegateMessageScope):
(WebThreadDelegateMessageScope::~WebThreadDelegateMessageScope):
(SendDelegateMessage):

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

10 months agoclang-tidy: Use const reference for MediaTime parameter to prevent object copy
ddkilzer@apple.com [Tue, 18 Dec 2018 21:54:24 +0000 (21:54 +0000)]
clang-tidy: Use const reference for MediaTime parameter to prevent object copy
<https://webkit.org/b/192814>

Reviewed by Mark Lam.

Source/JavaScriptCore:

* runtime/JSCJSValue.h:
(JSC::jsNumber):

Source/WebCore:

* bindings/js/JSDOMConvertNumbers.h:
(WebCore::JSConverter<IDLUnrestrictedDouble>::convert):

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

10 months ago[WebGPU] BindGroupLayout and Device::createBindGroupLayout
justin_fan@apple.com [Tue, 18 Dec 2018 21:51:56 +0000 (21:51 +0000)]
[WebGPU] BindGroupLayout and Device::createBindGroupLayout
https://bugs.webkit.org/show_bug.cgi?id=192817

Reviewed by Dean Jackson.

Update bind-group-layouts to test new functionality.

Source/WebCore:

Implement the emtpy WebGPUBindGroupLayout interface, and enable creation via WebGPUDevice::createBindGroupLayout:
* Modules/webgpu/WebGPUBindGroupLayout.cpp: Added.
(WebCore::WebGPUBindGroupLayout::create):
(WebCore::WebGPUBindGroupLayout::WebGPUBindGroupLayout):
* Modules/webgpu/WebGPUBindGroupLayout.h: Added.
* Modules/webgpu/WebGPUBindGroupLayout.idl: Added. Empty interface for now.
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createBindGroupLayout const): Added.
* Modules/webgpu/WebGPUDevice.h:
* Modules/webgpu/WebGPUDevice.idl:
* platform/graphics/gpu/GPUBindGroupLayout.cpp: Added.
(WebCore::GPUBindGroupLayout::tryCreate):
(WebCore::GPUBindGroupLayout::GPUBindGroupLayout):
* platform/graphics/gpu/GPUBindGroupLayout.h: Added.
* platform/graphics/gpu/GPUDevice.cpp:
(WebCore::GPUDevice::tryCreateBindGroupLayout const): Added.
* platform/graphics/gpu/GPUDevice.h:

Add files and symbols to project:
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:

Missing includes that were previously provided via UnifiedSources:
* platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h:
* platform/sql/SQLiteFileSystem.h:

LayoutTests:

* webgpu/bind-group-layouts-expected.txt:
* webgpu/bind-group-layouts.html:

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

10 months agoUnreviewed test gardening after r239306 and r239338.
ryanhaddad@apple.com [Tue, 18 Dec 2018 21:51:06 +0000 (21:51 +0000)]
Unreviewed test gardening after r239306 and r239338.

Move test compositing/contents-format baselines for Mojave into platform/mac, add new baselines for High Sierra and earlier.

* platform/mac-highsierra-wk1/compositing/contents-format/subpixel-antialiased-text-enabled-expected.txt: Copied from LayoutTests/platform/mac-wk1/compositing/contents-format/subpixel-antialiased-text-enabled-expected.txt.
* platform/mac-highsierra/compositing/contents-format/subpixel-antialiased-nested-layer-expected.txt: Copied from LayoutTests/platform/mac-mojave/compositing/contents-format/subpixel-antialiased-nested-layer-expected.txt.
* platform/mac-highsierra/compositing/contents-format/subpixel-antialiased-text-configs-antialiasing-style-expected.txt: Copied from LayoutTests/platform/mac/compositing/contents-format/subpixel-antialiased-text-configs-antialiasing-style-expected.txt.
* platform/mac-highsierra/compositing/contents-format/subpixel-antialiased-text-configs-expected.txt: Copied from LayoutTests/platform/mac/compositing/contents-format/subpixel-antialiased-text-configs-expected.txt.
* platform/mac-highsierra/compositing/contents-format/subpixel-antialiased-text-enabled-expected.txt: Copied from LayoutTests/platform/mac/compositing/contents-format/subpixel-antialiased-text-enabled-expected.txt.
* platform/mac-highsierra/compositing/contents-format/subpixel-antialiased-text-images-expected.txt: Copied from LayoutTests/platform/mac/compositing/contents-format/subpixel-antialiased-text-images-expected.txt.
* platform/mac-highsierra/compositing/contents-format/subpixel-antialiased-text-traversal-expected.txt: Copied from LayoutTests/platform/mac/compositing/contents-format/subpixel-antialiased-text-traversal-expected.txt.
* platform/mac-highsierra/compositing/contents-format/subpixel-antialiased-text-visibility-expected.txt: Copied from LayoutTests/platform/mac/compositing/contents-format/subpixel-antialiased-text-visibility-expected.txt.
* platform/mac-mojave-wk1/compositing/contents-format/subpixel-antialiased-text-enabled-expected.txt: Removed.
* platform/mac-mojave/compositing/contents-format/subpixel-antialiased-text-configs-antialiasing-style-expected.txt: Removed.
* platform/mac-mojave/compositing/contents-format/subpixel-antialiased-text-configs-expected.txt: Removed.
* platform/mac-mojave/compositing/contents-format/subpixel-antialiased-text-enabled-expected.txt: Removed.
* platform/mac-mojave/compositing/contents-format/subpixel-antialiased-text-images-expected.txt: Removed.
* platform/mac-mojave/compositing/contents-format/subpixel-antialiased-text-traversal-expected.txt: Removed.
* platform/mac-mojave/compositing/contents-format/subpixel-antialiased-text-visibility-expected.txt: Removed.
* platform/mac-wk1/compositing/contents-format/subpixel-antialiased-text-enabled-expected.txt:
* platform/mac/compositing/contents-format/subpixel-antialiased-nested-layer-expected.txt: Renamed from LayoutTests/platform/mac-mojave/compositing/contents-format/subpixel-antialiased-nested-layer-expected.txt.
* platform/mac/compositing/contents-format/subpixel-antialiased-text-configs-antialiasing-style-expected.txt:
* platform/mac/compositing/contents-format/subpixel-antialiased-text-configs-expected.txt:
* platform/mac/compositing/contents-format/subpixel-antialiased-text-enabled-expected.txt:
* platform/mac/compositing/contents-format/subpixel-antialiased-text-images-expected.txt:
* platform/mac/compositing/contents-format/subpixel-antialiased-text-traversal-expected.txt:
* platform/mac/compositing/contents-format/subpixel-antialiased-text-visibility-expected.txt:

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

10 months agoMake ReadableStreamXX constructs use PrivateIdentifier
youenn@apple.com [Tue, 18 Dec 2018 21:41:34 +0000 (21:41 +0000)]
Make ReadableStreamXX constructs use PrivateIdentifier
https://bugs.webkit.org/show_bug.cgi?id=192771

Reviewed by Chris Dumez.

PrivateIdentifier is a better name for making sure a given construct does not show up in the global scope.
Covered by existing binding tests.

* Modules/streams/ReadableByteStreamController.idl:
* Modules/streams/ReadableStreamBYOBReader.idl:
* Modules/streams/ReadableStreamBYOBRequest.idl:
* Modules/streams/ReadableStreamDefaultController.idl:
* Modules/streams/ReadableStreamDefaultReader.idl:
* bindings/scripts/CodeGeneratorJS.pm:
(NeedsConstructorProperty):
* bindings/scripts/preprocess-idls.pl:
(shouldExposeInterface):
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp: Removed.
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h: Removed.
* bindings/scripts/test/TestCustomConstructor.idl: Removed.

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

10 months agoHTTPS Upgrade: Scripts / preprocessing necessary to create new database in future
commit-queue@webkit.org [Tue, 18 Dec 2018 20:59:53 +0000 (20:59 +0000)]
HTTPS Upgrade: Scripts / preprocessing necessary to create new database in future
https://bugs.webkit.org/show_bug.cgi?id=192612
<rdar://problem/46651207>

Patch by Vivek Seth <v_seth@apple.com> on 2018-12-18
Reviewed by Andy Estes.

* Configurations/WebKit.xcconfig:
* DerivedSources.make:
* Scripts/generate-https-upgrade-database.sh: Added.
* WebKit.xcodeproj/project.pbxproj:

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

10 months agoSynchronous media query evaluation could destroy current Frame/FrameView.
zalan@apple.com [Tue, 18 Dec 2018 20:09:32 +0000 (20:09 +0000)]
Synchronous media query evaluation could destroy current Frame/FrameView.
https://bugs.webkit.org/show_bug.cgi?id=192781
<rdar://problem/34416793>

Reviewed by Chris Dumez.

Source/WebCore:

Protect Frame and FrameView when coming back from printing and check if the current Frame/FrameView/FrameLoader objects are still valid.

Test: printing/print-with-media-query-destory.html

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::finishedLoading):
* page/Frame.cpp:
(WebCore::Frame::setPrinting):
* page/FrameView.cpp:
(WebCore::FrameView::forceLayoutForPagination):

LayoutTests:

* printing/print-with-media-query-destory-expected.txt: Added.
* printing/print-with-media-query-destory.html: Added.

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

10 months agoUnreviewed, fix the 32-bit watchOS build after r239314
wenson_hsieh@apple.com [Tue, 18 Dec 2018 19:45:24 +0000 (19:45 +0000)]
Unreviewed, fix the 32-bit watchOS build after r239314

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):

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

10 months agoWeb Inspector: Layers: increase default column width for other localizations
drousso@apple.com [Tue, 18 Dec 2018 19:43:55 +0000 (19:43 +0000)]
Web Inspector: Layers: increase default column width for other localizations
https://bugs.webkit.org/show_bug.cgi?id=192812
<rdar://problem/46628625>

Reviewed by Brian Burg.

* UserInterface/Views/LayerDetailsSidebarPanel.js:
(WI.LayerDetailsSidebarPanel.prototype._buildDataGrid):
* UserInterface/Views/LayerTreeDetailsSidebarPanel.js:
(WI.LayerTreeDetailsSidebarPanel.prototype._buildDataGridSection):

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

10 months agowebkitpy: Ignore device type for test when using --force
jbedard@apple.com [Tue, 18 Dec 2018 19:42:55 +0000 (19:42 +0000)]
webkitpy: Ignore device type for test when using --force
https://bugs.webkit.org/show_bug.cgi?id=192786
<rdar://problem/46794894>

Reviewed by Daniel Bates.

It is sometimes the case that a contributor will wish to run a test on a specific device,
despite expectations which indicate a test should not be run on that device.

* Scripts/webkitpy/layout_tests/run_webkit_tests.py:
(parse_args):
* Scripts/webkitpy/port/device_port.py:
(DevicePort.default_child_processes): Strip device type information when using --force.
(DevicePort.setup_test_run): Only allow incomplete match when using --force.

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

10 months agoWeb Inspector: m3u8 content not shown, it should be text
joepeck@webkit.org [Tue, 18 Dec 2018 19:18:44 +0000 (19:18 +0000)]
Web Inspector: m3u8 content not shown, it should be text
https://bugs.webkit.org/show_bug.cgi?id=192731
<rdar://problem/46747728>

Reviewed by Devin Rousso.

Source/WebCore:

* inspector/NetworkResourcesData.cpp:
(WebCore::NetworkResourcesData::setResourceContent):
Don't clobber data if setting empty content on a resource that has content.

* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::shouldTreatAsText):
Additional non-"text/" mime types that can be treated as text.

* platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::isTextMediaPlaylistMIMEType):
* platform/MIMETypeRegistry.h:
Detect media playlist mime types that are text (m3u8/m3u).

Source/WebInspectorUI:

* UserInterface/Base/MIMETypeUtilities.js:
(WI.shouldTreatMIMETypeAsText):
Support m3u8/m3u files as text.

LayoutTests:

* inspector/unit-tests/mimetype-utilities-expected.txt:
* inspector/unit-tests/mimetype-utilities.html:
Tests for shouldTreatMIMETypeAsText.

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

10 months agoRemove <meta http-equiv=set-cookie> support
dbates@webkit.org [Tue, 18 Dec 2018 19:17:15 +0000 (19:17 +0000)]
Remove <meta http-equiv=set-cookie> support
https://bugs.webkit.org/show_bug.cgi?id=185077
<rdar://problem/41791397>

Reviewed by Brent Fulgham.

Source/WebCore:

Remove support for the HTTP-equiv. pragma Set-Cookie to set a cookie. In <https://github.com/whatwg/html/pull/3649>
the HTML living standard was ammended to define this pragma as no-op. Chrome and Edge have also
removed support for this pragma and Firefox has an open bug to remove it.

* dom/Document.cpp:
(WebCore::Document::processHttpEquiv): Emit a message that the Set-Cookie pragma is obsolete and
was ignored instead of setting the cookie.
* html/parser/XSSAuditor.cpp:
(WebCore::isDangerousHTTPEquiv): We no longer need to consider the Set-Cookie pragma
as dangerous and erase attribute http-equiv when we find it because we no longer honor
this pragma.

LayoutTests:

Update test now that we no longer consider the HTTP equiv. pragma Set-Cookie as
dangerous (since it is ignored).

* http/tests/security/xssAuditor/cookie-injection-expected.txt:

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

11 months agoCSS Typed OM should expose attributeStyleMap
justin_michaud@apple.com [Tue, 18 Dec 2018 18:51:05 +0000 (18:51 +0000)]
CSS Typed OM should expose attributeStyleMap
https://bugs.webkit.org/show_bug.cgi?id=192671

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

* web-platform-tests/css/css-properties-values-api/typedom.tentative-expected.txt:
* web-platform-tests/css/css-properties-values-api/unit-cycles-expected.txt:

Source/WebCore:

Exposes element.attributeStyleMap, adds a stub for the StylePropertyMap class, and updates the existing
TypedOMCSSImageValue to not require a RenderObject so that it can still work inside attributeStyleMap.

Test: css-typedom/attributeStyleMap.html

* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* css/ElementCSSInlineStyle.idl:
* css/typedom/StylePropertyMap.h: Copied from Source/WebCore/css/typedom/StylePropertyMapReadOnly.h.
* css/typedom/StylePropertyMap.idl: Copied from Source/WebCore/css/typedom/StylePropertyMapReadOnly.idl.
* css/typedom/StylePropertyMapReadOnly.cpp: Added.
(WebCore::StylePropertyMapReadOnly::reifyValue):
(WebCore::StylePropertyMapReadOnly::customPropertyValueOrDefault):
* css/typedom/StylePropertyMapReadOnly.h:
(WebCore::StylePropertyMapReadOnly::create): Deleted.
(WebCore::StylePropertyMapReadOnly::get const): Deleted.
(WebCore::StylePropertyMapReadOnly::StylePropertyMapReadOnly): Deleted.
* css/typedom/StylePropertyMapReadOnly.idl:
* css/typedom/TypedOMCSSImageValue.h:
* dom/Element.cpp:
(WebCore::Element::attributeStyleMap):
(WebCore::Element::setAttributeStyleMap):
* dom/Element.h:
* dom/ElementRareData.cpp:
* dom/ElementRareData.h:
(WebCore::ElementRareData::attributeStyleMap):
(WebCore::ElementRareData::setAttributeStyleMap):
* dom/StyledElement.cpp:
(WebCore::StyledElement::ensureAttributeStyleMap):
* dom/StyledElement.h:
* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::size):
(WebCore::CanvasRenderingContext2DBase::drawImage):
* platform/graphics/CustomPaintImage.cpp:
(WebCore::extractComputedProperty):
(WebCore::CustomPaintImage::doCustomPaint):

LayoutTests:

* css-typedom/attributeStyleMap-expected.txt: Added.
* css-typedom/attributeStyleMap.html: Added.
* css-typedom/sameobject-expected.txt: Added.
* css-typedom/sameobject.html: Added.
* fast/css-custom-paint/properties.html:
* platform/ios-wk1/TestExpectations:
* platform/ios-wk2/js/dom/dom-static-property-for-in-iteration-expected.txt: Added.
* platform/mac-wk1/TestExpectations:
* platform/mac-wk2/js/dom/dom-static-property-for-in-iteration-expected.txt: Added.
* platform/win/TestExpectations:

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

11 months agoUnreviewed. Appease a build error where we weren't using a variable defined in an...
sbarati@apple.com [Tue, 18 Dec 2018 18:40:28 +0000 (18:40 +0000)]
Unreviewed. Appease a build error where we weren't using a variable defined in an "if"

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

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

11 months agoWKWebView has old URL while displaying SafeBrowsing interstitial, for link-click...
achristensen@apple.com [Tue, 18 Dec 2018 18:26:33 +0000 (18:26 +0000)]
WKWebView has old URL while displaying SafeBrowsing interstitial, for link-click navigations
https://bugs.webkit.org/show_bug.cgi?id=192675

Reviewed by Geoffrey Garen.

Source/WebKit:

When a safe browsing warning is being shown, WKWebView.URL should be the unsafe website, not the safe website before it.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _showSafeBrowsingWarningWithTitle:warning:details:completionHandler:]):
(-[WKWebView _showSafeBrowsingWarningWithURL:title:warning:details:completionHandler:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm:
(WebKit::SafeBrowsingWarning::SafeBrowsingWarning):
* UIProcess/SafeBrowsingWarning.h:
(WebKit::SafeBrowsingWarning::create):
(WebKit::SafeBrowsingWarning::url const):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm:
(goBack):
(TEST):
(visitUnsafeSite):
(-[SafeBrowsingHelper observeValueForKeyPath:ofObject:change:context:]):
(-[SafeBrowsingHelper webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:completionHandler:]):

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

11 months agoFix test failure after r239306.
simon.fraser@apple.com [Tue, 18 Dec 2018 17:11:50 +0000 (17:11 +0000)]
Fix test failure after r239306.

Need Mojave WK1 results for this test.

* platform/mac-mojave-wk1/compositing/contents-format/subpixel-antialiased-text-enabled-expected.txt: Added.

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

11 months agoCalling setValue() while typing should invoke -textDidChangeInTextField in the inject...
wenson_hsieh@apple.com [Tue, 18 Dec 2018 15:37:10 +0000 (15:37 +0000)]
Calling setValue() while typing should invoke -textDidChangeInTextField in the injected bundle
https://bugs.webkit.org/show_bug.cgi?id=192785
<rdar://problem/45321184>

Reviewed by Tim Horton.

Source/WebCore:

Makes a minor adjustment in `TextFieldInputType::setValue` to consider value changes as "user editing", if we're
currently processing a keystroke from the user. This is useful for certain private clients, such as Safari, that
need to know when the user is typing in a text form control, but the page is preventing default text insertion
behavior and instead updating values programmatically.

Test: fast/forms/call-text-did-change-in-text-field-when-typing.html

* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::setValue):

LayoutTests:

Add a test to verify that:
1. When typing in a focused field, the injected bundle method is invoked.
2. When changing the value of the focused field under non-typing user interaction, the method isn't invoked.
3. When changing the value of the focused field programmatically without user gesture, the method isn't invoked.

* TestExpectations:
* fast/forms/call-text-did-change-in-text-field-when-typing-expected.txt: Added.
* fast/forms/call-text-did-change-in-text-field-when-typing.html: Added.
* platform/wk2/TestExpectations:

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

11 months ago[LFC][BFC][MarginCollapsing] Implement marginBeforeCollapsesWithParentMarginAfter
zalan@apple.com [Tue, 18 Dec 2018 15:30:25 +0000 (15:30 +0000)]
[LFC][BFC][MarginCollapsing] Implement marginBeforeCollapsesWithParentMarginAfter
https://bugs.webkit.org/show_bug.cgi?id=192801

Reviewed by Antti Koivisto.

* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter):

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

11 months ago[LFC][BFC][MarginCollapsing] Implement marginAfterCollapsesWithSiblingMarginBeforeWit...
zalan@apple.com [Tue, 18 Dec 2018 15:28:47 +0000 (15:28 +0000)]
[LFC][BFC][MarginCollapsing] Implement marginAfterCollapsesWithSiblingMarginBeforeWithClearance
https://bugs.webkit.org/show_bug.cgi?id=192799

Reviewed by Antti Koivisto.

* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):

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

11 months ago[LFC][BFC][MarginCollapsing] Implement marginAfterCollapsesWithParentMarginBefore
zalan@apple.com [Tue, 18 Dec 2018 15:27:09 +0000 (15:27 +0000)]
[LFC][BFC][MarginCollapsing] Implement marginAfterCollapsesWithParentMarginBefore
https://bugs.webkit.org/show_bug.cgi?id=192798

Reviewed by Antti Koivisto.

* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginBefore):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):

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

11 months agoRegression(r239182) SuspendedPage's process reuse for link navigation optimization...
cdumez@apple.com [Tue, 18 Dec 2018 15:26:50 +0000 (15:26 +0000)]
Regression(r239182) SuspendedPage's process reuse for link navigation optimization sometimes broken
https://bugs.webkit.org/show_bug.cgi?id=192772

Reviewed by Antti Koivisto.

Source/WebKit:

With r239182, if the page in the previous process would fail to enter PageCache, we would destroy
the corresponding SuspendedPageProxy, which would potentially terminate the process. This would
regress performance when trying to navigate back in history to that page. This would also regress
performance when link-navigating to the same domain as we would have previously reused the suspended
page's process for such navigation.

Address the issue by keeping the SuspendedPageProxy alive even if the WebPage fails to suspend.
When trying to reuse a SuspendedPageProxy, if the page failed to suspend, reuse its process but
not the suspended page itself.

* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::~SuspendedPageProxy):
(WebKit::SuspendedPageProxy::waitUntilReadyToUnsuspend):
(WebKit::SuspendedPageProxy::unsuspend):
(WebKit::SuspendedPageProxy::didSuspend):
(WebKit::SuspendedPageProxy::didFailToSuspend):
(WebKit::SuspendedPageProxy::loggingString const):
* UIProcess/SuspendedPageProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::swapToWebProcess):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigationInternal):

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

11 months ago[LFC][BFC][MarginCollapsing] Expand marginsCollapseThrough collapsing logic
zalan@apple.com [Tue, 18 Dec 2018 15:25:32 +0000 (15:25 +0000)]
[LFC][BFC][MarginCollapsing] Expand marginsCollapseThrough collapsing logic
https://bugs.webkit.org/show_bug.cgi?id=192794

Reviewed by Antti Koivisto.

* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginsCollapseThrough):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):

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

11 months ago[LFC][BFC][MarginCollapsing] Expand marginAfterCollapsesWithNextSibling and marginBef...
zalan@apple.com [Tue, 18 Dec 2018 15:23:47 +0000 (15:23 +0000)]
[LFC][BFC][MarginCollapsing] Expand marginAfterCollapsesWithNextSibling and marginBeforeCollapsesWithPreviousSibling collapsing logic
https://bugs.webkit.org/show_bug.cgi?id=192791

Reviewed by Antti Koivisto.

* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithPreviousSibling):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithNextSibling):

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

11 months ago[LFC][BFC][MarginCollapsing] Expand marginAfterCollapsesWithParentMarginAfter and...
zalan@apple.com [Tue, 18 Dec 2018 15:19:21 +0000 (15:19 +0000)]
[LFC][BFC][MarginCollapsing] Expand marginAfterCollapsesWithParentMarginAfter and marginBeforeCollapsesWithParentMarginBefore collapsing logic
https://bugs.webkit.org/show_bug.cgi?id=192787

Reviewed by Antti Koivisto.

* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::hasClearance):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginBefore):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):

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

11 months agoUnreviewed, JHBuild GTK build fix attempt
philn@webkit.org [Tue, 18 Dec 2018 13:00:36 +0000 (13:00 +0000)]
Unreviewed, JHBuild GTK build fix attempt

* gtk/jhbuild.modules: There's no libffi in this moduleset anymore.
There's no ninja module either, it should be provided by the host system.

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

11 months agoSkip the stress/elidable-new-object-roflcopter-then-exit.js test on 32-bit.
mark.lam@apple.com [Tue, 18 Dec 2018 08:16:14 +0000 (08:16 +0000)]
Skip the stress/elidable-new-object-roflcopter-then-exit.js test on 32-bit.
https://bugs.webkit.org/show_bug.cgi?id=191374
<rdar://problem/46525447>

Reviewed by Yusuke Suzuki.

This test runs too slow on 32-bit, and is not relevant for non-JIT builds.

* stress/elidable-new-object-roflcopter-then-exit.js:

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

11 months agoSkip the stress/materialized-regexp-has-correct-last-index-set-by-match.js test on...
mark.lam@apple.com [Tue, 18 Dec 2018 07:58:59 +0000 (07:58 +0000)]
Skip the stress/materialized-regexp-has-correct-last-index-set-by-match.js test on 32-bit.
https://bugs.webkit.org/show_bug.cgi?id=192019
<rdar://problem/46525456>

Reviewed by Yusuke Suzuki.

The test runs too slow on 32-bit.

* stress/materialized-regexp-has-correct-last-index-set-by-match.js:

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

11 months agoSkip the stress/materialize-regexp-cyclic-regexp.js test on 32-bit.
mark.lam@apple.com [Tue, 18 Dec 2018 07:51:24 +0000 (07:51 +0000)]
Skip the stress/materialize-regexp-cyclic-regexp.js test on 32-bit.
https://bugs.webkit.org/show_bug.cgi?id=191373
<rdar://problem/46525458>

Reviewed by Yusuke Suzuki.

The test is already slow running with a JIT on 64-bit.  It will always timeout
on 32-bit without a JIT.

* stress/materialize-regexp-cyclic-regexp.js:

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

11 months agoArray unshift/shift should not race against the AI in the compiler thread.
mark.lam@apple.com [Tue, 18 Dec 2018 06:56:51 +0000 (06:56 +0000)]
Array unshift/shift should not race against the AI in the compiler thread.
https://bugs.webkit.org/show_bug.cgi?id=192795
<rdar://problem/46724263>

Reviewed by Saam Barati.

JSTests:

* stress/array-unshift-should-not-race-against-compiler-thread.js: Added.

Source/JavaScriptCore:

The Array unshift and shift operations for ArrayStorage type arrays are protected
using the cellLock.  The AbstractInterpreter's foldGetByValOnConstantProperty()
function does grab the cellLock before reading a value from the array's ArrayStorage,
but does not get the array butterfly under the protection of the cellLock.

This is insufficient and racy.  For ArrayStorage type arrays, the fetching of the
butterfly also needs to be protected by the cellLock.  The unshift / shift
operations can move values around in the butterfly.  Hence, the fact that AI has
fetched a butterfly pointer (while ensuring no structure change) is insufficient
to guarantee that the values in the butterfly haven't shifted.

Having AI hold the cellLock the whole time (from before fetching the butterfly
till after reading the value from it) eliminates this race.  Note: we only need
to do this for ArrayStorage type arrays.

Note also that though AI is holding the cellLock in this case, we still need to
ensure that the array structure hasn't changed around the fetching of the butterfly.
This is because operations other than unshift and shift are guarded by this
protocol, and not the cellLock.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* runtime/JSArray.cpp:
(JSC::JSArray::unshiftCountSlowCase):

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

11 months ago[JSC] Optimize Object.keys by caching own keys results in StructureRareData
yusukesuzuki@slowstart.org [Tue, 18 Dec 2018 06:54:49 +0000 (06:54 +0000)]
[JSC] Optimize Object.keys by caching own keys results in StructureRareData
https://bugs.webkit.org/show_bug.cgi?id=190047

Reviewed by Saam Barati.

JSTests:

* stress/object-keys-cached-zero.js: Added.
(shouldBe):
(test):
* stress/object-keys-changed-attribute.js: Added.
(shouldBe):
(test):
* stress/object-keys-changed-index.js: Added.
(shouldBe):
(test):
* stress/object-keys-changed.js: Added.
(shouldBe):
(test):
* stress/object-keys-indexed-non-cache.js: Added.
(shouldBe):
(test):
* stress/object-keys-overrides-get-property-names.js: Added.
(shouldBe):
(test):
(noInline):

Source/JavaScriptCore:

Object.keys is one of the most frequently used function in web-tooling-benchmarks (WTB).
Object.keys is dominant in lebab of WTB, and frequently called in babel and others.
Since our Structure knows the shape of JSObject, we can cache the result of Object.keys
in Structure (StructureRareData) as we cache JSPropertyNameEnumerator in StructureRareData.

This patch caches the result of Object.keys in StructureRareData. The cached array is created
as JSImmutableButterfly. And Object.keys creates CoW from this data. Currently, the lifetime
strategy of this JSImmutableButterfly is the same to cached JSPropertyNameEnumerator. It is
referenced from Structure, and collected when Structure is collected.

This improves several benchmarks in SixSpeed.

                                baseline                  patched

    object-assign.es5      350.1710+-3.6303     ^    226.0368+-4.7558        ^ definitely 1.5492x faster
    for-of-object.es6      269.1941+-3.3430     ^    127.9317+-2.3875        ^ definitely 2.1042x faster

And it improves WTB lebab by 11.8%.

    Before: lebab:  6.10 runs/s
    After:  lebab:  6.82 runs/s

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::foldConstants):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNode.cpp:
(JSC::DFG::Node::convertToNewArrayBuffer):
* dfg/DFGNode.h:
* dfg/DFGNodeType.h:
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileObjectKeys):
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLAbstractHeapRepository.h:
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileObjectKeys):
* runtime/Butterfly.h:
(JSC::ContiguousData::Data::setStartingValue):
* runtime/Intrinsic.cpp:
(JSC::intrinsicName):
* runtime/Intrinsic.h:
* runtime/JSImmutableButterfly.h:
(JSC::JSImmutableButterfly::JSImmutableButterfly):
We set JSEmpty to the underlying butterfly storage if indexing type is Contiguous.
Otherwise, JSImmutableButterfly is half-baked one until all the storage is filled with some meaningful values, it leads to crash
if half-baked JSImmutableButterfly is exposed to GC.
* runtime/ObjectConstructor.cpp:
(JSC::ownPropertyKeys):
* runtime/Structure.cpp:
(JSC::Structure::canCachePropertyNameEnumerator const):
* runtime/Structure.h:
* runtime/StructureInlines.h:
(JSC::Structure::setCachedOwnKeys):
(JSC::Structure::cachedOwnKeys const):
(JSC::Structure::cachedOwnKeysIgnoringSentinel const):
(JSC::Structure::canCacheOwnKeys const):
* runtime/StructureRareData.cpp:
(JSC::StructureRareData::visitChildren):
(JSC::StructureRareData::cachedPropertyNameEnumerator const): Deleted.
(JSC::StructureRareData::setCachedPropertyNameEnumerator): Deleted.
* runtime/StructureRareData.h:
* runtime/StructureRareDataInlines.h:
(JSC::StructureRareData::cachedPropertyNameEnumerator const):
(JSC::StructureRareData::setCachedPropertyNameEnumerator):
(JSC::StructureRareData::cachedOwnKeys const):
(JSC::StructureRareData::cachedOwnKeysIgnoringSentinel const):
(JSC::StructureRareData::cachedOwnKeysConcurrently const):
(JSC::StructureRareData::setCachedOwnKeys):
(JSC::StructureRareData::previousID const): Deleted.
* runtime/VM.cpp:
(JSC::VM::VM):

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

11 months ago[Mac] Layout Test http/wpt/webauthn/public-key-credential-create-success-hid.https...
jiewen_tan@apple.com [Tue, 18 Dec 2018 06:37:28 +0000 (06:37 +0000)]
[Mac] Layout Test http/wpt/webauthn/public-key-credential-create-success-hid.https.html and http/wpt/webauthn/public-key-credential-get-success-hid.https.html are flaky
https://bugs.webkit.org/show_bug.cgi?id=192061

Reviewed by Dewei Zhu.

Source/WebKit:

Part 3.

Add some additional temporary logging info to determine if the timer is working as expected.
Once the bug is determined and fixed, we should remove all logging added in this patch.

* UIProcess/WebAuthentication/AuthenticatorManager.cpp:
(WebKit::AuthenticatorManager::respondReceived):
(WebKit::AuthenticatorManager::initTimeOutTimer):
(WebKit::AuthenticatorManager::timeOutTimerFired):
* UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.cpp:
(WebKit::MockAuthenticatorManager::respondReceivedInternal):

LayoutTests:

Add a time out value.

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

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

11 months agoEnable HTTP and HTTPS proxies on iOS and make it a property of the NSURLSession
sbarati@apple.com [Tue, 18 Dec 2018 06:33:58 +0000 (06:33 +0000)]
Enable HTTP and HTTPS proxies on iOS and make it a property of the NSURLSession
https://bugs.webkit.org/show_bug.cgi?id=192374
<rdar://problem/46506286>

Reviewed by Alex Christensen.

Source/WebCore/PAL:

* pal/spi/cf/CFNetworkSPI.h:
Remove the now-unused SPI declaration.

Source/WebKit:

This patch makes it so that we can use HTTP/HTTPS proxies on iOS as well.
To enable on iOS, you can do something like:
$ defaults write -g WebKit2HTTPProxy -string "http://localhost:8080"
$ defaults write -g WebKit2HTTPSProxy -string "http://localhost:8080"

This patch also changes the Proxy to be enabled on a per NSURLSession
basis instead of a per process basis.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/NetworkSessionCreationParameters.cpp:
(WebKit::NetworkSessionCreationParameters::privateSessionParameters):
(WebKit::NetworkSessionCreationParameters::encode const):
(WebKit::NetworkSessionCreationParameters::decode):
* NetworkProcess/NetworkSessionCreationParameters.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::proxyDictionary):
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
* NetworkProcess/mac/NetworkProcessMac.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcess):
(WebKit::overrideSystemProxies): Deleted.
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _initWithConfiguration:]):
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
(-[_WKWebsiteDataStoreConfiguration httpProxy]):
(-[_WKWebsiteDataStoreConfiguration setHTTPProxy:]):
(-[_WKWebsiteDataStoreConfiguration httpsProxy]):
(-[_WKWebsiteDataStoreConfiguration setHTTPSProxy:]):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
(WebKit::WebsiteDataStoreConfiguration::copy):
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
(WebKit::WebsiteDataStoreConfiguration::httpProxy const):
(WebKit::WebsiteDataStoreConfiguration::setHTTPProxy):
(WebKit::WebsiteDataStoreConfiguration::httpsProxy const):
(WebKit::WebsiteDataStoreConfiguration::setHTTPSProxy):

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

11 months agoTap highlights should not be shown on iOSMac
wenson_hsieh@apple.com [Tue, 18 Dec 2018 06:30:34 +0000 (06:30 +0000)]
Tap highlights should not be shown on iOSMac
https://bugs.webkit.org/show_bug.cgi?id=192797
<rdar://problem/46793995>

Reviewed by Tim Horton.

WKWebViews in iOSMac should avoid painting tap highlights, since tap highlights are not present in the rest of
the macOS platform. Simply disable this functionality by bailing in `-[WKContentView _showTapHighlight]`.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _showTapHighlight]):

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

11 months ago[Win][Clang] Fix compilation warnings WebCore/platform/graphics directory
Hironori.Fujii@sony.com [Tue, 18 Dec 2018 05:49:32 +0000 (05:49 +0000)]
[Win][Clang] Fix compilation warnings WebCore/platform/graphics directory
https://bugs.webkit.org/show_bug.cgi?id=192752

Reviewed by Don Olmstead.

No new tests, no behavior changes.

* platform/graphics/win/DIBPixelData.cpp:
Enclosed bitmapType and bitmapPixelsPerMeter with #ifndef NDEBUG.
* platform/graphics/win/FontPlatformDataWin.cpp:
(WebCore::FontPlatformData::openTypeTable const): Use ASSERT_UNUSED instead of ASSERT.
* platform/graphics/win/GraphicsContextWin.cpp: Removed unused variable 'deg2rad'.
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
Removed unused soft links MFCreateSampleGrabberSinkActivate, MFCreateMemoryBuffer and MFCreateSample.
(WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerPrivateMediaFoundation):
Reorder the initializer list.
(WebCore::MediaPlayerPrivateMediaFoundation::seek): Use ASSERT_UNUSED instead of ASSERT.
(WebCore::MediaPlayerPrivateMediaFoundation::setAllChannelVolumes): Ditto.
(WebCore::MediaPlayerPrivateMediaFoundation::createSession): Ditto.
(WebCore::MediaPlayerPrivateMediaFoundation::endSession): Ditto.
(WebCore::MediaPlayerPrivateMediaFoundation::onCreatedMediaSource): Ditto.
(WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame): Added default case.
* platform/graphics/win/SimpleFontDataCairoWin.cpp:
(WebCore::Font::platformBoundsForGlyph const): Use inner braces to initialize subobjects of MAT2.
* platform/graphics/win/SimpleFontDataWin.cpp: Removed unused 'cSmallCapsFontSizeMultiplier'.
(WebCore::Font::initGDIFont): Use inner braces to initialize subobjects of MAT2.
(WebCore::Font::boundsForGDIGlyph const): Ditto.
(WebCore::Font::widthForGDIGlyph const): Ditto.
* platform/graphics/win/UniscribeController.cpp:
(WebCore::UniscribeController::UniscribeController):
Reorder the initializer list.
(WebCore::UniscribeController::offsetForPosition): Use parentheses to combine && and ||.
(WebCore::UniscribeController::shapeAndPlaceItem): Removed unused 'glyphCount'.

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

11 months ago[MediaStream] A stream's first video frame should be rendered
eric.carlson@apple.com [Tue, 18 Dec 2018 05:31:22 +0000 (05:31 +0000)]
[MediaStream] A stream's first video frame should be rendered
https://bugs.webkit.org/show_bug.cgi?id=192629
<rdar://problem/46664353>

Reviewed by Youenn Fablet.

Source/WebCore:

Test: fast/mediastream/media-stream-renders-first-frame.html

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentDisplayMode const):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayMode):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentReadyState):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::characteristicsChanged):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::checkSelectedVideoTrack):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext):
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::size const):
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::processNewFrame):
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
(WebCore::RealtimeIncomingVideoSourceCocoa::processNewSample):

LayoutTests:

* fast/mediastream/MediaStream-video-element-displays-buffer.html: Updated.
* fast/mediastream/MediaStream-video-element-video-tracks-disabled-then-enabled-expected.txt: Ditto.
* fast/mediastream/MediaStream-video-element-video-tracks-disabled-then-enabled.html: Ditto.
* fast/mediastream/media-stream-renders-first-frame-expected.txt: Added.
* fast/mediastream/media-stream-renders-first-frame.html: Added.
* http/tests/media/media-stream/getusermedia-with-canvas-expected.txt: Removed.
* http/tests/media/media-stream/getusermedia-with-canvas.html: Removed.

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

11 months agoUnreviewed, fix the iOSMac engineering build again
wenson_hsieh@apple.com [Tue, 18 Dec 2018 05:23:10 +0000 (05:23 +0000)]
Unreviewed, fix the iOSMac engineering build again

After r239311, `WebProcessProxy::fullKeyboardAccessEnabled` in `WebProcessProxyIOS.mm` attempts to use
`WKFullKeyboardAccessWatcher`, which is guarded by `ENABLE(FULL_KEYBOARD_ACCESS)`. However, on iOSMac,
`ENABLE(FULL_KEYBOARD_ACCESS)` is 0. Fix the build by putting access to `WKFullKeyboardAccessWatcher` behind
`ENABLE(FULL_KEYBOARD_ACCESS)`.

* UIProcess/ios/WebProcessProxyIOS.mm:
(WebKit::WebProcessProxy::fullKeyboardAccessEnabled):

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

11 months agoUnreviewed, fix the iOSMac engineering build
wenson_hsieh@apple.com [Tue, 18 Dec 2018 04:39:35 +0000 (04:39 +0000)]
Unreviewed, fix the iOSMac engineering build

`generateRequestID()` is only invoked from code under `ENABLE(MEDIA_STREAM)`; move it under this guard to avoid
an unused function warning.

* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:

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

11 months agoBindings generator should support Conditional= along with CachedAttribute
justin_michaud@apple.com [Tue, 18 Dec 2018 04:17:58 +0000 (04:17 +0000)]
Bindings generator should support Conditional= along with CachedAttribute
https://bugs.webkit.org/show_bug.cgi?id=192721

Reviewed by Ryosuke Niwa.

Fix a bug where specifying both attributes causes compilation errors because the compile-time
condition is not included in the derived code.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjCachedAttribute3Getter):
(WebCore::jsTestObjCachedAttribute3):
(WebCore::JSTestObj::visitChildren):
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/TestObj.idl:

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

11 months agoclang-tidy: Fix unnecessary object copy in CPUMonitor::setCPULimit()
ddkilzer@apple.com [Tue, 18 Dec 2018 04:09:50 +0000 (04:09 +0000)]
clang-tidy: Fix unnecessary object copy in CPUMonitor::setCPULimit()
<https://webkit.org/b/192707>
<rdar://problem/46734926>

Reviewed by Daniel Bates.

Source/WebCore:

* platform/CPUMonitor.cpp:
(WebCore::CPUMonitor::setCPULimit):
* platform/CPUMonitor.h:
(WebCore::CPUMonitor::setCPULimit):
- Change parameter to const reference to fix unnecessary copies.

Source/WebKit:

* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::updateCPUMonitorState):
- Pass m_cpuLimit directly since getting its value causes an
  identical std::optional<double> to be created unnecessarily.

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

11 months ago[iOS] Focusing a large editable element always scrolls to the top of the element
wenson_hsieh@apple.com [Tue, 18 Dec 2018 04:04:44 +0000 (04:04 +0000)]
[iOS] Focusing a large editable element always scrolls to the top of the element
https://bugs.webkit.org/show_bug.cgi?id=192745
<rdar://problem/46758445>

Reviewed by Tim Horton.

Source/WebKit:

Currently, when focusing form controls or editable elements, we try to scroll such that the focused element rect
is centered within the visible area. In the case of very large focusable elements whose dimensions exceed the
width or height of the visible area, we instead scroll such that the top left point of the element is at the top
left corner of the visible area.

However, this results in unnecessary scrolling if the top of the element is already near the top of the visible
area. For WebKit2-based rich text editors that have an editable body element with a top content inset that
contains additional content, this means we will always scroll the additional content away when focusing the
editable body.

To avoid this behavior, adjust focused element zooming logic for editable elements that are too large to be
centered in the visible area, such that we only scroll the top left position of the focused element to the top
half or top right of the visible area, respectively. This reduces the amount of scrolling when focusing large
editable elements, while still making it clear which element is being focused.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):

Make some small adjustments to improve the readability of this method by using `clampTo` instead of clamping
values by comparing and setting values.

Also, fix an existing bug wherein focusable elements that are meant to be centered within the visible area are
currently offset by half the difference between the bottom inset amount and the top inset amount, in the case
where the `_obscuredInsets` SPI is used to specify content insets for the web view (i.e., MobileSafari).

* UIProcess/API/Cocoa/WKWebViewInternal.h:

Make a couple of arguments `const FloatRect&` instead of just `FloatRect`.

LayoutTests:

Add a new layout test to verify that we don't scroll unnecessarily when focusing a tall editable element, whose
top offset is already near the top of the viewport.

* editing/selection/ios/no-scrolling-when-focusing-large-editable-area-expected.txt: Added.
* editing/selection/ios/no-scrolling-when-focusing-large-editable-area.html: Added.

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

11 months agooffsetLeft and offsetParent should adjust across shadow boundaries
rniwa@webkit.org [Tue, 18 Dec 2018 03:52:53 +0000 (03:52 +0000)]
offsetLeft and offsetParent should adjust across shadow boundaries
https://bugs.webkit.org/show_bug.cgi?id=157437
<rdar://problem/26154021>

Reviewed by Simon Fraser.

Source/WebCore:

Update the WebKit's treatment of shadow boundaries in offsetLeft, offsetTop, and offsetParent to match
the latest discussion in CSS WG. See https://github.com/w3c/webcomponents/issues/497
and https://github.com/w3c/webcomponents/issues/763

The latest consensus is to use the retargeting algorithm (https://dom.spec.whatwg.org/#retarget).
In practice, this would mean that we need to keep walking up the offset parent ancestors until we find
the one which is in the same tree as a shadow-inclusive ancestor of the context object.

For example, if a node (the context object of offsetTop, offsetLeft, offsetParent) was assigned to a slot
inside a shadow tree and its offset parent was in the shadow tree, we need to walk up to its offset parent,
then its offset parent, etc... until we find the offset parent in the same tree as the context object.

Note it's possible that the context object is inside a shadow tree which does not have its own offset parent.
(e.g. all elements have position: static) For this reason, we need to consider not just offset parent in
the same tree as the context object but as well as any offset parent which is in its ancestor trees.

Test: fast/shadow-dom/offsetParent-across-shadow-boundaries.html

* dom/Element.cpp:
(WebCore::adjustOffsetForZoomAndSubpixelLayout): Extracted to share code between offsetLeft and offsetTop.
(WebCore::collectAncestorTreeScopeAsHashSet): Added.
(WebCore::Element::offsetLeftForBindings): Added. Sums up offsetLeft's until it finds the first offset parent
which is a shadow-including ancestor (https://dom.spec.whatwg.org/#concept-shadow-including-ancestor).
(WebCore::Element::offsetLeft): Now uses adjustOffsetForZoomAndSubpixelLayout.
(WebCore::Element::offsetTopForBindings): Added. Like offsetLeftForBindings, this function sums up offsetTop's
until it finds the first offset parent which is a shadow-including ancestor.
(WebCore::Element::offsetTop): Now uses adjustOffsetForZoomAndSubpixelLayout.
(WebCore::Element::offsetParentForBindings): Renamed from bindingsOffsetParent to be consistent with other
functions meant to be used for bindings code.
* dom/Element.h:
* html/HTMLElement.idl:

Source/WebKit:

Use *forBindings variants of offsetLeft, offsetTop, and offsetParent.

* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementGtk.cpp:
(webkit_dom_element_get_offset_left):
(webkit_dom_element_get_offset_top):
(webkit_dom_element_get_offset_parent):

Source/WebKitLegacy/mac:

Use *forBindings variants of offsetLeft, offsetTop, and offsetParent.

* DOM/DOMElement.mm:
(-[DOMElement offsetLeft]):
(-[DOMElement offsetTop]):
(-[DOMElement offsetParent]):

LayoutTests:

Added a W3C style testharness.js test.

* fast/shadow-dom/offsetParent-across-shadow-boundaries-expected.txt: Added.
* fast/shadow-dom/offsetParent-across-shadow-boundaries.html: Added.

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

11 months agoWeb Inspector: Canvas: path view is misaligned
drousso@apple.com [Tue, 18 Dec 2018 02:45:05 +0000 (02:45 +0000)]
Web Inspector: Canvas: path view is misaligned
https://bugs.webkit.org/show_bug.cgi?id=192761

Reviewed by Joseph Pecoraro.

* UserInterface/Views/RecordingContentView.css:
(.content-view:not(.tab).recording :matches(img, canvas)):
(.content-view:not(.tab).recording canvas.path):

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

11 months agoSome builds are broken after r239262
cfleizach@apple.com [Tue, 18 Dec 2018 02:25:25 +0000 (02:25 +0000)]
Some builds are broken after r239262
https://bugs.webkit.org/show_bug.cgi?id=192777

Reviewed by Simon Fraser.

Source/WebKit:

* Platform/spi/ios/AccessibilitySupportSPI.h:
* UIProcess/Cocoa/WKFullKeyboardAccessWatcher.h:
* UIProcess/Cocoa/WKFullKeyboardAccessWatcher.mm:
(platformIsFullKeyboardAccessEnabled):
(-[WKFullKeyboardAccessWatcher init]):
Fix the build by being more clear about when it's OK to use AccessibilitySupport.

Source/WTF:

* wtf/Platform.h:

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

11 months agoAllow passing nil as session state to [WKWebView _restoreSessionState:]
cdumez@apple.com [Tue, 18 Dec 2018 02:17:26 +0000 (02:17 +0000)]
Allow passing nil as session state to [WKWebView _restoreSessionState:]
https://bugs.webkit.org/show_bug.cgi?id=192789
<rdar://problem/46755277>

Reviewed by Alex Christensen.

Source/WebKit:

Allow passing nil as session state to [WKWebView _restoreSessionState:] instead of crashing.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _restoreSessionState:andNavigate:]):

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKit/WKBackForwardList.mm:
(TEST):

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

11 months agoDon't use more expensive layer backing store formats when subpixel text antialiasing...
simon.fraser@apple.com [Tue, 18 Dec 2018 01:45:47 +0000 (01:45 +0000)]
Don't use more expensive layer backing store formats when subpixel text antialiasing is not enabled
https://bugs.webkit.org/show_bug.cgi?id=192780
rdar://problem/43394387

Reviewed by Tim Horton.
Source/WebCore:

macOS Mojave disabled text subpixel antialiasing by default, so we no longer need to use the
memory-hungry "linear glyph mask" CALayer backing store formats for non-opaque with text in them.

Add FontCascade::isSubpixelAntialiasingAvailable() which reports whether subpixel antialiasing is available,
and consult it when making decisions that affect layer backing store format.

Tested by new results for existing tests.

* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::isSubpixelAntialiasingAvailable):
* platform/graphics/FontCascade.h:
* platform/graphics/cocoa/FontCascadeCocoa.mm:
(WebCore::FontCascade::isSubpixelAntialiasingAvailable): CGFontRenderingGetFontSmoothingDisabled() isn't super cheap, so fetch
it once.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateAfterDescendants):
* testing/Internals.cpp:
(WebCore::Internals::setFontSmoothingEnabled): Remove a WebCore::

Source/WebCore/PAL:

Add CGFontRenderingGetFontSmoothingDisabled().

* pal/spi/cg/CoreGraphicsSPI.h:

Tools:

No need to set "AppleFontSmoothing" defaults for WK2.

* WebKitTestRunner/InjectedBundle/mac/InjectedBundleMac.mm:
(WTR::InjectedBundle::platformInitialize):

LayoutTests:

New macOS Mojave and later results.

* platform/mac-mojave/compositing/contents-format/subpixel-antialiased-nested-layer-expected.txt: Added.
* platform/mac-mojave/compositing/contents-format/subpixel-antialiased-text-configs-antialiasing-style-expected.txt: Added.
* platform/mac-mojave/compositing/contents-format/subpixel-antialiased-text-configs-expected.txt: Added.
* platform/mac-mojave/compositing/contents-format/subpixel-antialiased-text-enabled-expected.txt: Added.
* platform/mac-mojave/compositing/contents-format/subpixel-antialiased-text-images-expected.txt: Added.
* platform/mac-mojave/compositing/contents-format/subpixel-antialiased-text-traversal-expected.txt: Added.
* platform/mac-mojave/compositing/contents-format/subpixel-antialiased-text-visibility-expected.txt: Added.

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

11 months agoFix occasional null-dereference crash in WebPageProxy::didReceiveServerRedirectForPro...
commit-queue@webkit.org [Tue, 18 Dec 2018 01:32:34 +0000 (01:32 +0000)]
Fix occasional null-dereference crash in WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame
https://bugs.webkit.org/show_bug.cgi?id=192744
<rdar://problem/45842668>

Patch by Alex Christensen <achristensen@webkit.org> on 2018-12-17
Reviewed by Chris Dumez.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
Things happen.  Navigations can be null.  If they are, we shouldn't dereference pointers to them.

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

11 months agoSamplingProfiler's isValidFramePointer() should reject address at stack origin.
mark.lam@apple.com [Tue, 18 Dec 2018 01:21:07 +0000 (01:21 +0000)]
SamplingProfiler's isValidFramePointer() should reject address at stack origin.
https://bugs.webkit.org/show_bug.cgi?id=192779
<rdar://problem/46775869>

Reviewed by Saam Barati.

JSTests:

* stress/sampling-profiler-should-not-sample-beyond-stack-bounds.js: Added.

Source/JavaScriptCore:

isValidFramePointer() was previously treating the address at StackBounds::origin()
as valid stack memory.  This is not true.  StackBounds::origin() is actually the
first address beyond valid stack memory. This is now fixed.

* runtime/SamplingProfiler.cpp:
(JSC::FrameWalker::isValidFramePointer):

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

11 months agowebkitpy: Handle case where stdout and stderr don't accept unicode
jbedard@apple.com [Tue, 18 Dec 2018 00:12:06 +0000 (00:12 +0000)]
webkitpy: Handle case where stdout and stderr don't accept unicode
https://bugs.webkit.org/show_bug.cgi?id=192775
<rdar://problem/46497303>

Reviewed by Stephanie Lewis.

* Scripts/webkitpy/layout_tests/views/metered_stream.py:
(MeteredStream.write): If unicode cannot be written to the stream, replace unicode
characters with '?'.
* Scripts/webkitpy/layout_tests/views/metered_stream_unittest.py:
(RegularTest.test_stream_with_encoding):

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

11 months agoUnreviewed test gardening, address a syntax error in a new test.
ryanhaddad@apple.com [Mon, 17 Dec 2018 23:37:27 +0000 (23:37 +0000)]
Unreviewed test gardening, address a syntax error in a new test.

* stress/out-of-frame-stack-accesses-due-to-probe-based-osr-exits.js:

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

11 months agoUnreviewed, revert recent CrashReporterClient build fixes as they are no longer needed.
cdumez@apple.com [Mon, 17 Dec 2018 23:29:01 +0000 (23:29 +0000)]
Unreviewed, revert recent CrashReporterClient build fixes as they are no longer needed.

* Platform/cocoa/WKCrashReporter.mm:

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

11 months agoAdd "-o/--output" option to startup.py and new_tab.py benchmark scripts to save the...
commit-queue@webkit.org [Mon, 17 Dec 2018 23:06:47 +0000 (23:06 +0000)]
Add "-o/--output" option to startup.py and new_tab.py benchmark scripts to save the results in json format.
https://bugs.webkit.org/show_bug.cgi?id=192385

Patch by Suresh Koppisetty <skoppisetty@apple.com> on 2018-12-17
Reviewed by Ryosuke Niwa.

Sample json output for new tab benchmark script after running for 2 iterations and 2 groups. Values are in milliseconds.
{
        "NewTabBenchmark": {
                "metrics": {
                        "Time": {
                                "current": [
                                        [
                                                410.2939453125,
                                                307.81494140625
                                        ],
                                        [
                                                340.616943359375,
                                                265.94384765625
                                        ]
                                ]
                        }
                }
        }
}

Sample json output for startup time benchmark script after running for 2 iterations. Values are in milliseconds.
{
        "StartupBenchmark": {
                "metrics": {
                        "Time": {
                                "current": [
                                        [
                                                1415.2099609375,
                                                1439.552978515625
                                        ]
                                ]
                        }
                }
        }
}

* LaunchTime/launch_time.py:
* LaunchTime/new_tab.py:
(NewTabBenchmark.get_test_name):
* LaunchTime/startup.py:
(StartupBenchmark.get_test_name):

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

11 months agoImport FeedbackServer only if "-f/--feedback-in-browser" option is enabled.
commit-queue@webkit.org [Mon, 17 Dec 2018 23:01:44 +0000 (23:01 +0000)]
Import FeedbackServer only if "-f/--feedback-in-browser" option is enabled.
https://bugs.webkit.org/show_bug.cgi?id=192378

Patch by Suresh Koppisetty <skoppisetty@apple.com> on 2018-12-17
Reviewed by Ryosuke Niwa.

FeedbackServer currently depends on Tornado-5.1, which further adds
dependency of "singledispatch", "backports-abc" and "futures" python libraries.
Importing FeedbackServer only if "-f/--feedback-in-browser" option is enabled
will let us run the benchmark scripts without installing any new python libraries.

* LaunchTime/launch_time.py:
* LaunchTime/new_tab.py:

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

11 months agoRollout r235411
commit-queue@webkit.org [Mon, 17 Dec 2018 23:00:41 +0000 (23:00 +0000)]
Rollout r235411
https://bugs.webkit.org/show_bug.cgi?id=192778
<rdar://46789485>

Disabling access to CoreServices is causing a performance
regression in process launch time.  See <rdar://46141878>

Patch by Suresh Koppisetty <skoppisettyt@apple.com> on 2018-12-17
Reviewed by Alex Christensen.

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

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

11 months agoSuppress ASAN on valid stack accesses in Probe-based OSRExit::executeOSRExit().
mark.lam@apple.com [Mon, 17 Dec 2018 22:46:50 +0000 (22:46 +0000)]
Suppress ASAN on valid stack accesses in Probe-based OSRExit::executeOSRExit().
https://bugs.webkit.org/show_bug.cgi?id=192776
<rdar://problem/46772368>

Reviewed by Keith Miller.

JSTests:

* stress/out-of-frame-stack-accesses-due-to-probe-based-osr-exits.js: Added.

Source/JavaScriptCore:

1. Add some asanUnsafe methods to the Register class.
2. Update the probe-based OSRExit::executeOSRExit() to use these asanUnsafe methods.

* dfg/DFGOSRExit.cpp:
(JSC::DFG::OSRExit::executeOSRExit):
* interpreter/Register.h:
(JSC::Register::asanUnsafeUnboxedInt32 const):
(JSC::Register::asanUnsafeUnboxedInt52 const):
(JSC::Register::asanUnsafeUnboxedStrictInt52 const):
(JSC::Register::asanUnsafeUnboxedDouble const):
(JSC::Register::asanUnsafeUnboxedCell const):

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

11 months agoMake DocumentMarker::allMarkers() constexpr
dbates@webkit.org [Mon, 17 Dec 2018 21:47:53 +0000 (21:47 +0000)]
Make DocumentMarker::allMarkers() constexpr
https://bugs.webkit.org/show_bug.cgi?id=192634

Reviewed by Simon Fraser.

The result of DocumentMarker::allMarkers() can be computed at compile time. We should annotate
it constexpr to do just that.

* dom/DocumentMarker.h:
(WebCore::DocumentMarker::allMarkers):

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

11 months ago[WebGPU] Implement WebGPUBindGroupLayoutDescriptor and its supporting dictionaries
justin_fan@apple.com [Mon, 17 Dec 2018 21:34:18 +0000 (21:34 +0000)]
[WebGPU] Implement WebGPUBindGroupLayoutDescriptor and its supporting dictionaries
https://bugs.webkit.org/show_bug.cgi?id=192726

Reviewed by Myles C. Maxfield.

Source/WebCore:

Test: webgpu/bind-group-layouts.html
Implement the WebGPUBindGroupLayoutDescriptor struct and its sub-structs:
* Modules/streams/WebGPUBindGroupLayoutDescriptor.h: Added.
* Modules/streams/WebGPUBindGroupLayoutDescriptor.idl: Added.
* Modules/webgpu/WebGPUBindGroupLayoutBinding.h: Added.
* Modules/webgpu/WebGPUBindGroupLayoutBinding.idl: Added.
* Modules/webgpu/WebGPUShaderStageBit.h: Added.
* Modules/webgpu/WebGPUShaderStageBit.idl: Added.
* platform/graphics/gpu/GPUBindGroupLayoutBinding.h: Added.
* platform/graphics/gpu/GPUBindGroupLayoutDescriptor.h: Added.

Add the new symbols and files to the project:
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:

Small FIXME update for later:
* platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
(WebCore::GPURenderPassEncoder::setVertexBuffers):

LayoutTests:

Add simple test to ensure a WebGPUBindGroupLayoutDescriptor can be created.

* webgpu/bind-group-layouts-expected.txt: Added.
* webgpu/bind-group-layouts.html: Added.

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

11 months agoFix stale assertion in attemptToForceStringArrayModeByToStringConversion().
mark.lam@apple.com [Mon, 17 Dec 2018 21:32:39 +0000 (21:32 +0000)]
Fix stale assertion in attemptToForceStringArrayModeByToStringConversion().
https://bugs.webkit.org/show_bug.cgi?id=192770
<rdar://problem/46449037>

Reviewed by Keith Miller.

JSTests:

* stress/force-string-arrayMode-on-originalNonArray-array-class.js: Added.

Source/JavaScriptCore:

This assertion was added before Array::OriginalNonArray was introduced.  It just
needs to be updated to allow for Array::OriginalNonArray.

* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::attemptToForceStringArrayModeByToStringConversion):

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

11 months agoWeb Inspector: Audit: add plural result strings
drousso@apple.com [Mon, 17 Dec 2018 21:16:30 +0000 (21:16 +0000)]
Web Inspector: Audit: add plural result strings
https://bugs.webkit.org/show_bug.cgi?id=192769
<rdar://problem/46628680>

Reviewed by Brian Burg.

* UserInterface/Views/AuditTestContentView.js:
(WI.AuditTestContentView.prototype.showNoResultDataPlaceholder):

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

* Localizations/en.lproj/localizedStrings.js:

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

11 months agoWeb Inspector: Settings: add singular "space" UIString
drousso@apple.com [Mon, 17 Dec 2018 21:15:39 +0000 (21:15 +0000)]
Web Inspector: Settings: add singular "space" UIString
https://bugs.webkit.org/show_bug.cgi?id=192766
<rdar://problem/46776948>

Reviewed by Brian Burg.

* UserInterface/Views/SettingEditor.js:
(WI.SettingEditor):
(WI.SettingEditor.prototype.get label):
(WI.SettingEditor.prototype.set label): Added.

* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createGeneralSettingsView):
(WI.SettingsTabContentView.prototype._createGeneralSettingsView.addSpacesSetting): Added.
(WI.SettingsTabContentView.prototype._createGeneralSettingsView.addSpacesSetting.updateLabel): Added.

* Localizations/en.lproj/localizedStrings.js:

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

11 months agoSupport concatenating StringView with other string types
dbates@webkit.org [Mon, 17 Dec 2018 20:36:31 +0000 (20:36 +0000)]
Support concatenating StringView with other string types
https://bugs.webkit.org/show_bug.cgi?id=177566

Reviewed by Darin Adler.

Source/WTF:

Add operator+ overloads to StringOperators.h to support concatenating a StringView with
other string types (e.g. String). This lets a person write more naturally looking code:

stringView + string

Instead of:

makeString(stringView, string)

* wtf/text/StringOperators.h:
(WTF::operator+): Added various operator+ overloads.

Tools:

Add some tests to ensure we do not regress the number of allocations needed when performing
string concatenation with string views.

* TestWebKitAPI/Tests/WTF/StringOperators.cpp:
(TestWebKitAPI::TEST):

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

11 months agoUnreviewed WPE build fix after r239277.
zandobersek@gmail.com [Mon, 17 Dec 2018 20:21:08 +0000 (20:21 +0000)]
Unreviewed WPE build fix after r239277.

* UIProcess/API/C/WKContext.cpp:
(WKContextClearCurrentModifierStateForTesting):
Use the WebKit:: namespace specifier as it is used across this file.

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

11 months agoUnreviewed build fix.
zalan@apple.com [Mon, 17 Dec 2018 20:18:18 +0000 (20:18 +0000)]
Unreviewed build fix.

Source/WebCore:

* page/ios/FrameIOS.mm:
(WebCore::Frame::interpretationsForCurrentRoot const):

Source/WebKitLegacy/ios:

* WebCoreSupport/WebVisiblePosition.mm:
(-[WebVisiblePosition enclosingRangeWithDictationPhraseAlternatives:]):
(-[WebVisiblePosition enclosingRangeWithCorrectionIndicator]):

Source/WebKitLegacy/mac:

* WebView/WebFrame.mm:
(-[WebFrame getDictationResultRanges:andMetadatas:]):

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

11 months agoReproducible ASSERTion failure when toggling layer borders with find-in-page up
zalan@apple.com [Mon, 17 Dec 2018 19:42:55 +0000 (19:42 +0000)]
Reproducible ASSERTion failure when toggling layer borders with find-in-page up
https://bugs.webkit.org/show_bug.cgi?id=192762
<rdar://problem/46676873>

Reviewed by Simon Fraser.

Source/WebCore:

DocumentMarkerController::markersFor() should take a reference instead of a Node*.

Test: editing/document-marker-null-check.html

* dom/DocumentMarkerController.cpp:
(DocumentMarkerController::hasMarkers):
* dom/DocumentMarkerController.h:
* editing/AlternativeTextController.cpp:
(WebCore::AlternativeTextController::respondToChangedSelection):
* editing/Editor.cpp:
(WebCore::Editor::selectionStartHasMarkerFor const):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers const):
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::paint):
* rendering/RenderText.cpp:
(WebCore::RenderText::draggedContentRangesBetweenOffsets const):
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForWithReason):
* testing/Internals.cpp:
(WebCore::Internals::markerCountForNode):

LayoutTests:

* editing/document-marker-null-check-expected.txt: Added.
* editing/document-marker-null-check.html: Added.

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

11 months agoUnreviewed, rolling out r239265 and r239274.
commit-queue@webkit.org [Mon, 17 Dec 2018 19:22:20 +0000 (19:22 +0000)]
Unreviewed, rolling out r239265 and r239274.
https://bugs.webkit.org/show_bug.cgi?id=192765

unorm_normalize is deprecated, and broke an internal build
(Requested by Truitt on #webkit).

Reverted changesets:

"[GTK][WPE] Need a function to convert internal URI to display
("pretty") URI"
https://bugs.webkit.org/show_bug.cgi?id=174816
https://trac.webkit.org/changeset/239265

"Fix the Apple Internal Mac build with a newer SDK"
https://trac.webkit.org/changeset/239274

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

11 months agoImplement UIScriptController::toggleCapsLock() for iOS
dbates@webkit.org [Mon, 17 Dec 2018 19:19:25 +0000 (19:19 +0000)]
Implement UIScriptController::toggleCapsLock() for iOS
https://bugs.webkit.org/show_bug.cgi?id=191815

Reviewed by Andy Estes.

Source/WebCore/PAL:

Add HID usage enumerator for the Caps Lock key.

* pal/spi/cocoa/IOKitSPI.h:

Source/WebKit:

Add test infrastructure to clear the current modifier state. We will use this to ensure that
the caps lock state does not persist between tests.

* UIProcess/API/C/WKContext.cpp:
(WKContextClearCurrentModifierStateForTesting): Added.
* UIProcess/API/C/WKContextPrivate.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::clearCurrentModifierStateForTesting): Added.
* UIProcess/WebProcessPool.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::clearCurrentModifierStateForTesting): Added.
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

Tools:

Add support for toggling the caps lock state in WebKitTestRunner on iOS.

* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetStateToConsistentValues): Clear the current modifier state
before running a test. This ensures that the caps lock state does not persist between
tests should a test enable caps lock and not disable it.
* WebKitTestRunner/ios/HIDEventGenerator.mm:
(hidUsageCodeForCharacter): Map "capsLock" to the Caps Lock key usage code.
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::createUIPhysicalKeyboardEvent): Modified to take the keyboard input flags to use to
create the event. Also substituted NSString* for const String& as the data type for the first
two parameters to avoid conversions in the implementation of UIScriptController::toggleCapsLock()
below.
(WTR::UIScriptController::keyDown): Update as needed due to changes to prototype of createUIPhysicalKeyboardEvent().
(WTR::UIScriptController::toggleCapsLock): Dispatch a UIEvent to toggle caps lock.

LayoutTests:

Add iOS-specific results for some of the tests. We need to continue to skip the caps
lock tests on iOS until we have the fix for <rdar://problem/44930119>.

* fast/forms/password-scrolled-after-caps-lock-toggled.html: Replace input.focus() with
UIHelper.activateElement(input) to make it work on iOS and update logic accordingly.
Compensate for the fact that one less character than the size of the input is visible in
a password field on iOS.
* fast/repaint/placeholder-after-caps-lock-hidden.html: Replace input.focus() with
UIHelper.activateElement(input) to make it work on iOS and update logic accordingly.
* platform/ios-wk2/TestExpectations:
* platform/ios-wk2/fast/forms/password-scrolled-after-caps-lock-toggled-expected.txt: Added.
* platform/ios-wk2/fast/repaint/placeholder-after-caps-lock-hidden-expected.txt: Added.

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

11 months agoREGRESSION (r239262): Fix broken builds prior to Mojave
ddkilzer@apple.com [Mon, 17 Dec 2018 19:17:11 +0000 (19:17 +0000)]
REGRESSION (r239262): Fix broken builds prior to Mojave
<https://bugs.webkit.org/show_bug.cgi?id=192373>
<rdar://problem/46462670>

* UIProcess/Cocoa/WKFullKeyboardAccessWatcher.mm:
Wrap header in ENABLE(ACCESSIBILITY_EVENTS) to fix the build.

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

11 months ago[iOS] Remove -[WebEvent initWithKeyEventType:...:characterSet:]
dbates@webkit.org [Mon, 17 Dec 2018 18:58:52 +0000 (18:58 +0000)]
[iOS] Remove -[WebEvent initWithKeyEventType:...:characterSet:]
https://bugs.webkit.org/show_bug.cgi?id=192633

Reviewed by Wenson Hsieh.

Source/WebCore:

UIKit has long adopted the newer -[WebEvent initWithKeyEventType:] initializer that takes an
input manager hint. We no longer need to keep the variant -[WebEvent initWithKeyEventType:...:characterSet:]
for binary compatibility.

* platform/ios/WebEvent.h:
* platform/ios/WebEvent.mm:
(-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]): Deleted.

Source/WebKit:

Update code to use the modern initializer.

* UIProcess/ios/WKWebEvent.mm:
(-[WKWebEvent initWithEvent:]):

Tools:

Update code to use the modern initializer.

* DumpRenderTree/mac/EventSendingController.mm:
(-[EventSendingController keyDown:withModifiers:withLocation:]):

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

11 months agoFix the Apple Internal Mac build with a newer SDK
dbates@webkit.org [Mon, 17 Dec 2018 18:56:24 +0000 (18:56 +0000)]
Fix the Apple Internal Mac build with a newer SDK

* wtf/URLHelpers.cpp:
(WTF::URLHelpers::userVisibleURL):

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

11 months agoUnreviewed, rolling out r239254.
jlewis3@apple.com [Mon, 17 Dec 2018 18:45:16 +0000 (18:45 +0000)]
Unreviewed, rolling out r239254.

This broke the Windows 10 Debug build

Reverted changeset:

"Replace many uses of String::format with more type-safe
alternatives"
https://bugs.webkit.org/show_bug.cgi?id=192742
https://trac.webkit.org/changeset/239254

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

11 months ago[Web Animations] Remove the redundant m_scheduledMicrotask from WebAnimation
graouts@webkit.org [Mon, 17 Dec 2018 17:51:57 +0000 (17:51 +0000)]
[Web Animations] Remove the redundant m_scheduledMicrotask from WebAnimation
https://bugs.webkit.org/show_bug.cgi?id=192758

Reviewed by Dean Jackson.

We tracked whether we had a pending microtask twice so we remove the m_scheduledMicrotask flag as m_finishNotificationStepsMicrotaskPending
gives us enough information as it is. Additionally, we remove the scheduleMicrotaskIfNeeded() and performMicrotask() functions since there is
less bookkeeping to perform.

No new test since there is no user-observable change.

* animation/WebAnimation.cpp:
(WebCore::WebAnimation::updateFinishedState):
(WebCore::WebAnimation::scheduleMicrotaskIfNeeded): Deleted.
(WebCore::WebAnimation::performMicrotask): Deleted.
* animation/WebAnimation.h:

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

11 months ago[Web Animations] Ensure we don't update an animation's finished state twice when...
graouts@webkit.org [Mon, 17 Dec 2018 17:49:55 +0000 (17:49 +0000)]
[Web Animations] Ensure we don't update an animation's finished state twice when updating animations
https://bugs.webkit.org/show_bug.cgi?id=192757

Reviewed by Dean Jackson.

When animations are udpated and DocumentTimeline::updateAnimationsAndSendEvents() is called, we used to update an animation's finished state
twice since we'd do it once when calling tick() and once again when calling resolve() in the ensuing style invalidation. We now keep track of
whether we've already updated an animation's finished state during animation update in the call to tick() and avoid updating in the immediate
next call to resolve(), unless any of the timing properties have changed in the meantime.

No new test since there is no user-observable change.

* animation/WebAnimation.cpp:
(WebCore::WebAnimation::timingDidChange):
(WebCore::WebAnimation::tick):
(WebCore::WebAnimation::resolve):
* animation/WebAnimation.h:

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

11 months agoREGRESSION (r233268): Elements animated in from offscreen sometimes don't display
simon.fraser@apple.com [Mon, 17 Dec 2018 17:10:44 +0000 (17:10 +0000)]
REGRESSION (r233268): Elements animated in from offscreen sometimes don't display
https://bugs.webkit.org/show_bug.cgi?id=192725
rdar://problem/46011418

Reviewed by Antoine Quint.

Source/WebCore:

There were two problems with backing store attachment and animation.

First, animations are an input into the "backing store attached" logic, so when they change
we should set the CoverageRectChanged bit on GraphicsLayerCA.

Secondly, when an ancestor has unknown animation extent, all its descendants need to
get backing store, so we need to set childCommitState.ancestorWithTransformAnimationIntersectsCoverageRect when
the current layer has no animation extent.

Tests: compositing/backing/animate-into-view-with-descendant.html
       compositing/backing/animate-into-view.html

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::addAnimation):
(WebCore::GraphicsLayerCA::removeAnimation):
(WebCore::GraphicsLayerCA::recursiveCommitChanges):

LayoutTests:

* compositing/backing/animate-into-view-expected.txt: Added.
* compositing/backing/animate-into-view-with-descendant-expected.txt: Added.
* compositing/backing/animate-into-view-with-descendant.html: Added.
* compositing/backing/animate-into-view.html: Added.
* platform/ios/compositing/backing/animate-into-view-expected.txt: Added.
* platform/ios/compositing/backing/animate-into-view-with-descendant-expected.txt: Added.

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

11 months ago[LFC][BFC][MarginCollapsing] Unify margin collapse function naming
zalan@apple.com [Mon, 17 Dec 2018 15:44:55 +0000 (15:44 +0000)]
[LFC][BFC][MarginCollapsing] Unify margin collapse function naming
https://bugs.webkit.org/show_bug.cgi?id=192747

Reviewed by Antti Koivisto.

Rename some margin collapse getters.

* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBefore):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginAfter):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBeforeFromFirstChild):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithPreviousSibling):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithNextSibling):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginsCollapseThrough):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):
(WebCore::Layout::isMarginBeforeCollapsedWithSibling): Deleted.
(WebCore::Layout::isMarginAfterCollapsedWithSibling): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParent): Deleted.
(WebCore::Layout::isMarginAfterCollapsedThrough): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginAfterCollapsedWithParent): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParentMarginAfter): Deleted.

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

11 months agoclang-tidy: loop variable is copied but only used as const reference in WebCore,...
ddkilzer@apple.com [Mon, 17 Dec 2018 14:22:41 +0000 (14:22 +0000)]
clang-tidy: loop variable is copied but only used as const reference in WebCore, WebKit, Tools
<https://webkit.org/b/192751>
<rdar://problem/46771623>

Reviewed by Daniel Bates.

Change loop variables to const references to avoid unnecessary
copies.

Source/WebCore:

* Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
(WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
* Modules/indexeddb/server/MemoryObjectStore.cpp:
(WebCore::IDBServer::MemoryObjectStore::populateIndexWithExistingRecords):
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::maybeNotifyConnectionsOfVersionChange):
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::objectStoreIdentifiers):
* Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
(WebCore::IDBDatabaseInfo::IDBDatabaseInfo):
(WebCore::IDBDatabaseInfo::loggingString const):
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::removeSamplesFromTrackBuffer):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::targetElementForActiveDescendant const):
* accessibility/AccessibilityTableRow.cpp:
(WebCore::AccessibilityTableRow::headerObject):
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::computedNeedsForcedLayout):
* crypto/keys/CryptoKeyRSA.cpp:
(WebCore::CryptoKeyRSA::importJwk):
(WebCore::CryptoKeyRSA::exportJwk const):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::OrderedNamedLinesCollector::appendLines const):
* dom/DataTransfer.cpp:
(WebCore::readURLsFromPasteboardAsString):
* dom/TreeScope.cpp:
(WebCore::TreeScope::elementsFromPoint):
* html/track/WebVTTParser.cpp:
(WebCore::WebVTTParser::checkAndStoreRegion):
* inspector/agents/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::setInstruments):
* page/Page.cpp:
(WebCore::Page::updateIntersectionObservations):
* page/TextIndicator.cpp:
(WebCore::estimatedBackgroundColorForRange):
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::computeLayoutDependency):
* platform/graphics/DisplayRefreshMonitorManager.cpp:
(WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::moveOrCopyAnimations):
(WebCore::GraphicsLayerCA::updateAnimations):
(WebCore::GraphicsLayerCA::isRunningTransformAnimation const):
* platform/graphics/mac/ImageMac.mm:
(WebCore::BitmapImage::tiffRepresentation):
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::append):
* testing/Internals.cpp:
(WebCore::Internals::acceleratedAnimationsForElement):

Source/WebKit:

* NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::~WebSWServerConnection):
* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::encode const):
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::toNSErrors):
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::setFilesToSelectForFileUpload):
(WebKit::WebAutomationSession::performKeyboardInteractions):
(WebKit::WebAutomationSession::performInteractionSequence):
* UIProcess/Plugins/PluginProcessManager.cpp:
(WebKit::PluginProcessManager::getPluginProcess):
* UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords):
(WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveDataRecords const):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::serializedAttachmentDataForIdentifiers):
* UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
(WebKit::LocalStorageDatabaseTracker::deleteAllDatabases):
(WebKit::LocalStorageDatabaseTracker::origins const):
(WebKit::LocalStorageDatabaseTracker::originDetails):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_shouldAttachDrawingAreaOnPageTransition):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::didUpdateActivityStateTimerFired):

Tools:

* DumpRenderTree/mac/DumpRenderTreePasteboard.mm:
(-[LocalPasteboard pasteboardItems]):

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

11 months ago[GTK][WPE] Need a function to convert internal URI to display ("pretty") URI
Ms2ger@igalia.com [Mon, 17 Dec 2018 14:08:46 +0000 (14:08 +0000)]
[GTK][WPE] Need a function to convert internal URI to display ("pretty") URI
https://bugs.webkit.org/show_bug.cgi?id=174816

Reviewed by Michael Catanzaro.

Source/WebCore:

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

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

Source/WebKit:

Add webkit_uri_for_display for GTK and WPE.

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

Source/WTF:

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

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

Tools:

Add tests for userVisibleString() and (for GTK and WPE) webkit_uri_for_display().

* TestWebKitAPI/CMakeLists.txt:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WTF/URLHelpers.cpp: Added.
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitGLib/TestWebKitURIUtilities.cpp: Added.
(testURIForDisplayUnaffected):
(testURIForDisplayAffected):
(beforeAll):
(afterAll):
* TestWebKitAPI/glib/CMakeLists.txt:

LayoutTests:

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

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

11 months ago[WPE] Add API to notify about frame displayed view backend callback
carlosgc@webkit.org [Mon, 17 Dec 2018 13:31:27 +0000 (13:31 +0000)]
[WPE] Add API to notify about frame displayed view backend callback
https://bugs.webkit.org/show_bug.cgi?id=192224

Reviewed by Michael Catanzaro.

Source/WebKit:

Add API to add a callback to the view to be called when the view backend notifies that a frame has been
displayed.

* UIProcess/API/glib/WebKitWebView.cpp:
(FrameDisplayedCallback::FrameDisplayedCallback):
(FrameDisplayedCallback::~FrameDisplayedCallback):
(webkit_web_view_add_frame_displayed_callback):
(webkit_web_view_remove_frame_displayed_callback):
* UIProcess/API/wpe/WebKitWebView.h:
* UIProcess/API/wpe/docs/wpe-0.1-sections.txt:

Tools:

Add a test case to check the new API.

* TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebView.cpp:
(testWebViewFrameDisplayed):
(beforeAll):
* wpe/jhbuild.modules: Bump WPEBackend-fdo to 1.1.0.

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

11 months agoAX: Support keyboard access preference for iOS in WebKit
cfleizach@apple.com [Mon, 17 Dec 2018 00:44:23 +0000 (00:44 +0000)]
AX: Support keyboard access preference for iOS in WebKit
https://bugs.webkit.org/show_bug.cgi?id=192373
<rdar://problem/46462670>

Reviewed by Tim Horton.

* Platform/spi/ios/AccessibilitySupportSPI.h:
* PlatformMac.cmake:
* SourcesCocoa.txt:
* UIProcess/Cocoa/WKFullKeyboardAccessWatcher.h: Added.
* UIProcess/Cocoa/WKFullKeyboardAccessWatcher.mm: Added.
(platformIsFullKeyboardAccessEnabled):
(-[WKFullKeyboardAccessWatcher notifyAllProcessPools]):
(-[WKFullKeyboardAccessWatcher retrieveKeyboardUIModeFromPreferences:]):
(-[WKFullKeyboardAccessWatcher init]):
(+[WKFullKeyboardAccessWatcher fullKeyboardAccessEnabled]):
* UIProcess/ios/WebProcessProxyIOS.mm:
(WebKit::WebProcessProxy::fullKeyboardAccessEnabled):
* UIProcess/mac/WKFullKeyboardAccessWatcher.h: Removed.
* UIProcess/mac/WKFullKeyboardAccessWatcher.mm: Removed.
* WebKit.xcodeproj/project.pbxproj:

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

11 months agoUnreviewed follow up after r239260
aperez@igalia.com [Sun, 16 Dec 2018 22:29:13 +0000 (22:29 +0000)]
Unreviewed follow up after r239260
https://bugs.webkit.org/show_bug.cgi?id=192714
<rdar://problem/46762407>

* Platform/win/SharedMemoryWin.cpp:
(WebKit::SharedMemory::allocate): Use PAGE_READWRITE directly instead
of going through the protectAttribute() function, which is removed
because it is now unused.

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

11 months agoUnify SharedMemory factory functions
aperez@igalia.com [Sun, 16 Dec 2018 19:39:38 +0000 (19:39 +0000)]
Unify SharedMemory factory functions
https://bugs.webkit.org/show_bug.cgi?id=192714

Reviewed by Darin Adler.

This unifies SharedMemory so in the following way, across platforms:

- SharedMemory::create() is removed, to avoid ambiguity.
- SharedMemory::allocate() always allocates a new block of shared memory.
- SharedMemory::wrapMap() always creates a SharedMemory object which refers to an
  existing region of memory resulting from memory-mapping a file.

* NetworkProcess/cache/NetworkCacheDataCocoa.mm:
(WebKit::NetworkCache::Data::tryCreateSharedMemory const): Use SharedMemory::wrapMap().
* Platform/SharedMemory.h: Remove the definition of SharedMemory::create(), and make
SharedMemory::wrapMap() available on OS(DARWIN) as well.
* Platform/cocoa/SharedMemoryCocoa.cpp:
(WebKit::SharedMemory::wrapMap): Renamed from ::create().
* Platform/unix/SharedMemoryUnix.cpp:
(WebKit::SharedMemory::allocate): Renamed from ::create().
* Platform/win/SharedMemoryWin.cpp:
(WebKit::SharedMemory::allocate): Renamed from ::create()
* UIProcess/API/APIContentRuleListStore.cpp:
(API::createExtension): Use NetworkCache::Data::tryCreateSharedMemory() instead of
SharedMemory::create().

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

11 months agoUnreviewed build fix after r239253
aperez@igalia.com [Sun, 16 Dec 2018 12:05:46 +0000 (12:05 +0000)]
Unreviewed build fix after r239253

* gtk/jhbuild.modules: Fix typo in libpsl dependency name.

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

11 months ago[meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for...
cfleizach@apple.com [Sun, 16 Dec 2018 07:25:21 +0000 (07:25 +0000)]
[meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
https://bugs.webkit.org/show_bug.cgi?id=192449
<rdar://problem/46595508>

Reviewed by Darin Adler.

Part 7: Files in UIProcess/API

* UIProcess/API/APIContentRuleListStore.cpp:
* UIProcess/API/APIHitTestResult.cpp:
* UIProcess/API/APINavigation.cpp:
* UIProcess/API/APIOpenPanelParameters.cpp:
* UIProcess/API/APIPageConfiguration.cpp:
* UIProcess/API/C/WKApplicationCacheManager.cpp:
(WKApplicationCacheManagerGetTypeID):
(WKApplicationCacheManagerGetApplicationCacheOrigins):
(WKApplicationCacheManagerDeleteEntriesForOrigin):
(WKApplicationCacheManagerDeleteAllEntries):
* UIProcess/API/C/WKAuthenticationDecisionListener.cpp:
(WKAuthenticationDecisionListenerGetTypeID):
(WKAuthenticationDecisionListenerUseCredential):
(WKAuthenticationDecisionListenerCancel):
(WKAuthenticationDecisionListenerRejectProtectionSpaceAndContinue):
* UIProcess/API/C/WKBackForwardListItemRef.cpp:
(WKBackForwardListItemGetTypeID):
(WKBackForwardListItemCopyURL):
(WKBackForwardListItemCopyTitle):
(WKBackForwardListItemCopyOriginalURL):
* UIProcess/API/C/WKContext.cpp:
(WKContextGetTypeID):
(WKContextCreate):
(WKContextCreateWithInjectedBundlePath):
(WKContextCreateWithConfiguration):
(WKContextSetClient):
(WKContextSetInjectedBundleClient):
(WKContextSetHistoryClient):
(WKContextSetDownloadClient):
(WKContextSetConnectionClient):
(WKContextDownloadURLRequest):
(WKContextResumeDownload):
(WKContextSetInitializationUserDataForInjectedBundle):
(WKContextPostMessageToInjectedBundle):
(WKContextGetGlobalStatistics):
(WKContextAddVisitedLink):
(WKContextClearVisitedLinks):
(WKContextSetCacheModel):
(WKContextGetCacheModel):
(WKContextSetMaximumNumberOfProcesses):
(WKContextGetMaximumNumberOfProcesses):
(WKContextSetAlwaysUsesComplexTextCodePath):
(WKContextSetShouldUseFontSmoothing):
(WKContextSetAdditionalPluginsDirectory):
(WKContextRefreshPlugIns):
(WKContextRegisterURLSchemeAsEmptyDocument):
(WKContextRegisterURLSchemeAsSecure):
(WKContextRegisterURLSchemeAsBypassingContentSecurityPolicy):
(WKContextRegisterURLSchemeAsCachePartitioned):
(WKContextRegisterURLSchemeAsCanDisplayOnlyIfCanRequest):
(WKContextSetDomainRelaxationForbiddenForURLScheme):
(WKContextSetCanHandleHTTPSServerTrustEvaluation):
(WKContextSetPrewarmsProcessesAutomatically):
(WKContextSetCustomWebContentServiceBundleIdentifier):
(WKContextSetDiskCacheSpeculativeValidationEnabled):
(WKContextPreconnectToServer):
(WKContextGetCookieManager):
(WKContextGetWebsiteDataStore):
(WKContextGetGeolocationManager):
(WKContextGetMediaSessionFocusManager):
(WKContextGetNotificationManager):
(WKContextStartMemorySampler):
(WKContextStopMemorySampler):
(WKContextAllowSpecificHTTPSCertificateForHost):
(WKContextDisableProcessTermination):
(WKContextEnableProcessTermination):
(WKContextSetHTTPPipeliningEnabled):
(WKContextWarmInitialProcess):
(WKContextGetStatistics):
(WKContextGetStatisticsWithOptions):
(WKContextJavaScriptConfigurationFileEnabled):
(WKContextSetJavaScriptConfigurationFileEnabled):
(WKContextGarbageCollectJavaScriptObjects):
(WKContextSetJavaScriptGarbageCollectorTimerEnabled):
(WKContextUseTestingNetworkSession):
(WKContextSetAllowsAnySSLCertificateForWebSocketTesting):
(WKContextSetAllowsAnySSLCertificateForServiceWorkerTesting):
(WKContextClearCachedCredentials):
(WKContextCopyPlugInAutoStartOriginHashes):
(WKContextSetPlugInAutoStartOriginHashes):
(WKContextSetPlugInAutoStartOriginsFilteringOutEntriesAddedAfterTime):
(WKContextSetPlugInAutoStartOrigins):
(WKContextSetInvalidMessageFunction):
(WKContextSetMemoryCacheDisabled):
(WKContextSetFontWhitelist):
(WKContextTerminateNetworkProcess):
(WKContextTerminateServiceWorkerProcess):
(WKContextGetNetworkProcessIdentifier):
(WKContextAddSupportedPlugin):
(WKContextClearSupportedPlugins):
(WKContextSetIDBPerOriginQuota):
* UIProcess/API/C/WKPage.cpp:
(WKPageLoadURLWithShouldOpenExternalURLsPolicy):
(WKPageLoadURLWithUserData):
(WKPageLoadURLRequestWithUserData):
(WKPageSetPaginationMode):
(WKPageGetPaginationMode):
(WKPageSetPageLoaderClient):
(WKPageSetPagePolicyClient):
* UIProcess/API/C/cg/WKIconDatabaseCG.cpp:

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