WebKit-https.git
18 months ago[GTK][WPE] Remove UpdateAtlas
magomez@igalia.com [Wed, 28 Mar 2018 12:30:10 +0000 (12:30 +0000)]
[GTK][WPE] Remove UpdateAtlas
https://bugs.webkit.org/show_bug.cgi?id=184042

Reviewed by Žan Doberšek.

Source/WebCore:

Remove UpdateAtlas and AreaAllocator classes. Instead of using UpdateAtlas as a cache
of buffers to render tiles with cairo, allocate a new buffer for each tile instead.

Covered by existent tests.

* loader/EmptyClients.h:
* page/ChromeClient.h:
* platform/TextureMapper.cmake:
* platform/graphics/texmap/coordinated/AreaAllocator.cpp: Removed.
* platform/graphics/texmap/coordinated/AreaAllocator.h: Removed.
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
* platform/graphics/texmap/coordinated/SurfaceUpdateInfo.h:
(): Deleted.
* platform/graphics/texmap/coordinated/UpdateAtlas.cpp: Removed.
* platform/graphics/texmap/coordinated/UpdateAtlas.h: Removed.
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):

Source/WebKit:

Remove all the code related to UpdateAtlas handling.

* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::updateTilesIfNeeded):
(WebKit::CoordinatedGraphicsScene::commitSceneState):
(WebKit::CoordinatedGraphicsScene::purgeGLResources):
(WebKit::CoordinatedGraphicsScene::syncUpdateAtlases): Deleted.
(WebKit::CoordinatedGraphicsScene::createUpdateAtlas): Deleted.
(WebKit::CoordinatedGraphicsScene::removeUpdateAtlas): Deleted.
(WebKit::CoordinatedGraphicsScene::releaseUpdateAtlases): Deleted.
* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::renderLayerTree):
(WebKit::ThreadedCompositor::releaseUpdateAtlases): Deleted.
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::delegatedScrollRequested):
(WebKit::WebChromeClient::resetUpdateAtlasForTesting): Deleted.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::resetUpdateAtlasForTesting): Deleted.
* WebProcess/WebPage/AcceleratedDrawingArea.h:
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
(WebKit::CompositingCoordinator::CompositingCoordinator):
(WebKit::CompositingCoordinator::flushPendingLayerChanges):
(WebKit::CompositingCoordinator::clearPendingStateChanges):
(WebKit::CompositingCoordinator::renderNextFrame):
(WebKit::CompositingCoordinator::purgeBackingStores):
(WebKit::CompositingCoordinator::createUpdateAtlas): Deleted.
(WebKit::CompositingCoordinator::removeUpdateAtlas): Deleted.
(WebKit::CompositingCoordinator::getCoordinatedBuffer): Deleted.
(): Deleted.
(WebKit::CompositingCoordinator::scheduleReleaseInactiveAtlases): Deleted.
(WebKit::CompositingCoordinator::releaseInactiveAtlasesTimerFired): Deleted.
(WebKit::CompositingCoordinator::releaseAtlases): Deleted.
(WebKit::CompositingCoordinator::clearUpdateAtlases): Deleted.
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
(WebKit::CoordinatedLayerTreeHost::clearUpdateAtlases): Deleted.
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
(WebKit::ThreadedCoordinatedLayerTreeHost::releaseUpdateAtlases): Deleted.
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
* WebProcess/WebPage/DrawingArea.h:
* WebProcess/WebPage/LayerTreeHost.h:
(WebKit::LayerTreeHost::setIsDiscardable):

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

18 months agoREGRESSION(r229998): WebDriver: MiniBrowser is crashing in a lot of tests after r229998
carlosgc@webkit.org [Wed, 28 Mar 2018 10:40:24 +0000 (10:40 +0000)]
REGRESSION(r229998): WebDriver: MiniBrowser is crashing in a lot of tests after r229998
https://bugs.webkit.org/show_bug.cgi?id=184075

Reviewed by Žan Doberšek.

This is because we are using a value after it has been moved.

* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::setWindowFrameOfBrowsingContext): Save a reference to page in a local variable
before using it when it's also going to be moved in the lambda capture.

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

18 months agoappendQuotedJSONString stops on arithmetic overflow instead of propagating it upwards
rmorisset@apple.com [Wed, 28 Mar 2018 09:36:44 +0000 (09:36 +0000)]
appendQuotedJSONString stops on arithmetic overflow instead of propagating it upwards
https://bugs.webkit.org/show_bug.cgi?id=183894

Reviewed by Saam Barati.

JSTests:

* stress/json-stringified-overflow.js: Added.
(catch):

Source/JavaScriptCore:

Use the return value of appendQuotedJSONString to fail more gracefully when given a string that is too large to handle.

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

Source/WTF:

appendQuotedJSONString now returns a bool indicating whether it succeeded, instead of silently failing when given a string too large
to fit in 4GB.

* wtf/text/StringBuilder.h:
* wtf/text/StringBuilderJSON.cpp:
(WTF::StringBuilder::appendQuotedJSONString):

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

18 months ago[JSC] Move WeakValueRef class to its own file and use it from Objc and GLib
carlosgc@webkit.org [Wed, 28 Mar 2018 09:16:15 +0000 (09:16 +0000)]
[JSC] Move WeakValueRef class to its own file and use it from Objc and GLib
https://bugs.webkit.org/show_bug.cgi?id=184073

Reviewed by Yusuke Suzuki.

We currently have duplicated code in Obj and GLib implementations.

* API/JSManagedValue.mm:
(managedValueHandleOwner):
(-[JSManagedValue initWithValue:]):
* API/JSWeakValue.cpp: Added.
(JSC::JSWeakValue::~JSWeakValue):
(JSC::JSWeakValue::clear):
(JSC::JSWeakValue::isClear const):
(JSC::JSWeakValue::setPrimitive):
(JSC::JSWeakValue::setObject):
(JSC::JSWeakValue::setString):
* API/JSWeakValue.h: Added.
(JSC::JSWeakValue::isSet const):
(JSC::JSWeakValue::isPrimitive const):
(JSC::JSWeakValue::isObject const):
(JSC::JSWeakValue::isString const):
(JSC::JSWeakValue::object const):
(JSC::JSWeakValue::primitive const):
(JSC::JSWeakValue::string const):
* API/glib/JSCWeakValue.cpp:
* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:

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

18 months ago[GLIB] Add JSCWeakValue to JavaScriptCore GLib API
carlosgc@webkit.org [Wed, 28 Mar 2018 06:21:57 +0000 (06:21 +0000)]
[GLIB] Add JSCWeakValue to JavaScriptCore GLib API
https://bugs.webkit.org/show_bug.cgi?id=184041

Reviewed by Michael Catanzaro.

Source/JavaScriptCore:

This allows to keep a reference to a JavaSCript value without protecting it, and without having a strong
reference of the context. When the value is cleared the JSCWeakValue::cleared signal is emitted and
jsc_weak_value_get_value() will always return nullptr.

* API/glib/JSCWeakValue.cpp: Added.
(WeakValueRef::~WeakValueRef):
(WeakValueRef::clear):
(WeakValueRef::isClear const):
(WeakValueRef::isSet const):
(WeakValueRef::isPrimitive const):
(WeakValueRef::isObject const):
(WeakValueRef::isString const):
(WeakValueRef::setPrimitive):
(WeakValueRef::setObject):
(WeakValueRef::setString):
(WeakValueRef::object const):
(WeakValueRef::primitive const):
(WeakValueRef::string const):
(weakValueHandleOwner):
(jscWeakValueInitialize):
(jscWeakValueSetProperty):
(jscWeakValueDispose):
(jsc_weak_value_class_init):
(jsc_weak_value_new):
(jsc_weak_value_get_value):
* API/glib/JSCWeakValue.h: Added.
* API/glib/docs/jsc-glib-4.0-sections.txt:
* API/glib/docs/jsc-glib-docs.sgml:
* API/glib/jsc.h:
* GLib.cmake:

Tools:

Add test case for JSCWeakValue.

* TestWebKitAPI/Tests/JavaScriptCore/glib/TestJSC.cpp:
(weakValueClearedCallback):
(testJSCWeakValue):
(main):

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

18 months ago[LayoutReloaded] Start using window.collectTextRuns() to layout text lines in inline...
zalan@apple.com [Wed, 28 Mar 2018 04:52:54 +0000 (04:52 +0000)]
[LayoutReloaded] Start using window.collectTextRuns() to layout text lines in inline formatting context
https://bugs.webkit.org/show_bug.cgi?id=184070

Reviewed by Antti Koivisto.

* LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js:
(InlineFormattingContext.prototype._handleText):
(InlineFormattingContext.prototype._commitLine):
* LayoutReloaded/FormattingContext/InlineFormatting/Line.js:
(Line.prototype.addTextLineBox):
(Line):
(Line.prototype.addLineBox): Deleted.
* LayoutReloaded/FormattingState/BlockFormattingState.js:
(BlockFormattingState):
* LayoutReloaded/FormattingState/FormattingState.js:
(FormattingState.prototype.displayBox):
(FormattingState):
(FormattingState.prototype._setFormattingContext): Deleted.
* LayoutReloaded/FormattingState/InlineFormattingState.js:
(InlineFormattingState):
* LayoutReloaded/LayoutTree/Text.js:
(Text.prototype.content):
* LayoutReloaded/Utils.js:
(Utils.textRuns):
(Utils.textRunsForLine):
(Utils._dumpLines.):
(Utils._dumpLines):
* LayoutReloaded/test/simple-inline-text.html:

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

18 months ago[DFG] Remove unnecessary USE(JSVALUE32_64) / USE(JSVALUE64)
utatane.tea@gmail.com [Wed, 28 Mar 2018 03:32:09 +0000 (03:32 +0000)]
[DFG] Remove unnecessary USE(JSVALUE32_64) / USE(JSVALUE64)
https://bugs.webkit.org/show_bug.cgi?id=181292

Reviewed by Saam Barati.

By using JSValueRegs abstraction, we can simplify DFGSpeculativeJIT.cpp code.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileGetByValOnDirectArguments):
(JSC::DFG::SpeculativeJIT::compileGetByValOnScopedArguments):
(JSC::DFG::SpeculativeJIT::compileCreateRest):
(JSC::DFG::SpeculativeJIT::compileArraySlice):
(JSC::DFG::SpeculativeJIT::emitSwitchImm):
(JSC::DFG::SpeculativeJIT::compilePutDynamicVar):
(JSC::DFG::SpeculativeJIT::compilePutAccessorByVal):

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

18 months agoWeb Inspector: Modernize some utility functions
timothy@apple.com [Wed, 28 Mar 2018 02:51:18 +0000 (02:51 +0000)]
Web Inspector: Modernize some utility functions
https://bugs.webkit.org/show_bug.cgi?id=184047

Source/WebInspectorUI:

Reviewed by Matt Baker.

* UserInterface/Base/Utilities.js:
(Node.prototype.enclosingNodeOrSelfWithClass): Use parentElement instead of parentNode, so we don't need to check for document.
(Node.prototype.enclosingNodeOrSelfWithNodeNameInArray): Ditto. Also just toUpperCase input, since nodeName is already upper case.
(String.prototype.escapeCharacters): Use Set and string iteration instead of indexOf and charAt.

LayoutTests:

Rubber-stamped by Matt Baker.

* inspector/unit-tests/string-utilities-expected.txt: Updated.
* inspector/unit-tests/string-utilities.html: Added String.prototype.escapeCharacters test.

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

18 months agoUnreviewed, fix typo in variable name
mcatanzaro@igalia.com [Wed, 28 Mar 2018 02:37:05 +0000 (02:37 +0000)]
Unreviewed, fix typo in variable name

* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseCrossingNotifyEvent):

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

18 months agoUnreviewed, rolling out r230008.
mcatanzaro@igalia.com [Wed, 28 Mar 2018 01:36:52 +0000 (01:36 +0000)]
Unreviewed, rolling out r230008.

Lots of HTTP test failures

Reverted changeset:

"Remove unused libsoup ResourceHandle implementation"
https://bugs.webkit.org/show_bug.cgi?id=184048
https://trac.webkit.org/changeset/230008

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

18 months agoSkip http/wpt/service-workers/third-party-registration.html.
ryanhaddad@apple.com [Wed, 28 Mar 2018 00:22:50 +0000 (00:22 +0000)]
Skip http/wpt/service-workers/third-party-registration.html.
https://bugs.webkit.org/show_bug.cgi?id=183860

Unreviewed test gardening.

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

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

18 months agoMake it possible to call ContentSecurityPolicy::upgradeInsecureRequestIfNeeded()...
cdumez@apple.com [Wed, 28 Mar 2018 00:12:32 +0000 (00:12 +0000)]
Make it possible to call ContentSecurityPolicy::upgradeInsecureRequestIfNeeded() from non-main threads
https://bugs.webkit.org/show_bug.cgi?id=184029

Reviewed by Youenn Fablet.

Make it possible to call ContentSecurityPolicy::upgradeInsecureRequestIfNeeded() from non-main threads
by having it use SecurityOriginData (which is safe to construct on non-main threads) instead of
SecurityOrigin (which isn't).

ContentSecurityPolicy::upgradeInsecureRequestIfNeeded() is already called from non-main thread in
FetchLoader, XHR and WebSocket when used in workers. This wasn't safe.

* loader/DocumentWriter.cpp:
(WebCore::DocumentWriter::begin):
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::upgradeInsecureRequestIfNeeded const):
(WebCore::ContentSecurityPolicy::setUpgradeInsecureRequests):
(WebCore::ContentSecurityPolicy::takeNavigationRequestsToUpgrade):
(WebCore::ContentSecurityPolicy::setInsecureNavigationRequestsToUpgrade):
* page/csp/ContentSecurityPolicy.h:

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

18 months agoAttempt to fix media control layout tests after <https://trac.webkit.org/changeset...
dbates@webkit.org [Tue, 27 Mar 2018 23:54:24 +0000 (23:54 +0000)]
Attempt to fix media control layout tests after <https://trac.webkit.org/changeset/230006/>
(https://bugs.webkit.org/show_bug.cgi?id=179983)

Exempt elements in user agent shadow DOM from having to perform a potentially CORS-
enabled fetch for a mask image to try to fix the following tests from timing out:
    media/modern-media-controls/media-controller/media-controller-inline-to-fullscreen-to-inline.html
    media/modern-media-controls/media-controller/media-controller-inline-to-fullscreen-to-pip-to-inline.html

* style/StylePendingResources.cpp:
(WebCore::Style::loadPendingImage):

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

18 months agoThe layout test fast/canvas/webgl/read-pixels-test.html is timing out.
pvollan@apple.com [Tue, 27 Mar 2018 23:39:40 +0000 (23:39 +0000)]
The layout test fast/canvas/webgl/read-pixels-test.html is timing out.
https://bugs.webkit.org/show_bug.cgi?id=183923
<rdar://problem/38756869>

Reviewed by Brent Fulgham.

Source/WebCore:

The test is timing out when we do not interact directly with the WindowServer, causing
OpenGL to fall back to software rendering. In this mode, any call to CGLChoosePixelFormat
requesting an accelerated pixel format will fail because it cannot determine which GPU is
connected to the display.

OpenGL treats all GPUs as if they were offline when used in a process (like the WebContent
process) that does not directly control the display.

We can get correct behavior if we tell OpenGL which GPU is currently connected to the
display, and if we instruct CGLChoosePixelFormat to create an offline renderer pixel format
by including the 'kCGLPFAAllowOfflineRenderers' flag in its arguments.

We can use CGLSetVirtualScreen with an OpenGL display mask that tells the OpenGL framework
which GPU it should use.

See https://developer.apple.com/library/content/technotes/tn2229/_index.html#//apple_ref/doc/uid/DTS40008924-CH1-SUBSECTION7
for details on how the virtual screen is found from the OpenGL display mask.

No new tests, covered by existing tests.

* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
(WebCore::setPixelFormat):
(WebCore::identifyAndSetCurrentGPU):
(WebCore::GraphicsContext3D::GraphicsContext3D):
(WebCore::GraphicsContext3D::setOpenGLDisplayMask):
(WebCore::GraphicsContext3D::allowOfflineRenderers):

Source/WebKit:

Send OpenGL display mask to the WebContent process when the display ID is changing.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::windowScreenDidChange):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::openGLDisplayMaskChanged):

Source/WTF:

Add compile guard for blocking of the WindowServer in the WebProcess.

* wtf/FeatureDefines.h:

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

18 months agoMove request checking out of PingLoad for future reuse in NetworkLoad
youenn@apple.com [Tue, 27 Mar 2018 23:26:35 +0000 (23:26 +0000)]
Move request checking out of PingLoad for future reuse in NetworkLoad
https://bugs.webkit.org/show_bug.cgi?id=183865

Reviewed by Chris Dumez.

Source/WebKit:

Introduce NetworkLoadChecker as a way to validate requests before sending them in the network process.
Validation encompasses: CORS checks, CSP and Content Extensions on both main request and redirected requests if any.

Make PingLoad use NetworkLoadChecker. Future patch should make NetworkLoad to use it as well whenever needed.

Make NetworkCORSPreflightChecker takes a CompletionHandler instead of a Function.
Ensure this callback is called even if preflight is not completed by returning a Canceled error.

