WebKit-https.git
10 months agoSkip stress/regexp-unicode-surrogate-pair-increment-should-involve-length-check.js...
ticaiolima@gmail.com [Mon, 23 Sep 2019 20:42:14 +0000 (20:42 +0000)]
Skip stress/regexp-unicode-surrogate-pair-increment-should-involve-length-check.js into ARMv7 and MIPS
https://bugs.webkit.org/show_bug.cgi?id=202113

Unreviewed test gardening, skipped test in ARMv7 and MIPS.

It is going to be fixed in
https://bugs.webkit.org/show_bug.cgi?id=202041

* stress/regexp-unicode-surrogate-pair-increment-should-involve-length-check.js:

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

10 months ago[WebAuthn] LocalAuthenticator tests are failing on internal bots
jiewen_tan@apple.com [Mon, 23 Sep 2019 20:18:05 +0000 (20:18 +0000)]
[WebAuthn] LocalAuthenticator tests are failing on internal bots
https://bugs.webkit.org/show_bug.cgi?id=201844
<rdar://problem/54278693>

Reviewed by Brent Fulgham.

Source/WebKit:

This patch adds a way for mock tests to select a credential in getAssertion
ceremonies such that a test can ensure it always uses the credential it manages.
Credentials managed by other test could be deleted at anytime.

* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetWebAuthenticationMockConfiguration):
* UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
(WebKit::LocalAuthenticator::getAssertion):
* UIProcess/WebAuthentication/Cocoa/LocalConnection.h:
* UIProcess/WebAuthentication/Cocoa/LocalConnection.mm:
(WebKit::LocalConnection::selectCredential const):
* UIProcess/WebAuthentication/Mock/MockLocalConnection.h:
* UIProcess/WebAuthentication/Mock/MockLocalConnection.mm:
(WebKit::MockLocalConnection::selectCredential const):
* UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h:

Tools:

LocalAuthenticator tests utilize Keychain for mock testing. Unlike iOS simulator tests which
each test runner is running in different simulator containers, all test runners are running
in the same macOS container in macOS. Therefore, Keychain is shared among all test runners
in macOS while it is not in iOS simulators. And therefore, race conditions would happen in
macOS which make the current tests flaky given they don't consider race conditions.

This patch then makes each test generate a random credential, and thus no other tests would
be able to access it, and therefore eliminate any race condition. To support this, a few new
functionalities are introduced to the mock test infrastructure as well:
1) TestRunner.cleanUpKeychain accepts a new parameter to more precisely identify an item.
2) WebAuthenticationMockConfiguration.Local has a new member to uniquely select a credential
for getAssertion ceremony when multiple presents.

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setWebAuthenticationMockConfiguration):
(WTR::TestRunner::cleanUpKeychain):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::cleanUpKeychain):
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::cleanUpKeychain):

LayoutTests:

This patch makes each test to generate their own credentials to avoid race conditions in Keychain
accesses when multiple test runners present.

* http/wpt/credential-management/credentialscontainer-store-basics.https.html:
* http/wpt/webauthn/idl.https.html:
These two tests are changed to use hid authenticator instead of local to avoid any future Keychain issues.
* http/wpt/webauthn/public-key-credential-create-failure-local-silent.https.html:
* http/wpt/webauthn/public-key-credential-create-failure-local.https.html:
* http/wpt/webauthn/public-key-credential-create-success-local.https.html:
* http/wpt/webauthn/public-key-credential-get-failure-local-silent.https.html:
* http/wpt/webauthn/public-key-credential-get-failure-local.https.html:
* http/wpt/webauthn/public-key-credential-get-success-local.https.html:
* http/wpt/webauthn/resources/util.js:
* platform/mac-wk2/TestExpectations:

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

10 months ago[iOS] REGRESSION(r250151): Occasional assertion failures in ShareableBitmap::~Shareab...
david_quesada@apple.com [Mon, 23 Sep 2019 20:15:19 +0000 (20:15 +0000)]
[iOS] REGRESSION(r250151): Occasional assertion failures in ShareableBitmap::~ShareableBitmap()
https://bugs.webkit.org/show_bug.cgi?id=202112
rdar://problem/55624598

Reviewed by Chris Dumez.

* Shared/cg/ShareableBitmapCG.cpp:
(WebKit::ShareableBitmap::releaseDataProviderData):
It is possible and valid for a UIImage created from a ShareableBitmap's CGImage representation
to be deallocated on a background thread. When this happens, releaseDataProviderData() should
ensure it's running on the main thread before deref'ing the ShareableBitmap. Otherwise the
bitmap can be deallocated on the background thread, violating an assertion added in r250151.

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

10 months agoUnreviewed build fix after r250173: tvOS build broken due to unused function.
krollin@apple.com [Mon, 23 Sep 2019 19:15:37 +0000 (19:15 +0000)]
Unreviewed build fix after r250173: tvOS build broken due to unused function.

* platform/network/cocoa/CookieCocoa.mm:
(WebCore::Cookie::operator NSHTTPCookie * _Nullable  const):

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

10 months agoWeb Inspector: Improve the Uncaught Exception View file a bug link
joepeck@webkit.org [Mon, 23 Sep 2019 18:06:18 +0000 (18:06 +0000)]
Web Inspector: Improve the Uncaught Exception View file a bug link
https://bugs.webkit.org/show_bug.cgi?id=201717

Reviewed by Devin Rousso.

Source/WebInspectorUI:

* UserInterface/Debug/UncaughtExceptionReporter.js:
Allow the link to be clicked. Use openInNewTab on click to also
bring the new tab to the foreground. Also update the content.

Source/WebKit:

* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::bringInspectedPageToFront):
* UIProcess/WebInspectorProxy.h:
* UIProcess/WebInspectorProxy.messages.in:
Provide a way to bring the inspected page to the foreground.

* WebProcess/WebPage/WebInspectorUI.cpp:
(WebKit::WebInspectorUI::openInNewTab):
Use it when opening a new tab beside the inspected page.

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

10 months agoUnreviewed build fix after r250169 and r250236.
bfulgham@apple.com [Mon, 23 Sep 2019 18:00:22 +0000 (18:00 +0000)]
Unreviewed build fix after r250169 and r250236.

* NetworkProcess/curl/NetworkDataTaskCurl.cpp:
(WebKit::NetworkDataTaskCurl::createCurlRequest):
* UIProcess/API/C/curl/WKWebsiteDataStoreRefCurl.cpp:
(WKWebsiteDataStoreEnableDefaultNetworkProxySettings):
(WKWebsiteDataStoreEnableCustomNetworkProxySettings):
(WKWebsiteDataStoreDisableNetworkProxySettings):

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

10 months agoUnreviewed WinCairo/FTW Build fix after r250192.
bfulgham@apple.com [Mon, 23 Sep 2019 17:53:39 +0000 (17:53 +0000)]
Unreviewed WinCairo/FTW Build fix after r250192.

* platform/network/curl/CurlDownload.cpp:
(WebCore::CurlDownload::createCurlRequest):

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

10 months ago[LFC][IFC] Merge inline box compute functions
zalan@apple.com [Mon, 23 Sep 2019 17:21:22 +0000 (17:21 +0000)]
[LFC][IFC] Merge inline box compute functions
https://bugs.webkit.org/show_bug.cgi?id=202092
<rdar://problem/55607748>

Reviewed by Antti Koivisto.

Make InlineFormattingContext::layoutInFlowContent() logic simpler.

* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layoutInFlowContent):
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot):
(WebCore::Layout::InlineFormattingContext::computeHorizontalAndVerticalGeometry):
(WebCore::Layout::InlineFormattingContext::initializeMarginBorderAndPaddingForGenericInlineBox): Deleted.
(WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPaddingForInlineContainer): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:

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

10 months agoclang-tidy: Fix unnecessary copy/ref churn of for loop variables in WebKit
ddkilzer@apple.com [Mon, 23 Sep 2019 17:04:54 +0000 (17:04 +0000)]
clang-tidy: Fix unnecessary copy/ref churn of for loop variables in WebKit
<https://webkit.org/b/202096>

Reviewed by Darin Adler.

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

* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
(WebKit::domainsToString):
* UIProcess/ios/WKActionSheetAssistant.mm:
(-[WKActionSheetAssistant presentationRectForElementUsingClosestIndicatedRect]):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _singleTapDidReset:]):
* UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm:
(-[WKDataListSuggestionsControl textSuggestions]):

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

10 months agoREGRESSION (r249855): Remove debug logging from WebCore::RenderImage::paintIntoRect()
ddkilzer@apple.com [Mon, 23 Sep 2019 16:48:25 +0000 (16:48 +0000)]
REGRESSION (r249855): Remove debug logging from WebCore::RenderImage::paintIntoRect()
<https://webkit.org/b/202103>

Reviewed by Zalan Bujtas.

* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintIntoRect): Remove debug logging
statements.

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

10 months agoWebPage::sessionID() does not need to get the sessionID from there WebCore Page
cdumez@apple.com [Mon, 23 Sep 2019 16:31:15 +0000 (16:31 +0000)]
WebPage::sessionID() does not need to get the sessionID from there WebCore Page
https://bugs.webkit.org/show_bug.cgi?id=202094

Reviewed by Youenn Fablet.

WebPage::sessionID() does not need to get the sessionID from there WebCore Page, it can
simply get the sessionID from the WebProcess singleton, now that we have a single session
per WebProcess. This will avoid potential crashes trying to dereference m_page to get the
sessionID, since m_page can be null.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::sessionID const):
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::sessionID const): Deleted.

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

10 months ago[LFC][IFC] Pass in the Used*Values to inline layout functions.
zalan@apple.com [Mon, 23 Sep 2019 16:14:21 +0000 (16:14 +0000)]
[LFC][IFC] Pass in the Used*Values to inline layout functions.
https://bugs.webkit.org/show_bug.cgi?id=202091
<rdar://problem/55601987>

Reviewed by Antti Koivisto.

Only the top level layout functions should generate constraint values.

* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layoutInFlowContent):
(WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints):
(WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPaddingForInlineContainer):
(WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot):
(WebCore::Layout::InlineFormattingContext::computeHorizontalMargin):
(WebCore::Layout::InlineFormattingContext::computeWidthAndMargin):
(WebCore::Layout::InlineFormattingContext::computeHeightAndMargin):
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot):
(WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForReplacedInlineBox):
* layout/inlineformatting/InlineFormattingContext.h:
(WebCore::Layout::InlineFormattingContext::InlineLayout::widthConstraint const):
* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::InlineFormattingContext::InlineLayout::InlineLayout):
(WebCore::Layout::InlineFormattingContext::InlineLayout::layout):
(WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
(WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):

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

10 months agoRefcount simple line layout
antti@apple.com [Mon, 23 Sep 2019 15:54:58 +0000 (15:54 +0000)]
Refcount simple line layout
https://bugs.webkit.org/show_bug.cgi?id=202104

Reviewed by Zalan Bujtas.

Make SimpleLineLayout::Layout refcounted for safety and ease of use.

* dom/Position.cpp:
(WebCore::Position::upstream const):
(WebCore::Position::downstream const):
* editing/TextIterator.cpp:
(WebCore::TextIterator::handleTextNode):
(WebCore::TextIterator::handleTextBox):
(WebCore::TextIterator::handleTextNodeFirstLetter):
* editing/TextIterator.h:
* rendering/RenderBlockFlow.h:
* rendering/RenderTreeAsText.cpp:
(WebCore::RenderTreeAsText::writeRenderObject):
(WebCore::write):
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::create):
(WebCore::SimpleLineLayout::Layout::create):
* rendering/SimpleLineLayout.h:
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::outputLineLayoutForFlow):
* rendering/SimpleLineLayoutResolver.cpp:
(WebCore::SimpleLineLayout::RunResolver::Run::rect const):
(WebCore::SimpleLineLayout::RunResolver::Iterator::Iterator):

Iterator now refs the layout. Since the resolver is owned by the layout, it is guaranteed to stay alive too.

(WebCore::SimpleLineLayout::RunResolver::Iterator::advanceLines):
* rendering/SimpleLineLayoutResolver.h:
(WebCore::SimpleLineLayout::RunResolver::Iterator::layout const):
(WebCore::SimpleLineLayout::RunResolver::Run::computeBaselinePosition const):
(WebCore::SimpleLineLayout::RunResolver::Iterator::simpleRun const):
(WebCore::SimpleLineLayout::RunResolver::Iterator::inQuirksMode const): Deleted.
(WebCore::SimpleLineLayout::runResolver): Deleted.

Always use the cached resolver owned by SimpleLineLayout::Layout.

* rendering/line/LineLayoutInterfaceTextBoxes.cpp:
(WebCore::LineLayoutInterface::firstTextBoxInVisualOrderFor):
(WebCore::LineLayoutInterface::firstTextBoxInTextOrderFor):
(WebCore::LineLayoutInterface::textBoxRangeFor):
(WebCore::LineLayoutInterface::Provider::firstTextBoxInVisualOrderFor): Deleted.
(WebCore::LineLayoutInterface::Provider::firstTextBoxInTextOrderFor): Deleted.
(WebCore::LineLayoutInterface::Provider::textBoxRangeFor): Deleted.

There is no need for a separate Provider class anymore as the iterator keeps SimpleLineLayout::Layout
and Resolver instances alive itself.

* rendering/line/LineLayoutInterfaceTextBoxes.h:
(WebCore::LineLayoutInterface::hasTextBoxes):
(WebCore::LineLayoutInterface::Provider::firstTextBoxFor): Deleted.

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

10 months agoSimplify UserMediaPermissionRequestManager management of UserMediaRequest
youenn@apple.com [Mon, 23 Sep 2019 14:16:44 +0000 (14:16 +0000)]
Simplify UserMediaPermissionRequestManager management of UserMediaRequest
https://bugs.webkit.org/show_bug.cgi?id=201688

Reviewed by Eric Carlson.

Source/WebCore:

Covered by existing tests and modified test.

* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::UserMediaRequest):
* Modules/mediastream/UserMediaRequest.h:
(WebCore::UserMediaRequest::identifier const):
Add an identifier generated for each request.

Source/WebKit:

Instead of having two maps to go from ID to request and request to ID,
Make request own its ID and keep a single ID to request map.
Rename it to m_ongoingUserMediaRequests.

Rename requests that are not processed because the document cannot start media as m_pendingUserMediaRequests.
In case the request is cancelled following the stopping of active dom objects, we just remove it from m_pendingUserMediaRequests
instead of denying the request. This matches Chrome and Firefox behavior.

* WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
(WebKit::UserMediaPermissionRequestManager::startUserMediaRequest):
(WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest):
(WebKit::UserMediaPermissionRequestManager::cancelUserMediaRequest):
(WebKit::UserMediaPermissionRequestManager::mediaCanStart):
(WebKit::UserMediaPermissionRequestManager::userMediaAccessWasGranted):
(WebKit::UserMediaPermissionRequestManager::userMediaAccessWasDenied):
(WebKit::UserMediaPermissionRequestManager::addDeviceChangeObserver):
(WebKit::generateRequestID): Deleted.
(WebKit::UserMediaPermissionRequestManager::removeMediaRequestFromMaps): Deleted.
* WebProcess/MediaStream/UserMediaPermissionRequestManager.h:

LayoutTests:

* http/tests/media/media-stream/disconnected-frame-permission-denied-expected.txt:
* http/tests/media/media-stream/disconnected-frame-permission-denied.html:

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

10 months agotestmasm: integer operands loaded as unsigned values
zandobersek@gmail.com [Mon, 23 Sep 2019 14:08:07 +0000 (14:08 +0000)]
testmasm: integer operands loaded as unsigned values
https://bugs.webkit.org/show_bug.cgi?id=202099

Reviewed by Mark Lam.

Suppress GCC warnings about comparing signed and unsigned values in
test cases introduced in r247913 by using signed integer types for
loading 32-bit and 64-bit integer operand values.

* assembler/testmasm.cpp:
(JSC::testBranchTestBit32RegReg):
(JSC::testBranchTestBit32RegImm):
(JSC::testBranchTestBit32AddrImm):
(JSC::testBranchTestBit64RegReg):
(JSC::testBranchTestBit64RegImm):
(JSC::testBranchTestBit64AddrImm):

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

10 months ago[GTK][WPE] Don't use prgname in dbus-proxy socket path
pgriffis@igalia.com [Mon, 23 Sep 2019 13:59:49 +0000 (13:59 +0000)]
[GTK][WPE] Don't use prgname in dbus-proxy socket path
https://bugs.webkit.org/show_bug.cgi?id=201979

The path length for the socket is limited to 108 bytes so it is easy for a long
prgname to cause it to get truncated and fail. Since we only allow the socket
path into the sandbox the unique directory isn't necessary.

Reviewed by Michael Catanzaro.

* UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
(WebKit::XDGDBusProxyLauncher::setAddress):

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

10 months ago[GStreamer] isAVC1CodecSupported is crashing several media source tests due to avc1...
cturner@igalia.com [Mon, 23 Sep 2019 10:31:24 +0000 (10:31 +0000)]
[GStreamer] isAVC1CodecSupported is crashing several media source tests due to avc1.4d4001 codec type
https://bugs.webkit.org/show_bug.cgi?id=201870

Reviewed by Xabier Rodriguez-Calvar.

The GStreamer codec-utils package expects all level_idc's to be
multiples of 10 from the spec idc, i.e., 1.1 -> 11, 3.1 -> 31, 1
-> 10, etc.

In the WPT tests, there is some confusion of this *10 multiplier,
and the level_idc is given in several places as simply "1". This
causes the get_level codec helper to return NULL, which the
registry scanner was not handling properly, and crashing on.

Fix this by special casing "web level idc's" that violate the *10
rule in isAVC1CodecSupported.

There is prior art along these lines in Gecko:
https://searchfox.org/mozilla-central/source/dom/media/VideoUtils.cpp#453
I assume Chrome/IE/etc must do something similar. The fix does not
belong in GStreamer since these are actually invalid inputs to the
get_level function.

Tested by imported/w3c/web-platform-tests/media-source

* platform/graphics/gstreamer/GStreamerRegistryScanner.cpp:
(WebCore::GStreamerRegistryScanner::isAVC1CodecSupported const):
Special case levels 1..5, even though these *should* be
represented as 10 through 50 respectively, they are not in
web-land. The two-byte local storage trick was contributed to me
by Adrian Perez de Castro.

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

10 months ago[SOUP] Stop setting G_TLS_GNUTLS_PRIORITY
mcatanzaro@igalia.com [Mon, 23 Sep 2019 09:05:16 +0000 (09:05 +0000)]
[SOUP] Stop setting G_TLS_GNUTLS_PRIORITY
https://bugs.webkit.org/show_bug.cgi?id=172154

Reviewed by Carlos Garcia Campos.

Nowadays, I maintain glib-networking. WebKit doesn't need to override its defaults to be
secure anymore. By overriding glib-networking's default priority, WebKit is force-reenabling
TLS 1.0 and TLS 1.1 even when glib-networking has disabled them.

* NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp:
(main):
* WebProcess/EntryPoint/unix/WebProcessMain.cpp:
(main):

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

10 months agoSync operator dictionary
commit-queue@webkit.org [Mon, 23 Sep 2019 08:49:11 +0000 (08:49 +0000)]
Sync operator dictionary
https://bugs.webkit.org/show_bug.cgi?id=201974

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

LayoutTests/imported/w3c:

Update improved test results.

* web-platform-tests/mathml/presentation-markup/operators/operator-dictionary-001-expected.txt:

Source/WebCore:

Sync with operator dictionary list from
https://mathml-refresh.github.io/mathml-core/#operator-dictionary

Test: imported/w3c/web-platform-tests/mathml/presentation-markup/operators/operator-dictionary-001.html

* mathml/MathMLOperatorDictionary.cpp:

LayoutTests:

* platform/ios-wk2/imported/w3c/web-platform-tests/mathml/relations/css-styling/ignored-properties-001-expected.txt: Added.
* platform/win/TestExpectations:

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

10 months agoclang-tidy: Fix unnecessary copy/ref churn of for loop variables in WebCore
ddkilzer@apple.com [Mon, 23 Sep 2019 03:46:57 +0000 (03:46 +0000)]
clang-tidy: Fix unnecessary copy/ref churn of for loop variables in WebCore
<https://webkit.org/b/202090>

Reviewed by Daniel Bates.

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

* Modules/encryptedmedia/InitDataRegistry.cpp:
(WebCore::InitDataRegistry::extractKeyIDsCenc):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::getMisspellingRange const):
(WebCore::AccessibilityObject::performTextOperation):
* html/HTMLSlotElement.cpp:
(WebCore::flattenAssignedNodes):
* html/track/WebVTTParser.cpp:
(WebCore::WebVTTParser::checkAndStoreStyleSheet):
* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns const):
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::updateSupportedTypeIdentifiers):
* platform/ios/WebItemProviderPasteboard.mm:
(-[WebItemProviderPasteboard allDroppedFileURLs]):
* svg/SVGStringList.h:
* testing/MockLibWebRTCPeerConnection.cpp:
(WebCore::MockLibWebRTCPeerConnection::GetTransceivers const):
Also call transceivers.reserve() to optimize allocations.

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

