WebKit-https.git
11 months ago[WPE][Qt] loadingChanged signal parameter is unusable
philn@webkit.org [Fri, 30 Aug 2019 08:29:41 +0000 (08:29 +0000)]
[WPE][Qt] loadingChanged signal parameter is unusable
https://bugs.webkit.org/show_bug.cgi?id=201301

Reviewed by Carlos Garcia Campos.

Source/WebKit:

* UIProcess/API/wpe/qt/WPEQtView.h: Explicitely name signal
parameter. It is a runtime requirement for QML.

Tools:

* MiniBrowser/wpe/qt/main.qml: Add a basic loadingChange signal handler.
* Scripts/webkitpy/style/checker.py: White-list WPEQtView.h for
readablity/parameter_name code styl checker rule.

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

11 months ago[JSC] DFG inlining CheckBadCell slow path does not assume result VirtualRegister...
ysuzuki@apple.com [Fri, 30 Aug 2019 08:13:15 +0000 (08:13 +0000)]
[JSC] DFG inlining CheckBadCell slow path does not assume result VirtualRegister can be invalid
https://bugs.webkit.org/show_bug.cgi?id=201332

Reviewed by Mark Lam.

JSTests:

This test is very flaky, it is hard to reproduce.

* stress/setter-inlining-resulting-bad-cell-result-virtual-register-should-be-invalid.js: Added.
(code):

Source/JavaScriptCore:

When inlining setter calls in DFG, result VirtualRegister becomes invalid one. While other call-related DFG code correctly assumes
that `result` may be invalid, only CheckBadCell slow path missed this case. Since this is OSR exit path and VirtualRegister result
does not exist, set BottomValue only when "result" is valid as the other DFG code is doing.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleInlining):

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

11 months ago[wk2] LayoutTest imported/w3c/web-platform-tests/IndexedDB/fire-error-event-exception...
sihui_liu@apple.com [Fri, 30 Aug 2019 07:50:14 +0000 (07:50 +0000)]
[wk2] LayoutTest imported/w3c/web-platform-tests/IndexedDB/fire-error-event-exception.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=169621

Reviewed by Alex Christensen.

Source/WebCore:

Event handlers of IDB objects were called in unexpected order because of race, which made the console messages
in the tests come out of order.
Usually, an operation/request result is handled as follows:
1. IDBServer sends IDBResultData to IDBClient.
2. IDBClient receives IDBResultData and finishes a IDBTransaction operation with that result.
3. IDBTransaction schedules operation completed timer.
4. (Some time later) Timer fires, and IDBTransaction completes a request with the result and dispatches event.
5. (Some time later) IDBTransaction is notified that event is dispatched. If there are other results received,
IDBTransaction schedules operation completed timer.

In previous implementation, if the IDBClient received a second IDBResultData for the same IDBTransaction between
step 3 and step 4, it would not schedule timer because timer was still active; if it received the result between
step 4 and step 5, it would schedule timer again.

Consider a flow like this:
result1 of transaction1 received, timer of transaction1 scheduled
result2 of transaction2 received, timer of transaction2 scheduled
result3 of transaction1 is received, timer of transaction1 active so no scheduling
timer of transaction1 fired, event1 to be dispatched to request1
timer of transaction2 fired, event2 to be dispatched to request2
result4 of transaction2 received, timer of transaction2 scheduled
event1 dispatched, timer of transaction1 scheduled (for handling result3)
event2 dispatched, timer of transaction2 active so no scheduling
timer of transaction2 fired, event3 to dispatch to request4
timer of transaction1 fired, event4 to dispatch to request3

request4 would get event before request3, though result3 was received before result4. We should stop scheduling
event if an IDBTransaction is in between step 4 and 5, which means its m_currentlyCompletingRequest is not null.

* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::operationCompletedOnServer):

LayoutTests:

Update test expectations to PASS.

* platform/gtk/TestExpectations:
* platform/ios-wk2/TestExpectations:
* platform/mac-wk2/TestExpectations:

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

11 months agoWeb Inspector: Debugger: async event listener stack traces should be available in...
drousso@apple.com [Fri, 30 Aug 2019 06:56:06 +0000 (06:56 +0000)]
Web Inspector: Debugger: async event listener stack traces should be available in Workers
https://bugs.webkit.org/show_bug.cgi?id=200903

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/agents/InspectorDebuggerAgent.h:
(Inspector::InspectorDebuggerAgent::enabled): Added.
* inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::InspectorDebuggerAgent::willDestroyFrontendAndBackend):
(Inspector::InspectorDebuggerAgent::enable):
(Inspector::InspectorDebuggerAgent::disable):
Allow subclasses to extend what it means for the `InspectorDebuggerAgent` to be `enabled`.

Source/WebCore:

Tests: inspector/worker/dom-debugger-event-interval-breakpoints.html
       inspector/worker/dom-debugger-event-listener-breakpoints.html
       inspector/worker/dom-debugger-event-timeout-breakpoints.html
       inspector/worker/dom-debugger-url-breakpoints.html

* inspector/agents/WebDebuggerAgent.h:
* inspector/agents/WebDebuggerAgent.cpp:
(WebCore::WebDebuggerAgent::enabled const): Added.
(WebCore::WebDebuggerAgent::enable):
(WebCore::WebDebuggerAgent::disable):
(WebCore::WebDebuggerAgent::didAddEventListener): Added.
(WebCore::WebDebuggerAgent::willRemoveEventListener): Added.
(WebCore::WebDebuggerAgent::willHandleEvent): Added.
(WebCore::WebDebuggerAgent::didPostMessage): Added.
(WebCore::WebDebuggerAgent::didFailPostMessage): Added.
(WebCore::WebDebuggerAgent::willDispatchPostMessage): Added.
(WebCore::WebDebuggerAgent::didDispatchPostMessage): Added.
(WebCore::WebDebuggerAgent::didClearAsyncStackTraceData): Added.
* inspector/agents/page/PageDebuggerAgent.h:
* inspector/agents/page/PageDebuggerAgent.cpp:
(WebCore::PageDebuggerAgent::enabled const): Added.
(WebCore::PageDebuggerAgent::enable):
(WebCore::PageDebuggerAgent::disable):
(WebCore::PageDebuggerAgent::didClearAsyncStackTraceData): Deleted.
(WebCore::PageDebuggerAgent::didAddEventListener): Deleted.
(WebCore::PageDebuggerAgent::willRemoveEventListener): Deleted.
(WebCore::PageDebuggerAgent::willHandleEvent): Deleted.
(WebCore::PageDebuggerAgent::didPostMessage): Deleted.
(WebCore::PageDebuggerAgent::didFailPostMessage): Deleted.
(WebCore::PageDebuggerAgent::willDispatchPostMessage): Deleted.
(WebCore::PageDebuggerAgent::didDispatchPostMessage): Deleted.
Move various `InspectorInstrumentation` calls from `PageDebuggerAgent` to `WebDebuggerAgent`
so that `WorkerDebuggerAgent` also inherits them.

* inspector/InstrumentingAgents.h:
(WebCore::InstrumentingAgents::webDebuggerAgent const): Added.
(WebCore::InstrumentingAgents::setWebDebuggerAgent): Added.
(WebCore::InstrumentingAgents::inspectorDebuggerAgent const): Deleted.
(WebCore::InstrumentingAgents::setInspectorDebuggerAgent): Deleted.
* inspector/InstrumentingAgents.cpp:
(WebCore::InstrumentingAgents::reset):
* inspector/agents/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::mainFrameStartedLoading):
(WebCore::InspectorTimelineAgent::startProgrammaticCapture):
(WebCore::InspectorTimelineAgent::stopProgrammaticCapture):
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didClearWindowObjectInWorldImpl):
(WebCore::InspectorInstrumentation::isDebuggerPausedImpl):
(WebCore::InspectorInstrumentation::didInstallTimerImpl):
(WebCore::InspectorInstrumentation::didRemoveTimerImpl):
(WebCore::InspectorInstrumentation::didAddEventListenerImpl):
(WebCore::InspectorInstrumentation::willRemoveEventListenerImpl):
(WebCore::InspectorInstrumentation::didPostMessageImpl):
(WebCore::InspectorInstrumentation::didFailPostMessageImpl):
(WebCore::InspectorInstrumentation::willDispatchPostMessageImpl):
(WebCore::InspectorInstrumentation::didDispatchPostMessageImpl):
(WebCore::InspectorInstrumentation::willHandleEventImpl):
(WebCore::InspectorInstrumentation::didHandleEventImpl):
(WebCore::InspectorInstrumentation::willFireTimerImpl):
(WebCore::InspectorInstrumentation::didFireTimerImpl):
(WebCore::InspectorInstrumentation::scriptExecutionBlockedByCSPImpl):
(WebCore::InspectorInstrumentation::didCommitLoadImpl):
(WebCore::InspectorInstrumentation::frameStartedLoadingImpl):
(WebCore::InspectorInstrumentation::frameStoppedLoadingImpl):
(WebCore::InspectorInstrumentation::addMessageToConsoleImpl):
(WebCore::InspectorInstrumentation::didRequestAnimationFrameImpl):
(WebCore::InspectorInstrumentation::didCancelAnimationFrameImpl):
(WebCore::InspectorInstrumentation::willFireAnimationFrameImpl):
(WebCore::InspectorInstrumentation::didFireAnimationFrameImpl):
Replace `inspectorDebuggerAgent` with `webDebuggerAgent` so the right instrumentation hooks
are available.

LayoutTests:

* inspector/worker/dom-debugger-event-interval-breakpoints-expected.txt:
* inspector/worker/dom-debugger-event-listener-breakpoints-expected.txt:
* inspector/worker/dom-debugger-event-timeout-breakpoints-expected.txt:
* inspector/worker/dom-debugger-url-breakpoints-expected.txt:
* inspector/worker/resources/worker-dom-debugger.js:

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

11 months agoRemove HAVE_PASSKIT_GRANULAR_ERRORS conditional
krollin@apple.com [Fri, 30 Aug 2019 05:00:15 +0000 (05:00 +0000)]
Remove HAVE_PASSKIT_GRANULAR_ERRORS conditional
https://bugs.webkit.org/show_bug.cgi?id=201278
<rdar://problem/54821052>

Reviewed by Alex Christensen.

HAVE_PASSKIT_GRANULAR_ERRORS is always True, so remove the conditional
tests, keeping the True branches and removing the False branches.

Source/WebCore/PAL:

* pal/cocoa/PassKitSoftLink.h:
* pal/cocoa/PassKitSoftLink.mm:

Source/WebKit:

* Platform/cocoa/PaymentAuthorizationPresenter.mm:
(WebKit::PaymentAuthorizationPresenter::completePaymentSession):
(WebKit::PaymentAuthorizationPresenter::completeShippingContactSelection):
* Platform/cocoa/PaymentAuthorizationViewController.mm:
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didAuthorizePayment:completion:]): Deleted.
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:completion:]): Deleted.
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:completion:]): Deleted.
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:completion:]): Deleted.
* Platform/cocoa/WKPaymentAuthorizationDelegate.h:
* Platform/cocoa/WKPaymentAuthorizationDelegate.mm:
(-[WKPaymentAuthorizationDelegate completePaymentMethodSelection:]):
(-[WKPaymentAuthorizationDelegate completePaymentSession:errors:didReachFinalState:]):
(-[WKPaymentAuthorizationDelegate completeShippingContactSelection:summaryItems:shippingMethods:errors:]):
(-[WKPaymentAuthorizationDelegate completeShippingMethodSelection:]):
* Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
(WebKit::toPKContactFields):
(WebKit::toNSSet):
(WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest):
(WebKit::toPKAddressField): Deleted.

Source/WTF:

* wtf/FeatureDefines.h:

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

11 months agoAdd "IsolatedCopy" in the name of String getters that call isolatedCopy() on the...
cdumez@apple.com [Fri, 30 Aug 2019 04:35:58 +0000 (04:35 +0000)]
Add "IsolatedCopy" in the name of String getters that call isolatedCopy() on the string
https://bugs.webkit.org/show_bug.cgi?id=201318

Reviewed by Alex Christensen.

Add "IsolatedCopy" in the name of String getters that call isolatedCopy() on the string, for clarity.

Source/WebCore:

* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::createBackingStore):
(WebCore::IDBServer::IDBServer::performGetAllDatabaseNames):
(WebCore::IDBServer::IDBServer::removeDatabasesModifiedSinceForVersion):
(WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesModifiedSince):
(WebCore::IDBServer::IDBServer::removeDatabasesWithOriginsForVersion):
(WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesForOrigins):
(WebCore::IDBServer::IDBServer::computeSpaceUsedForOrigin):
(WebCore::IDBServer::IDBServer::upgradeFilesIfNecessary):
* Modules/indexeddb/server/IDBServer.h:
(WebCore::IDBServer::IDBServer::databaseDirectoryPathIsolatedCopy const):
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::fullDatabaseDirectoryWithUpgrade):
(WebCore::IDBServer::SQLiteIDBBackingStore::databasesSizeForOrigin const):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:
(WebCore::IDBServer::SQLiteIDBBackingStore::databaseRootDirectoryIsolatedCopy const):
* Modules/webdatabase/Database.cpp:
(WebCore::Database::markAsDeletedAndClose):
(WebCore::Database::stringIdentifierIsolatedCopy const):
(WebCore::Database::displayNameIsolatedCopy const):
(WebCore::Database::expectedVersionIsolatedCopy const):
(WebCore::Database::fileNameIsolatedCopy const):
(WebCore::Database::details const):
(WebCore::Database::didCommitWriteTransaction):
(WebCore::Database::didExceedQuota):
* Modules/webdatabase/Database.h:
* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::maximumSize):
(WebCore::DatabaseTracker::doneCreatingDatabase):
(WebCore::DatabaseTracker::addOpenDatabase):
(WebCore::DatabaseTracker::removeOpenDatabase):
* Modules/webdatabase/SQLError.h:
(WebCore::SQLError::messageIsolatedCopy const):
* Modules/webdatabase/SQLError.idl:
* Modules/webdatabase/SQLTransaction.cpp:
(WebCore::SQLTransaction::openTransactionAndPreflight):
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::RegistrationDatabase::openSQLiteDatabase):
(WebCore::RegistrationDatabase::clearAll):
* workers/service/server/RegistrationDatabase.h:
(WebCore::RegistrationDatabase::databaseDirectoryIsolatedCopy const):

Source/WebKit:

* NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp:
(WebKit::ResourceLoadStatisticsPersistentStorage::storageDirectoryPathIsolatedCopy const):
(WebKit::ResourceLoadStatisticsPersistentStorage::resourceLogFilePath const):
(WebKit::ResourceLoadStatisticsPersistentStorage::monitorDirectoryForNewStatistics):
* NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.h:
* NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
(WebKit::NetworkCache::BlobStorage::blobDirectoryPathIsolatedCopy const):
(WebKit::NetworkCache::BlobStorage::synchronize):
(WebKit::NetworkCache::BlobStorage::blobPathForHash const):
* NetworkProcess/cache/NetworkCacheBlobStorage.h:
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::Storage::basePathIsolatedCopy const):
(WebKit::NetworkCache::Storage::versionPath const):
(WebKit::NetworkCache::Storage::recordsPathIsolatedCopy const):
(WebKit::NetworkCache::Storage::synchronize):
(WebKit::NetworkCache::Storage::recordDirectoryPathForKey const):
(WebKit::NetworkCache::Storage::traverse):
(WebKit::NetworkCache::Storage::clear):
(WebKit::NetworkCache::Storage::shrink):
(WebKit::NetworkCache::Storage::deleteOldVersions):
* NetworkProcess/cache/NetworkCacheStorage.h:

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

11 months agoUpdate .xcconfig symbols to reflect the current set of past and future product versions.
krollin@apple.com [Fri, 30 Aug 2019 04:18:29 +0000 (04:18 +0000)]
Update .xcconfig symbols to reflect the current set of past and future product versions.
https://bugs.webkit.org/show_bug.cgi?id=200720
<rdar://problem/54305032>

Reviewed by Alex Christensen.

Remove version symbols related to old OS's we no longer support,
ensure that version symbols are defined for OS's we do support.

PerformanceTests:

* MediaTime/Configurations/Base.xcconfig:
* MediaTime/Configurations/DebugRelease.xcconfig:

Source/bmalloc:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:

Source/JavaScriptCore:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
* Configurations/Version.xcconfig:

Source/ThirdParty:

* gtest/xcode/Config/DebugProject.xcconfig:
* gtest/xcode/Config/ReleaseProject.xcconfig:

Source/ThirdParty/ANGLE:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:

Source/ThirdParty/libwebrtc:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
* Configurations/Version.xcconfig:

Source/WebCore:

No new tests -- no new or changed functionality.

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
* Configurations/Version.xcconfig:

Source/WebCore/PAL:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
* Configurations/Version.xcconfig:

Source/WebInspectorUI:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
* Configurations/Version.xcconfig:

Source/WebKit:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
* Configurations/Version.xcconfig:

Source/WebKitLegacy/mac:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
* Configurations/Version.xcconfig:

Source/WTF:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:

Tools:

* ContentExtensionTester/Configurations/Base.xcconfig:
* ContentExtensionTester/Configurations/DebugRelease.xcconfig:
* DumpRenderTree/mac/Configurations/Base.xcconfig:
* DumpRenderTree/mac/Configurations/DebugRelease.xcconfig:
* ImageDiff/cg/Configurations/Base.xcconfig:
* ImageDiff/cg/Configurations/DebugRelease.xcconfig:
* MiniBrowser/Configurations/Base.xcconfig:
* MiniBrowser/Configurations/DebugRelease.xcconfig:
* TestWebKitAPI/Configurations/Base.xcconfig:
* TestWebKitAPI/Configurations/DebugRelease.xcconfig:
* WebEditingTester/Configurations/Base.xcconfig:
* WebEditingTester/Configurations/DebugRelease.xcconfig:
* WebKitTestRunner/Configurations/Base.xcconfig:
* WebKitTestRunner/Configurations/DebugRelease.xcconfig:
* lldb/lldbWebKitTester/Configurations/Base.xcconfig:
* lldb/lldbWebKitTester/Configurations/DebugRelease.xcconfig:

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

11 months agoRemove empty FontCache.cpp file in TestWebKitAPI
krollin@apple.com [Fri, 30 Aug 2019 04:16:22 +0000 (04:16 +0000)]
Remove empty FontCache.cpp file in TestWebKitAPI
https://bugs.webkit.org/show_bug.cgi?id=201277
<rdar://problem/54820726>

Reviewed by Alex Christensen.

Bug 200694 emptied out the contents of FontCache.cpp. This patch
removes the file from the project.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebCore/FontCache.cpp: Removed.

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

11 months ago[JSC] Repatch should construct CallCases and CasesValue at the same time
ysuzuki@apple.com [Fri, 30 Aug 2019 03:28:20 +0000 (03:28 +0000)]
[JSC] Repatch should construct CallCases and CasesValue at the same time
https://bugs.webkit.org/show_bug.cgi?id=201325

Reviewed by Saam Barati.

JSTests:

* stress/repatch-switch.js: Added.
(main.f2.f0):
(main.f2.f3):
(main.f2.f1):
(main.f2):
(main):

Source/JavaScriptCore:

In linkPolymorphicCall, we should create callCases and casesValue at the same time to assert `callCases.size() == casesValue.size()`.
If the call variant is isClosureCall and InternalFunction, we skip adding it to casesValue. So we should not add this variant to callCases too.

* jit/Repatch.cpp:
(JSC::linkPolymorphicCall):

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

11 months agoAvoid running the outline painting phase if no renderers have outlines
simon.fraser@apple.com [Fri, 30 Aug 2019 02:35:34 +0000 (02:35 +0000)]
Avoid running the outline painting phase if no renderers have outlines
https://bugs.webkit.org/show_bug.cgi?id=201284

Reviewed by Said Abou-Hallawa.

The outline painting phase (paintOutlineForFragments()) can take up to 20% of the painting time
even when there are no outlines. Keep track of which renderers have outlines, and only run the phase
when printing (for hasOutlineAnnotation()) or if there are any renderers with outlines.

* rendering/RenderElement.cpp:
(WebCore::RenderElement::styleWillChange):
(WebCore::RenderElement::styleDidChange):
(WebCore::RenderElement::willBeDestroyed):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintLayerContents):
* rendering/RenderView.h:

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

11 months agoInvalid XPCServices symlinks are being created
krollin@apple.com [Fri, 30 Aug 2019 01:57:01 +0000 (01:57 +0000)]
Invalid XPCServices symlinks are being created
https://bugs.webkit.org/show_bug.cgi?id=201320
<rdar://problem/54719612>

Reviewed by Dan Bernstein.

When performing incremental builds, errant XPCServices symlinks can be
created. For example, in the following, the second symlink is the
correct one. The first symlink gets created when the build process
tries to create the symlink and it already exists. When it already
exists, the command to create the symlink actually follows the
existing symlink and creates the (second) symlink at the location
where the first symlink points.

    WebKit.framework/Versions/A/XPCServices/XPCServices@ -> Versions/Current/XPCServices
    WebKit.framework/XPCServices@ -> Versions/Current/XPCServices

Address this by specifying -h to the `ln` command, which will cause it
to not follow symlinks if they already exist at the target.

Also, fix a benign issue where the Xcode build variable WRAPPER_NAME
was being referenced in a context where it wasn't defined.

* WebKit.xcodeproj/project.pbxproj:

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

11 months agoCopying and pasting two paragraphs with a newline between them results in stray parag...
timothy@apple.com [Fri, 30 Aug 2019 01:40:58 +0000 (01:40 +0000)]
Copying and pasting two paragraphs with a newline between them results in stray paragraph with newline inside.
https://bugs.webkit.org/show_bug.cgi?id=201306

Reviewed by Wenson Hsieh.

Source/WebCore:

Test: editing/pasteboard/paste-without-nesting.html

* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::moveNodeOutOfAncestor): Consider the ancestor node safe to remove
if there is no rendered text inside, not just if there are any child nodes.

LayoutTests:

* editing/pasteboard/paste-without-nesting-expected.txt: Updated results.
* editing/pasteboard/paste-without-nesting.html: Added new test case.

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

11 months ago[JSC] ObjectAllocationSinkingPhase wrongly deals with always-taken branches during...
ysuzuki@apple.com [Fri, 30 Aug 2019 01:30:29 +0000 (01:30 +0000)]
[JSC] ObjectAllocationSinkingPhase wrongly deals with always-taken branches during interpretation
https://bugs.webkit.org/show_bug.cgi?id=198650

Reviewed by Saam Barati.

JSTests:

* stress/object-allocation-sinking-interpretation-can-interpret-edges-that-can-be-proven-unreachable-in-ai.js:
(main.v0):
(main):

Source/JavaScriptCore:

Object Allocation Sinking phase has a lightweight abstract interpreter which interprets DFG nodes related to allocations and properties.
This interpreter is lightweight since it does not track abstract values and conditions as deeply as AI does. It can happen that this
interpreter interpret the control-flow edge that AI proved that is never taken.
AI already knows some control-flow edges are never taken, and based on this information, AI can remove CheckStructure nodes. But
ObjectAllocationSinking phase can trace this never-taken edges and propagate structure information that contradicts to the analysis
done in ObjectAllocationSinking.

Let's see the example.

    BB#0
        35: NewObject([%AM:Object])
        ...
        47: Branch(ConstantTrue, T:#1, F:#2)

    BB#1 // This basic block is never taken due to @47's jump.
        ...
        71: PutByOffset(@35, @66, id2{a}, 0, W:NamedProperties(2))
        72: PutStructure(@35, %AM:Object -> %Dx:Object, ID:60066)
        ...
        XX: Jump(#2)

    BB#2
        ...
        92: CheckStructure(@35, [%Dx:Object])
        93: PutByOffset(@35, @35, id2{a}, 0, W:NamedProperties(2))
        ...

AI removes @92 because AI knows BB#0 only takes BB#1 branch. @35's Structure is always %Dx so @92 is redundant.
AI proved that @71 and @72 are always executed while BB#0 -> BB#2 edge is never taken so that @35 object's structure is proven at @92.
After AI removes @92, ObjectAllocationSinking starts looking into this graph.

    BB#0
        35: NewObject([%AM:Object])
        ...
        47: Branch(ConstantTrue, T:#1, F:#2)

    BB#1 // This basic block is never taken due to @47's jump.
        ...
        71: PutByOffset(@35, @66, id2{a}, 0, W:NamedProperties(2))
        72: PutStructure(@35, %AM:Object -> %Dx:Object, ID:60066)
        ...
        XX: Jump(#2)

    BB#2
        ...
        93: PutByOffset(@35, @35, id2{a}, 0, W:NamedProperties(2))
        ...
        YY: Jump(#3)

    BB#3
        ...
        ZZ: <HERE> want to materialize @35's sunk object.

Since AI does not change the @47 Branch to Jump (it is OK anyway), BB#0 -> BB#2 edge remains and ObjectAllocationSinking phase propagates information in
BB#0's %AM structure information to BB#2. ObjectAllocationSinking phase converts @35 to PhantomNewObject, removes PutByOffset and PutStructure, and
insert MaterializeNewObject in @ZZ. At this point, ObjectAllocationSinking lightweight interpreter gets two structures while AI gets one: @35's original
one (%AM) and @72's replaced one (%Dx). Since AI already proved @ZZ only gets %Dx, AI removed @92 CheckStructure. But this is not known to ObjectAllocationSinking
phase's interpretation. So when creating recovery data, MultiPutByOffset includes two structures, %AM and %Dx. This is OK since MultiPutByOffset takes
conservative set of structures and performs switching. But the problem here is that %AM's id2{a} offset is -1 since %AM does not have such a property.
So when creating MultiPutByOffset in ObjectAllocationSinking, we accidentally create MultiPutByOffset with -1 offset data, and lowering phase hits the debug
assertion.

    187: MultiPutByOffset(@138, @138, id2{a}, <Replace: [%AM:Object], offset = -1, >, <Replace: [%Dx:Object], offset = 0, >)

This bug is harmless since %AM structure comparison never meets at runtime. But we are not considering the case including `-1` offset property in MultiPutByOffset data.
In this patch, we just filter out apparently wrong structures when creating MultiPutByOffset in ObjectAllocationSinking. This is OK since it never comes at runtime.

* dfg/DFGObjectAllocationSinkingPhase.cpp:

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

11 months agoWeb Inspector: DOMDebugger: support event breakpoints in Worker contexts
drousso@apple.com [Fri, 30 Aug 2019 01:08:03 +0000 (01:08 +0000)]
Web Inspector: DOMDebugger: support event breakpoints in Worker contexts
https://bugs.webkit.org/show_bug.cgi?id=200651

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/protocol/DOMDebugger.json:
Make the domain available in "worker" contexts as well.

Source/WebCore:

Tests: inspector/worker/dom-debugger-dom-breakpoints.html
       inspector/worker/dom-debugger-event-animation-frame-breakpoints.html
       inspector/worker/dom-debugger-event-interval-breakpoints.html
       inspector/worker/dom-debugger-event-listener-breakpoints.html
       inspector/worker/dom-debugger-event-timeout-breakpoints.html
       inspector/worker/dom-debugger-url-breakpoints.html

* inspector/agents/InspectorDOMDebuggerAgent.h:
* inspector/agents/InspectorDOMDebuggerAgent.cpp:
(WebCore::InspectorDOMDebuggerAgent::InspectorDOMDebuggerAgent):
(WebCore::InspectorDOMDebuggerAgent::enabled const):
(WebCore::InspectorDOMDebuggerAgent::enable):
(WebCore::InspectorDOMDebuggerAgent::disable):
(WebCore::InspectorDOMDebuggerAgent::debuggerWasEnabled):
(WebCore::InspectorDOMDebuggerAgent::debuggerWasDisabled):
(WebCore::InspectorDOMDebuggerAgent::setEventBreakpoint):
(WebCore::InspectorDOMDebuggerAgent::removeEventBreakpoint):
(WebCore::InspectorDOMDebuggerAgent::~InspectorDOMDebuggerAgent): Deleted.
(WebCore::InspectorDOMDebuggerAgent::frameDocumentUpdated): Deleted.
(WebCore::InspectorDOMDebuggerAgent::willInvalidateStyleAttr): Deleted.
(WebCore::InspectorDOMDebuggerAgent::didInsertDOMNode): Deleted.
(WebCore::InspectorDOMDebuggerAgent::didRemoveDOMNode): Deleted.
(WebCore::domTypeForName): Deleted.
(WebCore::domTypeName): Deleted.
(WebCore::InspectorDOMDebuggerAgent::setDOMBreakpoint): Deleted.
(WebCore::InspectorDOMDebuggerAgent::removeDOMBreakpoint): Deleted.
(WebCore::InspectorDOMDebuggerAgent::willInsertDOMNode): Deleted.
(WebCore::InspectorDOMDebuggerAgent::willRemoveDOMNode): Deleted.
(WebCore::InspectorDOMDebuggerAgent::willModifyDOMAttr): Deleted.
(WebCore::InspectorDOMDebuggerAgent::descriptionForDOMEvent): Deleted.
(WebCore::InspectorDOMDebuggerAgent::hasBreakpoint): Deleted.
(WebCore::InspectorDOMDebuggerAgent::updateSubtreeBreakpoints): Deleted.
(WebCore::InspectorDOMDebuggerAgent::willFireAnimationFrame): Deleted.
* inspector/agents/page/PageDOMDebuggerAgent.h: Added.
* inspector/agents/page/PageDOMDebuggerAgent.cpp: Added.
(WebCore::domTypeForName):
(WebCore::domTypeName):
(WebCore::PageDOMDebuggerAgent::PageDOMDebuggerAgent):
(WebCore::PageDOMDebuggerAgent::enabled const):
(WebCore::PageDOMDebuggerAgent::enable):
(WebCore::PageDOMDebuggerAgent::disable):
(WebCore::PageDOMDebuggerAgent::setDOMBreakpoint):
(WebCore::PageDOMDebuggerAgent::removeDOMBreakpoint):
(WebCore::PageDOMDebuggerAgent::frameDocumentUpdated):
(WebCore::PageDOMDebuggerAgent::willInsertDOMNode):
(WebCore::PageDOMDebuggerAgent::didInsertDOMNode):
(WebCore::PageDOMDebuggerAgent::willRemoveDOMNode):
(WebCore::PageDOMDebuggerAgent::didRemoveDOMNode):
(WebCore::PageDOMDebuggerAgent::willModifyDOMAttr):
(WebCore::PageDOMDebuggerAgent::willFireAnimationFrame):
(WebCore::PageDOMDebuggerAgent::willInvalidateStyleAttr):
(WebCore::PageDOMDebuggerAgent::setAnimationFrameBreakpoint):
(WebCore::PageDOMDebuggerAgent::descriptionForDOMEvent):
(WebCore::PageDOMDebuggerAgent::updateSubtreeBreakpoints):
(WebCore::PageDOMDebuggerAgent::hasBreakpoint):
* inspector/agents/worker/WorkerDOMDebuggerAgent.h: Added.
* inspector/agents/worker/WorkerDOMDebuggerAgent.cpp: Added.
(WebCore::WorkerDOMDebuggerAgent::WorkerDOMDebuggerAgent):
(WebCore::WorkerDOMDebuggerAgent::setDOMBreakpoint):
(WebCore::WorkerDOMDebuggerAgent::removeDOMBreakpoint):
(WebCore::WorkerDOMDebuggerAgent::setAnimationFrameBreakpoint):
Split the `InspectorDOMDebuggerAgent` into two subclasses depending on the inspected target
type, as certain `DOMDebugger` commands don't make sense for a `Worker` context:
 - DOM breakpoints, as there is no DOM in a `Worker` context
 - animation frame event breakpoints, as there is no `requestAnimationFrame` function

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

* inspector/InstrumentingAgents.h:
(WebCore::InstrumentingAgents::pageDOMDebuggerAgent const): Added.
(WebCore::InstrumentingAgents::setPageDOMDebuggerAgent): Added.
* inspector/InstrumentingAgents.cpp:
(WebCore::InstrumentingAgents::reset):

* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::willInsertDOMNodeImpl):
(WebCore::InspectorInstrumentation::didInsertDOMNodeImpl):
(WebCore::InspectorInstrumentation::willRemoveDOMNodeImpl):
(WebCore::InspectorInstrumentation::didRemoveDOMNodeImpl):
(WebCore::InspectorInstrumentation::willModifyDOMAttrImpl):
(WebCore::InspectorInstrumentation::willInvalidateStyleAttrImpl):
(WebCore::InspectorInstrumentation::frameDocumentUpdatedImpl):
(WebCore::InspectorInstrumentation::willFireAnimationFrameImpl):

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

Source/WebInspectorUI:

* UserInterface/Controllers/DOMDebuggerManager.js:
(WI.DOMDebuggerManager.prototype._updateDOMBreakpoint):
(WI.DOMDebuggerManager.prototype._updateEventBreakpoint):
Add assertions when adding/removing DOM breakpoints or animation frame event breakpoints if
the target is a `WI.WorkerTarget`, as neither are supported by `Worker`s.

LayoutTests:

* inspector/worker/dom-debugger-dom-breakpoints.html: Added.
* inspector/worker/dom-debugger-dom-breakpoints-expected.txt: Added.
* inspector/worker/dom-debugger-event-animation-frame-breakpoints.html: Added.
* inspector/worker/dom-debugger-event-animation-frame-breakpoints-expected.txt: Added.
* inspector/worker/dom-debugger-event-interval-breakpoints.html: Added.
* inspector/worker/dom-debugger-event-interval-breakpoints-expected.txt: Added.
* inspector/worker/dom-debugger-event-listener-breakpoints.html: Added.
* inspector/worker/dom-debugger-event-listener-breakpoints-expected.txt: Added.
* inspector/worker/dom-debugger-event-timeout-breakpoints.html: Added.
* inspector/worker/dom-debugger-event-timeout-breakpoints-expected.txt: Added.
* inspector/worker/dom-debugger-url-breakpoints.html: Added.
* inspector/worker/dom-debugger-url-breakpoints-expected.txt: Added.

* inspector/debugger/resources/log-active-stack-trace.js: Added.
(TestPage.registerInitializer.window.logStackTrace): Added.
(TestPage.registerInitializer.window.logActiveStackTrace):

* inspector/worker/resources/dom-debugger-utilities.js: Added.
(TestPage.registerInitializer.InspectorTest.Worker.DOMDebugger.createWorkerTarget):
* inspector/worker/resources/worker-dom-debugger.js: Added.

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

11 months agoRemove 32-bit macOS support
krollin@apple.com [Fri, 30 Aug 2019 00:39:31 +0000 (00:39 +0000)]
Remove 32-bit macOS support
https://bugs.webkit.org/show_bug.cgi?id=201282
<rdar://problem/54821667>

Reviewed by Anders Carlsson.

WebKit doesn’t support 32-bit Mac any more, so remove checks and code
for that platform.

Source/JavaScriptCore:

* API/JSBase.h:
* runtime/VM.h:

Source/WTF:

* wtf/Platform.h:

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

11 months agoSpeculative loads should use the NetworkSession owning their Cache
commit-queue@webkit.org [Fri, 30 Aug 2019 00:17:41 +0000 (00:17 +0000)]
Speculative loads should use the NetworkSession owning their Cache
https://bugs.webkit.org/show_bug.cgi?id=201314

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

This provides a performance improvement when using non-default persistent WKWebsiteDataStores.

* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::NetworkSession):
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::open):
(WebKit::NetworkCache::Cache::Cache):
* NetworkProcess/cache/NetworkCache.h:
(WebKit::NetworkCache::Cache::sessionID const):
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
(WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):

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

11 months agoRemove CCBigNum fallback code
krollin@apple.com [Fri, 30 Aug 2019 00:02:11 +0000 (00:02 +0000)]
Remove CCBigNum fallback code
https://bugs.webkit.org/show_bug.cgi?id=201250
<rdar://problem/54814330>

Reviewed by Jiewen Tan.

Bug 184637 added support for CCRSAGetCRTComponents, falling back to
the older CCBigNum code if CCRSAGetCRTComponents was not available. We
now only support OS's that have CCRSAGetCRTComponents so remove the
fallback code.

Source/WebCore:

No new tests -- no new or changed functionality.

* crypto/CommonCryptoUtilities.cpp:
(WebCore::CCBigNum::CCBigNum): Deleted.
(WebCore::CCBigNum::~CCBigNum): Deleted.
(WebCore::CCBigNum::operator=): Deleted.
(WebCore::CCBigNum::data const): Deleted.
(WebCore::CCBigNum::operator- const): Deleted.
(WebCore::CCBigNum::operator% const): Deleted.
(WebCore::CCBigNum::inverse const): Deleted.
* crypto/CommonCryptoUtilities.h:
* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::getPrivateKeyComponents):

Source/WebCore/PAL:

* pal/spi/cocoa/CommonCryptoSPI.h:

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

11 months agoWeb Inspector: replace uses of `Array.prototype.concat` with `Array.prototype.push`
drousso@apple.com [Thu, 29 Aug 2019 23:56:12 +0000 (23:56 +0000)]
Web Inspector: replace uses of `Array.prototype.concat` with `Array.prototype.push`
https://bugs.webkit.org/show_bug.cgi?id=201082

Reviewed by Joseph Pecoraro.

Source/WebInspectorUI:

`x = x.concat(y)` is very slow, as `x` has to be fully copied in order to add `y` to it.
Introduce `Array.prototype.pushIterable`, which iterates the given `iterable` and adds each
item to the `this` array.

* UserInterface/Controllers/DOMDebuggerManager.js:
(WI.DOMDebuggerManager.prototype.get domBreakpoints):
(WI.DOMDebuggerManager.prototype.domBreakpointsInSubtree):
* UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
(WI.JavaScriptRuntimeCompletionProvider.completionControllerCompletionsNeeded.receivedPropertyNames):
* UserInterface/Models/CSSCompletions.js:
(WI.CSSCompletions):
* UserInterface/Models/CSSKeywordCompletions.js:
(WI.CSSKeywordCompletions.forProperty):
(WI.CSSKeywordCompletions.forProperty.addKeywordsForName):
(WI.CSSKeywordCompletions.forFunction):
* UserInterface/Models/Canvas.js:
(WI.Canvas.prototype.recordingProgress):
* UserInterface/Models/DOMNodeStyles.js:
(WI.DOMNodeStyles.prototype._updateStyleCascade):
(WI.DOMNodeStyles.prototype._collectStylesInCascadeOrder):
* UserInterface/Models/TimelineRecording.js:
(WI.TimelineRecording.prototype.get sourceCodeTimelines):
(WI.TimelineRecording.prototype.initializeCallingContextTrees):
* UserInterface/Protocol/RemoteObject.js:
(WI.RemoteObject.prototype._getPropertyDescriptorsResolver):
* UserInterface/Views/ConsoleMessageView.js:
(WI.ConsoleMessageView.prototype._appendMessageTextAndArguments):
* UserInterface/Views/ContentBrowser.js:
(WI.ContentBrowser.prototype.get currentRepresentedObjects):
* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype._visibleChildren):
* UserInterface/Views/DataGridNode.js:
(WI.DataGridNode.prototype.get filterableData):
* UserInterface/Views/HeapAllocationsTimelineView.js:
(WI.HeapAllocationsTimelineView.prototype.get selectionPathComponents):
* UserInterface/Views/IndexedDatabaseObjectStoreContentView.js:
(WI.IndexedDatabaseObjectStoreContentView.prototype._fetchMoreData.processEntries):
* UserInterface/Views/NavigationItem.js:
(WI.NavigationItem.prototype.get _classNames):
* UserInterface/Views/ObjectTreeView.js:
(WI.ObjectTreeView.prototype._updateProperties):
* UserInterface/Views/OpenResourceDialog.js:
(WI.OpenResourceDialog.prototype._addResourcesForFrame):
* UserInterface/Views/OverviewTimelineView.js:
(WI.OverviewTimelineView.prototype._loadExistingRecords):
* UserInterface/Views/ResourceCollectionContentView.js:
(WI.ResourceCollectionContentView.prototype.get navigationItems):
* UserInterface/Views/ResourceHeadersContentView.js:
(WI.ResourceHeadersContentView.prototype._perfomSearchOnKeyValuePairs):
* UserInterface/Views/ResourceSecurityContentView.js:
(WI.ResourceSecurityContentView.prototype._perfomSearchOnKeyValuePairs):
* UserInterface/Views/ScriptClusterTimelineView.js:
(WI.ScriptClusterTimelineView.prototype.get selectionPathComponents):
* UserInterface/Views/ScrubberNavigationItem.js:
(WI.ScrubberNavigationItem.prototype.get additionalClassNames):
* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype._addGradientTokens):
(WI.SpreadsheetStyleProperty.prototype._addColorTokens.pushPossibleColorToken):
(WI.SpreadsheetStyleProperty.prototype._addTimingFunctionTokens):
(WI.SpreadsheetStyleProperty.prototype._addVariableTokens):
* UserInterface/Views/TreeOutline.js:
(WI.TreeOutline.prototype.selfOrDescendant):
* UserInterface/Views/View.js:
(WI.View._visitViewTreeForLayout):

LayoutTests:

* inspector/unit-tests/array-utilities.html:
* inspector/unit-tests/array-utilities-expected.txt:
Add tests for added utility `Array.prototype.pushIterable`.

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

11 months ago[EWS] Increase status-bubble iframe width on bugzilla comment review page
aakash_jain@apple.com [Thu, 29 Aug 2019 22:35:17 +0000 (22:35 +0000)]
[EWS] Increase status-bubble iframe width on bugzilla comment review page
https://bugs.webkit.org/show_bug.cgi?id=201304

Reviewed by Jonathan Bedard.

* template/en/default/attachment/reviewform.html.tmpl: Increased the width from 400 to 700 pixels.

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

11 months ago[LFC][TFC] Initialize <tr> display boxes.
zalan@apple.com [Thu, 29 Aug 2019 22:32:43 +0000 (22:32 +0000)]
[LFC][TFC] Initialize <tr> display boxes.
https://bugs.webkit.org/show_bug.cgi?id=201232
<rdar://problem/54806789>

Reviewed by Antti Koivisto.

Set them as blank for now.

* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::initializeDisplayBoxToBlank const):
(WebCore::Layout::TableFormattingContext::layout const):
* layout/tableformatting/TableFormattingContext.h:
* layout/tableformatting/TableGrid.cpp:
(WebCore::Layout::TableGrid::Row::Row):
(WebCore::Layout::TableGrid::appendCell):
* layout/tableformatting/TableGrid.h:
(WebCore::Layout::TableGrid::Row::box const):

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

11 months ago[iOS 13] Caret does not appear in text field if the body element is translated comple...
wenson_hsieh@apple.com [Thu, 29 Aug 2019 22:17:46 +0000 (22:17 +0000)]
[iOS 13] Caret does not appear in text field if the body element is translated completely out of the viewport
https://bugs.webkit.org/show_bug.cgi?id=201287
<rdar://problem/54780864>

Reviewed by Tim Horton.

Source/WebKit:

During EditorState computation, we use the hidden editable element heuristic to determine whether we should
begin suppressing selection gestures and UI. Currently, we use the editable root of the selection range to
determine where in the layer tree we should start our ascent, in search of a completely transparent or
completely clipped container.

However, in the case where the selection is inside a focused text field, this causes us to walk up the layer
tree starting at the RenderLayer corresponding to the text field's inner contenteditable div, which is different
than the text field's enclosing RenderLayer in the case where the containing block is transformed, such that no
part of it is within the visible viewport. This scenario is exercised by the below test case, in which the caret
after transforming the body horizontally by -100vw is hidden due to a false positive in the hidden editable area
heuristic.

Fix this by starting the layer tree ascent from the enclosing layer of the text form control if applicable,
instead of the inner editable area under the shadow root of the form control.

Test: editing/selection/ios/show-selection-in-transformed-container.html

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::platformEditorState const):

LayoutTests:

Add a new layout test that covers this scenario. See WebKit ChangeLog for additional detail.

* editing/selection/ios/show-selection-in-transformed-container-expected.txt: Added.
* editing/selection/ios/show-selection-in-transformed-container.html: Added.

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

11 months agodocument.fonts.ready is resolved too quickly
youenn@apple.com [Thu, 29 Aug 2019 22:01:53 +0000 (22:01 +0000)]
document.fonts.ready is resolved too quickly
https://bugs.webkit.org/show_bug.cgi?id=174030
<rdar://problem/33083550>

Reviewed by Frédéric Wang.

LayoutTests/imported/w3c:

Test from https://github.com/web-platform-tests/wpt/pull/18489.

* web-platform-tests/fonts/ahem.css: Added.
(@font-face):
* web-platform-tests/infrastructure/assumptions/document-fonts-ready-expected.txt: Added.
* web-platform-tests/infrastructure/assumptions/document-fonts-ready.html: Added.

Source/WebCore:

As described in https://drafts.csswg.org/css-font-loading/#font-face-set-ready, the ready promise
is only fulfilled after layout operations complete and no additional font loads are necessary.