* NetworkProcess/NetworkCORSPreflightChecker.cpp:
(WebKit::NetworkCORSPreflightChecker::~NetworkCORSPreflightChecker):
(WebKit::NetworkCORSPreflightChecker::returnResult):
(WebKit::NetworkCORSPreflightChecker::willPerformHTTPRedirection):
(WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
(WebKit::NetworkCORSPreflightChecker::didCompleteWithError):
* NetworkProcess/NetworkCORSPreflightChecker.h:
* NetworkProcess/NetworkLoadChecker.cpp: Added.
(WebKit::NetworkLoadChecker::NetworkLoadChecker):
(WebKit::NetworkLoadChecker::check):
(WebKit::NetworkLoadChecker::checkRedirection):
(WebKit::NetworkLoadChecker::returnError):
(WebKit::NetworkLoadChecker::checkRequest):
(WebKit::NetworkLoadChecker::checkCORSRequest):
(WebKit::NetworkLoadChecker::checkCORSRedirectedRequest):
(WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
(WebKit::NetworkLoadChecker::doesNotNeedCORSCheck const):
(WebKit::NetworkLoadChecker::contentSecurityPolicy const):
(WebKit::NetworkLoadChecker::contentExtensionsBackend):
(WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad):
* NetworkProcess/NetworkLoadChecker.h: Added.
(WebKit::NetworkLoadChecker::setCSPResponseHeaders):
(WebKit::NetworkLoadChecker::setContentExtensionRuleLists):
(WebKit::NetworkLoadChecker::url const):
(WebKit::NetworkLoadChecker::storedCredentialsPolicy const):
(WebKit::NetworkLoadChecker::isChecking const):
(WebKit::NetworkLoadChecker::isRedirected const):
* NetworkProcess/PingLoad.cpp:
(WebKit::PingLoad::PingLoad):
(WebKit::PingLoad::~PingLoad):
(WebKit::PingLoad::willPerformHTTPRedirection):
(WebKit::PingLoad::didReceiveChallenge):
(WebKit::PingLoad::wasBlocked):
(WebKit::PingLoad::cannotShowURL):
(WebKit::PingLoad::timeoutTimerFired):
(WebKit::PingLoad::currentURL const):
* NetworkProcess/PingLoad.h:
* WebKit.xcodeproj/project.pbxproj:

LayoutTests:

* http/wpt/beacon/cors/cors-preflight-cookie-expected.txt:
* http/wpt/beacon/cors/cors-preflight-cookie.html:

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

18 months agohttps://bugs.webkit.org/show_bug.cgi?id=183876
eric.carlson@apple.com [Tue, 27 Mar 2018 23:16:33 +0000 (23:16 +0000)]
https://bugs.webkit.org/show_bug.cgi?id=183876
<rdar://problem/38726459>

Unreviewed, fix for the test added in r229995 in the iOS simulator.

* TestWebKitAPI/Tests/WebKitCocoa/AVFoundationPreference.mm:
(TestWebKitAPI::AVFoundationPref::testWithPreference):

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

18 months ago[WebAuthN] Implement authenticatorGetAssertion
jiewen_tan@apple.com [Tue, 27 Mar 2018 22:42:45 +0000 (22:42 +0000)]
[WebAuthN] Implement authenticatorGetAssertion
https://bugs.webkit.org/show_bug.cgi?id=183881
<rdar://problem/37258628>

Reviewed by Brent Fulgham.

Source/WebCore:

This patch does the following few things:
1) It implements the spec: https://www.w3.org/TR/webauthn/#op-get-assertion as of 5 December 2017.
2) It tweaks encoding/decoding of PublicKeyCredentialRequestOptions such that options can be passed
between UI and Web processes.
3) It refines the way how LocalAuthenticator::makeCredential find intersection between
excludeCredentialDescriptorList and existing credentials in the authenticator, such that it is faster.
Basically, it takes the CredentialID from the list and treat it as an ASCII string and put it into a
HashSet<String>. It should not matter if a duplicated CredentialID is added. If the hash set is not
empty, the algorithm then queries Keychain for all CredentialIDs related to the current RP ID once.
For every queried CredentialID, the algorithm then treats it as an ASCII string as well and look for
a match in the hash set to produce the intersetction. The new way is also employed in
LocalAuthenticator::getAssertion as well.
4) It abstracts the way to produce authData and thus reorders a bit of code in
LocalAuthenticator::makeCredential.

Covered by API tests.

* Modules/webauthn/AuthenticatorManager.cpp:
(WebCore::AuthenticatorManager::create const):
(WebCore::AuthenticatorManager::discoverFromExternalSource const):
* Modules/webauthn/PublicKeyCredentialCreationOptions.h:
* Modules/webauthn/PublicKeyCredentialRequestOptions.h:
(WebCore::PublicKeyCredentialRequestOptions::encode const):
(WebCore::PublicKeyCredentialRequestOptions::decode):
* Modules/webauthn/cocoa/LocalAuthenticator.h:
* Modules/webauthn/cocoa/LocalAuthenticator.mm:
(WebCore::LocalAuthenticatorInternal::buildAuthData):
(WebCore::LocalAuthenticatorInternal::produceHashSet):
(WebCore::LocalAuthenticator::makeCredential):
(WebCore::LocalAuthenticator::getAssertion):
(WebCore::LocalAuthenticator::issueClientCertificate const):
* WebCore.xcodeproj/project.pbxproj:

Source/WebKit:

* Shared/WebPreferences.yaml:
* UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp:
(WebKit::WebCredentialsMessengerProxy::makeCredential):
(WebKit::WebCredentialsMessengerProxy::getAssertion):
(WebKit::WebCredentialsMessengerProxy::getAssertionReply):
* UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h:
* UIProcess/CredentialManagement/WebCredentialsMessengerProxy.messages.in:
* WebProcess/CredentialManagement/WebCredentialsMessenger.cpp:
(WebKit::WebCredentialsMessenger::getAssertion):
(WebKit::WebCredentialsMessenger::getAssertionReply):
* WebProcess/CredentialManagement/WebCredentialsMessenger.messages.in:

Tools:

* TestWebKitAPI/Tests/ios/LocalAuthenticator.mm:
(TestWebKitAPI::getTestKey):
(TestWebKitAPI::addTestKeyToKeychain):
(TestWebKitAPI::LAEvaluatePolicyFailedSwizzler::evaluatePolicyFailed):
(TestWebKitAPI::LAEvaluatePolicyPassedSwizzler::evaluatePolicyPassed):
(TestWebKitAPI::LAEvaluateAccessControlFailedSwizzler::LAEvaluateAccessControlFailedSwizzler):
(TestWebKitAPI::LAEvaluateAccessControlFailedSwizzler::evaluateAccessControlFailed):
(TestWebKitAPI::LAEvaluateAccessControlPassedSwizzler::LAEvaluateAccessControlPassedSwizzler):
(TestWebKitAPI::LAEvaluateAccessControlPassedSwizzler::evaluateAccessControlPassed):
(TestWebKitAPI::TEST):

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

18 months agoREGRESSION(r229937): WebDriver tests no longer run, test runner hangs when launching...
bburg@apple.com [Tue, 27 Mar 2018 22:36:29 +0000 (22:36 +0000)]
REGRESSION(r229937): WebDriver tests no longer run, test runner hangs when launching wpt web server
https://bugs.webkit.org/show_bug.cgi?id=184056
<rdar://problem/38925058>

Reviewed by Timothy Hatcher and Youenn Fablet.

Tools:

* Scripts/webkitpy/webdriver_tests/webdriver_w3c_web_server.py:
(WebDriverW3CWebServer.start):
The config key used in upstream WPT has changed from 'host' to 'browser_host'.

WebDriverTests:

* imported/w3c/config.json:
The config key used in upstream WPT has changed from 'host' to 'browser_host'.

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

18 months agoUpdate my email address in contributors.json and scripts
timothy@hatcher.name [Tue, 27 Mar 2018 22:30:22 +0000 (22:30 +0000)]
Update my email address in contributors.json and scripts
https://bugs.webkit.org/show_bug.cgi?id=184054

Patch by Timothy Hatcher <timothy@hatcher.name> on 2018-03-27

* Scripts/validate-committer-lists:
(CommitterListFromGit):
* Scripts/webkitpy/common/config/contributors.json:

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

18 months agoAvoid constructing SecurityOrigin objects from non-main threads
cdumez@apple.com [Tue, 27 Mar 2018 22:01:03 +0000 (22:01 +0000)]
Avoid constructing SecurityOrigin objects from non-main threads
https://bugs.webkit.org/show_bug.cgi?id=184024

Reviewed by Youenn Fablet.

Source/WebCore:

Avoid constructing SecurityOrigin objects from non-main threads as much as possible
as it is not safe. This patch gets rid of most offending cases but not all of them
yet, which is why I haven't added a ASSERT(isMainThread()) to the SecurityOrigin
constructor yet.

For example, ContentSecurityPolicy::upgradeInsecureRequestIfNeeded() currently
gets called from non-main threads and construct a SecurityOrigin. Fixing this
will require some refactoring that would have made this patch much larger.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::matchRegistration):
* page/EventSource.cpp:
(WebCore::EventSource::didReceiveResponse):
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::SecurityOrigin):
* page/SecurityOrigin.h:
(WebCore::SecurityOrigin::isPotentiallyTrustworthy const):
* testing/Internals.cpp:
(WebCore::Internals::hasServiceWorkerRegistration):
* workers/DedicatedWorkerGlobalScope.cpp:
(WebCore::DedicatedWorkerGlobalScope::create):
(WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
* workers/DedicatedWorkerGlobalScope.h:
* workers/DedicatedWorkerThread.cpp:
(WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
* workers/DedicatedWorkerThread.h:
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::WorkerGlobalScope):
* workers/WorkerGlobalScope.h:
* workers/WorkerLocation.cpp:
(WebCore::WorkerLocation::origin const):
* workers/WorkerThread.cpp:
(WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
(WebCore::WorkerThread::workerThread):
* workers/WorkerThread.h:
* workers/service/SWClientConnection.h:
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::getRegistration):
(WebCore::ServiceWorkerContainer::getRegistrations):
* workers/service/ServiceWorkerGlobalScope.cpp:
(WebCore::ServiceWorkerGlobalScope::create):
(WebCore::ServiceWorkerGlobalScope::ServiceWorkerGlobalScope):
* workers/service/ServiceWorkerGlobalScope.h:
* workers/service/ServiceWorkerProvider.cpp:
(WebCore::ServiceWorkerProvider::mayHaveServiceWorkerRegisteredForOrigin):
* workers/service/ServiceWorkerProvider.h:
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::createWorkerGlobalScope):
(WebCore::fireMessageEvent):
(WebCore::ServiceWorkerThread::postMessageToServiceWorker):
* workers/service/context/ServiceWorkerThread.h:

Source/WebKit:

Avoid constructing SecurityOrigin objects from non-main threads as much as possible.

* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::mayHaveServiceWorkerRegisteredForOrigin const):
(WebKit::WebSWClientConnection::matchRegistration):
(WebKit::WebSWClientConnection::getRegistrations):
* WebProcess/Storage/WebSWClientConnection.h:
* WebProcess/Storage/WebSWOriginTable.cpp:
(WebKit::WebSWOriginTable::contains const):
* WebProcess/Storage/WebSWOriginTable.h:

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

18 months agoRemove unused libsoup ResourceHandle implementation
achristensen@apple.com [Tue, 27 Mar 2018 21:16:41 +0000 (21:16 +0000)]
Remove unused libsoup ResourceHandle implementation
https://bugs.webkit.org/show_bug.cgi?id=184048

Reviewed by Michael Catanzaro.

This code is unused since r228901 so let's remove it!

* platform/network/ResourceHandle.h:
* platform/network/ResourceHandleInternal.h:
(WebCore::ResourceHandleInternal::ResourceHandleInternal):
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::ResourceHandle::~ResourceHandle):
(WebCore::ResourceHandleInternal::soupSession):
(WebCore::ResourceHandle::cancelledOrClientless):
(WebCore::ResourceHandle::ensureReadBuffer):
(WebCore::ResourceHandle::currentStreamPosition const):
(WebCore::ResourceHandle::platformContinueSynchronousDidReceiveResponse):
(WebCore::ResourceHandle::didStartRequest):
(WebCore::ResourceHandle::start):
(WebCore::ResourceHandle::releaseForDownload):
(WebCore::ResourceHandle::sendPendingRequest):
(WebCore::ResourceHandle::cancel):
(WebCore::ResourceHandle::shouldUseCredentialStorage):
(WebCore::ResourceHandle::continueDidReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
(WebCore::ResourceHandle::receivedCredential):
(WebCore::ResourceHandle::receivedCancellation):
(WebCore::ResourceHandle::receivedChallengeRejection):
(WebCore::ResourceHandle::platformSetDefersLoading):
(WebCore::sessionFromContext): Deleted.
(WebCore::ResourceHandle::create): Deleted.
(WebCore::ResourceHandle::ResourceHandle): Deleted.
(WebCore::isAuthenticationFailureStatusCode): Deleted.
(WebCore::tlsErrorsChangedCallback): Deleted.
(WebCore::gotHeadersCallback): Deleted.
(WebCore::applyAuthenticationToRequest): Deleted.
(WebCore::restartedCallback): Deleted.
(WebCore::shouldRedirect): Deleted.
(WebCore::shouldRedirectAsGET): Deleted.
(WebCore::continueAfterWillSendRequest): Deleted.
(WebCore::doRedirect): Deleted.
(WebCore::redirectSkipCallback): Deleted.
(WebCore::wroteBodyDataCallback): Deleted.
(WebCore::cleanupSoupRequestOperation): Deleted.
(WebCore::nextMultipartResponsePartCallback): Deleted.
(WebCore::sendRequestCallback): Deleted.
(WebCore::continueAfterDidReceiveResponse): Deleted.
(WebCore::startingCallback): Deleted.
(WebCore::networkEventCallback): Deleted.
(WebCore::createSoupMessageForHandleAndRequest): Deleted.
(WebCore::createSoupRequestAndMessageForHandle): Deleted.
(WebCore::ResourceHandle::timeoutFired): Deleted.
(WebCore::waitingToSendRequest): Deleted.
(WebCore::readCallback): Deleted.

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

18 months agoMove online state detection from the WebProcess to the NetworkProcess
cdumez@apple.com [Tue, 27 Mar 2018 21:02:25 +0000 (21:02 +0000)]
Move online state detection from the WebProcess to the NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=183989
<rdar://problem/37093299>

Reviewed by Youenn Fablet.

Source/WebCore:

Move online state detection from the WebProcess to the NetworkProcess. This avoid executing the same (expensive) code in
EACH web process whenever a network interface's state changes. Now, the Network Process monitors network interfaces
and determines the online state whenever an interface's state changes. If the onLine state changes, it notifies all
its connected WebProcesses via IPC.

* inspector/agents/InspectorApplicationCacheAgent.cpp:
(WebCore::InspectorApplicationCacheAgent::networkStateChanged):
* loader/LoaderStrategy.h:
* page/Navigator.cpp:
(WebCore::Navigator::onLine const):
* page/Page.cpp:
* platform/network/NetworkStateNotifier.h:
* workers/Worker.cpp:
(WebCore::Worker::Worker):
(WebCore::Worker::notifyFinished):
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::ServiceWorkerThread):
* workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):

Source/WebKit:

Move online state detection from the WebProcess to the NetworkProcess. This avoid executing the same (expensive) code in
EACH web process whenever a network interface's state changes. Now, the Network Process monitors network interfaces
and determines the online state whenever an interface's state changes. If the onLine state changes, it notifies all
its connected WebProcesses via IPC.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::setOnLineState):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::NetworkProcess):
(WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::setOnLineState):
* WebProcess/Network/NetworkProcessConnection.h:
* WebProcess/Network/NetworkProcessConnection.messages.in:
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::isOnLine const):
(WebKit::WebLoaderStrategy::addOnlineStateChangeListener):
(WebKit::WebLoaderStrategy::setOnLineState):
* WebProcess/Network/WebLoaderStrategy.h:

Source/WebKitLegacy:

No change on WebKit1 except that WebResourceLoadScheduler needs to override
2 new virtual functions which forward the calls to the NetworkStateNotifier.

* WebCoreSupport/WebResourceLoadScheduler.cpp:
(WebResourceLoadScheduler::isOnLine const):
(WebResourceLoadScheduler::addOnlineStateChangeListener):
* WebCoreSupport/WebResourceLoadScheduler.h:

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

18 months agoCSS mask images should be retrieved using potentially CORS-enabled fetch
dbates@webkit.org [Tue, 27 Mar 2018 20:56:09 +0000 (20:56 +0000)]
CSS mask images should be retrieved using potentially CORS-enabled fetch
https://bugs.webkit.org/show_bug.cgi?id=179983
<rdar://problem/35678149>

Reviewed by Brent Fulgham.

Source/WebCore:

As per <https://drafts.fxtf.org/css-masking-1/#priv-sec> (Editor’s Draft, 23 December 2017)
we should fetch CSS mask images using a potentially CORS-enabled fetch.

Both cross-origin CSS shape-outside images and CSS mask images may be sensitive to timing
attacks that can be used to reveal their pixel data when retrieved without regard to CORS.
For the same reason that we fetch CSS shape-outside images using a potentially CORS-enabled
fetch we should fetch CSS mask the same way. This also makes the behavior of WebKit more
closely align with the behavior in the spec.

Test: http/tests/security/css-mask-image.html

* page/Settings.yaml: Add a setting for toggle "Anonymous" mode fetching of mask images (defaults: true).
We need this setting to avoid breaking the developer convenience feature that some modern media controls
layout tests employ to load assets from the filesystem as opposed to using the hardcoded data URLs baked
into the WebKit binary.
* style/StylePendingResources.cpp: Substitute LoadPolicy::NoCORS and LoadPolicy::Anonymous for
LoadPolicy::Normal and LoadPolicy::ShapeOutside, respectively, to match the terminology used
in the HTML, CSS Shapes Module Level 1, and CSS Masking Module Level 1 specs.
(WebCore::Style::loadPendingImage): Ditto.
(WebCore::Style::loadPendingResources): Use load policy LoadPolicy::Anonymous when fetching
a mask image or shape-outside image.