10 months ago[JSC] Int52Rep(DoubleRepAnyIntUse) should not call operation function
ysuzuki@apple.com [Sun, 22 Sep 2019 09:57:48 +0000 (09:57 +0000)]
[JSC] Int52Rep(DoubleRepAnyIntUse) should not call operation function
https://bugs.webkit.org/show_bug.cgi?id=202072

Reviewed by Mark Lam.

JSTests:

* stress/int52rep-with-double-checks-int52-range.js: Added.
(shouldBe):
(test):

Source/JavaScriptCore:

Inline doubleToStrictInt52 in FTL since it is very simple function.
This change improves JetStream2/stanford-crypto-sha256 by ~5%.

* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::doubleToStrictInt52):
* ftl/FTLOutput.cpp:
(JSC::FTL::Output::doubleToInt64):
* ftl/FTLOutput.h:

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

10 months agoUnreviewed, follow-up change after r250198
ysuzuki@apple.com [Sun, 22 Sep 2019 09:08:28 +0000 (09:08 +0000)]
Unreviewed, follow-up change after r250198
https://bugs.webkit.org/show_bug.cgi?id=201633

* b3/testb3_5.cpp:
(testCheckAddRemoveCheckWithSExt16):

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

10 months ago[JSC] Remove CheckAdd in JetStream2/async-fs's Math.random function
ysuzuki@apple.com [Sun, 22 Sep 2019 07:19:43 +0000 (07:19 +0000)]
[JSC] Remove CheckAdd in JetStream2/async-fs's Math.random function
https://bugs.webkit.org/show_bug.cgi?id=201633

Reviewed by Mark Lam.

Int52Rep is used in DFG and FTL to calculate Int52 things faster. This is typically used when user code see uint32_t type.
In JS, we handles Int32 well, but if the value exceeds Int32 range (like, using 0xffffffff), we use Int52 instead not to fallback to Double.

The problem is that we do not have optimizations for Int52's overflow checks. This emits many ArithAdd(Int52Rep x 2, CheckOverflow). Each
of them emits OSR exit, which prevents dead-store-elimination in B3, and makes ValueToInt32(Int52) alive if it is referenced from some variable which
can be seen if OSR exit occurs.

In this patch, we perform strength-reduction for CheckAdd, converting to Add. We already have such a thing. But the existing one does not handle instructions
well emitted when Int52 is used.

When Int52 is used, we typically have the sequence like,

    Int64 @78 = SExt32(@73, DFG:@67<Int52>) // Widen Int32 to Int64
    Int64 @81 = Shl(@78, $12(@80), DFG:@162<Int52>) // Convert Int32 to Int52

While we have Shl handling for integer-range optimization in B3ReduceStrength, we lack handling of SExt32 while it is very easy.
This patch adds SExt8, SExt16, SExt32, and ZExt32 handling to B3ReduceStrength's integer range analysis.
This converts many CheckAdd in JetStream2/async-fs's hot function to simple Add, and removes a bunch of unnecessary instructions which exist because of this OSR exit.
We can see ~5% improvement in JetStream2/async-fs.

* b3/B3ReduceStrength.cpp:
* b3/testb3.h:
(int16Operands):
(int8Operands):
* b3/testb3_1.cpp:
(run):
* b3/testb3_5.cpp:
(testCheckAddRemoveCheckWithSExt8):
(testCheckAddRemoveCheckWithSExt16):
(testCheckAddRemoveCheckWithSExt32):
(testCheckAddRemoveCheckWithZExt32):

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

10 months agoFix an assertion failure introduced in r250186.
mitz@apple.com [Sun, 22 Sep 2019 06:12:57 +0000 (06:12 +0000)]
Fix an assertion failure introduced in r250186.

* UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
(WebKit::PluginProcessProxy::platformGetLaunchOptionsWithAttributes): Corrected the
  assertion.

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

10 months agoReduce use of SessionID::defaultSessionID() in WebKit
cdumez@apple.com [Sun, 22 Sep 2019 06:04:48 +0000 (06:04 +0000)]
Reduce use of SessionID::defaultSessionID() in WebKit
https://bugs.webkit.org/show_bug.cgi?id=202080

Reviewed by Alex Christensen.

Source/WebCore:

Reduce use of SessionID::defaultSessionID() in WebKit. Falling back to the default session
when you don't know which session to use is never a good idea and a potential privacy issue.

* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::connect):
* dom/Document.cpp:
(WebCore::Document::logger):
* dom/Document.h:
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::parseAdClickAttribution const):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::continueAfterContentPolicy):
* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoaderClient.h:
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
(WebCore::CachedResourceLoader::updateCachedResourceWithCurrentRequest):
(WebCore::CachedResourceLoader::requestResource):
(WebCore::CachedResourceLoader::revalidateResource):
(WebCore::CachedResourceLoader::loadResource):
* loader/cache/CachedResourceLoader.h:
(WebCore::CachedResourceLoader::clearDocumentLoader):
* page/Frame.cpp:
* page/Frame.h:
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::isAlwaysOnLoggingAllowed const):

Source/WebKit:

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::convertMainResourceLoadToDownload):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::convertMainResourceLoadToDownload):
* WebProcess/WebPage/WebFrame.h:

Source/WebKitLegacy/mac:

* WebCoreSupport/WebFrameLoaderClient.h:
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::convertMainResourceLoadToDownload):

Source/WebKitLegacy/win:

* WebCoreSupport/WebFrameLoaderClient.cpp:
(WebFrameLoaderClient::convertMainResourceLoadToDownload):
* WebCoreSupport/WebFrameLoaderClient.h:

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

10 months agoServiceWorkerContextData does not need a sessionID
cdumez@apple.com [Sun, 22 Sep 2019 05:17:38 +0000 (05:17 +0000)]
ServiceWorkerContextData does not need a sessionID
https://bugs.webkit.org/show_bug.cgi?id=202087

Reviewed by Alex Christensen.

* workers/service/ServiceWorkerContextData.cpp:
(WebCore::ServiceWorkerContextData::isolatedCopy const):
* workers/service/ServiceWorkerContextData.h:
(WebCore::ServiceWorkerContextData::encode const):
(WebCore::ServiceWorkerContextData::decode):
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::RegistrationDatabase::RegistrationDatabase):
(WebCore::RegistrationDatabase::importRecords):
* workers/service/server/RegistrationDatabase.h:
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::updateWorker):
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::contextData const):

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

10 months agoDrop unnecessary NetworkProcess::m_sessionByConnection
cdumez@apple.com [Sun, 22 Sep 2019 05:17:00 +0000 (05:17 +0000)]
Drop unnecessary NetworkProcess::m_sessionByConnection
https://bugs.webkit.org/show_bug.cgi?id=202088

Reviewed by Alex Christensen.

* NetworkProcess/NetworkProcess.cpp:
* NetworkProcess/NetworkProcess.h:

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

10 months agoWebIDBConnectionToClient does not need to be RefCounted or a SessionID
cdumez@apple.com [Sun, 22 Sep 2019 05:16:23 +0000 (05:16 +0000)]
WebIDBConnectionToClient does not need to be RefCounted or a SessionID
https://bugs.webkit.org/show_bug.cgi?id=202089

Reviewed by Alex Christensen.

Source/WebCore:

Drop some dead code.

* Modules/indexeddb/server/IDBConnectionToClientDelegate.h:

Source/WebKit:

WebIDBConnectionToClient does not need to be RefCounted, the ref() / deref() virtual function
it implemented from its interface were dead code. We now stop subclassing RefCounted and have
the NetworkConnectionToWebProcess fully own the WebIDBConnectionToClient. Instead of the
WebIDBConnectionToClient having 3 data members for the NetworkProcess, the sessionID and the IPC
connection, use a single data member to its NetworkConnectionToWebProcess parent. It can get
everything it needs from its parent.

* NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
(WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient):
(WebKit::WebIDBConnectionToClient::idbServer):
(WebKit::WebIDBConnectionToClient::disconnectedFromWebProcess):
(WebKit::WebIDBConnectionToClient::messageSenderConnection const):
(WebKit::WebIDBConnectionToClient::connectionToClient):
(WebKit::WebIDBConnectionToClient::deleteDatabase):
(WebKit::WebIDBConnectionToClient::openDatabase):
(WebKit::WebIDBConnectionToClient::abortTransaction):
(WebKit::WebIDBConnectionToClient::commitTransaction):
(WebKit::WebIDBConnectionToClient::didFinishHandlingVersionChangeTransaction):
(WebKit::WebIDBConnectionToClient::createObjectStore):
(WebKit::WebIDBConnectionToClient::deleteObjectStore):
(WebKit::WebIDBConnectionToClient::renameObjectStore):
(WebKit::WebIDBConnectionToClient::clearObjectStore):
(WebKit::WebIDBConnectionToClient::createIndex):
(WebKit::WebIDBConnectionToClient::deleteIndex):
(WebKit::WebIDBConnectionToClient::renameIndex):
(WebKit::WebIDBConnectionToClient::putOrAdd):
(WebKit::WebIDBConnectionToClient::getRecord):
(WebKit::WebIDBConnectionToClient::getAllRecords):
(WebKit::WebIDBConnectionToClient::getCount):
(WebKit::WebIDBConnectionToClient::deleteRecord):
(WebKit::WebIDBConnectionToClient::openCursor):
(WebKit::WebIDBConnectionToClient::iterateCursor):
(WebKit::WebIDBConnectionToClient::establishTransaction):
(WebKit::WebIDBConnectionToClient::databaseConnectionPendingClose):
(WebKit::WebIDBConnectionToClient::databaseConnectionClosed):
(WebKit::WebIDBConnectionToClient::abortOpenAndUpgradeNeeded):
(WebKit::WebIDBConnectionToClient::didFireVersionChangeEvent):
(WebKit::WebIDBConnectionToClient::openDBRequestCancelled):
(WebKit::WebIDBConnectionToClient::confirmDidCloseFromServer):
(WebKit::WebIDBConnectionToClient::getAllDatabaseNames):
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
* NetworkProcess/NetworkConnectionToWebProcess.h:

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

10 months ago[CURL] CurlRequest does not need a sessionID
cdumez@apple.com [Sun, 22 Sep 2019 05:15:45 +0000 (05:15 +0000)]
[CURL] CurlRequest does not need a sessionID
https://bugs.webkit.org/show_bug.cgi?id=202086

Reviewed by Alex Christensen.

* platform/network/curl/CurlFormDataStream.cpp:
(WebCore::CurlFormDataStream::CurlFormDataStream):
* platform/network/curl/CurlFormDataStream.h:
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::CurlRequest):
* platform/network/curl/CurlRequest.h:
(WebCore::CurlRequest::create):
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::createCurlRequest):

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

10 months agoCookieRequestHeaderFieldProxy does not need a SessionID
cdumez@apple.com [Sun, 22 Sep 2019 05:15:13 +0000 (05:15 +0000)]
CookieRequestHeaderFieldProxy does not need a SessionID
https://bugs.webkit.org/show_bug.cgi?id=202084

Reviewed by Alex Christensen.

* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::didOpenSocketStream):
* loader/CookieJar.cpp:
(WebCore::CookieJar::cookieRequestHeaderFieldProxy):
* loader/CookieJar.h:
* platform/network/CookieRequestHeaderFieldProxy.h:
(WebCore::CookieRequestHeaderFieldProxy::encode const):
(WebCore::CookieRequestHeaderFieldProxy::decode):

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

10 months agoDocumentLoader::m_temporaryServiceWorkerClient does not need a sessionID
cdumez@apple.com [Sun, 22 Sep 2019 05:14:26 +0000 (05:14 +0000)]
DocumentLoader::m_temporaryServiceWorkerClient does not need a sessionID
https://bugs.webkit.org/show_bug.cgi?id=202083

Reviewed by Alex Christensen.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::registerTemporaryServiceWorkerClient):
(WebCore::DocumentLoader::unregisterTemporaryServiceWorkerClient):
* loader/DocumentLoader.h:

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

10 months agoMove JSLexicalEnvironment, DirectArguments, and ScopedArguments cells out of the...
mark.lam@apple.com [Sun, 22 Sep 2019 04:01:23 +0000 (04:01 +0000)]
Move JSLexicalEnvironment, DirectArguments, and ScopedArguments cells out of the Gigacage.
https://bugs.webkit.org/show_bug.cgi?id=202082

Reviewed by Tadeu Zagallo.

They are not being caged anyway.

* runtime/DirectArguments.h:
* runtime/JSLexicalEnvironment.h:
(JSC::JSLexicalEnvironment::subspaceFor):
* runtime/ScopedArguments.h:
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:

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

10 months ago[FTW] Resolve crashes found while running canvas tests
bfulgham@apple.com [Sun, 22 Sep 2019 02:40:44 +0000 (02:40 +0000)]
[FTW] Resolve crashes found while running canvas tests
https://bugs.webkit.org/show_bug.cgi?id=202062

Reviewed by Don Olmstead.

* platform/graphics/Pattern.h:
* platform/graphics/win/Direct2DOperations.cpp:
(WebCore::Direct2D::FillSource::FillSource): Take GraphicsContext as argument, rather than
a PlatformContextDirect2D since downstream operations require the former.
(WebCore::Direct2D::StrokeSource::StrokeSource): Ditto.
(WebCore::Direct2D::clip): Use new 'pushClip' helper function.
* platform/graphics/win/Direct2DOperations.h:
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContext::drawPath):
(WebCore::GraphicsContext::fillPath):
(WebCore::GraphicsContext::strokePath):
(WebCore::GraphicsContext::fillRect):
(WebCore::GraphicsContext::fillRectWithRoundedHole):
(WebCore::GraphicsContext::strokeRect):
* platform/graphics/win/GraphicsContextImplDirect2D.cpp:
(WebCore::GraphicsContextImplDirect2D::fillRect): Update to pass GraphicsContext.
(WebCore::GraphicsContextImplDirect2D::fillRectWithRoundedHole): Ditto.
(WebCore::GraphicsContextImplDirect2D::fillPath): Ditto.
(WebCore::GraphicsContextImplDirect2D::strokeRect): Ditto.
(WebCore::GraphicsContextImplDirect2D::strokePath): Ditto.
(WebCore::GraphicsContextImplDirect2D::drawGlyphs): Ditto.
* platform/graphics/win/ImageBufferDataDirect2D.cpp:
(WebCore::ImageBufferData::copyRectFromSourceToData): Correct return behavior.
(WebCore::ImageBufferData::compatibleBitmap): Make a copy if the render target is
backed by the ID2D1Bitmap we are trying to draw with.
* platform/graphics/win/PatternDirect2D.cpp:
(WebCore::Pattern::createPlatformPattern const): Remove 'PlatformContextDirect2D' contructor,
since we always need a GraphicsContext for the Image class.
* platform/graphics/win/PlatformContextDirect2D.cpp:
(WebCore::PlatformContextDirect2D::clipLayer const): Added.
(WebCore::PlatformContextDirect2D::clearClips): Added.
(WebCore::PlatformContextDirect2D::restore): Update to use m_stateStack, rather than
the m_renderStates vector.
(WebCore::PlatformContextDirect2D::save): Ditto.
(WebCore::PlatformContextDirect2D::pushRenderClip): Ditto.
(WebCore::PlatformContextDirect2D::setActiveLayer): Ditto.
(WebCore::PlatformContextDirect2D::endDraw): Ditto.
(WebCore::PlatformContextDirect2D::notifyPostDrawObserver): Ditto.
(WebCore::PlatformContextDirect2D::pushClip): Ditto.
* platform/graphics/win/PlatformContextDirect2D.h:
(WebCore::PlatformContextDirect2D::hasSavedState const):
(WebCore::PlatformContextDirect2D::clipLayer const): Deleted.

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

10 months agoRegression(iOS 13) web views do not deal properly with their window's UIScene changing
cdumez@apple.com [Sat, 21 Sep 2019 23:13:47 +0000 (23:13 +0000)]
Regression(iOS 13) web views do not deal properly with their window's UIScene changing
https://bugs.webkit.org/show_bug.cgi?id=202070
<rdar://problem/55580699>

Reviewed by Tim Horton.

Web views do not deal properly with their window's UIScene changing. If a Safari window is in the
background for 1 minute, its UIScene will be detached and the window will get a new UIScene if
the user later switches to this window. Our web views listen to UIScene notifications to determine
their visibility and currently stop receiving visibility updates once the window’s UIScene has
changed. This causes view freezes because our WebContent process does not know its view is visible
and keeps its layer tree frozen.

Previously, when our view would be added to a window, we would get this window's UIScene and listen
for UISceneDidEnterBackgroundNotification / UISceneWillEnterForegroundNotification for this UIScene
object. Instead, we now listen to these notifications for ALL the application's UIScenes. Our handler
then checks if the notification's UIScene object matches the current window's UIScene before
forwarding the notification to the rest of WebKit.

* UIProcess/ApplicationStateTracker.mm:
(WebKit::ApplicationStateTracker::ApplicationStateTracker):
(WebKit::ApplicationStateTracker::~ApplicationStateTracker):

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

10 months agoSafari 13 may launch leftover 32-bit plug-in process from Safari 12’s WebKit, which...
mitz@apple.com [Sat, 21 Sep 2019 22:57:46 +0000 (22:57 +0000)]
Safari 13 may launch leftover 32-bit plug-in process from Safari 12’s WebKit, which crashes
https://bugs.webkit.org/show_bug.cgi?id=202077
<rdar://problem/55547063>

Reviewed by Sam Weinig.

* Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
(WebKit::getPluginArchitecture): Removed support for i386 plug-ins.

* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::serviceName): Assert that the requested process type is not Plugin32.

* UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
(WebKit::PluginProcessProxy::platformGetLaunchOptionsWithAttributes): Assert that the
  plug-in architecture is x86_64.

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

10 months agostress/test-out-of-memory.js is not throwing OOM into ARMv7 and MIPS
ticaiolima@gmail.com [Sat, 21 Sep 2019 20:20:56 +0000 (20:20 +0000)]
stress/test-out-of-memory.js is not throwing OOM into ARMv7 and MIPS
https://bugs.webkit.org/show_bug.cgi?id=202011

Reviewed by Mark Lam.

We are skipping this test into MIPS and ARMv7 because some of its assumptions
are not valid for them. The current behavior of the test in those architectures
is that it does not throw during `new ArrayBuffer(1000)` allocation site,
because eden collection keeps happening between iterations. The collection
is triggered on those architectures because the amount of stress
`new Promise` generates into GC limits is not enough to avoid them
while loop is executing.

Changing the size of `UInt8Array` from `80000000` to `160000000` can
be an alternative fix to avoid collection happening during `ArrayBuffer`
allocation loop, but we can't guarantee this test is always going to execute
without error when Gigacage is disabled, given we can reach an OOM state in
some allocations that need to succeed, making this test flaky for those
architectures.

* stress/test-out-of-memory.js:

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

10 months agoAccessCase should strongly visit its dependencies while on stack
tzagallo@apple.com [Sat, 21 Sep 2019 18:30:29 +0000 (18:30 +0000)]
AccessCase should strongly visit its dependencies while on stack
https://bugs.webkit.org/show_bug.cgi?id=201986
<rdar://problem/55521953>

Reviewed by Saam Barati and Yusuke Suzuki.

JSTests:

* stress/ftl-put-by-id-setter-exception-interesting-live-state-2.js: Added.
(foo):
(warmup):

Source/JavaScriptCore:

AccessCase::doesCalls is responsible for specifying the cells it depends on, so that
MarkingGCAwareJITStubRoutine can strongly visit them while the stub is on stack. However,
it was missing most of its dependencies, which led to it being collected while on stack.
This manifested in the flaky test stress/ftl-put-by-id-setter-exception-interesting-live-state.js
as the PolymorphicAccess being collected and removing its exception handler from the code
block, which led to exception propagating past the try/catch.

In order to fix this, we abstract the dependency gathering logic from AccessCase into
forEachDependentCell and use it to implement visitWeak as well as doesCalls in order to
guarantee that their implementation is consistent.

* bytecode/AccessCase.cpp:
(JSC::AccessCase::forEachDependentCell const):
(JSC::AccessCase::doesCalls const):
(JSC::AccessCase::visitWeak const):
* bytecode/AccessCase.h:
* bytecode/CallLinkInfo.cpp:
(JSC::CallLinkInfo::lastSeenCallee const):
(JSC::CallLinkInfo::haveLastSeenCallee const):
(JSC::CallLinkInfo::lastSeenCallee): Deleted.
(JSC::CallLinkInfo::haveLastSeenCallee): Deleted.
* bytecode/CallLinkInfo.h:
(JSC::CallLinkInfo::isDirect const):
(JSC::CallLinkInfo::isLinked const):
(JSC::CallLinkInfo::stub const):
(JSC::CallLinkInfo::forEachDependentCell const):
(JSC::CallLinkInfo::isLinked): Deleted.
(JSC::CallLinkInfo::stub): Deleted.
* bytecode/ObjectPropertyCondition.cpp:
(JSC::ObjectPropertyCondition::isStillLive const):
* bytecode/ObjectPropertyCondition.h:
(JSC::ObjectPropertyCondition::forEachDependentCell const):
* bytecode/ObjectPropertyConditionSet.cpp:
(JSC::ObjectPropertyConditionSet::areStillLive const):
* bytecode/ObjectPropertyConditionSet.h:
(JSC::ObjectPropertyConditionSet::forEachDependentCell const):
* bytecode/PropertyCondition.cpp:
(JSC::PropertyCondition::isStillLive const):
* bytecode/PropertyCondition.h:
(JSC::PropertyCondition::forEachDependentCell const):
* jit/PolymorphicCallStubRoutine.cpp:
(JSC::PolymorphicCallStubRoutine::visitWeak):
* jit/PolymorphicCallStubRoutine.h:
(JSC::PolymorphicCallStubRoutine::forEachDependentCell):

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