This patch implements this by notifying the FontFaceSet created for the document when the document
is finished loading. At that time, the promise will be resolved as soon as fonts are finished loading if any.

Test: imported/w3c/web-platform-tests/infrastructure/assumptions/document-fonts-ready.html

* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::optionalFontFaceSet):
* css/CSSFontSelector.h:
* css/FontFaceSet.cpp:
(WebCore::FontFaceSet::FontFaceSet):
(WebCore::FontFaceSet::startedLoading):
(WebCore::FontFaceSet::didFirstLayout):
(WebCore::FontFaceSet::completedLoading):
* css/FontFaceSet.h:
* dom/Document.cpp:
(WebCore::Document::implicitClose):

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

11 months ago[ews-app] Status bubble should only display important messages in pop-over
aakash_jain@apple.com [Thu, 29 Aug 2019 21:55:11 +0000 (21:55 +0000)]
[ews-app] Status bubble should only display important messages in pop-over
https://bugs.webkit.org/show_bug.cgi?id=201308

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-app/ews/views/statusbubble.py: Added various build-steps which are of low interest
to end-users in STEPS_TO_HIDE. If any of these steps fail, it will not be hidden.

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

11 months agoFlaky Test: svg/custom/tabindex-order.html
rniwa@webkit.org [Thu, 29 Aug 2019 21:51:22 +0000 (21:51 +0000)]
Flaky Test: svg/custom/tabindex-order.html
https://bugs.webkit.org/show_bug.cgi?id=201294

Reviewed by Chris Dumez.

Make the backward sequential navigation case more robust against platform differences.

* svg/custom/tabindex-order.html:

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

11 months ago[LFC][BFC] BlockFormattingContext::usedAvailableWidthForFloatAvoider should only...
zalan@apple.com [Thu, 29 Aug 2019 21:26:23 +0000 (21:26 +0000)]
[LFC][BFC] BlockFormattingContext::usedAvailableWidthForFloatAvoider should only be called on float avoiders.
https://bugs.webkit.org/show_bug.cgi?id=201238
<rdar://problem/54807663>

Reviewed by Antti Koivisto.

Make the horizontal available space logic for float avoiders more explicit/readable.

* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::usedAvailableWidthForFloatAvoider const):
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):

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

11 months agoWeb Inspector: REGRESSION (r248873): Debugger: pressing delete on a breakpoint will...
drousso@apple.com [Thu, 29 Aug 2019 20:50:24 +0000 (20:50 +0000)]
Web Inspector: REGRESSION (r248873): Debugger: pressing delete on a breakpoint will also delete any resource/element parent immediately before it in the list
https://bugs.webkit.org/show_bug.cgi?id=200939

Reviewed by Joseph Pecoraro.

* UserInterface/Views/DebuggerSidebarPanel.js:
(WI.DebuggerSidebarPanel.prototype._breakpointTreeOutlineDeleteTreeElement):
(WI.DebuggerSidebarPanel.prototype._handleBreakpointElementAddedOrRemoved):
(WI.DebuggerSidebarPanel.prototype._breakpointTreeOutlineDeleteTreeElement.checkIfSelectionAdjustmentNeeded): Deleted.
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel):
(WI.SourcesNavigationSidebarPanel.prototype._handleBreakpointElementAddedOrRemoved):
(WI.SourcesNavigationSidebarPanel.this._breakpointsTreeOutline.ondelete.checkIfSelectionAdjustmentNeeded): Deleted.
When the `WI.TreeOutline`'s own `ondelete` is called, that means we must be handling a
delete that was _not_ handled by a `WI.TreeElement`. This means that the `selectedTreeElement`
has to be a resource/script, the `window` object, or one of the non-deletable breakpoints.

In the case of a non-deletable breakpoint, since they're never removed from their parent
`WI.TreeOutline`, we just shift the selection to the next selectable `WI.TreeElement`.

Otherwise, wait for the `WI.TreeOutline.Event.ElementRemoved` event to be fired, and adjust
the selection then based on whether the new `selectedTreeElement` is one of the "top" items,
namely the "All Exceptions", "Uncaught Exceptions", and "Assertion Failures" breakpoints.

* UserInterface/Views/BreakpointTreeElement.js:
(WI.BreakpointTreeElement.prototype.ondelete):
* UserInterface/Views/DOMBreakpointTreeElement.js:
(WI.DOMBreakpointTreeElement.prototype.ondelete):
* UserInterface/Views/DOMNodeTreeElement.js:
(WI.DOMNodeTreeElement.prototype.ondelete):
* UserInterface/Views/EventBreakpointTreeElement.js:
(WI.EventBreakpointTreeElement.prototype.ondelete):
* UserInterface/Views/URLBreakpointTreeElement.js:
(WI.URLBreakpointTreeElement.prototype.ondelete):
Add `return true;` to let the parent `WI.TreeOutline` know that the delete event was handled.
This prevents the parent `WI.TreeOutline`'s own `ondelete` from being called, which would
cause a double-delete as there would be a different `selectedTreeElement`.

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

11 months ago[LFC] Inline content logging should have some extra space for better readability
zalan@apple.com [Thu, 29 Aug 2019 20:48:02 +0000 (20:48 +0000)]
[LFC] Inline content logging should have some extra space for better readability
https://bugs.webkit.org/show_bug.cgi?id=201236
<rdar://problem/54807336>

Reviewed by Antti Koivisto.

* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::outputInlineRuns):

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

11 months ago[LFC][TFC] Use the "complicated-cases" category for computing the TFC root's height
zalan@apple.com [Thu, 29 Aug 2019 20:07:36 +0000 (20:07 +0000)]
[LFC][TFC] Use the "complicated-cases" category for computing the TFC root's height
https://bugs.webkit.org/show_bug.cgi?id=201230
<rdar://problem/54806131>

Reviewed by Antti Koivisto.

This might change in the future but for now let's use the "complicated cases" when we need to compute the TFC's height and vertical margin.
This is very BFC specific since (block)TFC is always parented in a BFC.

* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):

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

11 months ago[LFC][TFC] The table wrapper box is a block level box
zalan@apple.com [Thu, 29 Aug 2019 20:03:37 +0000 (20:03 +0000)]
[LFC][TFC] The table wrapper box is a block level box
https://bugs.webkit.org/show_bug.cgi?id=201229
<rdar://problem/54805515>

Reviewed by Antti Koivisto.

This is the anonymous box that we inject as the parent of the table caption/actual table box.

* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::complicatedCases):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForAncestors const):
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::establishesBlockFormattingContext const):
(WebCore::Layout::Box::isFloatAvoider const):
(WebCore::Layout::Box::isBlockLevelBox const):

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

11 months agoSkip fetch event dispatching if no fetch event handler is added at script evaluation...
youenn@apple.com [Thu, 29 Aug 2019 19:24:46 +0000 (19:24 +0000)]
Skip fetch event dispatching if no fetch event handler is added at script evaluation time
https://bugs.webkit.org/show_bug.cgi?id=201174

Reviewed by Chris Dumez.

Source/WebCore:

At end of worker script evaluation, store whether a fetch event handler is registered.
Send it back to the SWServer that will store it in the corresponding SWServerWorker.

Add support for soft update directly from the registration.
This will trigger a soft-update from the worker context itself.
In theory, this should be started by the job queue but we do not have a way yet to implement this as per spec.

Test: http/wpt/service-workers/skipFetchEvent.https.html

* workers/DedicatedWorkerThread.h:
(WebCore::DedicatedWorkerThread::start):
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
* workers/WorkerThread.cpp:
(WebCore::WorkerThread::workerThread):
* workers/WorkerThread.h:
(WebCore::WorkerThread::finishedEvaluatingScript):
* workers/service/context/SWContextManager.cpp:
(WebCore::SWContextManager::registerServiceWorkerThreadForInstall):
(WebCore::SWContextManager::startedServiceWorker):
(WebCore::SWContextManager::softUpdate):
* workers/service/context/SWContextManager.h:
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::postFetchTask):
(WebCore::ServiceWorkerThread::softUpdate):
(WebCore::ServiceWorkerThread::finishedEvaluatingScript):
(WebCore::ServiceWorkerThread::start):
* workers/service/context/ServiceWorkerThread.h:
(WebCore::ServiceWorkerThread::doesHandleFetch const):
* workers/service/server/SWServer.h:
* workers/service/server/SWServerRegistration.cpp:
(WebCore::SWServerRegistration::shouldSoftUpdate const):
(WebCore::SWServerRegistration::softUpdate):
* workers/service/server/SWServerRegistration.h:
(WebCore::SWServerRegistration::isStale const):
* workers/service/server/SWServerToContextConnection.cpp:
(WebCore::SWServerToContextConnection::generateConnectionIdentifier):
(WebCore::SWServerToContextConnection::SWServerToContextConnection):
(WebCore::SWServerToContextConnection::scriptContextStarted):
* workers/service/server/SWServerToContextConnection.h:
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::scriptContextStarted):
(WebCore::SWServerWorker::setState):
* workers/service/server/SWServerWorker.h:
(WebCore::SWServerWorker::shouldSkipFetchEvent const):

Source/WebKit:

Store whether a fetch event handler is set at script evaluation time.
If not, we skip the fetch event entirely so that the network load can start sooner.
If fetch event is skipped, we trigger soft update, as defined in
https://w3c.github.io/ServiceWorker/#handle-fetch step 16.

* NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::startFetch):
* NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
(WebKit::WebSWServerToContextConnection::softUpdate):
* NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
* NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::serviceWorkerStarted):
(WebKit::WebSWContextManagerConnection::serviceWorkerFailedToStart):
(WebKit::WebSWContextManagerConnection::softUpdate):
* WebProcess/Storage/WebSWContextManagerConnection.h:
* WebProcess/Storage/WebSWContextManagerConnection.messages.in:

LayoutTests:

* http/wpt/service-workers/skipFetchEvent-worker.js: Added.
(async.doTest):
* http/wpt/service-workers/skipFetchEvent.https-expected.txt: Added.
* http/wpt/service-workers/skipFetchEvent.https.html: Added.

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

11 months agoRemove support for macOS < 10.13 (part 3)
krollin@apple.com [Thu, 29 Aug 2019 19:22:22 +0000 (19:22 +0000)]
Remove support for macOS < 10.13 (part 3)
https://bugs.webkit.org/show_bug.cgi?id=201224
<rdar://problem/54795934>

Reviewed by Darin Adler.

Remove symbols in WebKitTargetConditionals.xcconfig related to macOS
10.13, including WK_MACOS_1013 and WK_MACOS_BEFORE_1013, and suffixes
like _MACOS_SINCE_1013.

Source/JavaScriptCore:

* Configurations/WebKitTargetConditionals.xcconfig:

Source/ThirdParty/libwebrtc:

* Configurations/WebKitTargetConditionals.xcconfig:

Source/WebCore:

No new tests -- no new or changed functionality.

* Configurations/WebKitTargetConditionals.xcconfig:

Source/WebCore/PAL:

* Configurations/WebKitTargetConditionals.xcconfig:

Source/WebInspectorUI:

Also added some macOS target numbers.

* Configurations/WebKitTargetConditionals.xcconfig:

Source/WebKit:

* Configurations/WebKitTargetConditionals.xcconfig:

Source/WebKitLegacy/mac:

* Configurations/WebKitTargetConditionals.xcconfig:

Tools:

Also added some macOS target numbers.

* TestWebKitAPI/Configurations/WebKitTargetConditionals.xcconfig:

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

11 months agoresults.webkit.org: Remove border from tooltip
jbedard@apple.com [Thu, 29 Aug 2019 18:40:23 +0000 (18:40 +0000)]
results.webkit.org: Remove border from tooltip
https://bugs.webkit.org/show_bug.cgi?id=201239

Reviewed by Alex Christensen.

* resultsdbpy/resultsdbpy/view/static/css/tooltip.css:
(.tooltip-content): Remove border.

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

11 months agoGenerateTAPI WebKitLegacy.tbd fails on internal iOS Simulator builds
dino@apple.com [Thu, 29 Aug 2019 17:21:14 +0000 (17:21 +0000)]
GenerateTAPI WebKitLegacy.tbd fails on internal iOS Simulator builds
https://bugs.webkit.org/show_bug.cgi?id=201200

Reverting r249211 after Dan Bernstein pointed out it will cause
an error with the public iOS 13 SDK.

* Misc/WebDownload.h:

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

11 months agoCompletionHandler default constructor does not initialize `m_wasConstructedOnMainThread`
cdumez@apple.com [Thu, 29 Aug 2019 17:11:05 +0000 (17:11 +0000)]
CompletionHandler default constructor does not initialize `m_wasConstructedOnMainThread`
https://bugs.webkit.org/show_bug.cgi?id=201249

Reviewed by Joseph Pecoraro and Alex Christensen.

* wtf/CompletionHandler.h:
(WTF::CompletionHandler<Out):

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

11 months agoRemove a bad assertion in ByteCodeParser::inlineCall().
mark.lam@apple.com [Thu, 29 Aug 2019 17:04:07 +0000 (17:04 +0000)]
Remove a bad assertion in ByteCodeParser::inlineCall().
https://bugs.webkit.org/show_bug.cgi?id=201292
<rdar://problem/54121659>

Reviewed by Michael Saboff.

In the DFG bytecode parser, we've already computed the inlining cost of a candidate
inlining target, and determine that it is worth inlining before invoking
ByteCodeParser::inlineCall().  However, in ByteCodeParser::inlineCall(), it
recomputes the inlining cost again only for the purpose of asserting that it isn't
too high.

Not consider a badly written test that does the following:

    function bar() {
        ...
        foo(); // Call in a hot loop here.
        ...
    }

    bar(); // <===== foo is inlineable into bar here.
    noInline(foo); // <===== Change mind, and make foo not inlineable.
    bar();

With this bad test, the following racy scenario can occur:

1. the first invocation of bar() gets hot, and a concurrent compile is kicked off.
2. the compiler thread computes foo()'s inliningCost() and determines that it is
   worthy to be inlined, and will imminently call inlineCall().
3. the mutator calls the noInline() test utility on foo(), thereby making it NOT
   inlineable.
4. the compiler thread calls inlineCall().  In inlineCall(), it re-computes the
   inliningCost for foo() and now finds that it is not inlineable.  An assertion
   failure follows.

Technically, the test is in error because noInline() shouldn't be used that way.
However, fuzzers that are not clued into noInline()'s proper usage may generate
code like this.

On the other hand, ByteCodeParser::inlineCall() should not be recomputing that the
inlining cost and asserting on it.  The only reason inlineCall() is invoked is
because it was already previously determined that a target function is inlineable
based on its inlining cost.  Today, in practice, I don't think we have any real
world condition where the mutator can affect the inlining cost of a target
function midway through execution.  So, this assertion isn't a problem if no one
writes a test that abuses noInline().  However, should things change such that the
mutator is able to affect the inlining cost of a target function, then it is
incorrect for the compiler to assume that the inlining cost is immutable.  Once
the compiler decides to inline a function, it should just follow through.

This patch removes this assertion in ByteCodeParser::inlineCall().  It is an
annoyance at best (for fuzzers), and at worst, incorrect if the mutator gains the
ability to affect the inlining cost of a target function.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::inlineCall):

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

11 months ago[GTK] Unreviewed test gardening
aboya@igalia.com [Thu, 29 Aug 2019 17:01:28 +0000 (17:01 +0000)]
[GTK] Unreviewed test gardening
https://bugs.webkit.org/show_bug.cgi?id=201276

* fast/borders/empty-outline-border-assert-expected.txt:
* platform/gtk/TestExpectations:
* platform/gtk/fast/dom/Window/window-lookup-precedence-expected.txt: Added.
* platform/gtk/fast/forms/label/labelable-elements-expected.txt: Added.
* platform/gtk/http/tests/media/hls/video-controls-live-stream-expected.txt:
* platform/gtk/http/tests/security/mixedContent/websocket/insecure-websocket-in-iframe-expected.txt: Added.
* platform/gtk/http/tests/security/mixedContent/websocket/insecure-websocket-in-main-frame-expected.txt: Added.
* platform/gtk/imported/w3c/web-platform-tests/custom-elements/builtin-coverage-expected.txt: Added.
* platform/gtk/imported/w3c/web-platform-tests/dom/nodes/Node-cloneNode-expected.txt: Added.
* platform/gtk/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-showModal-expected.txt:
* platform/gtk/imported/w3c/web-platform-tests/html/semantics/interfaces-expected.txt: Added.
* platform/gtk/imported/w3c/web-platform-tests/websockets/closing-handshake/003-expected.txt:
* platform/gtk/imported/w3c/web-platform-tests/websockets/cookies/004-expected.txt:
* platform/gtk/imported/w3c/web-platform-tests/websockets/unload-a-document/002-expected.txt: Added.
* platform/gtk/imported/w3c/web-platform-tests/websockets/unload-a-document/004-expected.txt: Added.
* platform/ios-wk2/fast/borders/empty-outline-border-assert-expected.txt: Removed.
* platform/mac-wk2/fast/borders/empty-outline-border-assert-expected.txt: Removed.

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

11 months agoUse WebPageProxy callbacks in case of authentication challenge received from Service...
youenn@apple.com [Thu, 29 Aug 2019 16:19:20 +0000 (16:19 +0000)]
Use WebPageProxy callbacks in case of authentication challenge received from Service Worker
https://bugs.webkit.org/show_bug.cgi?id=201177

Reviewed by Alex Christensen.

Source/WebKit:

Send topOrigin for every possible load to NetworkProcess.
Send topOrigin as part of authentication challenge to UIProcess.

If there is no corresponding page for the pageID, try getting a page
related to the service worker using the topOrigin and send the challenge to it.

* NetworkProcess/NetworkCORSPreflightChecker.cpp:
(WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
* NetworkProcess/NetworkCORSPreflightChecker.h:
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::didReceiveChallenge):
* NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::NetworkLoadChecker):
(WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
* NetworkProcess/NetworkLoadChecker.h:
* NetworkProcess/NetworkLoadParameters.h:
* NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::encode const):
(WebKit::NetworkResourceLoadParameters::decode):
* NetworkProcess/NetworkResourceLoadParameters.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
* NetworkProcess/PingLoad.cpp:
(WebKit::PingLoad::PingLoad):
(WebKit::PingLoad::didReceiveChallenge):
* Shared/Authentication/AuthenticationManager.cpp:
(WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
* Shared/Authentication/AuthenticationManager.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::processAuthenticationChallenge):
(WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didReceiveAuthenticationChallengeProxy):
* UIProcess/WebPageProxy.h:
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
(WebKit::WebLoaderStrategy::loadResourceSynchronously):
(WebKit::WebLoaderStrategy::startPingLoad):

LayoutTests:

* http/wpt/service-workers/server-trust-evaluation.https.html:

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

11 months ago[GStreamer] Do not use makeWeakPtr from streaming thread.
cturner@igalia.com [Thu, 29 Aug 2019 16:14:07 +0000 (16:14 +0000)]
[GStreamer] Do not use makeWeakPtr from streaming thread.
https://bugs.webkit.org/show_bug.cgi?id=201220

Reviewed by Xabier Rodriguez-Calvar.

Test: imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-retrieve-persistent-license.https.html

Recently some asserts were added that you can't create WeakPtr's
from streaming threads when the factory is created on the
main-thread. The fix is to eagerly create the WeakPtr at player
initialization time, rather than lazily when the streaming thread
first asks for it.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:

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

11 months agoDissociate the WebPageProxy's identifier from the WebPage's
cdumez@apple.com [Thu, 29 Aug 2019 15:28:23 +0000 (15:28 +0000)]
Dissociate the WebPageProxy's identifier from the WebPage's
https://bugs.webkit.org/show_bug.cgi?id=201233

Reviewed by Alex Christensen.

Dissociate the WebPageProxy's identifier from the WebPage's. This will allow bumping the
WebPage's identifier everytime we create a WebPage in a new process in case of process
swap on navigation (Bug 201225).