LayoutTests:

Add a test to ensure we do not fetch a cross-origin CSS mask image that does
not allow CORS access.

* http/tests/security/css-mask-image-expected.html: Added.
* http/tests/security/css-mask-image.html: Added.
* http/tests/security/resources/black-square.png: Added.
* http/tests/security/resources/fail-mask.png: Added.
* media/modern-media-controls/resources/media-controls-loader.js: Disable "Anonymous" mode
fetching of mask images to allow modern media controls to load mask assets from the filesystem.

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

18 months agomemoryStatus() is wrong in certain testing scenarios on iOS
sbarati@apple.com [Tue, 27 Mar 2018 20:52:35 +0000 (20:52 +0000)]
memoryStatus() is wrong in certain testing scenarios on iOS
https://bugs.webkit.org/show_bug.cgi?id=184050
<rdar://problem/37959258>

Rubber-stamped by Mark Lam.

This switches us from using "phys_footprint" to using "internal + compressed"
when computing the dirty memory in the current process. There are iOS testing
scenarios where phys_footprint doesn't give us a reliable answer. In my testing,
"internal + compressed" tracks phys_footprint closely (when phys_footprint is
working). They're usually within much less than 1% of each other. We're making
this change to ensure testing in our iOS infrastructure is valid.

I opened a bug to move back to phys_footprint when it's feasible:
https://bugs.webkit.org/show_bug.cgi?id=184050

* bmalloc/AvailableMemory.cpp:
(bmalloc::memoryStatus):

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

18 months agoRenderBox::parent/firstChild/nextSibling/previousSiblingBox() functions should type...
zalan@apple.com [Tue, 27 Mar 2018 20:51:06 +0000 (20:51 +0000)]
RenderBox::parent/firstChild/nextSibling/previousSiblingBox() functions should type check.
https://bugs.webkit.org/show_bug.cgi?id=184032
<rdar://problem/38384984>

Reviewed by Antti Koivisto.

Source/WebCore:

We cannot rely on the correctness of the render tree structure when querying for parent/child/next and previous
sibling since some features (multicolumn/spanners) move subtrees out of their original position (which is highly
undesired and should not be encouraged at all though).
It should also be noted that these functions are not equivalent of typeOfChildren<RenderBox> and the following usage
    for (auto* boxChild = firstChildBox(); boxChild; boxChild = boxChild->nextSiblingBox())
can lead to unexpected result.

Test: fast/multicol/parent-box-when-spanner-is-present.html

* rendering/RenderBox.h:
(WebCore::RenderBox::parentBox const):
(WebCore::RenderBox::firstChildBox const):
(WebCore::RenderBox::lastChildBox const):
(WebCore::RenderBox::previousSiblingBox const):
(WebCore::RenderBox::nextSiblingBox const):
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::positionListMarker):
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::layout):
* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::updateLogicalWidth):

LayoutTests:

* fast/multicol/parent-box-when-spanner-is-present-expected.txt: Added.
* fast/multicol/parent-box-when-spanner-is-present.html: Added.

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

18 months ago[Extra zoom mode] Add support for new focused form control overlay behaviors
wenson_hsieh@apple.com [Tue, 27 Mar 2018 20:49:06 +0000 (20:49 +0000)]
[Extra zoom mode] Add support for new focused form control overlay behaviors
https://bugs.webkit.org/show_bug.cgi?id=184043
<rdar://problem/38758727>

Reviewed by Tim Horton.

See below for more details.

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

Suppress focused form control navigation while the scroll view is undergoing a scroll or zoom animation (e.g.,
when moving from one focused form control to another).

(-[WKContentView textInputController:didCommitText:withSuggestion:]):

When dismissing an input view controller, allow focused form control navigation only after updating assisted
node information to ensure that focus rects aren't stale as the user begins to navigate between forms.

(-[WKContentView rectForFocusedFormControlController:inCoordinateSpace:]):
(-[WKContentView nextRectForFocusedFormControlController:inCoordinateSpace:]):
(-[WKContentView previousRectForFocusedFormControlController:inCoordinateSpace:]):
(-[WKContentView scrollViewForFocusedFormControlController:]):
(-[WKContentView highlightedRectForFocusedFormControlController:inCoordinateSpace:]): Deleted.

Implement some new focused form overlay delegate hooks to vend the scroll view, as well as the rects of next and
previous focusable form controls.

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

18 months agoFurther refine cookie read/write logging
bfulgham@apple.com [Tue, 27 Mar 2018 20:27:55 +0000 (20:27 +0000)]
Further refine cookie read/write logging
https://bugs.webkit.org/show_bug.cgi?id=184044
<rdar://problem/38915610>

Reviewed by Chris Dumez.

Source/WebCore:

Export 'shouldBlockCookies' so that it can be accessed by the WebKit framework.

* platform/network/NetworkStorageSession.h:

Source/WebKit:

Cookie logging was passing the partition, rather than the first party, when logging, which
prevented logging in cases where partitioning or blocking was active. This patch corrects
these calls so that logging is generated in these cases, too.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::cookiesForDOM): Call log routines if needed.
(WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM): Ditto.
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::escapeIDForJSON): Make available to use in multiple functions.
(WebKit::NetworkResourceLoader::logCookieInformation const): Revise to use shared
convenience functions.
(WebKit::logBlockedCookieInformation): Added.
(WebKit::logCookieInformationInternal): Added.
(WebKit::NetworkResourceLoader::logCookieInformation): Revise to use shared
convenience functions.
* NetworkProcess/NetworkResourceLoader.h:

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

18 months agoWeb Inspector: Command-Shift-left/right arrow keys should not switch tabs when focuse...
nvasilyev@apple.com [Tue, 27 Mar 2018 19:30:59 +0000 (19:30 +0000)]
Web Inspector: Command-Shift-left/right arrow keys should not switch tabs when focused on color picker text fields
https://bugs.webkit.org/show_bug.cgi?id=184028

Reviewed by Timothy Hatcher.

* UserInterface/Views/EditingSupport.js:
(WI.isEventTargetAnEditableField):
Detect <input type="number"> as an editable text field.

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

18 months ago[Web Animations] Stop using internals.pauseAnimationAtTimeOnElement() in favor of...
graouts@webkit.org [Tue, 27 Mar 2018 19:19:46 +0000 (19:19 +0000)]
[Web Animations] Stop using internals.pauseAnimationAtTimeOnElement() in favor of Web Animations API for animations tests
https://bugs.webkit.org/show_bug.cgi?id=184038

Reviewed by Dean Jackson.

Source/WebCore:

Expose a new method to indicate that the runtime flag for CSS Animations and CSS Transitions as Web Animations is enabled.

* testing/InternalSettings.cpp:
(WebCore::InternalSettings::cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:

LayoutTests:

Make 48 tests opt into CSS Animations and CSS Transitions as Web Animations. These tests used the internals.pauseAnimationAtTimeOnElement()
method, but this method should be going away since the Web Animations API allows seeking and pausing. To support this, we make
animation-test-helpers.js use the Web Animations API instead of internals.pauseAnimationAtTimeOnElement() if the tests has opted
into CSS Animations and CSS Transitions as Web Animations and we know it's safe to use these APIs.

* animations/3d/matrix-transform-type-animation.html:
* animations/3d/transform-perspective.html:
* animations/animation-callback-timestamp.html:
* animations/animation-direction-reverse-hardware-opacity.html:
* animations/animation-direction-reverse-hardware.html:
* animations/animation-direction-reverse-non-hardware.html:
* animations/animation-direction-reverse-timing-functions-hardware.html:
* animations/animation-direction-reverse-timing-functions.html:
* animations/animation-direction.html:
* animations/animation-hit-test.html:
* animations/animation-offscreen-to-onscreen.html:
* animations/change-keyframes-expected.txt:
* animations/change-keyframes.html:
* animations/cross-fade-background-image.html:
* animations/cross-fade-border-image-source.html:
* animations/cross-fade-list-style-image.html:
* animations/cross-fade-webkit-mask-box-image.html:
* animations/duplicate-keys-expected.html:
* animations/duplicate-keys.html:
* animations/font-variations/font-stretch.html:
* animations/font-variations/font-style.html:
* animations/font-variations/font-variation-settings-order.html:
* animations/font-variations/font-variation-settings-unlike.html:
* animations/font-variations/font-variation-settings.html:
* animations/font-variations/font-weight.html:
* animations/generic-from-to.html:
* animations/import.html:
* animations/keyframe-multiple-timing-functions-transform.html:
* animations/keyframes-comma-separated.html:
* animations/keyframes-infinite-iterations.html:
* animations/keyframes-invalid-keys.html:
* animations/keyframes-out-of-order.html:
* animations/keyframes.html:
* animations/longhand-timing-function.html:
* animations/matrix-anim.html:
* animations/missing-keyframe-properties-repeating.html:
* animations/missing-keyframe-properties.html:
* animations/missing-values-first-keyframe.html:
* animations/missing-values-last-keyframe.html:
* animations/multiple-animations-timing-function.html:
* animations/multiple-animations.html:
* animations/multiple-keyframes.html:
* animations/negative-delay.html:
* animations/pause-crash.html:
* animations/resources/animation-test-helpers.js:
(checkExpectedValue):
(pauseAnimationAtTimeOnElement):
(startTest):
(runAnimationTest):
* animations/simultaneous-start-left.html:
* animations/spring-function.html:
* animations/stacking-context-unchanged-while-running.html:
* animations/timing-functions.html:
* animations/unanimated-style.html:
* animations/unprefixed-keyframes.html:

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

18 months agoMark some CSS animations tests as failing on Windows.
pvollan@apple.com [Tue, 27 Mar 2018 19:02:19 +0000 (19:02 +0000)]
Mark some CSS animations tests as failing on Windows.
https://bugs.webkit.org/show_bug.cgi?id=183953

Unreviewed test gardening.

* platform/win/TestExpectations:

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

18 months agoWeb Automation: support enter/exit fullscreen and hide/restore window operations
bburg@apple.com [Tue, 27 Mar 2018 16:37:43 +0000 (16:37 +0000)]
Web Automation: support enter/exit fullscreen and hide/restore window operations
https://bugs.webkit.org/show_bug.cgi?id=182837
<rdar://problem/37580732>

Reviewed by Tim Horton.

The W3C specification is more explicit about when to exit fullscreen and
restore the window for a browsing context. So, WebKit needs to have support
for performing these operations on behalf of a driver.

Based on prototyping, it is sufficient to use a JavaScript atom to enter
fullscreen mode. This is included in the patch as EnterFullscreen.js and
can be used to implement the §10.7.5 Fullscreen Window command.

Other window operations cannot be peformed from JavaScript, so we need to
delegate these operations to the session client (i.e., Safari).
This patch adds session client callouts for restoring, minimizing, and
switching to a browsing context.

Exiting fullscreen happens implicitly (per specification) when setting a
window frame without an actual frame, or when switching/restoring/minimizing a window.
If needed, a driver can call Set Window Rect in this way to unfullscreen a context.
Similarly, a driver can restore a minimized window using Set Window Rect.

* UIProcess/API/APIAutomationSessionClient.h:
(API::AutomationSessionClient::requestHideWindowOfPage):
(API::AutomationSessionClient::requestRestoreWindowOfPage):
(API::AutomationSessionClient::requestSwitchToPage):
Add new API client methods.

* UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
Add new Cocoa API delegate methods.

* UIProcess/Automation/Automation.json:
Make the switch to browsing context command asynchronous, since this functionality
is not always synchronous, and we prefer to use completion handlers in the delegates.

Add new protocol method for hiding the window of a browsing context.
This is expected to minimize/miniaturize a window for desktop window managers.

* UIProcess/Automation/WebAutomationSession.h:
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::switchToBrowsingContext):
Make this function asynchronous. Call out to the session client.

(WebKit::WebAutomationSession::setWindowFrameOfBrowsingContext):
Follow the steps in the specification to restore window and exit fullscreen.

(WebKit::WebAutomationSession::hideWindowOfBrowsingContext):
Exit fullscreen and call out to the session client.

(WebKit::WebAutomationSession::exitFullscreenWindowForPage):
This is a little strange. Because there is no async API for exiting fullscreen
from C++ code, we hook into willEnterFullScreen and didExitFullScreen and send
out the response if the page exited fullscreen after we requested it to do so.
Because the W3C specification mandates that drivers only process one command at
a time, there will only ever be one callback installed by this method at a time.

(WebKit::WebAutomationSession::restoreWindowForPage):
(WebKit::WebAutomationSession::hideWindowForPage):
Call out to the session client.

(WebKit::WebAutomationSession::didEnterFullScreenForPage):
(WebKit::WebAutomationSession::didExitFullScreenForPage):
Add methods to be called by instrumentation hooks in WebFullScreenManagerProxy.

* UIProcess/Automation/atoms/EnterFullscreen.js: Added.
(enterFullscreen):

* UIProcess/Cocoa/AutomationSessionClient.h:
* UIProcess/Cocoa/AutomationSessionClient.mm:
(WebKit::AutomationSessionClient::AutomationSessionClient):
(WebKit::AutomationSessionClient::requestSwitchToPage):
(WebKit::AutomationSessionClient::requestHideWindowOfPage):
(WebKit::AutomationSessionClient::requestRestoreWindowOfPage):
(WebKit::AutomationSessionClient::isShowingJavaScriptDialogOnPage):
Add boilerplate to convert C++ API client to Objective-C delegate methods.

* UIProcess/WebFullScreenManagerProxy.cpp:
(WebKit::WebFullScreenManagerProxy::didEnterFullScreen):
(WebKit::WebFullScreenManagerProxy::didExitFullScreen):
Notify the automation session if the page is under automation and
enters or exits fullscreen.

* WebKit.xcodeproj/project.pbxproj:
Add EnterFullscreen.js to the list of WebDriver atoms. These are copied
as WebKit2 private headers and used by driver implementations.

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

18 months ago[GStreamer] Enhance debugging in the BasePlayer
commit-queue@webkit.org [Tue, 27 Mar 2018 16:25:52 +0000 (16:25 +0000)]
[GStreamer] Enhance debugging in the BasePlayer
https://bugs.webkit.org/show_bug.cgi?id=184035

Patch by Thibault Saunier <tsaunier@igalia.com> on 2018-03-27
Reviewed by Philippe Normand.

No behaviour changes so no test were added/enabled.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
(WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
(WebCore::MediaPlayerPrivateGStreamerBase::naturalSize const):
(WebCore::MediaPlayerPrivateGStreamerBase::setVolume):
(WebCore::MediaPlayerPrivateGStreamerBase::volumeChangedCallback):
(WebCore::MediaPlayerPrivateGStreamerBase::setMuted):
(WebCore::MediaPlayerPrivateGStreamerBase::muted const):
(WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
(WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
(WebCore::MediaPlayerPrivateGStreamerBase::setStreamVolumeElement):
(WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceAttached):
(WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceDetached):
(WebCore::MediaPlayerPrivateGStreamerBase::dispatchDecryptionKey):
(WebCore::MediaPlayerPrivateGStreamerBase::handleProtectionEvent):

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

18 months agoAdd Load16Z for B3 and use it in WebAssembly
utatane.tea@gmail.com [Tue, 27 Mar 2018 16:21:19 +0000 (16:21 +0000)]
Add Load16Z for B3 and use it in WebAssembly
https://bugs.webkit.org/show_bug.cgi?id=165884

Reviewed by JF Bastien.

We already support Load16Z in B3. Use it for i32.load16_u / i64.load16_u in WebAssembly.
spec-tests/memory.wast.js already covered this change.

* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::emitLoadOp):

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

18 months agoMake AVFoundationEnabled preference available on iOS
eric.carlson@apple.com [Tue, 27 Mar 2018 11:39:53 +0000 (11:39 +0000)]
Make AVFoundationEnabled preference available on iOS
https://bugs.webkit.org/show_bug.cgi?id=183876
<rdar://problem/38726459>

Reviewed by Youenn Fablet.

Source/WebCore:

Test: AVFoundationPref API test.

* html/HTMLAudioElement.idl: There is no need for a runtime setting to enable/disable audio,
there is already settings.mediaEnabled.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::prepareForLoad): Fail if there are no media engines registered.
(WebCore::HTMLMediaElement::noneSupported): Return early if m_error has already been set.
(WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture): Remove a typo.

* page/RuntimeEnabledFeatures.cpp:
(WebCore::RuntimeEnabledFeatures::audioEnabled const): Deleted.
* page/RuntimeEnabledFeatures.h:

Source/WebKit:

* Shared/WebPreferences.yaml: Set AVFoundationEnabled with DEFAULT_AVFOUNDATION_ENABLED.
* Shared/WebPreferencesDefaultValues.h:

* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _setAVFoundationEnabled:]): Enable for iOS.
(-[WKPreferences _avFoundationEnabled]): Ditto.
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit/video.html: Added.
* TestWebKitAPI/Tests/WebKitCocoa/AVFoundationPreference.mm: Added.
(-[PreferenceTestMessageHandler userContentController:didReceiveScriptMessage:]):
(TestWebKitAPI::AVFoundationPref::SetUp):
(TestWebKitAPI::AVFoundationPref::testWithPreference):
(TestWebKitAPI::TEST_F):

LayoutTests:

* media/media-error-fired-once-expected.txt: Added.
* media/media-error-fired-once.html: Added.

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

18 months ago[GTK] Layout test editing/deleting/delete-surrogatepair.html crashing with CRITICAL...
Hironori.Fujii@sony.com [Tue, 27 Mar 2018 10:10:41 +0000 (10:10 +0000)]
[GTK] Layout test editing/deleting/delete-surrogatepair.html crashing with CRITICAL **: enchant_dict_check: assertion 'g_utf8_validate(word, len, NULL)' failed
https://bugs.webkit.org/show_bug.cgi?id=176799