10 months ago[Pointer Events] touch-action set to pan-x or pan-y alone should disable scrolling...
graouts@webkit.org [Sat, 21 Sep 2019 16:08:34 +0000 (16:08 +0000)]
[Pointer Events] touch-action set to pan-x or pan-y alone should disable scrolling altogether if the intial gesture is in the disallowed direction
https://bugs.webkit.org/show_bug.cgi?id=202053
<rdar://problem/54542190>

Reviewed by Tim Horton.

Source/WebKit:

Although the Pointer Events specification does not specify this clearly (see https://github.com/w3c/pointerevents/issues/303), setting "touch-action" to a value
that only allows scrolling a specific direction ("pan-x" or "pan-y") should disable scrolling in the specified direction if the panning gesture initially is directed
in the opposite direction. In practice, this means that setting "touch-action: pan-y" on an element should disable scrolling if the user initially pans horizontally,
even if later on in the gesture the user pans vertically. This allows for sites that want to offer a programmatic horizontal scroller to disable vertical scrolling
if the user pans horizontally.

In order to support this, we add four UISwipeGestureRecognizers, one for each direction, and we selectively allows touches to be recognizer for them based on the
"touch-action" value specified at the initial touch location for a given gesture. In the case of "touch-action: pan-y" we only allow the left and right swipe recognizers
to be enabled, and in the case of "touch-action: pan-x" we only allow the up and down swipe recognizers to be enabled. If any of those gesture recognizers is recognized,
scrolling will be disabled for the duration of this gesture. If a UIScrollView panning gesture recognizer is recognized prior to a swipe, they won't have a chance to be
recognized.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView cleanupInteraction]):
(-[WKContentView _removeDefaultGestureRecognizers]):
(-[WKContentView _addDefaultGestureRecognizers]):
(-[WKContentView gestureRecognizer:shouldReceiveTouch:]):

LayoutTests:

Add new tests checking that setting "touch-action: pan-y" on an element and initiating a horizontal panning gesture will disallow scrolling vertically
if a vertical scrolling gesture follows. We test both the case where scrolling would apply to the whole page and the case where scrolling would apply
to an "overflow: scroll" element.

* pointerevents/ios/touch-action-pan-y-horizontal-gesture-prevents-vertical-scrolling-expected.txt: Added.
* pointerevents/ios/touch-action-pan-y-horizontal-gesture-prevents-vertical-scrolling.html: Added.
* pointerevents/ios/touch-action-pan-y-in-overflow-scroll-horizontal-gesture-prevents-vertical-scrolling-expected.txt: Added.
* pointerevents/ios/touch-action-pan-y-in-overflow-scroll-horizontal-gesture-prevents-vertical-scrolling.html: Added.

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

10 months agoreleasePointerCapture() not working for implicit capture; can't opt-in to pointerente...
graouts@webkit.org [Sat, 21 Sep 2019 15:34:43 +0000 (15:34 +0000)]
releasePointerCapture() not working for implicit capture; can't opt-in to pointerenter/leave for touches
https://bugs.webkit.org/show_bug.cgi?id=199803
<rdar://problem/53127223>

Reviewed by Dean Jackson.

Source/WebCore:

In order to dispatch boundary events (pointerover/out/enter/leave) when the implicit pointer capture is released on iOS,
we need to track the target of the pointer events that was dispatched last for a given pointer id. Then we compare that
target with the current target when dispatching a new pointer event and determine whether we should dispatch boundary
events using the exact same approach used to dispatch mouse boundary events in EventHandler::updateMouseEventTargetNode().

Tests: pointerevents/ios/boundary-events-through-hierarchy-without-pointer-capture.html
       pointerevents/ios/boundary-events-without-pointer-capture.html

* page/PointerCaptureController.cpp:
(WebCore::hierarchyHasCapturingEventListeners):
(WebCore::PointerCaptureController::dispatchEventForTouchAtIndex):
(WebCore::PointerCaptureController::pointerEventWillBeDispatched):
(WebCore::PointerCaptureController::ensureCapturingDataForPointerEvent):
(WebCore::PointerCaptureController::cancelPointer):
* page/PointerCaptureController.h:

LayoutTests:

Add new tests that check we correctly dispatch boundary events on iOS when pointer capture is disabled.

* pointerevents/ios/boundary-events-through-hierarchy-without-pointer-capture-expected.txt: Added.
* pointerevents/ios/boundary-events-through-hierarchy-without-pointer-capture.html: Added.
* pointerevents/ios/boundary-events-without-pointer-capture-expected.txt: Added.
* pointerevents/ios/boundary-events-without-pointer-capture.html: Added.
* pointerevents/utils.js:

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

10 months ago[LFC] LayoutContext::m_formattingContextRootListForLayout should be a WeakHashSet
zalan@apple.com [Sat, 21 Sep 2019 13:51:17 +0000 (13:51 +0000)]
[LFC] LayoutContext::m_formattingContextRootListForLayout should be a WeakHashSet
https://bugs.webkit.org/show_bug.cgi?id=202068
<rdar://problem/55579352>

Reviewed by Alex Christensen.

* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::layout):
(WebCore::Layout::LayoutContext::styleChanged):
(WebCore::Layout::LayoutContext::markNeedsUpdate):
* layout/LayoutContext.h:
* page/FrameViewLayoutContext.cpp:
(WebCore::layoutUsingFormattingContext):

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

10 months agoclang-tidy: Fix unnecessary copy/ref churn of for loop variables in WTF/JavaScriptCore
ddkilzer@apple.com [Sat, 21 Sep 2019 11:39:57 +0000 (11:39 +0000)]
clang-tidy: Fix unnecessary copy/ref churn of for loop variables in WTF/JavaScriptCore
<https://webkit.org/b/202069>

Reviewed by Mark Lam.

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

Source/JavaScriptCore:

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::setConstantIdentifierSetRegisters):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::prepareLexicalScopeForNextForLoopIteration):
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::dump):
* inspector/agents/InspectorAgent.cpp:
(Inspector::InspectorAgent::activateExtraDomains):
* inspector/remote/cocoa/RemoteInspectorCocoa.mm:
(Inspector::RemoteInspector::stopInternal):
(Inspector::RemoteInspector::xpcConnectionFailed):
(Inspector::RemoteInspector::pushListingsNow):
* parser/Parser.h:
(JSC::Scope::computeLexicallyCapturedVariablesAndPurgeCandidates):
* runtime/ProxyObject.cpp:
(JSC::ProxyObject::performGetOwnPropertyNames):
* runtime/SamplingProfiler.cpp:
(JSC::SamplingProfiler::registerForReportAtExit):
(JSC::SamplingProfiler::reportTopFunctions):
(JSC::SamplingProfiler::reportTopBytecodes):
* runtime/TypeSet.cpp:
(JSC::StructureShape::inspectorRepresentation):
(JSC::StructureShape::merge):

Source/WTF:

* wtf/AggregateLogger.h:
(WTF::AggregateLogger::log const):

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

10 months ago[Apple Pay] Clean up handling of summary items and payment method updates
aestes@apple.com [Sat, 21 Sep 2019 06:37:34 +0000 (06:37 +0000)]
[Apple Pay] Clean up handling of summary items and payment method updates
https://bugs.webkit.org/show_bug.cgi?id=202018
<rdar://problem/55470632>

Reviewed by Tim Horton.

Source/WebCore:

Replaced the PaymentMethodUpdate struct with a class that knows how to convert from
ApplePayPaymentMethodUpdate structs to PKPaymentRequestPaymentMethodUpdate instances.

Moved some scattered-around free functions for converting payment summary items into
PaymentSummaryItems{.h,Cocoa.mm}.

* Modules/applepay/ApplePayPaymentMethodUpdate.h:
* Modules/applepay/ApplePaySession.cpp:
(WebCore::finishConverting):
(WebCore::convertAndValidateTotal):
(WebCore::convertAndValidate):
* Modules/applepay/ApplePaySessionPaymentRequest.h:
* Modules/applepay/PaymentCoordinator.h:
* Modules/applepay/PaymentCoordinatorClient.h:
* Modules/applepay/PaymentHeaders.h:
* Modules/applepay/PaymentMethodUpdate.h: Added.
* Modules/applepay/PaymentSummaryItems.h: Added.
* Modules/applepay/cocoa/PaymentMethodUpdateCocoa.mm: Added.
(WebCore::PaymentMethodUpdate::PaymentMethodUpdate):
(WebCore::PaymentMethodUpdate::totalAndLineItems const):
(WebCore::PaymentMethodUpdate::platformUpdate const):
* Modules/applepay/cocoa/PaymentSummaryItemsCocoa.mm: Added.
(WebCore::toDecimalNumber):
(WebCore::toPKPaymentSummaryItemType):
(WebCore::toPKPaymentSummaryItem):
(WebCore::platformSummaryItems):
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::ApplePayPaymentHandler::paymentMethodUpdated):
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* testing/MockPaymentCoordinator.cpp:
(WebCore::MockPaymentCoordinator::completePaymentMethodSelection):

Source/WebKit:

Now that PaymentMethodUpdate knows how to convert itself to a
PKPaymentRequestPaymentMethodUpdate, PaymentAuthorizationPresenter can merely pass the
converted update directly to the platform delegate rather than passing the individual
components and relying on the delegate to instantiate the platform update itself. Added
FIXMEs for applying a similar treatment to ShippingContactUpdate and ShippingMethodUpdate.

* Platform/cocoa/PaymentAuthorizationPresenter.h:
* Platform/cocoa/PaymentAuthorizationPresenter.mm:
(WebKit::PaymentAuthorizationPresenter::completePaymentMethodSelection):
(WebKit::PaymentAuthorizationPresenter::completeShippingContactSelection):
(WebKit::PaymentAuthorizationPresenter::completeShippingMethodSelection):
* Platform/cocoa/WKPaymentAuthorizationDelegate.h:
* Platform/cocoa/WKPaymentAuthorizationDelegate.mm:
(-[WKPaymentAuthorizationDelegate completePaymentMethodSelection:]):
(-[WKPaymentAuthorizationDelegate completeShippingContactSelection:]):
(-[WKPaymentAuthorizationDelegate completeShippingMethodSelection:]):
(-[WKPaymentAuthorizationDelegate _didSelectPaymentMethod:completion:]):
(-[WKPaymentAuthorizationDelegate _didSelectShippingContact:completion:]):
(-[WKPaymentAuthorizationDelegate _didSelectShippingMethod:completion:]):
(-[WKPaymentAuthorizationDelegate completeShippingContactSelection:summaryItems:shippingMethods:errors:]): Deleted.
* Shared/ApplePay/WebPaymentCoordinatorProxy.h:
* Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
* Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest):
(WebKit::toPKPaymentSummaryItemType): Deleted.
(WebKit::toPKPaymentSummaryItem): Deleted.
(WebKit::toPKPaymentSummaryItems): Deleted.
* Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
(IPC::ArgumentCoder<WebCore::PaymentMethodUpdate>::encode):
(IPC::ArgumentCoder<WebCore::PaymentMethodUpdate>::decode):

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

10 months agoeliding a move in Air O0 needs to mark the dest's old reg as available
keith_miller@apple.com [Sat, 21 Sep 2019 02:11:37 +0000 (02:11 +0000)]
eliding a move in Air O0 needs to mark the dest's old reg as available
https://bugs.webkit.org/show_bug.cgi?id=202066

Reviewed by Saam Barati.

Also adds a new release method that handles all the invariants of
returning a register to the available register pool.

* b3/air/AirAllocateRegistersAndStackAndGenerateCode.cpp:
(JSC::B3::Air::GenerateAndAllocateRegisters::release):
(JSC::B3::Air::GenerateAndAllocateRegisters::spill):
(JSC::B3::Air::GenerateAndAllocateRegisters::freeDeadTmpsIfNeeded):
(JSC::B3::Air::GenerateAndAllocateRegisters::generate):
* b3/air/AirAllocateRegistersAndStackAndGenerateCode.h:

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

10 months agoAssertion fires when animating a discrete property with values range and multiple...
commit-queue@webkit.org [Sat, 21 Sep 2019 01:24:45 +0000 (01:24 +0000)]
Assertion fires when animating a discrete property with values range and multiple animators
https://bugs.webkit.org/show_bug.cgi?id=201926

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-09-20
Reviewed by Darin Adler.

Source/WebCore:

The first animator of a property is considered the result element. The
other animators will be just contributers to the first animator. For the
first animator and in SVGSMILElement::progress(), we call resetAnimatedType()
which creates m_animator in SVGAnimateElementBase::animator(). But for
the other animators we do not call resetAnimatedType(). So their m_animator
will stay null until they are used for the first time.

If SVGAnimationElement::startedActiveInterval() calls calculateToAtEndOfDurationValue()
for a discrete property this will have no effect and the call should be
ignored. So SVGAnimateElementBase::calculateToAtEndOfDurationValue()
should bail out early if isDiscreteAnimator() is true.

The bug is isDiscreteAnimator() will return false if the m_animator is
null even if the animated property is discrete, e.g. SVGAnimatedString.
The fix is to make isDiscreteAnimator() ensure m_animator is created.

Unrelated change:
Make most of the protected methods of SVGAnimateElementBase be private.

Test: svg/animations/multiple-discrete-values-animate.svg

* svg/SVGAnimateElementBase.cpp:
(WebCore::SVGAnimateElementBase::calculateFromAndByValues):
(WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue):

LayoutTests:

Animate a discrete property, such as SVGAnimatedString. There should be
multiple animators and the range of animation has to be set by the 'values'
attribute.

* svg/animations/multiple-discrete-values-animate-expected.txt: Added.
* svg/animations/multiple-discrete-values-animate.svg: Added.

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

10 months ago[EWS] JSC queues should re-build ToT and compare results on build failure
aakash_jain@apple.com [Sat, 21 Sep 2019 01:07:49 +0000 (01:07 +0000)]
[EWS] JSC queues should re-build ToT and compare results on build failure
https://bugs.webkit.org/show_bug.cgi?id=201999

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/factories.py:
(JSCTestsFactory.__init__): Do not add the UnApplyPatchIfRequired and CompileJSCOnlyToT step here, as
these are dynamically added (if required) in steps.py in CompileWebKit.evaluateCommand() using addStepsAfterCurrentStep().
Also setting skipUpload=False since we don't need to upload the archive for this queue. Building and testing is done in same build.
* BuildSlaveSupport/ews-build/steps.py:
(CompileWebKit.evaluateCommand): Add CompileJSCOnlyToT or CompileWebKitToT build-step based on 'group' property.
(AnalyzeCompileWebKitResults.start): Ditto.
(CompileJSCOnly.start): Set the 'group' property to 'jsc'.
(CompileJSCOnlyToT.evaluateCommand): Over-ride evaluateCommand, so that base-class' (CompileWebKit) evaluateCommand is
not used, base class evaluateCommand adds build-steps dynamically.

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

10 months agoRemove dead code for a specific macOS and iOS SDK
krollin@apple.com [Sat, 21 Sep 2019 00:36:06 +0000 (00:36 +0000)]
Remove dead code for a specific macOS and iOS SDK
https://bugs.webkit.org/show_bug.cgi?id=202054
<rdar://problem/55569619>

Reviewed by Zalan Bujtas.

ComplexTextController::collectComplexTextRunsForCharacters in
ComplexTextControllerCoreText.mm has some code for compatibility with
specifically macOS 10.14.0 and iOS 12.0 (see Bug 186571). We don't
build for these targets any more (when we build for macOS 10.14, it's
for a later minor revision), so this code can be removed.

No new tests -- no new or changed functionality.

* platform/graphics/mac/ComplexTextControllerCoreText.mm:
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters):

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

10 months agoHarden assertion in StructureIDTable::get().
mark.lam@apple.com [Sat, 21 Sep 2019 00:29:13 +0000 (00:29 +0000)]
Harden assertion in StructureIDTable::get().
https://bugs.webkit.org/show_bug.cgi?id=202067
<rdar://problem/55577923>

Reviewed by Keith Miller.

* runtime/StructureIDTable.h:
(JSC::StructureIDTable::get):

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

10 months agoRemove some support for < iOS 13
krollin@apple.com [Sat, 21 Sep 2019 00:17:27 +0000 (00:17 +0000)]
Remove some support for < iOS 13
https://bugs.webkit.org/show_bug.cgi?id=202027
<rdar://problem/55547109>

Reviewed by Alex Christensen.

Remove some support for iOS versions less than 13.0.

Update conditionals that reference __IPHONE_OS_VERSION_MIN_REQUIRED
and __IPHONE_OS_VERSION_MAX_ALLOWED, assuming that they both have
values >= 130000. This means that expressions like
"__IPHONE_OS_VERSION_MIN_REQUIRED < 101300" are always False and
"__IPHONE_OS_VERSION_MIN_REQUIRED >= 101300" are always True.

After version checks have been removed, there are some cases where the
preprocessor conditional looks like "#if PLATFORM(MAC) ||
PLATFORM(IOS_FAMILY)". These can be collapsed into "#if
PLATFORM(COCOA)". This additional cleanup will be performed in a
subsequent patch.

This removal is part of a series of patches effecting the removal of
dead code for old versions of iOS. This particular pass involves
changes in which Joe Pecoraro was involved. These changes are isolated
from other similar changes in order to facilitate the reviewing
process.

Source/WebCore/PAL:

* pal/spi/cf/CFNetworkSPI.h:

Source/WebKit:

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

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

10 months agoRemove unnecessary abstractions around WebsiteDataStore
achristensen@apple.com [Sat, 21 Sep 2019 00:13:24 +0000 (00:13 +0000)]
Remove unnecessary abstractions around WebsiteDataStore
https://bugs.webkit.org/show_bug.cgi?id=201655

Reviewed by Chris Dumez.

Source/WebCore:

* Modules/webdatabase/cocoa/DatabaseManagerCocoa.mm:
(WebCore::DatabaseManager::platformInitialize):

Source/WebKit:

* PlatformFTW.cmake:
* PlatformWin.cmake:
* Sources.txt:
* SourcesCocoa.txt:
* SourcesGTK.txt:
* SourcesWPE.txt:
* UIProcess/API/APIHTTPCookieStore.cpp:
* UIProcess/API/APIHTTPCookieStore.h:
* UIProcess/API/APIPageConfiguration.cpp:
(API::PageConfiguration::websiteDataStore):
(API::PageConfiguration::setWebsiteDataStore):
* UIProcess/API/APIPageConfiguration.h:
* UIProcess/API/APIProcessPoolConfiguration.cpp:
* UIProcess/API/APIWebsiteDataStore.cpp: Removed.
* UIProcess/API/APIWebsiteDataStore.h: Removed.
* UIProcess/API/APIWebsitePolicies.cpp:
(API::WebsitePolicies::WebsitePolicies):
(API::WebsitePolicies::setWebsiteDataStore):
(API::WebsitePolicies::data):
* UIProcess/API/APIWebsitePolicies.h:
* UIProcess/API/C/WKAPICast.h:
* UIProcess/API/C/WKContext.cpp:
(WKContextSetCacheModel):
(WKContextGetCacheModel):
* UIProcess/API/C/WKFramePolicyListener.cpp:
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreGetTypeID):
(WKWebsiteDataStoreGetDefaultDataStore):
(WKWebsiteDataStoreCreateNonPersistentDataStore):
(WKWebsiteDataStoreCreateWithConfiguration):
(WKWebsiteDataStoreGetHTTPCookieStore):
(WKWebsiteDataStoreSetResourceLoadStatisticsDebugModeWithCompletionHandler):
(WKWebsiteDataStoreSetResourceLoadStatisticsPrevalentResourceForDebugMode):
(WKWebsiteDataStoreSetStatisticsLastSeen):
(WKWebsiteDataStoreSetStatisticsPrevalentResource):
(WKWebsiteDataStoreSetStatisticsVeryPrevalentResource):
(WKWebsiteDataStoreDumpResourceLoadStatistics):
(WKWebsiteDataStoreIsStatisticsPrevalentResource):
(WKWebsiteDataStoreIsStatisticsVeryPrevalentResource):
(WKWebsiteDataStoreIsStatisticsRegisteredAsSubresourceUnder):
(WKWebsiteDataStoreIsStatisticsRegisteredAsSubFrameUnder):
(WKWebsiteDataStoreIsStatisticsRegisteredAsRedirectingTo):
(WKWebsiteDataStoreSetStatisticsHasHadUserInteraction):
(WKWebsiteDataStoreIsStatisticsHasHadUserInteraction):
(WKWebsiteDataStoreSetStatisticsGrandfathered):
(WKWebsiteDataStoreIsStatisticsGrandfathered):
(WKWebsiteDataStoreSetStatisticsSubframeUnderTopFrameOrigin):
(WKWebsiteDataStoreSetStatisticsSubresourceUnderTopFrameOrigin):
(WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectTo):
(WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectFrom):
(WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectTo):
(WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectFrom):
(WKWebsiteDataStoreSetStatisticsCrossSiteLoadWithLinkDecoration):
(WKWebsiteDataStoreSetStatisticsTimeToLiveUserInteraction):
(WKWebsiteDataStoreStatisticsProcessStatisticsAndDataRecords):
(WKWebsiteDataStoreStatisticsUpdateCookieBlocking):
(WKWebsiteDataStoreStatisticsSubmitTelemetry):
(WKWebsiteDataStoreSetStatisticsNotifyPagesWhenDataRecordsWereScanned):
(WKWebsiteDataStoreSetStatisticsIsRunningTest):
(WKWebsiteDataStoreSetStatisticsShouldClassifyResourcesBeforeDataRecordsRemoval):
(WKWebsiteDataStoreSetStatisticsNotifyPagesWhenTelemetryWasCaptured):
(WKWebsiteDataStoreSetStatisticsMinimumTimeBetweenDataRecordsRemoval):
(WKWebsiteDataStoreSetStatisticsGrandfatheringTime):
(WKWebsiteDataStoreSetStatisticsMaxStatisticsEntries):
(WKWebsiteDataStoreSetStatisticsPruneEntriesDownTo):
(WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
(WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
(WKWebsiteDataStoreStatisticsClearThroughWebsiteDataRemoval):
(WKWebsiteDataStoreStatisticsDeleteCookiesForTesting):
(WKWebsiteDataStoreStatisticsHasLocalStorage):
(WKWebsiteDataStoreSetStatisticsCacheMaxAgeCap):
(WKWebsiteDataStoreStatisticsHasIsolatedSession):
(WKWebsiteDataStoreStatisticsResetToConsistentState):
(WKWebsiteDataStoreRemoveAllFetchCaches):
(WKWebsiteDataStoreRemoveFetchCacheForOrigin):
(WKWebsiteDataStoreRemoveAllIndexedDatabases):
(WKWebsiteDataStoreRemoveLocalStorage):
(WKWebsiteDataStoreRemoveAllServiceWorkerRegistrations):
(WKWebsiteDataStoreGetFetchCacheOrigins):
(WKWebsiteDataStoreGetFetchCacheSizeForOrigin):
(WKWebsiteDataStoreCopyServiceWorkerRegistrationDirectory):
(WKWebsiteDataStoreSetServiceWorkerRegistrationDirectory):
(WKWebsiteDataStoreClearAllDeviceOrientationPermissions):
(WKWebsiteDataStoreSetWebAuthenticationMockConfiguration):
(WKWebsiteDataStoreClearAdClickAttributionsThroughWebsiteDataRemoval):
* UIProcess/API/C/WKWebsitePolicies.cpp:
* UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm: Removed.
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(+[WKWebsiteDataStore defaultDataStore]):
(+[WKWebsiteDataStore nonPersistentDataStore]):
(-[WKWebsiteDataStore dealloc]):
(-[WKWebsiteDataStore httpCookieStore]):
(-[WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
(-[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]):
(+[WKWebsiteDataStore _defaultDataStoreExists]):
(+[WKWebsiteDataStore _deleteDefaultDataStoreForTesting]):
(-[WKWebsiteDataStore _initWithConfiguration:]):
(-[WKWebsiteDataStore _fetchDataRecordsOfTypes:withOptions:completionHandler:]):
(-[WKWebsiteDataStore _resourceLoadStatisticsEnabled]):
(-[WKWebsiteDataStore _setResourceLoadStatisticsEnabled:]):
(-[WKWebsiteDataStore _resourceLoadStatisticsDebugMode]):
(-[WKWebsiteDataStore _setResourceLoadStatisticsDebugMode:]):
(-[WKWebsiteDataStore _cacheStorageDirectory]):
(-[WKWebsiteDataStore _setCacheStorageDirectory:]):
(-[WKWebsiteDataStore _serviceWorkerRegistrationDirectory]):
(-[WKWebsiteDataStore _setServiceWorkerRegistrationDirectory:]):
(-[WKWebsiteDataStore _setBoundInterfaceIdentifier:]):
(-[WKWebsiteDataStore _boundInterfaceIdentifier]):
(-[WKWebsiteDataStore _setAllowsCellularAccess:]):
(-[WKWebsiteDataStore _allowsCellularAccess]):
(-[WKWebsiteDataStore _setProxyConfiguration:]):
(-[WKWebsiteDataStore _sourceApplicationBundleIdentifier]):
(-[WKWebsiteDataStore _setSourceApplicationBundleIdentifier:]):
(-[WKWebsiteDataStore _sourceApplicationSecondaryIdentifier]):
(-[WKWebsiteDataStore _setSourceApplicationSecondaryIdentifier:]):
(-[WKWebsiteDataStore _proxyConfiguration]):
(-[WKWebsiteDataStore _indexedDBDatabaseDirectory]):
(-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldSubmitTelemetry:]):
(-[WKWebsiteDataStore _setResourceLoadStatisticsTestingCallback:]):
(-[WKWebsiteDataStore _getAllStorageAccessEntriesFor:completionHandler:]):
(-[WKWebsiteDataStore _scheduleCookieBlockingUpdate:]):
(-[WKWebsiteDataStore _setPrevalentDomain:completionHandler:]):
(-[WKWebsiteDataStore _getIsPrevalentDomain:completionHandler:]):
(-[WKWebsiteDataStore _clearPrevalentDomain:completionHandler:]):
(-[WKWebsiteDataStore _processStatisticsAndDataRecords:]):
(-[WKWebsiteDataStore _hasRegisteredServiceWorker]):
(-[WKWebsiteDataStore _delegate]):
(-[WKWebsiteDataStore set_delegate:]):
* UIProcess/API/Cocoa/WKWebsiteDataStoreInternal.h:
* UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp: Removed.
* UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
(webkitWebsiteDataManagerSetProperty):
(webkitWebsiteDataManagerGetDataStore):
(webkit_website_data_manager_get_local_storage_directory):
(webkit_website_data_manager_get_disk_cache_directory):
(webkit_website_data_manager_get_offline_application_cache_directory):
(webkit_website_data_manager_get_indexeddb_directory):
(webkit_website_data_manager_get_websql_directory):
(webkit_website_data_manager_get_hsts_cache_directory):
(webkit_website_data_manager_fetch):
(webkit_website_data_manager_remove):
(webkit_website_data_manager_clear):
(webkitWebsiteDataManagerCreate): Deleted.
* UIProcess/API/glib/WebKitWebsiteDataManagerPrivate.h:
* UIProcess/API/win/APIWebsiteDataStoreWin.cpp: Removed.
* UIProcess/Cocoa/NavigationState.mm:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::NetworkProcessProxy):
(WebKit::NetworkProcessProxy::websiteDataStoreFromSessionID):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebFramePolicyListenerProxy.cpp:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
* UIProcess/WebProcessPool.cpp:
(WebKit::m_webProcessCache):
(WebKit::WebProcessPool::ensureNetworkProcess):
(WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
(WebKit::WebProcessPool::tryTakePrewarmedProcess):
(WebKit::WebProcessPool::processDidFinishLaunching):
(WebKit::WebProcessPool::processForRegistrableDomain):
(WebKit::WebProcessPool::createWebPage):
(WebKit::WebProcessPool::mayHaveRegisteredServiceWorkers):
* UIProcess/WebProcessPool.h:
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::defaultApplicationCacheDirectory):
(WebKit::WebsiteDataStore::defaultCacheStorageDirectory):
(WebKit::WebsiteDataStore::defaultNetworkCacheDirectory):
(WebKit::WebsiteDataStore::defaultMediaCacheDirectory):
(WebKit::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
(WebKit::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory):
(WebKit::WebsiteDataStore::defaultLocalStorageDirectory):
(WebKit::WebsiteDataStore::defaultMediaKeysStorageDirectory):
(WebKit::WebsiteDataStore::defaultWebSQLDatabaseDirectory):
(WebKit::WebsiteDataStore::defaultResourceLoadStatisticsDirectory):
(WebKit::WebsiteDataStore::defaultJavaScriptConfigurationDirectory):
(WebKit::WebsiteDataStore::tempDirectoryFileSystemRepresentation):
(WebKit::WebsiteDataStore::cacheDirectoryFileSystemRepresentation):
(WebKit::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::globalDefaultDataStore):
(WebKit::WebsiteDataStore::defaultDataStore):
(WebKit::WebsiteDataStore::deleteDefaultDataStoreForTesting):
(WebKit::WebsiteDataStore::defaultDataStoreExists):
(WebKit::WebsiteDataStore::defaultDataStoreConfiguration):
(WebKit::WebsiteDataStore::isAssociatedProcessPool const):
(WebKit::WebsiteDataStore::defaultMediaCacheDirectory):
(WebKit::WebsiteDataStore::defaultJavaScriptConfigurationDirectory):
(WebKit::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory):
* UIProcess/WebsiteData/WebsiteDataStore.h:
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
* UIProcess/WebsiteData/win/WebsiteDataStoreWin.cpp:
(WebKit::WebsiteDataStore::defaultApplicationCacheDirectory):
(WebKit::WebsiteDataStore::defaultCacheStorageDirectory):
(WebKit::WebsiteDataStore::defaultNetworkCacheDirectory):
(WebKit::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
(WebKit::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory):
(WebKit::WebsiteDataStore::defaultLocalStorageDirectory):
(WebKit::WebsiteDataStore::defaultMediaKeysStorageDirectory):
(WebKit::WebsiteDataStore::defaultWebSQLDatabaseDirectory):
(WebKit::WebsiteDataStore::defaultResourceLoadStatisticsDirectory):
(WebKit::WebsiteDataStore::cacheDirectoryFileSystemRepresentation):
(WebKit::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
* UIProcess/glib/WebProcessProxyGLib.cpp:
(WebKit::WebProcessProxy::platformGetLaunchOptions):
* UIProcess/glib/WebsiteDataStoreGLib.cpp: Copied from Source/WebKit/UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp.
(API::WebsiteDataStore::defaultApplicationCacheDirectory): Deleted.
(API::WebsiteDataStore::defaultNetworkCacheDirectory): Deleted.
(API::WebsiteDataStore::defaultCacheStorageDirectory): Deleted.
(API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory): Deleted.
(API::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory): Deleted.
(API::WebsiteDataStore::defaultLocalStorageDirectory): Deleted.
(API::WebsiteDataStore::defaultMediaKeysStorageDirectory): Deleted.
(API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory): Deleted.
(API::WebsiteDataStore::defaultWebSQLDatabaseDirectory): Deleted.
(API::WebsiteDataStore::defaultHSTSDirectory): Deleted.
(API::WebsiteDataStore::defaultResourceLoadStatisticsDirectory): Deleted.
(API::WebsiteDataStore::cacheDirectoryFileSystemRepresentation): Deleted.
(API::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation): Deleted.
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
(WebKit::WebMediaKeyStorageManager::setWebsiteDataStore):

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

10 months ago[resource-timing] Report performance entries with all HTTP status codes
commit-queue@webkit.org [Fri, 20 Sep 2019 23:59:02 +0000 (23:59 +0000)]
[resource-timing] Report performance entries with all HTTP status codes
https://bugs.webkit.org/show_bug.cgi?id=202040

Patch by Alex Christensen <achristensen@webkit.org> on 2019-09-20
Reviewed by Joseph Pecoraro.

LayoutTests/imported/w3c:

* web-platform-tests/resource-timing/resource_ignore_failures-expected.txt: Removed.
* web-platform-tests/resource-timing/resource_ignore_failures.html: Removed.
This test is no longer in wpt and it would regress with this change, so we remove it.
* web-platform-tests/resource-timing/resources/status-code.py: Added.
(main):
* web-platform-tests/resource-timing/status-codes-create-entry-expected.txt: Added.
* web-platform-tests/resource-timing/status-codes-create-entry.html: Added.

Source/WebCore:

This follows a Chromium change at https://chromium-review.googlesource.com/c/chromium/src/+/1796544
The spec change is being discussed at https://github.com/w3c/resource-timing/issues/165

Test: imported/w3c/web-platform-tests/resource-timing/status-codes-create-entry.html

I had to slightly modify the test to make sure the entry count was > 0 instead of == 1 to reduce flakyness because sometimes we load the 200 image twice.
I'll submit a PR to WPT, too.

* loader/ResourceTimingInformation.cpp:
(WebCore::ResourceTimingInformation::shouldAddResourceTiming):

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

10 months agoREGRESSION (iOS 13): rAF stops firing when navigating away cross-origin and then...
cdumez@apple.com [Fri, 20 Sep 2019 23:46:45 +0000 (23:46 +0000)]
REGRESSION (iOS 13): rAF stops firing when navigating away cross-origin and then back
https://bugs.webkit.org/show_bug.cgi?id=201767
<rdar://problem/55350854>

Reviewed by Tim Horton.

Source/WebKit:

This is a follow-up to r249961 to address crashes when navigating back cross-origin to a page
that uses requestAnimationFrame. r249961 took care of moving RemoteLayerTreeDisplayRefreshMonitor
objects from one RemoteLayerTreeDrawingArea to another but failed to tell those monitors
about their new drawingArea. As a result, RemoteLayerTreeDrawingArea::willDestroyDisplayRefreshMonitor()
would not get called on the new drawing area when it should have.

* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm:
(WebKit::RemoteLayerTreeDisplayRefreshMonitor::updateDrawingArea):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::adoptDisplayRefreshMonitorsFromDrawingArea):

LayoutTests:

Call finishJSTest() on a timer to make it more likely to reproduce the bug.

* http/tests/navigation/page-cache-requestAnimationFrame.html:

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

10 months agoRemove check of setSourceAppPid selector that's no longer needed
krollin@apple.com [Fri, 20 Sep 2019 22:58:55 +0000 (22:58 +0000)]
Remove check of setSourceAppPid selector that's no longer needed
https://bugs.webkit.org/show_bug.cgi?id=201971
<rdar://problem/55505761>

Reviewed by Andy Estes.

Bug 172152 introduced a check of the NEFilterSource selector
setSourceAppPid in order to support OS's that didn't support it. All
supported Cocoa platforms now support it, so the check can be removed.

Source/WebCore:

No new tests -- no new or changed functionality.

* platform/cocoa/NetworkExtensionContentFilter.mm:
(WebCore::NetworkExtensionContentFilter::initialize):

Source/WebCore/PAL:

* pal/spi/cocoa/NEFilterSourceSPI.h:

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

10 months agoRemove some support for < iOS 13
krollin@apple.com [Fri, 20 Sep 2019 22:19:55 +0000 (22:19 +0000)]
Remove some support for < iOS 13
https://bugs.webkit.org/show_bug.cgi?id=201967
<rdar://problem/55504738>

Reviewed by Andy Estes.

Remove some support for iOS versions less than 13.0.

Update conditionals that reference __IPHONE_OS_VERSION_MIN_REQUIRED
and __IPHONE_OS_VERSION_MAX_ALLOWED, assuming that they both have
values >= 130000. This means that expressions like
"__IPHONE_OS_VERSION_MIN_REQUIRED < 101300" are always False and
"__IPHONE_OS_VERSION_MIN_REQUIRED >= 101300" are always True.

After version checks have been removed, there are some cases where the
preprocessor conditional looks like "#if PLATFORM(MAC) ||
PLATFORM(IOS_FAMILY)". These can be collapsed into "#if
PLATFORM(COCOA)". This additional cleanup will be performed in a
subsequent patch.

This removal is part of a series of patches effecting the removal of
dead code for old versions of iOS. This particular pass involves
changes in which Andy Estes was involved. These changes are isolated
from other similar changes in order to facilitate the reviewing
process.

Source/WebCore:

No new tests -- no new or changed functionality.

* platform/cocoa/NetworkExtensionContentFilter.mm:
(WebCore::NetworkExtensionContentFilter::initialize):

Source/WebCore/PAL:

* pal/spi/cocoa/NEFilterSourceSPI.h:

Source/WebKit:

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _dataForPreviewItemController:atPosition:type:]):
* UIProcess/ios/forms/WKFileUploadPanel.mm:
(-[WKFileUploadPanel _uploadItemFromMediaInfo:successBlock:failureBlock:]):

Source/WTF:

* wtf/FeatureDefines.h:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/WKPDFView.mm: Removed.

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

10 months agoSanitize suggested filenames used for saving PDFs
timothy_horton@apple.com [Fri, 20 Sep 2019 21:49:30 +0000 (21:49 +0000)]
Sanitize suggested filenames used for saving PDFs
https://bugs.webkit.org/show_bug.cgi?id=202034
<rdar://problem/53183075>

Reviewed by Chris Dumez.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didFinishLoadingDataForCustomContentProvider):
(WebKit::WebPageProxy::saveDataToFileInDownloadsFolder):
(WebKit::WebPageProxy::savePDFToFileInDownloadsFolder):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplicationRaw): Deleted.
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplication):
(WebKit::WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplicationRaw): Deleted.
Sanitize suggested filenames to ensure that they comprise only one path component
when concatenated with their destination directory.

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

10 months agoBegin moving WebsiteDataStore setters to WebsiteDataStoreConfiguration
achristensen@apple.com [Fri, 20 Sep 2019 21:45:53 +0000 (21:45 +0000)]
Begin moving WebsiteDataStore setters to WebsiteDataStoreConfiguration
https://bugs.webkit.org/show_bug.cgi?id=202025

Reviewed by Chris Dumez.

One expected change in behavior is that the resource load statistics directory is not created on startup with an ephemeral session any more
because we call the constructor of WebsiteDataStoreConfiguration inside _WKWebsiteDataStoreConfiguration and set the default directory like we do the other directories.

* TestWebKitAPI/Tests/WebKitCocoa/StorageQuota.mm:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::websiteDataStore):
(WTR::TestController::generatePageConfiguration):

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

10 months agoAdd release logging for when a view is added / removed from a window
cdumez@apple.com [Fri, 20 Sep 2019 21:40:23 +0000 (21:40 +0000)]
Add release logging for when a view is added / removed from a window
https://bugs.webkit.org/show_bug.cgi?id=202050

Reviewed by Tim Horton.

Add release logging for when a view is added / removed from a window to help determine the
view's visibility in the logs.

* UIProcess/ios/WKApplicationStateTrackingView.mm:
(-[WKApplicationStateTrackingView willMoveToWindow:]):
(-[WKApplicationStateTrackingView didMoveToWindow]):

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

10 months agoApplicationStateTracker::m_isBackground initialization does not account for UIScenes
cdumez@apple.com [Fri, 20 Sep 2019 21:37:24 +0000 (21:37 +0000)]
ApplicationStateTracker::m_isBackground initialization does not account for UIScenes
https://bugs.webkit.org/show_bug.cgi?id=202048

Reviewed by Geoffrey Garen.

ApplicationStateTracker::m_isBackground initialization does not account for UIScenes, it merely checks
the visibility state of the whole app. It should instead check the visibility state of the window's
UIScene.

This patch also refactors the code a little bit to reduce #ifdef'ing.

* UIProcess/ApplicationStateTracker.mm:
(WebKit::ApplicationStateTracker::ApplicationStateTracker):

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

10 months agoDocument no longer needs to store a SessionID
cdumez@apple.com [Fri, 20 Sep 2019 21:35:58 +0000 (21:35 +0000)]
Document no longer needs to store a SessionID
https://bugs.webkit.org/show_bug.cgi?id=202024

Reviewed by Geoffrey Garen.

Document no longer needs to store a SessionID, now that we have a single
session per WebProcess. It can simply get its sessionID from its Page.

Source/WebCore:

* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::create):
* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::didOpenSocketStream):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
* dom/DOMImplementation.cpp:
(WebCore::createXMLDocument):
(WebCore::DOMImplementation::createDocument):
(WebCore::DOMImplementation::createHTMLDocument):
* dom/DOMImplementation.h:
* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::m_undoManager):
(WebCore::Document::create):
(WebCore::Document::createNonRenderedPlaceholder):
(WebCore::Document::cloneDocumentWithoutChildren const):
(WebCore::Document::sessionID const):
(WebCore::Document::privateBrowsingStateDidChange):
(WebCore::Document::ensureTemplateDocument):
(WebCore::Document::logger):
(WebCore::Document::didLogMessage):
* dom/Document.h:
(WebCore::Document::create):
* dom/XMLDocument.h:
(WebCore::XMLDocument::create):
(WebCore::XMLDocument::createXHTML):
(WebCore::XMLDocument::XMLDocument):
* html/FTPDirectoryDocument.cpp:
(WebCore::FTPDirectoryDocument::FTPDirectoryDocument):
* html/FTPDirectoryDocument.h:
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::parseAdClickAttribution const):
* html/HTMLDocument.cpp:
(WebCore::HTMLDocument::createSynthesizedDocument):
(WebCore::HTMLDocument::HTMLDocument):
(WebCore::HTMLDocument::cloneDocumentWithoutChildren const):
* html/HTMLDocument.h:
(WebCore::HTMLDocument::create):
* html/ImageDocument.cpp:
(WebCore::ImageDocument::ImageDocument):
* html/MediaDocument.cpp:
(WebCore::MediaDocument::MediaDocument):
* html/MediaDocument.h:
* html/PluginDocument.cpp:
(WebCore::PluginDocument::PluginDocument):
* html/TextDocument.cpp:
(WebCore::TextDocument::TextDocument):
* html/TextDocument.h:
* inspector/DOMPatchSupport.cpp:
(WebCore::DOMPatchSupport::patchDocument):
* loader/CookieJar.cpp:
(WebCore::CookieJar::cookieRequestHeaderFieldProxy):
(WebCore::CookieJar::cookieRequestHeaderFieldValue const):
* loader/CookieJar.h:
* loader/DocumentWriter.cpp:
(WebCore::DocumentWriter::createDocument):
* loader/SinkDocument.cpp:
(WebCore::SinkDocument::SinkDocument):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::setResponse):
(WebCore::CachedResource::varyHeaderValuesMatch):
* loader/cache/CachedSVGDocument.cpp:
(WebCore::CachedSVGDocument::finishLoading):
* loader/cache/CachedSVGFont.cpp:
(WebCore::CachedSVGFont::ensureCustomFontData):
* page/Page.cpp:
(WebCore::Page::configureLoggingChannel):
* platform/network/CacheValidation.cpp:
(WebCore::cookieRequestHeaderFieldValue):
(WebCore::collectVaryingRequestHeaders):
(WebCore::verifyVaryingRequestHeaders):
* platform/network/CacheValidation.h:
* svg/SVGDocument.cpp:
(WebCore::SVGDocument::SVGDocument):
(WebCore::SVGDocument::cloneDocumentWithoutChildren const):
* svg/SVGDocument.h:
(WebCore::SVGDocument::create):
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::isAlwaysOnLoggingAllowed const):
* worklets/WorkletGlobalScope.cpp:
(WebCore::WorkletGlobalScope::WorkletGlobalScope):
* worklets/WorkletGlobalScope.h:
* xml/DOMParser.cpp:
(WebCore::DOMParser::parseFromString):
* xml/DOMParser.h:
* xml/DOMParser.idl:
* xml/XMLHttpRequest.cpp:
* xml/XSLTProcessor.cpp:
(WebCore::XSLTProcessor::createDocumentFromSource):

Source/WebKit:

* WebProcess/WebPage/WebCookieJar.cpp:
(WebKit::WebCookieJar::cookieRequestHeaderFieldValue const):
* WebProcess/WebPage/WebCookieJar.h:

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

10 months agoWeb Inspector: HTML Formatter - better indentation/newline handling for self closing...
drousso@apple.com [Fri, 20 Sep 2019 21:23:20 +0000 (21:23 +0000)]
Web Inspector: HTML Formatter - better indentation/newline handling for self closing tags
https://bugs.webkit.org/show_bug.cgi?id=202036

Reviewed by Joseph Pecoraro.

Source/WebInspectorUI:

* UserInterface/Workers/Formatter/HTMLFormatter.js:
(HTMLFormatter.prototype._before):

LayoutTests:

* inspector/formatting/formatting-xml.html:
* inspector/formatting/formatting-xml-expected.txt:
* inspector/formatting/resources/xml-tests/self-closing.xml: Added.
* inspector/formatting/resources/xml-tests/self-closing-expected.xml: Added.

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

10 months ago[iOS] ASSERTION FAILED: Unsafe to ref/deref of ShareableBitmap from different threads
cdumez@apple.com [Fri, 20 Sep 2019 21:06:26 +0000 (21:06 +0000)]
[iOS] ASSERTION FAILED: Unsafe to ref/deref of ShareableBitmap from different threads
https://bugs.webkit.org/show_bug.cgi?id=201712
<rdar://problem/55289916>

Reviewed by Tim Horton.

Make sure ShareableBitmap objects are always ref'd / deref'd on the main thread by dispatching to
the main thread in ShareableBitmap::releaseBitmapContextData() before calling deref().

* Shared/ShareableBitmap.cpp:
(WebKit::ShareableBitmap::ShareableBitmap):
(WebKit::ShareableBitmap::~ShareableBitmap):
* Shared/cg/ShareableBitmapCG.cpp:
(WebKit::ShareableBitmap::createGraphicsContext):
(WebKit::ShareableBitmap::releaseBitmapContextData):

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

10 months agoBegin moving WebsiteDataStore setters to WebsiteDataStoreConfiguration
achristensen@apple.com [Fri, 20 Sep 2019 21:01:10 +0000 (21:01 +0000)]
Begin moving WebsiteDataStore setters to WebsiteDataStoreConfiguration
https://bugs.webkit.org/show_bug.cgi?id=202025

Reviewed by Chris Dumez.

Most of these were only needed before initNonPersistentConfiguration existed.

* UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.cpp:
(WKWebsiteDataStoreConfigurationGetPerOriginStorageQuota):
(WKWebsiteDataStoreConfigurationSetPerOriginStorageQuota):
* UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.h:
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetPerOriginStorageQuota):
* UIProcess/API/C/WKWebsiteDataStoreRef.h:
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _initWithConfiguration:]):
(-[WKWebsiteDataStore _perOriginStorageQuota]):
(-[WKWebsiteDataStore _setPerOriginStorageQuota:]):
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
(-[_WKWebsiteDataStoreConfiguration perOriginStorageQuota]):
(-[_WKWebsiteDataStoreConfiguration setPerOriginStorageQuota:]):
(-[_WKWebsiteDataStoreConfiguration boundInterfaceIdentifier]):
(-[_WKWebsiteDataStoreConfiguration setBoundInterfaceIdentifier:]):
(-[_WKWebsiteDataStoreConfiguration allowsCellularAccess]):
(-[_WKWebsiteDataStoreConfiguration setAllowsCellularAccess:]):
(-[_WKWebsiteDataStoreConfiguration proxyConfiguration]):
(-[_WKWebsiteDataStoreConfiguration setProxyConfiguration:]):
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::WebsiteDataStore):
(WebKit::WebsiteDataStore::setSourceApplicationSecondaryIdentifier):
(WebKit::WebsiteDataStore::setSourceApplicationBundleIdentifier):
* UIProcess/WebsiteData/WebsiteDataStore.h:
(WebKit::WebsiteDataStore::setBoundInterfaceIdentifier):
(WebKit::WebsiteDataStore::boundInterfaceIdentifier):
(WebKit::WebsiteDataStore::sourceApplicationBundleIdentifier const):
(WebKit::WebsiteDataStore::sourceApplicationSecondaryIdentifier const):
(WebKit::WebsiteDataStore::setAllowsCellularAccess):
(WebKit::WebsiteDataStore::allowsCellularAccess):
(WebKit::WebsiteDataStore::setProxyConfiguration):
(WebKit::WebsiteDataStore::proxyConfiguration):
(WebKit::WebsiteDataStore::setPerOriginStorageQuota): Deleted.
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
(WebKit::WebsiteDataStoreConfiguration::copy):
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
(WebKit::WebsiteDataStoreConfiguration::boundInterfaceIdentifier const):
(WebKit::WebsiteDataStoreConfiguration::setBoundInterfaceIdentifier):
(WebKit::WebsiteDataStoreConfiguration::allowsCellularAccess const):
(WebKit::WebsiteDataStoreConfiguration::setAllowsCellularAccess):
(WebKit::WebsiteDataStoreConfiguration::proxyConfiguration const):
(WebKit::WebsiteDataStoreConfiguration::setProxyConfiguration):

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

10 months agoWeb Inspector: Remove BranchManager in favor of just using currentRevision
pecoraro@apple.com [Fri, 20 Sep 2019 20:49:47 +0000 (20:49 +0000)]
Web Inspector: Remove BranchManager in favor of just using currentRevision
https://bugs.webkit.org/show_bug.cgi?id=202000

Reviewed by Devin Rousso.

Remove BranchManager. The Branch concept never got fleshed out, and would
likely be too complex for the average case. Local Overrides are simpler.
In the interest of expanding Local Overrides to more content lets simply
by removing Branches.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Base/Main.js:
(WI.loaded):
* UserInterface/Controllers/BranchManager.js: Removed.
* UserInterface/Controllers/CSSManager.js:
(WI.CSSManager.prototype._resourceContentDidChange.applyStyleSheetChanges.styleSheetFound):
(WI.CSSManager.prototype._resourceContentDidChange.applyStyleSheetChanges):
(WI.CSSManager.prototype._resourceContentDidChange):
(WI.CSSManager.prototype._updateResourceContent.fetchedStyleSheetContent):
* UserInterface/Main.html:
* UserInterface/Models/Branch.js: Removed.
* UserInterface/Models/SourceCode.js:
(WI.SourceCode.prototype._processContent):
(WI.SourceCode):
* UserInterface/Views/TextResourceContentView.js:
(WI.TextResourceContentView.prototype._textEditorContentDidChange):

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

10 months agoIntroduce LegacyGlobalSettings for settings the NetworkProcess needs from a WebProces...
achristensen@apple.com [Fri, 20 Sep 2019 20:36:57 +0000 (20:36 +0000)]
Introduce LegacyGlobalSettings for settings the NetworkProcess needs from a WebProcessPool
https://bugs.webkit.org/show_bug.cgi?id=201970

Reviewed by Geoff Garen.

I'm starting by moving the cache model to this new abstraction.
We were using it in tests to disable the page cache, which should be done with a boolean on the pool configuration, not by changing the cache model.
We were also using it in WKContextSetCacheModel which has several clients that won't change quickly, so this abstraction is used to maintain existing behavior.
I need this so I can make a NetworkProcess not depend on anything from a WebProcessPool when starting.

* Sources.txt:
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/C/WKContext.cpp:
(WKContextSetCacheModel):
(WKContextGetCacheModel):
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration pageCacheEnabled]):
(-[_WKProcessPoolConfiguration setPageCacheEnabled:]):
* UIProcess/LegacyGlobalSettings.cpp: Added.
(WebKit::LegacyGlobalSettings::singleton):
(WebKit::LegacyGlobalSettings::setCacheModel):
* UIProcess/LegacyGlobalSettings.h: Added.
(WebKit::LegacyGlobalSettings::cacheModel const):
* UIProcess/WebProcessCache.cpp:
(WebKit::WebProcessCache::updateCapacity):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
(WebKit::WebProcessPool::initializeNewWebProcess):
(WebKit::WebProcessPool::updateMaxSuspendedPageCount):
(WebKit::WebProcessPool::setCacheModel):
* UIProcess/WebProcessPool.h:
* WebKit.xcodeproj/project.pbxproj:

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

10 months ago[SVG2]: Add auto behavior for rx and ry to the SVG <ellipse> and <rect> elements...
commit-queue@webkit.org [Fri, 20 Sep 2019 20:30:33 +0000 (20:30 +0000)]
[SVG2]: Add auto behavior for rx and ry to the SVG <ellipse> and <rect> elements (Addressing review comments)
https://bugs.webkit.org/show_bug.cgi?id=199843

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-09-20
Reviewed by Darin Adler.

Make RenderSVGEllipse calculate of the ellipse's rx and ry more efficiently.

* rendering/svg/RenderSVGEllipse.cpp:
(WebCore::RenderSVGEllipse::calculateRadiiAndCenter):

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

10 months agoDeprecate unused C API aliases for WebsiteDataStore
achristensen@apple.com [Fri, 20 Sep 2019 20:29:24 +0000 (20:29 +0000)]
Deprecate unused C API aliases for WebsiteDataStore
https://bugs.webkit.org/show_bug.cgi?id=202029

Reviewed by Chris Dumez.

This is a piece of r249768.

* UIProcess/API/C/WKApplicationCacheManager.cpp:
(WKApplicationCacheManagerGetTypeID):
(WKApplicationCacheManagerGetApplicationCacheOrigins):
(WKApplicationCacheManagerDeleteEntriesForOrigin):
(WKApplicationCacheManagerDeleteAllEntries):
* UIProcess/API/C/WKApplicationCacheManager.h:
* UIProcess/API/C/WKKeyValueStorageManager.cpp:
(WKKeyValueStorageManagerGetTypeID):
(WKKeyValueStorageManagerGetOriginKey):
(WKKeyValueStorageManagerGetCreationTimeKey):
(WKKeyValueStorageManagerGetModificationTimeKey):
(WKKeyValueStorageManagerGetKeyValueStorageOrigins):
(WKKeyValueStorageManagerGetStorageDetailsByOrigin):
(WKKeyValueStorageManagerDeleteEntriesForOrigin):
(WKKeyValueStorageManagerDeleteAllEntries):
* UIProcess/API/C/WKKeyValueStorageManager.h:
* UIProcess/API/C/WKResourceCacheManager.cpp:
(WKResourceCacheManagerGetTypeID):
(WKResourceCacheManagerGetCacheOrigins):
(WKResourceCacheManagerClearCacheForOrigin):
(WKResourceCacheManagerClearCacheForAllOrigins):
(toWebsiteDataTypes): Deleted.
* UIProcess/API/C/WKResourceCacheManager.h:

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

10 months agoUnreviewed. Bump WPE version numbers.
aperez@igalia.com [Fri, 20 Sep 2019 20:21:22 +0000 (20:21 +0000)]
Unreviewed. Bump WPE version numbers.

* Source/cmake/OptionsWPE.cmake:

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

10 months agoRemove functionality to disable TLS fallback
achristensen@apple.com [Fri, 20 Sep 2019 20:17:26 +0000 (20:17 +0000)]
Remove functionality to disable TLS fallback
https://bugs.webkit.org/show_bug.cgi?id=201998

Reviewed by Geoff Garen.

Source/WebCore/PAL:

* pal/spi/cf/CFNetworkSPI.h:

Source/WebKit:

Since r249019 it is not used.  It was a useful experiment and I'm glad we didn't see any regressions.

* NetworkProcess/NetworkSessionCreationParameters.cpp:
(WebKit::NetworkSessionCreationParameters::privateSessionParameters):
(WebKit::NetworkSessionCreationParameters::encode const):
(WebKit::NetworkSessionCreationParameters::decode):
* NetworkProcess/NetworkSessionCreationParameters.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _setAllowsTLSFallback:]):
(-[WKWebsiteDataStore _allowsTLSFallback]):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::setAllowsTLSFallback): Deleted.
* UIProcess/WebsiteData/WebsiteDataStore.h:
(WebKit::WebsiteDataStore::allowsTLSFallback const): Deleted.

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

10 months agoRemove unused storage paths on APIProcessPoolConfiguration
achristensen@apple.com [Fri, 20 Sep 2019 20:11:50 +0000 (20:11 +0000)]
Remove unused storage paths on APIProcessPoolConfiguration
https://bugs.webkit.org/show_bug.cgi?id=202028

Reviewed by Chris Dumez.

This is a piece of r249768.
There is no way to set these paths and they have been replaced by WebsiteDataStore paths.
There was one remaining use of the global disk cache directory in NetworkProcess::setCacheModel,
which I replaced with the default session's disk cache directory, which is equivalent.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::setCacheModel):
* NetworkProcess/NetworkProcess.h:
(WebKit::NetworkProcess::diskCacheDirectory const): Deleted.
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
(WebKit::NetworkProcessCreationParameters::NetworkProcessCreationParameters): Deleted.
* NetworkProcess/NetworkProcessCreationParameters.h:
* 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::storageDirectory):
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy):
(API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration): Deleted.
(API::ProcessPoolConfiguration::ProcessPoolConfiguration): Deleted.
(API::ProcessPoolConfiguration::~ProcessPoolConfiguration): Deleted.
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/glib/WebKitWebContext.cpp:
(webkitWebContextConstructed):
(webkit_web_context_set_disk_cache_directory):
(websiteDataStoreConfigurationForWebProcessPoolConfiguration): Deleted.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
(WebKit::WebProcessPool::resolvePathsForSandboxExtensions):
(WebKit::WebProcessPool::webProcessDataStoreParameters):
* UIProcess/WebProcessPool.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::processPools const):
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:

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

10 months agoRemove some support for < iOS 13
krollin@apple.com [Fri, 20 Sep 2019 20:10:37 +0000 (20:10 +0000)]
Remove some support for < iOS 13
https://bugs.webkit.org/show_bug.cgi?id=202032
<rdar://problem/55548468>

Reviewed by Alex Christensen.

Remove some support for iOS versions less than 13.0.

Update conditionals that reference __IPHONE_OS_VERSION_MIN_REQUIRED
and __IPHONE_OS_VERSION_MAX_ALLOWED, assuming that they both have
values >= 130000. This means that expressions like
"__IPHONE_OS_VERSION_MIN_REQUIRED < 101300" are always False and
"__IPHONE_OS_VERSION_MIN_REQUIRED >= 101300" are always True.

This removal is part of a series of patches effecting the removal of
dead code for old versions of iOS. This particular pass involves
changes in which Dan Bates was involved. These changes are isolated
from other similar changes in order to facilitate the reviewing
process.

Source/WebCore:

No new tests -- no new or changed functionality.

* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::ResourceRequest::doUpdatePlatformRequest):
(WebCore::ResourceRequest::doUpdateResourceRequest):
* platform/network/cocoa/CookieCocoa.mm:
(WebCore::Cookie::operator NSHTTPCookie * _Nullable  const):
* platform/network/cocoa/ResourceRequestCocoa.mm:
(WebCore::ResourceRequest::doUpdateResourceRequest):
(WebCore::ResourceRequest::doUpdatePlatformRequest):

Source/WebKit:

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

Source/WebKitLegacy/mac:

* WebView/WebHTMLView.mm:
(-[WebHTMLView _handleEditingKeyEvent:]):

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

10 months agoUnreviewed, rolling out r250114.
tsavell@apple.com [Fri, 20 Sep 2019 19:39:42 +0000 (19:39 +0000)]
Unreviewed, rolling out r250114.

Broke ~16 webgpu/ tests on Mojave wk2

Reverted changeset:

"Web Inspector: Canvas: show WebGPU shader pipelines"
https://bugs.webkit.org/show_bug.cgi?id=201675
https://trac.webkit.org/changeset/250114

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

10 months agoRemove some support for < iOS 13
krollin@apple.com [Fri, 20 Sep 2019 19:31:24 +0000 (19:31 +0000)]
Remove some support for < iOS 13
https://bugs.webkit.org/show_bug.cgi?id=201973
<rdar://problem/55506966>

Reviewed by Alex Christensen.

Remove some support for iOS versions less than 13.0.

Update conditionals that reference __IPHONE_OS_VERSION_MIN_REQUIRED
and __IPHONE_OS_VERSION_MAX_ALLOWED, assuming that they both have
values >= 130000. This means that expressions like
"__IPHONE_OS_VERSION_MIN_REQUIRED < 101300" are always False and
"__IPHONE_OS_VERSION_MIN_REQUIRED >= 101300" are always True.

This removal is part of a series of patches effecting the removal of
dead code for old versions of iOS. This particular pass involves
changes in which Chris Dumez was involved. These changes are isolated
from other similar changes in order to facilitate the reviewing
process.

Source/WebKit:

* NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
(WebKit::Download::resume):

Source/WTF:

* wtf/FeatureDefines.h:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

10 months agoUnreviewed, fix confusing release logging under WebPageProxy::loadRequestWithNavigati...
cdumez@apple.com [Fri, 20 Sep 2019 15:53:24 +0000 (15:53 +0000)]
Unreviewed, fix confusing release logging under WebPageProxy::loadRequestWithNavigationShared().

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

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

10 months agoImplement Position::upstream and Position::downstream with line layout iterator
antti@apple.com [Fri, 20 Sep 2019 15:41:43 +0000 (15:41 +0000)]
Implement Position::upstream and Position::downstream with line layout iterator
https://bugs.webkit.org/show_bug.cgi?id=202043

Reviewed by Zalan Bujtas.

These can eventually work without switching to lineboxes.

* dom/Position.cpp:
(WebCore::Position::upstream const):
(WebCore::Position::downstream const):

Factor the loops into TextBox::isLastOnLine function.

* rendering/line/LineLayoutInterfaceTextBoxes.cpp:
(WebCore::LineLayoutInterface::TextBox::isLastOnLine const):

Looking into root boxes is a much more efficient way to figure this out.

(WebCore::LineLayoutInterface::TextBox::isLast const):
(WebCore::LineLayoutInterface::TextBoxIterator::ComplexPath::nextInlineTextBoxInTextOrder const):
(WebCore::LineLayoutInterface::TextBoxIterator::traverseNextInTextOrder):
* rendering/line/LineLayoutInterfaceTextBoxes.h:

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

10 months agoUnreviewed. Make toctou-having-a-bad-time-new-array.js run for less time because...
sbarati@apple.com [Fri, 20 Sep 2019 15:40:09 +0000 (15:40 +0000)]
Unreviewed. Make toctou-having-a-bad-time-new-array.js run for less time because it's timing out on the debug bots.

* stress/toctou-having-a-bad-time-new-array.js:

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

10 months agoRegression(r248832): Unable to quicklook HTML files in Mail
cdumez@apple.com [Fri, 20 Sep 2019 15:23:50 +0000 (15:23 +0000)]
Regression(r248832): Unable to quicklook HTML files in Mail
https://bugs.webkit.org/show_bug.cgi?id=202012
<rdar://problem/55285295>