* Shared/WebBackForwardListItem.cpp:
(WebKit::WebBackForwardListItem::create):
(WebKit::WebBackForwardListItem::WebBackForwardListItem):
* Shared/WebBackForwardListItem.h:
(WebKit::WebBackForwardListItem::pageID const):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageLoaderClient):
* UIProcess/API/Cocoa/WKBrowsingContextController.mm:
(-[WKBrowsingContextController handle]):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView dealloc]):
(-[WKWebView _didCommitLayerTree:]):
(-[WKWebView _dispatchSetViewLayoutSize:]):
(-[WKWebView _cancelAnimatedResize]):
(-[WKWebView _remoteObjectRegistry]):
(-[WKWebView _handle]):
(-[WKWebView _focusTextInputContext:completionHandler:]):
(-[WKWebView _endAnimatedResize]):
(-[WKWebView _resizeWhileHidingContentWithUpdates:]):
(-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:maximumUnobscuredSizeOverride:]):
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _getAllStorageAccessEntriesFor:completionHandler:]):
* UIProcess/API/glib/WebKitWebContext.cpp:
(webkitWebContextGetWebViewForPage):
* UIProcess/API/glib/WebKitWebView.cpp:
(webkit_web_view_get_page_id):
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::handleForWebPageProxy):
(WebKit::WebAutomationSession::switchToBrowsingContext):
(WebKit::WebAutomationSession::waitForNavigationToCompleteOnPage):
(WebKit::WebAutomationSession::respondToPendingPageNavigationCallbacksWithTimeout):
(WebKit::WebAutomationSession::navigationOccurredForFrame):
(WebKit::WebAutomationSession::documentLoadedForFrame):
(WebKit::WebAutomationSession::inspectorFrontendLoaded):
(WebKit::WebAutomationSession::mouseEventsFlushedForPage):
(WebKit::WebAutomationSession::keyboardEventsFlushedForPage):
(WebKit::WebAutomationSession::willClosePage):
(WebKit::WebAutomationSession::evaluateJavaScriptFunction):
(WebKit::WebAutomationSession::resolveChildFrameHandle):
(WebKit::WebAutomationSession::resolveParentFrameHandle):
(WebKit::WebAutomationSession::computeElementLayout):
(WebKit::WebAutomationSession::selectOptionElement):
(WebKit::WebAutomationSession::getAllCookies):
(WebKit::WebAutomationSession::deleteSingleCookie):
(WebKit::WebAutomationSession::inputDispatcherForPage):
(WebKit::WebAutomationSession::viewportInViewCenterPointOfElement):
(WebKit::WebAutomationSession::simulateMouseInteraction):
(WebKit::WebAutomationSession::simulateKeyboardInteraction):
(WebKit::WebAutomationSession::performMouseInteraction):
(WebKit::WebAutomationSession::performKeyboardInteractions):
(WebKit::WebAutomationSession::takeScreenshot):
* UIProcess/Automation/WebAutomationSession.h:
* UIProcess/Automation/mac/WebAutomationSessionMac.mm:
(WebKit::WebAutomationSession::inspectBrowsingContext):
* UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
(WebKit::PlaybackSessionManagerProxy::PlaybackSessionManagerProxy):
(WebKit::PlaybackSessionManagerProxy::invalidate):
* UIProcess/Cocoa/TextCheckingController.mm:
(WebKit::TextCheckingController::replaceRelativeToSelection):
(WebKit::TextCheckingController::removeAnnotationRelativeToSelection):
* UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
(WebKit::VideoFullscreenManagerProxy::VideoFullscreenManagerProxy):
(WebKit::VideoFullscreenManagerProxy::invalidate):
* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::performDictionaryLookupAtLocation):
(WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection):
(WebKit::WebPageProxy::paymentCoordinatorAddMessageReceiver):
(WebKit::WebPageProxy::paymentCoordinatorRemoveMessageReceiver):
(WebKit::WebPageProxy::speakingErrorOccurred):
(WebKit::WebPageProxy::boundaryEventOccurred):
(WebKit::WebPageProxy::voicesDidChange):
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::~WebViewImpl):
(WebKit::WebViewImpl::windowDidOrderOffScreen):
(WebKit::WebViewImpl::windowDidOrderOnScreen):
(WebKit::WebViewImpl::windowDidChangeOcclusionState):
(WebKit::WebViewImpl::viewDidHide):
(WebKit::WebViewImpl::viewDidUnhide):
(WebKit::WebViewImpl::activeSpaceDidChange):
(WebKit::WebViewImpl::remoteObjectRegistry):
* UIProcess/GeolocationPermissionRequestManagerProxy.cpp:
(WebKit::GeolocationPermissionRequestManagerProxy::didReceiveGeolocationPermissionDecision):
* UIProcess/InspectorTargetProxy.cpp:
(WebKit::InspectorTargetProxy::connect):
(WebKit::InspectorTargetProxy::disconnect):
(WebKit::InspectorTargetProxy::sendMessageToTargetBackend):
* UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp:
(WebKit::NotificationPermissionRequestManagerProxy::createRequest):
* UIProcess/Notifications/WebNotificationManagerProxy.cpp:
(WebKit::WebNotificationManagerProxy::show):
(WebKit::WebNotificationManagerProxy::cancel):
(WebKit::WebNotificationManagerProxy::didDestroyNotification):
(WebKit::pageIDsMatch):
(WebKit::pageAndNotificationIDsMatch):
(WebKit::WebNotificationManagerProxy::clearNotifications):
(WebKit::WebNotificationManagerProxy::providerDidShowNotification):
(WebKit::WebNotificationManagerProxy::providerDidClickNotification):
* UIProcess/Notifications/WebNotificationManagerProxy.h:
* UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
(WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
(WebKit::ProvisionalPageProxy::processDidTerminate):
(WebKit::ProvisionalPageProxy::cancel):
(WebKit::ProvisionalPageProxy::initializeWebPage):
(WebKit::ProvisionalPageProxy::loadData):
(WebKit::ProvisionalPageProxy::loadRequest):
(WebKit::ProvisionalPageProxy::goToBackForwardItem):
(WebKit::ProvisionalPageProxy::didCreateMainFrame):
(WebKit::ProvisionalPageProxy::didStartProvisionalLoadForFrame):
(WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame):
(WebKit::ProvisionalPageProxy::didCommitLoadForFrame):
* UIProcess/ProvisionalPageProxy.h:
* UIProcess/RemoteWebInspectorProxy.cpp:
(WebKit::RemoteWebInspectorProxy::load):
(WebKit::RemoteWebInspectorProxy::sendMessageToFrontend):
(WebKit::RemoteWebInspectorProxy::createFrontendPageAndWindow):
(WebKit::RemoteWebInspectorProxy::closeFrontendPageAndWindow):
* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::SuspendedPageProxy):
(WebKit::SuspendedPageProxy::~SuspendedPageProxy):
(WebKit::SuspendedPageProxy::unsuspend):
(WebKit::SuspendedPageProxy::close):
(WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
(WebKit::SuspendedPageProxy::loggingString const):
* UIProcess/SuspendedPageProxy.h:
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
(WebKit::UserMediaPermissionRequestManagerProxy::denyRequest):
(WebKit::UserMediaPermissionRequestManagerProxy::finishGrantingRequest):
* UIProcess/ViewGestureController.cpp:
(WebKit::ViewGestureController::ViewGestureController):
(WebKit::ViewGestureController::~ViewGestureController):
(WebKit::ViewGestureController::disconnectFromProcess):
(WebKit::ViewGestureController::connectToProcess):
(WebKit::ViewGestureController::controllerForGesture):
(WebKit::ViewGestureController::forceRepaintIfNeeded):
(WebKit::ViewGestureController::requestRenderTreeSizeNotificationIfNeeded):
* UIProcess/ViewGestureController.h:
* UIProcess/VisitedLinkStore.cpp:
(WebKit::VisitedLinkStore::addVisitedLinkHashFromPage):
* UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp:
(WebKit::WebAuthenticatorCoordinatorProxy::WebAuthenticatorCoordinatorProxy):
(WebKit::WebAuthenticatorCoordinatorProxy::~WebAuthenticatorCoordinatorProxy):
* UIProcess/WebBackForwardList.cpp:
(WebKit::WebBackForwardList::itemForID):
(WebKit::WebBackForwardList::restoreFromState):
* UIProcess/WebEditCommandProxy.cpp:
(WebKit::WebEditCommandProxy::unapply):
(WebKit::WebEditCommandProxy::reapply):
* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::loadURL):
(WebKit::WebFrameProxy::loadData):
(WebKit::WebFrameProxy::stopLoading const):
(WebKit::WebFrameProxy::collapseSelection):
* UIProcess/WebFullScreenManagerProxy.cpp:
(WebKit::WebFullScreenManagerProxy::WebFullScreenManagerProxy):
(WebKit::WebFullScreenManagerProxy::~WebFullScreenManagerProxy):
(WebKit::WebFullScreenManagerProxy::willEnterFullScreen):
(WebKit::WebFullScreenManagerProxy::didEnterFullScreen):
(WebKit::WebFullScreenManagerProxy::willExitFullScreen):
(WebKit::WebFullScreenManagerProxy::didExitFullScreen):
(WebKit::WebFullScreenManagerProxy::setAnimatingFullScreen):
(WebKit::WebFullScreenManagerProxy::requestExitFullScreen):
(WebKit::WebFullScreenManagerProxy::saveScrollPosition):
(WebKit::WebFullScreenManagerProxy::restoreScrollPosition):
(WebKit::WebFullScreenManagerProxy::setFullscreenInsets):
(WebKit::WebFullScreenManagerProxy::setFullscreenAutoHideDuration):
(WebKit::WebFullScreenManagerProxy::setFullscreenControlsHidden):
* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::WebInspectorProxy):
(WebKit::WebInspectorProxy::invalidate):
(WebKit::WebInspectorProxy::sendMessageToFrontend):
(WebKit::WebInspectorProxy::connect):
(WebKit::WebInspectorProxy::close):
(WebKit::WebInspectorProxy::reset):
(WebKit::WebInspectorProxy::updateForNewPageProcess):
(WebKit::WebInspectorProxy::setFrontendConnection):
(WebKit::WebInspectorProxy::showConsole):
(WebKit::WebInspectorProxy::showResources):
(WebKit::WebInspectorProxy::showMainResourceForFrame):
(WebKit::WebInspectorProxy::attach):
(WebKit::WebInspectorProxy::detach):
(WebKit::WebInspectorProxy::togglePageProfiling):
(WebKit::WebInspectorProxy::toggleElementSelection):
(WebKit::WebInspectorProxy::createFrontendPage):
(WebKit::WebInspectorProxy::openLocalInspectorFrontend):
(WebKit::WebInspectorProxy::open):
(WebKit::WebInspectorProxy::closeFrontendPageAndWindow):
(WebKit::WebInspectorProxy::attachAvailabilityChanged):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::m_resetRecentCrashCountTimer):
(WebKit::WebPageProxy::~WebPageProxy):
(WebKit::WebPageProxy::setUIClient):
(WebKit::WebPageProxy::setIconLoadingClient):
(WebKit::WebPageProxy::launchProcess):
(WebKit::WebPageProxy::suspendCurrentPageIfPossible):
(WebKit::WebPageProxy::swapToWebProcess):
(WebKit::WebPageProxy::launchProcessForReload):
(WebKit::WebPageProxy::launchProcessWithItem):
(WebKit::WebPageProxy::initializeWebPage):
(WebKit::WebPageProxy::close):
(WebKit::WebPageProxy::tryClose):
(WebKit::WebPageProxy::loadRequest):
(WebKit::WebPageProxy::loadRequestWithNavigationShared):
(WebKit::WebPageProxy::loadFile):
(WebKit::WebPageProxy::loadData):
(WebKit::WebPageProxy::loadDataWithNavigationShared):
(WebKit::WebPageProxy::loadAlternateHTML):
(WebKit::WebPageProxy::loadWebArchiveData):
(WebKit::WebPageProxy::navigateToPDFLinkWithSimulatedClick):
(WebKit::WebPageProxy::stopLoading):
(WebKit::WebPageProxy::reload):
(WebKit::WebPageProxy::goToBackForwardItem):
(WebKit::WebPageProxy::tryRestoreScrollPosition):
(WebKit::WebPageProxy::setControlledByAutomation):
(WebKit::WebPageProxy::setIndicating):
(WebKit::WebPageProxy::createInspectorTargets):
(WebKit::WebPageProxy::setBackgroundColor):
(WebKit::WebPageProxy::setTopContentInset):
(WebKit::WebPageProxy::setUnderlayColor):
(WebKit::WebPageProxy::viewWillStartLiveResize):
(WebKit::WebPageProxy::viewWillEndLiveResize):
(WebKit::WebPageProxy::activityStateDidChange):
(WebKit::WebPageProxy::viewDidEnterWindow):
(WebKit::WebPageProxy::dispatchActivityStateChange):
(WebKit::WebPageProxy::layerHostingModeDidChange):
(WebKit::WebPageProxy::setInitialFocus):
(WebKit::WebPageProxy::clearSelection):
(WebKit::WebPageProxy::restoreSelectionInFocusedEditableElement):
(WebKit::WebPageProxy::validateCommand):
(WebKit::WebPageProxy::increaseListLevel):
(WebKit::WebPageProxy::decreaseListLevel):
(WebKit::WebPageProxy::changeListType):
(WebKit::WebPageProxy::setBaseWritingDirection):
(WebKit::WebPageProxy::setNeedsFontAttributes):
(WebKit::WebPageProxy::scheduleFullEditorStateUpdate):
(WebKit::WebPageProxy::selectAll):
(WebKit::WebPageProxy::executeEditCommand):
(WebKit::WebPageProxy::requestFontAttributesAtSelectionStart):
(WebKit::WebPageProxy::setEditable):
(WebKit::WebPageProxy::performDragControllerAction):
(WebKit::WebPageProxy::dragEnded):
(WebKit::WebPageProxy::didStartDrag):
(WebKit::WebPageProxy::dragCancelled):
(WebKit::WebPageProxy::processNextQueuedMouseEvent):
(WebKit::WebPageProxy::sendWheelEvent):
(WebKit::WebPageProxy::handleKeyboardEvent):
(WebKit::WebPageProxy::handleGestureEvent):
(WebKit::WebPageProxy::handleTouchEventSynchronously):
(WebKit::WebPageProxy::resetPotentialTapSecurityOrigin):
(WebKit::WebPageProxy::handleTouchEventAsynchronously):
(WebKit::WebPageProxy::handleTouchEvent):
(WebKit::WebPageProxy::cancelPointer):
(WebKit::WebPageProxy::touchWithIdentifierWasRemoved):
(WebKit::WebPageProxy::scrollBy):
(WebKit::WebPageProxy::centerSelectionInVisibleArea):
(WebKit::WebPageProxy::commitProvisionalPage):
(WebKit::WebPageProxy::continueNavigationInNewProcess):
(WebKit::WebPageProxy::setUserAgent):
(WebKit::WebPageProxy::resumeActiveDOMObjectsAndAnimations):
(WebKit::WebPageProxy::suspendActiveDOMObjectsAndAnimations):
(WebKit::WebPageProxy::setCustomTextEncodingName):
(WebKit::WebPageProxy::restoreFromSessionState):
(WebKit::WebPageProxy::setTextZoomFactor):
(WebKit::WebPageProxy::setPageZoomFactor):
(WebKit::WebPageProxy::setPageAndTextZoomFactors):
(WebKit::WebPageProxy::scalePage):
(WebKit::WebPageProxy::scalePageInViewCoordinates):
(WebKit::WebPageProxy::scaleView):
(WebKit::WebPageProxy::windowScreenDidChange):
(WebKit::WebPageProxy::accessibilitySettingsDidChange):
(WebKit::WebPageProxy::setUseFixedLayout):
(WebKit::WebPageProxy::setFixedLayoutSize):
(WebKit::WebPageProxy::setAlwaysShowsHorizontalScroller):
(WebKit::WebPageProxy::setAlwaysShowsVerticalScroller):
(WebKit::WebPageProxy::listenForLayoutMilestones):
(WebKit::WebPageProxy::setSuppressScrollbarAnimations):
(WebKit::WebPageProxy::setEnableVerticalRubberBanding):
(WebKit::WebPageProxy::setEnableHorizontalRubberBanding):
(WebKit::WebPageProxy::setBackgroundExtendsBeyondPage):
(WebKit::WebPageProxy::setPaginationMode):
(WebKit::WebPageProxy::setPaginationBehavesLikeColumns):
(WebKit::WebPageProxy::setPageLength):
(WebKit::WebPageProxy::setGapBetweenPages):
(WebKit::WebPageProxy::setPaginationLineGridEnabled):
(WebKit::WebPageProxy::findStringMatches):
(WebKit::WebPageProxy::findString):
(WebKit::WebPageProxy::getImageForFindMatch):
(WebKit::WebPageProxy::selectFindMatch):
(WebKit::WebPageProxy::indicateFindMatch):
(WebKit::WebPageProxy::hideFindUI):
(WebKit::WebPageProxy::countStringMatches):
(WebKit::WebPageProxy::replaceMatches):
(WebKit::WebPageProxy::runJavaScriptInMainFrameScriptWorld):
(WebKit::WebPageProxy::runJavaScriptInFrame):
(WebKit::WebPageProxy::getRenderTreeExternalRepresentation):
(WebKit::WebPageProxy::getSourceForFrame):
(WebKit::WebPageProxy::getContentsAsString):
(WebKit::WebPageProxy::getContentsAsAttributedString):
(WebKit::WebPageProxy::getBytecodeProfile):
(WebKit::WebPageProxy::getSamplingProfilerOutput):
(WebKit::WebPageProxy::getContentsAsMHTMLData):
(WebKit::WebPageProxy::getSelectionOrContentsAsString):
(WebKit::WebPageProxy::getSelectionAsWebArchiveData):
(WebKit::WebPageProxy::getMainResourceDataOfFrame):
(WebKit::WebPageProxy::getResourceDataFromFrame):
(WebKit::WebPageProxy::getWebArchiveOfFrame):
(WebKit::WebPageProxy::forceRepaint):
(WebKit::WebPageProxy::preferencesDidChange):
(WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
(WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrameShared):
(WebKit::WebPageProxy::willPerformClientRedirectForFrame):
(WebKit::WebPageProxy::didCancelClientRedirectForFrame):
(WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
(WebKit::WebPageProxy::didFinishLoadForFrame):
(WebKit::WebPageProxy::didFailLoadForFrame):
(WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
(WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared):
(WebKit::WebPageProxy::decidePolicyForNewWindowAction):
(WebKit::WebPageProxy::decidePolicyForResponseShared):
(WebKit::WebPageProxy::willSubmitForm):
(WebKit::WebPageProxy::didNavigateWithNavigationDataShared):
(WebKit::WebPageProxy::didPerformClientRedirectShared):
(WebKit::WebPageProxy::didPerformServerRedirectShared):
(WebKit::trySOAuthorization):
(WebKit::WebPageProxy::createNewPage):
(WebKit::WebPageProxy::showShareSheet):
(WebKit::WebPageProxy::setMediaVolume):
(WebKit::WebPageProxy::setMuted):
(WebKit::WebPageProxy::stopMediaCapture):
(WebKit::WebPageProxy::stopAllMediaPlayback):
(WebKit::WebPageProxy::suspendAllMediaPlayback):
(WebKit::WebPageProxy::resumeAllMediaPlayback):
(WebKit::WebPageProxy::handleMediaEvent):
(WebKit::WebPageProxy::setVolumeOfMediaElement):
(WebKit::WebPageProxy::setMayStartMediaWhenInWindow):
(WebKit::WebPageProxy::didChooseColor):
(WebKit::WebPageProxy::didEndColorPicker):
(WebKit::WebPageProxy::didCloseSuggestions):
(WebKit::WebPageProxy::didSelectOption):
(WebKit::WebPageProxy::setAllowsMediaDocumentInlinePlayback):
(WebKit::WebPageProxy::backForwardAddItem):
(WebKit::WebPageProxy::messageSenderDestinationID const):
(WebKit::WebPageProxy::valueChangedForPopupMenu):
(WebKit::WebPageProxy::setTextFromItemForPopupMenu):
(WebKit::WebPageProxy::postMessageToInjectedBundle):
(WebKit::WebPageProxy::failedToShowPopupMenu):
(WebKit::WebPageProxy::showContextMenu):
(WebKit::WebPageProxy::contextMenuItemSelected):
(WebKit::WebPageProxy::handleContextMenuKeyEvent):
(WebKit::WebPageProxy::didChooseFilesForOpenPanelWithDisplayStringAndIcon):
(WebKit::WebPageProxy::didChooseFilesForOpenPanel):
(WebKit::WebPageProxy::didCancelForOpenPanel):
(WebKit::WebPageProxy::advanceToNextMisspelling):
(WebKit::WebPageProxy::changeSpellingToWord):
(WebKit::WebPageProxy::removeEditCommand):
(WebKit::WebPageProxy::didFinishCheckingText):
(WebKit::WebPageProxy::didCancelCheckingText):
(WebKit::WebPageProxy::didReceiveEvent):
(WebKit::WebPageProxy::processDidBecomeUnresponsive):
(WebKit::WebPageProxy::processDidBecomeResponsive):
(WebKit::WebPageProxy::dispatchProcessDidTerminate):
(WebKit::WebPageProxy::gamepadActivity):
(WebKit::WebPageProxy::updateWebsitePolicies):
(WebKit::WebPageProxy::backForwardRemovedItem):
(WebKit::WebPageProxy::setCanRunModal):
(WebKit::WebPageProxy::beginPrinting):
(WebKit::WebPageProxy::endPrinting):
(WebKit::WebPageProxy::computePagesForPrinting):
(WebKit::WebPageProxy::drawRectToImage):
(WebKit::WebPageProxy::drawPagesToPDF):
(WebKit::WebPageProxy::drawPagesForPrinting):
(WebKit::WebPageProxy::setMinimumSizeForAutoLayout):
(WebKit::WebPageProxy::setAutoSizingShouldExpandToViewHeight):
(WebKit::WebPageProxy::setViewportSizeForCSSViewportUnits):
(WebKit::WebPageProxy::handleAlternativeTextUIResult):
(WebKit::WebPageProxy::setComposition):
(WebKit::WebPageProxy::confirmComposition):
(WebKit::WebPageProxy::cancelComposition):
(WebKit::WebPageProxy::setScrollPinningBehavior):
(WebKit::WebPageProxy::setOverlayScrollbarStyle):
(WebKit::WebPageProxy::addMIMETypeWithCustomContentProvider):
(WebKit::WebPageProxy::changeFontAttributes):
(WebKit::WebPageProxy::changeFont):
(WebKit::WebPageProxy::setTextAsync):
(WebKit::WebPageProxy::insertTextAsync):
(WebKit::WebPageProxy::hasMarkedText):
(WebKit::WebPageProxy::getMarkedRangeAsync):
(WebKit::WebPageProxy::getSelectedRangeAsync):
(WebKit::WebPageProxy::characterIndexForPointAsync):
(WebKit::WebPageProxy::firstRectForCharacterRangeAsync):
(WebKit::WebPageProxy::setCompositionAsync):
(WebKit::WebPageProxy::confirmCompositionAsync):
(WebKit::WebPageProxy::takeSnapshot):
(WebKit::WebPageProxy::requestActiveNowPlayingSessionInfo):
(WebKit::WebPageProxy::performImmediateActionHitTestAtLocation):
(WebKit::WebPageProxy::immediateActionDidUpdate):
(WebKit::WebPageProxy::immediateActionDidCancel):
(WebKit::WebPageProxy::immediateActionDidComplete):
(WebKit::WebPageProxy::handleAcceptedCandidate):
(WebKit::WebPageProxy::setUseSystemAppearance):
(WebKit::WebPageProxy::setHeaderBannerHeightForTesting):
(WebKit::WebPageProxy::setFooterBannerHeightForTesting):
(WebKit::WebPageProxy::setShouldDispatchFakeMouseMoveEvents):
(WebKit::WebPageProxy::setPlaybackTarget):
(WebKit::WebPageProxy::externalOutputDeviceAvailableDidChange):
(WebKit::WebPageProxy::setShouldPlayToPlaybackTarget):
(WebKit::WebPageProxy::clearWheelEventTestTrigger):
(WebKit::WebPageProxy::setShouldScaleViewToFitDocument):
(WebKit::WebPageProxy::getLoadDecisionForIcon):
(WebKit::WebPageProxy::setResourceCachingDisabled):
(WebKit::WebPageProxy::setUserInterfaceLayoutDirection):
(WebKit::WebPageProxy::didAllowPointerLock):
(WebKit::WebPageProxy::didDenyPointerLock):
(WebKit::WebPageProxy::requestPointerUnlock):
(WebKit::WebPageProxy::setURLSchemeHandlerForScheme):
(WebKit::WebPageProxy::didCommitCrossSiteLoadWithDataTransferFromPrevalentResource):
(WebKit::WebPageProxy::effectiveAppearanceDidChange):
(WebKit::WebPageProxy::insertAttachment):
(WebKit::WebPageProxy::updateAttachmentAttributes):
(WebKit::WebPageProxy::getApplicationManifest):
(WebKit::WebPageProxy::setDefersLoadingForTesting):
(WebKit::WebPageProxy::updateCurrentModifierState):
(WebKit::WebPageProxy::simulateDeviceOrientationChange):
(WebKit::WebPageProxy::detectDataInAllFrames):
(WebKit::WebPageProxy::removeDataDetectedLinks):
(WebKit::WebPageProxy::textInputContextsInRect):
(WebKit::WebPageProxy::focusTextInputContext):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::identifier const):
(WebKit::WebPageProxy::webPageID const):
* UIProcess/WebPageProxyIdentifier.h: Added.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
(WebKit::WebProcessPool::pageEndUsingWebsiteDataStore):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::webPage):
(WebKit::WebProcessProxy::addExistingWebPage):
(WebKit::WebProcessProxy::removeWebPage):
(WebKit::WebProcessProxy::addVisitedLinkStoreUser):
(WebKit::WebProcessProxy::removeVisitedLinkStoreUser):
(WebKit::WebProcessProxy::hasProvisionalPageWithID const):
(WebKit::WebProcessProxy::isAllowedToUpdateBackForwardItem const):
(WebKit::WebProcessProxy::transformObjectsToHandles):
* UIProcess/WebProcessProxy.h:
* UIProcess/WebURLSchemeHandler.cpp:
(WebKit::WebURLSchemeHandler::startTask):
(WebKit::WebURLSchemeHandler::stopAllTasksForPage):
(WebKit::WebURLSchemeHandler::stopTask):
(WebKit::WebURLSchemeHandler::removeTaskFromPageMap):
* UIProcess/WebURLSchemeHandler.h:
* UIProcess/WebURLSchemeTask.cpp:
(WebKit::WebURLSchemeTask::WebURLSchemeTask):
(WebKit::WebURLSchemeTask::didPerformRedirection):
(WebKit::WebURLSchemeTask::didReceiveResponse):
(WebKit::WebURLSchemeTask::didReceiveData):
(WebKit::WebURLSchemeTask::didComplete):
* UIProcess/WebURLSchemeTask.h:
(WebKit::WebURLSchemeTask::pageID const):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::getAllStorageAccessEntries):
* UIProcess/WebsiteData/WebsiteDataStore.h:
* UIProcess/gtk/WebPageProxyGtk.cpp:
(WebKit::WebPageProxy::getCenterForZoomGesture):
* UIProcess/ios/EditableImageController.mm:
(WebKit::EditableImageController::EditableImageController):
(WebKit::EditableImageController::~EditableImageController):
* UIProcess/ios/SmartMagnificationController.mm:
(WebKit::SmartMagnificationController::SmartMagnificationController):
(WebKit::SmartMagnificationController::~SmartMagnificationController):
(WebKit::SmartMagnificationController::handleSmartMagnificationGesture):
* UIProcess/ios/ViewGestureControllerIOS.mm:
(WebKit::ViewGestureController::beginSwipeGesture):
(WebKit::ViewGestureController::endSwipeGesture):
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _wk_printedDocument]):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView ensurePositionInformationIsUpToDate:]):
(-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::requestFocusedElementInformation):
(WebKit::WebPageProxy::updateVisibleContentRects):
(WebKit::WebPageProxy::resendLastVisibleContentRects):
(WebKit::WebPageProxy::dynamicViewportSizeUpdate):
(WebKit::WebPageProxy::setViewportConfigurationViewLayoutSize):
(WebKit::WebPageProxy::setForceAlwaysUserScalable):
(WebKit::WebPageProxy::setMaximumUnobscuredSize):
(WebKit::WebPageProxy::setDeviceOrientation):
(WebKit::WebPageProxy::setOverrideViewportArguments):
(WebKit::WebPageProxy::selectWithGesture):
(WebKit::WebPageProxy::updateSelectionWithTouches):
(WebKit::WebPageProxy::replaceDictatedText):
(WebKit::WebPageProxy::replaceSelectedText):
(WebKit::WebPageProxy::requestAutocorrectionData):
(WebKit::WebPageProxy::applyAutocorrection):
(WebKit::WebPageProxy::selectTextWithGranularityAtPoint):
(WebKit::WebPageProxy::selectPositionAtBoundaryWithDirection):
(WebKit::WebPageProxy::moveSelectionAtBoundaryWithDirection):
(WebKit::WebPageProxy::selectPositionAtPoint):
(WebKit::WebPageProxy::beginSelectionInDirection):
(WebKit::WebPageProxy::updateSelectionWithExtentPoint):
(WebKit::WebPageProxy::updateSelectionWithExtentPointAndBoundary):
(WebKit::WebPageProxy::requestDictationContext):
(WebKit::WebPageProxy::requestAutocorrectionContext):
(WebKit::WebPageProxy::getSelectionContext):
(WebKit::WebPageProxy::handleTwoFingerTapAtPoint):
(WebKit::WebPageProxy::handleStylusSingleTapAtPoint):
(WebKit::WebPageProxy::selectWithTwoTouches):
(WebKit::WebPageProxy::requestPositionInformation):
(WebKit::WebPageProxy::startInteractionWithElementAtPosition):
(WebKit::WebPageProxy::stopInteraction):
(WebKit::WebPageProxy::performActionOnElement):
(WebKit::WebPageProxy::applicationDidEnterBackground):
(WebKit::WebPageProxy::applicationDidFinishSnapshottingAfterEnteringBackground):
(WebKit::WebPageProxy::applicationWillEnterForeground):
(WebKit::WebPageProxy::applicationWillResignActive):
(WebKit::WebPageProxy::applicationDidBecomeActive):
(WebKit::WebPageProxy::extendSelection):
(WebKit::WebPageProxy::selectWordBackward):
(WebKit::WebPageProxy::requestRectsForGranularityWithSelectionOffset):
(WebKit::WebPageProxy::requestRectsAtSelectionOffsetWithText):
(WebKit::WebPageProxy::storeSelectionForAccessibility):
(WebKit::WebPageProxy::startAutoscrollAtPosition):
(WebKit::WebPageProxy::cancelAutoscroll):
(WebKit::WebPageProxy::moveSelectionByOffset):
(WebKit::WebPageProxy::registerUIProcessAccessibilityTokens):
(WebKit::WebPageProxy::willStartUserTriggeredZooming):
(WebKit::WebPageProxy::potentialTapAtPosition):
(WebKit::WebPageProxy::commitPotentialTap):
(WebKit::WebPageProxy::cancelPotentialTap):
(WebKit::WebPageProxy::tapHighlightAtPosition):
(WebKit::WebPageProxy::handleTap):
(WebKit::WebPageProxy::didRecognizeLongPress):
(WebKit::WebPageProxy::handleDoubleTapForDoubleClickAtPoint):
(WebKit::WebPageProxy::inspectorNodeSearchMovedToPosition):
(WebKit::WebPageProxy::inspectorNodeSearchEndedAtPosition):
(WebKit::WebPageProxy::blurFocusedElement):
(WebKit::WebPageProxy::setIsShowingInputViewForFocusedElement):
(WebKit::WebPageProxy::autofillLoginCredentials):
(WebKit::WebPageProxy::focusNextFocusedElement):
(WebKit::WebPageProxy::setFocusedElementValue):
(WebKit::WebPageProxy::setFocusedElementValueAsNumber):
(WebKit::WebPageProxy::setFocusedElementSelectedIndex):
(WebKit::WebPageProxy::computePagesForPrintingAndDrawToPDF):
(WebKit::WebPageProxy::contentSizeCategoryDidChange):
(WebKit::WebPageProxy::generateSyntheticEditingCommand):
(WebKit::WebPageProxy::hardwareKeyboardAvailabilityChanged):
(WebKit::WebPageProxy::requestEvasionRectsAboveSelection):
(WebKit::WebPageProxy::updateSelectionWithDelta):
(WebKit::WebPageProxy::requestDocumentEditingContext):
(WebKit::WebPageProxy::requestDragStart):
(WebKit::WebPageProxy::requestAdditionalItemsForDragSession):
(WebKit::WebPageProxy::didConcludeDrop):
(WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrameShared):
* UIProcess/mac/RemoteWebInspectorProxyMac.mm:
(WebKit::RemoteWebInspectorProxy::platformSave):
(WebKit::RemoteWebInspectorProxy::platformAppend):
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
(WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState):
* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::handleMagnificationGestureEvent):
(WebKit::ViewGestureController::handleSmartMagnificationGesture):
* UIProcess/mac/WKImmediateActionController.mm:
(-[WKImmediateActionController immediateActionRecognizerWillBeginAnimation:]):
* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::platformSave):
(WebKit::WebInspectorProxy::platformAppend):
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::windowAndViewFramesChanged):
(WebKit::WebPageProxy::setMainFrameIsScrollable):
(WebKit::WebPageProxy::insertDictatedTextAsync):
(WebKit::WebPageProxy::attributedSubstringForCharacterRangeAsync):
(WebKit::WebPageProxy::fontAtSelection):
(WebKit::WebPageProxy::stringSelectionForPasteboard):
(WebKit::WebPageProxy::dataSelectionForPasteboard):
(WebKit::WebPageProxy::readSelectionFromPasteboard):
(WebKit::WebPageProxy::replaceSelectionWithPasteboardData):
(WebKit::WebPageProxy::sendComplexTextInputToPlugin):
(WebKit::WebPageProxy::uppercaseWord):
(WebKit::WebPageProxy::lowercaseWord):
(WebKit::WebPageProxy::capitalizeWord):
(WebKit::WebPageProxy::setSmartInsertDeleteEnabled):
(WebKit::WebPageProxy::registerUIProcessAccessibilityTokens):
(WebKit::WebPageProxy::shouldDelayWindowOrderingForEvent):
(WebKit::WebPageProxy::acceptsFirstMouse):
* WebKit.xcodeproj/project.pbxproj:

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