Reviewed by Carlos Garcia Campos.

Source/WebCore:

The length of a surrogate-pair UTF-16 character is 2 even though
the number of characters is 1. An incorrect string length was
passed to enchant_dict_check if the string contains a
surrogate-pair character because the length was calculated by
applying UTF-16 character position to UTF-8 string.

No new tests (Covered by existing tests).

* platform/text/enchant/TextCheckerEnchant.cpp:
(WebCore::TextCheckerEnchant::checkSpellingOfWord): Changed the
type of an argument `word` from CString to String. Convert a
substring of the argument into UTF-8.
(WebCore::TextCheckerEnchant::checkSpellingOfString): Pass the
original UTF-16 string to checkSpellingOfWord instead of a
converted UTF-8 string.
* platform/text/enchant/TextCheckerEnchant.h: Changed the type of
an argument `word` from CString to String.

LayoutTests:

* platform/gtk/TestExpectations: Unmarked editing/deleting/delete-surrogatepair.html.

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

18 months ago[JSC] Remove repeated iteration of ElementNode
utatane.tea@gmail.com [Tue, 27 Mar 2018 08:49:41 +0000 (08:49 +0000)]
[JSC] Remove repeated iteration of ElementNode
https://bugs.webkit.org/show_bug.cgi?id=183987

Reviewed by Keith Miller.

BytecodeGenerator repeatedly iterates ElementNode to emit the efficient code.
While it is OK for small arrays, this repeated iteration takes much time
if the array is very large. For example, Kraken's initialization code includes
very large array with numeric literals. This makes bytecode compiling so long.

This patch carefully removes unnecessary iteration when emitting arrays.
This reduces one of Kraken/imaging-darkroom's bytecode compiling from 13.169856 ms
to 9.988050 ms.

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitNewArrayBuffer):
(JSC::BytecodeGenerator::emitNewArray):
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::ArrayNode::emitBytecode):
(JSC::ArrayPatternNode::bindValue const):
(JSC::ArrayPatternNode::emitDirectBinding):

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

18 months agoRemove an unnecessary const_cast from BitmapTextureGL::updateContents().
Ms2ger@igalia.com [Tue, 27 Mar 2018 06:59:12 +0000 (06:59 +0000)]
Remove an unnecessary const_cast from BitmapTextureGL::updateContents().
https://bugs.webkit.org/show_bug.cgi?id=184007

Reviewed by Žan Doberšek.

No new tests.

* platform/graphics/texmap/BitmapTextureGL.cpp:
(WebCore::BitmapTextureGL::updateContents):

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

18 months agoAdopt WK_ALTERNATE_FRAMEWORKS_DIR in WebKit
timothy_horton@apple.com [Tue, 27 Mar 2018 04:07:40 +0000 (04:07 +0000)]
Adopt WK_ALTERNATE_FRAMEWORKS_DIR in WebKit
https://bugs.webkit.org/show_bug.cgi?id=184030
<rdar://problem/38895281>

Reviewed by Dan Bernstein.

* Configurations/Base.xcconfig:
Source/WebKit:

* Configurations/BaseTarget.xcconfig:
* Configurations/WebKit.xcconfig:

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

18 months agoAdd and adopt HAVE(CORE_ANIMATION_RENDER_SERVER)
timothy_horton@apple.com [Mon, 26 Mar 2018 22:28:39 +0000 (22:28 +0000)]
Add and adopt HAVE(CORE_ANIMATION_RENDER_SERVER)
https://bugs.webkit.org/show_bug.cgi?id=184026
<rdar://problem/38883321>

Reviewed by Sam Weinig.

Source/WebKit:

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _takeViewSnapshot]):
(-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):

Source/WTF:

* wtf/Platform.h:

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

18 months agoJIT callOperation() needs to support operations that return SlowPathReturnType differ...
ross.kirsling@sony.com [Mon, 26 Mar 2018 21:41:13 +0000 (21:41 +0000)]
JIT callOperation() needs to support operations that return SlowPathReturnType differently on Windows.
https://bugs.webkit.org/show_bug.cgi?id=183655

Reviewed by Keith Miller.

* jit/CCallHelpers.h:
(JSC::CCallHelpers::ArgCollection::argCount):
(JSC::CCallHelpers::marshallArgumentRegister):
(JSC::CCallHelpers::setupArgumentsImpl):
On Win64, ensure that argCount always includes GPRs and FPRs and that counting starts from 1 for SlowPathReturnType.

* jit/JIT.h:
(JSC::JIT::callOperation):
(JSC::JIT::is64BitType):
(JSC::JIT::is64BitType<void>):
On Win64, ensure special call is used for SlowPathReturnType.

* jit/JITOperations.h:
Update changed type.

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

18 months agoWe should have SSE4 detection in the X86 MacroAssembler.
utatane.tea@gmail.com [Mon, 26 Mar 2018 21:07:21 +0000 (21:07 +0000)]
We should have SSE4 detection in the X86 MacroAssembler.
https://bugs.webkit.org/show_bug.cgi?id=165363

Reviewed by JF Bastien.

Source/JavaScriptCore:

This patch adds popcnt support to WASM in x86_64 environment.
To use it, we refactor our CPUID feature detection in MacroAssemblerX86Common.
Our spec-tests already cover popcnt.

* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::supportsCountPopulation):
* assembler/MacroAssemblerX86Common.cpp:
(JSC::MacroAssemblerX86Common::getCPUID):
(JSC::MacroAssemblerX86Common::getCPUIDEx):
(JSC::MacroAssemblerX86Common::collectCPUFeatures):
* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::countPopulation32):
(JSC::MacroAssemblerX86Common::supportsFloatingPointRounding):
(JSC::MacroAssemblerX86Common::supportsCountPopulation):
(JSC::MacroAssemblerX86Common::supportsAVX):
(JSC::MacroAssemblerX86Common::supportsLZCNT):
(JSC::MacroAssemblerX86Common::supportsBMI1):
(JSC::MacroAssemblerX86Common::isSSE2Present):
(JSC::MacroAssemblerX86Common::updateEax1EcxFlags): Deleted.
* assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::countPopulation64):
* assembler/X86Assembler.h:
(JSC::X86Assembler::popcnt_rr):
(JSC::X86Assembler::popcnt_mr):
(JSC::X86Assembler::popcntq_rr):
(JSC::X86Assembler::popcntq_mr):
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::addOp<OpType::I32Popcnt>):
(JSC::Wasm::B3IRGenerator::addOp<OpType::I64Popcnt>):

Source/WTF:

GCC 5 supports clobbering PIC registers in inline ASM [1,2].

[1]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47602
[2]: https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=216154

* wtf/Atomics.h:
(WTF::x86_cpuid):

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

18 months agoDFG should know that CreateThis can be effectful
fpizlo@apple.com [Mon, 26 Mar 2018 21:01:16 +0000 (21:01 +0000)]
DFG should know that CreateThis can be effectful
https://bugs.webkit.org/show_bug.cgi?id=184013

Reviewed by Saam Barati.

JSTests:

* stress/create-this-property-change.js: Added.
(Foo):
(RealBar):
(get if):
* stress/create-this-structure-change-without-cse.js: Added.
(Foo):
(RealBar):
(get if):
* stress/create-this-structure-change.js: Added.
(Foo):
(RealBar):
(get if):

Source/JavaScriptCore:

As shown in the tests added in JSTests, CreateThis can be effectful if the constructor this
is a proxy.

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

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

18 months ago[Extra zoom mode] Refactor input view controller presentation and dismissal helpers
wenson_hsieh@apple.com [Mon, 26 Mar 2018 21:00:30 +0000 (21:00 +0000)]
[Extra zoom mode] Refactor input view controller presentation and dismissal helpers
https://bugs.webkit.org/show_bug.cgi?id=184020
Work towards <rdar://problem/38758727>

Reviewed by Tim Horton.

We currently have separate presentation and dismissal helpers for each type of view controller corresponding to
a focused element type. This is excessive, considering that all of these helpers are only invoked from one place
(either -presentViewControllerForCurrentAssistedNode or -dismissAllInputViewControllers), with the exception of
the focused form control overlay.

This refactoring allows us to then adjust the timing of first responder restoration logic, such that the focused
form control view controller can receive forwarded events from the web view. See below for more detail.

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

Remove logic to restore the web view as first responder.

(-[WKContentView presentViewControllerForCurrentAssistedNode]):
(-[WKContentView dismissAllInputViewControllers]):

Restore first responder after dismissing a view controller that was presented when focusing a form control, only
if the web view was first responder before presentation.

(-[WKContentView presentDatePickerViewController:]): Deleted.
(-[WKContentView dismissDatePickerViewController:]): Deleted.
(-[WKContentView presentTimePickerViewController:]): Deleted.
(-[WKContentView dismissTimePickerViewController:]): Deleted.
(-[WKContentView presentSelectMenuViewController:]): Deleted.
(-[WKContentView dismissSelectMenuViewController:]): Deleted.
(-[WKContentView dismissNumberPadViewController:]): Deleted.
(-[WKContentView presentNumberPadViewController:]): Deleted.
(-[WKContentView presentTextInputViewController:]): Deleted.
(-[WKContentView dismissTextInputViewController:]): Deleted.

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

18 months ago[ASan] Allow Ref<> to be swapped
graouts@webkit.org [Mon, 26 Mar 2018 20:16:48 +0000 (20:16 +0000)]
[ASan] Allow Ref<> to be swapped
https://bugs.webkit.org/show_bug.cgi?id=184017
<rdar://problem/36336787>

Reviewed by JF Bastien.

Unpoison a Ref in various calls just like in ~Ref so that sorting a Vector<Ref<>> works with ASan on.

* wtf/Ref.h:
(WTF::Ref::assignToHashTableEmptyValue):
(WTF::=):
(WTF::U>::replace):

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

18 months agoWeb Automation: provide a way to ask clients for a new tab or window
bburg@apple.com [Mon, 26 Mar 2018 19:25:56 +0000 (19:25 +0000)]
Web Automation: provide a way to ask clients for a new tab or window
https://bugs.webkit.org/show_bug.cgi?id=183381
<rdar://problem/38167301>

Reviewed by Timothy Hatcher.

Add support for specifying browsing context options when requesting
a new browsing context from the automation session client/delegate.
This is currently just used for specifying tab vs window, but could
also be used for things like toggling certain browser chrome or features.

There is no guarantee that the client has a notion of tabs vs windows,
so this option is purely advisory and should not cause the command to
fail if it cannot be honored.

This behavior caused by specifying this option is client-specific, so no
new tests are included in WebKit for this change.

* UIProcess/API/APIAutomationSessionClient.h:
(API::AutomationSessionClient::didRequestNewPageWithOptions):
(API::AutomationSessionClient::didRequestNewWindow): Deleted.
Add options parameter.

* UIProcess/API/glib/WebKitAutomationSession.cpp:
Adjust to new signature. More work is needed to plumb this information
to the public API for GTK/WPE and support it in WebKitGTK driver.

* UIProcess/Automation/Automation.json: Add new optional parameter.

* UIProcess/Automation/WebAutomationSession.h:
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::createBrowsingContext):
Convert the protocol option to an API option.

* UIProcess/Cocoa/AutomationSessionClient.h:
* UIProcess/Cocoa/AutomationSessionClient.mm:
(WebKit::AutomationSessionClient::AutomationSessionClient):
(WebKit::toAPI):
(WebKit::AutomationSessionClient::didRequestNewPageWithOptions):
(WebKit::AutomationSessionClient::didRequestNewWindow): Deleted.
Convert the internal option to a Cocoa SPI option and pass it along.

* UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
Adjust delegate methods to include options. Clients need to adopt the new signature(s).

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

18 months ago[Web Animations] Make imported/mozilla/css-animations/test_animation-currenttime...
graouts@webkit.org [Mon, 26 Mar 2018 19:12:10 +0000 (19:12 +0000)]
[Web Animations] Make imported/mozilla/css-animations/test_animation-currenttime.html pass reliably
https://bugs.webkit.org/show_bug.cgi?id=183819

Reviewed by Dean Jackson.

LayoutTests/imported/mozilla:

Record progressions of Mozilla tests.

* css-animations/test_animation-currenttime-expected.txt:

Source/WebCore:

The current time for a CSS Animation exposed via the API should be clamped between 0 and the animation duration.

* animation/CSSAnimation.cpp:
(WebCore::CSSAnimation::bindingsCurrentTime const):
* animation/CSSAnimation.h:
* animation/WebAnimation.h:

LayoutTests:

The test imported/mozilla/css-animations/test_animation-currenttime.html now passes reliably.

* TestExpectations:

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

18 months ago[Extra zoom mode] Add plumbing for next and previous focusable element rects
wenson_hsieh@apple.com [Mon, 26 Mar 2018 19:09:33 +0000 (19:09 +0000)]
[Extra zoom mode] Add plumbing for next and previous focusable element rects
https://bugs.webkit.org/show_bug.cgi?id=184016
Work towards <rdar://problem/38758727>

Reviewed by Tim Horton.

When building up AssistedNodeInformation, we currently compute the element rect of the current focused element,
as well as flags indicating whether or not there are next or previous focusable elements. For
<rdar://problem/38758727>, we additionally send the rects of the next or previous focusable elements as well.

* Shared/AssistedNodeInformation.cpp:
(WebKit::AssistedNodeInformation::encode const):
(WebKit::AssistedNodeInformation::decode):

IPC support for nextNodeRect and previousNodeRect.

* Shared/AssistedNodeInformation.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::elementRectInRootViewCoordinates):

Add a helper to compute an element's rect in root view coordinates. We use this to compute the rects of the
current focused element as well as those of the next and previous elements, if any.

(WebKit::WebPage::getAssistedNodeInformation):
(WebKit::hasAssistableElement): Deleted.

Since we need the next or previous focusable element to get its rect, we don't need this helper anymore.

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

18 months ago[Web Animations] Correctly handle timing functions specified by CSS Animations and...
graouts@webkit.org [Mon, 26 Mar 2018 19:08:01 +0000 (19:08 +0000)]
[Web Animations] Correctly handle timing functions specified by CSS Animations and CSS Transitions
https://bugs.webkit.org/show_bug.cgi?id=183935

Reviewed by Dean Jackson.

LayoutTests/imported/mozilla:

Record progressions of Mozilla tests.

* css-animations/test_animation-computed-timing-expected.txt:
* css-transitions/test_animation-computed-timing-expected.txt:
* css-transitions/test_keyframeeffect-getkeyframes-expected.txt:

Source/WebCore:

We were incorrectly reflecting the animation-timing-function and transition-timing-function values on the generated
DeclarativeAnimation effect timing "easing" property. In fact, those values should only be represented on the keyframes.

In the case of a CSS Animation, the animation-timing-function property set on the element's style serves as the default
value used for all keyframes, and individual keyframes can specify an overriding animation-timing-function. For a CSS
Transition, the transition-timing-function property set on the element's style serves as the timing function of the
from keyframe.

To correctly reflect this, we provide a new timingFunctionForKeyframeAtIndex() function on KeyframeEffectReadOnly
which will return the right TimingFunction object at a given index, regardless of the animation type. In the case
of getKeyframes(), we manually return "linear" for the "to" keyframe since timingFunctionForKeyframeAtIndex()
would otherwise return the same timing function as the "from" keyframe. This avoids creating an extra
LinearTimingFunction object.

As a result, a number of Mozilla imported tests progress since we have correct information on the "easing" property
of objects returned by getKeyframes() and the "progress" reported by getComputedTiming() now always uses a linear
timing function.

* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::syncPropertiesWithBackingAnimation): The timing function of the backing Animation should
not be reflected on the effect's timing object.
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::getKeyframes): Return the correct timing function for a keyframe, and use a "linear"
value for the "to" keyframe of a CSS Transition.
(WebCore::KeyframeEffectReadOnly::setAnimatedPropertiesInStyle):
(WebCore::KeyframeEffectReadOnly::timingFunctionForKeyframeAtIndex):
* animation/KeyframeEffectReadOnly.h:

LayoutTests:

We now pass 2 additional Mozilla tests completely, so they no longer need to be marked as flaky failures or timeouts.
We also update tests that we wrote ourselves and which incorrectly assumed that the effect's timing would reflect
the timing function set by CSS.

* TestExpectations:
* webanimations/css-animations-expected.txt:
* webanimations/css-animations.html:
* webanimations/css-transitions-expected.txt:
* webanimations/css-transitions.html:

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

18 months agoMake VCP encoder usage conditional on using internal SDK
commit-queue@webkit.org [Mon, 26 Mar 2018 18:36:37 +0000 (18:36 +0000)]
Make VCP encoder usage conditional on using internal SDK
https://bugs.webkit.org/show_bug.cgi?id=184009

Patch by Youenn Fablet <youennf@gmail.com> on 2018-03-26
Reviewed by Eric Carlson.

* Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.h:

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

18 months agoUse SecurityOriginData more consistently in Service Worker code
cdumez@apple.com [Mon, 26 Mar 2018 18:03:40 +0000 (18:03 +0000)]
Use SecurityOriginData more consistently in Service Worker code
https://bugs.webkit.org/show_bug.cgi?id=183969

Reviewed by Darin Adler.

Source/WebCore:

Use SecurityOriginData more consistently in Service Worker code to avoid constructing
SecurityOrigin objects unnecessarily.

I also updated SecurityOrigin to use SecurityOriginData as a data member. This reduces
code duplication a bit. This also avoids constructing SecurityOriginData unnecessarily
in some cases as callers can now use SecurityOrigin::data() instead of
SecurityOriginData::fromSecurityOrigin().

No new tests, no Web-facing behavior change.