Reviewed by Per Arne Vollan.

Follow-up to fix bug in r250110. Now that loadFile() calls
maybeInitializeSandboxExtensionHandle(), it no longer needs to
call assumeReadAccessToBaseURL(). This is because maybeInitializeSandboxExtensionHandle()
already take care of it.

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

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

10 months agoImplement memory monitoring functions for Linux OS
commit-queue@webkit.org [Fri, 20 Sep 2019 15:07:19 +0000 (15:07 +0000)]
Implement memory monitoring functions for Linux OS
https://bugs.webkit.org/show_bug.cgi?id=200391

Patch by Paulo Matos <pmatos@igalia.com> on 2019-09-20
Reviewed by Žan Doberšek.

Source/JavaScriptCore:

* jsc.cpp:

Source/WTF:

* wtf/PlatformGTK.cmake:
* wtf/PlatformJSCOnly.cmake:
* wtf/PlatformWPE.cmake:
* wtf/linux/ProcessMemoryFootprint.h: Added.
(ProcessMemoryFootprint::now):
(ProcessMemoryFootprint::resetPeak):

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

10 months ago[LFC] Introduce LayoutContext class
zalan@apple.com [Fri, 20 Sep 2019 13:36:00 +0000 (13:36 +0000)]
[LFC] Introduce LayoutContext class
https://bugs.webkit.org/show_bug.cgi?id=202026
<rdar://problem/55546622>

Reviewed by Antti Koivisto.

Move context related functionality from LayoutState to LayoutContext.
To initiate a layout, create a LayoutContext, pass the current LayoutState object in and call layout().

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::layoutOutOfFlowContent):
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
* layout/LayoutState.cpp:
(WebCore::Layout::LayoutState::createFormattingStateForFormattingRootIfNeeded):
(WebCore::Layout::LayoutState::updateLayout): Deleted.
(WebCore::Layout::LayoutState::layoutFormattingContextSubtree): Deleted.
(WebCore::Layout::LayoutState::styleChanged): Deleted.
(WebCore::Layout::LayoutState::markNeedsUpdate): Deleted.
(WebCore::Layout::LayoutState::createFormattingContext): Deleted.
(WebCore::Layout::LayoutState::run): Deleted.
* layout/LayoutState.h:
(WebCore::Layout::LayoutState::hasFormattingState const):
(WebCore::Layout::LayoutState::setQuirksMode):
(WebCore::Layout::LayoutState::inNoQuirksMode const):
(WebCore::Layout::LayoutState::updateAll): Deleted.
* layout/Verification.cpp:
(WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree):
(WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const): Deleted.
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints):
* layout/blockformatting/BlockInvalidation.cpp:
(WebCore::Layout::computeUpdateType):
(WebCore::Layout::computeUpdateTypeForAncestor):
(WebCore::Layout::BlockInvalidation::invalidate):
* layout/blockformatting/BlockInvalidation.h:
* layout/displaytree/DisplayBox.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot):
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot):
* layout/inlineformatting/InlineInvalidation.cpp:
(WebCore::Layout::InlineInvalidation::invalidate):
* layout/inlineformatting/InlineInvalidation.h:
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::printLayoutTreeForLiveDocuments):
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::layoutTableCellBox):
(WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns):
* layout/tableformatting/TableInvalidation.cpp:
(WebCore::Layout::TableInvalidation::invalidate):
* layout/tableformatting/TableInvalidation.h:
* page/FrameViewLayoutContext.cpp:
(WebCore::layoutUsingFormattingContext):

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

10 months agoSynchronize MathML WPT tests against upstream
commit-queue@webkit.org [Fri, 20 Sep 2019 11:00:53 +0000 (11:00 +0000)]
Synchronize MathML WPT tests against upstream
https://bugs.webkit.org/show_bug.cgi?id=201975

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

LayoutTests/imported/w3c:

Sync is based on a3a4442b04c37155f81c4ad4ae9c06339f76ce14.

* resources/import-expectations.json:
* web-platform-tests/mathml/presentation-markup/direction/direction-006.html:
* web-platform-tests/mathml/presentation-markup/direction/direction-007.html:
* web-platform-tests/mathml/presentation-markup/direction/direction-008.html:
* web-platform-tests/mathml/presentation-markup/direction/direction-009.html:
* web-platform-tests/mathml/presentation-markup/direction/direction-010.html:
* web-platform-tests/mathml/presentation-markup/fractions/frac-bar-002-expected.html: Added.
* web-platform-tests/mathml/presentation-markup/fractions/frac-bar-002.html: Added.
* web-platform-tests/mathml/presentation-markup/fractions/frac-default-padding-expected.html: Added.
* web-platform-tests/mathml/presentation-markup/fractions/frac-default-padding.html: Added.
* web-platform-tests/mathml/presentation-markup/fractions/frac-rendering-from-in-flow-expected.html: Added.
* web-platform-tests/mathml/presentation-markup/fractions/frac-rendering-from-in-flow.html: Added.
* web-platform-tests/mathml/presentation-markup/fractions/w3c-import.log:
* web-platform-tests/mathml/presentation-markup/menclose/legacy-menclose-radical-notation-expected.html: Added.
* web-platform-tests/mathml/presentation-markup/menclose/legacy-menclose-radical-notation.html: Added.
* web-platform-tests/mathml/presentation-markup/menclose/w3c-import.log: Copied from LayoutTests/imported/w3c/web-platform-tests/mathml/presentation-markup/mrow/w3c-import.log.
* web-platform-tests/mathml/presentation-markup/mrow/legacy-mrow-like-elements-001-expected.txt: Added.
* web-platform-tests/mathml/presentation-markup/mrow/legacy-mrow-like-elements-001.html: Added.
* web-platform-tests/mathml/presentation-markup/mrow/legacy-mrow-like-elements-002-expected.html: Added.
* web-platform-tests/mathml/presentation-markup/mrow/legacy-mrow-like-elements-002.html: Added.
* web-platform-tests/mathml/presentation-markup/mrow/legacy-mstyle-attributes-expected.txt: Added.
* web-platform-tests/mathml/presentation-markup/mrow/legacy-mstyle-attributes.html: Added.
* web-platform-tests/mathml/presentation-markup/mrow/w3c-import.log:
* web-platform-tests/mathml/presentation-markup/operators/embellished-operator-001-expected.txt:
* web-platform-tests/mathml/presentation-markup/operators/embellished-operator-001.html:
* web-platform-tests/mathml/presentation-markup/operators/embellished-operator-002-expected.txt:
* web-platform-tests/mathml/presentation-markup/operators/embellished-operator-002.html:
* web-platform-tests/mathml/presentation-markup/operators/mo-form-dynamic.html:
* web-platform-tests/mathml/presentation-markup/operators/mo-form-fallback.html:
* web-platform-tests/mathml/presentation-markup/operators/mo-form-minus-plus.html:
* web-platform-tests/mathml/presentation-markup/operators/mo-form.html:
* web-platform-tests/mathml/presentation-markup/operators/mo-movablelimits-default.html:
* web-platform-tests/mathml/presentation-markup/operators/mo-movablelimits-dynamic.html:
* web-platform-tests/mathml/presentation-markup/operators/mo-movablelimits-from-in-flow-expected.html: Added.
* web-platform-tests/mathml/presentation-markup/operators/mo-movablelimits-from-in-flow.html: Added.
* web-platform-tests/mathml/presentation-markup/operators/mo-movablelimits.html:
* web-platform-tests/mathml/presentation-markup/operators/mo-paint-lspace-rspace.html:
* web-platform-tests/mathml/presentation-markup/operators/operator-dictionary-001-expected.txt: Added.
* web-platform-tests/mathml/presentation-markup/operators/operator-dictionary-001.html: Added.
* web-platform-tests/mathml/presentation-markup/operators/w3c-import.log:
* web-platform-tests/mathml/presentation-markup/radicals/radical-rendering-from-in-flow-expected.html: Added.
* web-platform-tests/mathml/presentation-markup/radicals/radical-rendering-from-in-flow.html: Added.
* web-platform-tests/mathml/presentation-markup/radicals/w3c-import.log:
* web-platform-tests/mathml/presentation-markup/scripts/cramped-001-expected.txt: Added.
* web-platform-tests/mathml/presentation-markup/scripts/cramped-001.html: Added.
* web-platform-tests/mathml/presentation-markup/scripts/w3c-import.log:
* web-platform-tests/mathml/presentation-markup/spaces/space-like-004-expected.txt:
* web-platform-tests/mathml/presentation-markup/spaces/space-like-004.html:
* web-platform-tests/mathml/presentation-markup/tables/table-001-expected.txt: Added.
* web-platform-tests/mathml/presentation-markup/tables/table-001.html: Added.
* web-platform-tests/mathml/presentation-markup/tables/table-002-expected.txt: Added.
* web-platform-tests/mathml/presentation-markup/tables/table-002.html: Added.
* web-platform-tests/mathml/presentation-markup/tables/w3c-import.log:
* web-platform-tests/mathml/relations/css-styling/attribute-mapping-001.html:
* web-platform-tests/mathml/relations/css-styling/displaystyle-011.html:
* web-platform-tests/mathml/relations/css-styling/displaystyle-012.html:
* web-platform-tests/mathml/relations/css-styling/displaystyle-013.html:
* web-platform-tests/mathml/relations/css-styling/displaystyle-014.html:
* web-platform-tests/mathml/relations/css-styling/displaystyle-015.html:
* web-platform-tests/mathml/relations/css-styling/ignored-properties-001-expected.txt: Added.
* web-platform-tests/mathml/relations/css-styling/ignored-properties-001.html: Added.
* web-platform-tests/mathml/relations/css-styling/mathsize-attribute-css-keywords.html:
* web-platform-tests/mathml/relations/css-styling/mathsize-attribute-legacy-values.html:
* web-platform-tests/mathml/relations/css-styling/mathvariant-auto.html:
* web-platform-tests/mathml/relations/css-styling/mathvariant-bold-fraktur.html:
* web-platform-tests/mathml/relations/css-styling/mathvariant-bold-italic.html:
* web-platform-tests/mathml/relations/css-styling/mathvariant-bold-sans-serif.html:
* web-platform-tests/mathml/relations/css-styling/mathvariant-bold-script.html:
* web-platform-tests/mathml/relations/css-styling/mathvariant-bold.html:
* web-platform-tests/mathml/relations/css-styling/mathvariant-double-struck.html:
* web-platform-tests/mathml/relations/css-styling/mathvariant-fraktur.html:
* web-platform-tests/mathml/relations/css-styling/mathvariant-initial.html:
* web-platform-tests/mathml/relations/css-styling/mathvariant-italic.html:
* web-platform-tests/mathml/relations/css-styling/mathvariant-looped.html:
* web-platform-tests/mathml/relations/css-styling/mathvariant-monospace.html:
* web-platform-tests/mathml/relations/css-styling/mathvariant-sans-serif-bold-italic.html:
* web-platform-tests/mathml/relations/css-styling/mathvariant-sans-serif-italic.html:
* web-platform-tests/mathml/relations/css-styling/mathvariant-sans-serif.html:
* web-platform-tests/mathml/relations/css-styling/mathvariant-script.html:
* web-platform-tests/mathml/relations/css-styling/mathvariant-stretched.html:
* web-platform-tests/mathml/relations/css-styling/mathvariant-tailed.html:
* web-platform-tests/mathml/relations/css-styling/not-participating-to-parent-layout.html:
* web-platform-tests/mathml/relations/css-styling/padding-border-margin/border-002.html:
* web-platform-tests/mathml/relations/css-styling/padding-border-margin/margin-002.html:
* web-platform-tests/mathml/relations/css-styling/padding-border-margin/padding-002.html:
* web-platform-tests/mathml/relations/css-styling/w3c-import.log:
* web-platform-tests/mathml/relations/css-styling/width-height-001.html:
* web-platform-tests/mathml/relations/html5-tree/clipboard-event-handlers.tentative-expected.txt:
* web-platform-tests/mathml/relations/html5-tree/clipboard-event-handlers.tentative.html:
* web-platform-tests/mathml/relations/html5-tree/css-inline-style-dynamic.tentative-expected.html:
* web-platform-tests/mathml/relations/html5-tree/display-2-expected.html: Added.
* web-platform-tests/mathml/relations/html5-tree/display-2.html: Added.
* web-platform-tests/mathml/relations/html5-tree/math-global-event-handlers.tentative-expected.txt:
* web-platform-tests/mathml/relations/html5-tree/math-global-event-handlers.tentative.html:
* web-platform-tests/mathml/relations/html5-tree/tabindex-001-expected.txt: Added.
* web-platform-tests/mathml/relations/html5-tree/tabindex-001.html: Added.
* web-platform-tests/mathml/relations/html5-tree/tabindex-002-expected.txt: Added.
* web-platform-tests/mathml/relations/html5-tree/tabindex-002.html: Added.
* web-platform-tests/mathml/relations/html5-tree/w3c-import.log:
* web-platform-tests/mathml/support/box-navigation.js: Added.
(IsInFlow):
(firstInFlowChild):
(nextInFlowSibling):
(previousInFlowSibling):
* web-platform-tests/mathml/support/feature-detection.js:
(MathMLFeatureDetection.string_appeared_here):
(MathMLFeatureDetection.has_mspace): Deleted.
(MathMLFeatureDetection.has_operator_spacing): Deleted.
(MathMLFeatureDetection.has_mfrac): Deleted.
(MathMLFeatureDetection.has_msqrt): Deleted.
(MathMLFeatureDetection.has_menclose): Deleted.
(MathMLFeatureDetection.has_dir): Deleted.
* web-platform-tests/mathml/support/mathml-fragments.js:
(FragmentHelper.createElement):
(FragmentHelper.forceNonEmptyElement):
(FragmentHelper.forceNonEmptyDescendants):
* web-platform-tests/mathml/support/operator-dictionary.js: Added.
(async.fetchOperatorDictionary):
(splitKey):
(spaceIndexToLength):
(defaultPropertyValue):
* web-platform-tests/mathml/support/operator-dictionary.json: Added.
* web-platform-tests/mathml/support/w3c-import.log:
* web-platform-tests/mathml/tools/mathvariant-transforms.py:
* web-platform-tests/mathml/tools/operator-dictionary.py: Added.
(parseHexaNumber):
(parseHexaSequence):
(parseSpaces):
(parseProperties):
(buildKeyAndValueFrom):
(createSizeVariants):
(createStretchy):
* web-platform-tests/mathml/tools/operator-dictionary.xsl: Added.
* web-platform-tests/mathml/tools/utils/misc.py:
* web-platform-tests/mathml/tools/utils/w3c-import.log:
* web-platform-tests/mathml/tools/w3c-import.log:

LayoutTests:

* TestExpectations:
* platform/gtk/imported/w3c/web-platform-tests/mathml/presentation-markup/mrow/legacy-mrow-like-elements-001-expected.txt: Added.
* platform/gtk/imported/w3c/web-platform-tests/mathml/presentation-markup/mrow/legacy-mstyle-attributes-expected.txt: Added.
* platform/gtk/imported/w3c/web-platform-tests/mathml/presentation-markup/operators/dir-mo-expected.txt: Added.
* platform/gtk/imported/w3c/web-platform-tests/mathml/presentation-markup/operators/operator-dictionary-001-expected.txt: Added.
* platform/gtk/imported/w3c/web-platform-tests/mathml/presentation-markup/scripts/cramped-001-expected.txt: Added.
* platform/gtk/imported/w3c/web-platform-tests/mathml/presentation-markup/tables/table-001-expected.txt: Added.
* platform/gtk/imported/w3c/web-platform-tests/mathml/presentation-markup/tables/table-002-expected.txt: Added.
* platform/gtk/imported/w3c/web-platform-tests/mathml/relations/css-styling/ignored-properties-001-expected.txt: Added.
* platform/gtk/imported/w3c/web-platform-tests/mathml/relations/html5-tree/tabindex-001-expected.txt: Added.
* platform/gtk/imported/w3c/web-platform-tests/mathml/relations/html5-tree/tabindex-002-expected.txt: Added.
* platform/ios-wk1/imported/w3c/web-platform-tests/matml/presentation-markup/operators/operator-dictionary-001-expected.txt: Added.
* platform/ios-wk1/imported/w3c/web-platform-tests/matml/relations/css-styling/ignored-properties-001-expected.txt: Added.
* platform/mac/TestExpectations:
* tests-options.json:

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

10 months agoUI process crash when using callOnMainThread() after the main thread dispatcher has...
commit-queue@webkit.org [Fri, 20 Sep 2019 08:45:03 +0000 (08:45 +0000)]
UI process crash when using callOnMainThread() after the main thread dispatcher has been destroyed
https://bugs.webkit.org/show_bug.cgi?id=197266

Patch by Libor Bukata <libor.bukata@oracle.com> on 2019-09-20
Reviewed by Carlos Garcia Campos.

* wtf/generic/MainThreadGeneric.cpp:
(WTF::scheduleDispatchFunctionsOnMainThread):

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

10 months agoUnreviewed. Remove duplicated HashMap iteration since r248734.
jh718.park@samsung.com [Fri, 20 Sep 2019 08:33:26 +0000 (08:33 +0000)]
Unreviewed. Remove duplicated HashMap iteration since r248734.

ASSERT statement already exists for |storageNamespaceID|,
so |HashMap.get| for the parameter is not needed.

* NetworkProcess/WebStorage/StorageManager.cpp:
(WebKit::StorageManager::destroySessionStorageNamespace):

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

10 months agoASSERT NOT REACHED in Inspector::InjectedScriptModule::ensureInjected() seen with...
drousso@apple.com [Fri, 20 Sep 2019 08:28:09 +0000 (08:28 +0000)]
ASSERT NOT REACHED in Inspector::InjectedScriptModule::ensureInjected() seen with inspector/heap/getRemoteObject.html
https://bugs.webkit.org/show_bug.cgi?id=201713
<rdar://problem/55290349>

Reviewed by Joseph Pecoraro.

Expose the `Exception` object by leveraging an `Expected` of `JSValue` as the return value
instead of using a referenced `bool` (which wouldn't include any of the exception's info).

* bindings/ScriptFunctionCall.h:
* bindings/ScriptFunctionCall.cpp:
(Deprecated::ScriptFunctionCall::call):

* inspector/InjectedScript.cpp:
(Inspector::InjectedScript::wrapCallFrames const):
(Inspector::InjectedScript::wrapObject const):
(Inspector::InjectedScript::wrapJSONString const):
(Inspector::InjectedScript::wrapTable const):
(Inspector::InjectedScript::previewValue const):
(Inspector::InjectedScript::findObjectById const):
(Inspector::InjectedScript::releaseObjectGroup):

* inspector/InjectedScriptBase.h:
* inspector/InjectedScriptBase.cpp:
(Inspector::InjectedScriptBase::callFunctionWithEvalEnabled const):
(Inspector::InjectedScriptBase::makeCall):
(Inspector::InjectedScriptBase::makeAsyncCall):

* inspector/InjectedScriptManager.h:
* inspector/InjectedScriptManager.cpp:
(Inspector::InjectedScriptManager::createInjectedScript):
(Inspector::InjectedScriptManager::injectedScriptFor):

* inspector/InjectedScriptModule.cpp:
(Inspector::InjectedScriptModule::ensureInjected):

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

10 months agoUnreviewed. Fix Build warning below since r248734.
jh718.park@samsung.com [Fri, 20 Sep 2019 07:09:59 +0000 (07:09 +0000)]
Unreviewed. Fix Build warning below since r248734.

warning: unused variable ‘foo’ [-Wunused-variable]

* NetworkProcess/WebStorage/StorageManager.cpp:
(WebKit::StorageManager::destroySessionStorageNamespace):
* NetworkProcess/WebStorage/StorageManagerSet.cpp:
(WebKit::StorageManagerSet::add):
(WebKit::StorageManagerSet::waitUntilTasksFinished):

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

10 months ago[FTW] Enable WebKitTestRunner build
bfulgham@apple.com [Fri, 20 Sep 2019 04:55:55 +0000 (04:55 +0000)]
[FTW] Enable WebKitTestRunner build
https://bugs.webkit.org/show_bug.cgi?id=201996

Reviewed by Fujii Hironori.

It's time to start getting the test system up and running for FTW.

This patch does the following:

1. Adds relevant CMake changes to get things building.
2. Adds a "--ftw" flag to the build scripts that will trigger a relevant build.
3. Updates 'webkitpy' to recognize the 'ftw' port.

Note: Pixel tests are not yet supported.