11 months agoUse inline data member initialization in ProcessLauncher
cdumez@apple.com [Thu, 29 Aug 2019 15:27:27 +0000 (15:27 +0000)]
Use inline data member initialization in ProcessLauncher
https://bugs.webkit.org/show_bug.cgi?id=201247

Reviewed by Ryosuke Niwa.

* UIProcess/Launcher/ProcessLauncher.cpp:
(WebKit::ProcessLauncher::ProcessLauncher):
* UIProcess/Launcher/ProcessLauncher.h:

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

11 months agoCrash when mach_port_deallocate() returns KERN_INVALID_NAME
cdumez@apple.com [Thu, 29 Aug 2019 15:25:32 +0000 (15:25 +0000)]
Crash when mach_port_deallocate() returns KERN_INVALID_NAME
https://bugs.webkit.org/show_bug.cgi?id=201248
<rdar://problem/54813890>

Reviewed by Alex Christensen.

* wtf/cocoa/MachSendRight.cpp:
(WTF::deallocateSendRightSafely):

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

11 months agoAddress some MathML FIXMEs
commit-queue@webkit.org [Thu, 29 Aug 2019 14:54:54 +0000 (14:54 +0000)]
Address some MathML FIXMEs
https://bugs.webkit.org/show_bug.cgi?id=201293

Patch by Rob Buis <rbuis@igalia.com> on 2019-08-29
Reviewed by Frédéric Wang.

Source/WebCore:

Add element tag checks for data, time and dialog.

* mathml/MathMLOperatorDictionary.h:
* mathml/MathMLPresentationElement.cpp:
(WebCore::MathMLPresentationElement::isPhrasingContent):
(WebCore::MathMLPresentationElement::isFlowContent):

LayoutTests:

Also test newly exposed data and time elements.

* mathml/presentation/foreign-element-in-token-expected.txt:
* mathml/presentation/foreign-element-in-token.html:
* platform/ios-wk2/mathml/presentation/foreign-element-in-token-expected.txt:
* platform/mac-wk2/mathml/presentation/foreign-element-in-token-expected.txt:

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

11 months ago[Nicosia] Nicosia::Animation is missing the copy assignment operator
zandobersek@gmail.com [Thu, 29 Aug 2019 11:21:20 +0000 (11:21 +0000)]
[Nicosia] Nicosia::Animation is missing the copy assignment operator
https://bugs.webkit.org/show_bug.cgi?id=201298

Reviewed by Carlos Garcia Campos.

Along with the copy constructor, the Nicosia::Animation class also
requires the copy assignment operator that's invoked whenever
the containing Nicosia::Animations object is copied across different
state objects.

Much like the constructor, the copy assignment should clone the
TimingFunction object to make it safely reusable in other contexts.
This fixes the assertion failures in debug configurations over the
improper cross-thread RefCounted usage.

* platform/graphics/nicosia/NicosiaAnimation.cpp:
(Nicosia::Animation::operator=):
* platform/graphics/nicosia/NicosiaAnimation.h:
Explicitly default the move constructor and assignment operator,
providing the whole quartet.

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

11 months agohttps://bugs.webkit.org/show_bug.cgi?id=200917
commit-queue@webkit.org [Thu, 29 Aug 2019 11:10:45 +0000 (11:10 +0000)]
https://bugs.webkit.org/show_bug.cgi?id=200917
Do not call addHTTPOriginIfNeeded for window.open

window.open() always uses GET requests and addHTTPOriginIfNeeded
has no effect for GET, so do not call it.

Patch by Rob Buis <rbuis@igalia.com> on 2019-08-29
Reviewed by Frédéric Wang.

* page/DOMWindow.cpp:
(WebCore::DOMWindow::createWindow):

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

11 months agoWebSockets: first-party for cookies not set in handshake request when using platform...
carlosgc@webkit.org [Thu, 29 Aug 2019 10:39:39 +0000 (10:39 +0000)]
WebSockets: first-party for cookies not set in handshake request when using platform APIs
https://bugs.webkit.org/show_bug.cgi?id=200165

Reviewed by Youenn Fablet.

* Modules/websockets/ThreadableWebSocketChannel.cpp:
(WebCore::ThreadableWebSocketChannel::webSocketConnectRequest):

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

11 months agoImplement HTMLOrForeignElement
commit-queue@webkit.org [Thu, 29 Aug 2019 08:30:05 +0000 (08:30 +0000)]
Implement HTMLOrForeignElement
https://bugs.webkit.org/show_bug.cgi?id=201219

Patch by Rob Buis <rbuis@igalia.com> on 2019-08-29
Reviewed by Frédéric Wang.

Add FIXME for updating the spec link.

* html/HTMLOrForeignElement.idl:

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

11 months agoWeb Inspector: Import file pickers sometimes do not import
pecoraro@apple.com [Thu, 29 Aug 2019 08:24:19 +0000 (08:24 +0000)]
Web Inspector: Import file pickers sometimes do not import
https://bugs.webkit.org/show_bug.cgi?id=201290
<rdar://problem/54826117>

Reviewed by Devin Rousso.

* UserInterface/Base/FileUtilities.js:
(WI.FileUtilities.importText):
(WI.FileUtilities.importJSON):
Keep the input element alive so it doesn't get garbage collected,
which makes the file chooser do nothing.

(WI.FileUtilities.save):
(WI.FileUtilities.async.readText):
Place read operations after event handlers are setup in case the
read operations can happen synchronously and events may not fire.

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

11 months agoDFG/FTL: We should prefetch structures and do a loadLoadFence before doing PrototypeC...
mark.lam@apple.com [Thu, 29 Aug 2019 06:49:28 +0000 (06:49 +0000)]
DFG/FTL: We should prefetch structures and do a loadLoadFence before doing PrototypeChainIsSane checks.
https://bugs.webkit.org/show_bug.cgi?id=201281
<rdar://problem/54028228>

Reviewed by Yusuke Suzuki and Saam Barati.

JSTests:

* stress/structure-storedPrototype-should-only-assert-on-the-mutator-thread.js: Added.

Source/JavaScriptCore:

This (see title above) is already the preferred idiom used in most places in our
compiler, except for 2: DFG's SpeculativeJIT::compileGetByValOnString() and FTL's
compileStringCharAt().  Consider the following:

    bool prototypeChainIsSane = false;
    if (globalObject->stringPrototypeChainIsSane()) {
        ...
        m_graph.registerAndWatchStructureTransition(globalObject->stringPrototype()->structure(vm()));
        m_graph.registerAndWatchStructureTransition(globalObject->objectPrototype()->structure(vm()));

        prototypeChainIsSane = globalObject->stringPrototypeChainIsSane();
    }

What's essential for correctness here is that the stringPrototype and objectPrototype
structures be loaded before the loads in the second stringPrototypeChainIsSane()
check.  Without a loadLoadFence before the second stringPrototypeChainIsSane()
check, we can't guarantee that.  Elsewhere in the compiler, the preferred idiom
for doing this right is to pre-load the structures first, do a loadLoadFence, and
then do the IsSane check just once after e.g.

    Structure* arrayPrototypeStructure = globalObject->arrayPrototype()->structure(m_vm);
    Structure* objectPrototypeStructure = globalObject->objectPrototype()->structure(m_vm);

    if (arrayPrototypeStructure->transitionWatchpointSetIsStillValid() // has loadLoadFences.
        && objectPrototypeStructure->transitionWatchpointSetIsStillValid() // has loadLoadFences.
        && globalObject->arrayPrototypeChainIsSane()) {

        m_graph.registerAndWatchStructureTransition(arrayPrototypeStructure);
        m_graph.registerAndWatchStructureTransition(objectPrototypeStructure);
        ...
    }

This patch changes DFG's SpeculativeJIT::compileGetByValOnString() and FTL's
compileStringCharAt() to follow the same idiom.

We also fix a bad assertion in Structure::storedPrototype() and
Structure::storedPrototypeObject().  The assertion is only correct when those
methods are called from the mutator thread.  The assertion has been updated to
only check its test condition if the current thread is the mutator thread.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileGetByValOnString):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileStringCharAt):
* runtime/StructureInlines.h:
(JSC::Structure::storedPrototype const):
(JSC::Structure::storedPrototypeObject const):

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

11 months agoWeb Inspector: REGRESSION(r249078): JavaScript autocomplete doesn't work when evaluat...
drousso@apple.com [Thu, 29 Aug 2019 06:46:27 +0000 (06:46 +0000)]
Web Inspector: REGRESSION(r249078): JavaScript autocomplete doesn't work when evaluating properties of values
https://bugs.webkit.org/show_bug.cgi?id=201226

Reviewed by Joseph Pecoraro.

r249078 modified `WI.JavaScriptRuntimeCompletionProvider` to use arrays of property names
instead of objects for completion, but a few code paths were missed.

* UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
(WI.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.evaluated):
(WI.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.receivedPropertyNamesFromEvaluate):
(WI.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.receivedObjectPropertyNames): Added.
(WI.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.receivedArrayPropertyNames):

* UserInterface/Models/CallFrame.js:
(WI.CallFrame.prototype.collectScopeChainVariableNames):
(WI.CallFrame.prototype.collectScopeChainVariableNames.propertiesCollected):

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

11 months ago[Win] MiniBrowser crashes in WKURLCopyString if WKPageCopyActiveURL returns null
Hironori.Fujii@sony.com [Thu, 29 Aug 2019 06:26:38 +0000 (06:26 +0000)]
[Win] MiniBrowser crashes in WKURLCopyString if WKPageCopyActiveURL returns null
https://bugs.webkit.org/show_bug.cgi?id=201215

Reviewed by Don Olmstead.

MiniBrowser crashed if it was going to go to a unreachable page
because WKPageCopyActiveURL returned a nullptr.

* MiniBrowser/win/WebKitBrowserWindow.cpp:
(createString): Added null checking of the argument.

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

11 months ago[Nicosia] Implement layer representation retain, release mechanics
zandobersek@gmail.com [Thu, 29 Aug 2019 06:13:42 +0000 (06:13 +0000)]
[Nicosia] Implement layer representation retain, release mechanics
https://bugs.webkit.org/show_bug.cgi?id=201133

Reviewed by Carlos Garcia Campos.

* page/scrolling/nicosia/ScrollingStateNodeNicosia.cpp:
(WebCore::LayerRepresentation::retainPlatformLayer):
Type-cast the layer object to the reference-counted
Nicosia::PlatformLayer type and reference that object.
(WebCore::LayerRepresentation::releasePlatformLayer):
Ditto, but dereference the object.

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

11 months ago[Nicosia] Add Nicosia::PlatformLayer::accessStaging() helper
zandobersek@gmail.com [Thu, 29 Aug 2019 06:13:04 +0000 (06:13 +0000)]
[Nicosia] Add Nicosia::PlatformLayer::accessStaging() helper
https://bugs.webkit.org/show_bug.cgi?id=201132

Reviewed by Carlos Garcia Campos.

* platform/graphics/nicosia/NicosiaPlatformLayer.h:
(Nicosia::CompositionLayer::accessStaging):
Add an accessor into the staging state of the Nicosia::PlatformLayer
object. This will be needed for the application of scrolling changes
in the asynchronous scrolling system.

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

11 months ago[CoordGraphics] Expose Nicosia layer as the underlying CoordinatedGraphicsLayer platf...
zandobersek@gmail.com [Thu, 29 Aug 2019 06:12:27 +0000 (06:12 +0000)]
[CoordGraphics] Expose Nicosia layer as the underlying CoordinatedGraphicsLayer platform layer
https://bugs.webkit.org/show_bug.cgi?id=201131

Reviewed by Carlos Garcia Campos.

Add the CoordinatedGraphicsLayer::platformLayer() override, returning
the Nicosia::CompositionLayer object as the underlying platform layer.
This will come in handy for asynchronous scrolling.

* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::platformLayer const):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:

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

11 months ago[Nicosia] Polish ScrollingCoordinator implementation
zandobersek@gmail.com [Thu, 29 Aug 2019 06:11:51 +0000 (06:11 +0000)]
[Nicosia] Polish ScrollingCoordinator implementation
https://bugs.webkit.org/show_bug.cgi?id=201130

Reviewed by Carlos Garcia Campos.

These changes primarily mirror the Mac implementation of this class.

* page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp:
(WebCore::ScrollingCoordinatorNicosia::pageDestroyed):
Upon releasing the ThreadedScrollingTree, it should also be invalidated
on the scrolling thread.
(WebCore::ScrollingCoordinatorNicosia::commitTreeState):
Invoke willCommitTree() at the beginning of this method. Additionally
the pending-commit-count is incremented for the ThreadedScrollingTree
object.

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

11 months agoMake tabIndex IDL attribute reflect its content attribute
rniwa@webkit.org [Thu, 29 Aug 2019 03:14:24 +0000 (03:14 +0000)]
Make tabIndex IDL attribute reflect its content attribute
https://bugs.webkit.org/show_bug.cgi?id=199606
<rdar://problem/52811448>

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* web-platform-tests/html/dom/reflection-misc-expected.txt: Rebaselined now that test cases for summary are passing.