* Modules/cache/DOMCacheStorage.cpp:
(WebCore::DOMCacheStorage::origin const):
* Modules/encryptedmedia/CDM.cpp:
(WebCore::CDM::storageDirectory const):
* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::mediaKeysStorageDirectory const):
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
(WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory const):
* Modules/indexeddb/IDBFactory.cpp:
(WebCore::IDBFactory::openInternal):
(WebCore::IDBFactory::deleteDatabase):
* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::getAllDatabaseNames):
* Modules/webdatabase/Database.cpp:
(WebCore::Database::securityOrigin):
* Modules/webdatabase/DatabaseContext.cpp:
(WebCore::DatabaseContext::securityOrigin const):
* Modules/webdatabase/DatabaseContext.h:
* Modules/webdatabase/DatabaseManager.cpp:
(WebCore::DatabaseManager::fullPathForDatabase):
(WebCore::DatabaseManager::detailsForNameAndOrigin):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerMediaKeysStorageDirectory const):
* inspector/agents/InspectorDOMStorageAgent.cpp:
(WebCore::InspectorDOMStorageAgent::findStorageArea):
* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::calculateQuotaForOrigin):
(WebCore::ApplicationCacheStorage::calculateUsageForOrigin):
(WebCore::ApplicationCacheStorage::calculateRemainingSizeForOriginExcludingCache):
(WebCore::ApplicationCacheStorage::storeUpdatedQuotaForOrigin):
(WebCore::ApplicationCacheStorage::store):
(WebCore::ApplicationCacheStorage::ensureOriginRecord):
* page/DOMWindow.cpp:
(WebCore:: const):
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::SecurityOrigin):
(WebCore::SecurityOrigin::isPotentiallyTrustworthy const):
(WebCore::SecurityOrigin::canAccess const):
(WebCore::SecurityOrigin::canDisplay const):
(WebCore::SecurityOrigin::domainForCachePartition const):
(WebCore::SecurityOrigin::isLocal const):
(WebCore::SecurityOrigin::toString const):
(WebCore::SecurityOrigin::toRawString const):
(WebCore::SecurityOrigin::create):
(WebCore::SecurityOrigin::isSameSchemeHostPort const):
* page/SecurityOrigin.h:
(WebCore::SecurityOrigin::protocol const):
(WebCore::SecurityOrigin::host const):
(WebCore::SecurityOrigin::port const):
(WebCore::SecurityOrigin::data const):
(WebCore::SecurityOrigin::isHTTPFamily const):
* page/SecurityOriginData.cpp:
(WebCore::SecurityOriginData::toString const):
(WebCore::SecurityOriginData::fromFrame):
* page/SecurityOriginData.h:
(WebCore::SecurityOriginData::fromURL):
* storage/StorageNamespaceProvider.cpp:
(WebCore::StorageNamespaceProvider::localStorageArea):
* testing/Internals.cpp:
(WebCore::Internals::clearCacheStorageMemoryRepresentation):
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::addRegistration):
(WebCore::ServiceWorkerContainer::removeRegistration):
(WebCore::ServiceWorkerContainer::updateRegistration):
* workers/service/ServiceWorkerRegistrationKey.cpp:
(WebCore::ServiceWorkerRegistrationKey::relatesToOrigin const):
* workers/service/ServiceWorkerRegistrationKey.h:
* workers/service/server/SWOriginStore.cpp:
(WebCore::SWOriginStore::add):
(WebCore::SWOriginStore::remove):
(WebCore::SWOriginStore::clear):
* workers/service/server/SWOriginStore.h:
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::addRegistration):
(WebCore::SWServer::removeRegistration):
(WebCore::SWServer::clear):
(WebCore::SWServer::tryInstallContextData):
(WebCore::SWServer::serverToContextConnectionCreated):
(WebCore::SWServer::markAllWorkersForOriginAsTerminated):
(WebCore::SWServer::unregisterServiceWorkerClient):
(WebCore::SWServer::needsServerToContextConnectionForOrigin const):
* workers/service/server/SWServer.h:
* workers/service/server/SWServerToContextConnection.cpp:
(WebCore::SWServerToContextConnection::SWServerToContextConnection):
(WebCore::SWServerToContextConnection::~SWServerToContextConnection):
(WebCore::SWServerToContextConnection::connectionForOrigin):
* workers/service/server/SWServerToContextConnection.h:
(WebCore::SWServerToContextConnection::securityOrigin const):
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::origin const):
(WebCore::SWServerWorker::securityOrigin const):
* workers/service/server/SWServerWorker.h:

Source/WebKit:

Use SecurityOriginData more consistently in Service Worker code to avoid constructing
SecurityOrigin objects unnecessarily.

* NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::encode const):
* Shared/API/c/WKSecurityOriginRef.cpp:
(WKSecurityOriginCopyDatabaseIdentifier):
* StorageProcess/ServiceWorker/WebSWOriginStore.cpp:
(WebKit::WebSWOriginStore::addToStore):
(WebKit::WebSWOriginStore::removeFromStore):
* StorageProcess/ServiceWorker/WebSWOriginStore.h:
* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::scheduleJobInServer):
(WebKit::WebSWServerConnection::registerServiceWorkerClient):
* StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
(WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
* StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::connectionToContextProcessWasClosed):
(WebKit::StorageProcess::needsServerToContextConnectionForOrigin const):
(WebKit::StorageProcess::createStorageToWebProcessConnection):
(WebKit::StorageProcess::deleteWebsiteDataForOrigins):
(WebKit::StorageProcess::serverToContextConnectionForOrigin):
(WebKit::StorageProcess::createServerToContextConnection):
(WebKit::StorageProcess::swContextConnectionMayNoLongerBeNeeded):
* StorageProcess/StorageProcess.h:
* UIProcess/API/APIFrameInfo.cpp:
(API::FrameInfo::create):
* UIProcess/API/C/WKApplicationCacheManager.cpp:
(WKApplicationCacheManagerDeleteEntriesForOrigin):
* UIProcess/API/C/WKKeyValueStorageManager.cpp:
(WKKeyValueStorageManagerDeleteEntriesForOrigin):
* UIProcess/API/C/WKResourceCacheManager.cpp:
(WKResourceCacheManagerClearCacheForOrigin):
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreRemoveFetchCacheForOrigin):
(WKWebsiteDataStoreGetFetchCacheSizeForOrigin):
* UIProcess/ServiceWorkerProcessProxy.cpp:
(WebKit::ServiceWorkerProcessProxy::create):
(WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
(WebKit::ServiceWorkerProcessProxy::getLaunchOptions):
* UIProcess/ServiceWorkerProcessProxy.h:
* UIProcess/Storage/StorageProcessProxy.cpp:
(WebKit::StorageProcessProxy::getStorageProcessConnection):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
(WebKit::WebProcessPool::disconnectProcess):
(WebKit::WebProcessPool::updateProcessAssertions):
* UIProcess/WebProcessPool.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::fetchDataAndApply):
* WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
(WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageCopyOriginsWithApplicationCache):
* WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
(WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest):
(WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices):
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::registerServiceWorkerClient):
(WebKit::WebSWClientConnection::matchRegistration):
(WebKit::WebSWClientConnection::whenRegistrationReady):
(WebKit::WebSWClientConnection::getRegistrations):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::exceededDatabaseQuota):
(WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::fetchWebsiteData):
* WebProcess/WebStorage/StorageAreaImpl.cpp:
(WebKit::StorageAreaImpl::securityOrigin const):
* WebProcess/WebStorage/StorageAreaImpl.h:
* WebProcess/WebStorage/StorageAreaMap.cpp:
(WebKit::StorageAreaMap::StorageAreaMap):
(WebKit::StorageAreaMap::dispatchSessionStorageEvent):
(WebKit::StorageAreaMap::dispatchLocalStorageEvent):
* WebProcess/WebStorage/StorageNamespaceImpl.cpp:
(WebKit::StorageNamespaceImpl::didDestroyStorageAreaMap):

Source/WebKitLegacy:

Use SecurityOrigin::data() instead of SecurityOriginData::fromSecurityOrigin().

* Storage/StorageTracker.cpp:
(WebKit::StorageTracker::diskUsageForOrigin):

Source/WebKitLegacy/mac:

Use SecurityOrigin::data() instead of SecurityOriginData::fromSecurityOrigin().

* Storage/WebDatabaseManager.mm:
(-[WebDatabaseManager databasesWithOrigin:]):
(-[WebDatabaseManager deleteOrigin:]):
(-[WebDatabaseManager deleteDatabase:withOrigin:]):
* Storage/WebDatabaseQuotaManager.mm:
(-[WebDatabaseQuotaManager usage]):
(-[WebDatabaseQuotaManager quota]):
(-[WebDatabaseQuotaManager setQuota:]):
* Storage/WebStorageManager.mm:
(-[WebStorageManager deleteOrigin:]):
* WebCoreSupport/WebSecurityOrigin.mm:
(-[WebSecurityOrigin databaseIdentifier]):
(-[WebSecurityOrigin usage]):
(-[WebSecurityOrigin quota]):
(-[WebSecurityOrigin setQuota:]):

Source/WebKitLegacy/win:

Use SecurityOrigin::data() instead of SecurityOriginData::fromSecurityOrigin().

* WebDatabaseManager.cpp:
(WebDatabaseManager::databasesWithOrigin):
(WebDatabaseManager::deleteOrigin):
(WebDatabaseManager::deleteDatabase):
(WebDatabaseManager::setQuota):
* WebSecurityOrigin.cpp:
(WebSecurityOrigin::usage):
(WebSecurityOrigin::quota):
(WebSecurityOrigin::setQuota):

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

18 months agoWarn against cookie access in the WebContent process using ProcessPrivilege assertions
bfulgham@apple.com [Mon, 26 Mar 2018 17:55:45 +0000 (17:55 +0000)]
Warn against cookie access in the WebContent process using ProcessPrivilege assertions
https://bugs.webkit.org/show_bug.cgi?id=183911
<rdar://problem/38762306>

Reviewed by Youenn Fablet.

Source/WebCore:

Add a set of ProcessPrivilege assertions to enforce the rule that the WebContent process
should never call Cookie API directly. That should only happen in the Networking or
UIProcess.

Add a new static flag to NetworkStorageSession that indicates if the current process has
permission to interact with the Cookie API.

No new tests since there is no change in behavior.

* platform/network/NetworkStorageSession.cpp:
(WebCore::NetworkStorageSession::NetworkStorageSession):
(WebCore::NetworkStorageSession::processMayUseCookieAPI): Added.
(WebCore::NetworkStorageSession::permitProcessToUseCookieAPI): Added. This also adds
the appropriate flag to the ProcessPrivileges data for the current process.
* platform/network/NetworkStorageSession.h:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::createCFStorageSessionForIdentifier): Do not create cookie storage if the current
process is prohibited from interacting with the Cookie API.
(WebCore::NetworkStorageSession::NetworkStorageSession): Add assertions.
(WebCore::NetworkStorageSession::switchToNewTestingSession): Do not create cookie storage if
the current process is prohibited from interacting with the Cookie API.
(WebCore::NetworkStorageSession::defaultStorageSession): Ditto.
(WebCore::NetworkStorageSession::ensureSession): Ditto.
(WebCore::NetworkStorageSession::cookieStorage const): Ditto.
* platform/network/cocoa/CookieStorageObserver.mm:
(WebCore::CookieStorageObserver::CookieStorageObserver): Assert if accessed from untrusted process.
(WebCore::CookieStorageObserver::startObserving): Ditto.
(WebCore::CookieStorageObserver::stopObserving): Ditto.
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::NetworkStorageSession::setCookie):
(WebCore::NetworkStorageSession::setCookies):
(WebCore::NetworkStorageSession::deleteCookie):
(WebCore::nsCookiesToCookieVector):
(WebCore::NetworkStorageSession::getAllCookies):
(WebCore::NetworkStorageSession::getCookies):
(WebCore::NetworkStorageSession::flushCookieStore):
(WebCore::NetworkStorageSession::nsCookieStorage const):
(WebCore::createPrivateStorageSession):
* platform/network/mac/CookieJarMac.mm:
(WebCore::httpCookies):
(WebCore::deleteHTTPCookie):
(WebCore::httpCookiesForURL):
(WebCore::filterCookies):
(WebCore::applyPartitionToCookies):
(WebCore::cookiesInPartitionForURL):
(WebCore::cookiesForSession):
(WebCore::setHTTPCookiesForURL):
(WebCore::deleteAllHTTPCookies):
(WebCore::setCookiesFromDOM):
(WebCore::httpCookieAcceptPolicy):
(WebCore::deleteCookie):
(WebCore::deleteCookiesForHostnames):
(WebCore::deleteAllCookiesModifiedSince):

Source/WebKit:

Add a set of ProcessPrivilege assertions to enforce the rule that the WebContent process
should never call Cookie API directly. That should only happen in the Networking or
UIProcess.

* NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
(WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
(WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy):
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::applyCookieBlockingPolicy):
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::setSharedHTTPCookieStorage):
(WebKit::NetworkProcess::syncAllCookies):
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
* NetworkProcess/mac/RemoteNetworkingContext.mm:
(WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
* PluginProcess/PluginProcess.cpp:
(WebKit::PluginProcess::initializeProcess):
* Shared/cf/CookieStorageUtilsCF.mm:
(WebKit::cookieStorageFromIdentifyingData):
(WebKit::identifyingDataFromCookieStorage):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess):
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
(WebKit::privateBrowsingSession):
* UIProcess/WebProcessPool.cpp:
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):
* UIProcess/mac/WebCookieManagerProxyMac.mm:
(WebKit::WebCookieManagerProxy::persistHTTPCookieAcceptPolicy):
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::setPrivateBrowsingEnabled):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::createNetworkingContext):
* WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
(WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
(WebKit::WebFrameNetworkingContext::storageSession const):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeProcess):

Source/WebKitLegacy/mac:

Initialize the ProcessPrivilege and Cookie API access levels for single-process use.

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

Source/WebKitLegacy/win:

Initialize the ProcessPrivilege and Cookie API access levels for single-process use.

* WebView.cpp:
(WebView::WebView):

Source/WTF:

Extend the ProcessPrivilege API with the ability to add and remove individual
privileges.

* wtf/ProcessPrivilege.cpp:
(WTF::addProcessPrivilege):
(WTF::removeProcessPrivilege):
* wtf/ProcessPrivilege.h:

Tools:

Add a set of ProcessPrivilege assertions to enforce the rule that the WebContent process
should never call Cookie API directly. That should only happen in the Networking or
UIProcess.

* DumpRenderTree/mac/DumpRenderTree.mm:
(DumpRenderTreeMain):
* TestWebKitAPI/TestsController.cpp:
(TestWebKitAPI::TestsController::TestsController):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::initialize):

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

18 months agoMerge ResourceHandleClient::willCacheResponseAsync with ResourceHandleClient::willCac...
achristensen@apple.com [Mon, 26 Mar 2018 17:38:49 +0000 (17:38 +0000)]
Merge ResourceHandleClient::willCacheResponseAsync with ResourceHandleClient::willCacheResponse
https://bugs.webkit.org/show_bug.cgi?id=183965

Reviewed by Chris Dumez.

Source/WebCore:

It turns out that ResourceHandleClient::willCacheResponseAsync didn't do anything and the logic in
ResourceHandleClient::willCacheResponse was not being called.  This makes it so there is one code
path and it executes the logic in ResourceHandleClient::willCacheResponse.

* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoaderClient.h:
* loader/ResourceLoader.h:
* loader/SubresourceLoader.h:
* loader/cocoa/SubresourceLoaderCocoa.mm:
(WebCore::SubresourceLoader::willCacheResponseAsync):
(WebCore::SubresourceLoader::willCacheResponse): Deleted.
* loader/mac/ResourceLoaderMac.mm:
(WebCore::ResourceLoader::willCacheResponseAsync):
(WebCore::ResourceLoader::willCacheResponse): Deleted.
* platform/network/ResourceHandle.h:
* platform/network/ResourceHandleClient.cpp:
(WebCore::ResourceHandleClient::willCacheResponseAsync): Deleted.
* platform/network/ResourceHandleClient.h:
(WebCore::ResourceHandleClient::willCacheResponseAsync):
(WebCore::ResourceHandleClient::shouldCacheResponse):
(WebCore::ResourceHandleClient::willCacheResponse): Deleted.
* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::ResourceHandle::continueWillCacheResponse): Deleted.
* platform/network/cf/ResourceHandleCFURLConnectionDelegate.h:
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::continueWillCacheResponse): Deleted.
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::continueWillCacheResponse): Deleted.
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate continueWillCacheResponse:]): Deleted.

Source/WebKit:

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::willCacheResponse const):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:

Source/WebKitLegacy/mac:

* WebCoreSupport/WebFrameLoaderClient.h:
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::willCacheResponse const):

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

18 months agoMark imported/mozilla/css-animations/test_animation-cancel.html as flaky.
ryanhaddad@apple.com [Mon, 26 Mar 2018 17:18:56 +0000 (17:18 +0000)]
Mark imported/mozilla/css-animations/test_animation-cancel.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=184011

Unreviewed test gardening.

* TestExpectations:

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

18 months ago[LayoutReloaded] Add InlineText DOM interface and dependencies
zalan@apple.com [Mon, 26 Mar 2018 17:03:53 +0000 (17:03 +0000)]
[LayoutReloaded] Add InlineText DOM interface and dependencies
https://bugs.webkit.org/show_bug.cgi?id=184010

Reviewed by Antti Koivisto.

to help inline text layout.

* LayoutReloaded/misc/LayoutReloadedWebKit.patch:

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