* PlatformFTW.cmake: Build the WK2 test runner.
* Scripts/build-webkit: Update to recognize the FTW port.
* Scripts/webkitdirs.pm: Ditto.
* Scripts/webkitperl/webkitdirs_unittest/extractNonMacOSHostConfiguration.pl: Ditto.
* Scripts/webkitpy/common/config/ports.py: Ditto.
* Scripts/webkitpy/common/config/ports_unittest.py: Ditto.
* Scripts/webkitpy/common/version_name_map.py: Ditto.
* Scripts/webkitpy/port/factory.py: Ditto.
* Scripts/webkitpy/port/win.py: Ditto.
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::dumpDOMAsWebArchive): Don't build or run this method
on Windows.
* WebKitTestRunner/PlatformFTW.cmake: Added.
* WebKitTestRunner/PlatformWebView.h:
* WebKitTestRunner/win/PlatformWebViewWin.cpp:
* WebKitTestRunner/win/TestInvocationDirect2D.cpp: Added.
(WTR::TestInvocation::dumpPixelsAndCompareWithExpected): Add stub implementation.

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

10 months agoUnreviewed. Fix Build error below since r248879.
jh718.park@samsung.com [Fri, 20 Sep 2019 04:47:51 +0000 (04:47 +0000)]
Unreviewed. Fix Build error below since r248879.

warning: unused variable ‘canvas’ [-Wunused-variable]

No new tests, no new behavioral changes.

* html/canvas/GPUBasedCanvasRenderingContext.cpp:
(WebCore::GPUBasedCanvasRenderingContext::notifyCanvasContentChanged):

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

10 months ago[FTW, WinCairo] Support running tests in Release mode
bfulgham@apple.com [Fri, 20 Sep 2019 03:51:38 +0000 (03:51 +0000)]
[FTW, WinCairo] Support running tests in Release mode
https://bugs.webkit.org/show_bug.cgi?id=202021

Reviewed by Don Olmstead.

In Bug 201597, we added new features to better lock down JSC features in the
potentially untrusted WebContent process.

Unfortunately, this change included XPC Dictionary items used at startup to
lock down JSC features before entering the main execution of the process. These
changes were not done for the WinCairo or FTW ports.

We need to pass the state of the JIT and whether to enable certain JSC features
at process launch. Since the XPC mechanisms we use on macOS and iOS do not exist
on Windows, I am implementing them as command-line flags.

    -configure-jsc-for-testing: Sets the JSC in testing mode.
    -disable-jit: Disables the JIT.

See r249808 for the equivalent changes on macOS and iOS.

* PlatformFTW.cmake: Add some missing header files needed when building tests.
* Shared/win/AuxiliaryProcessMainWin.cpp:
(WebKit::AuxiliaryProcessMainBase::parseCommandLine):
* UIProcess/Launcher/win/ProcessLauncherWin.cpp:
(WebKit::ProcessLauncher::launchProcess):

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

10 months agoWeb Inspector: searching in overrides doesn't work
pecoraro@apple.com [Fri, 20 Sep 2019 03:36:15 +0000 (03:36 +0000)]
Web Inspector: searching in overrides doesn't work
https://bugs.webkit.org/show_bug.cgi?id=202020

Reviewed by Devin Rousso.

* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype.customPerformSearch):
Do not go to agents for a local resource. Search locally in the TextEditor.

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

10 months ago[Win][MiniBrowser] Use _com_ptr_t methods instead of calling QueryInterface explictly
Hironori.Fujii@sony.com [Fri, 20 Sep 2019 03:18:45 +0000 (03:18 +0000)]
[Win][MiniBrowser] Use _com_ptr_t methods instead of calling QueryInterface explictly
https://bugs.webkit.org/show_bug.cgi?id=201976

Reviewed by Don Olmstead.

This change consists of three refactorings:
1. Replaced explicit QueryInterface with _com_ptr_t methods
2. Replaced typedef with _COM_SMARTPTR_TYPEDEF macro
3. Replaced WebCore's COMPtr with _com_ptr_t because it is not a public WebKit API

* MiniBrowser/win/MiniBrowserWebHost.cpp:
(MiniBrowserWebHost::didFirstLayoutInFrame): Deleted.
* MiniBrowser/win/MiniBrowserWebHost.h:
(MiniBrowserWebHost::didFirstLayoutInFrame):
* MiniBrowser/win/PrintWebUIDelegate.cpp:
(getHandleFromWebView):
(PrintWebUIDelegate::webViewPrintingMarginRect):
(PrintWebUIDelegate::runModal):
(PrintWebUIDelegate::createModalDialog):
* MiniBrowser/win/WebKitLegacyBrowserWindow.cpp:
(WebKitLegacyBrowserWindow::init):
(WebKitLegacyBrowserWindow::setToDefaultPreferences):
(WebKitLegacyBrowserWindow::showLastVisitedSites):
(WebKitLegacyBrowserWindow::reload):
(WebKitLegacyBrowserWindow::resetZoom):
(WebKitLegacyBrowserWindow::zoomIn):
(WebKitLegacyBrowserWindow::zoomOut):
(WebKitLegacyBrowserWindow::showLayerTree):
(WebKitLegacyBrowserWindow::print):
* MiniBrowser/win/WebKitLegacyBrowserWindow.h:
(WebKitLegacyBrowserWindow::privatePreferences):
* MiniBrowser/win/WinMain.cpp:
(wWinMain):
* MiniBrowser/win/stdafx.h:

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

10 months ago[JSC] DFG op_call_varargs should not assume that one-previous-local of freeReg is...
ysuzuki@apple.com [Fri, 20 Sep 2019 02:31:45 +0000 (02:31 +0000)]
[JSC] DFG op_call_varargs should not assume that one-previous-local of freeReg is usable
https://bugs.webkit.org/show_bug.cgi?id=202014

Reviewed by Saam Barati.

JSTests:

* stress/call-varargs-inlining-should-not-clobber-previous-to-free-register.js: Added.
(__v0):

Source/JavaScriptCore:

Let's look into the bytecode generated by the test.

    [   0] enter
    [   1] get_scope          loc4
    [   3] mov                loc5, loc4
    [   6] check_traps
    [   7] mov                loc6, callee
    [  10] create_direct_arguments loc7
    [  12] to_this            this
    [  15] mov                loc8, loc7
    [  18] mov                loc9, loc6
    [  21] mov                loc12, Undefined(const0)
    [  24] get_by_id          loc11, loc6, 0
    [  29] jneq_ptr           loc11, ApplyFunction, 18(->47)
    [  34] mov                loc11, loc6
    [  37] call_varargs       loc11, loc11, this, loc8, loc13, 0
    [  45] jmp                17(->62)
    [  47] mov                loc16, loc6
    [  50] mov                loc15, this
    [  53] mov                loc14, loc8
    [  56] call               loc11, loc11, 3, 22
    ...

call_varargs uses loc13 as firstFreeReg (first usable bottom register in the current stack-frame to spread variadic arguments after this).
This is correct. And call_varargs uses |this| as this argument for the call_varargs. This |this| argument is not in a region starting from loc13.
And it is not in the previous place to loc13 (|this| is not loc12).

On the other hand, DFG::ByteCodeParser's inlining path is always assuming that the previous to firstFreeReg is usable and part of arguments.
But this is wrong. loc12 in the above bytecode is used for `[  56] call               loc11, loc11, 3, 22`'s argument later, and this call assumes
that loc12 is not clobbered by call_varargs. But DFG and FTL clobbers it.

The test is recursively calling the same function, and we inline the same function one-level. And stack-overflow error happens when inlined
CallForwardVarargs (from op_call_varargs) is called. FTL recovers the frames, and at this point, outer function's loc12 is recovered to garbage since
LoadVarargs clobbers it. And we eventually use it and crash.

    60:<!0:-> LoadVarargs(Check:Untyped:Kill:@30, MustGen, start = loc13, count = loc15, machineStart = loc7, machineCount = loc9, offset = 0, mandatoryMinimum = 0, limit = 2, R:World, W:Stack(-16),Stack(-14),Stack(-13),Heap, Exits, ClobbersExit, bc#37, ExitValid)

This LoadVarargs clobbers loc12, loc13, and loc15 while loc12 is used.

In all the tiers, op_call_varargs first allocates enough region to hold varargs including |this|. And we store |this| value to a correct place.
DFG should not assume that the previous register to firstFreeReg is used for |this|.

This patch fixes DFG::ByteCodeParser's stack region calculation for op_call_varargs inlining. And we rename maxNumArguments to maxArgumentCountIncludingThis to
represent that `maxArgumentCountIncludingThis` includes |this| count.

* bytecode/CallLinkInfo.cpp:
(JSC::CallLinkInfo::setMaxArgumentCountIncludingThis):
(JSC::CallLinkInfo::setMaxNumArguments): Deleted.
* bytecode/CallLinkInfo.h:
(JSC::CallLinkInfo::addressOfMaxArgumentCountIncludingThis):
(JSC::CallLinkInfo::maxArgumentCountIncludingThis):
(JSC::CallLinkInfo::addressOfMaxNumArguments): Deleted.
(JSC::CallLinkInfo::maxNumArguments): Deleted.
* bytecode/CallLinkStatus.cpp:
(JSC::CallLinkStatus::computeFor):
(JSC::CallLinkStatus::dump const):
* bytecode/CallLinkStatus.h:
(JSC::CallLinkStatus::maxArgumentCountIncludingThis const):
(JSC::CallLinkStatus::maxNumArguments const): Deleted.
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleVarargsInlining):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::emitCall):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::emitCall):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileDirectCallOrConstruct):
* jit/JITCall.cpp:
(JSC::JIT::compileSetupFrame):
* jit/JITCall32_64.cpp:
(JSC::JIT::compileSetupFrame):
* jit/JITOperations.cpp:

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

10 months ago[GTK] Dependency hunspell-en-gb cannot be found on Fedora 30
jdiggs@igalia.com [Fri, 20 Sep 2019 01:39:00 +0000 (01:39 +0000)]
[GTK] Dependency hunspell-en-gb cannot be found on Fedora 30
https://bugs.webkit.org/show_bug.cgi?id=202009

Update package name to hunspell-en-GB.

Reviewed by Carlos Alberto Lopez Perez.

* gtk/install-dependencies:

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

10 months agoWeb Inspector: Canvas: show WebGPU shader pipelines
drousso@apple.com [Fri, 20 Sep 2019 01:20:31 +0000 (01:20 +0000)]
Web Inspector: Canvas: show WebGPU shader pipelines
https://bugs.webkit.org/show_bug.cgi?id=201675

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/protocol/Canvas.json:
Add a `ProgramType` enum that conveys the type of shader program/pipeline when notifying the
frontend of a new program

Source/WebCore:

Tests: inspector/canvas/requestShaderSource-webgpu.html
       inspector/canvas/shaderProgram-add-remove-webgpu.html
       inspector/canvas/updateShader-webgpu.html

Create common base classes for `WebGPUPipeline` and `GPUPipeline` so that Web Inspector can
instrument both render and compute shader pipelines.

Refactor `InspectorShaderProgram` to support both `WebGLProgram` and `WebGPUPipeline` so
that the same object can be used for all types of shader "program"s.

Keep a copy of each shader module's source, and allow the shader module to be updated.

* Modules/webgpu/WebGPUDevice.h:
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createShaderModule const):
(WebCore::WebGPUDevice::createRenderPipeline): Added.
(WebCore::WebGPUDevice::createComputePipeline): Added.
(WebCore::WebGPUDevice::createRenderPipeline const): Deleted.
(WebCore::WebGPUDevice::createComputePipeline const): Deleted.

* Modules/webgpu/WebGPUPipeline.h: Added.
(WebCore::WebGPUPipeline::isRenderPipeline const):
(WebCore::WebGPUPipeline::isComputePipeline const):
(WebCore::WebGPUPipeline::scriptExecutionContext const):
* Modules/webgpu/WebGPUPipeline.cpp: Added.
(WebCore::WebGPUPipeline::instancesMutex):
(WebCore::WebGPUPipeline::WebGPUPipeline):
(WebCore::WebGPUPipeline::~WebGPUPipeline):
* platform/graphics/gpu/GPUPipeline.cpp: Added.
* platform/graphics/gpu/GPUPipeline.h: Added.
(WebCore::GPUPipeline::isRenderPipeline const):
(WebCore::GPUPipeline::isComputePipeline const):

* Modules/webgpu/WebGPUComputePipeline.idl:
* Modules/webgpu/WebGPUComputePipeline.h:
(WebCore::WebGPUComputePipeline::computePipeline const): Deleted.
* Modules/webgpu/WebGPUComputePipeline.cpp:
(WebCore::WebGPUComputePipeline::create):
(WebCore::WebGPUComputePipeline::WebGPUComputePipeline):
(WebCore::WebGPUComputePipeline::recompile): Added.
* platform/graphics/gpu/GPUComputePipeline.h:
(WebCore::GPUComputePipeline::isComputePipeline): Added.
* platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm:
(WebCore::GPUComputePipeline::tryCreate):
(WebCore::GPUComputePipeline::GPUComputePipeline):
(WebCore::GPUComputePipeline::recompile): Added.

* Modules/webgpu/WebGPURenderPipeline.idl:
* Modules/webgpu/WebGPURenderPipeline.h:
(WebCore::WebGPURenderPipeline::renderPipeline const): Deleted.
* Modules/webgpu/WebGPURenderPipeline.cpp:
(WebCore::WebGPURenderPipeline::create):
(WebCore::WebGPURenderPipeline::WebGPURenderPipeline):
(WebCore::WebGPURenderPipeline::recompile): Added.
* platform/graphics/gpu/GPURenderPipeline.h:
(WebCore::GPURenderPipeline::isRenderPipeline): Added.
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::tryCreateMtlRenderPipelineState):
(WebCore::GPURenderPipeline::tryCreate):
(WebCore::GPURenderPipeline::GPURenderPipeline):
(WebCore::GPURenderPipeline::recompile): Added.

* Modules/webgpu/WebGPUShaderModule.h:
(WebCore::WebGPUShaderModule::source const): Added.
* Modules/webgpu/WebGPUShaderModule.cpp:
(WebCore::WebGPUShaderModule::update): Added.
* Modules/webgpu/WebGPUProgrammableStageDescriptor.h:
* platform/graphics/gpu/GPUProgrammableStageDescriptor.h:
(WebCore::GPUProgrammableStageDescriptor::GPUProgrammableStageDescriptor):

* inspector/InspectorShaderProgram.h:
* inspector/InspectorShaderProgram.cpp:
(WebCore::InspectorShaderProgram::create):
(WebCore::InspectorShaderProgram::InspectorShaderProgram):
(WebCore::InspectorShaderProgram::program const): Added.
(WebCore::InspectorShaderProgram::pipeline const): Added.
(WebCore::shaderForType): Added.
(WebCore::InspectorShaderProgram::requestShaderSource): Added.
(WebCore::InspectorShaderProgram::updateShader): Added.
(WebCore::InspectorShaderProgram::context const): Deleted.
(WebCore::InspectorShaderProgram::shaderForType): Deleted.

* inspector/agents/InspectorCanvasAgent.h:
* inspector/agents/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
(WebCore::InspectorCanvasAgent::discardAgent):
(WebCore::InspectorCanvasAgent::enable):
(WebCore::InspectorCanvasAgent::disable):
(WebCore::InspectorCanvasAgent::requestShaderSource):
(WebCore::InspectorCanvasAgent::updateShader):
(WebCore::InspectorCanvasAgent::setShaderProgramDisabled):
(WebCore::InspectorCanvasAgent::setShaderProgramHighlighted):
(WebCore::InspectorCanvasAgent::frameNavigated):
(WebCore::InspectorCanvasAgent::didCreateWebGLProgram): Added.
(WebCore::InspectorCanvasAgent::willDestroyWebGLProgram): Added.
(WebCore::InspectorCanvasAgent::isWebGLProgramDisabled): Added.
(WebCore::InspectorCanvasAgent::isWebGLProgramHighlighted): Added.
(WebCore::InspectorCanvasAgent::didCreateWebGPUPipeline): Added.
(WebCore::InspectorCanvasAgent::willDestroyWebGPUPipeline): Added.
(WebCore::InspectorCanvasAgent::programDestroyedTimerFired): Added.
(WebCore::InspectorCanvasAgent::reset): Added.
(WebCore::InspectorCanvasAgent::unbindProgram):
(WebCore::InspectorCanvasAgent::findInspectorProgram):
(WebCore::InspectorCanvasAgent::didCreateProgram): Deleted.
(WebCore::InspectorCanvasAgent::willDeleteProgram): Deleted.
(WebCore::InspectorCanvasAgent::isShaderProgramDisabled): Deleted.
(WebCore::InspectorCanvasAgent::isShaderProgramHighlighted): Deleted.
(WebCore::InspectorCanvasAgent::clearCanvasData): Deleted.
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didCreateWebGLProgram): Added.
(WebCore::InspectorInstrumentation::willDestroyWebGLProgram): Added.
(WebCore::InspectorInstrumentation::isWebGLProgramDisabled): Added.
(WebCore::InspectorInstrumentation::isWebGLProgramHighlighted): Added.
(WebCore::InspectorInstrumentation::didCreateWebGPUPipeline): Added.
(WebCore::InspectorInstrumentation::willDestroyWebGPUPipeline): Added.
(WebCore::InspectorInstrumentation::didCreateProgram): Deleted.
(WebCore::InspectorInstrumentation::willDeleteProgram): Deleted.
(WebCore::InspectorInstrumentation::isShaderProgramDisabled): Deleted.
(WebCore::InspectorInstrumentation::isShaderProgramHighlighted): Deleted.
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didCreateWebGLProgramImpl): Added.
(WebCore::InspectorInstrumentation::willDestroyWebGLProgramImpl): Added.
(WebCore::InspectorInstrumentation::isWebGLProgramDisabledImpl): Added.
(WebCore::InspectorInstrumentation::isWebGLProgramHighlightedImpl): Added.
(WebCore::InspectorInstrumentation::didCreateWebGPUPipelineImpl): Added.
(WebCore::InspectorInstrumentation::willDestroyWebGPUPipelineImpl): Added.
(WebCore::InspectorInstrumentation::didCreateProgramImpl): Deleted.
(WebCore::InspectorInstrumentation::willDeleteProgramImpl): Deleted.
(WebCore::InspectorInstrumentation::isShaderProgramDisabledImpl): Deleted.
(WebCore::InspectorInstrumentation::isShaderProgramHighlightedImpl): Deleted.

* html/canvas/WebGLProgram.h:
* html/canvas/WebGLProgram.cpp:
(WebCore::WebGLProgram::WebGLProgram):
(WebCore::WebGLProgram::~WebGLProgram):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::InspectorScopedShaderProgramHighlight::showHightlight):
(WebCore::WebGLRenderingContextBase::createProgram):
(WebCore::WebGLRenderingContextBase::deleteProgram):
(WebCore::WebGLRenderingContextBase::drawArrays):
(WebCore::WebGLRenderingContextBase::drawElements):
Rename WebGL program instrumentation points to be less ambiguous.

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

Source/WebInspectorUI:

Show WebGPU shader pipelines ("programs") underneath each corresponding WebGPU device.

Allow editing of attached shader modules for each WebGPU shader pipeline, but don't allow
highlighting/disabling, as WebGPU pipelines don't have those capabilities/concepts yet.

* UserInterface/Protocol/CanvasObserver.js:
(WI.CanvasObserver.prototype.programCreated):
* UserInterface/Controllers/CanvasManager.js:
(WI.CanvasManager.prototype.programCreated):

* UserInterface/Models/Canvas.js:
(WI.Canvas.prototype.nextShaderProgramDisplayNumberForProgramType): Added.
(WI.Canvas.prototype.nextShaderProgramDisplayNumber): Deleted.

* UserInterface/Models/ShaderProgram.js:
(WI.ShaderProgram):
(WI.ShaderProgram.contextTypeSupportsProgramType): Added.
(WI.ShaderProgram.programTypeSupportsShaderType): Added.
(WI.ShaderProgram.prototype.get programType): Added.
(WI.ShaderProgram.prototype.get displayName):
(WI.ShaderProgram.prototype.set disabled):
(WI.ShaderProgram.prototype.requestShaderSource):
(WI.ShaderProgram.prototype.updateShader):
(WI.ShaderProgram.prototype.showHighlight):
(WI.ShaderProgram.prototype.hideHighlight):
(WI.ShaderProgram.prototype.requestVertexShaderSource): Deleted.
(WI.ShaderProgram.prototype.requestFragmentShaderSource): Deleted.
(WI.ShaderProgram.prototype.updateVertexShader): Deleted.
(WI.ShaderProgram.prototype.updateFragmentShader): Deleted.
(WI.ShaderProgram.prototype._requestShaderSource): Deleted.
(WI.ShaderProgram.prototype._updateShader): Deleted.