Source/WebCore:

This patch makes tabIndex IDL attribute no longer return 0 when the element is focusable
to match the latest HTML5 specification. Instead, the IDL attribute simply reflect the tabindex
content attribute with some elements having 0 as the default tab index (see r248784):
https://html.spec.whatwg.org/multipage/interaction.html#the-tabindex-attribute

The practical implication is that tabIndex IDL attribute on a root editable element (a.k.a.
editing host in HTML5 spec term), body element in design mode, and media elements with
media controls would start returning -1 instead of 0.

Mechanically, this is accomplished by removing the special case in Element::tabIndexForBindings
when supportsFocus returned true. The effect, if any, this patch has on each element which
overrides Element::supportsFocus is summarized as follows (indentation simplies inheritance):

HTMLAnchorElement -> No effect since defaultTabIndex returns 0.
    HTMLAreaElement -> Ditto.
HTMLBodyElement -> Changes to return -1 in design mode.
HTMLElement -> Changes to return -1 on a root editable element.
HTMLFormControlElement
    HTMLButtonElement -> No effect since defaultTabIndex returns 0.
    HTMLFieldSetElement -> No effect since this is an override to use HTMLElement's supportsFocus.
    HTMLFormControlElementWithState
        HTMLKeygenElement -> No effect since defaultTabIndex returns 0.
        HTMLSelectElement -> Ditto.
        HTMLTextFormControlElement -> Ditto.
            HTMLInputElement -> Ditto.
            HTMLTextAreaElement -> Ditto.
    HTMLOutputElement -> No effect since this is an override to use HTMLElement's supportsFocus.
HTMLFrameElementBase - No change. Added defaultTabIndex on HTMLIFrameElement and HTMLFrameElement
    to returns 0.
HTMLImageElement - No impact since it only affects when an image is set to be editable via SPI.
HTMLMediaElement - Changes to return -1 when media controls is present.
HTMLPlugInElement - applet and embed elements change to return -1 when the plugin is available.
HTMLSummaryElement - No change. Added defaultTabIndex to return 0 when it's active to match
    supportsFocus as well as the HTML5 specification.
MathMLElement - No effect since tabIndex IDL attribute does not exist in MathML.
SVGAElement - No effect since defaultTabIndex returns 0.
SVGClipPathElement - No effect since it always returns false.
SVGDefsElement - No effect since it always returns false.

Tests: fast/dom/tabindex-defaults.html
       plugins/focus.html

* dom/Element.cpp:
(WebCore::Element::tabIndexForBindings const): Made the change.
* html/HTMLFrameElement.cpp:
(WebCore::HTMLFrameElement::defaultTabIndex const): Added to preserve the existing behavior.
* html/HTMLFrameElement.h:
* html/HTMLIFrameElement.cpp:
(WebCore::HTMLIFrameElement::defaultTabIndex const): Ditto.
* html/HTMLIFrameElement.h:
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::defaultTabIndex const): Added. Always return 0 to match the spec.
* html/HTMLObjectElement.h:
* html/HTMLSummaryElement.cpp:
(WebCore::HTMLSummaryElement::defaultTabIndex const): Added. Return 0 when the this summary
is the active summary element of the details element.
* html/HTMLSummaryElement.h:

LayoutTests:

Added test cases and assertions.

* fast/dom/tabindex-defaults-expected.txt:
* fast/dom/tabindex-defaults.html: Added test cases for iframe, frame, object, video, summary, and SVG elements.
Also blur the active element to avoid any race conditions.
* plugins/focus-expected.txt:
* plugins/focus.html:
* svg/custom/tabindex-order-expected.txt:
* svg/custom/tabindex-order.html: Made the sequential navigation code not rely on tabIndex IDL attribute.

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

11 months agoMake FillLayer::hasImage() inline
simon.fraser@apple.com [Thu, 29 Aug 2019 03:01:39 +0000 (03:01 +0000)]
Make FillLayer::hasImage() inline
https://bugs.webkit.org/show_bug.cgi?id=201265

Reviewed by Zalan Bujtas.

FillLayer::hasImage() shows up on profiles because it's called from hot functions like
isTransparent() and hasMask(), so make a basic inline version that doens't have
to walk the list.

* rendering/style/FillLayer.cpp:
(WebCore::FillLayer::hasImageInAnyLayer const):
(WebCore::FillLayer::hasImage const): Deleted.
* rendering/style/FillLayer.h:
(WebCore::FillLayer::hasImage const):

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

11 months agoREGRESSION: String check: “realtime” Suggesting “real time”
commit-queue@webkit.org [Thu, 29 Aug 2019 02:40:37 +0000 (02:40 +0000)]
REGRESSION: String check: “realtime” Suggesting “real time”
https://bugs.webkit.org/show_bug.cgi?id=201107
<rdar://problem/46372620>

Patch by Peng Liu <peng.liu6@apple.com> on 2019-08-28
Reviewed by Jer Noble.

Update Localizable.strings.

No new test.

* en.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::localizedMediaControlElementString):

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

11 months agoPaintFrequencyTracker triggers too many calls to MonotonicTime::now() on layer painting
simon.fraser@apple.com [Thu, 29 Aug 2019 02:24:03 +0000 (02:24 +0000)]
PaintFrequencyTracker triggers too many calls to MonotonicTime::now() on layer painting
https://bugs.webkit.org/show_bug.cgi?id=201261

Reviewed by Zalan Bujtas.

MonotonicTime::now() shows up as expensive when painting layer-heavy content, because PaintFrequencyTracker
makes two calls per layer paint.

Halve the number of calls by storing m_lastPaintTime at the start of the paint; doing so doesn't substantially
change the behavior of the tracker.

* rendering/PaintFrequencyTracker.h:
(WebCore::PaintFrequencyTracker::begin):
(WebCore::PaintFrequencyTracker::end):

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

11 months agoReloading a web view with a fixed-width viewport and variable content width restores...
timothy_horton@apple.com [Thu, 29 Aug 2019 02:07:35 +0000 (02:07 +0000)]
Reloading a web view with a fixed-width viewport and variable content width restores the previous page scale, shouldn't
https://bugs.webkit.org/show_bug.cgi?id=201256
<rdar://problem/54809509>

Reviewed by Simon Fraser.

Source/WebKit:

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::restorePageState):
When restoring page state from a history item, if the saved scale was equal to the
initial scale at the time it was saved, ignore the saved scale and use the current
initial scale instead.

Normally this doesn't matter because a given page's initial scale doesn't usually change
between loads, but it totally can! See the test for one example of a way an API client
might cause this; you could also imagine something similar happening if the actual
page content changed.

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit/long-email-viewport.html: Added.
* TestWebKitAPI/Tests/WebKitCocoa/ReloadWithDifferingInitialScale.mm: Added.
(TestWebKitAPI::TEST):
Add a test. I left many comments because I had a great deal of trouble
writing this test and wanted to document my findings.

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

11 months agoresults.webkit.org: Do not display branch selector if only one branches available
jbedard@apple.com [Thu, 29 Aug 2019 00:44:28 +0000 (00:44 +0000)]
results.webkit.org: Do not display branch selector if only one branches available
https://bugs.webkit.org/show_bug.cgi?id=201244

Rubber-stamped by Aakash Jain.

* resultsdbpy/resultsdbpy/view/static/js/drawer.js: Hide the branch selector's
container if there aren't multiple branches to choose from.

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

11 months agoWKAttachmentTests.DropFolderAsAttachmentAndMoveByDragging fails in some iOS simulator...
wenson_hsieh@apple.com [Thu, 29 Aug 2019 00:01:03 +0000 (00:01 +0000)]
WKAttachmentTests.DropFolderAsAttachmentAndMoveByDragging fails in some iOS simulator configurations
https://bugs.webkit.org/show_bug.cgi?id=201241
<rdar://problem/54317588>

Reviewed by Tim Horton.

For reasons that are still unknown, it's possible for iOS 13 simulators to get into a state where the IPC
communication delay between the web and UI processes can become extraordinarily long. Under these circumstances,
the drag and drop harness fails to simulate a drop, since it ends up firing all scheduled calls to
-dropInteraction:sessionDidUpdate: before the first response from the web process arrives in the UI process, so
it believes that the web view has rejected the drop from being handled.

Instead, make the drag and drop simulator robust by ensuring a presentation update between drop session updates,
to make sure that the web process has had time to send a response after each update.

* TestWebKitAPI/ios/DragAndDropSimulatorIOS.mm:
(-[DragAndDropSimulator _advanceProgress]):

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

11 months agoPlacate exception check validation in DFG's operationHasGenericProperty().
mark.lam@apple.com [Wed, 28 Aug 2019 23:11:17 +0000 (23:11 +0000)]
Placate exception check validation in DFG's operationHasGenericProperty().
https://bugs.webkit.org/show_bug.cgi?id=201245
<rdar://problem/54777512>

Reviewed by Robin Morisset.

JSTests:

* stress/missing-exception-check-in-operationHasGenericProperty.js: Added.

Source/JavaScriptCore:

* dfg/DFGOperations.cpp:

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

11 months agoNull check webFrame when creating a print preview to prevent a crash.
megan_gardner@apple.com [Wed, 28 Aug 2019 23:07:40 +0000 (23:07 +0000)]
Null check webFrame when creating a print preview to prevent a crash.
https://bugs.webkit.org/show_bug.cgi?id=201237
<rdar://problem/51618863>

Reviewed by Tim Horton.

Source/WebKit:

Move and expend a null check to keep from crashing when making a print preview.

* UIProcess/mac/WKPrintingView.mm:
(-[WKPrintingView _drawPreview:]):
(-[WKPrintingView drawRect:]):

Tools:

Test to verify that if we don't have the WebPageProxy, we will not crash when making a print preview.

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

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

11 months agoUnreviewed. Restabilize non-unified build.
ross.kirsling@sony.com [Wed, 28 Aug 2019 22:52:29 +0000 (22:52 +0000)]
Unreviewed. Restabilize non-unified build.

Source/JavaScriptCore:

* runtime/PropertySlot.h:

Source/WebCore:

* inspector/agents/WebConsoleAgent.h:
* loader/ResourceLoadObserver.h:

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

11 months agoDevirtualize RenderBox::visualOverflowRect()
simon.fraser@apple.com [Wed, 28 Aug 2019 22:32:01 +0000 (22:32 +0000)]
Devirtualize RenderBox::visualOverflowRect()
https://bugs.webkit.org/show_bug.cgi?id=201231

Reviewed by Zalan Bujtas.

The only override of RenderBox::visualOverflowRect() was in RenderView, for "paintsEntireContents" views, and as
far as I can tell this is not necessary. visualOverflowRect() is hot when called from RenderLayer::localBoundingBox() --
this shows in profiles when scrolling large patch reviews, so making it non-virtual is a performance enhancement.

RenderLayer::localBoundingBox() can also just call visualOverflowRect(), since that returns borderBoxRect()
when there is no overflow.

* rendering/RenderBox.h:
(WebCore::RenderBox::visualOverflowRect const):
* rendering/RenderLayer.cpp:
(WebCore::performOverlapTests): Minor optimization to avoid a call to boundingBox().
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderView.cpp:
(WebCore::RenderView::visualOverflowRect const): Deleted.
* rendering/RenderView.h:

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

11 months agoWasm's AirIRGenerator::addLocal() and B3IRGenerator::addLocal() are doing unnecessary...
mark.lam@apple.com [Wed, 28 Aug 2019 21:24:47 +0000 (21:24 +0000)]
Wasm's AirIRGenerator::addLocal() and B3IRGenerator::addLocal() are doing unnecessary overflow checks.
https://bugs.webkit.org/show_bug.cgi?id=201006
<rdar://problem/52053991>

Reviewed by Yusuke Suzuki.

We already ensured that it is not possible to overflow in Wasm::FunctionParser's
parse().  It is unnecessary and misleading to do those overflow checks in
AirIRGenerator and B3IRGenerator.  The only check that is necessary is that
m_locals.tryReserveCapacity() is successful, otherwise, we have an out of memory
situation.

This patch changes these unnecessary checks to assertions instead.

* wasm/WasmAirIRGenerator.cpp:
(JSC::Wasm::AirIRGenerator::addLocal):
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::addLocal):
* wasm/WasmValidate.cpp:
(JSC::Wasm::Validate::addLocal):

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

11 months agoUnreviewed, fix test failure after r249173
drousso@apple.com [Wed, 28 Aug 2019 21:23:01 +0000 (21:23 +0000)]
Unreviewed, fix test failure after r249173

* inspector/timeline/line-column-expected.txt:

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

11 months agoCreate ANGLE EGL Context with all extensions disabled by default
commit-queue@webkit.org [Wed, 28 Aug 2019 20:34:19 +0000 (20:34 +0000)]
Create ANGLE EGL Context with all extensions disabled by default
https://bugs.webkit.org/show_bug.cgi?id=200900

Patch by Austin Eng <enga@chromium.org> on 2019-08-28
Reviewed by Alex Christensen.