18 months ago[GTK][WPE] Upload correct buffer in BitmapTextureGL::updateContents()
magomez@igalia.com [Mon, 26 Mar 2018 14:30:08 +0000 (14:30 +0000)]
[GTK][WPE] Upload correct buffer in BitmapTextureGL::updateContents()
https://bugs.webkit.org/show_bug.cgi?id=184004

Reviewed by Žan Doberšek.

Do not upload the original buffer. Upload the result of creating a subImage buffer
if it was required.

Covered by existent tests.

* platform/graphics/texmap/BitmapTextureGL.cpp:
(WebCore::BitmapTextureGL::updateContents):

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

18 months ago[GTK][WPE] Add API to convert between DOM and JSCValue
carlosgc@webkit.org [Mon, 26 Mar 2018 08:44:13 +0000 (08:44 +0000)]
[GTK][WPE] Add API to convert between DOM and JSCValue
https://bugs.webkit.org/show_bug.cgi?id=183448

Reviewed by Michael Catanzaro.

.:

Define FORWARDING_HEADERS_WPE_DOM_DIR.

* Source/cmake/OptionsWPE.cmake:

Source/WebKit:

Add methods to get a JSCValue for a WebKitDOMObject and to create a WebKitDOMNode from a JSCValue. Deprecate
most of the GTK+ DOM bindings API and move the non-deprecated parts to glib dir to be exposed by WPE too.

* PlatformGTK.cmake:
* PlatformWPE.cmake:
* SourcesGTK.txt:
* SourcesWPE.txt:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
* WebProcess/InjectedBundle/API/glib/DOM/DOMObjectCache.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/DOMObjectCache.cpp.
* WebProcess/InjectedBundle/API/glib/DOM/DOMObjectCache.h: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/DOMObjectCache.h.
* WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMDocument.cpp: Added.
(WebKit::kit):
(WebKit::core):
(WebKit::wrapDocument):
(webkit_dom_document_class_init):
(webkit_dom_document_init):
* WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMDocumentPrivate.h: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentPrivate.h.
* WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMElement.cpp: Added.
(WebKit::kit):
(WebKit::core):
(WebKit::wrapElement):
(webkit_dom_element_class_init):
(webkit_dom_element_init):
(webkit_dom_element_html_input_element_is_user_edited):
(webkit_dom_element_html_input_element_get_auto_filled):
(webkit_dom_element_html_input_element_set_auto_filled):
(webkit_dom_element_html_input_element_set_editing_value):
* WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMElementPrivate.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementPrivate.h.
* WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMNode.cpp: Added.
(_WebKitDOMNodePrivate::~_WebKitDOMNodePrivate):
(WebKit::kit):
(WebKit::core):
(WebKit::wrapNode):
(webkitDOMNodeConstructor):
(webkitDOMNodeFinalize):
(webkit_dom_node_init):
(webkit_dom_node_class_init):
(webkitDOMNodeSetCoreObject):
(webkitDOMNodeGetCoreObject):
(webkit_dom_node_for_js_value):
* WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMNodePrivate.h: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodePrivate.h.
* WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMObject.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObject.cpp.
(webkitDOMObjectSetProperty):
(webkit_dom_object_class_init):
* WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMPrivate.cpp: Added.
(WebKit::wrap):
* WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMPrivate.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/DOMObjectCache.h.
* WebProcess/InjectedBundle/API/glib/WebKitFrame.cpp:
(webkit_frame_get_js_value_for_dom_object):
(webkit_frame_get_js_value_for_dom_object_in_script_world):
* WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
(webkit_web_page_class_init):
(webkitWebPageCreate):
(webkit_web_page_get_dom_document):
* WebProcess/InjectedBundle/API/gtk/DOM/GObjectEventListener.cpp:
(WebKit::GObjectEventListener::handleEvent):
* WebProcess/InjectedBundle/API/gtk/DOM/GObjectNodeFilterCondition.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/GObjectXPathNSResolver.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlob.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlob.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp.
(webkitDOMDocumentDOMEventTargetInit):
(webkitDOMDocumentInstallProperties):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementGtk.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp.
(webkitDOMElementDOMEventTargetInit):
(webkitDOMElementInstallProperties):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEventTarget.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEventTarget.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPrivate.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEvent.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEvent.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEvent.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEvent.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeFilter.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeFilter.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeGtk.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.cpp.
(webkitDOMNodeDOMEventTargetInit):
(webkitDOMNodeInstallProperties):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeList.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeList.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObject.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivateGtk.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivate.cpp.
(WebKit::wrapNodeGtk):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivateGtk.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivate.h.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheet.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheet.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetList.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetList.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEvent.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEvent.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpression.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpression.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathNSResolver.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathNSResolver.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.h:
* WebProcess/InjectedBundle/API/gtk/DOM/docs/webkitdomgtk-4.0-sections.txt:
* WebProcess/InjectedBundle/API/gtk/WebKitFrame.h:
* WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMDefines.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentPrivate.h.
* WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMDocument.h: Added.
* WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMElement.h: Added.
* WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMNode.h: Added.
* WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMObject.h: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObject.h.
* WebProcess/InjectedBundle/API/wpe/DOM/webkitdom.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodePrivate.h.
* WebProcess/InjectedBundle/API/wpe/WebKitFrame.h:
* WebProcess/InjectedBundle/API/wpe/WebKitWebHitTestResult.h: Added.
* WebProcess/InjectedBundle/API/wpe/WebKitWebPage.h:
* WebProcess/InjectedBundle/API/wpe/WebKitWebProcessEnumTypes.cpp.template: Added.
* WebProcess/InjectedBundle/API/wpe/WebKitWebProcessEnumTypes.h.template: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObjectPrivate.h.
* WebProcess/InjectedBundle/API/wpe/webkit-web-extension.h:

Tools:

Add unit tests for non-deprecated DOM API and switch existing tests to use non-deprecated API except for the
ones that test the deprecated API.

* TestWebKitAPI/Tests/WebKitGLib/DOMElementTest.cpp: Added.
(DOMElementTest::create):
(DOMElementTest::testAutoFill):
(registerTests):
* TestWebKitAPI/Tests/WebKitGLib/EditorTest.cpp: Added.
(WebKitWebEditorTest::create):
(WebKitWebEditorTest::selectionChangedCallback):
(WebKitWebEditorTest::testSelectionchanged):
(registerTests):
* TestWebKitAPI/Tests/WebKitGLib/FrameTest.cpp:
(WebKitFrameTest::testJavaScriptValues):
(registerTests):
* TestWebKitAPI/Tests/WebKitGLib/TestDOMElement.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObjectPrivate.h.
(testWebKitDOMElementAutoFill):
(beforeAll):
(afterAll):
* TestWebKitAPI/Tests/WebKitGLib/TestEditor.cpp: Renamed from Tools/TestWebKitAPI/Tests/WebKitGtk/TestEditor.cpp.
* TestWebKitAPI/Tests/WebKitGLib/TestFrame.cpp:
(testWebKitFrameJavaScriptValues):
(beforeAll):
* TestWebKitAPI/Tests/WebKitGLib/TestWebExtensions.cpp:
(inputElementIsUserEdited):
(testWebExtensionInputElementIsUserEdited):
(testWebExtensionFormSubmissionSteps):
(beforeAll):
* TestWebKitAPI/Tests/WebKitGLib/WebExtensionTest.cpp:
(documentLoadedCallback):
(serializeNode):
(contextMenuCallback):
(consoleMessageSentCallback):
(formControlsAssociatedCallback):
(willSubmitFormCallback):
(pageCreatedCallback):
(methodCallCallback):
* TestWebKitAPI/Tests/WebKitGLib/WebProcessTest.cpp:
(checkLeaks):
(webProcessTestRunnerFinalize):
(checkLeaksAtExit):
* TestWebKitAPI/Tests/WebKitGtk/AutocleanupsTest.cpp:
(AutocleanupsTest::testWebProcessAutocleanups):
* TestWebKitAPI/Tests/WebKitGtk/DOMClientRectTest.cpp:
* TestWebKitAPI/Tests/WebKitGtk/DOMNodeFilterTest.cpp:
* TestWebKitAPI/Tests/WebKitGtk/DOMNodeTest.cpp:
* TestWebKitAPI/Tests/WebKitGtk/DOMXPathNSResolverTest.cpp:
* TestWebKitAPI/Tests/WebKitGtk/EditorTest.cpp: Removed.
* TestWebKitAPI/glib/CMakeLists.txt:
* TestWebKitAPI/glib/PlatformGTK.cmake:
* TestWebKitAPI/glib/PlatformWPE.cmake:

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

18 months ago[CoordGraphics] Clean up CoordinatedGraphicsScene construct-time initializations
zandobersek@gmail.com [Mon, 26 Mar 2018 07:37:23 +0000 (07:37 +0000)]
[CoordGraphics] Clean up CoordinatedGraphicsScene construct-time initializations
https://bugs.webkit.org/show_bug.cgi?id=184002

Reviewed by Carlos Garcia Campos.

Move the CoordinatedGraphicsScene constant-expression initializations
from constructor to the point of declaration.

Default the CoordinatedGraphicsScene destructor.

The m_scrollPosition member variable is unused in this class, while the
similarly-named m_renderedContentsScrollPosition tracks scroll position
of the scene. Remove the latter and use m_scrollPosition in its place.

* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::CoordinatedGraphicsScene):
(WebKit::CoordinatedGraphicsScene::adjustPositionForFixedLayers):
(WebKit::CoordinatedGraphicsScene::commitSceneState):
(WebKit::CoordinatedGraphicsScene::~CoordinatedGraphicsScene): Deleted.
* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:

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

18 months ago[GTK] WebKitWebProcessEnumTypes.h missing from webkit-web-extension.h
mcatanzaro@igalia.com [Mon, 26 Mar 2018 06:58:14 +0000 (06:58 +0000)]
[GTK] WebKitWebProcessEnumTypes.h missing from webkit-web-extension.h
https://bugs.webkit.org/show_bug.cgi?id=183998

Reviewed by Carlos Garcia Campos.

* WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h:

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

18 months ago[GTK] Unresolved type warnings when generating gir
carlosgc@webkit.org [Mon, 26 Mar 2018 06:48:49 +0000 (06:48 +0000)]
[GTK] Unresolved type warnings when generating gir
https://bugs.webkit.org/show_bug.cgi?id=183926

Reviewed by Michael Catanzaro.

Skip deprecated functions using JSC C API from introspection.

* UIProcess/API/glib/WebKitJavascriptResult.cpp:
* UIProcess/API/glib/WebKitWebView.cpp:
* WebProcess/InjectedBundle/API/glib/WebKitFrame.cpp:

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

18 months agoFix typo in JSC option name
sbarati@apple.com [Mon, 26 Mar 2018 06:38:44 +0000 (06:38 +0000)]
Fix typo in JSC option name
https://bugs.webkit.org/show_bug.cgi?id=184001

Reviewed by Mark Lam.

enableJITDebugAssetions => enableJITDebugAssertions.

* assembler/MacroAssembler.cpp:
(JSC::MacroAssembler::jitAssert):
* runtime/Options.h:

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

18 months ago[TexMap] Clean up TextureMapperPlatformLayer, TextureMapperBackingStore code
zandobersek@gmail.com [Mon, 26 Mar 2018 06:21:32 +0000 (06:21 +0000)]
[TexMap] Clean up TextureMapperPlatformLayer, TextureMapperBackingStore code
https://bugs.webkit.org/show_bug.cgi?id=183985

Reviewed by Michael Catanzaro.

Clean up TextureMapperPlatformLayer and TextureMapperBackingStore
headers and implementation files. Remove dubious whitespace, use #pragma
once, clean up constructors, destructors, method definitions and remove
unnecessary includes in favor of forward declarations where possible.

The TextureMapperPlatformLayer::swapBuffers() method is removed as it
wasn't called or overridden anywhere.

No new tests -- no change in functionality.

* platform/graphics/texmap/TextureMapperBackingStore.cpp:
* platform/graphics/texmap/TextureMapperBackingStore.h:
(WebCore::TextureMapperBackingStore::drawRepaintCounter):
* platform/graphics/texmap/TextureMapperPlatformLayer.h:
(WebCore::TextureMapperPlatformLayer::setClient):
(WebCore::TextureMapperPlatformLayer::TextureMapperPlatformLayer): Deleted.
(WebCore::TextureMapperPlatformLayer::swapBuffers): Deleted.

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

18 months ago[Xcode] Remove workaround only needed for deploying to iOS 10.0 and earlier
mitz@apple.com [Mon, 26 Mar 2018 05:56:45 +0000 (05:56 +0000)]
[Xcode] Remove workaround only needed for deploying to iOS 10.0 and earlier
https://bugs.webkit.org/show_bug.cgi?id=183999

Reviewed by Sam Weinig.

* Configurations/WebCore.xcconfig: Removed build settings.
* Configurations/WebCoreTestSupport.xcconfig: Removed location of phony WebKitLegacy from
  frameworks search path.
* Configurations/WebKitLegacyStub.iOS.tbd: Removed.
* WebCore.xcodeproj/project.pbxproj: Removed script build phase from the Derived Sources target.

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

18 months agoUnreviewed, rolling out r229954.
commit-queue@webkit.org [Mon, 26 Mar 2018 05:00:03 +0000 (05:00 +0000)]
Unreviewed, rolling out r229954.
https://bugs.webkit.org/show_bug.cgi?id=184000

Caused many layout tests to crash on Apple High Sierra,
Sierra, iOS Simulator and GTK Linux Debug test bots (Requested
by dydz on #webkit).

Reverted changeset:

"Use SecurityOriginData more consistently in Service Worker
code"
https://bugs.webkit.org/show_bug.cgi?id=183969
https://trac.webkit.org/changeset/229954

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

18 months agoWebProcess memory monitor: use %zu format specifier for size_t
clopez@igalia.com [Mon, 26 Mar 2018 00:54:22 +0000 (00:54 +0000)]
WebProcess memory monitor: use %zu format specifier for size_t
https://bugs.webkit.org/show_bug.cgi?id=183997

Reviewed by Michael Catanzaro.

usse %zu format specifier for size_t instead of %lu.

* wtf/MemoryPressureHandler.cpp:
(WTF::MemoryPressureHandler::shrinkOrDie):
(WTF::MemoryPressureHandler::measurementTimerFired):

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

18 months agoWeb Automation: remove unnecessary member variable WebAutomationSession
bburg@apple.com [Sun, 25 Mar 2018 20:22:36 +0000 (20:22 +0000)]
Web Automation: remove unnecessary member variable WebAutomationSession
https://bugs.webkit.org/show_bug.cgi?id=183971

Reviewed by Timothy Hatcher.

The concept of the "active" browsing context is something in the WebDriver
specification, but we were a bit too literal when first implementing this.
There's no actual need for this on the browser side since most commands
require implicitly switching to the target window passed in with the
Automation command. The driver, however, still needs to track the current
browsing context and current top-level browsing context.

For returning whether a browsing context is active,  we can just look at
the page's activity state to know whether the page is active or not. For
a normal browser, only one page is going to be visible and focused at a time.

* UIProcess/Automation/WebAutomationSession.h:
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::buildBrowsingContextForPage):
Consult the page's activity state to determine whether it's active.

(WebKit::WebAutomationSession::createBrowsingContext):
(WebKit::WebAutomationSession::closeBrowsingContext):
(WebKit::WebAutomationSession::switchToBrowsingContext):
(WebKit::WebAutomationSession::handleRunOpenPanel):
Stop reading and writing the current browsing context handle.

* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::isViewFocused const):
(WebKit::WebPageProxy::isViewWindowActive const):
Add new accessor.

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

18 months agoDisable geolocation prompt in minimal simulator mode
timothy_horton@apple.com [Sun, 25 Mar 2018 20:22:18 +0000 (20:22 +0000)]
Disable geolocation prompt in minimal simulator mode
https://bugs.webkit.org/show_bug.cgi?id=183991
<rdar://problem/38845774>

Reviewed by Dan Bernstein.

* Misc/WebGeolocationCoreLocationProvider.mm:
(-[WebGeolocationCoreLocationProvider requestGeolocationAuthorization]):
* Misc/WebGeolocationProviderIOS.mm:
(-[WebGeolocationProviderIOS registerWebView:]):
(-[WebGeolocationProviderIOS initializeGeolocationForWebView:listener:]):
Also clean up some unnecessary nested #ifs.

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

18 months agor228149 accidentally removed code that resets m_emptyCursor at the end of a GC
sbarati@apple.com [Sun, 25 Mar 2018 18:26:32 +0000 (18:26 +0000)]
r228149 accidentally removed code that resets m_emptyCursor at the end of a GC
https://bugs.webkit.org/show_bug.cgi?id=183995

Reviewed by Filip Pizlo.

The removal of this line of code was unintended and happened during some
refactoring Fil was doing. The consequence of removing this line of code
is that the m_emptyCursor became a monotonically increasing integer, leading
the cursor to usually being out of bounds of the block range (depending on
what the program is doing). This made the functionality of finding an empty
block to steal almost always fail.

* heap/BlockDirectory.cpp:
(JSC::BlockDirectory::prepareForAllocation):

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

18 months agoAdd and adopt ENABLE(AIRPLAY_PICKER)
timothy_horton@apple.com [Sun, 25 Mar 2018 17:09:00 +0000 (17:09 +0000)]
Add and adopt ENABLE(AIRPLAY_PICKER)
https://bugs.webkit.org/show_bug.cgi?id=183992

Reviewed by Daniel Bates.

Source/WebKit:

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _showPlaybackTargetPicker:fromRect:]):
* UIProcess/ios/forms/WKAirPlayRoutePicker.h:
* UIProcess/ios/forms/WKAirPlayRoutePicker.mm:

Source/WTF:

* wtf/FeatureDefines.h:

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