* UserInterface/Views/ShaderProgramContentView.js:
(WI.ShaderProgramContentView):
(WI.ShaderProgramContentView.prototype.get navigationItems): Added.
(WI.ShaderProgramContentView.prototype.shown):
(WI.ShaderProgramContentView.prototype.hidden):
(WI.ShaderProgramContentView.prototype.get saveData):
(WI.ShaderProgramContentView.prototype._refreshContent):
(WI.ShaderProgramContentView.prototype._updateShader):
(WI.ShaderProgramContentView.prototype._contentDidChange):
* UserInterface/Views/ShaderProgramContentView.css:
(.content-view.shader-program > .shader): Added.
(.content-view.shader-program > .shader.compute): Added.
(body[dir=ltr] .content-view.shader-program > .shader.vertex,): Added.
(body[dir=ltr] .content-view.shader-program > .shader.fragment,): Added.
(.content-view.shader-program > .shader + .shader): Added.
(.content-view.shader-program > .shader > header > *): Added.
(.content-view.shader-program > .shader > header > .shader-type): Added.
(@media (prefers-color-scheme: dark) .content-view.shader-program > .shader > header): Added.
(.content-view.shader-program > .text-editor.shader): Deleted.
(body[dir=ltr] .content-view.shader-program > .text-editor.shader.vertex,): Deleted.
(body[dir=ltr] .content-view.shader-program > .text-editor.shader.fragment,): Deleted.
(body[dir=ltr] .content-view.shader-program > .text-editor.shader + .text-editor.shader): Deleted.
(body[dir=rtl] .content-view.shader-program > .text-editor.shader + .text-editor.shader): Deleted.
(.content-view.shader-program > .text-editor.shader > .type-title): Deleted.
(.content-view.shader-program > .text-editor.shader > .CodeMirror): Deleted.
* UserInterface/Views/CodeMirrorAdditions.js:

* UserInterface/Views/ShaderProgramTreeElement.js:
(WI.ShaderProgramTreeElement):
(WI.ShaderProgramTreeElement.prototype.onattach):
(WI.ShaderProgramTreeElement.prototype.ondetach):
(WI.ShaderProgramTreeElement.prototype.canSelectOnMouseDown):
(WI.ShaderProgramTreeElement.prototype.populateContextMenu):

* Localizations/en.lproj/localizedStrings.js:

LayoutTests:

Split existing shader tests into WebGL and WebGPU sub-tests for different platforms.

* inspector/canvas/requestShaderSource.html:
* inspector/canvas/requestShaderSource-expected.txt:
* inspector/canvas/updateShader.html:
* inspector/canvas/updateShader-expected.txt:

* inspector/canvas/resources/shaderProgram-utilities-webgpu.js: Added.
* inspector/canvas/requestShaderSource-webgpu.html: Added.
* inspector/canvas/requestShaderSource-webgpu-expected.txt: Added.
* inspector/canvas/shaderProgram-add-remove-webgpu.html: Added.
* inspector/canvas/shaderProgram-add-remove-webgpu-expected.txt: Added.
* inspector/canvas/updateShader-webgpu-expected.txt: Added.
* inspector/canvas/updateShader-webgpu.html: Added.

* inspector/canvas/resources/shaderProgram-utilities-webgl.js: Renamed from LayoutTests/inspector/canvas/resources/shaderProgram-utilities.js.
* inspector/canvas/console-record-webgl.html:
* inspector/canvas/console-record-webgl2.html:
* inspector/canvas/recording-webgl-frameCount.html:
* inspector/canvas/recording-webgl-full.html:
* inspector/canvas/recording-webgl-memoryLimit.html:
* inspector/canvas/recording-webgl-snapshots.html:
* inspector/canvas/recording-webgl2-frameCount.html:
* inspector/canvas/recording-webgl2-full.html:
* inspector/canvas/recording-webgl2-memoryLimit.html:
* inspector/canvas/recording-webgl2-snapshots.html:
* inspector/canvas/requestShaderSource-webgl.html: Added.
* inspector/canvas/requestShaderSource-webgl-expected.txt: Added.
* inspector/canvas/setShaderProgramDisabled.html:
* inspector/canvas/setShaderProgramHighlighted.html:
* inspector/canvas/shaderProgram-add-remove-webgl.html:
* inspector/canvas/shaderProgram-add-remove-webgl2.html:
* inspector/canvas/updateShader-webgl.html: Added.
* inspector/canvas/updateShader-webgl-expected.txt: Added.

* platform/gtk/TestExpectations:
* platform/ios/TestExpectations:
* platform/mac-wk1/TestExpectations:
* platform/mac/TestExpectations:
* platform/win/TestExpectations:
* platform/wincairo/TestExpectations:
* platform/wpe/TestExpectations:

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

10 months agoresults.webkit.org: Collapse results with the same version name
jbedard@apple.com [Fri, 20 Sep 2019 00:46:11 +0000 (00:46 +0000)]
results.webkit.org: Collapse results with the same version name
https://bugs.webkit.org/show_bug.cgi?id=201779

Rubber-stamped by Aakash Jain.

* resultsdbpy/resultsdbpy/view/static/js/configuration.js:
(Configuration.prototype.const.ending.this.version_name.substring):
(Configuration.prototype.toKey): Prefer version_name over version number in key.
(Configuration.prototype.compare): version_name comparison should always override version comparison.
(Configuration.prototype.compareSDKs): Make SDK regex global.
(Configuration.prototype.toParams): Remove E tag on version_name.
(Configuration): Append E tag on the version_name based on the SDK.
* resultsdbpy/resultsdbpy/view/static/js/timeline.js:
(TimelineFromEndpoint.prototype.toString): Print version number with SDK.

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

10 months agoRename VMInspector::m_list to m_vmList.
mark.lam@apple.com [Fri, 20 Sep 2019 00:29:56 +0000 (00:29 +0000)]
Rename VMInspector::m_list to m_vmList.
https://bugs.webkit.org/show_bug.cgi?id=202015

Reviewed by Yusuke Suzuki.

m_vmList is more descriptive, and this rename helps grep-ability by disambiguating
it from other m_lists in the code base.

* tools/VMInspector.cpp:
(JSC::VMInspector::add):
(JSC::VMInspector::remove):
* tools/VMInspector.h:
(JSC::VMInspector::iterate):

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

10 months agoAdd better logging for when the view visibility state changes
cdumez@apple.com [Fri, 20 Sep 2019 00:11:57 +0000 (00:11 +0000)]
Add better logging for when the view visibility state changes
https://bugs.webkit.org/show_bug.cgi?id=202008

Reviewed by Geoffrey Garen.

* UIProcess/ApplicationStateTracker.mm:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::updateActivityState):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::applicationDidEnterBackground):
(WebKit::WebPageProxy::applicationWillEnterForeground):

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

10 months agoRegression(r248832): Unable to quicklook HTML files in Mail
cdumez@apple.com [Thu, 19 Sep 2019 23:55:36 +0000 (23:55 +0000)]
Regression(r248832): Unable to quicklook HTML files in Mail
https://bugs.webkit.org/show_bug.cgi?id=202012
<rdar://problem/55285295>

Reviewed by Geoff Garen and Brent Fulgham.

r248832 inadvertently reverted the fix for Mail that landed in r247400 by not using
the same logic to initialize the sandbox extension if the process had already
finished launching or not. In particular, the new code path that happens on process
launch unconditionally used '/' as resource directory for the sandbox extension if
the client did not provide one. The logic in maybeInitializeSandboxExtensionHandle()
would use the file URL's base URL as resource directory when creating a sandbox
extension for '/' would fail (which it often does).

To address the issue, have the logic that runs on process launch call
maybeInitializeSandboxExtensionHandle() so avoid duplicating code and make sure
both cases now have the Mail fix.

* UIProcess/AuxiliaryProcessProxy.cpp:
(WebKit::AuxiliaryProcessProxy::didFinishLaunching):
* UIProcess/AuxiliaryProcessProxy.h:
(WebKit::AuxiliaryProcessProxy::isLaunching const):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
(WebKit::WebPageProxy::loadRequestWithNavigationShared):
(WebKit::WebPageProxy::loadFile):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.messages.in:

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

10 months agomacCatalyst apps crash under TextCheckingControllerProxy::replaceRelativeToSelection...
timothy_horton@apple.com [Thu, 19 Sep 2019 23:15:52 +0000 (23:15 +0000)]
macCatalyst apps crash under TextCheckingControllerProxy::replaceRelativeToSelection when spell checking
https://bugs.webkit.org/show_bug.cgi?id=202010
<rdar://problem/54974971>

Reviewed by Beth Dakin.

* WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.mm:
(WebKit::TextCheckingControllerProxy::replaceRelativeToSelection):
relativeReplacementRange is in the coordinate space of the document's text,
not the replacement string. We need to adjust into replacement string
coordinates before slicing the replacement, or we'll throw an exception
trying to read past the end of the string, in the case where the
replacement string is shorter than the replaced string (by more than 2 characters).

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

10 months agoReduce the number of required tag bits for the JSValue.
mark.lam@apple.com [Thu, 19 Sep 2019 22:23:50 +0000 (22:23 +0000)]
Reduce the number of required tag bits for the JSValue.
https://bugs.webkit.org/show_bug.cgi?id=201990

Reviewed by Yusuke Suzuki.

We're reducing the number of tag bits to 15.  It should just work.

How did we arrive at 15 bits?
============================
Currently, the minimum number of top bits used by doubles is 13-bits.  The
highest double bit encoding are:

    "negative" pureNaN: starts with 0xfff8
    negative infinity:  starts with 0xfff0
    highest number:     starts with 0xffe*
    lowest number:      starts with 0x0000

Requirements:
1. We need tags for 2 range of numbers: pointers (all 0s at the top), and ints
   (all 1s at the top).

2. We want to be able to add an offset to double bits and ensure that they never
   end up in the ranges for pointers and ints.

3. The int tag must be higher than whatever value is produced in the top bits
   when boxing a double.  We have code that relies on this relationship being
   true and checks if a JSValue is an int by checking if the tag bits are above
   or equal to the int tag.

4. We don't want to burn more than 2 CPU registers for tag / mask registers.

Based on the bit encoding of doubles, the full number range of the top 13 bits
are used in valid double numbers.  This means the minimum tag bits must be greater
than 13.

Consider a 14-bit tag.  The DoubleEncodeOffset will be 1 << 50 i.e. starts with
0x0004.  With this encoding,
    "negative" pureNaN: maps to 0xfff8 + 0x0004 => 0xfffc

i.e. the top 14 bits are all set.  This conflicts with the int number range.

Next, consider a 15-bit tag.  The DoubleEncodeOffset will be 1 << 49 i.e. starts
with 0x0002.  With this encoding:
    "negative" pureNaN: maps to 0xfff8 + 0x0002 => 0xfffa
    negative infinity:  maps to 0xfff0 + 0x0002 => 0xfff2

i.e. 0xfffe (top 5 bits set) is available to represent ints.  This is the encoding
that we'll adopt in this patch.

Alternate encodings schemes to consider in the future:
=====================================================
1. If we're willing and able to purifyNaN at all the places that can produce a
   "negative" pureNaN, e.g. after a division, then we can remove the "negative"
   pureNaN as a valid double bit encoding.  With this, we can now box doubles
   with just a 14-bit tag, and DoubleEncodeOffset will be 1 << 50 i.e. starts with
   0x0004.

   With this encoding, the top double, negative infinity, is encoded as follows:

        negative infinity:  maps to 0xfff0 + 0x0004 => 0xfff4

   i.e. leaving 0xfffc as the tag for ints.

   We didn't adopt this scheme at this time because it adds complexity, and may
   have performance impact from the extra purifyNaN checks.

   Ref: https://bugs.webkit.org/show_bug.cgi?id=202002

2. If we're willing to use 3 tag registers or always materialize one of them, we
   can also adopt a 14-bit tag as follows:

       Pointer {  0000:PPPP:PPPP:PPPP
                / 0002:****:****:****
       Double  {         ...
                \ FFFC:****:****:****
       Integer {  FFFF:0000:IIII:IIII

   where ...
       NumberMask is 0xfffc: any bits set in the top 14 bits is a number.
       IntMask is 0xffff: value is int if value & IntMask == IntMask.
       NotCellMask is NumberMask | OtherTag.

   Since the highest double is "negative" pureNaN i.e. starts with 0xfff8, adding
   a DoubleEncodeOffset of 1<<50 (starts with 0x0004) produces 0xfffc which is
   still less than 0xffff.

   We didn't adopt this scheme at this time because it adds complexity and may
   have a performance impact from either burning another register, or materializing
   the 3rd mask.

   Ref: https://bugs.webkit.org/show_bug.cgi?id=202005

* runtime/JSCJSValue.h:

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

10 months agoWebStorageNamespaceProvider / StorageNamespaceImpl no longer need SessionIDs
commit-queue@webkit.org [Thu, 19 Sep 2019 21:46:03 +0000 (21:46 +0000)]
WebStorageNamespaceProvider / StorageNamespaceImpl no longer need SessionIDs
https://bugs.webkit.org/show_bug.cgi?id=201922
<rdar://problem/55505906>

Patch by Yury Semikhatsky <yurys@chromium.org> on 2019-09-19
Reviewed by Chris Dumez.

Fix GTK Debug compilation after https://trac.webkit.org/changeset/250083:
../../Source/WebKit/WebProcess/WebStorage/WebStorageNamespaceProvider.cpp:75:55: error: no member named 'singleton' in namespace 'WebCore::Process'
ASSERT_UNUSED(sessionID, sessionID == WebProcess::singleton().sessionID());
                                  ~~~~~~~~~~~~^

* WebProcess/WebStorage/WebStorageNamespaceProvider.cpp:

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

10 months agoREGRESSION: [iOS 13?] TestWebKitAPI.SharedBufferTest.tryCreateArrayBufferLargeSegment...
ryanhaddad@apple.com [Thu, 19 Sep 2019 21:34:10 +0000 (21:34 +0000)]
REGRESSION: [iOS 13?] TestWebKitAPI.SharedBufferTest.tryCreateArrayBufferLargeSegments is failing
https://bugs.webkit.org/show_bug.cgi?id=201902

Unreviewed test gardening.

* TestWebKitAPI/Tests/WebCore/SharedBuffer.cpp: Disable the test on iOS.

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

10 months agoWorkerGlobalScope does not need a SessionID
cdumez@apple.com [Thu, 19 Sep 2019 21:19:21 +0000 (21:19 +0000)]
WorkerGlobalScope does not need a SessionID
https://bugs.webkit.org/show_bug.cgi?id=201991

Reviewed by Alex Christensen.

WorkerGlobalScope does not need a SessionID, now that we have a single session
per WebProcess.

Source/WebCore:

* dom/Document.cpp:
(WebCore::Document::resume):
(WebCore::Document::privateBrowsingStateDidChange):
* dom/Document.h:
* dom/ScriptExecutionContext.h:
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::matchRegistration):
(WebCore::DocumentLoader::commitData):
(WebCore::DocumentLoader::registerTemporaryServiceWorkerClient):
(WebCore::DocumentLoader::unregisterTemporaryServiceWorkerClient):
* testing/Internals.cpp:
(WebCore::Internals::serviceWorkerClientIdentifier const):
(WebCore::Internals::storeRegistrationsOnDisk):
(WebCore::Internals::hasServiceWorkerRegistration):
(WebCore::Internals::terminateServiceWorker):
(WebCore::Internals::hasServiceWorkerConnection):
* workers/DedicatedWorkerGlobalScope.cpp:
(WebCore::DedicatedWorkerGlobalScope::create):
(WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
* workers/DedicatedWorkerGlobalScope.h:
* workers/DedicatedWorkerThread.cpp:
(WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
(WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
* workers/DedicatedWorkerThread.h:
* workers/Worker.cpp:
(WebCore::Worker::notifyFinished):
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::WorkerGlobalScope):
* workers/WorkerGlobalScope.h:
* workers/WorkerGlobalScopeProxy.h:
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
* workers/WorkerMessagingProxy.h:
* workers/WorkerThread.cpp:
(WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
(WebCore::WorkerThread::WorkerThread):
(WebCore::WorkerThread::workerThread):
* workers/WorkerThread.h:
* workers/service/ServiceWorker.cpp:
(WebCore::ServiceWorker::postMessage):
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::mainThreadConnection):
(WebCore::ServiceWorkerContainer::addRegistration):
(WebCore::ServiceWorkerContainer::removeRegistration):
(WebCore::ServiceWorkerContainer::updateRegistration):
(WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
(WebCore::ServiceWorkerContainer::notifyRegistrationIsSettled):
(WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
(WebCore::ServiceWorkerContainer::notifyFailedFetchingScript):
(WebCore::ServiceWorkerContainer::ensureSWClientConnection):
* workers/service/ServiceWorkerGlobalScope.cpp:
(WebCore::ServiceWorkerGlobalScope::create):
(WebCore::ServiceWorkerGlobalScope::ServiceWorkerGlobalScope):
* workers/service/ServiceWorkerGlobalScope.h:
* workers/service/ServiceWorkerProvider.cpp:
(WebCore::ServiceWorkerProvider::mayHaveServiceWorkerRegisteredForOrigin):
(WebCore::ServiceWorkerProvider::registerServiceWorkerClients):
* workers/service/ServiceWorkerProvider.h:
* workers/service/WorkerSWClientConnection.cpp:
(WebCore::WorkerSWClientConnection::WorkerSWClientConnection):
(WebCore::WorkerSWClientConnection::matchRegistration):
(WebCore::WorkerSWClientConnection::getRegistrations):
(WebCore::WorkerSWClientConnection::whenRegistrationReady):
(WebCore::WorkerSWClientConnection::addServiceWorkerRegistrationInServer):
(WebCore::WorkerSWClientConnection::removeServiceWorkerRegistrationInServer):
(WebCore::WorkerSWClientConnection::didResolveRegistrationPromise):
(WebCore::WorkerSWClientConnection::postMessageToServiceWorker):
(WebCore::WorkerSWClientConnection::serverConnectionIdentifier const):
(WebCore::WorkerSWClientConnection::syncTerminateWorker):
(WebCore::WorkerSWClientConnection::registerServiceWorkerClient):
(WebCore::WorkerSWClientConnection::finishFetchingScriptInServer):
(WebCore::WorkerSWClientConnection::scheduleJob):
* workers/service/WorkerSWClientConnection.h:
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::ServiceWorkerThread):
(WebCore::ServiceWorkerThread::createWorkerGlobalScope):
* workers/service/context/ServiceWorkerThread.h:
* workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
* workers/service/context/ServiceWorkerThreadProxy.h:
* worklets/WorkletGlobalScope.h:
(WebCore::WorkletGlobalScope::sessionID const):
* xml/DOMParser.cpp:
(WebCore::DOMParser::parseFromString):
* xml/DOMParser.h:
* xml/DOMParser.idl:
* xml/XMLHttpRequest.cpp:

Source/WebKit:

* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::installServiceWorker):
* WebProcess/Storage/WebServiceWorkerProvider.cpp:
(WebKit::WebServiceWorkerProvider::serviceWorkerConnection):
(WebKit::WebServiceWorkerProvider::existingServiceWorkerConnection):
(WebKit::WebServiceWorkerProvider::serviceWorkerConnectionForSession): Deleted.
(WebKit::WebServiceWorkerProvider::existingServiceWorkerConnectionForSession): Deleted.
* WebProcess/Storage/WebServiceWorkerProvider.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updateThrottleState):

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

10 months agoSource/WebCore:
commit-queue@webkit.org [Thu, 19 Sep 2019 20:52:30 +0000 (20:52 +0000)]
Source/WebCore:
[SVG2]: Add auto behavior for rx and ry to the SVG <ellipse> and<rect> elements
https://bugs.webkit.org/show_bug.cgi?id=199843

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

The specification is: https://www.w3.org/TR/SVG2/geometry.html#RxProperty.

Change the initial value of rx and ry to be "auto". Change the parser to
parse LengthOrAuto for these properties. Handle the case if one of them
is missing.

Tests: svg/custom/ellipse-radius-auto-dynamic.svg
       svg/custom/ellipse-radius-auto-initial.svg
       svg/custom/ellipse-radius-length-initial.svg
       svg/custom/rect-radius-auto-dynamic.svg
       svg/custom/rect-radius-auto-initial.svg
       svg/custom/rect-radius-length-initial.svg

* css/CSSProperties.json:
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeRxOrRy):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::initialRadius):
* rendering/style/SVGRenderStyleDefs.cpp:
(WebCore::StyleLayoutData::StyleLayoutData):
* rendering/svg/RenderSVGEllipse.cpp:
(WebCore::RenderSVGEllipse::calculateRadiiAndCenter):

LayoutTests:
[SVG2]: Add auto behavior for rx and ry to the SVG <ellipse> and <rect> elements
https://bugs.webkit.org/show_bug.cgi?id=199843

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

Add tests which exercise the initial setting for rx and ry: length, 'auto'.
Add tests to dynamically change the values of these properties from length
to 'auto'.

Skip the tests with dynamic changes till webkit.org/b/201918 is fixed.

* TestExpectations:
* svg/css/parse-length-expected.txt:
* svg/css/parse-length.html:
* svg/custom/ellipse-radius-auto-dynamic-expected.svg: Added.
* svg/custom/ellipse-radius-auto-dynamic.svg: Added.
* svg/custom/ellipse-radius-auto-initial-expected.svg: Added.
* svg/custom/ellipse-radius-auto-initial.svg: Added.
* svg/custom/ellipse-radius-length-initial-expected.svg: Added.
* svg/custom/ellipse-radius-length-initial.svg: Added.
* svg/custom/rect-radius-auto-dynamic-expected.svg: Added.
* svg/custom/rect-radius-auto-dynamic.svg: Added.
* svg/custom/rect-radius-auto-initial-expected.svg: Added.
* svg/custom/rect-radius-auto-initial.svg: Added.
* svg/custom/rect-radius-length-initial-expected.svg: Added.
* svg/custom/rect-radius-length-initial.svg: Added.

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