In WebGL, extensions must be explicitly requested before they are enabled.
Fixes the following WebGL conformance tests with the ANGLE backend
LayoutTests/webgl/*/conformance/extensions/ext-blend-minmax.html
LayoutTests/webgl/*/conformance/extensions/ext-frag-depth.html
LayoutTests/webgl/*/conformance/extensions/ext-shader-texture-lod.html
LayoutTests/webgl/*/conformance/extensions/ext-sRGB.html
LayoutTests/webgl/*/conformance/extensions/oes-standard-derivatives.html
LayoutTests/webgl/*/conformance/extensions/oes-texture-float.html
LayoutTests/webgl/*/conformance/extensions/webgl-compressed-texture-s3tc.html
LayoutTests/webgl/*/conformance/glsl/misc/shader-with-dfdx.frag.html
LayoutTests/webgl/*/conformance/glsl/variables/glsl-built-ins.html
LayoutTests/webgl/*/conformance/textures/misc/texture-npot-video.html
LayoutTests/webgl/*/conformance/textures/misc/texture-npot.html

* html/canvas/ANGLEInstancedArrays.cpp:
(WebCore::ANGLEInstancedArrays::ANGLEInstancedArrays):
(WebCore::ANGLEInstancedArrays::supported):
* html/canvas/WebGLCompressedTextureASTC.cpp:
(WebCore::WebGLCompressedTextureASTC::WebGLCompressedTextureASTC):
* html/canvas/WebGLCompressedTextureATC.cpp:
(WebCore::WebGLCompressedTextureATC::WebGLCompressedTextureATC):
* html/canvas/WebGLCompressedTexturePVRTC.cpp:
(WebCore::WebGLCompressedTexturePVRTC::WebGLCompressedTexturePVRTC):
* html/canvas/WebGLCompressedTextureS3TC.cpp:
(WebCore::WebGLCompressedTextureS3TC::WebGLCompressedTextureS3TC):
(WebCore::WebGLCompressedTextureS3TC::supported):
* html/canvas/WebGLDebugShaders.cpp:
(WebCore::WebGLDebugShaders::WebGLDebugShaders):
* html/canvas/WebGLDepthTexture.cpp:
(WebCore::WebGLDepthTexture::WebGLDepthTexture):
* html/canvas/WebGLDrawBuffers.cpp:
(WebCore::WebGLDrawBuffers::WebGLDrawBuffers):
(WebCore::WebGLDrawBuffers::supported):
* platform/graphics/angle/GraphicsContext3DANGLE.cpp:
(WebCore::GraphicsContext3D::reshapeFBOs):
(WebCore::GraphicsContext3D::validateDepthStencil):
* platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
(WebCore::GraphicsContext3D::GraphicsContext3D):

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

11 months agoAll image drawing functions should take an argument of type ImagePaintingOptions
commit-queue@webkit.org [Wed, 28 Aug 2019 20:23:39 +0000 (20:23 +0000)]
All image drawing functions should take an argument of type ImagePaintingOptions
https://bugs.webkit.org/show_bug.cgi?id=201059

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-08-28
Reviewed by Simon Fraser.

Source/WebCore:

In this patch:
-- All the image drawing function will take an argument of type
   ImagePaintingOptions instead of passing individual options.

-- ImagePaintingOptions is made like a set of options. It can be
   initialized with any number of options and the order does not matter

-- Image::originalSize() is deleted because it returns size() and none
   of the Image concrete classes overrides this implementation.

* Headers.cmake:
* WebCore.xcodeproj/project.pbxproj:
* html/ImageBitmap.cpp:
(WebCore::ImageBitmap::createPromise):
(WebCore::ImageBitmap::createFromBuffer):
* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::drawImage):
(WebCore::drawImageToContext):
(WebCore::CanvasRenderingContext2DBase::fullCanvasCompositedDrawImage):
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::draw):
(WebCore::BitmapImage::drawPattern):
* platform/graphics/BitmapImage.h:
* platform/graphics/CrossfadeGeneratedImage.cpp:
(WebCore::drawCrossfadeSubimage):
(WebCore::CrossfadeGeneratedImage::draw):
(WebCore::CrossfadeGeneratedImage::drawPattern):
* platform/graphics/CrossfadeGeneratedImage.h:
* platform/graphics/CustomPaintImage.cpp:
(WebCore::CustomPaintImage::draw):
(WebCore::CustomPaintImage::drawPattern):
* platform/graphics/CustomPaintImage.h:
* platform/graphics/GeneratedImage.h:
(WebCore::GeneratedImage::draw):
(WebCore::GeneratedImage::drawPattern):
* platform/graphics/GradientImage.cpp:
(WebCore::GradientImage::draw):
(WebCore::GradientImage::drawPattern):
* platform/graphics/GradientImage.h:
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::drawImage):
(WebCore::GraphicsContext::drawTiledImage):
(WebCore::GraphicsContext::drawImageBuffer):
(WebCore::GraphicsContext::drawConsumingImageBuffer):
* platform/graphics/GraphicsContext.h:
(WebCore::GraphicsContext::drawNativeImage):
(WebCore::GraphicsContext::drawImage):
(WebCore::GraphicsContext::drawTiledImage):
(WebCore::GraphicsContext::drawImageBuffer):
(WebCore::GraphicsContext::drawPattern):
(WebCore::GraphicsContext::drawConsumingImageBuffer):
(WebCore::ImagePaintingOptions::ImagePaintingOptions): Deleted.
(WebCore::ImagePaintingOptions::usesDefaultInterpolation const): Deleted.
* platform/graphics/GraphicsContextImpl.cpp:
(WebCore::GraphicsContextImpl::drawImageImpl):
(WebCore::GraphicsContextImpl::drawTiledImageImpl):
* platform/graphics/GraphicsContextImpl.h:
* platform/graphics/Image.cpp:
(WebCore::Image::drawPattern):
(WebCore::Image::drawTiled):
(WebCore::Image::computeIntrinsicDimensions):
* platform/graphics/Image.h:
(WebCore::Image::drawPattern):
(WebCore::Image::draw):
(WebCore::Image::drawTiled):
(WebCore::Image::originalSize const): Deleted.
* platform/graphics/ImageBuffer.h:
(WebCore::ImageBuffer::draw):
(WebCore::ImageBuffer::drawPattern):
(WebCore::ImageBuffer::drawConsuming):
* platform/graphics/ImagePaintingOptions.h: Added.
(WebCore::ImagePaintingOptions::ImagePaintingOptions):
(WebCore::ImagePaintingOptions::compositeOperator const):
(WebCore::ImagePaintingOptions::blendMode const):
(WebCore::ImagePaintingOptions::decodingMode const):
(WebCore::ImagePaintingOptions::orientation const):
(WebCore::ImagePaintingOptions::interpolationQuality const):
(WebCore::ImagePaintingOptions::setOption):
* platform/graphics/NamedImageGeneratedImage.cpp:
(WebCore::NamedImageGeneratedImage::draw):
(WebCore::NamedImageGeneratedImage::drawPattern):
* platform/graphics/NamedImageGeneratedImage.h:
* platform/graphics/NativeImage.h:
* platform/graphics/cairo/CairoOperations.cpp:
(WebCore::Cairo::drawShadowLayerBuffer):
(WebCore::Cairo::drawShadowImage):
(WebCore::Cairo::drawNativeImage):
(WebCore::Cairo::drawPattern):
* platform/graphics/cairo/CairoOperations.h:
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::drawNativeImage):
(WebCore::GraphicsContext::drawPattern):
* platform/graphics/cairo/GraphicsContextImplCairo.cpp:
(WebCore::GraphicsContextImplCairo::drawNativeImage):
(WebCore::GraphicsContextImplCairo::drawPattern):
* platform/graphics/cairo/GraphicsContextImplCairo.h:
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBuffer::drawConsuming):
(WebCore::ImageBuffer::draw):
(WebCore::ImageBuffer::drawPattern):
* platform/graphics/cairo/NativeImageCairo.cpp:
(WebCore::drawNativeImage):
* platform/graphics/cg/GraphicsContext3DCG.cpp:
(WebCore::GraphicsContext3D::paintToCanvas):
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::drawNativeImage):
(WebCore::GraphicsContext::drawPattern):
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::drawConsuming):
(WebCore::ImageBuffer::draw):
(WebCore::ImageBuffer::drawPattern):
* platform/graphics/cg/NativeImageCG.cpp:
(WebCore::drawNativeImage):
* platform/graphics/cg/PDFDocumentImage.cpp:
(WebCore::PDFDocumentImage::draw):
* platform/graphics/cg/PDFDocumentImage.h:
* platform/graphics/displaylists/DisplayListItems.cpp:
(WebCore::DisplayList::DrawNativeImage::DrawNativeImage):
(WebCore::DisplayList::DrawNativeImage::apply const):
(WebCore::DisplayList::DrawPattern::DrawPattern):
(WebCore::DisplayList::DrawPattern::apply const):
* platform/graphics/displaylists/DisplayListItems.h:
(WebCore::DisplayList::DrawNativeImage::create):
(WebCore::DisplayList::DrawPattern::create):
(WebCore::DisplayList::DrawPattern::DrawPattern):
* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::drawNativeImage):
(WebCore::DisplayList::Recorder::drawPattern):
* platform/graphics/displaylists/DisplayListRecorder.h:
* platform/graphics/filters/FEBlend.cpp:
(WebCore::FEBlend::platformApplySoftware):
* platform/graphics/filters/FEComposite.cpp:
(WebCore::FEComposite::platformApplySoftware):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::paint):
* platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp:
(Nicosia::CairoOperationRecorder::drawNativeImage):
(Nicosia::CairoOperationRecorder::drawPattern):
* platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h:
* platform/graphics/win/Direct2DOperations.cpp:
(WebCore::Direct2D::drawNativeImage):
(WebCore::Direct2D::drawPattern):
* platform/graphics/win/Direct2DOperations.h:
* platform/graphics/win/GraphicsContextImplDirect2D.h:
* platform/graphics/win/ImageCGWin.cpp:
(WebCore::BitmapImage::getHBITMAPOfSize):
(WebCore::BitmapImage::drawFrameMatchingSourceSize):
* platform/graphics/win/ImageCairoWin.cpp:
(WebCore::BitmapImage::getHBITMAPOfSize):
(WebCore::BitmapImage::drawFrameMatchingSourceSize):
* platform/graphics/win/NativeImageDirect2D.cpp:
(WebCore::drawNativeImage):
* platform/ios/DragImageIOS.mm:
(WebCore::createDragImageFromImage):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::paintSnapshotImage):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintReplaced):
(WebCore::RenderImage::paintIntoRect):
* rendering/RenderSnapshottedPlugIn.cpp:
(WebCore::RenderSnapshottedPlugIn::paintSnapshot):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintSnapshottedPluginOverlay):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::drawForContainer):
(WebCore::SVGImage::nativeImageForCurrentFrame):
(WebCore::SVGImage::nativeImage):
(WebCore::SVGImage::drawPatternForContainer):
(WebCore::SVGImage::draw):
* svg/graphics/SVGImage.h:
* svg/graphics/SVGImageForContainer.cpp:
(WebCore::SVGImageForContainer::draw):
(WebCore::SVGImageForContainer::drawPattern):
* svg/graphics/SVGImageForContainer.h:

Source/WebKit:

GraphicsContext::drawImage() now takes an ImagePaintingOptions.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::imagePositionInformation):

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

11 months agoXLinkNames namespace is required before the 'href' attribute of SVG animate elements
commit-queue@webkit.org [Wed, 28 Aug 2019 19:57:00 +0000 (19:57 +0000)]
XLinkNames namespace is required before the 'href' attribute of SVG animate elements
https://bugs.webkit.org/show_bug.cgi?id=201227

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-08-28
Reviewed by Ryosuke Niwa.

Source/WebCore:

To get the animation target element, get the value of the "href" attribute
or the "xlink:href" attribute.

Tests: svg/custom/href-svg-namespace-animate-target.svg

* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::buildPendingResource):

LayoutTests:

* svg/custom/href-svg-namespace-animate-target-expected.svg: Added.
* svg/custom/href-svg-namespace-animate-target.svg: Added.

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

11 months agoUnreviewed, rolling out r249209.
tsavell@apple.com [Wed, 28 Aug 2019 19:51:06 +0000 (19:51 +0000)]
Unreviewed, rolling out r249209.

Broke 19 webgpu/ tests

Reverted changeset:

"[WHLSL] Inline typedef'd types during Metal code generation
to simplify generated code while also making it easier to
read"
https://bugs.webkit.org/show_bug.cgi?id=201185
https://trac.webkit.org/changeset/249209

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

11 months ago[WHLSL] Matrices need to have correct alignment
mmaxfield@apple.com [Wed, 28 Aug 2019 19:46:36 +0000 (19:46 +0000)]
[WHLSL] Matrices need to have correct alignment
https://bugs.webkit.org/show_bug.cgi?id=201212

Reviewed by Robin Morisset.

Source/WebCore:

Matrices have particular alignment requirements and size requirements.

  Type   | Alignment | Size
---------------------------
float2x2 |         8 |   16
float2x3 |        16 |   32
float2x4 |        16 |   32
float3x2 |         8 |   24
float3x3 |        16 |   48
float3x4 |        16 |   48
float4x2 |         8 |   32
float4x3 |        16 |   64
float4x4 |        16 |   64

These are important because they may be a member of a struct, and we don't want to misplace
every successive item in the struct.

Test: webgpu/whlsl/matrix-alignment.html

* Modules/webgpu/WHLSL/Metal/WHLSLNativeTypeWriter.cpp:
(WebCore::WHLSL::Metal::writeNativeType):

LayoutTests:

Test the alignment and size of float matrices.

Intentionally don't test bool matrices, because they can't be placed in buffers,
meaning their size and alignment is unobservable.

* webgpu/whlsl/matrix-alignment-expected.txt: Added.
* webgpu/whlsl/matrix-alignment.html: Added.

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

11 months agoresults.webkit.org: Move drawer to the right, open by default
jbedard@apple.com [Wed, 28 Aug 2019 19:36:23 +0000 (19:36 +0000)]
results.webkit.org: Move drawer to the right, open by default
https://bugs.webkit.org/show_bug.cgi?id=200977

Rubber-stamped by Aakash Jain.

The drawer was both unpopular and not discoverable. After feedback from bot watchers,
moving the drawer to the right side of the screen, opening it by default and have it displace
instead of hide the main content.

* resultsdbpy/resultsdbpy/view/commit_view_unittest.py:
(CommitViewUnittest.test_drawer): Support new drawer style.
(CommitViewUnittest.test_range_slider): Ditto.
(CommitViewUnittest.test_one_line_switch): Ditto.
(CommitViewUnittest.test_branch_selection): Ditto.
* resultsdbpy/resultsdbpy/view/static/css/drawer.css: Removed.
* resultsdbpy/resultsdbpy/view/static/js/drawer.js:
(setEnableRecursive): Disable all elements underneath this one
(Drawer): Make drawer a sidebar.
* resultsdbpy/resultsdbpy/view/static/library/css/webkit.css:
(.header>.title, .topbar>.title): Overflow of titles should be hidden.
(:root): Move boldInverseColor into webkit.css.
(@media (prefers-color-scheme: dark)):
(.sidebar): Sidebars on mobile should behave like drawers.
(.sidebar.hidden): Add concept of hidden sidebar.
(.mobile-sidebar-control): Add a control to collapse sidebar that only exists on mobile.
(.mobile-sidebar-control.display):
(.main.under-topbar-with-actions):
(@media screen and (min-width: 600px) and (orientation: landscape)):
(.sidebar.left.hidden):
(.sidebar.right.hidden):
(.main.right.hidden):
(.main.left.hidden):
(@media screen and (min-width: 768px) and (orientation: landscape)):
(.sidebar.right):
(a.disabled): Add ability to disable a link.
(.desktop-control): Add a control which only exists on desktop.
* resultsdbpy/resultsdbpy/view/templates/base.html: Add hamburger drawer-button for mobile.
* resultsdbpy/resultsdbpy/view/templates/commits.html: Use main since Drawer is now a sidebar.
* resultsdbpy/resultsdbpy/view/templates/documentation.html: Ditto.
* resultsdbpy/resultsdbpy/view/templates/search.html: Ditto.
* resultsdbpy/resultsdbpy/view/templates/suite_results.html: Ditto.
* resultsdbpy/resultsdbpy/view/view_routes_unittest.py:
(WebSiteTestCase.toggle_drawer): Support new drawer style.
(WebSiteTestCase.find_input_with_name): Ditto.

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

11 months agoImplement HTMLOrForeignElement
commit-queue@webkit.org [Wed, 28 Aug 2019 19:34:43 +0000 (19:34 +0000)]
Implement HTMLOrForeignElement
https://bugs.webkit.org/show_bug.cgi?id=201219

Patch by Rob Buis <rbuis@igalia.com> on 2019-08-28
Reviewed by Ryosuke Niwa.

Source/WebCore:

Add the HTMLOrForeignElement [1] interface to share properties
and methods between HTML, SVG and MathML.

[1] https://github.com/mathml-refresh/mathml/issues/83

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/StaticRange.h:
* html/HTMLElement.idl:
* html/HTMLOrForeignElement.idl: Added.
* svg/SVGElement.idl:

LayoutTests:

Adjust test expectations to new HTMLOrForeignElement interface.

* js/dom/dom-static-property-for-in-iteration-expected.txt:
* platform/mac-wk2/js/dom/dom-static-property-for-in-iteration-expected.txt:
* platform/mac/inspector/model/remote-object-dom-expected.txt:

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

11 months agoGenerateTAPI WebKitLegacy.tbd fails on internal iOS Simulator builds
dino@apple.com [Wed, 28 Aug 2019 19:19:41 +0000 (19:19 +0000)]
GenerateTAPI WebKitLegacy.tbd fails on internal iOS Simulator builds
https://bugs.webkit.org/show_bug.cgi?id=201200

Reviewed by Simon Fraser.

We want to include Foundation/NSURLDownload.h if we're on
a newer iOS.

* Misc/WebDownload.h:

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

11 months ago[WHLSL] Inline typedef'd types during Metal code generation to simplify generated...
weinig@apple.com [Wed, 28 Aug 2019 18:11:12 +0000 (18:11 +0000)]
[WHLSL] Inline typedef'd types during Metal code generation to simplify generated code while also making it easier to read
https://bugs.webkit.org/show_bug.cgi?id=201185

Reviewed by Saam Barati.

The current Metal code generation generates many unnecessary typedefs during TypeNamer::emitMetalTypeDefinitions
such as 'typedef float2 type19;' that can be removed by just using resolved type whereever the typedef would have
been used. The only types that actually need to be predefined are the types that declare a new struct or enum, which
means we can stop emitting for AST::TypeReference, AST::Pointer, AST::Array, and AST::TypeDefinition. Instead, the
relevent mangledNameForType constructs the computed name on the fly.

This is a 25% speedup in the metal code generation phase.

* Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
Switch to using auto rather than Mangled*Name when it is obvious and the actual return type
may need to become more complicated (e.g. MangledOrNativeTypeName).

* Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.h:
* Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
(WebCore::WHLSL::Metal::TypeNamer::visit):
There is no need to generate typenames for AST::TypeDefinitions if they are never used.

(WebCore::WHLSL::Metal::TypeNamer::generateUniquedTypeName):
The only UnnamedType that needs a generated typename now is AST::ArrayReferenceType, which emits a struct interface.

(WebCore::WHLSL::Metal::TypeNamer::emitUnnamedTypeDefinition):
Stop generating type definitions for AST::TypeReference, AST::Pointer, AST::Array.

(WebCore::WHLSL::Metal::TypeNamer::emitNamedTypeDefinition):
Stop generating type definitions for AST::TypeDefinition.

(WebCore::WHLSL::Metal::TypeNamer::emitMetalTypeDefinitions):
Update for rename from m_unnamedTypeMapping to m_arrayReferenceTypeMapping.

(WebCore::WHLSL::Metal::TypeNamer::mangledNameForType):
Look into the types and generate a concrete type name when necessary. Lazily cache the constructed
names for AST::ArrayType and AST::Pointer.

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

11 months agoRemove support for macOS < 10.13 (part 2)
krollin@apple.com [Wed, 28 Aug 2019 17:40:26 +0000 (17:40 +0000)]
Remove support for macOS < 10.13 (part 2)
https://bugs.webkit.org/show_bug.cgi?id=201197
<rdar://problem/54759985>

Source/JavaScriptCore:

Update conditionals that reference WK_MACOS_1013 and suffixes like
_MACOS_SINCE_1013, assuming that we're always building on 10.13 or
later and that these conditionals are always True or False.

See Bug 200694 for earlier changes in this area.

Reviewed by Darin Adler.

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

Reviewed by Darin Adler.

Update conditionals that reference WK_MACOS_1013 and suffixes like
_MACOS_SINCE_1013, assuming that we're always building on 10.13 or
later and that these conditionals are always True or False.

See Bug 200694 for earlier changes in this area.

No new tests -- no new or changed functionality.

* Configurations/FeatureDefines.xcconfig:

Source/WebCore/PAL:

Reviewed by Darin Adler.

Update conditionals that reference WK_MACOS_1013 and suffixes like
_MACOS_SINCE_1013, assuming that we're always building on 10.13 or
later and that these conditionals are always True or False.

See Bug 200694 for earlier changes in this area.

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

Reviewed by Darin Adler.

Update conditionals that reference WK_MACOS_1013 and suffixes like
_MACOS_SINCE_1013, assuming that we're always building on 10.13 or
later and that these conditionals are always True or False.

See Bug 200694 for earlier changes in this area.

* Configurations/FeatureDefines.xcconfig:
* Configurations/WebKit.xcconfig:

Source/WebKitLegacy/mac:

Reviewed by Darin Adler.

Update conditionals that reference WK_MACOS_1013 and suffixes like
_MACOS_SINCE_1013, assuming that we're always building on 10.13 or
later and that these conditionals are always True or False.

See Bug 200694 for earlier changes in this area.

* Configurations/FeatureDefines.xcconfig:

Tools:

Reviewed by Darin Adler.

Update conditionals that reference WK_MACOS_1013 and suffixes like
_MACOS_SINCE_1013, assuming that we're always building on 10.13 or
later and that these conditionals are always True or False.

See Bug 200694 for earlier changes in this area.

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

11 months agogeolocation.watchPosition() / getCurrentPosition() should return PERMISSION_DENIED...
cdumez@apple.com [Wed, 28 Aug 2019 17:20:00 +0000 (17:20 +0000)]
geolocation.watchPosition() / getCurrentPosition() should return PERMISSION_DENIED when context is not secure
https://bugs.webkit.org/show_bug.cgi?id=201221

Reviewed by Ryosuke Niwa.

Source/WebCore:

geolocation.watchPosition() / getCurrentPosition() should return PERMISSION_DENIED when context is not secure,
not POSITION_UNAVAILABLE. Both Gecko and Blink agree on PERMISSION_DENIED.

No new tests, updated existing tests.

* Modules/geolocation/Geolocation.cpp:
(WebCore::Geolocation::startRequest):

LayoutTests:

Update layout tests to reflect behavior change.

* fast/dom/Geolocation/dataURL-getCurrentPosition-expected.txt:
* fast/dom/Geolocation/dataURL-getCurrentPosition.html:
* fast/dom/Geolocation/dataURL-watchPosition-expected.txt:
* fast/dom/Geolocation/dataURL-watchPosition.html:
* http/tests/security/resources/checkThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethod.js:
(didReceiveError):
(checkThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethod):
* http/tests/security/sandboxed-iframe-geolocation-getCurrentPosition-expected.txt:
* http/tests/security/sandboxed-iframe-geolocation-getCurrentPosition.html:
* http/tests/security/sandboxed-iframe-geolocation-watchPosition-expected.txt:
* http/tests/security/sandboxed-iframe-geolocation-watchPosition.html:

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

11 months agoHave WebPageProxy generate the page identifier by itself
cdumez@apple.com [Wed, 28 Aug 2019 17:14:27 +0000 (17:14 +0000)]
Have WebPageProxy generate the page identifier by itself
https://bugs.webkit.org/show_bug.cgi?id=201223

Reviewed by Ryosuke Niwa.

Have WebPageProxy generate the page identifier by itself instead of
having the WebProcessProxy do it.

* UIProcess/ServiceWorkerProcessProxy.cpp:
(WebKit::m_serviceWorkerPageID):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::create):
(WebKit::WebPageProxy::WebPageProxy):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::createWebPage):
(WebKit::WebProcessProxy::generatePageID): Deleted.
* UIProcess/WebProcessProxy.h:

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

11 months ago[MSE][GStreamer] WebKitMediaSrc rework
aboya@igalia.com [Wed, 28 Aug 2019 17:04:32 +0000 (17:04 +0000)]
[MSE][GStreamer] WebKitMediaSrc rework
https://bugs.webkit.org/show_bug.cgi?id=199719

Reviewed by Xabier Rodriguez-Calvar.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-video-element/timeout_on_seek.py: Added.
(parse_range):
(main):
* web-platform-tests/html/semantics/embedded-content/the-video-element/video_timeupdate_on_seek.html: Added.
* web-platform-tests/html/semantics/embedded-content/the-video-element/video_timeupdate_on_seek-expected.txt: Added.
* web-platform-tests/media-source/mediasource-buffered-seek-expected.txt: Added.
* web-platform-tests/media-source/mediasource-buffered-seek.html: Added.

Source/WebCore:

This patch reworks the WebKitMediaSrc element and many of the player
private methods that interacted with it.

In comparison with the old WebKitMediaSrc, in the new one seeks have
been massively simplified.

The new WebKitMediaSrc no longer relies on a bin or appsrc, having
greater control over its operation. This made it comparatively much
easier to implement features such as seek before playback or
single-stream flushing.

stream-collection events are emitted from the WebKitMediaSrc to reuse
the track handling in MediaPlayerPrivateGStreamer for playbin3, which
is now used for MSE pipelines.

Additional tests have been added to check some assumptions, and some
bugs that have surfaced with the changes have been fixed but no new
features (like multi-track support) are implemented in this patch.

One instance of these bugs is `resized` events, which were previously
being emitted when frames with different resolutions where appended.
This is a wrong behavior that has not been preserved in the rework, as
resize events should be emitted when the frames are shown, not
just appended.

There are subtler bugfixes, such as ignoring PTS-less frames in
AppendPipeline::appsinkNewSample(). These frames are problematic for
MSE, yet they were somehow passing through the pipelines. Since
WebKitMediaSrc is stricter with assertions, these have to be filtered.

This test gets rid of !m_mseSeekCompleted assertion failures in tests
and potentially other hard to debug bugs in the previous seek
algorithm.

This patch makes the following existing tests pass:

imported/w3c/web-platform-tests/media-source/mediasource-config-change-webm-a-bitrate.html
imported/w3c/web-platform-tests/media-source/mediasource-config-change-webm-v-framesize.html

New test: imported/w3c/web-platform-tests/media-source/mediasource-buffered-seek.html
New test: LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-video-element/video_timeupdate_on_seek.html (non-MSE related)

* Headers.cmake:
* platform/GStreamer.cmake:
* platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
(WTF::adoptGRef):
(WTF::refGPtr<GstMiniObject>):
(WTF::derefGPtr<GstMiniObject>):
* platform/graphics/gstreamer/GRefPtrGStreamer.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::playbackPosition const):
(WebCore::MediaPlayerPrivateGStreamer::paused const):
(WebCore::MediaPlayerPrivateGStreamer::updateTracks):
(WebCore::MediaPlayerPrivateGStreamer::enableTrack):
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
(WebCore::MediaPlayerPrivateGStreamer::sourceSetup):
(WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage):
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
(WebCore::MediaPlayerPrivateGStreamer::invalidateCachedPosition):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::naturalSize const):
(WebCore::MediaPlayerPrivateGStreamerBase::naturalSizeFromCaps const):
(WebCore::MediaPlayerPrivateGStreamerBase::samplesHaveDifferentNaturalSize const):
(WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/gstreamer/MediaSampleGStreamer.cpp:
(WebCore::MediaSampleGStreamer::MediaSampleGStreamer):
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::appsinkNewSample):
(WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink):
* platform/graphics/gstreamer/mse/AppendPipeline.h:
(WebCore::AppendPipeline::appsinkCaps):
(WebCore::AppendPipeline::streamType):
(WebCore::AppendPipeline::demuxerSrcPadCaps):
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::~MediaPlayerPrivateGStreamerMSE):
(WebCore::MediaPlayerPrivateGStreamerMSE::load):
(WebCore::MediaPlayerPrivateGStreamerMSE::play):
(WebCore::MediaPlayerPrivateGStreamerMSE::pause):
(WebCore::MediaPlayerPrivateGStreamerMSE::seek):
(WebCore::MediaPlayerPrivateGStreamerMSE::seekCompleted):
(WebCore::MediaPlayerPrivateGStreamerMSE::setReadyState):
(WebCore::MediaPlayerPrivateGStreamerMSE::sourceSetup):
(WebCore::MediaPlayerPrivateGStreamerMSE::updateStates):
(WebCore::MediaPlayerPrivateGStreamerMSE::didEnd):
(WebCore::MediaPlayerPrivateGStreamerMSE::unblockDurationChanges):
(WebCore::MediaPlayerPrivateGStreamerMSE::durationChanged):
(WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected):
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
(WebCore::MediaSourceClientGStreamerMSE::addSourceBuffer):
(WebCore::MediaSourceClientGStreamerMSE::removedFromMediaSource):
(WebCore::MediaSourceClientGStreamerMSE::flush):
(WebCore::MediaSourceClientGStreamerMSE::enqueueSample):
(WebCore::MediaSourceClientGStreamerMSE::isReadyForMoreSamples):
(WebCore::MediaSourceClientGStreamerMSE::notifyClientWhenReadyForMoreSamples):
(WebCore::MediaSourceClientGStreamerMSE::allSamplesInTrackEnqueued):
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
* platform/graphics/gstreamer/mse/MediaSourceGStreamer.cpp:
(WebCore::MediaSourceGStreamer::markEndOfStream):
(WebCore::MediaSourceGStreamer::unmarkEndOfStream):
(WebCore::MediaSourceGStreamer::waitForSeekCompleted):
* platform/graphics/gstreamer/mse/MediaSourceGStreamer.h:
* platform/graphics/gstreamer/mse/PlaybackPipeline.cpp: Removed.
* platform/graphics/gstreamer/mse/PlaybackPipeline.h: Removed.
* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
(WebCore::SourceBufferPrivateGStreamer::enqueueSample):
(WebCore::SourceBufferPrivateGStreamer::isReadyForMoreSamples):
(WebCore::SourceBufferPrivateGStreamer::notifyClientWhenReadyForMoreSamples):
* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h:
* platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
(WebKitMediaSrcPrivate::streamByName):
(Stream::Stream):
(Stream::StreamingMembers::StreamingMembers):
(Stream::StreamingMembers::durationEnqueued const):
(findPipeline):
(webkit_media_src_class_init):
(webkit_media_src_init):
(webKitMediaSrcFinalize):
(debugProbe):
(collectionPlusStream):
(collectionMinusStream):
(gstStreamType):
(webKitMediaSrcAddStream):
(webKitMediaSrcRemoveStream):
(webKitMediaSrcActivateMode):
(webKitMediaSrcPadLinked):
(webKitMediaSrcStreamNotifyLowWaterLevel):
(webKitMediaSrcLoop):
(webKitMediaSrcEnqueueObject):
(webKitMediaSrcEnqueueSample):
(webKitMediaSrcEnqueueEvent):
(webKitMediaSrcEndOfStream):
(webKitMediaSrcIsReadyForMoreSamples):
(webKitMediaSrcNotifyWhenReadyForMoreSamples):
(webKitMediaSrcChangeState):
(webKitMediaSrcStreamFlushStart):
(webKitMediaSrcStreamFlushStop):
(webKitMediaSrcFlush):
(webKitMediaSrcSeek):
(countStreamsOfType):
(webKitMediaSrcGetProperty):
(webKitMediaSrcUriGetType):
(webKitMediaSrcGetProtocols):
(webKitMediaSrcGetUri):
(webKitMediaSrcSetUri):
(webKitMediaSrcUriHandlerInit):
* platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.h:
* platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamerPrivate.h: Removed.

Tools:

Added WebKitMediaSourceGStreamer.cpp to the GStreamer-style coding
whitelist.

* Scripts/webkitpy/style/checker.py:

LayoutTests:

Updated expectations.

* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:
* platform/ios-simulator/TestExpectations:
* platform/mac/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-video-element/video_timeupdate_on_seek-expected.txt: Added.

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

11 months agoUpdating inactive contributors in contributors.json.
ap@apple.com [Wed, 28 Aug 2019 16:58:15 +0000 (16:58 +0000)]
Updating inactive contributors in contributors.json.

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

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

11 months agoHave RenderSVGBlock compute visual overflow just like everyone else
simon.fraser@apple.com [Wed, 28 Aug 2019 16:57:31 +0000 (16:57 +0000)]
Have RenderSVGBlock compute visual overflow just like everyone else
https://bugs.webkit.org/show_bug.cgi?id=201211

Reviewed by Zalan Bujtas.

RenderSVGBlock overrode visualOverflowRect() just to account for text shadow. This prevents callers
optimizing calls to visualOverflowRect(), so instead have RenderSVGBlock implement computeOverflow()
and call addVisualOverflow().

* rendering/svg/RenderSVGBlock.cpp:
(WebCore::RenderSVGBlock::computeOverflow):
(WebCore::RenderSVGBlock::visualOverflowRect const): Deleted.
* rendering/svg/RenderSVGBlock.h:

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

11 months agoresults.webkit.org: Auto-expand single configurations
jbedard@apple.com [Wed, 28 Aug 2019 16:42:40 +0000 (16:42 +0000)]
results.webkit.org: Auto-expand single configurations
https://bugs.webkit.org/show_bug.cgi?id=201218

Rubber-stamped by Aakash Jain.

* resultsdbpy/resultsdbpy/view/static/js/timeline.js:
(TimelineFromEndpoint.toString): Automatically expand timeline when only one
configuration has been specified.
* resultsdbpy/resultsdbpy/view/static/library/js/components/TimelineComponents.js:
(prototype.ExpandableSeriesComponent): Add options so that the caller can set whether a timeline
is expanded or collapsed by default.

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

11 months agoFlaky Test: fullscreen/full-screen-request-removed-with-raf.html
jer.noble@apple.com [Wed, 28 Aug 2019 16:28:27 +0000 (16:28 +0000)]
Flaky Test: fullscreen/full-screen-request-removed-with-raf.html
https://bugs.webkit.org/show_bug.cgi?id=201188

Reviewed by Alexey Proskuryakov.

* fullscreen/full-screen-request-removed-with-raf.html:

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

11 months agoresults.webkit.org: Sanitize all commit arguments on upload
jbedard@apple.com [Wed, 28 Aug 2019 15:45:20 +0000 (15:45 +0000)]
results.webkit.org: Sanitize all commit arguments on upload
https://bugs.webkit.org/show_bug.cgi?id=201189
<rdar://problem/54564837>

Reviewed by Aakash Jain.

* resultsdbpy/resultsdbpy/controller/commit.py:
(Commit.__init__): Only allow commits to be constructed with valid values.
* resultsdbpy/resultsdbpy/controller/commit_controller.py:
(CommitController.register): Strip potential API key.
* resultsdbpy/resultsdbpy/controller/commit_unittest.py:
(CommitUnittest.test_invalid): Test that commits which contain html inside the
repository_id, branch or commit id are rejected.

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

11 months agoGardening: Rebase test results after r249175.
mark.lam@apple.com [Wed, 28 Aug 2019 15:36:37 +0000 (15:36 +0000)]
Gardening: Rebase test results after r249175.
https://bugs.webkit.org/show_bug.cgi?id=201172

Not reviewed.

* Scripts/tests/builtins/expected/WebCore-AnotherGuardedInternalBuiltin-Separate.js-result:
* Scripts/tests/builtins/expected/WebCore-ArbitraryConditionalGuard-Separate.js-result:
* Scripts/tests/builtins/expected/WebCore-GuardedBuiltin-Separate.js-result:
* Scripts/tests/builtins/expected/WebCore-GuardedInternalBuiltin-Separate.js-result:
* Scripts/tests/builtins/expected/WebCore-UnguardedBuiltin-Separate.js-result:
* Scripts/tests/builtins/expected/WebCore-xmlCasingTest-Separate.js-result:
* Scripts/tests/builtins/expected/WebCoreJSBuiltins.h-result:

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

11 months agoREGRESSION (r248807): Objects stored in ElementRareData are leaked
rniwa@webkit.org [Wed, 28 Aug 2019 15:15:51 +0000 (15:15 +0000)]
REGRESSION (r248807): Objects stored in ElementRareData are leaked
https://bugs.webkit.org/show_bug.cgi?id=200954

Reviewed by Antti Koivisto.

Use a custom deleter in std::unique_ptr to call the correct destructor instead of making
NodeRareData's destructor virtual. Added NodeRareData::isElementRareData to differentiate
ElementRareData and NodeRareData by borrowing 1 bit from the frame count.

No new tests since there should be no behavioral change.

* dom/ElementRareData.h:
(WebCore::ElementRareData::ElementRareData):
* dom/Node.cpp:
(WebCore::Node::materializeRareData): Call the constructors of unique_ptr directly since
make_unique does not take a custom deleter. We can't add the support to makeUnique either
without making it three arguments since we need to cast ElementRareData to NodeRareData
in addition to specifying a custom deleter (normal casting wouldn't work due to
the presence of a custom deleter).
(WebCore::Node::NodeRareDataDeleter::operator() const): Added.
* dom/Node.h:
(WebCore::Node::NodeRareDataDeleter): Added.
* dom/NodeRareData.cpp:
* dom/NodeRareData.h:
(WebCore::NodeRareData::NodeRareData): Makes newly added Type.
(WebCore::NodeRareData::isElementRareData): Added.
(WebCore::NodeRareData::~NodeRareData): Deleted.

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

11 months ago[SOUP] Shut compilation warning
csaavedra@igalia.com [Wed, 28 Aug 2019 11:52:31 +0000 (11:52 +0000)]
[SOUP] Shut compilation warning

Unreviewed. RELEASE_LOG_ERROR() needs a channel.

* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::SoupNetworkSession::setupHSTSEnforcer):

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

11 months ago[SOUP] Fix the debug build after r249192
csaavedra@igalia.com [Wed, 28 Aug 2019 11:43:56 +0000 (11:43 +0000)]
[SOUP] Fix the debug build after r249192

Unreviewed build fix.

* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::SoupNetworkSession::setupHSTSEnforcer):

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

11 months agoUnable to enter text in https://eat.fi
carlosgc@webkit.org [Wed, 28 Aug 2019 10:22:56 +0000 (10:22 +0000)]
Unable to enter text in https://eat.fi
https://bugs.webkit.org/show_bug.cgi?id=193046

Reviewed by Ryosuke Niwa.

Source/WebCore:

This is because the button element inside the label is receiving the click event, which causes the form to be
submitted. According to the spec we should do nothing in this case, because button element is considered to be
interactive content.

"The activation behavior of a label element for events targeted at interactive content descendants of a label
element, and any descendants of those interactive content descendants, must be to do nothing."
https://html.spec.whatwg.org/#the-label-element

This patch adds HTMLElement::isInteractiveContent() according to the HTML spec:

"Interactive content is content that is specifically intended for user interaction.
a (if the href attribute is present), audio (if the controls attribute is present), button, details, embed,
iframe, img (if the usemap attribute is present), input (if the type attribute is not in the Hidden state),
label, object (if the usemap attribute is present), select, textarea, video (if the controls attribute is
present)"
https://html.spec.whatwg.org/#interactive-content-2

That's used in HTMLLabelElement::defaultEventHandler() using the helper method
isEventTargetedAtInteractiveDescendants() to decide whether to simulate a click event or do nothing.

* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::isInteractiveContent const):
* html/HTMLAnchorElement.h:
* html/HTMLButtonElement.h:
* html/HTMLDetailsElement.h:
* html/HTMLElement.h:
(WebCore::HTMLElement::isInteractiveContent const):
* html/HTMLEmbedElement.h:
* html/HTMLIFrameElement.h:
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::isInteractiveContent const):
* html/HTMLImageElement.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::isInteractiveContent const):
* html/HTMLInputElement.h:
* html/HTMLLabelElement.cpp:
(WebCore::HTMLLabelElement::isEventTargetedAtInteractiveDescendants const):
(WebCore::HTMLLabelElement::defaultEventHandler):
* html/HTMLLabelElement.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::isInteractiveContent const):
* html/HTMLMediaElement.h:
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::isInteractiveContent const):
* html/HTMLObjectElement.h:
* html/HTMLSelectElement.h:
* html/HTMLTextAreaElement.h:
* html/HiddenInputType.h:
* html/InputType.cpp:
(WebCore::InputType::isInteractiveContent const):
* html/InputType.h:

LayoutTests:

Add new test imported for blink.

* imported/blink/fast/forms/label/label-contains-other-interactive-content-expected.txt: Added.
* imported/blink/fast/forms/label/label-contains-other-interactive-content.html: Added.
* platform/ios-wk2/TestExpectations: Skip the new test because it requires eventSender.mouseDown/Up/MoveTo()

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

11 months agoREGRESSION(r243434): Wrong URL passed to WebKitWebView::load-failed when cancelling...
carlosgc@webkit.org [Wed, 28 Aug 2019 10:21:12 +0000 (10:21 +0000)]
REGRESSION(r243434): Wrong URL passed to WebKitWebView::load-failed when cancelling previous load
https://bugs.webkit.org/show_bug.cgi?id=201176

Reviewed by Žan Doberšek.

Use the current provisional/committed url when faking an error event, instead of the current active URI that can
be the pending api request of a new load.

* UIProcess/API/glib/WebKitWebView.cpp:
(webkitWebViewWillStartLoad):

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

11 months ago[GTK][WPE] Implement HSTS for the soup network backend
csaavedra@igalia.com [Wed, 28 Aug 2019 10:15:36 +0000 (10:15 +0000)]
[GTK][WPE] Implement HSTS for the soup network backend
https://bugs.webkit.org/show_bug.cgi?id=192074

Reviewed by Carlos Garcia Campos.

libsoup 2.67.1 introduced HSTS support via a SoupSessionFeature.
Add support to the soup network backend by adding the feature to
SoupNetworkSession and handling HSTS protocol upgrades, by
propagating the scheme change further to clients. This patch adds
the HSTS feature unconditionally, but it still possible to add
a boolean property to the web context class if desired.

Additionally, add API to the WebKitWebsiteDataManager to specify
the directory where the HSTS database is saved. If the directory
is not set or if the data manager is ephemeral, use a
non-persistent, memory only HSTS enforcer.

Implement as well the methods needed to clean-up and delete HSTS
Source/WebCore:

policies from the storage and expose the feature in GTK+ MiniBrowser's
about:data.

* platform/network/soup/GUniquePtrSoup.h:
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::hstsStorageDirectory):
(WebCore::SoupNetworkSession::SoupNetworkSession):
(WebCore::SoupNetworkSession::setHSTSPersistentStorage):
(WebCore::SoupNetworkSession::setupHSTSEnforcer):
(WebCore::SoupNetworkSession::getHostNamesWithHSTSCache):
(WebCore::SoupNetworkSession::deleteHSTSCacheForHostNames):
(WebCore::SoupNetworkSession::clearHSTSCache):
* platform/network/soup/SoupNetworkSession.h:

Source/WebKit:

policies from the storage and expose the feature in GTK+
MiniBrowser's about:data.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::fetchWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
(WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
(WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
* NetworkProcess/NetworkProcess.h:
(WebKit::NetworkProcess::suppressesConnectionTerminationOnSystemChange const):
* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::createRequest):
(WebKit::NetworkDataTaskSoup::clearRequest):
(WebKit::NetworkDataTaskSoup::shouldAllowHSTSPolicySetting const):
(WebKit::NetworkDataTaskSoup::shouldAllowHSTSProtocolUpgrade const):
(WebKit::NetworkDataTaskSoup::protocolUpgradedViaHSTS):
(WebKit::NetworkDataTaskSoup::hstsEnforced):
* NetworkProcess/soup/NetworkDataTaskSoup.h:
* NetworkProcess/soup/NetworkProcessSoup.cpp:
(WebKit::NetworkProcess::getHostNamesWithHSTSCache):
(WebKit::NetworkProcess::deleteHSTSCacheForHostNames):
(WebKit::NetworkProcess::clearHSTSCache):
(WebKit::NetworkProcess::platformInitializeNetworkProcess):
* UIProcess/API/APIWebsiteDataStore.h:
* UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
(API::WebsiteDataStore::defaultHSTSDirectory):
* UIProcess/API/glib/WebKitWebContext.cpp:
(webkitWebContextConstructed):
* UIProcess/API/glib/WebKitWebsiteData.cpp:
(recordContainsSupportedDataTypes):
(toWebKitWebsiteDataTypes):
* UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
(webkitWebsiteDataManagerGetProperty):
(webkitWebsiteDataManagerSetProperty):
(webkitWebsiteDataManagerConstructed):
(webkit_website_data_manager_class_init):
(webkitWebsiteDataManagerGetDataStore):
(webkit_website_data_manager_get_hsts_cache_directory):
(toWebsiteDataTypes):
* UIProcess/API/gtk/WebKitWebsiteData.h:
* UIProcess/API/gtk/WebKitWebsiteDataManager.h:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
* UIProcess/API/wpe/WebKitWebsiteData.h:
* UIProcess/API/wpe/WebKitWebsiteDataManager.h:
* UIProcess/API/wpe/docs/wpe-1.0-sections.txt:
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
(WebKit::WebsiteDataStoreConfiguration::copy):
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
(WebKit::WebsiteDataStoreConfiguration::hstsStorageDirectory const):
(WebKit::WebsiteDataStoreConfiguration::setHSTSStorageDirectory):

Tools:

policies from the storage and expose the feature in GTK+
MiniBrowser's about:data.

* MiniBrowser/gtk/main.c:
(gotWebsiteDataCallback):
* TestWebKitAPI/Tests/WebKitGLib/TestWebsiteData.cpp:
(serverCallback):
(testWebsiteDataConfiguration):
(testWebsiteDataEphemeral):
(prepopulateHstsData):
(testWebsiteDataHsts):
(beforeAll):
* TestWebKitAPI/glib/WebKitGLib/TestMain.h:
(Test::Test):
* gtk/jhbuild.modules: Bump libsoup to 2.67.91 for the new APIs
* wpe/jhbuild.modules: Ditto
* MiniBrowser/gtk/main.c:
(gotWebsiteDataCallback):

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

11 months agoSVG2: Add length, item getter and item setter to all SVG lists
commit-queue@webkit.org [Wed, 28 Aug 2019 07:10:44 +0000 (07:10 +0000)]
SVG2: Add length, item getter and item setter to all SVG lists
https://bugs.webkit.org/show_bug.cgi?id=199526

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-08-28
Reviewed by Simon Fraser.

Source/WebCore:

-- Implement the SVG2 specs for SVG lists:
https://svgwg.org/svg2-draft/types.html#TermListInterface.

-- Match the arguments' names in the IDL files with the specs.

Tests: svg/dom/SVGLengthList-length-indexed-access.xhtml
       svg/dom/SVGPathSegList-length-indexed-access.xhtml

* svg/SVGLengthList.idl:
* svg/SVGNumberList.idl:
* svg/SVGPathSegList.h:
* svg/SVGPathSegList.idl:
* svg/SVGPointList.idl:
* svg/SVGStringList.idl:
* svg/SVGTransformList.idl:
* svg/properties/SVGList.h:
(WebCore::SVGList::length const):
(WebCore::SVGList::setItem):

LayoutTests:

* svg/custom/polyline-points-crash-expected.txt:
* svg/dom/SVGLengthList-basics-expected.txt:
* svg/dom/SVGLengthList-length-indexed-access-expected.txt: Added.
* svg/dom/SVGLengthList-length-indexed-access.xhtml: Added.
* svg/dom/SVGNumberList-basics-expected.txt:
* svg/dom/SVGPathSegList-length-indexed-access-expected.txt: Added.
* svg/dom/SVGPathSegList-length-indexed-access.xhtml: Added.
* svg/dom/SVGPointList-basics-expected.txt:
* svg/dom/SVGTransformList-basics-expected.txt:

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

11 months agoFix applying diffs that only change file mode
commit-queue@webkit.org [Wed, 28 Aug 2019 03:15:33 +0000 (03:15 +0000)]
Fix applying diffs that only change file mode
https://bugs.webkit.org/show_bug.cgi?id=201191

Patch by James Darpinian <jdarpinian@google.com> on 2019-08-27
Reviewed by Daniel Bates.

* Scripts/svn-apply:
(patch): Handle case of file mode change without content change

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

11 months ago[ews] Status bubble should be red for CANCELLED builds
aakash_jain@apple.com [Wed, 28 Aug 2019 02:39:02 +0000 (02:39 +0000)]
[ews] Status bubble should be red for CANCELLED builds
https://bugs.webkit.org/show_bug.cgi?id=201204

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-app/ews/views/statusbubble.py:
(StatusBubble._build_bubble):

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

11 months agoMake FrameLoader::open() set outgoing referrer properly
Hironori.Fujii@sony.com [Wed, 28 Aug 2019 01:40:42 +0000 (01:40 +0000)]
Make FrameLoader::open() set outgoing referrer properly
https://bugs.webkit.org/show_bug.cgi?id=167050
Source/WebCore:

<rdar://problem/27972404>

Reviewed by Youenn Fablet.

In debug builds, an assertion failed in WebCore::SecurityPolicy::generateReferrerHeader:
ASSERTION FAILED: referrer == URL(URL(), referrer).strippedForUseAsReferrer()

In release builds, cached pages with a URL fragment sent its URL fragment in the referrer.

m_outgoingReferrer mistakenly had a URL fragment.

Test: http/tests/navigation/page-cache-fragment-referrer.html

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::open): Set m_outgoingReferrer by using
FrameLoader::setOutgoingReferrer to remove URL fragments.

LayoutTests:

Reviewed by Youenn Fablet.

* http/tests/navigation/page-cache-fragment-referrer-expected.html: Added.
* http/tests/navigation/page-cache-fragment-referrer.html: Added.
* http/tests/navigation/resources/referrer.php: Added.

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

11 months agoUnreviewed. Build fix after r249175.
said@apple.com [Wed, 28 Aug 2019 01:22:37 +0000 (01:22 +0000)]
Unreviewed. Build fix after r249175.

Fix the condition which generates the declaration of vm in
GenerateGetOwnPropertySlotByIndex.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateGetOwnPropertySlotByIndex):

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

11 months agoWeb Inspector: replace uses of added utility `Array.prototype.keySet` with an actual...
drousso@apple.com [Wed, 28 Aug 2019 00:10:47 +0000 (00:10 +0000)]
Web Inspector: replace uses of added utility `Array.prototype.keySet` with an actual `Set`
https://bugs.webkit.org/show_bug.cgi?id=201194

Reviewed by Ross Kirsling.

Source/WebInspectorUI:

They both have basically the same functionality, with one difference being that a `Set` can
work with arrays that have non-string values.

* UserInterface/Base/Utilities.js:
(Array.prototype.keySet): Deleted.
* UserInterface/Controllers/CodeMirrorCompletionController.js:
(WI.CodeMirrorCompletionController.prototype._generateJavaScriptCompletions):
(WI.CodeMirrorCompletionController.prototype._generateJavaScriptCompletions.matchKeywords):
* UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
(WI.JavaScriptRuntimeCompletionProvider.completionControllerCompletionsNeeded.receivedPropertyNames):

LayoutTests:

* inspector/unit-tests/array-utilities.html:
* inspector/unit-tests/array-utilities-expected.txt:

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

11 months agoUpdate PACCage changes for builds without Gigacage, but with signed pointers
msaboff@apple.com [Tue, 27 Aug 2019 23:48:54 +0000 (23:48 +0000)]
Update PACCage changes for builds without Gigacage, but with signed pointers
https://bugs.webkit.org/show_bug.cgi?id=201202

Reviewed by Saam Barati.

Factored out the untagging of pointers and added that to both the Gigacage enabled
and disabled code paths.  Did this for the LLInt as well as the JITs.

* JavaScriptCore.xcodeproj/project.pbxproj: Added arm64e.rb to offlineasm file list.
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::cageTypedArrayStorage):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::caged):
* llint/LowLevelInterpreter64.asm:

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

11 months ago[WebGPU] Implement GPUErrors for and relax GPUBuffer validation rules
justin_fan@apple.com [Tue, 27 Aug 2019 23:39:38 +0000 (23:39 +0000)]
[WebGPU] Implement GPUErrors for and relax GPUBuffer validation rules
https://bugs.webkit.org/show_bug.cgi?id=200852

Reviewed by Dean Jackson.

Source/WebCore:

Fix incorrect usage validation during GPUBuffer creation.
Implement GPUError reporting for GPUBuffer creation and methods.

Test: webgpu/buffer-errors.html

* Modules/webgpu/WebGPUBuffer.cpp:
(WebCore::WebGPUBuffer::create):
(WebCore::WebGPUBuffer::WebGPUBuffer):
(WebCore::WebGPUBuffer::unmap):
(WebCore::WebGPUBuffer::destroy):
(WebCore::WebGPUBuffer::rejectOrRegisterPromiseCallback):
* Modules/webgpu/WebGPUBuffer.h: Now inherits from GPUObjectBase.
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createBuffer const):
(WebCore::WebGPUDevice::createBufferMapped const):
* platform/graphics/gpu/GPUBuffer.h: No longer inherits from GPUObjectBase.
* platform/graphics/gpu/GPUObjectBase.h:
(WebCore::GPUObjectBase::errorScopes):
(WebCore::GPUObjectBase::generateError): Deleted.
* platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
(WebCore::GPUBuffer::validateBufferUsage):
(WebCore::GPUBuffer::tryCreate): Alignment issue should be general WebGPU requirement.
(WebCore::GPUBuffer::GPUBuffer):
(WebCore::GPUBuffer::~GPUBuffer): Must do cleanup without generating errors.
(WebCore::GPUBuffer::registerMappingCallback):
(WebCore::GPUBuffer::copyStagingBufferToGPU):
(WebCore::GPUBuffer::unmap):
(WebCore::GPUBuffer::destroy):

LayoutTests:

Add a test to ensure GPUBuffer errors are generated properly.

* webgpu/buffer-errors-expected.txt: Added.
* webgpu/buffer-errors.html: Added.

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