18 months agoMove WKAnimationDelegate to its own header
timothy_horton@apple.com [Sun, 25 Mar 2018 17:08:14 +0000 (17:08 +0000)]
Move WKAnimationDelegate to its own header
https://bugs.webkit.org/show_bug.cgi?id=183976
<rdar://problem/38822299>

Reviewed by Dan Bernstein.

* Shared/RemoteLayerTree/WKAnimationDelegate.h: Added.
* UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
RemoteLayerTreeHost uses a forward declaration of WKAnimationDelegate,
so we're just getting lucky that an -invalidate method exists on
some other object. Instead, move WKAnimationDelegate to its own
header, and include it in the places we use it.

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

18 months agoUse completion handlers for ResourceHandleClient::canAuthenticateAgainstProtectionSpa...
achristensen@apple.com [Sun, 25 Mar 2018 06:19:02 +0000 (06:19 +0000)]
Use completion handlers for ResourceHandleClient::canAuthenticateAgainstProtectionSpaceAsync
https://bugs.webkit.org/show_bug.cgi?id=183966

Reviewed by Chris Dumez.

No change in behavior.

* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::canAuthenticateAgainstProtectionSpaceAsync):
* loader/ResourceLoader.h:
* platform/network/BlobResourceHandle.cpp:
* platform/network/PingHandle.h:
* platform/network/ResourceHandle.h:
* platform/network/ResourceHandleClient.h:
* platform/network/SynchronousLoaderClient.cpp:
(WebCore::SynchronousLoaderClient::canAuthenticateAgainstProtectionSpaceAsync):
* platform/network/SynchronousLoaderClient.h:
* platform/network/cf/ResourceHandleCFURLConnectionDelegate.h:
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::canAuthenticateAgainstProtectionSpace):
(WebCore::ResourceHandle::continueCanAuthenticateAgainstProtectionSpace): Deleted.
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate continueCanAuthenticateAgainstProtectionSpace:]): Deleted.

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

18 months agoAdopt WK_PLATFORM_NAME in WebKit
timothy_horton@apple.com [Sun, 25 Mar 2018 04:32:40 +0000 (04:32 +0000)]
Adopt WK_PLATFORM_NAME in WebKit
https://bugs.webkit.org/show_bug.cgi?id=183978

Reviewed by Dan Bernstein.

* Configurations/WebKit.xcconfig:
* WebKit.xcodeproj/project.pbxproj:
* mac/MigrateHeadersFromWebKitLegacy.make:
* mac/postprocess-framework-headers.sh:

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

18 months ago[DFG] Introduces fused compare and jump
utatane.tea@gmail.com [Sat, 24 Mar 2018 21:43:22 +0000 (21:43 +0000)]
[DFG] Introduces fused compare and jump
https://bugs.webkit.org/show_bug.cgi?id=177100

Reviewed by Mark Lam.

JSTests:

* stress/fused-jeq-slow.js: Added.
(shouldBe):
(testJEQ):
(testJNEQB):
(testJEQB):
(testJNEQF):
(testJEQF):
* stress/fused-jeq.js: Added.
(shouldBe):
(testJEQ):
(testJNEQB):
(testJEQB):
(testJNEQF):
(testJEQF):
* stress/fused-jstricteq-slow.js: Added.
(shouldBe):
(testJSTRICTEQ):
(testJNSTRICTEQB):
(testJSTRICTEQB):
(testJNSTRICTEQF):
(testJSTRICTEQF):
* stress/fused-jstricteq.js: Added.
(shouldBe):
(testJSTRICTEQ):
(testJNSTRICTEQB):
(testJSTRICTEQB):
(testJNSTRICTEQF):
(testJSTRICTEQF):

Source/JavaScriptCore:

This patch introduces op_jeq, op_jneq, op_jstricteq, and op_jnstricteq.
It offers 3 benefit.

1. They are introduced due to the similar purpose to op_jless etc. It aligns
op_eq families to op_jless families.

2. It reduces the size of bytecode to represent the typical code sequence.

3. It offers the way to fuse check and jump in DFG code generation. Since
we have MovHint between Branch and CompareEq/CompareStrictEq previously,
we cannot do this optimization. It reduces the machine code size in DFG too.

It slightly improves Octane/boyer.

    boyer  6.18038+-0.05002    ^     6.06990+-0.04176       ^ definitely 1.0182x faster

* bytecode/BytecodeDumper.cpp:
(JSC::BytecodeDumper<Block>::dumpBytecode):
* bytecode/BytecodeList.json:
* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):
* bytecode/Opcode.h:
(JSC::isBranch):
* bytecode/PreciseJumpTargetsInlines.h:
(JSC::extractStoredJumpTargetsForBytecodeOffset):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitJumpIfTrue):
(JSC::BytecodeGenerator::emitJumpIfFalse):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGCapabilities.cpp:
(JSC::DFG::capabilityLevel):
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileStrictEq):
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
(JSC::JIT::privateCompileSlowCases):
* jit/JIT.h:
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_jeq):
(JSC::JIT::emit_op_neq):
(JSC::JIT::emit_op_jneq):
(JSC::JIT::compileOpStrictEq):
(JSC::JIT::emit_op_stricteq):
(JSC::JIT::emit_op_nstricteq):
(JSC::JIT::compileOpStrictEqJump):
(JSC::JIT::emit_op_jstricteq):
(JSC::JIT::emit_op_jnstricteq):
(JSC::JIT::emitSlow_op_jstricteq):
(JSC::JIT::emitSlow_op_jnstricteq):
(JSC::JIT::emitSlow_op_jeq):
(JSC::JIT::emitSlow_op_jneq):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emitSlow_op_eq):
(JSC::JIT::emit_op_jeq):
(JSC::JIT::compileOpEqJumpSlow):
(JSC::JIT::emitSlow_op_jeq):
(JSC::JIT::emit_op_jneq):
(JSC::JIT::emitSlow_op_jneq):
(JSC::JIT::compileOpStrictEq):
(JSC::JIT::emit_op_stricteq):
(JSC::JIT::emit_op_nstricteq):
(JSC::JIT::compileOpStrictEqJump):
(JSC::JIT::emit_op_jstricteq):
(JSC::JIT::emit_op_jnstricteq):
(JSC::JIT::emitSlow_op_jstricteq):
(JSC::JIT::emitSlow_op_jnstricteq):
* jit/JITOperations.cpp:
* jit/JITOperations.h:
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* llint/LLIntSlowPaths.h:
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:

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

18 months agoIgnore sandbox_init_with_parameters deprecation warnings
timothy_horton@apple.com [Sat, 24 Mar 2018 21:23:07 +0000 (21:23 +0000)]
Ignore sandbox_init_with_parameters deprecation warnings
https://bugs.webkit.org/show_bug.cgi?id=183979

Reviewed by Dan Bernstein.

* Shared/ios/ChildProcessIOS.mm:
(WebKit::ChildProcess::initializeSandbox):

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

18 months agowebkitpy: Unrecognized mac versions always use WebKitTestRunner
jbedard@apple.com [Sat, 24 Mar 2018 20:46:46 +0000 (20:46 +0000)]
webkitpy: Unrecognized mac versions always use WebKitTestRunner
https://bugs.webkit.org/show_bug.cgi?id=183681
<rdar://problem/38509162>

Reviewed by Daniel Bates.

When an unrecognized version is used, we were unconditionally adding '-wk2'
to the mac version name. This would mean that the port object would always
use WebKitTestRunner as the driver, even if DumpRenderTree was explicitly
requested.

* Scripts/webkitpy/port/apple.py:
(ApplePort.determine_full_port_name): Only add wk2 to port names if
WebKitTestRunner is specified.
* Scripts/webkitpy/port/mac.py:
(MacPort.__init__): Compare length of split string, and do not treat wk2 as a
version name.
* Scripts/webkitpy/port/mac_unittest.py:
(MacTest):
(MacTest.test_factory_with_future_version): Confirm that future versions correctly
assign the driver and have undefined version names.
(MacTest.test_factory_with_portname_version): Confirm that general versions correctly assign
the driver and have defined versions.
(MacTest.test_factory_with_portname_wk2): Ensure that mac ports ending in 'wk2' set
the driver to be WebKitTestRunner even if webkit_test_runner=False.

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

18 months agoUse SecurityOriginData more consistently in Service Worker code
cdumez@apple.com [Sat, 24 Mar 2018 19:54:42 +0000 (19:54 +0000)]
Use SecurityOriginData more consistently in Service Worker code
https://bugs.webkit.org/show_bug.cgi?id=183969

Reviewed by Darin Adler.

Source/WebCore:

Use SecurityOriginData more consistently in Service Worker code to avoid constructing
SecurityOrigin objects unnecessarily.

I also updated SecurityOrigin to use SecurityOriginData as a data member. This reduces
code duplication a bit. This also avoids constructing SecurityOriginData unnecessarily
in some cases as callers can now use SecurityOrigin::data() instead of
SecurityOriginData::fromSecurityOrigin().

No new tests, no Web-facing behavior change.

* Modules/cache/DOMCacheStorage.cpp:
(WebCore::DOMCacheStorage::origin const):
* Modules/encryptedmedia/CDM.cpp:
(WebCore::CDM::storageDirectory const):
* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::mediaKeysStorageDirectory const):
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
(WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory const):
* Modules/indexeddb/IDBFactory.cpp:
(WebCore::IDBFactory::openInternal):
(WebCore::IDBFactory::deleteDatabase):
* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::getAllDatabaseNames):
* Modules/webdatabase/Database.cpp:
(WebCore::Database::securityOrigin):
* Modules/webdatabase/DatabaseContext.cpp:
(WebCore::DatabaseContext::securityOrigin const):
* Modules/webdatabase/DatabaseContext.h:
* Modules/webdatabase/DatabaseManager.cpp:
(WebCore::DatabaseManager::fullPathForDatabase):
(WebCore::DatabaseManager::detailsForNameAndOrigin):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerMediaKeysStorageDirectory const):
* inspector/agents/InspectorDOMStorageAgent.cpp:
(WebCore::InspectorDOMStorageAgent::findStorageArea):
* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::calculateQuotaForOrigin):
(WebCore::ApplicationCacheStorage::calculateUsageForOrigin):
(WebCore::ApplicationCacheStorage::calculateRemainingSizeForOriginExcludingCache):
(WebCore::ApplicationCacheStorage::storeUpdatedQuotaForOrigin):
(WebCore::ApplicationCacheStorage::store):
(WebCore::ApplicationCacheStorage::ensureOriginRecord):
* page/DOMWindow.cpp:
(WebCore:: const):
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::SecurityOrigin):
(WebCore::SecurityOrigin::isPotentiallyTrustworthy const):
(WebCore::SecurityOrigin::canAccess const):
(WebCore::SecurityOrigin::canDisplay const):
(WebCore::SecurityOrigin::domainForCachePartition const):
(WebCore::SecurityOrigin::isLocal const):
(WebCore::SecurityOrigin::toString const):
(WebCore::SecurityOrigin::toRawString const):
(WebCore::SecurityOrigin::create):
(WebCore::SecurityOrigin::isSameSchemeHostPort const):
* page/SecurityOrigin.h:
(WebCore::SecurityOrigin::protocol const):
(WebCore::SecurityOrigin::host const):
(WebCore::SecurityOrigin::port const):
(WebCore::SecurityOrigin::data const):
(WebCore::SecurityOrigin::isHTTPFamily const):
* page/SecurityOriginData.cpp:
(WebCore::SecurityOriginData::toString const):
(WebCore::SecurityOriginData::fromFrame):
* page/SecurityOriginData.h:
(WebCore::SecurityOriginData::fromURL):
* storage/StorageNamespaceProvider.cpp:
(WebCore::StorageNamespaceProvider::localStorageArea):
* testing/Internals.cpp:
(WebCore::Internals::clearCacheStorageMemoryRepresentation):
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::addRegistration):
(WebCore::ServiceWorkerContainer::removeRegistration):
(WebCore::ServiceWorkerContainer::updateRegistration):
* workers/service/ServiceWorkerRegistrationKey.cpp:
(WebCore::ServiceWorkerRegistrationKey::relatesToOrigin const):
* workers/service/ServiceWorkerRegistrationKey.h:
* workers/service/server/SWOriginStore.cpp:
(WebCore::SWOriginStore::add):
(WebCore::SWOriginStore::remove):
(WebCore::SWOriginStore::clear):
* workers/service/server/SWOriginStore.h:
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::addRegistration):
(WebCore::SWServer::removeRegistration):
(WebCore::SWServer::clear):
(WebCore::SWServer::tryInstallContextData):
(WebCore::SWServer::serverToContextConnectionCreated):
(WebCore::SWServer::markAllWorkersForOriginAsTerminated):
(WebCore::SWServer::unregisterServiceWorkerClient):
(WebCore::SWServer::needsServerToContextConnectionForOrigin const):
* workers/service/server/SWServer.h:
* workers/service/server/SWServerToContextConnection.cpp:
(WebCore::SWServerToContextConnection::SWServerToContextConnection):
(WebCore::SWServerToContextConnection::~SWServerToContextConnection):
(WebCore::SWServerToContextConnection::connectionForOrigin):
* workers/service/server/SWServerToContextConnection.h:
(WebCore::SWServerToContextConnection::securityOrigin const):
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::origin const):
(WebCore::SWServerWorker::securityOrigin const):
* workers/service/server/SWServerWorker.h:

Source/WebKit:

Use SecurityOriginData more consistently in Service Worker code to avoid constructing
SecurityOrigin objects unnecessarily.

* NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::encode const):
* Shared/API/c/WKSecurityOriginRef.cpp:
(WKSecurityOriginCopyDatabaseIdentifier):
* StorageProcess/ServiceWorker/WebSWOriginStore.cpp:
(WebKit::WebSWOriginStore::addToStore):
(WebKit::WebSWOriginStore::removeFromStore):
* StorageProcess/ServiceWorker/WebSWOriginStore.h:
* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::scheduleJobInServer):
(WebKit::WebSWServerConnection::registerServiceWorkerClient):
* StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
(WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
* StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::connectionToContextProcessWasClosed):
(WebKit::StorageProcess::needsServerToContextConnectionForOrigin const):
(WebKit::StorageProcess::createStorageToWebProcessConnection):
(WebKit::StorageProcess::deleteWebsiteDataForOrigins):
(WebKit::StorageProcess::serverToContextConnectionForOrigin):
(WebKit::StorageProcess::createServerToContextConnection):
(WebKit::StorageProcess::swContextConnectionMayNoLongerBeNeeded):
* StorageProcess/StorageProcess.h:
* UIProcess/API/APIFrameInfo.cpp:
(API::FrameInfo::create):
* UIProcess/API/C/WKApplicationCacheManager.cpp:
(WKApplicationCacheManagerDeleteEntriesForOrigin):
* UIProcess/API/C/WKKeyValueStorageManager.cpp:
(WKKeyValueStorageManagerDeleteEntriesForOrigin):
* UIProcess/API/C/WKResourceCacheManager.cpp:
(WKResourceCacheManagerClearCacheForOrigin):
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreRemoveFetchCacheForOrigin):
(WKWebsiteDataStoreGetFetchCacheSizeForOrigin):
* UIProcess/ServiceWorkerProcessProxy.cpp:
(WebKit::ServiceWorkerProcessProxy::create):
(WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
(WebKit::ServiceWorkerProcessProxy::getLaunchOptions):
* UIProcess/ServiceWorkerProcessProxy.h:
* UIProcess/Storage/StorageProcessProxy.cpp:
(WebKit::StorageProcessProxy::getStorageProcessConnection):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
(WebKit::WebProcessPool::disconnectProcess):
(WebKit::WebProcessPool::updateProcessAssertions):
* UIProcess/WebProcessPool.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::fetchDataAndApply):
* WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
(WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageCopyOriginsWithApplicationCache):
* WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
(WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest):
(WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices):
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::registerServiceWorkerClient):
(WebKit::WebSWClientConnection::matchRegistration):
(WebKit::WebSWClientConnection::whenRegistrationReady):
(WebKit::WebSWClientConnection::getRegistrations):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::exceededDatabaseQuota):
(WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::fetchWebsiteData):
* WebProcess/WebStorage/StorageAreaImpl.cpp:
(WebKit::StorageAreaImpl::securityOrigin const):
* WebProcess/WebStorage/StorageAreaImpl.h:
* WebProcess/WebStorage/StorageAreaMap.cpp:
(WebKit::StorageAreaMap::StorageAreaMap):
(WebKit::StorageAreaMap::dispatchSessionStorageEvent):
(WebKit::StorageAreaMap::dispatchLocalStorageEvent):
* WebProcess/WebStorage/StorageNamespaceImpl.cpp:
(WebKit::StorageNamespaceImpl::didDestroyStorageAreaMap):

Source/WebKitLegacy:

Use SecurityOrigin::data() instead of SecurityOriginData::fromSecurityOrigin().

* Storage/StorageTracker.cpp:
(WebKit::StorageTracker::diskUsageForOrigin):

Source/WebKitLegacy/mac:

Use SecurityOrigin::data() instead of SecurityOriginData::fromSecurityOrigin().

* Storage/WebDatabaseManager.mm:
(-[WebDatabaseManager databasesWithOrigin:]):
(-[WebDatabaseManager deleteOrigin:]):
(-[WebDatabaseManager deleteDatabase:withOrigin:]):
* Storage/WebDatabaseQuotaManager.mm:
(-[WebDatabaseQuotaManager usage]):
(-[WebDatabaseQuotaManager quota]):
(-[WebDatabaseQuotaManager setQuota:]):
* Storage/WebStorageManager.mm:
(-[WebStorageManager deleteOrigin:]):
* WebCoreSupport/WebSecurityOrigin.mm:
(-[WebSecurityOrigin databaseIdentifier]):
(-[WebSecurityOrigin usage]):
(-[WebSecurityOrigin quota]):
(-[WebSecurityOrigin setQuota:]):

Source/WebKitLegacy/win:

Use SecurityOrigin::data() instead of SecurityOriginData::fromSecurityOrigin().

* WebDatabaseManager.cpp:
(WebDatabaseManager::databasesWithOrigin):
(WebDatabaseManager::deleteOrigin):
(WebDatabaseManager::deleteDatabase):
(WebDatabaseManager::setQuota):
* WebSecurityOrigin.cpp:
(WebSecurityOrigin::usage):
(WebSecurityOrigin::quota):
(WebSecurityOrigin::setQuota):

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

18 months ago[JSC] Improve constants and add comments for CodeBlockHash
utatane.tea@gmail.com [Sat, 24 Mar 2018 19:29:03 +0000 (19:29 +0000)]
[JSC] Improve constants and add comments for CodeBlockHash
https://bugs.webkit.org/show_bug.cgi?id=183982

Rubber-stamped by Mark Lam.

* bytecode/CodeBlockHash.cpp:
(JSC::CodeBlockHash::CodeBlockHash):
* bytecode/ParseHash.cpp:
(JSC::ParseHash::ParseHash):

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

18 months ago[JSC] Add options to report parsing and bytecode compiling times
utatane.tea@gmail.com [Sat, 24 Mar 2018 19:04:18 +0000 (19:04 +0000)]
[JSC] Add options to report parsing and bytecode compiling times
https://bugs.webkit.org/show_bug.cgi?id=183982

Reviewed by Mark Lam.

This patch adds reportParseTimes and reportBytecodeCompileTimes options.
When they are enabled, JSC reports times consumed for parsing and bytecode
compiling.

* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* bytecode/ParseHash.cpp: Added.
(JSC::ParseHash::ParseHash):
* bytecode/ParseHash.h: Added.
(JSC::ParseHash::hashForCall const):
(JSC::ParseHash::hashForConstruct const):
* bytecode/UnlinkedFunctionExecutable.cpp:
(JSC::generateUnlinkedFunctionCodeBlock):
* bytecompiler/BytecodeGenerator.h:
(JSC::BytecodeGenerator::generate):
* parser/Parser.h:
(JSC::parse):
* runtime/CodeCache.h:
(JSC::generateUnlinkedCodeBlock):
* runtime/Options.h:

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

18 months ago[JIT] Drop ENABLE_JIT_VERBOSE flag
utatane.tea@gmail.com [Sat, 24 Mar 2018 17:10:23 +0000 (17:10 +0000)]
[JIT] Drop ENABLE_JIT_VERBOSE flag
https://bugs.webkit.org/show_bug.cgi?id=183983

Reviewed by Mark Lam.

Just use JITInternal::verbose value.

* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
(JSC::JIT::privateCompileSlowCases):
(JSC::JIT::link):

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

18 months agoFix the !ENABLE(MEDIA_STREAM) build
timothy_horton@apple.com [Sat, 24 Mar 2018 09:55:35 +0000 (09:55 +0000)]
Fix the !ENABLE(MEDIA_STREAM) build
https://bugs.webkit.org/show_bug.cgi?id=183977

Reviewed by Wenson Hsieh.

* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
* WebProcess/cocoa/UserMediaCaptureManager.messages.in:

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

18 months agoWKFileUploadPanel shouldn't depend on WebKitLegacy
timothy_horton@apple.com [Sat, 24 Mar 2018 09:45:57 +0000 (09:45 +0000)]
WKFileUploadPanel shouldn't depend on WebKitLegacy
https://bugs.webkit.org/show_bug.cgi?id=183981

Reviewed by Wenson Hsieh.

* UIProcess/ios/forms/WKFileUploadPanel.mm:
(-[WKFileUploadPanel _uploadItemForImageData:imageName:successBlock:failureBlock:]):
Just use the underlying WebCore function instead of the
unnecessary NSFileManager category method.

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

18 months agoUnreviewed, rolling out r229792.
commit-queue@webkit.org [Sat, 24 Mar 2018 09:10:19 +0000 (09:10 +0000)]
Unreviewed, rolling out r229792.
https://bugs.webkit.org/show_bug.cgi?id=183980

not actually necessary (Requested by thorton on #webkit).

Reverted changeset:

"Fix the build"
https://trac.webkit.org/changeset/229792

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

18 months agoFix the build
timothy_horton@apple.com [Sat, 24 Mar 2018 08:16:58 +0000 (08:16 +0000)]
Fix the build

* WebView/WebView.mm:

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

18 months agoFix the run-benchmark script, properly specifying the plan directory
zandobersek@gmail.com [Sat, 24 Mar 2018 07:06:23 +0000 (07:06 +0000)]
Fix the run-benchmark script, properly specifying the plan directory
where the Skipped file is located.

Rubber-stamped by Carlos Alberto Lopez Perez.

* Scripts/webkitpy/benchmark_runner/run_benchmark.py:
(start):

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

18 months agoFix the geolocation build
timothy_horton@apple.com [Sat, 24 Mar 2018 06:27:38 +0000 (06:27 +0000)]
Fix the geolocation build
https://bugs.webkit.org/show_bug.cgi?id=183975

* Modules/geolocation/ios/GeolocationPositionIOS.mm:
(WebCore::GeolocationPosition::GeolocationPosition):

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

18 months agoFix the !HAVE(APP_LINKS) build
timothy_horton@apple.com [Sat, 24 Mar 2018 06:26:21 +0000 (06:26 +0000)]
Fix the !HAVE(APP_LINKS) build
https://bugs.webkit.org/show_bug.cgi?id=183974

Reviewed by Dan Bernstein.

* pal/spi/cocoa/LaunchServicesSPI.h:
This header is not very !HAVE(APP_LINKS) friendly.

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

18 months agoFix the build with no pasteboard
timothy_horton@apple.com [Sat, 24 Mar 2018 05:56:49 +0000 (05:56 +0000)]
Fix the build with no pasteboard
https://bugs.webkit.org/show_bug.cgi?id=183973

Reviewed by Dan Bernstein.

* .../Configurations/FeatureDefines.xcconfig:
* WebView/WebView.mm:
(-[WebView _requestStartDataInteraction:globalPosition:]):
(-[WebView _getDataInteractionData]):
(-[WebView _dataOperationTextIndicator]):
(-[WebView _dragSourceAction]):
(-[WebView _draggedLinkTitle]):
(-[WebView _draggedLinkURL]):
(-[WebView _draggedElementBounds]):
(-[WebView _enteredDataInteraction:client:global:operation:]):
(-[WebView _updatedDataInteraction:client:global:operation:]):
(-[WebView _exitedDataInteraction:client:global:operation:]):
(-[WebView _performDataInteraction:client:global:operation:]):
(-[WebView _tryToPerformDataInteraction:client:global:operation:]):
(-[WebView _endedDataInteraction:global:]):
(-[WebView _dataInteractionCaretRect]):
* WebView/WebViewPrivate.h:

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

18 months agoAdopt WK_ALTERNATE_FRAMEWORKS_DIR in WebKitLegacy and update install name
timothy_horton@apple.com [Sat, 24 Mar 2018 02:30:15 +0000 (02:30 +0000)]
Adopt WK_ALTERNATE_FRAMEWORKS_DIR in WebKitLegacy and update install name
https://bugs.webkit.org/show_bug.cgi?id=183960
<rdar://problem/38812356>

Reviewed by Dan Bernstein.

* Configurations/WebKitLegacy.xcconfig:

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

18 months agoWeb Inspector: Styles: don't show checkboxes for invalid properties
nvasilyev@apple.com [Sat, 24 Mar 2018 01:26:05 +0000 (01:26 +0000)]
Web Inspector: Styles: don't show checkboxes for invalid properties
https://bugs.webkit.org/show_bug.cgi?id=183951
<rdar://problem/38807602>

Reviewed by Matt Baker.

Since toggling of invalid properties isn't supported by the backend, don't show checkboxes for invalid properties.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
(.spreadsheet-css-declaration:matches(:hover, :focus) .property:not(:matches(.invalid-name, .invalid-value)) .property-toggle,):
(.spreadsheet-css-declaration:matches(:hover, :focus) .property-toggle,): Deleted.
Don't show checkboxes for invalid properties but still show them for duplicate properties.

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

18 months agoEnable unified text selection in select cases for gradual testing
megan_gardner@apple.com [Sat, 24 Mar 2018 01:17:07 +0000 (01:17 +0000)]
Enable unified text selection in select cases for gradual testing
https://bugs.webkit.org/show_bug.cgi?id=183967
<rdar://problem/38815328>

Reviewed by Tim Horton.

Enable in select places for a more gradual switch, as this is a big change and we want to make sure
it works before switching completely.

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

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

18 months ago[Extra zoom mode] Fix some localizable strings after r229878
wenson_hsieh@apple.com [Sat, 24 Mar 2018 00:33:52 +0000 (00:33 +0000)]
[Extra zoom mode] Fix some localizable strings after r229878
https://bugs.webkit.org/show_bug.cgi?id=183963

Reviewed by Tim Horton.

The WEB_UI_STRING macro was incorrectly used for certain localized strings pertaining to extra zoom mode. To
correct this, make the "Done" string use WEB_UI_STRING with actual UI-facing text; since day, year and month
labels in the date picker are less generalizable to other UI, leave these as unique keys, but change them to
use WEB_UI_STRING_KEY instead.

Additionally, remove now-unused localizable strings for the text input view controller.

* English.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::formControlDoneButtonTitle):
(WebCore::datePickerDayLabelTitle):
(WebCore::datePickerMonthLabelTitle):
(WebCore::datePickerYearLabelTitle):

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

18 months agoIntroduce and adopt HAVE(AUDIO_TOOLBOX_AUDIO_SESSION)
timothy_horton@apple.com [Sat, 24 Mar 2018 00:00:32 +0000 (00:00 +0000)]
Introduce and adopt HAVE(AUDIO_TOOLBOX_AUDIO_SESSION)
https://bugs.webkit.org/show_bug.cgi?id=183954
<rdar://problem/38808858>

Reviewed by Dan Bernstein.

* wtf/Platform.h:

* WebView/WebPreferences.mm:
(-[WebPreferences setAudioSessionCategoryOverride:]):

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

18 months agoUpdate WPT tools to a1ec330
youenn@apple.com [Fri, 23 Mar 2018 23:49:58 +0000 (23:49 +0000)]
Update WPT tools to a1ec330
https://bugs.webkit.org/show_bug.cgi?id=183934

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* resources/config.json:
* resources/import-expectations.json:
* web-platform-tests/config.default.json:
* web-platform-tests/tools/: Refreshed.

Tools:

Update script to run WPT server  according updated WPT tools.

* Scripts/webkitpy/layout_tests/servers/web_platform_test_launcher.py:
(main):
* Scripts/webkitpy/layout_tests/servers/web_platform_test_server.py:
(base_http_url):
(base_https_url):

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

18 months agoResource Load Statistics: Pick up ITP debug mode flag from defaults
wilander@apple.com [Fri, 23 Mar 2018 23:48:23 +0000 (23:48 +0000)]
Resource Load Statistics: Pick up ITP debug mode flag from defaults
https://bugs.webkit.org/show_bug.cgi?id=183956
<rdar://problem/38559574>

Reviewed by Brent Fulgham.

* UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
(WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):

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

18 months agoNetworkStateNotifier::updateStateWithoutNotifying() is inefficient
cdumez@apple.com [Fri, 23 Mar 2018 23:46:50 +0000 (23:46 +0000)]
NetworkStateNotifier::updateStateWithoutNotifying() is inefficient
https://bugs.webkit.org/show_bug.cgi?id=183760
<rdar://problem/37093299>

Reviewed by Ryosuke Niwa.

Update NetworkStateNotifier::updateStateWithoutNotifying() to stop calling
SCDynamicStoreCopyKeyList(). SCDynamicStoreCopyKeyList() is expensive as it
expects its key parameter to be a regular expression and it can match several
keys. It is also unnecessary in our case since we already have an exact key.
We now call the more efficient SCDynamicStoreCopyValue() instead, which is
the right thing to call when we have an exact key.

This change was suggested by the SC team.

This was tested manually as there is no easy way to write an automated test
for this.

In a follow-up, I also plan to call this code in the UIProcess (or NetworkProcess)
to avoid calling it once per WebProcess.

* platform/network/mac/NetworkStateNotifierMac.cpp:
(WebCore::NetworkStateNotifier::updateStateWithoutNotifying):

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

18 months agoUnreviewed attempt to fix Windows build after r229926.
cdumez@apple.com [Fri, 23 Mar 2018 23:41:59 +0000 (23:41 +0000)]
Unreviewed attempt to fix Windows build after r229926.

* WebView.cpp:

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

18 months agoUnreviewed, rolling out r229868.
dbates@webkit.org [Fri, 23 Mar 2018 23:37:13 +0000 (23:37 +0000)]
Unreviewed, rolling out r229868.

Caused media controls tests to timeout. Will investigate
offline.

Reverted changeset:

"CSS mask images should be retrieved using potentially CORS-
enabled fetch"
https://bugs.webkit.org/show_bug.cgi?id=179983
https://trac.webkit.org/changeset/229868

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

18 months agoWeb Inspector: add WebKitAdditions hooks for WebInspectorUI
bburg@apple.com [Fri, 23 Mar 2018 23:35:03 +0000 (23:35 +0000)]
Web Inspector: add WebKitAdditions hooks for WebInspectorUI
https://bugs.webkit.org/show_bug.cgi?id=183940
<rdar://problem/38796310>

Reviewed by Timothy Hatcher.

* Scripts/combine-resources.pl:
(debugLog): Added. Leave in the logging I used to debug this.

(concatenateIncludedFilesMatchingPattern):
(stripIncludedFilesMatchingPattern):
(concatenateFiles): Deleted.
This function tried to do too many things. Split it into
two functions, one for stripping includes and one for concatenating
files referenced by includes.

Lastly, add a negative lookahead clause for 'WebKitAdditions' so includes
containing that string are not combined when no input directory is passed
to the script.

* Scripts/copy-user-interface-resources.pl:
WebKitAdditions is computed either from BUILT_PRODUCTS_DIR or SDKROOT,
depending on the build style. Just try them in order and use the first
one that exists. WebInspectorUI files are in their own directory, so
we can assume there are files to process if that directory exists.

Copy Main.html to derived sources before doing any processing on it.
This makes all combining phases have the same --input-html argument.

(debugLog): Added. Leave in the logging I used to debug this.

(combineOrStripResourcesForWebKitAdditions):
(stripResourcesForWebKitAdditions):
(combineResourcesForWebKitAdditions):
Determine if WebKitAdditions exists and whether there are any
resources for WebInspectorUI present that need to be processed.

* UserInterface/Main.html:
Add stub .js and .css WebKitAdditions files. We can add more later
if it makes sense but this is good enough to validate the build machinery.

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

18 months agoAdd pointer profiling hooks to the CSS JIT.
mark.lam@apple.com [Fri, 23 Mar 2018 23:28:05 +0000 (23:28 +0000)]
Add pointer profiling hooks to the CSS JIT.
https://bugs.webkit.org/show_bug.cgi?id=183947
<rdar://problem/38803593>

Reviewed by JF Bastien.

No new tests needed.  Covered by existing tests.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
- Added a missing application of WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION().

* bindings/scripts/test/JS/JSInterfaceName.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSMapLike.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestCEReactions.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestCallTracer.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestException.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestIterable.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestPluginInterface.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestSerialization.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::toJSNewlyCreated):
* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::ruleMatches):
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::compile):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
* cssjit/SelectorCompiler.h:
(WebCore::SelectorCompiler::ruleCollectorSimpleSelectorCheckerFunction):
(WebCore::SelectorCompiler::querySelectorSimpleSelectorCheckerFunction):
(WebCore::SelectorCompiler::ruleCollectorSelectorCheckerFunctionWithCheckingContext):
(WebCore::SelectorCompiler::querySelectorSelectorCheckerFunctionWithCheckingContext):
* dom/SelectorQuery.cpp:
(WebCore::SelectorDataList::executeCompiledSingleMultiSelectorData const):
(WebCore::SelectorDataList::execute const):

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

18 months agoAdopt WK_PLATFORM_NAME in WebKitLegacy
timothy_horton@apple.com [Fri, 23 Mar 2018 22:47:48 +0000 (22:47 +0000)]
Adopt WK_PLATFORM_NAME in WebKitLegacy
https://bugs.webkit.org/show_bug.cgi?id=183948
<rdar://problem/38803908>

Reviewed by Dan Bernstein.

Source/WebKitLegacy:

* WebKitLegacy.xcodeproj/project.pbxproj:

Source/WebKitLegacy/mac:

* Configurations/WebKitLegacy.xcconfig:
* MigrateHeaders.make:
* postprocess-headers.sh:

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

18 months agoLocal storage getItem() for an empty string returned UNDEFINED value.
commit-queue@webkit.org [Fri, 23 Mar 2018 22:41:40 +0000 (22:41 +0000)]
Local storage getItem() for an empty string returned UNDEFINED value.
https://bugs.webkit.org/show_bug.cgi?id=69138
<rdar://problem/13410974>

Patch by Sihui Liu <sihui_liu@apple.com> on 2018-03-23
Reviewed by Brady Eidson.

Source/WebCore:

* platform/sql/SQLiteStatement.cpp:
(WebCore::SQLiteStatement::getColumnBlobAsString):

Tools:

Add API test coverage.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/LocalStoragePersistence.mm: Added.
(-[LocalStorageMessageHandler userContentController:didReceiveScriptMessage:]):
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/localstorage-empty-string-value.html: Added.

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