WebKit-https.git
17 months agoImplement Same-Site cookies
dbates@webkit.org [Mon, 23 Apr 2018 20:58:35 +0000 (20:58 +0000)]
Implement Same-Site cookies
https://bugs.webkit.org/show_bug.cgi?id=159464
<rdar://problem/27196358>

Reviewed by Brent Fulgham.

Source/WebCore:

Implements support for Same-Site cookies as per <https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00>.
The implementation is materially consistent with the spec. though implements the computation
for a document's "site for cookies" indirectly as part of loading its frame. This is done to
avoid traversing the frame tree on each subresource request initiated by the document or one
of its workers. We take advantage of the fact that Web Workers and Service Workers use their
host document's loader to load resources on their behalf to use the correct "site for cookies"
for requests (e.g. fetch()) initiating by them without the need to duplicate and store the
host document's "site for cookies" in the worker's script execution context.

The implementation differs from the spec. in the handling of about: URLs and the empty URL
and makes the implementation in WebKit match the behavior of Chrome and Firefox as well as
consistent with origin inheritance as described in <https://html.spec.whatwg.org/multipage/browsers.html#origin>
(16 April 2018). Specifically, requests to about:blank, about:srcdoc and the empty URL ("")
are treated as same-site because these URLs inherit their origin from their owner.

Tests: http/tests/cookies/same-site/fetch-after-navigating-iframe-in-cross-origin-page.html
       http/tests/cookies/same-site/fetch-after-top-level-navigation-from-cross-origin-page.html
       http/tests/cookies/same-site/fetch-after-top-level-navigation-initiated-from-iframe-in-cross-origin-page.html
       http/tests/cookies/same-site/fetch-cookies-set-in-about-blank-iframe.html
       http/tests/cookies/same-site/fetch-in-about-blank-page.html
       http/tests/cookies/same-site/fetch-in-cross-origin-iframe.html
       http/tests/cookies/same-site/fetch-in-cross-origin-page.html
       http/tests/cookies/same-site/fetch-in-cross-origin-service-worker.html
       http/tests/cookies/same-site/fetch-in-cross-origin-worker.html
       http/tests/cookies/same-site/fetch-in-same-origin-page.html
       http/tests/cookies/same-site/fetch-in-same-origin-service-worker.html
       http/tests/cookies/same-site/fetch-in-same-origin-srcdoc-iframe.html
       http/tests/cookies/same-site/fetch-in-same-origin-worker.html
       http/tests/cookies/same-site/popup-cross-site-post.html
       http/tests/cookies/same-site/popup-cross-site.html
       http/tests/cookies/same-site/popup-same-site-post.html
       http/tests/cookies/same-site/popup-same-site-via-cross-site-redirect.html
       http/tests/cookies/same-site/popup-same-site-via-same-site-redirect.html
       http/tests/cookies/same-site/popup-same-site.html

* Sources.txt: Add source file SameSiteInfo.cpp.
* WebCore.xcodeproj/project.pbxproj: Add source files SameSiteInfo.{cpp, h}.
* dom/Document.cpp:
(WebCore::Document::initSecurityContext): Modified to call SecurityPolicy::shouldInheritSecurityOriginFromOwner().
(WebCore::Document::shouldInheritContentSecurityPolicyFromOwner const): Ditto.
(WebCore::shouldInheritSecurityOriginFromOwner): Deleted; moved to SecurityPolicy.
* dom/Document.h:
(WebCore::Document::firstPartyForSameSiteCookies const): Added.
(WebCore::Document::setFirstPartyForSameSiteCookies): Added.
* loader/CookieJar.cpp:
(WebCore::sameSiteInfo): Returns the same-site info for the request used to load the specified document.
(WebCore::cookies): Pass the same-site info down to the platform.
(WebCore::cookieRequestHeaderFieldProxy): Ditto.
(WebCore::setCookies): Ditto.
(WebCore::cookieRequestHeaderFieldValue): Ditto.
(WebCore::getRawCookies): Ditto.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::willSendRequest): Add same-site info to the request.
(WebCore::DocumentLoader::startLoadingMainResource): Update a FIXME comment to explain that
we can simplify ResourceRequestBase if we can remove the call to addExtraFieldsToMainResourceRequest()
here. Specifically, we would not need to differentiate between a request with an unspecified
same-site state (default state of a new request) from a request whose same-site state has
been explicitly set if we can assume that the same-site state of a request is set exactly
once. In absence of this guarantee we need an "unspecified" state to avoid overriding existing
same-site information computed with a null initiating document (the case of a new address bar
initiated load) from a load initiated by the document associated with this loader.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::setFirstPartyForCookies): Modified to also update the first party for
same-site cookies ("site for cookies").
(WebCore::FrameLoader::load): Add same-site info to the request.
(WebCore::FrameLoader::reload): Ditto.
(WebCore::FrameLoader::setOriginalURLForDownloadRequest): Ditto.
(WebCore::FrameLoader::addExtraFieldsToRequest): If the request does not already have
same-site info then compute it and add it to the request. Mark main frame main resource
requests as a "top-site".
(WebCore::FrameLoader::addSameSiteInfoToRequestIfNeeded): Implements the "'Same-site' and 'cross-site'
Requests" algorithm from <https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00#section-2.1>.
(WebCore::createWindow): Add same-site info to the request.
* loader/FrameLoader.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::init): Ditto.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::createWindow): Ditto.
* page/SecurityPolicy.cpp:
(WebCore::SecurityPolicy::shouldInheritSecurityOriginFromOwner): Moved from Document.cpp.
* page/SecurityPolicy.h:
* platform/CookiesStrategy.h:
* platform/network/CacheValidation.cpp:
(WebCore::headerValueForVary): Pass the same-site info down to the platform.
* platform/network/CookieRequestHeaderFieldProxy.h:
(WebCore::CookieRequestHeaderFieldProxy::encode const): Encode same-site bits.
(WebCore::CookieRequestHeaderFieldProxy::decode): Decode same-site bits.
* platform/network/PlatformCookieJar.h:
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::setAsIsolatedCopy): Added.
(WebCore::ResourceRequestBase::isSameSite const): Added.
(WebCore::ResourceRequestBase::setIsSameSite): Added.
(WebCore::ResourceRequestBase::isTopSite const): Added.
(WebCore::ResourceRequestBase::setIsTopSite): Added.
(WebCore::equalIgnoringHeaderFields):
* platform/network/ResourceRequestBase.h:
(WebCore::ResourceRequestBase::isSameSiteUnspecified const): Added. See comment for DocumentLoader::startLoadingMainResource()
for more details.
(WebCore::registrableDomainsAreEqual): Added.
(WebCore::ResourceRequestBase::encodeBase const): Encode same-site bits.
(WebCore::ResourceRequestBase::decodeBase): Decode same-site bits.
* platform/network/SameSiteInfo.cpp: Added.
(WebCore::SameSiteInfo::create):
* platform/network/SameSiteInfo.h: Added.
(WebCore::SameSiteInfo::encode const):
(WebCore::SameSiteInfo::decode):
* platform/network/cf/CookieJarCFNet.cpp:
(WebCore::setCookiesFromDOM): Pass Same-Site info down.
(WebCore::cookiesForDOM): Ditto.
(WebCore::cookieRequestHeaderFieldValue): Ditto.
(WebCore::getRawCookies): Ditto.
* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::siteForCookies): Added.
(WebCore::ResourceRequest::doUpdatePlatformRequest): Update platform request with same-site info.
(WebCore::ResourceRequest::doUpdateResourceRequest): Ditto.
* platform/network/cocoa/ResourceRequestCocoa.mm:
(WebCore::ResourceRequest::doUpdateResourceRequest): Ditto.
(WebCore::siteForCookies): Added.
(WebCore::ResourceRequest::doUpdatePlatformRequest): Update platform request with same-site info.
* platform/network/curl/CookieJarCurl.cpp:
(WebCore::cookiesForDOM): Pass Same-Site info down.
(WebCore::setCookiesFromDOM): Ditto.
(WebCore::cookieRequestHeaderFieldValue): Ditto.
(WebCore::getRawCookies): Ditto.
* platform/network/curl/CookieJarCurl.h:
* platform/network/curl/CookieJarCurlDatabase.cpp:
(WebCore::CookieJarCurlDatabase::setCookiesFromDOM const): Ditto.
(WebCore::CookieJarCurlDatabase::cookiesForDOM const): Ditto.
(WebCore::CookieJarCurlDatabase::cookieRequestHeaderFieldValue const): Ditto.
(WebCore::CookieJarCurlDatabase::getRawCookies const): Ditto.
* platform/network/curl/CookieJarCurlDatabase.h:
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::createCurlRequest): Ditto.
* platform/network/mac/CookieJarMac.mm:
(WebCore::cookiesForURL): Added; shared function to return the cookies based on the specified criterion.
(WebCore::setHTTPCookiesForURL): Moved from the bottom of the file to top to be closer to the other
CFNetwork helper functions. Modified to support fetching same-site cookies.
(WebCore::httpCookiesForURL): Moved to be under setHTTPCookiesForURL(). Modified to call cookiesForURL().
Note the SPI used in cookiesForURL() apply the same criterion for whether to fetch secure cookies as we
were computing here. That is, the CFNetwork SPI only returns secure cookies if the specified URL's scheme
case-insensitively matches "https".
(WebCore::cookiesInPartitionForURL): Wrote in terms of cookiesForURL().
(WebCore::cookiesForSession): Pass the Same-Site info.
(WebCore::cookiesForDOM): Ditto.
(WebCore::cookieRequestHeaderFieldValue): Ditto.
(WebCore::setCookiesFromDOM): Ditto.
(WebCore::getRawCookies): Ditto.
(WebCore::deleteCookie): Pass std::nullopt for the Same-Site info so that we do not consider the SameSite
attribute when fetching cookies to delete.
* platform/network/soup/CookieJarSoup.cpp:
(WebCore::setCookiesFromDOM): Pass the Same-Site info.
(WebCore::cookiesForDOM): Ditto.
(WebCore::cookieRequestHeaderFieldValue): Ditto.
(WebCore::getRawCookies): Ditto.
* workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::createPageForServiceWorker): Set the first party for same site cookies ("site for cookies") to
the script URL.
* xml/XSLTProcessor.cpp:
(WebCore::XSLTProcessor::createDocumentFromSource): Copy the first party for same-site cookies to the
new document.

Source/WebCore/PAL:

Forward declare some SPI.

* pal/spi/cf/CFNetworkSPI.h:

Source/WebKit:

Pass the Same-Site info through the WebKit abstractions.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
(WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
(WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
(WebKit::NetworkConnectionToWebProcess::getRawCookies):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::logCookieInformation const):
(WebKit::logBlockedCookieInformation):
(logCookieInformationInternal):
(NetworkResourceLoader::logCookieInformation):
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
(WebKit::NetworkCache::constructRevalidationRequest):
* NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
(WebKit::NetworkCache::SubresourceInfo::encode const):
(WebKit::NetworkCache::SubresourceInfo::decode):
(WebKit::NetworkCache::SubresourceInfo::SubresourceInfo):
* NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
(WebKit::NetworkCache::SubresourceInfo::isSameSite const):
(WebKit::NetworkCache::SubresourceInfo::isTopSite const): Returns false; subresources do not represent
a top-level navigation.
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::isThirdPartyRequest):
(WebKit::updateTaskWithFirstPartyForSameSiteCookies):
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
(WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::download):
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::cookiesForDOM):
(WebKit::WebPlatformStrategies::setCookiesFromDOM):
(WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue):
(WebKit::WebPlatformStrategies::getRawCookies):
* WebProcess/WebCoreSupport/WebPlatformStrategies.h:

Source/WebKitLegacy/mac:

Pass the Same-Site info through the strategy.

* WebCoreSupport/WebPlatformStrategies.h:
* WebCoreSupport/WebPlatformStrategies.mm:
(WebPlatformStrategies::cookiesForDOM):
(WebPlatformStrategies::setCookiesFromDOM):
(WebPlatformStrategies::cookieRequestHeaderFieldValue):
(WebPlatformStrategies::getRawCookies):

Source/WebKitLegacy/win:

Pass the Same-Site info through the strategy.

* WebCoreSupport/WebPlatformStrategies.cpp:
(WebPlatformStrategies::cookiesForDOM):
(WebPlatformStrategies::setCookiesFromDOM):
(WebPlatformStrategies::cookieRequestHeaderFieldValue):
(WebPlatformStrategies::getRawCookies):
* WebCoreSupport/WebPlatformStrategies.h:

LayoutTests:

Add tests. These tests are skipped on all ports for now, including Mac and iOS. We will
look to subsequently enable the tests for Mac and iOS once we have CFNetwork support for
Same-Site cookies.

The following tests and utilities were taken in whole or in part from Blink:
    http/tests/cookies/resources/echo-json.php
    http/tests/cookies/resources/post-cookies-onmessage.php
    http/tests/cookies/resources/post-cookies-to-opener.php
    http/tests/cookies/resources/testharness-helpers.js
    http/tests/cookies/same-site/popup-cross-site-post.html
    http/tests/cookies/same-site/popup-cross-site.html
    http/tests/cookies/same-site/popup-same-site-post.html
    http/tests/cookies/same-site/popup-same-site.html

The following files were derived from tests taken from Blink:
    http/tests/cookies/same-site/popup-same-site-via-cross-site-redirect.html
    http/tests/cookies/same-site/popup-same-site-via-same-site-redirect.html

* TestExpectations: Skip on all ports for now.
* http/tests/cookies/resources/cookie-utilities.js: Added.
(createCookie):
(setBaseDocumentWhenFetchingDOMCookies):
(setDOMCookie):
* http/tests/cookies/resources/cookie-utility.php:
* http/tests/cookies/resources/echo-json.php: Added.
* http/tests/cookies/resources/post-cookies-onmessage.php: Added.
* http/tests/cookies/resources/post-cookies-to-opener.php: Added.
* http/tests/cookies/resources/testharness-helpers.js: Added.
(clearKnownCookies):
* http/tests/cookies/same-site/fetch-after-navigating-iframe-in-cross-origin-page-expected.txt: Added.
* http/tests/cookies/same-site/fetch-after-navigating-iframe-in-cross-origin-page.html: Added.
* http/tests/cookies/same-site/fetch-after-top-level-navigation-from-cross-origin-page-expected.txt: Added.
* http/tests/cookies/same-site/fetch-after-top-level-navigation-from-cross-origin-page.html: Added.
* http/tests/cookies/same-site/fetch-after-top-level-navigation-initiated-from-iframe-in-cross-origin-page-expected.txt: Added.
* http/tests/cookies/same-site/fetch-after-top-level-navigation-initiated-from-iframe-in-cross-origin-page.html: Added.
* http/tests/cookies/same-site/fetch-cookies-set-in-about-blank-iframe-expected.txt: Added.
* http/tests/cookies/same-site/fetch-cookies-set-in-about-blank-iframe.html: Added.
* http/tests/cookies/same-site/fetch-in-about-blank-page-expected.txt: Added.
* http/tests/cookies/same-site/fetch-in-about-blank-page.html: Added.
* http/tests/cookies/same-site/fetch-in-cross-origin-iframe-expected.txt: Added.
* http/tests/cookies/same-site/fetch-in-cross-origin-iframe.html: Added.
* http/tests/cookies/same-site/fetch-in-cross-origin-page-expected.txt: Added.
* http/tests/cookies/same-site/fetch-in-cross-origin-page.html: Added.
* http/tests/cookies/same-site/fetch-in-cross-origin-service-worker-expected.txt: Added.
* http/tests/cookies/same-site/fetch-in-cross-origin-service-worker.html: Added.
* http/tests/cookies/same-site/fetch-in-cross-origin-worker-expected.txt: Added.
* http/tests/cookies/same-site/fetch-in-cross-origin-worker.html: Added.
* http/tests/cookies/same-site/fetch-in-same-origin-page-expected.txt: Added.
* http/tests/cookies/same-site/fetch-in-same-origin-page.html: Added.
* http/tests/cookies/same-site/fetch-in-same-origin-service-worker-expected.txt: Added.
* http/tests/cookies/same-site/fetch-in-same-origin-service-worker.html: Added.
* http/tests/cookies/same-site/fetch-in-same-origin-srcdoc-iframe-expected.txt: Added.
* http/tests/cookies/same-site/fetch-in-same-origin-srcdoc-iframe.html: Added.
* http/tests/cookies/same-site/fetch-in-same-origin-worker-expected.txt: Added.
* http/tests/cookies/same-site/fetch-in-same-origin-worker.html: Added.
* http/tests/cookies/same-site/popup-cross-site-expected.txt: Added.
* http/tests/cookies/same-site/popup-cross-site-post-expected.txt: Added.
* http/tests/cookies/same-site/popup-cross-site-post.html: Added.
* http/tests/cookies/same-site/popup-cross-site.html: Added.
* http/tests/cookies/same-site/popup-same-site-expected.txt: Added.
* http/tests/cookies/same-site/popup-same-site-post-expected.txt: Added.
* http/tests/cookies/same-site/popup-same-site-post.html: Added.
* http/tests/cookies/same-site/popup-same-site-via-cross-site-redirect-expected.txt: Added.
* http/tests/cookies/same-site/popup-same-site-via-cross-site-redirect.html: Added.
* http/tests/cookies/same-site/popup-same-site-via-same-site-redirect-expected.txt: Added.
* http/tests/cookies/same-site/popup-same-site-via-same-site-redirect.html: Added.
* http/tests/cookies/same-site/popup-same-site.html: Added.
* http/tests/cookies/same-site/resources/click-hyperlink.php: Added.
* http/tests/cookies/same-site/resources/echo-iframe-src.php: Added.
* http/tests/cookies/same-site/resources/fetch-after-navigating-iframe-in-cross-origin-page.php: Added.
* http/tests/cookies/same-site/resources/fetch-after-top-level-navigation-from-cross-origin-page.php: Added.
* http/tests/cookies/same-site/resources/fetch-after-top-level-navigation-initiated-from-iframe-in-cross-origin-page.php: Added.
* http/tests/cookies/same-site/resources/fetch-in-cross-origin-iframe.html: Added.
* http/tests/cookies/same-site/resources/fetch-in-cross-origin-service-worker.html: Added.
* http/tests/cookies/same-site/resources/fetch-in-cross-origin-worker.js: Added.
(async.checkResult):
* http/tests/cookies/same-site/resources/fetch-in-same-origin-service-worker.php: Added.
* http/tests/cookies/same-site/resources/fetch-in-same-origin-worker.js: Added.
(async.checkResult):
* http/tests/cookies/same-site/resources/passthrough-service-worker.js: Added.
* platform/mac-wk1/TestExpectations: Skip the Service Worker tests as they are not supported in LegacyWebKit.

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

17 months agoHTML String load cannot be prevented by responding 'Cancel' asynchronously in decideP...
cdumez@apple.com [Mon, 23 Apr 2018 20:49:57 +0000 (20:49 +0000)]
HTML String load cannot be prevented by responding 'Cancel' asynchronously in decidePolicyForNavigationAction
https://bugs.webkit.org/show_bug.cgi?id=184848
<rdar://problem/39145306>

Reviewed by Brady Eidson.

Source/WebCore:

When calling loadHTMLString on a WebView, we end up doing a load for 'about:blank'
with substitute data. In such case, we want to do a regular asynchronous policy
delegate check, there is no reason we need it to be synchronous. Update our check
to make sure we only do a synchronous policy check for initial 'about:blank' loads
that do not have substitute data.

* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/DecidePolicyForNavigationAction.mm:
(-[DecidePolicyForNavigationActionController webView:decidePolicyForNavigationAction:decisionHandler:]):
(TEST):

LayoutTests:

Update layout tests that wrongly expected 'about:blank' to load synchronously even
when it is not the initial empty document of an iframe. I have checked that our
behavior is now consistent with Chrome.

* fast/events/beforeunload-alert-user-interaction2.html:
* http/tests/security/cross-origin-reified-window-location-setting-expected.txt:
* http/tests/security/cross-origin-reified-window-location-setting.html:
* webarchive/loading/javascript-url-iframe-crash-expected.txt:

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

17 months agoWebProcessProxy frequently re-takes a process assertion for the network process even...
cdumez@apple.com [Mon, 23 Apr 2018 20:29:36 +0000 (20:29 +0000)]
WebProcessProxy frequently re-takes a process assertion for the network process even though is already has one
https://bugs.webkit.org/show_bug.cgi?id=184889
<rdar://problem/38151530>

Reviewed by Brady Eidson.

In ProcessThrottler::updateAssertionNow(), if the new process assertion state is the same
as the existing one, then return early. Otherwise, we would end up calling WebProcessProxy::didSetAssertionState()
for the same assertion state, which would cause duplicate logging but also some unnecessary work.

* UIProcess/ProcessThrottler.cpp:
(WebKit::ProcessThrottler::updateAssertionNow):

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

17 months ago[Extra zoom mode] 100vw is roughly half of the viewport width in extra zoom mode
wenson_hsieh@apple.com [Mon, 23 Apr 2018 19:40:26 +0000 (19:40 +0000)]
[Extra zoom mode] 100vw is roughly half of the viewport width in extra zoom mode
https://bugs.webkit.org/show_bug.cgi?id=184871
<rdar://problem/39477595>

Reviewed by Andy Estes.

Source/WebCore:

Currently, when computing CSS viewport units, we use ViewportConfiguration::initialScaleIgnoringContentSize().
This method computes an initial scale from the layout width and height without relying on any information
derived from the current content size. This is done to ensure that the content size and viewport dimensions for
CSS viewport units should not be simultaneously dependent on each other.

Since shrink-to-fit heuristics depend on content size, we currently assume that shrink-to-fit is disabled when
computing initialScaleIgnoringContentSize, by always passing in `false` for `shouldIgnoreScalingConstraints`.
However, in extra zoom mode, the opposite is true: since we force both `m_canIgnoreScalingConstraints` and
`m_forceHorizontalShrinkToFit` to be `true` in this mode, we will always try to shrink-to-fit regardless of
content size.

Because of this shrink-to-fit disparity between `initialScale` and `initialScaleIgnoringContentSize`, viewport
units in extra zoom mode are currently computed assuming an initial scale set by the page, whereas the real
viewport is scaled to fit, which causes any lengths computed in terms of vw and vh to be incorrect. To fix this,
we introduce a version of shouldIgnoreScalingConstraints() that returns `true` iff scaling constraints are
always ignored, regardless of content size. We then use this in initialScaleIgnoringContentSize, instead of
always passing in `false` for `shouldIgnoreScalingConstraints`.

Test: fast/css/extrazoom/viewport-units-shrink-to-fit.html

* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::shouldIgnoreScalingConstraintsRegardlessOfContentSize const):
(WebCore::ViewportConfiguration::initialScaleIgnoringContentSize const):
* page/ViewportConfiguration.h:

LayoutTests:

Add a new layout test to verify that shrink-to-fit works as intended in extra zoom mode:
1.  The large element should cause the entire viewport to shrink down to fit.
2.  Removing the large element should adjust the viewport, such that the smaller element now fits the entire
    viewport.
3.  The smaller element (at 100vw and 100vh) should be the same size as the window.

* TestExpectations:
* fast/css/extrazoom/viewport-units-shrink-to-fit-expected.txt: Added.
* fast/css/extrazoom/viewport-units-shrink-to-fit.html: Added.

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

17 months agoInclude stdio.h before using stderr
commit-queue@webkit.org [Mon, 23 Apr 2018 15:23:35 +0000 (15:23 +0000)]
Include stdio.h before using stderr
https://bugs.webkit.org/show_bug.cgi?id=184872

Patch by Ting-Wei Lan <lantw44@gmail.com> on 2018-04-23
Reviewed by Yusuke Suzuki.

* bmalloc/PerProcess.cpp:
* bmalloc/Scavenger.cpp:

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

17 months ago[Simple line layout] Generate inline boxtree using simple line layout runs.
zalan@apple.com [Mon, 23 Apr 2018 14:47:00 +0000 (14:47 +0000)]
[Simple line layout] Generate inline boxtree using simple line layout runs.
https://bugs.webkit.org/show_bug.cgi?id=184833

Reviewed by Antti Koivisto.

RenderBlockFlow::ensureLineBoxes triggers line layout on the block content to replace
the simple line layout runs with an inline boxtree. The runs generated by the fast path
should always match the inline tree boxes.
In this patch instead of triggering layout, we just convert the simple line runs to
inline boxes.
Currently, it works with only one, non-paginated text renderer, but we should be
able to extend it to all the simple line layout content.

Covered by existing tests.

* rendering/InlineBox.h:
(WebCore::InlineBox::setHasHyphen):
(WebCore::InlineBox::setCanHaveLeadingExpansion):
(WebCore::InlineBox::setCanHaveTrailingExpansion):
(WebCore::InlineBox::setForceTrailingExpansion):
(WebCore::InlineBox::setForceLeadingExpansion):
(WebCore::InlineBox::hasHyphen const):
(WebCore::InlineBox::canHaveLeadingExpansion const):
(WebCore::InlineBox::canHaveTrailingExpansion const):
(WebCore::InlineBox::forceTrailingExpansion const):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::ensureLineBoxes):
* rendering/RenderBlockFlow.h:
* rendering/SimpleLineLayoutFlowContents.h:
(WebCore::SimpleLineLayout::FlowContents::segmentForRun const):
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::canUseForLineBoxTree):
(WebCore::SimpleLineLayout::initializeInlineBox):
(WebCore::SimpleLineLayout::generateLineBoxTree):
* rendering/SimpleLineLayoutFunctions.h:
* rendering/SimpleLineLayoutResolver.cpp:
(WebCore::SimpleLineLayout::RunResolver::rangeForLine const):
* rendering/SimpleLineLayoutResolver.h:

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

17 months ago[CoordGraphics] Remove unused trajectory cruft in CoordinatedLayerTreeHost, Coordinat...
zandobersek@gmail.com [Mon, 23 Apr 2018 14:16:00 +0000 (14:16 +0000)]
[CoordGraphics] Remove unused trajectory cruft in CoordinatedLayerTreeHost, CoordinatedGraphicsLayer
https://bugs.webkit.org/show_bug.cgi?id=184881

Reviewed by Michael Catanzaro.

Source/WebCore:

Remove the redundant findFirstDescendantWithContentsRecursively() and
setVisibleContentRectTrajectoryVector() methods on the
CoordinatedGraphicsLayer class.

* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::findFirstDescendantWithContentsRecursively): Deleted.
(WebCore::CoordinatedGraphicsLayer::setVisibleContentRectTrajectoryVector): Deleted.
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:

Source/WebKit:

The CompositingCoordinator::setVisibleContentsRect() method is always
called with a (0,0) FloatPoint value as the trajectory vector parameter,
which is already the default value in TiledBackingStore where this ends
up. Removing this call chain also enables removing some unnecessary and
odd code in the CoordinatedGraphicsLayer class.

This doesn't yet touch the trajectory logic in the TiledBackingStore
class since it's not yet a given this won't be used in the future. But
if that will be necessary, hope is to not use it this way.

* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
(WebKit::CompositingCoordinator::setVisibleContentsRect):
(WebKit::CompositingCoordinator::mainContentsLayer): Deleted.
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
(WebKit::CoordinatedLayerTreeHost::setVisibleContentsRect):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
(WebKit::ThreadedCoordinatedLayerTreeHost::didChangeViewport):

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

17 months ago[CoordGraphics] TiledBackingStore unnecessarily tracks alpha support value
zandobersek@gmail.com [Mon, 23 Apr 2018 14:12:24 +0000 (14:12 +0000)]
[CoordGraphics] TiledBackingStore unnecessarily tracks alpha support value
https://bugs.webkit.org/show_bug.cgi?id=184880

Reviewed by Michael Catanzaro.

Drop the m_supportsAlpha member from the TiledBackingStore class. The
member value was unused. TiledBackingStore::setSupportsAlpha() method
is removed.

TiledBackingStore::setSupportsAlpha() invalidated the backing store,
so CoordinatedGraphicsLayer::setContentsOpaque() now enforces the same
behavior by manually updating the m_needsDisplay struct. This means
that during the following layer flush the backing store is repainted
in its entirety.

* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::setContentsOpaque):
(WebCore::CoordinatedGraphicsLayer::createBackingStore):
* platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
(WebCore::TiledBackingStore::TiledBackingStore):
(WebCore::TiledBackingStore::setSupportsAlpha): Deleted.
* platform/graphics/texmap/coordinated/TiledBackingStore.h:

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

17 months ago[GTK][WPE] TestSSL fails due to additional TLS errors returned
mcatanzaro@igalia.com [Mon, 23 Apr 2018 13:45:20 +0000 (13:45 +0000)]
[GTK][WPE] TestSSL fails due to additional TLS errors returned
https://bugs.webkit.org/show_bug.cgi?id=184860

Reviewed by Carlos Garcia Campos.

Add script and config file for regenerating the test certificate.
Regenerate it. TestSSL no longer fails on my machine.

I do see a ton of network process crashes and JavaScript errors, none of
which prevent the test from passing, but this commit only claims to fix
the certificate validation portion of the test.

* TestWebKitAPI/Tests/WebKitGLib/resources/generate-test-cert.sh: Added.
* TestWebKitAPI/Tests/WebKitGLib/resources/test-cert.conf: Added.
* TestWebKitAPI/Tests/WebKitGLib/resources/test-cert.pem:

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

17 months ago[GStreamer] Start implementing Audio/VideoTrackPrivateGSTreamer::kind method
commit-queue@webkit.org [Mon, 23 Apr 2018 13:39:53 +0000 (13:39 +0000)]
[GStreamer] Start implementing Audio/VideoTrackPrivateGSTreamer::kind method
https://bugs.webkit.org/show_bug.cgi?id=184650

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

In the playbin3 case we can assume that if the GstStream is selected by default,
it is the Main track of that kind.

No new tests are added as:
    * It relies on playbin3 case which support might be compiled out
    * we already have a few test that are currently disabled in the mediastream
      testsuite. This patch is part of the work to enable them.

* platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
(WebCore::AudioTrackPrivateGStreamer::kind const):
* platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h:
* platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
(WebCore::VideoTrackPrivateGStreamer::kind const):
* platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h:

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

17 months ago[MSE] Add allSamplesInTrackEnqueued event
aboya@igalia.com [Mon, 23 Apr 2018 11:19:01 +0000 (11:19 +0000)]
[MSE] Add allSamplesInTrackEnqueued event
https://bugs.webkit.org/show_bug.cgi?id=184737

MediaSource has a .endOfStream() method to signal when there are no more frames
after the ones currently buffered.

This bit of data is important for some multimedia frameworks. For instance, in
GStreamer a stream of frames being decoded should be terminated by a
'end-of-stream' (EOS) event that has a similar meaning. Some GStreamer elements
will expect this event in order to work properly under some circumstances.

Unfortunately currently WebKit provides no mechanism for this: an event of
sorts should be emitted after no more frames are going to be enqueued to signal
the end of the stream. The closest mechanism WebKit has for this is
`markEndOfStream()`, but it's not exactly the same: markEndOfStream() informs
that -- as far as network buffering is concerned -- we are done; but at that
point there may still be (and often are) many frames waiting in the
decodeQueue, so it would be wrong to signal the decoder that there are no more
frames.

This patch introduces a new optional method in SourceBufferPrivate,
`allSamplesInTrackEnqueued(const AtomicString& trackID)` that is called
whenever the MediaSource is in "ended" state (the user has called
`MediaSource.endOfStream()`) and the decodeQueue is empty. Media framework
implementations can use this method to send a EOS event to a decoder that needs
it.

Reviewed by Xabier Rodriguez-Calvar.

* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::streamEndedWithError):
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::provideMediaData):
(WebCore::SourceBuffer::trySignalAllSamplesInTrackEnqueued):
(WebCore::SourceBuffer::trySignalAllSamplesEnqueued):
* Modules/mediasource/SourceBuffer.h:
* platform/graphics/SourceBufferPrivate.h:
(WebCore::SourceBufferPrivate::allSamplesInTrackEnqueued):
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
(WebCore::MediaSourceClientGStreamerMSE::allSamplesInTrackEnqueued):
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
* platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
(WebCore::PlaybackPipeline::allSamplesInTrackEnqueued):
* platform/graphics/gstreamer/mse/PlaybackPipeline.h:
* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
(WebCore::SourceBufferPrivateGStreamer::allSamplesInTrackEnqueued):
* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h:

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

17 months ago[Win][WK2] REGRESSION(r230834) 'getpid': identifier not found
Hironori.Fujii@sony.com [Mon, 23 Apr 2018 10:13:00 +0000 (10:13 +0000)]
[Win][WK2] REGRESSION(r230834) 'getpid': identifier not found
https://bugs.webkit.org/show_bug.cgi?id=184877

Reviewed by Yusuke Suzuki.

* WebProcess/WebPage/WebBackForwardListProxy.cpp:
(WebKit::WebBackForwardListProxy::addItem): Use WTF::getCurrentProcessID() instead of getpid().
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::goToBackForwardItem): Ditto.

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

17 months agoAvoid uninitialized memory read.
zandobersek@gmail.com [Mon, 23 Apr 2018 07:44:50 +0000 (07:44 +0000)]
Avoid uninitialized memory read.
https://bugs.webkit.org/show_bug.cgi?id=184505
<rdar://problem/39348325>

Patch by Ms2ger <Ms2ger@igalia.com> on 2018-04-23
Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-bounds-expected.txt: Added.
* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-bounds.html: Added.

Source/WebCore:

Test: imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-bounds.html

* html/ImageBitmap.cpp:
(WebCore::croppedSourceRectangleWithFormatting):

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

17 months ago[TexMap] Drop RefCounted inheritance off of TextureMapperBackingStore
zandobersek@gmail.com [Mon, 23 Apr 2018 07:32:30 +0000 (07:32 +0000)]
[TexMap] Drop RefCounted inheritance off of TextureMapperBackingStore
https://bugs.webkit.org/show_bug.cgi?id=184810

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Turn TextureMapperBackingStore into a simple interface that doesn't
inherit from RefCounted<>. Instead, push that inheritance off to the
classes that implement the TextureMapperBackingStore interface. This
narrows down the purpose of TextureMapperBackingStore towards a simple
interface that TextureMapper algorithms can work with.

TextureMapperLayer has its m_backingStore member variable turn into
a simple pointer instead of a RefPtr<>. Setter method and call sites of
that method are updated to reflect that.

TextureMapperTiledBackingStore now inherits from RefCounted<> directly,
instead of through TextureMapperBackingStore.

* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayerTextureMapper::commitLayerChanges):
(WebCore::GraphicsLayerTextureMapper::updateBackingStoreIfNeeded):
* platform/graphics/texmap/GraphicsLayerTextureMapper.h:
* platform/graphics/texmap/TextureMapperBackingStore.h:
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::setBackingStore):
* platform/graphics/texmap/TextureMapperLayer.h:
* platform/graphics/texmap/TextureMapperTiledBackingStore.h:

Source/WebKit:

CoordinatedBackingStore should inherit directly from RefCounted<> now
that TextureMapperBackingStore doesn't anymore.

* Shared/CoordinatedGraphics/CoordinatedBackingStore.h:
* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::createBackingStoreIfNeeded):

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

17 months ago[AsyncScrolling] Add generic ScrollingThread implementation
zandobersek@gmail.com [Mon, 23 Apr 2018 06:48:37 +0000 (06:48 +0000)]
[AsyncScrolling] Add generic ScrollingThread implementation
https://bugs.webkit.org/show_bug.cgi?id=184809

Reviewed by Yusuke Suzuki.

Add a generic ScrollingThread implementation that internally uses
RunLoop facilities to run the scrolling thread and dispatch
callbacks on that thread.

ScrollingThread::initializeRunLoop() retrieves address of the
thread-specific RunLoop and signals the Condition object.
ScrollingThread::wakeUpRunLoop() uses RunLoop::dispatch() to schedule
callback dispatches on the scrolling thread.

ScrollingThread::createThreadIfNeeded() mimics Cocoa implementation and
waits for the RunLoop address to be retrieved before continuing.

* SourcesGTK.txt: Add to build.
* SourcesWPE.txt: Ditto.
* page/scrolling/ScrollingThread.cpp:
(WebCore::ScrollingThread::createThreadIfNeeded):
* page/scrolling/ScrollingThread.h:
* page/scrolling/generic/ScrollingThreadGeneric.cpp: Added.
(WebCore::ScrollingThread::initializeRunLoop):
(WebCore::ScrollingThread::wakeUpRunLoop):

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

17 months ago[CoordinatedGraphics] Unused contentsSize, coveredRect attributes in CoordinatedGraph...
zandobersek@gmail.com [Mon, 23 Apr 2018 06:47:02 +0000 (06:47 +0000)]
[CoordinatedGraphics] Unused contentsSize, coveredRect attributes in CoordinatedGraphicsState
https://bugs.webkit.org/show_bug.cgi?id=184811

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Remove the unused contentsSize and coveredRect attributes on the
CoordinatedGraphicsState struct. CoordinatedGraphicsLayer::coverRect()
method is now unused and can also be removed.

* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:

Source/WebKit:

* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
(WebKit::CompositingCoordinator::flushPendingLayerChanges): Stop setting
the removed contentsSize and coveredRect attributes. These were only
ever set to the appropriate values, but were then never used anywhere.

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

17 months agoWeb Inspector: WebInspectorProxy releases WKWebInspectorProxyObjCAdapter without...
mattbaker@apple.com [Sun, 22 Apr 2018 23:03:44 +0000 (23:03 +0000)]
Web Inspector: WebInspectorProxy releases WKWebInspectorProxyObjCAdapter without removing corresponding observer
https://bugs.webkit.org/show_bug.cgi?id=184865
<rdar://problem/37764960>

Reviewed by Brian Burg.

Replace the early return removed in https://bugs.webkit.org/show_bug.cgi?id=177661,
so that WKWebInspectorProxyObjCAdapter and the view controller can be reused
when reopening the Inspector while the WebView is still alive.

* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::platformCreateFrontendPage):

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

17 months agoAdd -[WKInputDelegate _webView:decidePolicyForFocusedElement:] so clients can request...
commit-queue@webkit.org [Sun, 22 Apr 2018 21:39:30 +0000 (21:39 +0000)]
Add -[WKInputDelegate _webView:decidePolicyForFocusedElement:] so clients can request default focusing behavior
https://bugs.webkit.org/show_bug.cgi?id=184844

Patch by Paul Knight <pknight@apple.com> on 2018-04-22
Reviewed by Dan Bernstein.

If a client doesn't implement -[_WKInputDelegate _webView:focusShouldStartInputSession:] the default
focus behavior only brings up the keyboard if it's already onscreen, the interaction is user driven,
and other factors that even depend on what feature flags are enabled.

If a client implements _webView:focusShouldStartInputSession:, they don't have a good way to specifiy
they'd like to fall back to the default behavior. This makes it difficult for a client to use the
default in most cases, but sometimes allow programmatic focus from the page, for example.

Add a new delegate method -_webView:decidePolicyForFocusedElement: that returns a new enum type
_WKFocusStartsInputSessionPolicy. Clients can return _WKFocusStartsInputSessionPolicyAuto to request
the default behavior, or _WKFocusStartsInputSessionPolicyAllow / Disallow to directly control whether
the keyboard appears to assist the focused node.

* UIProcess/API/Cocoa/_WKInputDelegate.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):

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

17 months agoAdd a layout test for r230785
wenson_hsieh@apple.com [Sun, 22 Apr 2018 21:23:16 +0000 (21:23 +0000)]
Add a layout test for r230785
https://bugs.webkit.org/show_bug.cgi?id=184757

Reviewed by Beth Dakin.

Adds a new layout test to verify that true screen dimensions in extra zoom mode
are observable from the page, via window.screen.

* TestExpectations:
* fast/dom/Window/extrazoom/window-get-real-screen-dimensions.html: Added.

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

17 months ago[JSC] Remove ModuleLoaderPrototype
utatane.tea@gmail.com [Sun, 22 Apr 2018 13:44:58 +0000 (13:44 +0000)]
[JSC] Remove ModuleLoaderPrototype
https://bugs.webkit.org/show_bug.cgi?id=184784

Reviewed by Mark Lam.

When we introduce ModuleLoaderPrototype, ModuleLoader may be created by users and exposed to users.
However, the loader spec is abandoned. So we do not need to have ModuleLoaderPrototype and JSModuleLoader.
This patch merges ModuleLoaderPrototype's functionality into JSModuleLoader.

* CMakeLists.txt:
* DerivedSources.make:
* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* builtins/ModuleLoader.js: Renamed from Source/JavaScriptCore/builtins/ModuleLoaderPrototype.js.
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::proxyRevokeStructure const):
(JSC::JSGlobalObject::moduleLoaderStructure const): Deleted.
* runtime/JSModuleLoader.cpp:
(JSC::moduleLoaderParseModule):
(JSC::moduleLoaderRequestedModules):
(JSC::moduleLoaderModuleDeclarationInstantiation):
(JSC::moduleLoaderResolve):
(JSC::moduleLoaderResolveSync):
(JSC::moduleLoaderFetch):
(JSC::moduleLoaderGetModuleNamespaceObject):
(JSC::moduleLoaderEvaluate):
* runtime/JSModuleLoader.h:
* runtime/ModuleLoaderPrototype.cpp: Removed.
* runtime/ModuleLoaderPrototype.h: Removed.

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

17 months agoCleanup CookieRequestHeaderFieldProxy
dbates@webkit.org [Sun, 22 Apr 2018 01:21:17 +0000 (01:21 +0000)]
Cleanup CookieRequestHeaderFieldProxy
https://bugs.webkit.org/show_bug.cgi?id=184868

Remove extraneous whitespace that I inadvertently added.

* platform/network/CookieRequestHeaderFieldProxy.h:
(WebCore::CookieRequestHeaderFieldProxy::decode):

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

17 months agoCleanup CookieRequestHeaderFieldProxy
dbates@webkit.org [Sun, 22 Apr 2018 01:16:25 +0000 (01:16 +0000)]
Cleanup CookieRequestHeaderFieldProxy
https://bugs.webkit.org/show_bug.cgi?id=184868

Reviewed by Youenn Fablet.

Simplify the struct CookieRequestHeaderFieldProxy and make it consistent with other structs.
Among other changes, remove constructors for CookieRequestHeaderFieldProxy as they are
unnecessary as all supported compilers support non-static data member initializers (NSDMI)
for aggregates, remove prefix "m_" from the name of fields as this is struct exists for
convenience and offers no encapsulation and simplify decoding logic of this struct.

No functionality changed. So, no new tests.

* loader/CookieJar.cpp:
(WebCore::cookieRequestHeaderFieldProxy):
* platform/network/CookieRequestHeaderFieldProxy.h:
(WebCore::CookieRequestHeaderFieldProxy::encode const):
(WebCore::CookieRequestHeaderFieldProxy::decode):
(WebCore::CookieRequestHeaderFieldProxy::CookieRequestHeaderFieldProxy): Deleted.
* platform/network/SocketStreamHandleImpl.cpp:
(WebCore::cookieDataForHandshake):
* platform/network/cf/CookieJarCFNet.cpp:
(WebCore::cookieRequestHeaderFieldValue):
* platform/network/curl/CookieJarCurl.cpp:
(WebCore::cookieRequestHeaderFieldValue):
* platform/network/curl/CookieJarCurlDatabase.cpp:
(WebCore::CookieJarCurlDatabase::cookieRequestHeaderFieldValue const):
* platform/network/mac/CookieJarMac.mm:
(WebCore::cookieRequestHeaderFieldValue):
* platform/network/soup/CookieJarSoup.cpp:
(WebCore::cookieRequestHeaderFieldValue):

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

17 months agoUnreviewed, follow-up patch after r230474
utatane.tea@gmail.com [Sat, 21 Apr 2018 21:58:51 +0000 (21:58 +0000)]
Unreviewed, follow-up patch after r230474
https://bugs.webkit.org/show_bug.cgi?id=166684

Add "JavaScriptCore" to Darwin name. And use short name "BMScavenger"
for Linux since adding "JavaScriptCore" makes the name too long for Linux.

* bmalloc/Scavenger.cpp:
(bmalloc::Scavenger::threadRunLoop):

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

17 months agoDisable backward and forward navigation swipes while in fullscreen.
commit-queue@webkit.org [Sat, 21 Apr 2018 21:52:51 +0000 (21:52 +0000)]
Disable backward and forward navigation swipes while in fullscreen.
https://bugs.webkit.org/show_bug.cgi?id=184656
rdar://problem/36057535

Patch by Jeremy Jones <jeremyj@apple.com> on 2018-04-21
Reviewed by Tim Horton.

Disable navigation swipes while in fullscreen.

* UIProcess/Cocoa/ViewGestureController.cpp:
(WebKit::ViewGestureController::canSwipeInDirection const):

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

17 months ago[Modern Media Controls] Show a loading indicator after pressing the play button in...
graouts@webkit.org [Sat, 21 Apr 2018 21:49:04 +0000 (21:49 +0000)]
[Modern Media Controls] Show a loading indicator after pressing the play button in compact mode
https://bugs.webkit.org/show_bug.cgi?id=184863
<rdar://problem/38939468>

Reviewed by Dean Jackson.

Source/WebCore:

We now display a loading indicator after pressing the play button when in compact mode. We also update the
behavior to use assets provided through WebKitAdditions (see webkit.org/b/184862) for the play button and
the invalid icon. Additionally, we always show a 20% opaque black overlay in the background while any piece
of user interface is up.

* Modules/modern-media-controls/controls/compact-activity-indicator.css: Added.
(button.compact-activity-indicator > picture): The loading indicator asset is a sprite made of 23 frames, so
we specify the mask size (since all buttons are rendered via a mask) to be 23 * 100% the rendered size. The
display of the loading indicator is performed with a first intro animation which runs once through the first
8 frames and then a continuously looping animation going through the remaining frames. We use a frames()
timing function to achieve the frame-by-frame effect while using only from/to keyframe animations. When we
fade out, we use a simply opacity fade, which is combined with the spinning animation. We use CSS variables
to encode both animations so they can be used combined or one at a time without redefining the whole animation
property.
(button.compact-activity-indicator.spins > picture): Use the "spins" animation variable when spinning.
(button.compact-activity-indicator.spins.fades-out > picture): Combine the "spins" and "fades-out" animation
variables when fading out.
(@keyframes compact-activity-indicator-intro): Animation going through the first 8 frames of the loading indicator.
(@keyframes compact-activity-indicator-loop): Animation going through the remaining frames of the loading indicator.
(@keyframes compact-activity-indicator-fades-out): Animation fading opacity from 1 to 0.
* Modules/modern-media-controls/controls/compact-activity-indicator.js: Added.
(CompactActivityIndicator):
(CompactActivityIndicator.prototype.show): Add the "spins" CSS class to show the control spinning with the intro animation.
(CompactActivityIndicator.prototype.hide): Add the "fades-out" CSS class to hide the control, removing both this class and
the "spins" class when the fade-out animation completes.
* Modules/modern-media-controls/controls/compact-media-controls.css: Added.
(.media-controls.compact:before): Add a 20% black overlay over the video frame to provide contrast for controls.
(.media-controls.compact button): Ensure buttons are sized to use the entire video frame so that their hit region
comprises the whole video frame.
(.media-controls.compact button > picture): Override default blending styles for a simple solid white mask.
(.media-controls.compact button:active > picture): Turn off the scale down effect when pressing a button.
* Modules/modern-media-controls/controls/compact-media-controls.js: Expose a "state" property for the compact media controls,
which can be exlusively one of three: "paused", "pending" and "invalid".
(CompactMediaControls.):
(CompactMediaControls.prototype.get state):
(CompactMediaControls.prototype.set state):
(CompactMediaControls.prototype.layout): In the "paused" state, show the play button. In the "pending" state show
the loading indicator. In the "invalid" state show the invalid button.
(CompactMediaControls.prototype.get placard): Deleted.
(CompactMediaControls.prototype.set placard): Deleted.
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/compact-media-controls-support.js: Added.
(CompactMediaControlsSupport.prototype.get mediaEvents):
(CompactMediaControlsSupport.prototype.handleEvent): Make the controls enter the "paused" state when receiving a "pause"
event. Make the controls enter the "invalid" state when receiving an "error" event.
(CompactMediaControlsSupport.prototype.enable):
(CompactMediaControlsSupport.prototype.disable):
(CompactMediaControlsSupport.prototype.buttonWasPressed): Play the media when pressing the play button and make the controls
enter the "pending" state. When pressing the loading indicator, pause the media and make the controls enter the "paused" state.
(CompactMediaControlsSupport.prototype._buttons):
(CompactMediaControlsSupport):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype._supportingObjectClasses): Only use CompactMediaControlsSupport as a media controller supporting object
in the compact mode.
* Modules/modern-media-controls/media/placard-support.js:
(PlacardSupport.prototype.get mediaEvents): This media controller support object no longer needs to deal with compact mode.
* Modules/modern-media-controls/media/playback-support.js:
(PlaybackSupport.prototype.syncControl): This media controller support object no longer needs to deal with compact mode.
(PlaybackSupport):

LayoutTests:

* media/modern-media-controls/compact-media-controls/compact-media-controls-constructor-expected.txt:
* media/modern-media-controls/compact-media-controls/compact-media-controls-constructor.html:
* media/modern-media-controls/compact-media-controls/compact-media-controls-layout-expected.txt:
* media/modern-media-controls/compact-media-controls/compact-media-controls-layout.html:

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

17 months ago[Modern Media Controls] Obtain compact mode icons through WebKitAdditions
graouts@webkit.org [Sat, 21 Apr 2018 21:47:55 +0000 (21:47 +0000)]
[Modern Media Controls] Obtain compact mode icons through WebKitAdditions
https://bugs.webkit.org/show_bug.cgi?id=184862
<rdar://problem/39621645>

Reviewed by Jon Lee.

* Modules/modern-media-controls/controls/button.js:
(Button.prototype._updateImageMetrics): Handle PDF assets where the image source's intrinsic size needs
to be adjusted for the device pixel density.
(Button):
* Modules/modern-media-controls/controls/icon-service.js: Expect three additional icons provided through
WebKitAdditions, including two in the PDF format, so we add support for this format.
* WebCore.xcodeproj/project.pbxproj: Copy additional assets from the WebKitAdditions build directory should
any be present.

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

17 months agoActivate NetworkLoadChecker for media loads
youenn@apple.com [Sat, 21 Apr 2018 20:46:44 +0000 (20:46 +0000)]
Activate NetworkLoadChecker for media loads
https://bugs.webkit.org/show_bug.cgi?id=184841

Reviewed by Eric Carlson.

Source/WebKit:

Instantiate a NetworkLoadChecker for NetworkResourceLoader for audio/video loads.

Move CORS checks for response after handling of 304 checks.
For 304 checks, we need to do the CORS checks on the validated cached response, not the 304 received response.

Updated ResourceError argument coder to explicitly pass the error type
as some errors created by NetworkLoadChecker would otherwise be received as General errors by WebProcess.
Updated platform data encoding of ResourceError accordingly.

All changes are covered by regular media loading layout tests.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::shouldUseNetworkLoadChecker):
(WebKit::NetworkResourceLoader::didReceiveResponse):
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<ResourceError>::encode):
(IPC::ArgumentCoder<ResourceError>::decode):
* Shared/mac/WebCoreArgumentCodersMac.mm:
(IPC::ArgumentCoder<ResourceError>::encodePlatformData):
(IPC::ArgumentCoder<ResourceError>::decodePlatformData):
We need to set the type after decoding the NSError as ResourceError tries to guess the type from NSError data.
* Shared/soup/WebCoreArgumentCodersSoup.cpp:
(IPC::ArgumentCoder<ResourceError>::encodePlatformData):
(IPC::ArgumentCoder<ResourceError>::decodePlatformData):

LayoutTests:

* TestExpectations: Added DumpJSConsoleLogInStdErr to remove console message differences between WK1/WK2.

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

17 months agoExpose whether you've build with the Apple Internal SDK
dino@apple.com [Sat, 21 Apr 2018 20:28:40 +0000 (20:28 +0000)]
Expose whether you've build with the Apple Internal SDK
https://bugs.webkit.org/show_bug.cgi?id=184864

Reviewed by Wenson Hsieh.

Internals API to let a test know if it is running with the
Apple internal SDK.

* testing/Internals.cpp:
(WebCore::usingAppleInternalSDK const):
* testing/Internals.h:
* testing/Internals.idl:

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

17 months agoREGRESSION(r214076): Web Inspector: Timelines load and DOMContentLoaded markers aren...
nvasilyev@apple.com [Sat, 21 Apr 2018 17:45:23 +0000 (17:45 +0000)]
REGRESSION(r214076): Web Inspector: Timelines load and DOMContentLoaded markers aren't visible
https://bugs.webkit.org/show_bug.cgi?id=184858

Reviewed by Brian Burg.

r214076 changed the color of all markers to light gray.

* UserInterface/Views/TimelineRuler.css:
(.timeline-ruler > .markers > .marker):
(body[dir=ltr] .timeline-ruler > .markers > .marker):
(body[dir=rtl] .timeline-ruler > .markers > .marker):
(.timeline-ruler > .markers > .marker.current-time):
(.timeline-ruler > .markers > .marker.load-event):
(.timeline-ruler > .markers > .marker.dom-content-event):
(.timeline-ruler > .markers > .marker.timestamp):
(body[dir=ltr] .timeline-ruler > .markers > .marker.current-time): Deleted.
(body[dir=rtl] .timeline-ruler > .markers > .marker.current-time): Deleted.

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

17 months agoAX: AOM does not work with DOM Level 1 events
n_wang@apple.com [Sat, 21 Apr 2018 06:56:29 +0000 (06:56 +0000)]
AX: AOM does not work with DOM Level 1 events
https://bugs.webkit.org/show_bug.cgi?id=184847

Reviewed by Chris Fleizach.

Source/WebCore:

Added the accessibility events to the HTML attribute names.

Test cases are added to the existing layout tests.

* html/HTMLAttributeNames.in:
* html/HTMLElement.cpp:
(WebCore::HTMLElement::createEventHandlerNameMap):

LayoutTests:

* accessibility/ios-simulator/AOM-dismiss-event-expected.txt:
* accessibility/ios-simulator/AOM-dismiss-event.html:
* accessibility/mac/AOM-event-accessiblesetvalue-expected.txt:
* accessibility/mac/AOM-event-accessiblesetvalue.html:
* accessibility/mac/AOM-events-all-expected.txt:
* accessibility/mac/AOM-events-all.html:
* accessibility/mac/AOM-events-expected.txt:
* accessibility/mac/AOM-events.html:

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

17 months ago[GLIB] ERROR: Thread was unable to be detached when running /jsc/vm test in debug
carlosgc@webkit.org [Sat, 21 Apr 2018 06:42:26 +0000 (06:42 +0000)]
[GLIB] ERROR: Thread was unable to be detached when running /jsc/vm test in debug
https://bugs.webkit.org/show_bug.cgi?id=184815

Reviewed by Michael Catanzaro.

This is because in the test we are calling both join and detach. We should only call join.

* TestWebKitAPI/Tests/JavaScriptCore/glib/TestJSC.cpp:
(testsJSCVirtualMachine):

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

17 months ago[GLIB] Test /jsc/prototypes crashes in debug
carlosgc@webkit.org [Sat, 21 Apr 2018 06:40:52 +0000 (06:40 +0000)]
[GLIB] Test /jsc/prototypes crashes in debug
https://bugs.webkit.org/show_bug.cgi?id=184814

Reviewed by Michael Catanzaro.

We should also call the constructor/destructor of Bar struct to ensure Foo is constructed.

* TestWebKitAPI/Tests/JavaScriptCore/glib/TestJSC.cpp:
(barCreate):
(barFree):

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

17 months ago[GLIB] All API tests fail in debug builds
carlosgc@webkit.org [Sat, 21 Apr 2018 06:38:21 +0000 (06:38 +0000)]
[GLIB] All API tests fail in debug builds
https://bugs.webkit.org/show_bug.cgi?id=184813

Reviewed by Mark Lam.

This is because of a conflict of ExceptionHandler class used in tests and ExceptionHandler struct defined in
JSCContext.cpp. This patch renames the ExceptionHandler struct as JSCContextExceptionHandler.

* API/glib/JSCContext.cpp:
(JSCContextExceptionHandler::JSCContextExceptionHandler):
(JSCContextExceptionHandler::~JSCContextExceptionHandler):
(jscContextConstructed):
(ExceptionHandler::ExceptionHandler): Deleted.
(ExceptionHandler::~ExceptionHandler): Deleted.

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

17 months agoREGRESSION(r228088): [SOUP] Check TLS errors for WebSockets on GTlsConnection::accept...
carlosgc@webkit.org [Sat, 21 Apr 2018 06:36:12 +0000 (06:36 +0000)]
REGRESSION(r228088): [SOUP] Check TLS errors for WebSockets on GTlsConnection::accept-certificate
https://bugs.webkit.org/show_bug.cgi?id=184804

Source/WebCore:

Reviewed by Michael Catanzaro.

* platform/network/soup/SocketStreamHandleImpl.h: Add a public url getter.
* platform/network/soup/SocketStreamHandleImplSoup.cpp:
(WebCore::acceptCertificateCallback): Call SoupNetworkSession::checkTLSErrors() to decide whether to accept the
certificate or not.
(WebCore::connectProgressCallback): Receive the SocketStreamHandle and pass it to acceptCertificateCallback callback.
(WebCore::socketClientEventCallback): Ditto.
(WebCore::SocketStreamHandleImpl::create): Always connect to network events.
(WebCore::wssConnectionAcceptCertificateCallback): Deleted.
(WebCore::wssSocketClientEventCallback): Deleted.

Tools:

Patch by Michael Catanzaro <mcatanzaro@igalia.com> on 2018-04-20
Reviewed by Carlos Garcia Campos.

* TestWebKitAPI/Tests/WebKitGLib/TestSSL.cpp:
(WebSocketTest::WebSocketTest):
(WebSocketTest::~WebSocketTest):
(WebSocketTest::serverWebSocketCallback):
(WebSocketTest::webSocketTestResultCallback):
(WebSocketTest::connectToServerAndWaitForEvents):
(testWebSocketTLSErrors):
(beforeAll):

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

17 months ago[SOUP] Do TLS error checking on GTlsConnection::accept-certificate
carlosgc@webkit.org [Sat, 21 Apr 2018 06:22:15 +0000 (06:22 +0000)]
[SOUP] Do TLS error checking on GTlsConnection::accept-certificate
https://bugs.webkit.org/show_bug.cgi?id=184480

Reviewed by Michael Catanzaro.

Source/WebCore:

* platform/network/soup/ResourceError.h: Change tlsError to recieve a failing URL instead of a SoupRequest,
since the request was only used to get the failing URL.
* platform/network/soup/ResourceErrorSoup.cpp:
(WebCore::ResourceError::tlsError): Use the given failing URL.
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::SoupNetworkSession::SoupNetworkSession): Use ssl-strict when creating the SoupSession to handle the
certificates ourselves by connecting to GTlsConnection::accept-certificate.
(WebCore::SoupNetworkSession::checkTLSErrors): Updated to receive a URL, certificate and errors instead of
receiving a SoupRequest and SoupMessage and extract the url, certirficate and errors from them. Also return the
optional error directly instead of using a completion handler since the function is always synchronous.
* platform/network/soup/SoupNetworkSession.h:

Source/WebKit:

Connect to GTlsConnection::accept-certificate signal instead of SoupMessage::notify::tls-errors to perform the
TLS errors check.

* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::createRequest): Do not connect to SoupMessage::notify::tls-errors.
(WebKit::NetworkDataTaskSoup::tlsConnectionAcceptCertificateCallback): Call tlsConnectionAcceptCertificate() is
the task is still ongoing.
(WebKit::NetworkDataTaskSoup::tlsConnectionAcceptCertificate): Check TLS errors here.
(WebKit::NetworkDataTaskSoup::networkEventCallback): Pass the stream to networkEvent.
(WebKit::NetworkDataTaskSoup::networkEvent): Connect to GTlsConnection::accept-certificate.
* NetworkProcess/soup/NetworkDataTaskSoup.h:

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

17 months agoNULL dereference crash sometimes under [super initWithCoder:] in WebView
timothy@apple.com [Sat, 21 Apr 2018 06:16:29 +0000 (06:16 +0000)]
NULL dereference crash sometimes under [super initWithCoder:] in WebView

https://bugs.webkit.org/show_bug.cgi?id=184851
rdar://problem/39611236

Reviewed by Tim Horton.

Source/WebKit:

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
(-[WKWebView effectiveAppearanceDidChange]):
Added a null check and call the code later in initialization.

Source/WebKitLegacy/mac:

* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
(-[WebView effectiveAppearanceDidChange]):
Added a null check and call the code later in initialization.

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

17 months agoUnreviewed, update 2 more API tests after r230876.
cdumez@apple.com [Sat, 21 Apr 2018 06:16:01 +0000 (06:16 +0000)]
Unreviewed, update 2 more API tests after r230876.

* TestWebKitAPI/Tests/WebKitCocoa/AnimatedResize.mm:
(TEST):
* TestWebKitAPI/Tests/ios/ScrollViewInsetTests.mm:
(TestWebKitAPI::TEST):

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

17 months agoAdjust geolocation feature flag
timothy_horton@apple.com [Sat, 21 Apr 2018 05:19:10 +0000 (05:19 +0000)]
Adjust geolocation feature flag
https://bugs.webkit.org/show_bug.cgi?id=184856

Reviewed by Wenson Hsieh.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

* Configurations/FeatureDefines.xcconfig:

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

17 months agoUnreviewed, rebaseline more tests after r230864.
cdumez@apple.com [Sat, 21 Apr 2018 04:25:11 +0000 (04:25 +0000)]
Unreviewed, rebaseline more tests after r230864.

* web-platform-tests/domparsing/innerhtml-05-expected.txt:
* web-platform-tests/html/semantics/forms/form-submission-0/getactionurl-expected.txt:

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

17 months agoUnreviewed attempt to fix Windows build after r230875.
cdumez@apple.com [Sat, 21 Apr 2018 04:22:25 +0000 (04:22 +0000)]
Unreviewed attempt to fix Windows build after r230875.

* platform/network/cf/CookieJarCFNet.cpp:
(WebCore::cookieRequestHeaderFieldValue):
* platform/network/curl/CookieJarCurlDatabase.cpp:

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

17 months agoUnreviewed attempt to fix GTK build after r230867.
cdumez@apple.com [Sat, 21 Apr 2018 02:35:09 +0000 (02:35 +0000)]
Unreviewed attempt to fix GTK build after r230867.

* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
(webkit_dom_dom_window_get_self):
(webkit_dom_dom_window_get_window):
(webkit_dom_dom_window_get_frames):
(webkit_dom_dom_window_get_opener):
(webkit_dom_dom_window_get_parent):
(webkit_dom_dom_window_get_top):

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

17 months agoUnreviewed, rolling out r230873.
commit-queue@webkit.org [Sat, 21 Apr 2018 02:26:23 +0000 (02:26 +0000)]
Unreviewed, rolling out r230873.
https://bugs.webkit.org/show_bug.cgi?id=184857

Broke the iOS build (Requested by cdumez on #webkit).

Reverted changeset:

"Disable backward and forward navigation swipes while in
fullscreen."
https://bugs.webkit.org/show_bug.cgi?id=184656
https://trac.webkit.org/changeset/230873

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

17 months agoUnreviewed, rebaseline more tests after r230864.
cdumez@apple.com [Sat, 21 Apr 2018 02:08:13 +0000 (02:08 +0000)]
Unreviewed, rebaseline more tests after r230864.

LayoutTests/imported/w3c:

* web-platform-tests/domparsing/innerhtml-05-expected.txt:
* web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt:
* web-platform-tests/html/semantics/forms/form-submission-0/getactionurl-expected.txt:

LayoutTests:

* fast/frames/sandboxed-iframe-history-denied-expected.txt:
* fast/xmlhttprequest/xmlhttprequest-no-file-access-expected.txt:

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

17 months agoREGRESSION (r229828): web view doesn’t update or respond to resizing until client...
cdumez@apple.com [Sat, 21 Apr 2018 01:55:35 +0000 (01:55 +0000)]
REGRESSION (r229828): web view doesn’t update or respond to resizing until client calls policy decision handler
https://bugs.webkit.org/show_bug.cgi?id=184210
<rdar://problem/39072354>

Reviewed by Wenson Hsieh.

Source/WebCore:

r229828 tried to have some API tests happy on iOS by freezing the layer tree
during the navigation policy decision. However, this is observable by the client
application and a regression from when the policy delegate was synchronous.

To address the issue, this patch reverts r229828 and instead updates the iOS
API tests to wait for the next presentation update after navigating
before interacting with the view.

* loader/FrameLoaderClient.h:
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):

Source/WebKit:

r229828 tried to have some API tests happy on iOS by freezing the layer tree
during the navigation policy decision. However, this is observable by the client
application and a regression from when the policy delegate was synchronous.

To address the issue, this patch reverts r229828 and instead updates the iOS
API tests to wait for the next presentation update after navigating
before interacting with the view.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
(WebKit::WebFrameLoaderClient::cancelPolicyCheck):
(WebKit::WebFrameLoaderClient::provisionalLoadStarted):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:

Tools:

* TestWebKitAPI/Tests/WebKit/large-red-square-image.html:
* TestWebKitAPI/Tests/WebKitCocoa/dragstart-change-selection-offscreen.html:
Add viewport meta tags.

* TestWebKitAPI/cocoa/TestNavigationDelegate.mm:
(-[WKWebView _test_waitForDidFinishNavigation]):
Update _test_waitForDidFinishNavigation to wait for the next presentation update
to make iOS API tests happy without having to modify each of them.

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

17 months agoLimit cookie header access to Network process
bfulgham@apple.com [Sat, 21 Apr 2018 01:51:37 +0000 (01:51 +0000)]
Limit cookie header access to Network process
https://bugs.webkit.org/show_bug.cgi?id=184764
<rdar://problem/36785285>

Reviewed by Youenn Fablet.

Revise the handling of cookie request headers so that we don't interact with them in the
WebContent process. They are only needed for interaction with the server and the network
process, so we should limit their scope to just the Network process.

Instead, we should handle a token that represents the cookie headers in the WebContent
process, which can be converted to the relevant cookie data in the network process when
needed.

Source/WebCore:

* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::didOpenSocketStream):
* Modules/websockets/WebSocketHandshake.cpp:
(WebCore::WebSocketHandshake::clientHandshakeMessage const):
(WebCore::WebSocketHandshake::clientHandshakeRequest const):
(WebCore::WebSocketHandshake::clientHandshakeCookieRequestHeaderFieldProxy const):
(WebCore::WebSocketHandshake::clientHandshakeMessage): Deleted.
(WebCore::WebSocketHandshake::clientHandshakeRequest): Deleted.
* Modules/websockets/WebSocketHandshake.h:
* WebCore.xcodeproj/project.pbxproj:
* loader/CookieJar.cpp:
(WebCore::cookieRequestHeaderFieldProxy):
* loader/CookieJar.h:
* platform/network/CookieRequestHeaderFieldProxy.h: Added.
(WebCore::CookieRequestHeaderFieldProxy::CookieRequestHeaderFieldProxy):
(WebCore::CookieRequestHeaderFieldProxy::isolatedCopy const):
(WebCore::CookieRequestHeaderFieldProxy::encode const):
(WebCore::CookieRequestHeaderFieldProxy::decode):
* platform/network/PlatformCookieJar.h:
* platform/network/SocketStreamHandle.cpp:
(WebCore::SocketStreamHandle::sendHandshake):
* platform/network/SocketStreamHandle.h:
* platform/network/SocketStreamHandleImpl.cpp:
(WebCore::SocketStreamHandleImpl::platformSendHandshake):
* platform/network/cf/SocketStreamHandleImpl.h:
* platform/network/curl/CookieJarCurl.cpp:
(WebCore::cookieRequestHeaderFieldValue):
* platform/network/curl/CookieJarCurl.h:
* platform/network/curl/SocketStreamHandleImpl.h:
* platform/network/mac/CookieJarMac.mm:
(WebCore::cookieRequestHeaderFieldValue):
* platform/network/soup/CookieJarSoup.cpp:
(WebCore::cookieRequestHeaderFieldValue):
* platform/network/soup/SocketStreamHandleImpl.h:

Source/WebKit:

* NetworkProcess/NetworkSocketStream.cpp:
(WebKit::NetworkSocketStream::sendHandshake):
* NetworkProcess/NetworkSocketStream.h:
* NetworkProcess/NetworkSocketStream.messages.in:
* WebProcess/Network/WebSocketStream.cpp:
(WebKit::WebSocketStream::networkProcessCrashed):
(WebKit::WebSocketStream::platformSendHandshake):
(WebKit::WebSocketStream::didSendHandshake):
* WebProcess/Network/WebSocketStream.h:
* WebProcess/Network/WebSocketStream.messages.in:

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

17 months agoHide Strong Password label when text field is too narrow
dbates@webkit.org [Sat, 21 Apr 2018 01:36:20 +0000 (01:36 +0000)]
Hide Strong Password label when text field is too narrow
https://bugs.webkit.org/show_bug.cgi?id=184785
<rdar://problem/38183939>

Reviewed by Zalan Bujtas.

Source/WebCore:

We accomplish this illusion by allowing the text field's decorations to wrap, specifying flex
shrink factors, a flex basis and hiding overflow. Hiding overflow is accomplished by a
combination of setting "overflow: hidden", "text-overflow: clip", and patching RenderTextControlSingleLine::layout()
to ensure that the height of the container element is equal to the intrinsic height of the
inner elements. Because the container is a flex box and we want to vertically center its
contents we also need to fix up the y-position of the container element as it may have flexed
as a result of forcing its height to match the intrinsic height of the inner elements.

* css/html.css:
(input::-webkit-strong-password-auto-fill-button): Specify a flex-shrink factor and prevent
wrapping of the "Strong Password" text when flexed.
* html/shadow/TextControlInnerElements.cpp:
(WebCore::TextControlInnerContainer::TextControlInnerContainer): Register for a custom style
resolution callback so that we can style the container if it is a Strong Password or Strong
Confirmation Password text field. Ideally we could accomplish this effect with a user agent-
specific pseudo class together with a selector definition in the user agent style sheet,
html.css. Unfortunately the style resolver does not seem to apply pseudo classes to
shadow DOM pseudo elements (why?). Therefore we use a custom style resolution callback to
achieve the same effect.
(WebCore::isStrongPasswordTextField): Returns whether the specified DOM element is a Strong
Password text field.
(WebCore::TextControlInnerContainer::resolveCustomStyle): Conditionally apply CSS properties
"flex-wrap: wrap" and overflow: hidden" if the shadow host of this container is a Strong
Password text field.
(WebCore::TextControlInnerElement::resolveCustomStyle): Conditionally style the inner text
if the shadow host of this container is a Strong Password text field. We need to apply these
styles here as opposed to in html.css for the same reason we need to apply the styles to
the container in a custom style resolution callback. See the comments for TextControlInnerContainer()
above for more details
* html/shadow/TextControlInnerElements.h:
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::resetOverriddenHeight): Added. Incorporates the logic from setNeedsLayoutOnAncestors().
(WebCore::RenderTextControlSingleLine::layout): Override the height of the container element to
match the height of the inner elements when this text field is a Strong Password field. We cache
the container's logical top before adjusting its height so that we can restore it after performing
a second layout of this renderer. This is needed because we vertically center the elements in this
renderer and adjusting the height of the container may cause it to flex and re-position along its
cross axis when the container's height is taller than the inner element's height (e.g. the "Strong
Password" label wraps to the next line). This re-positioning causes a noticeable jitter when
transitioning from a field that has a visible "Strong Password" label to one that does not. Caching
and restoring the logical top of the container element avoids this jitter.
(WebCore::setNeedsLayoutOnAncestors): Deleted. Moved its implementation into resetOverriddenHeight().

LayoutTests:

Update existing tests to include narrow text fields.

* fast/forms/auto-fill-button/input-strong-confirmation-password-auto-fill-button.html:
* fast/forms/auto-fill-button/input-strong-password-auto-fill-button.html:
* platform/mac/fast/forms/auto-fill-button/input-strong-confirmation-password-auto-fill-button-expected.txt:
* platform/mac/fast/forms/auto-fill-button/input-strong-password-auto-fill-button-expected.txt:

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

17 months agoDisable backward and forward navigation swipes while in fullscreen.
commit-queue@webkit.org [Sat, 21 Apr 2018 01:32:18 +0000 (01:32 +0000)]
Disable backward and forward navigation swipes while in fullscreen.
https://bugs.webkit.org/show_bug.cgi?id=184656
rdar://problem/36057535

Patch by Jeremy Jones <jeremyj@apple.com> on 2018-04-20
Reviewed by Tim Horton.

Disable navigation swipes while in fullscreen.

* UIProcess/Cocoa/ViewGestureController.cpp:
(WebKit::ViewGestureController::canSwipeInDirection const):

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

17 months agoRender a badge on system preview images
dino@apple.com [Sat, 21 Apr 2018 01:30:44 +0000 (01:30 +0000)]
Render a badge on system preview images
https://bugs.webkit.org/show_bug.cgi?id=184854
<rdar://problem/39615154>

Reviewed by Tim Horton.

Source/WebCore:

At paint time, if a RenderImage is an image element
which is identified as a system preview, then draw
a little badge in the top right corner.

It is expected that platforms will override the
default rendering with something that identifies
how a system preview will operate. e.g. QuickLook
on Apple systems.

Test: system-preview/badge.html

* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintIntoRect): If we are
a system preview, call RenderTheme to draw a badge.
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paintSystemPreviewBadge): A default
implementation that draws a red circle.
* rendering/RenderTheme.h:

LayoutTests:

* system-preview/badge-expected.html: Added.
* system-preview/badge.html: Added.

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

17 months agoUnreviewed, rolling out r230862.
commit-queue@webkit.org [Sat, 21 Apr 2018 01:24:53 +0000 (01:24 +0000)]
Unreviewed, rolling out r230862.
https://bugs.webkit.org/show_bug.cgi?id=184855

it is making some tests to time out on bots (Requested by
youenn on #webkit).

Reverted changeset:

"Mandate H264 hardware encoder for Mac in libwebrtc"
https://bugs.webkit.org/show_bug.cgi?id=184835
https://trac.webkit.org/changeset/230862

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

17 months agoWeb Inspector: remove some dead code in IdentifiersFactory
bburg@apple.com [Sat, 21 Apr 2018 01:12:44 +0000 (01:12 +0000)]
Web Inspector: remove some dead code in IdentifiersFactory
https://bugs.webkit.org/show_bug.cgi?id=184839

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

This was never used on non-Chrome ports, so the identifier always has a
prefix of '0.'. We may change this in the future, but for now remove this.
Using a PID for this purpose is problematic anyway.

* inspector/IdentifiersFactory.cpp:
(Inspector::addPrefixToIdentifier):
(Inspector::IdentifiersFactory::createIdentifier):
(Inspector::IdentifiersFactory::requestId):
(Inspector::IdentifiersFactory::addProcessIdPrefixTo): Deleted.
* inspector/IdentifiersFactory.h:

Source/WebCore:

* inspector/InspectorController.cpp:
(WebCore::InspectorController::setProcessId): Deleted.
* inspector/InspectorController.h:

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

17 months agoAdd the ability to use a hash for setting PtrTag enum values.
mark.lam@apple.com [Sat, 21 Apr 2018 00:19:00 +0000 (00:19 +0000)]
Add the ability to use a hash for setting PtrTag enum values.
https://bugs.webkit.org/show_bug.cgi?id=184852
<rdar://problem/39613891>

Reviewed by Saam Barati.

* runtime/PtrTag.h:

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

17 months agoElement fullscreen, expose WKWebView _fullScreenPlaceholderView as iOS SPI
commit-queue@webkit.org [Sat, 21 Apr 2018 00:09:27 +0000 (00:09 +0000)]
Element fullscreen, expose WKWebView _fullScreenPlaceholderView as iOS SPI
https://bugs.webkit.org/show_bug.cgi?id=184826
rdar://problem/39600825

Patch by Jeremy Jones <jeremyj@apple.com> on 2018-04-20
Reviewed by Tim Horton.

Add _fullScreenPlaceholderView for iOS similar to the one for Mac.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _fullScreenPlaceholderView]):
(-[WKWebView closeFullScreenWindowController]):
(-[WKWebView fullScreenPlaceholderView]): Deleted.
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.h:
* UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
(-[WKFullScreenWindowController webViewPlaceholder]):

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

17 months agoUse WindowProxy in DOMWindow.idl
cdumez@apple.com [Fri, 20 Apr 2018 23:48:50 +0000 (23:48 +0000)]
Use WindowProxy in DOMWindow.idl
https://bugs.webkit.org/show_bug.cgi?id=184820

Reviewed by Sam Weinig.

Use WindowProxy in DOMWindow.idl to match the specification more closely.

* bindings/js/JSWindowProxy.h:
* bindings/js/WindowProxy.cpp:
(WebCore::WindowProxy::window const):
* bindings/js/WindowProxy.h:
* bindings/scripts/CodeGeneratorJS.pm:
(NativeToJSValueDOMConvertNeedsState):
* dom/Document.cpp:
* dom/Document.h:
* dom/Document.idl:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::focus):
(WebCore::DOMWindow::self const):
(WebCore::DOMWindow::opener const):
(WebCore::DOMWindow::parent const):
(WebCore::DOMWindow::top const):
(WebCore::DOMWindow::open):
* page/DOMWindow.h:
* page/DOMWindow.idl:
* testing/Internals.cpp:
(WebCore::Internals::openDummyInspectorFrontend):
* testing/Internals.h:
* testing/Internals.idl:

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

17 months agoREGRESSION: API test WebKit.BackgroundColorSystemColor is failing
timothy@apple.com [Fri, 20 Apr 2018 23:45:09 +0000 (23:45 +0000)]
REGRESSION: API test WebKit.BackgroundColorSystemColor is failing

https://bugs.webkit.org/show_bug.cgi?id=184849
rdar://problem/39386405

Reviewed by Brian Burg.

* TestWebKitAPI/Tests/mac/BackgroundColor.mm:
(TestWebKitAPI::TEST): Use CGColorEqualToColor since we might get a different
CGColor pointer from NSColor each time.

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

17 months agoSome JSEntryPtrTags should actually be JSInternalPtrTags.
mark.lam@apple.com [Fri, 20 Apr 2018 23:30:05 +0000 (23:30 +0000)]
Some JSEntryPtrTags should actually be JSInternalPtrTags.
https://bugs.webkit.org/show_bug.cgi?id=184712
<rdar://problem/39507381>

Reviewed by Michael Saboff.

1. Convert some uses of JSEntryPtrTag into JSInternalPtrTags.
2. Tag all LLInt bytecodes consistently with BytecodePtrTag now and retag them
   only when needed.

* bytecode/AccessCase.cpp:
(JSC::AccessCase::generateImpl):
* bytecode/ByValInfo.h:
(JSC::ByValInfo::ByValInfo):
* bytecode/CallLinkInfo.cpp:
(JSC::CallLinkInfo::callReturnLocation):
(JSC::CallLinkInfo::patchableJump):
(JSC::CallLinkInfo::hotPathBegin):
(JSC::CallLinkInfo::slowPathStart):
* bytecode/CallLinkInfo.h:
(JSC::CallLinkInfo::setCallLocations):
(JSC::CallLinkInfo::hotPathOther):
* bytecode/PolymorphicAccess.cpp:
(JSC::PolymorphicAccess::regenerate):
* bytecode/StructureStubInfo.h:
(JSC::StructureStubInfo::doneLocation):
* dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::link):
* dfg/DFGOSRExit.cpp:
(JSC::DFG::reifyInlinedCallFrames):
* ftl/FTLLazySlowPath.cpp:
(JSC::FTL::LazySlowPath::initialize):
* ftl/FTLLazySlowPath.h:
(JSC::FTL::LazySlowPath::done const):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstruct):
(JSC::FTL::DFG::LowerDFGToB3::compileDirectCallOrConstruct):
(JSC::FTL::DFG::LowerDFGToB3::compileTailCall):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargsSpread):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargs):
(JSC::FTL::DFG::LowerDFGToB3::compileIn):
(JSC::FTL::DFG::LowerDFGToB3::lazySlowPath):
* jit/JIT.cpp:
(JSC::JIT::link):
* jit/JITExceptions.cpp:
(JSC::genericUnwind):
* jit/JITMathIC.h:
(JSC::isProfileEmpty):
* llint/LLIntData.cpp:
(JSC::LLInt::initialize):
* llint/LLIntData.h:
(JSC::LLInt::getCodePtr):
(JSC::LLInt::getExecutableAddress): Deleted.
* llint/LLIntExceptions.cpp:
(JSC::LLInt::callToThrow):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* wasm/js/WasmToJS.cpp:
(JSC::Wasm::wasmToJS):

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

17 months agoUpdate cross-origin SecurityError messages to not include the target origin
cdumez@apple.com [Fri, 20 Apr 2018 23:24:48 +0000 (23:24 +0000)]
Update cross-origin SecurityError messages to not include the target origin
https://bugs.webkit.org/show_bug.cgi?id=184803
<rdar://problem/39547724>

Reviewed by Sam Weinig.

Source/WebCore:

No new tests, rebaselined existing tests.

* bindings/js/JSDOMBindingSecurity.cpp:
(WebCore::canAccessDocument):
(WebCore::BindingSecurity::shouldAllowAccessToFrame):
(WebCore::BindingSecurity::shouldAllowAccessToDOMWindow):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::crossDomainAccessErrorMessage):
(WebCore::DOMWindow::isInsecureScriptAccess):
* page/DOMWindow.h:
* page/Location.cpp:
(WebCore::Location::reload):

LayoutTests:

* http/tests/history/cross-origin-replace-history-object-child-expected.txt:
* http/tests/history/cross-origin-replace-history-object-expected.txt:
* http/tests/plugins/cross-frame-object-access-expected.txt:
* http/tests/security/XFrameOptions/x-frame-options-deny-expected.txt:
* http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-parent-same-origin-deny-expected.txt:
* http/tests/security/XFrameOptions/x-frame-options-multiple-headers-sameorigin-deny-expected.txt:
* http/tests/security/XFrameOptions/x-frame-options-parent-same-origin-deny-expected.txt:
* http/tests/security/aboutBlank/xss-DENIED-navigate-opener-document-write-expected.txt:
* http/tests/security/aboutBlank/xss-DENIED-navigate-opener-javascript-url-expected.txt:
* http/tests/security/aboutBlank/xss-DENIED-set-opener-expected.txt:
* http/tests/security/contentSecurityPolicy/sandbox-allow-scripts-in-http-header-expected.txt:
* http/tests/security/cross-frame-access-call-expected.txt:
* http/tests/security/cross-frame-access-callback-explicit-domain-DENY-expected.txt:
* http/tests/security/cross-frame-access-child-explicit-domain-expected.txt:
* http/tests/security/cross-frame-access-custom-expected.txt:
* http/tests/security/cross-frame-access-delete-expected.txt:
* http/tests/security/cross-frame-access-first-time-expected.txt:
* http/tests/security/cross-frame-access-get-custom-property-cached-expected.txt:
* http/tests/security/cross-frame-access-get-expected.txt:
* http/tests/security/cross-frame-access-getOwnPropertyDescriptor-expected.txt:
* http/tests/security/cross-frame-access-history-get-expected.txt:
* http/tests/security/cross-frame-access-history-get-override-expected.txt:
* http/tests/security/cross-frame-access-history-prototype-expected.txt:
* http/tests/security/cross-frame-access-location-get-expected.txt:
* http/tests/security/cross-frame-access-location-get-override-expected.txt:
* http/tests/security/cross-frame-access-location-put-expected.txt:
* http/tests/security/cross-frame-access-name-getter-expected.txt:
* http/tests/security/cross-frame-access-object-getPrototypeOf-expected.txt:
* http/tests/security/cross-frame-access-object-prototype-expected.txt:
* http/tests/security/cross-frame-access-parent-explicit-domain-expected.txt:
* http/tests/security/cross-frame-access-port-expected.txt:
* http/tests/security/cross-frame-access-protocol-expected.txt:
* http/tests/security/cross-frame-access-protocol-explicit-domain-expected.txt:
* http/tests/security/cross-frame-access-put-expected.txt:
* http/tests/security/cross-frame-access-selection-expected.txt:
* http/tests/security/cross-origin-reified-window-property-access-expected.txt:
* http/tests/security/cross-origin-window-property-access-expected.txt:
* http/tests/security/dataURL/xss-DENIED-from-data-url-in-foreign-domain-subframe-expected.txt:
* http/tests/security/dataURL/xss-DENIED-from-data-url-in-foreign-domain-window-open-expected.txt:
* http/tests/security/dataURL/xss-DENIED-from-data-url-sub-frame-2-level-expected.txt:
* http/tests/security/dataURL/xss-DENIED-from-data-url-sub-frame-expected.txt:
* http/tests/security/dataURL/xss-DENIED-from-data-url-sub-frame-to-data-url-sub-frame-expected.txt:
* http/tests/security/dataURL/xss-DENIED-from-data-url-to-data-url-expected.txt:
* http/tests/security/dataURL/xss-DENIED-from-javascript-url-window-open-expected.txt:
* http/tests/security/dataURL/xss-DENIED-to-data-url-from-data-url-expected.txt:
* http/tests/security/dataURL/xss-DENIED-to-data-url-in-foreign-domain-subframe-expected.txt:
* http/tests/security/dataURL/xss-DENIED-to-data-url-in-foreign-domain-subframe-location-change-expected.txt:
* http/tests/security/dataURL/xss-DENIED-to-data-url-in-foreign-domain-window-open-expected.txt:
* http/tests/security/dataURL/xss-DENIED-to-data-url-sub-frame-2-level-expected.txt:
* http/tests/security/dataURL/xss-DENIED-to-data-url-sub-frame-expected.txt:
* http/tests/security/dataURL/xss-DENIED-to-data-url-sub-frame-uppercase-expected.txt:
* http/tests/security/dataURL/xss-DENIED-to-data-url-window-open-expected.txt:
* http/tests/security/document-all-expected.txt:
* http/tests/security/javascriptURL/xss-DENIED-from-javascript-url-in-foreign-domain-subframe-expected.txt:
* http/tests/security/javascriptURL/xss-DENIED-from-javascript-url-in-foreign-domain-window-open-expected.txt:
* http/tests/security/javascriptURL/xss-DENIED-to-javascript-url-in-foreign-domain-subframe-expected.txt:
* http/tests/security/javascriptURL/xss-DENIED-to-javascript-url-in-foreign-domain-window-open-expected.txt:
* http/tests/security/listener/xss-JSTargetNode-onclick-addEventListener-expected.txt:
* http/tests/security/listener/xss-JSTargetNode-onclick-shortcut-expected.txt:
* http/tests/security/listener/xss-XMLHttpRequest-addEventListener-expected.txt:
* http/tests/security/listener/xss-XMLHttpRequest-shortcut-expected.txt:
* http/tests/security/listener/xss-window-onclick-addEventListener-expected.txt:
* http/tests/security/listener/xss-window-onclick-shortcut-expected.txt:
* http/tests/security/location-cross-origin-expected.txt:
* http/tests/security/sandboxed-iframe-blocks-access-from-parent-expected.txt:
* http/tests/security/sandboxed-iframe-modify-self-expected.txt:
* http/tests/security/sandboxed-iframe-origin-add-expected.txt:
* http/tests/security/sandboxed-iframe-origin-remove-expected.txt:
* http/tests/security/srcdoc-in-sandbox-cannot-access-parent-expected.txt:
* http/tests/security/symbols-cross-origin-expected.txt:
* http/tests/security/window-defineProperty-crossOrigin-expected.txt:
* http/tests/security/xss-DENIED-assign-location-hash-expected.txt:
* http/tests/security/xss-DENIED-assign-location-host-expected.txt:
* http/tests/security/xss-DENIED-assign-location-hostname-expected.txt:
* http/tests/security/xss-DENIED-assign-location-nonstandardProperty-expected.txt:
* http/tests/security/xss-DENIED-assign-location-pathname-expected.txt:
* http/tests/security/xss-DENIED-assign-location-protocol-expected.txt:
* http/tests/security/xss-DENIED-assign-location-reload-expected.txt:
* http/tests/security/xss-DENIED-assign-location-search-expected.txt:
* http/tests/security/xss-DENIED-defineProperty-expected.txt:
* http/tests/security/xss-DENIED-frame-name-expected.txt:
* http/tests/security/xss-DENIED-htmlelelment-with-iframe-proto-expected.txt:
* http/tests/security/xss-DENIED-method-with-iframe-proto-expected.txt:
* http/tests/security/xss-DENIED-named-window-property-from-cross-origin-inactive-document-expected.txt:
* http/tests/security/xss-DENIED-sandboxed-iframe-expected.txt:
* http/tests/security/xss-DENIED-synchronous-form-expected.txt:
* http/tests/security/xss-DENIED-window-name-navigator-expected.txt:
* http/tests/security/xss-DENIED-xsl-document-securityOrigin-expected.txt:
* http/tests/security/xssAuditor/block-does-not-leak-location-expected.txt:
* http/tests/security/xssAuditor/full-block-script-tag-cross-domain-expected.txt:
* platform/wk2/http/tests/security/XFrameOptions/x-frame-options-deny-expected.txt:
* platform/wk2/http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-parent-same-origin-deny-expected.txt:
* platform/wk2/http/tests/security/XFrameOptions/x-frame-options-multiple-headers-sameorigin-deny-expected.txt:
* platform/wk2/http/tests/security/XFrameOptions/x-frame-options-parent-same-origin-deny-expected.txt:

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

17 months agoHandle more JSON stringify OOM
jfbastien@apple.com [Fri, 20 Apr 2018 23:18:23 +0000 (23:18 +0000)]
Handle more JSON stringify OOM
https://bugs.webkit.org/show_bug.cgi?id=184846
<rdar://problem/39390672>

Reviewed by Mark Lam.

JSTests:

* stress/json-stringified-overflow-2.js: Added. Same as the one
below, but with a bigger input which will trigger a different code
path.
(catch):
* stress/json-stringified-overflow.js: Modify the test to only
catch OOM on stringification. not on string creation.

Source/WTF:

JSON stringification can OOM easily. Here's another case.

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

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

17 months agoMandate H264 hardware encoder for Mac in libwebrtc
youenn@apple.com [Fri, 20 Apr 2018 22:57:54 +0000 (22:57 +0000)]
Mandate H264 hardware encoder for Mac in libwebrtc
https://bugs.webkit.org/show_bug.cgi?id=184835

Reviewed by Eric Carlson.

Tested manually through console traces that hardware VCP encoder code path is actually used instead of software VCP encoder code path.

* Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoEncoderH264.mm:
(-[RTCVideoEncoderH264 resetCompressionSessionWithPixelFormat:]):
* WebKit/0001-Update-RTCVideoEncoderH264.mm-for-WebKit.patch: Added to cover this change and changes made in bug 184668 and 183961.

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

17 months agoUpdate HSL/HSLA parsing to match CSS Color 4
commit-queue@webkit.org [Fri, 20 Apr 2018 22:28:47 +0000 (22:28 +0000)]
Update HSL/HSLA parsing to match CSS Color 4
https://bugs.webkit.org/show_bug.cgi?id=180528
<rdar://problem/35926675>

LayoutTests/imported/w3c:

Patch by Chris Nardi <cnardi@chromium.org> on 2018-04-20
Reviewed by Simon Fraser.

CSS Color 4 had many changes to the HSL/HSLA functions, including allowing angles to be
specified as the hue, adding a comma optional syntax, making the two functions synonyms
so each function can take an alpha value, and allowing percent alpha values. This change
updates our behavior to match that, and updates the HSL to RGB algorithm.

This change also updates the import of WPT css-color to test the changes.

* canvas/2d.fillStyle.parse.invalid.hsl-5-expected.txt:
* web-platform-tests/css/css-color/OWNERS: Added.
* web-platform-tests/css/css-color/border-bottom-color-expected.xht: Added.
* web-platform-tests/css/css-color/border-bottom-color.xht: Added.
* web-platform-tests/css/css-color/border-left-color-expected.xht: Added.
* web-platform-tests/css/css-color/border-left-color.xht: Added.
* web-platform-tests/css/css-color/border-right-color-expected.xht: Added.
* web-platform-tests/css/css-color/border-right-color.xht: Added.
* web-platform-tests/css/css-color/border-top-color-expected.xht: Added.
* web-platform-tests/css/css-color/border-top-color.xht: Added.
* web-platform-tests/css/css-color/color-001-expected.html: Added.
* web-platform-tests/css/css-color/color-001.html: Added.
* web-platform-tests/css/css-color/color-002-expected.html: Added.
* web-platform-tests/css/css-color/color-002.html: Added.
* web-platform-tests/css/css-color/color-003-expected.html: Added.
* web-platform-tests/css/css-color/color-003.html: Added.
* web-platform-tests/css/css-color/currentcolor-001-expected.html: Added.
* web-platform-tests/css/css-color/currentcolor-001.html: Added.
* web-platform-tests/css/css-color/currentcolor-002-expected.html: Added.
* web-platform-tests/css/css-color/currentcolor-002.html: Added.
* web-platform-tests/css/css-color/hex-001-expected.html: Added.
* web-platform-tests/css/css-color/hex-001.html: Added.
* web-platform-tests/css/css-color/hex-002-expected.html: Added.
* web-platform-tests/css/css-color/hex-002.html: Added.
* web-platform-tests/css/css-color/hex-003-expected.html: Added.
* web-platform-tests/css/css-color/hex-003.html: Added.
* web-platform-tests/css/css-color/hex-004-expected.html: Added.
* web-platform-tests/css/css-color/hex-004.html: Added.
* web-platform-tests/css/css-color/hsl-001-expected.html: Added.
* web-platform-tests/css/css-color/hsl-001.html: Added.
* web-platform-tests/css/css-color/hsl-002-expected.html: Added.
* web-platform-tests/css/css-color/hsl-002.html: Added.
* web-platform-tests/css/css-color/hsl-003-expected.html: Added.
* web-platform-tests/css/css-color/hsl-003.html: Added.
* web-platform-tests/css/css-color/hsl-004-expected.html: Added.
* web-platform-tests/css/css-color/hsl-004.html: Added.
* web-platform-tests/css/css-color/hsl-005-expected.html: Added.
* web-platform-tests/css/css-color/hsl-005.html: Added.
* web-platform-tests/css/css-color/hsl-006-expected.html: Added.
* web-platform-tests/css/css-color/hsl-006.html: Added.
* web-platform-tests/css/css-color/hsl-007-expected.html: Added.
* web-platform-tests/css/css-color/hsl-007.html: Added.
* web-platform-tests/css/css-color/hsl-008-expected.html: Added.
* web-platform-tests/css/css-color/hsl-008.html: Added.
* web-platform-tests/css/css-color/hsla-001-expected.html: Added.
* web-platform-tests/css/css-color/hsla-001.html: Added.
* web-platform-tests/css/css-color/hsla-002-expected.html: Added.
* web-platform-tests/css/css-color/hsla-002.html: Added.
* web-platform-tests/css/css-color/hsla-003-expected.html: Added.
* web-platform-tests/css/css-color/hsla-003.html: Added.
* web-platform-tests/css/css-color/hsla-004-expected.html: Added.
* web-platform-tests/css/css-color/hsla-004.html: Added.
* web-platform-tests/css/css-color/hsla-005-expected.html: Added.
* web-platform-tests/css/css-color/hsla-005.html: Added.
* web-platform-tests/css/css-color/hsla-006-expected.html: Added.
* web-platform-tests/css/css-color/hsla-006.html: Added.
* web-platform-tests/css/css-color/hsla-007-expected.html: Added.
* web-platform-tests/css/css-color/hsla-007.html: Added.
* web-platform-tests/css/css-color/hsla-008-expected.html: Added.
* web-platform-tests/css/css-color/hsla-008.html: Added.
* web-platform-tests/css/css-color/htaccess: Added.
* web-platform-tests/css/css-color/lab-001-expected.html: Added.
* web-platform-tests/css/css-color/lab-001.html: Added.
* web-platform-tests/css/css-color/lab-002-expected.html: Added.
* web-platform-tests/css/css-color/lab-002.html: Added.
* web-platform-tests/css/css-color/lab-003-expected.html: Added.
* web-platform-tests/css/css-color/lab-003.html: Added.
* web-platform-tests/css/css-color/lab-004-expected.html: Added.
* web-platform-tests/css/css-color/lab-004.html: Added.
* web-platform-tests/css/css-color/lab-005-expected.html: Added.
* web-platform-tests/css/css-color/lab-005.html: Added.
* web-platform-tests/css/css-color/lab-006-expected.html: Added.
* web-platform-tests/css/css-color/lab-006.html: Added.
* web-platform-tests/css/css-color/lab-007-expected.html: Added.
* web-platform-tests/css/css-color/lab-007.html: Added.
* web-platform-tests/css/css-color/lch-001-expected.html: Added.
* web-platform-tests/css/css-color/lch-001.html: Added.
* web-platform-tests/css/css-color/lch-002-expected.html: Added.
* web-platform-tests/css/css-color/lch-002.html: Added.
* web-platform-tests/css/css-color/lch-003-expected.html: Added.
* web-platform-tests/css/css-color/lch-003.html: Added.
* web-platform-tests/css/css-color/lch-004-expected.html: Added.
* web-platform-tests/css/css-color/lch-004.html: Added.
* web-platform-tests/css/css-color/lch-005-expected.html: Added.
* web-platform-tests/css/css-color/lch-005.html: Added.
* web-platform-tests/css/css-color/lch-006-expected.html: Added.
* web-platform-tests/css/css-color/lch-006.html: Added.
* web-platform-tests/css/css-color/lch-007-expected.html: Added.
* web-platform-tests/css/css-color/lch-007.html: Added.
* web-platform-tests/css/css-color/named-001-expected.html: Added.
* web-platform-tests/css/css-color/named-001.html: Added.
* web-platform-tests/css/css-color/rgb-001-expected.html: Added.
* web-platform-tests/css/css-color/rgb-001.html: Added.
* web-platform-tests/css/css-color/rgb-002-expected.html: Added.
* web-platform-tests/css/css-color/rgb-002.html: Added.
* web-platform-tests/css/css-color/rgb-003-expected.html: Added.
* web-platform-tests/css/css-color/rgb-003.html: Added.
* web-platform-tests/css/css-color/rgb-004-expected.html: Added.
* web-platform-tests/css/css-color/rgb-004.html: Added.
* web-platform-tests/css/css-color/rgb-005-expected.html: Added.
* web-platform-tests/css/css-color/rgb-005.html: Added.
* web-platform-tests/css/css-color/rgb-006-expected.html: Added.
* web-platform-tests/css/css-color/rgb-006.html: Added.
* web-platform-tests/css/css-color/rgb-007-expected.html: Added.
* web-platform-tests/css/css-color/rgb-007.html: Added.
* web-platform-tests/css/css-color/rgb-008-expected.html: Added.
* web-platform-tests/css/css-color/rgb-008.html: Added.
* web-platform-tests/css/css-color/rgba-001-expected.html: Added.
* web-platform-tests/css/css-color/rgba-001.html: Added.
* web-platform-tests/css/css-color/rgba-002-expected.html: Added.
* web-platform-tests/css/css-color/rgba-002.html: Added.
* web-platform-tests/css/css-color/rgba-003-expected.html: Added.
* web-platform-tests/css/css-color/rgba-003.html: Added.
* web-platform-tests/css/css-color/rgba-004-expected.html: Added.
* web-platform-tests/css/css-color/rgba-004.html: Added.
* web-platform-tests/css/css-color/rgba-005-expected.html: Added.
* web-platform-tests/css/css-color/rgba-005.html: Added.
* web-platform-tests/css/css-color/rgba-006-expected.html: Added.
* web-platform-tests/css/css-color/rgba-006.html: Added.
* web-platform-tests/css/css-color/rgba-007-expected.html: Added.
* web-platform-tests/css/css-color/rgba-007.html: Added.
* web-platform-tests/css/css-color/rgba-008-expected.html: Added.
* web-platform-tests/css/css-color/rgba-008.html: Added.
* web-platform-tests/css/css-color/t31-color-currentColor-b.xht:
* web-platform-tests/css/css-color/t31-color-text-a-expected.xht: Added.
* web-platform-tests/css/css-color/t31-color-text-a.xht: Added.
* web-platform-tests/css/css-color/t32-opacity-basic-0.0-a-expected.html: Added.
* web-platform-tests/css/css-color/t32-opacity-basic-0.0-a.xht: Added.
* web-platform-tests/css/css-color/t32-opacity-basic-1.0-a-expected.html: Added.
* web-platform-tests/css/css-color/t32-opacity-basic-1.0-a.xht: Added.
* web-platform-tests/css/css-color/t32-opacity-clamping-0.0-b-expected.html: Added.
* web-platform-tests/css/css-color/t32-opacity-clamping-0.0-b.xht: Added.
* web-platform-tests/css/css-color/t32-opacity-clamping-1.0-b-expected.html: Added.
* web-platform-tests/css/css-color/t32-opacity-clamping-1.0-b.xht: Added.
* web-platform-tests/css/css-color/t32-opacity-offscreen-b-expected.html: Added.
* web-platform-tests/css/css-color/t32-opacity-offscreen-b.xht: Added.
* web-platform-tests/css/css-color/t32-opacity-offscreen-multiple-boxes-1-c.xht:
* web-platform-tests/css/css-color/t32-opacity-offscreen-multiple-boxes-2-c.xht:
* web-platform-tests/css/css-color/t32-opacity-offscreen-with-alpha-c-expected.html: Added.
* web-platform-tests/css/css-color/t32-opacity-offscreen-with-alpha-c.xht: Added.
* web-platform-tests/css/css-color/t41-html4-keywords-a-expected.html: Added.
* web-platform-tests/css/css-color/t41-html4-keywords-a.xht: Added.
* web-platform-tests/css/css-color/t421-rgb-clip-outside-gamut-b-expected.html: Added.
* web-platform-tests/css/css-color/t421-rgb-clip-outside-gamut-b.xht: Added.
* web-platform-tests/css/css-color/t421-rgb-func-int-a.xht:
* web-platform-tests/css/css-color/t421-rgb-func-no-mixed-f.xht:
* web-platform-tests/css/css-color/t421-rgb-func-pct-a.xht:
* web-platform-tests/css/css-color/t421-rgb-func-whitespace-b.xht:
* web-platform-tests/css/css-color/t421-rgb-hex-parsing-f.xht:
* web-platform-tests/css/css-color/t421-rgb-hex3-a.xht:
* web-platform-tests/css/css-color/t421-rgb-hex6-a.xht:
* web-platform-tests/css/css-color/t421-rgb-values-meaning-b-expected.html: Added.
* web-platform-tests/css/css-color/t421-rgb-values-meaning-b.xht: Added.
* web-platform-tests/css/css-color/t422-rgba-a0.0-a-expected.html: Added.
* web-platform-tests/css/css-color/t422-rgba-a0.0-a.xht: Added.
* web-platform-tests/css/css-color/t422-rgba-a1.0-a.xht:
* web-platform-tests/css/css-color/t422-rgba-clamping-a0.0-b.xht:
* web-platform-tests/css/css-color/t422-rgba-clamping-a1.0-b.xht:
* web-platform-tests/css/css-color/t422-rgba-clip-outside-device-gamut-b.xht:
* web-platform-tests/css/css-color/t422-rgba-func-int-a.xht:
* web-platform-tests/css/css-color/t422-rgba-func-no-mixed-f.xht:
* web-platform-tests/css/css-color/t422-rgba-func-pct-a.xht:
* web-platform-tests/css/css-color/t422-rgba-func-whitespace-b.xht:
* web-platform-tests/css/css-color/t422-rgba-onscreen-b.xht:
* web-platform-tests/css/css-color/t422-rgba-onscreen-multiple-boxes-c.xht:
* web-platform-tests/css/css-color/t422-rgba-values-meaning-b-expected.html: Added.
* web-platform-tests/css/css-color/t422-rgba-values-meaning-b.xht: Added.
* web-platform-tests/css/css-color/t423-transparent-1-a.xht:
* web-platform-tests/css/css-color/t423-transparent-2-a.xht:
* web-platform-tests/css/css-color/t424-hsl-basic-a.xht:
* web-platform-tests/css/css-color/t424-hsl-clip-outside-gamut-b.xht:
* web-platform-tests/css/css-color/t424-hsl-h-rotating-b-expected.html: Added.
* web-platform-tests/css/css-color/t424-hsl-h-rotating-b.xht: Added.
* web-platform-tests/css/css-color/t424-hsl-parsing-f.xht:
* web-platform-tests/css/css-color/t424-hsl-values-b-1.html:
* web-platform-tests/css/css-color/t424-hsl-values-b-10.html:
* web-platform-tests/css/css-color/t424-hsl-values-b-11.html:
* web-platform-tests/css/css-color/t424-hsl-values-b-12.html:
* web-platform-tests/css/css-color/t424-hsl-values-b-13.html:
* web-platform-tests/css/css-color/t424-hsl-values-b-14.html:
* web-platform-tests/css/css-color/t424-hsl-values-b-15.html:
* web-platform-tests/css/css-color/t424-hsl-values-b-2.html:
* web-platform-tests/css/css-color/t424-hsl-values-b-3.html:
* web-platform-tests/css/css-color/t424-hsl-values-b-4.html:
* web-platform-tests/css/css-color/t424-hsl-values-b-5.html:
* web-platform-tests/css/css-color/t424-hsl-values-b-6.html:
* web-platform-tests/css/css-color/t424-hsl-values-b-7.html:
* web-platform-tests/css/css-color/t424-hsl-values-b-8.html:
* web-platform-tests/css/css-color/t424-hsl-values-b-9.html:
* web-platform-tests/css/css-color/t425-hsla-clip-outside-device-gamut-b.xht:
* web-platform-tests/css/css-color/t425-hsla-h-rotating-b-expected.html: Added.
* web-platform-tests/css/css-color/t425-hsla-h-rotating-b.xht: Added.
* web-platform-tests/css/css-color/t425-hsla-onscreen-b-expected.html: Added.
* web-platform-tests/css/css-color/t425-hsla-onscreen-b.xht: Added.
* web-platform-tests/css/css-color/t425-hsla-onscreen-multiple-boxes-c.xht:
* web-platform-tests/css/css-color/t425-hsla-parsing-f.xht:
* web-platform-tests/css/css-color/t425-hsla-values-b.xht:
* web-platform-tests/css/css-color/t43-svg-keywords-a-expected.html: Added.
* web-platform-tests/css/css-color/t43-svg-keywords-a.xht: Added.
* web-platform-tests/css/css-color/t44-currentcolor-background-b.xht:
* web-platform-tests/css/css-color/t44-currentcolor-border-b-expected.html:
* web-platform-tests/css/css-color/t44-currentcolor-border-b.xht:
* web-platform-tests/css/css-color/t44-currentcolor-inherited-c-expected.xht: Added.
* web-platform-tests/css/css-color/t44-currentcolor-inherited-c.xht: Added.
* web-platform-tests/css/css-color/w3c-import.log: Added.

Source/WebCore:

CSS Color 4 specifies a comma optional syntax for HSL/HSLA, as well as allowing angle values for the
hue and percent alpha values. Update our parsing to match this.

Patch by Chris Nardi <cnardi@chromium.org> on 2018-04-20
Reviewed by Simon Fraser.

This change also updates the import of WPT css-color to test the changes.

Tests: LayoutTests/imported/w3c/web-platform-tests/css/css-color/hsl{a}-{001-008}.html

* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::parseHSLParameters):
(WebCore::CSSPropertyParserHelpers::parseColorFunction):
(WebCore::CSSPropertyParserHelpers::consumeColor):
* platform/graphics/Color.cpp:
(WebCore::calcHue):
(WebCore::makeRGBAFromHSLA):

LayoutTests:

Patch by Chris Nardi <cnardi@chromium.org> on 2018-04-20
Reviewed by Simon Fraser.

This change updates our import of web-platform-tests/css/css-color
to test the new behavior.

* TestExpectations:
* canvas/philip/tests/2d.fillStyle.parse.invalid.hsl-5-expected.txt:

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

17 months ago[Extra zoom mode] Injected bundle form client should be notified when editing text...
wenson_hsieh@apple.com [Fri, 20 Apr 2018 22:21:54 +0000 (22:21 +0000)]
[Extra zoom mode] Injected bundle form client should be notified when editing text fields
https://bugs.webkit.org/show_bug.cgi?id=184822
<rdar://problem/38807319>

Reviewed by Tim Horton.

Source/WebCore:

Export the constructor and destructor of UserTypingGestureIndicator for use in WebKit (see WebPage.cpp).

Test: fast/forms/extrazoom/edit-text-field-calls-injected-bundle.html

* dom/UserTypingGestureIndicator.h:

Source/WebKit:

Fixes the bug by making a couple of tweaks: (1) don't use a separate codepath for inserting text in text inputs,
and (2) force a user typing gesture when inserting text using this codepath (i.e. WKTextInputListViewController).
Also adds plumbing to enable testing text entry with WKTextInputListViewController in extra zoom mode.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _simulateTextEntered:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:

Introduce testing SPI to simulate text entry. Additionally, add a missing availability annotation around testing
SPI added in 2017 to help test drag and drop for iOS 11.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _simulateTextEntered:]):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setTextAsync):

Tools:

Add WebKitTestRunner support for listening to form editing SPI hooks in the injected bundle. The new layout test
installs callbacks that listen for "begin editing", "end editing", and "text changed" calls to injected bundle
SPI. See other ChangeLogs for more detail.

* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::enterText):
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:

Add UIScriptController support for simulating text entry in the currently focused element.

* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::enterText):
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:

Add TestRunner bindings for registering injected bundle form client callbacks.

* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::handleTextDidChangeInTextField):
(WTR::handleTextFieldDidBeginEditing):
(WTR::handleTextFieldDidEndEditing):
(WTR::InjectedBundle::didCreatePage):

Set the injected bundle form editor client.

(WTR::InjectedBundle::setUpInjectedBundleClients):
(WTR::InjectedBundle::textDidChangeInTextField):
(WTR::InjectedBundle::textFieldDidBeginEditing):
(WTR::InjectedBundle::textFieldDidEndEditing):
* WebKitTestRunner/InjectedBundle/InjectedBundle.h:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::installTextDidChangeInTextFieldCallback):
(WTR::TestRunner::textDidChangeInTextFieldCallback):
(WTR::TestRunner::installTextFieldDidBeginEditingCallback):
(WTR::TestRunner::textFieldDidBeginEditingCallback):
(WTR::TestRunner::installTextFieldDidEndEditingCallback):
(WTR::TestRunner::textFieldDidEndEditingCallback):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::enterText):

LayoutTests:

Add a new layout test that focuses an input field, simulates text entry, and verifies that the injected bundle
form client's textDidChangeInTextField, textFieldDidBeginEditing and textFieldDidEndEditing functions are called.

* TestExpectations:

Skip tests in fast/forms/extrazoom by default.

* fast/forms/extrazoom/edit-text-field-calls-injected-bundle-expected.txt: Added.
* fast/forms/extrazoom/edit-text-field-calls-injected-bundle.html: Added.
* resources/ui-helper.js:
(window.UIHelper.enterText):

Introduce a new UIHelper method to simulate text entry in the currently focused element.

(window.UIHelper):

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

17 months agoEnterFullscreen must update the minimum and maximum layout sizes.
commit-queue@webkit.org [Fri, 20 Apr 2018 22:16:06 +0000 (22:16 +0000)]
EnterFullscreen must update the minimum and maximum layout sizes.
https://bugs.webkit.org/show_bug.cgi?id=184828
rdar://problem/38435829

Patch by Jeremy Jones <jeremyj@apple.com> on 2018-04-20
Reviewed by Jon Lee.

Without this, the WKWebView won't layout to the full size in fullscreen mode.

* UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
(-[WKFullScreenWindowController enterFullScreen]):

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

17 months agoDon't put build products into WK_ALTERNATE_WEBKIT_SDK_PATH for engineering builds
jer.noble@apple.com [Fri, 20 Apr 2018 22:14:35 +0000 (22:14 +0000)]
Don't put build products into WK_ALTERNATE_WEBKIT_SDK_PATH for engineering builds
https://bugs.webkit.org/show_bug.cgi?id=184762

Reviewed by Dan Bernstein.

Source/bmalloc:

* Configurations/Base.xcconfig:

Source/JavaScriptCore:

* Configurations/Base.xcconfig:
* JavaScriptCore.xcodeproj/project.pbxproj:

Source/ThirdParty/ANGLE:

* Configurations/Base.xcconfig:

Source/WebCore:

* Configurations/WebCore.xcconfig:
* WebCore.xcodeproj/project.pbxproj:

Source/WebCore/PAL:

* Configurations/CopyPALHeaders.xcconfig:
* Configurations/PAL.xcconfig:

Source/WebKit:

* Configurations/BaseTarget.xcconfig:

Source/WebKitLegacy/mac:

* Configurations/WebKitLegacy.xcconfig:

Source/WTF:

* Configurations/Base.xcconfig:

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

17 months agoRefactor NetworkResourceLoader to check for m_networkLoadChecker presence before...
youenn@apple.com [Fri, 20 Apr 2018 22:03:38 +0000 (22:03 +0000)]
Refactor NetworkResourceLoader to check for m_networkLoadChecker presence before using it
https://bugs.webkit.org/show_bug.cgi?id=184755

Reviewed by Chris Dumez.

Source/WebKit:

Make NetworkResourceLoader always use m_networkLoadChecker if there is one.
This is only used now for synchronous loads but will be used in the future for asynchronous loads as well.

Since we call didFail asynchronously to make sync/async handling more consistent,
We need to keep track of whether we will do clean-up twice.
A boolean is added for that purpose in NetworkResourceLoader.

There is a small change of behavior in the way we return an error.
Instead of returning a platformBadResponseError, we are now returning the error as computed by NetworkLoadChecker.
This allows getting some more error logging in the JS console.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::didReceiveResponse):
(WebKit::NetworkResourceLoader::willSendRedirectedRequest):
(WebKit::NetworkResourceLoader::continueWillSendRedirectedRequest):
(WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
* NetworkProcess/NetworkResourceLoader.h:

LayoutTests:

Made specific WK1 expectations as WK2 now has console messages for sync XHR that WK1 does not have.
Dump JS console log in stderr for redirect-cross-origin-sync-double.html as the test does not rely on it
and this allows keeping a single expected.txt file for WK1 and WK2.

* TestExpectations:
* http/tests/xmlhttprequest/access-control-and-redirects-expected.txt:
* http/tests/xmlhttprequest/redirect-cross-origin-tripmine-expected.txt:
* platform/mac-wk1/http/tests/xmlhttprequest/redirect-cross-origin-tripmine-expected.txt: Added.
* platform/win/http/tests/xmlhttprequest/redirect-cross-origin-tripmine-expected.txt: Added.

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

17 months agoRemove code for compilers that did not support NSDMI for aggregates
dbates@webkit.org [Fri, 20 Apr 2018 21:10:56 +0000 (21:10 +0000)]
Remove code for compilers that did not support NSDMI for aggregates
https://bugs.webkit.org/show_bug.cgi?id=184599

Reviewed by Per Arne Vollan.

Remove workaround for earlier Visual Studio versions that did not support non-static data
member initializers (NSDMI) for aggregates. We have since updated all the build.webkit.org
and EWS bots to a newer version that supports this feature.

Source/bmalloc:

* bmalloc/BPlatform.h:
* bmalloc/List.h:
(bmalloc::ListNode::ListNode): Deleted.
(bmalloc::List::iterator::iterator): Deleted.

Source/JavaScriptCore:

* domjit/DOMJITEffect.h:
(JSC::DOMJIT::Effect::Effect): Deleted.
* runtime/HasOwnPropertyCache.h:
(JSC::HasOwnPropertyCache::Entry::Entry): Deleted.
* wasm/WasmFormat.h:
(JSC::Wasm::WasmToWasmImportableFunction::WasmToWasmImportableFunction): Deleted.

Source/WebCore:

* Modules/cache/CacheQueryOptions.h:
(WebCore::CacheQueryOptions::CacheQueryOptions): Deleted.
* dom/Node.h:
(WebCore::Node::InsertionType::InsertionType): Deleted.
(WebCore::Node::RemovalType::RemovalType): Deleted.
* html/canvas/CanvasStyle.h:
(WebCore::CanvasStyle::CMYKAColor::CMYKAColor): Deleted.
* page/EventHandler.h:
(WebCore::EventHandler::DragTargetResponse::DragTargetResponse): Deleted.
* page/animation/CSSAnimationController.h:
(WebCore::AnimationUpdate::AnimationUpdate): Deleted.
* platform/graphics/FontSelectionAlgorithm.h:
(WebCore::FontSelectionRequest::tied const):
(WebCore::FontSelectionRequest::FontSelectionRequest): Deleted.
(WebCore::FontSelectionCapabilities::FontSelectionCapabilities): Deleted.
* platform/mediastream/IceCandidate.h:
(WebCore::IceCandidate::IceCandidate): Deleted.
* platform/text/StringWithDirection.h:
(WebCore::StringWithDirection::StringWithDirection): Deleted.
* rendering/MarkedText.h:
(WebCore::MarkedText::MarkedText): Deleted.
* style/StyleUpdate.h:
(WebCore::Style::ElementUpdate::ElementUpdate): Deleted.
(WebCore::Style::ElementUpdates::ElementUpdates): Deleted.
(WebCore::Style::TextUpdate::TextUpdate): Deleted.

Source/WTF:

* wtf/Compiler.h:

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

17 months agoLayout Test accessibility/mac/async-increment-decrement-action.html is flaky
n_wang@apple.com [Fri, 20 Apr 2018 21:02:55 +0000 (21:02 +0000)]
Layout Test accessibility/mac/async-increment-decrement-action.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=184834
<rdar://problem/39604753>

Reviewed by Chris Fleizach.

Changed the test to just make sure the increment/decrement actions are async, that
they won't block the test by changing the object's value.

* accessibility/mac/async-increment-decrement-action-expected.txt:
* accessibility/mac/async-increment-decrement-action.html:

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

17 months agoInclude missing files in WKContentViewInteraction.{mm,h}
timothy@apple.com [Fri, 20 Apr 2018 21:01:40 +0000 (21:01 +0000)]
Include missing files in WKContentViewInteraction.{mm,h}

https://bugs.webkit.org/show_bug.cgi?id=184832
rdar://problem/35377120

Reviewed by Wenson Hsieh.

Some WebDriver files were missing and should be included.

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

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

17 months agoWebPage sometimes incorrectly rules out PDF as a mime type that can be showed
youenn@apple.com [Fri, 20 Apr 2018 21:01:25 +0000 (21:01 +0000)]
WebPage sometimes incorrectly rules out PDF as a mime type that can be showed
https://bugs.webkit.org/show_bug.cgi?id=184369

Reviewed by Chris Dumez.

Source/WebCore:

WebPage does need to check for plugins at reception of the response.
In that case, the page URL is the URL from which we are navigating out.
Add plugin API to check for plugin availability with an extra URL parameter to cover that case.

Covered by API test.

* plugins/PluginData.cpp:
(WebCore::PluginData::supportsWebVisibleMimeTypeForURL const):
(WebCore::PluginData::supportsWebVisibleMimeType const):
* plugins/PluginData.h:

Source/WebKit:

Use API to check for plugin availability for response at navigation time.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::canShowResponse const):
(WebKit::WebPage::canShowMIMEType const):
* WebProcess/WebPage/WebPage.h:

Tools:

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

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

17 months agoBuild fix for internal builds after r230826.
mark.lam@apple.com [Fri, 20 Apr 2018 20:57:10 +0000 (20:57 +0000)]
Build fix for internal builds after r230826.
https://bugs.webkit.org/show_bug.cgi?id=184790
<rdar://problem/39301369>

Not reviewed.

* runtime/Options.cpp:
(JSC::overrideDefaults):
* tools/SigillCrashAnalyzer.cpp:
(JSC::SignalContext::dump):

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

17 months agoRemove Strong Password decoration when text field type changes
dbates@webkit.org [Fri, 20 Apr 2018 20:45:55 +0000 (20:45 +0000)]
Remove Strong Password decoration when text field type changes
https://bugs.webkit.org/show_bug.cgi?id=184795
<rdar://problem/38325108>

Reviewed by Antti Koivisto.

Source/WebCore:

Remove the Strong Password decoration when the text field's type changes to avoid interfering
with web sites that allow a person to show/hide their password.

Test: fast/forms/auto-fill-button/hide-strong-password-when-field-type-changes.html

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::updateType):

Source/WebKit:

Add injected bundle API and WebKit UI delegate SPI to notify the embedding client when the
Strong Password appearance of an HTML input element is resigned.

We add C SPI for Safari on Mac.

* UIProcess/API/APIUIClient.h:
(API::UIClient::didResignInputElementStrongPasswordAppearance):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageUIClient):
* UIProcess/API/C/WKPageUIClient.h:
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::setDelegate):
(WebKit::UIDelegate::UIClient::didResignInputElementStrongPasswordAppearance):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didResignInputElementStrongPasswordAppearance):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h:
(API::InjectedBundle::PageUIClient::didResignInputElementStrongPasswordAppearance):
* WebProcess/InjectedBundle/API/c/WKBundlePageUIClient.h:
* WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
(WebKit::InjectedBundlePageUIClient::didResignInputElementStrongPasswordAppearance):
* WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::inputElementDidResignStrongPasswordAppearance):
* WebProcess/WebCoreSupport/WebChromeClient.h:

Tools:

Add a unit test to ensure the injected bundle API and WebKit UI delegate SPI is invoked
when the field has the Strong Password button and its type changes.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/DidResignInputElementStrongPasswordAppearance.mm: Added.
(didResignInputElementStrongPasswordAppearance):
(-[DidResignInputElementStrongPasswordAppearance webProcessPlugIn:didCreateBrowserContextController:]):
* TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm:
(-[DidResignInputElementStrongPasswordAppearanceDelegate _webView:didResignInputElementStrongPasswordAppearanceWithUserInfo:]):
(-[DidResignInputElementStrongPasswordAppearanceDelegate webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:completionHandler:]):
(TEST):

LayoutTests:

Add tests to ensure that we remove the Strong Password decoration when the text field's type changes.

Extract code to toggle showing the AutoFill button from fast/forms/auto-fill-button/input-{disabled, readonly}-strong-password-and-strong-confirmation-password-auto-fill-buttons.html
into a new file fast/forms/auto-fill-button/resources/process-auto-fill-button-type-and-invoke-runTest.js
that can be shared.

* fast/forms/auto-fill-button/hide-strong-password-when-field-type-changes-expected.html: Added.
* fast/forms/auto-fill-button/hide-strong-password-when-field-type-changes.html: Added.
* fast/forms/auto-fill-button/input-disabled-strong-password-and-strong-confirmation-password-auto-fill-buttons.html:
* fast/forms/auto-fill-button/input-readonly-strong-password-and-strong-confirmation-password-auto-fill-buttons.html:
* fast/forms/auto-fill-button/resources/process-auto-fill-button-type-and-invoke-runTest.js: Added.
(window.onload):

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

17 months agoFixes for failing tests associated with switching Text Selection Assistants
megan_gardner@apple.com [Fri, 20 Apr 2018 20:40:51 +0000 (20:40 +0000)]
Fixes for failing tests associated with switching Text Selection Assistants
https://bugs.webkit.org/show_bug.cgi?id=184806
<rdar://problem/39367905>

Reviewed by Beth Dakin and Wenson Hsieh.

The major fix is the disabling the double tap noneditable text selection gesture.
The other fixes are small tweaks that shouldn't even be run into with the fix to
the double tap gesture, but they are incorrect, so I am taking the opportunity to
fix them now, in case we run into them again.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
We should not be allowing a double tap text gestures in non-editable web content.
We didn't have one with the old assistant. Fortunately, this is easily disabled.
(-[WKContentView canPerformActionForWebView:withSender:]):
We should not allow the lookup action if we do not actually have a selection.
It is meaningless without one.
(-[WKContentView selectedTextRange]):
We should not return a selection to UIKit if all we have is caret selection
in non-editable content. We have this for selections on Mac, but UIKit does
not know how to properly handle this, and will have incorrect behavior if we
return a valid selection.

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

17 months agoWebEvent fails to convert synthetic WebMouseEvent for automation
timothy@apple.com [Fri, 20 Apr 2018 20:12:06 +0000 (20:12 +0000)]
WebEvent fails to convert synthetic WebMouseEvent for automation

https://bugs.webkit.org/show_bug.cgi?id=184824
rdar://problem/35377120

Reviewed by Brian Burg.

Add WebEvent conversions that existed in PlatformEventFactoryIOS for legacy WebKit,
but never got added in WebIOSEventFactory and NativeWebMouseEvent for modern WebKit.
This affected WebDriver, and some events not being deliverd to the page.

* Shared/NativeWebMouseEvent.h:
(WebKit::NativeWebMouseEvent::nativeEvent const):
* Shared/ios/NativeWebMouseEventIOS.mm: Added.
(WebKit::NativeWebMouseEvent::NativeWebMouseEvent):
* Shared/ios/WebIOSEventFactory.h:
* Shared/ios/WebIOSEventFactory.mm:
(WebIOSEventFactory::createWebMouseEvent):
* WebKit.xcodeproj/project.pbxproj:

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

17 months agoUpdate Alignment shorthands to the spec now that they are not ambiguous
jfernandez@igalia.com [Fri, 20 Apr 2018 20:06:53 +0000 (20:06 +0000)]
Update Alignment shorthands to the spec now that they are not ambiguous
https://bugs.webkit.org/show_bug.cgi?id=184812

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

Imported new Web Platform Tests from the css-align test suite.
Additionally, updated the ones we already have to verify the new shorthand syntax is correct.

* resources/import-expectations.json:
* web-platform-tests/css/css-align/OWNERS: Added.
* web-platform-tests/css/css-align/content-distribution/place-content-shorthand-001.html:
* web-platform-tests/css/css-align/content-distribution/place-content-shorthand-002.html:
* web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004-expected.txt:
* web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html:
* web-platform-tests/css/css-align/default-alignment/parse-justify-items-001.html:
* web-platform-tests/css/css-align/default-alignment/parse-justify-items-003.html:
* web-platform-tests/css/css-align/default-alignment/place-items-shorthand-001.html:
* web-platform-tests/css/css-align/default-alignment/place-items-shorthand-002.html:
* web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004-expected.txt:
* web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html:
* web-platform-tests/css/css-align/default-alignment/shorthand-serialization-001-expected.txt: Added.
* web-platform-tests/css/css-align/default-alignment/shorthand-serialization-001.html: Added.
* web-platform-tests/css/css-align/default-alignment/w3c-import.log:
* web-platform-tests/css/css-align/gaps/column-gap-parsing-001-expected.txt:
* web-platform-tests/css/css-align/gaps/column-gap-parsing-001.html:
* web-platform-tests/css/css-align/gaps/gap-normal-computed-001-expected.txt: Added.
* web-platform-tests/css/css-align/gaps/gap-normal-computed-001.html: Added.
* web-platform-tests/css/css-align/gaps/gap-normal-used-001-expected.xht: Added.
* web-platform-tests/css/css-align/gaps/gap-normal-used-001.html: Added.
* web-platform-tests/css/css-align/gaps/gap-normal-used-002-expected.xht: Added.
* web-platform-tests/css/css-align/gaps/gap-normal-used-002.html: Added.
* web-platform-tests/css/css-align/gaps/gap-parsing-001-expected.txt:
* web-platform-tests/css/css-align/gaps/gap-parsing-001.html:
* web-platform-tests/css/css-align/gaps/grid-column-gap-parsing-001-expected.txt:
* web-platform-tests/css/css-align/gaps/grid-column-gap-parsing-001.html:
* web-platform-tests/css/css-align/gaps/grid-gap-parsing-001-expected.txt:
* web-platform-tests/css/css-align/gaps/grid-gap-parsing-001.html:
* web-platform-tests/css/css-align/gaps/grid-row-gap-parsing-001-expected.txt:
* web-platform-tests/css/css-align/gaps/grid-row-gap-parsing-001.html:
* web-platform-tests/css/css-align/gaps/row-gap-parsing-001-expected.txt:
* web-platform-tests/css/css-align/gaps/row-gap-parsing-001.html:
* web-platform-tests/css/css-align/gaps/w3c-import.log:
* web-platform-tests/css/css-align/resources/alignment-parsing-utils.js:
* web-platform-tests/css/css-align/self-alignment/place-self-shorthand-001.html:
* web-platform-tests/css/css-align/self-alignment/place-self-shorthand-002.html:
* web-platform-tests/css/css-align/self-alignment/place-self-shorthand-004-expected.txt:
* web-platform-tests/css/css-align/self-alignment/place-self-shorthand-004.html:
* web-platform-tests/css/css-align/w3c-import.log: Added.

Source/WebCore:

Now that the issue [1] about the syntax ambiguity has been resolved we
don't need to use the custom syntax anymore. The Alignment shorthands
use now the simple syntax, defined based on the longhands' syntax.

Since we allow all the values valid for each longhand, we'll update
in this CL the corresponding web platform tests. Additionally, this CL
updates also the shorthand serialization tests [2], which didn't
consider the new value 'legacy' for justify-items (and place-items) due
to the bug [3] Firefox still has pending to be fixed.

[1] https://github.com/w3c/csswg-drafts/issues/1001
[2] css/css-align/default-alignment/shorthand-serialization-001.html
[3] https://bugzilla.mozilla.org/show_bug.cgi?id=1363875

Tests: imported/w3c/web-platform-tests/css/css-align/default-alignment/shorthand-serialization-001.html
       imported/w3c/web-platform-tests/css/css-align/gaps/gap-normal-computed-001.html
       imported/w3c/web-platform-tests/css/css-align/gaps/gap-normal-used-001.html
       imported/w3c/web-platform-tests/css/css-align/gaps/gap-normal-used-002.html

* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::consumePlaceContentShorthand): Using the justify-content and align-content parsing logic to parse the shorthand.
(WebCore::CSSPropertyParser::consumePlaceItemsShorthand): Using the justify-items and align-items parsing logic to parse the shorthand.
(WebCore::CSSPropertyParser::consumePlaceSelfShorthand): Using the justify-self and align-self parsing logic to parse the shorthand.

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

17 months agoUnreviewed, rolling out r230117.
dbates@webkit.org [Fri, 20 Apr 2018 19:39:52 +0000 (19:39 +0000)]
Unreviewed, rolling out r230117.

Broke find-in-page for PDFs

Reverted changeset:

"ASSERTION FAILED: ASSERT(!containsImage ||
MIMETypeRegistry::isSupportedImageResourceMIMEType([resource
MIMEType])) in -[NSPasteboard(WebExtras)
_web_writePromisedRTFDFromArchive:containsImage:]"
https://bugs.webkit.org/show_bug.cgi?id=184161
https://trac.webkit.org/changeset/230117

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

17 months agoPausing should clear m_waitingToEnterFullscreen
eric.carlson@apple.com [Fri, 20 Apr 2018 19:01:52 +0000 (19:01 +0000)]
Pausing should clear m_waitingToEnterFullscreen
https://bugs.webkit.org/show_bug.cgi?id=184831
<rdar://problem/39602852>

Reviewed by Jer Noble.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::pause): Clear m_waitingToEnterFullscreen

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

17 months ago[Extra zoom mode] Disable CA transactions while setting up for fullscreen
eric.carlson@apple.com [Fri, 20 Apr 2018 18:36:39 +0000 (18:36 +0000)]
[Extra zoom mode] Disable CA transactions while setting up for fullscreen
https://bugs.webkit.org/show_bug.cgi?id=184817
<rdar://problem/39596075>

Reviewed by Jer Noble.

This was tested manually as it is not possible to write an automated test for this.

* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(VideoFullscreenInterfaceAVKit::doSetup): Move the call to disable CA transactions outside
of the EXTRA_ZOOM_MODE check, the [CATransaction commit] was already unguarded.

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

17 months agoUnreviewed, fix -Wformat warning
mcatanzaro@igalia.com [Fri, 20 Apr 2018 18:00:10 +0000 (18:00 +0000)]
Unreviewed, fix -Wformat warning

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

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

17 months agoMake PluginData cache its web visible plugins
youenn@apple.com [Fri, 20 Apr 2018 17:45:24 +0000 (17:45 +0000)]
Make PluginData cache its web visible plugins
https://bugs.webkit.org/show_bug.cgi?id=184421

Reviewed by Chris Dumez.

Source/WebCore:

Buffer visible plugins until the page URL changes.
For that purpose, we now cache the visible plugins and the URL it was computed from in PluginData.

Update plugin info provider API to pass the URL used to check for plugin visibility.

No observable change of behavior.

* loader/EmptyClients.cpp:
* plugins/PluginData.cpp:
(WebCore::PluginData::webVisiblePlugins const):
(WebCore::PluginData::publiclyVisiblePlugins const):
(WebCore::PluginData::supportsMimeType const):
* plugins/PluginData.h:
* plugins/PluginInfoProvider.h:

Source/WebKit:

Rename methods.
Pass an URL instead of relying on Page URL as the page URL
might not always be the URL we want to check against plugins.
In particular when navigation is on-going, we want to check the
plugins against the being navigated URL.

* WebProcess/Plugins/WebPluginInfoProvider.cpp:
(WebKit::WebPluginInfoProvider::pluginInfo):
(WebKit::WebPluginInfoProvider::webVisiblePluginInfo):
* WebProcess/Plugins/WebPluginInfoProvider.h:

Source/WebKitLegacy/mac:

* WebCoreSupport/WebPluginInfoProvider.h:
* WebCoreSupport/WebPluginInfoProvider.mm:
(WebPluginInfoProvider::pluginInfo):
(WebPluginInfoProvider::webVisiblePluginInfo):

Source/WebKitLegacy/win:

* WebCoreSupport/WebPluginInfoProvider.cpp:
(WebPluginInfoProvider::pluginInfo):
(WebPluginInfoProvider::webVisiblePluginInfo):
* WebCoreSupport/WebPluginInfoProvider.h:

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

17 months agoAdd a test to verify load/unload/pageshow/pagehide all work with process swapping.
beidson@apple.com [Fri, 20 Apr 2018 17:03:16 +0000 (17:03 +0000)]
Add a test to verify load/unload/pageshow/pagehide all work with process swapping.
https://bugs.webkit.org/show_bug.cgi?id=184807

Reviewed by Chris Dumez.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
(-[PSONMessageHandler userContentController:didReceiveScriptMessage:]):

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

17 months agoUnreviewed build fix after r230840.
cdumez@apple.com [Fri, 20 Apr 2018 16:19:31 +0000 (16:19 +0000)]
Unreviewed build fix after r230840.

* bindings/js/JSWindowProxy.cpp:
(WebCore::JSWindowProxy::attachDebugger):

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

17 months agoUnreviewed attempt to fix the Windows build after r230831.
cdumez@apple.com [Fri, 20 Apr 2018 16:12:41 +0000 (16:12 +0000)]
Unreviewed attempt to fix the Windows build after r230831.

* bindings/js/JSWindowProxy.cpp:
(WebCore::JSWindowProxy::create):
(WebCore::JSWindowProxy::attachDebugger):

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

17 months agoUnreviewed. Mark TestJSC as slow in debug.
carlosgc@webkit.org [Fri, 20 Apr 2018 13:24:22 +0000 (13:24 +0000)]
Unreviewed. Mark TestJSC as slow in debug.

Only /jsc/vm is slow, but GLib API test runner only checks the test binary for GLib tests.

* TestWebKitAPI/glib/TestExpectations.json:

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

17 months agoOmit default value when serializing font-feature-settings
commit-queue@webkit.org [Fri, 20 Apr 2018 12:08:45 +0000 (12:08 +0000)]
Omit default value when serializing font-feature-settings
https://bugs.webkit.org/show_bug.cgi?id=182382

Patch by Chris Nardi <cnardi@chromium.org> on 2018-04-20
Reviewed by Myles C. Maxfield.

Source/WebCore:

According to the shortest-serialization principle [1], values should be omitted if their omission
wouldn't change the value of reparsing. As "1"/"on" is the default value for font-feature-settings,
omit this when serializing, matching the behavior of Firefox and Chrome.

[1]: https://github.com/w3c/csswg-drafts/issues/1564

Updated css3/font-feature-settings-parsing.html, fast/css/inherited-properties-rare-text.html,
and fast/text/font-face-javascript.html.

* css/CSSFontFeatureValue.cpp:
(WebCore::CSSFontFeatureValue::customCSSText const):

LayoutTests:

Update tests to omit default value when serializing.

* css3/font-feature-settings-parsing-expected.txt:
* css3/font-feature-settings-parsing.html:
* fast/css/inherited-properties-rare-text-expected.txt:
* fast/text/font-face-javascript-expected.txt:
* fast/text/font-face-javascript.html:

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

17 months ago[GTK] Local cross references are broken in API documentation
carlosgc@webkit.org [Fri, 20 Apr 2018 10:33:30 +0000 (10:33 +0000)]
[GTK] Local cross references are broken in API documentation
https://bugs.webkit.org/show_bug.cgi?id=184771

Reviewed by Michael Catanzaro.

.:

Update the documentation html paths and install the JSC GLib API too.

* Source/PlatformGTK.cmake:

Tools:

The problem is that gtkdoc-fixxref expects the links to be in the form html/modulename (like the installed
ones), but we generate the documentation as modulename/html. So, links to WebKitDOM or JSC are generated as
../html/Foo. The rebase command considers html to be the module name in this case, creating broken links in all
the cases.

* gtk/gtkdoc.py:
(GTKDoc._copy_doc_files_to_output_dir): We don't have any html dir in the source tree so, we are not copying
anything here.
(GTKDoc._run_gtkdoc_mkhtml): Create the html dir here using html/modulename instead now.
(GTKDoc._run_gtkdoc_fixxref): Pass the new directory as module dir to gtkdoc-fixxref and fix several links for
which gtkdoc-fixxref always uses absolute paths.
* gtk/manifest.txt.in: Update the documentation html paths and include the JSC GLib API in the tarball too.

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

17 months agoMore WK_ALTERNATE_FRAMEWORKS_DIR adoption in WebCore
ap@apple.com [Fri, 20 Apr 2018 06:41:03 +0000 (06:41 +0000)]
More WK_ALTERNATE_FRAMEWORKS_DIR adoption in WebCore
https://bugs.webkit.org/show_bug.cgi?id=184805

Reviewed by Dan Bernstein.

* Configurations/WebCoreTestShim.xcconfig:
* Configurations/WebCoreTestSupport.xcconfig:

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

17 months agoUnreviewed. Fix GTK+ build after r230830.
carlosgc@webkit.org [Fri, 20 Apr 2018 06:17:19 +0000 (06:17 +0000)]
Unreviewed. Fix GTK+ build after r230830.

Add SimulatedInputDispatcher.cpp to the build.

* CMakeLists.txt:

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

17 months agoMake back forward cache work with process swapping.
beidson@apple.com [Fri, 20 Apr 2018 04:55:32 +0000 (04:55 +0000)]
Make back forward cache work with process swapping.
<rdar://problem/38676604> and https://bugs.webkit.org/show_bug.cgi?id=184793

Reviewed by Chris Dumez.

Source/WebCore:

Covered by API tests.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadWithNavigationAction):
(WebCore::FrameLoader::load):
(WebCore::FrameLoader::loadWithDocumentLoader):
(WebCore::FrameLoader::reloadWithOverrideEncoding):
(WebCore::FrameLoader::reload):
(WebCore::FrameLoader::commitProvisionalLoad):
(WebCore::FrameLoader::loadDifferentDocumentItem):
* loader/FrameLoader.h:

Source/WebKit:

We previously saved old processes in "SuspendedPageProxy" objects.
Now we reuse them when going back or forward.

* Platform/Logging.h:

* Shared/WebBackForwardListItem.cpp:
(WebKit::WebBackForwardListItem::setSuspendedPage):
(WebKit::WebBackForwardListItem::loggingString):
* Shared/WebBackForwardListItem.h:
(WebKit::WebBackForwardListItem::suspendedPage const):

Teach Navigation objects their source WebBackForwardListItems:
* UIProcess/API/APINavigation.cpp:
(API::Navigation::Navigation):
(API::Navigation::loggingString const):
* UIProcess/API/APINavigation.h:
(API::Navigation::create):
(API::Navigation::targetItem const):
(API::Navigation::fromItem const):
(API::Navigation::backForwardListItem): Deleted.

* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):

* UIProcess/SuspendedPageProxy.cpp:
(WebKit::messageNamesToIgnoreWhileSuspended):
(WebKit::SuspendedPageProxy::SuspendedPageProxy):
(WebKit::SuspendedPageProxy::~SuspendedPageProxy):
(WebKit::SuspendedPageProxy::webProcessDidClose):
(WebKit::SuspendedPageProxy::didReceiveMessage):
(WebKit::SuspendedPageProxy::loggingString const):
* UIProcess/SuspendedPageProxy.h:
(WebKit::SuspendedPageProxy::origin const):

* UIProcess/WebBackForwardList.cpp:
(WebKit::WebBackForwardList::WebBackForwardList):
(WebKit::WebBackForwardList::~WebBackForwardList):
(WebKit::WebBackForwardList::pageClosed):
(WebKit::WebBackForwardList::addItem):
(WebKit::WebBackForwardList::goToItem):
(WebKit::WebBackForwardList::removeAllItems):
(WebKit::WebBackForwardList::clear):
(WebKit::WebBackForwardList::restoreFromState):
(WebKit::WebBackForwardList::filteredItemStates const):
(WebKit::WebBackForwardList::itemStates const):
(WebKit::WebBackForwardList::loggingString):
* UIProcess/WebBackForwardList.h:

* UIProcess/WebNavigationState.cpp:
(WebKit::WebNavigationState::createLoadRequestNavigation):
(WebKit::WebNavigationState::createBackForwardNavigation):
* UIProcess/WebNavigationState.h:

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::reattachToWebProcess):
(WebKit::WebPageProxy::maybeCreateSuspendedPage):
(WebKit::WebPageProxy::reattachToWebProcessWithItem):
(WebKit::WebPageProxy::loadRequest):
(WebKit::WebPageProxy::loadFile):
(WebKit::WebPageProxy::goToBackForwardItem):
(WebKit::WebPageProxy::receivedPolicyDecision):
(WebKit::WebPageProxy::continueNavigationInNewProcess):
(WebKit::WebPageProxy::didCreateMainFrame):
(WebKit::WebPageProxy::didCreateSubframe):
(WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
(WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::connectionWillOpen):
(WebKit::WebPageProxy::attachToProcessForNavigation): Deleted.
* UIProcess/WebPageProxy.h:

* UIProcess/WebProcessLifetimeTracker.cpp:
(WebKit::WebProcessLifetimeTracker::webPageEnteringWebProcess):
(WebKit::WebProcessLifetimeTracker::connectionWillOpen): Deleted.
* UIProcess/WebProcessLifetimeTracker.h:

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigation):
(WebKit::WebProcessPool::registerSuspendedPageProxy):
(WebKit::WebProcessPool::unregisterSuspendedPageProxy):
* UIProcess/WebProcessPool.h:

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::suspendWebPageProxy):
(WebKit::WebProcessProxy::updateBackForwardItem):
(WebKit::WebProcessProxy::frameCreated):
* UIProcess/WebProcessProxy.h:

* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attachDrawingArea):

* WebProcess/WebPage/WebBackForwardListProxy.cpp:
(WebKit::WebBackForwardListProxy::addItemFromUIProcess):
(WebKit::WebBackForwardListProxy::addItem):
* WebProcess/WebPage/WebBackForwardListProxy.h:

* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_credentialsMessenger):
(WebKit::WebPage::reinitializeWebPage):
(WebKit::WebPage::goToBackForwardItem):
(WebKit::WebPage::restoreSessionInternal):
(WebKit::WebPage::restoreSession):
(WebKit::WebPage::updateBackForwardListForReattach):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::attachDrawingArea): Force a reattachment of the drawing
  area from a resumed WebProcess to the UIProcess (to make the page cache work)

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

17 months agoRename JSDOMWindowProxy to JSWindowProxy
cdumez@apple.com [Fri, 20 Apr 2018 02:15:39 +0000 (02:15 +0000)]
Rename JSDOMWindowProxy to JSWindowProxy
https://bugs.webkit.org/show_bug.cgi?id=184797

Reviewed by Sam Weinig.

Rename JSDOMWindowProxy to JSWindowProxy for consistency with WindowProxy.

Source/WebCore:

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/IDLTypes.h:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSDOMConvertWindowProxy.h:
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::JSDOMWindowBase):
(WebCore::JSDOMWindowBase::finishCreation):
(WebCore::JSDOMWindowBase::proxy const):
(WebCore::toJSDOMWindow):
* bindings/js/JSDOMWindowBase.h:
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::toWrapped):
* bindings/js/JSEventTargetCustom.cpp:
(WebCore::JSEventTarget::toWrapped):
* bindings/js/JSRemoteDOMWindowBase.cpp:
(WebCore::JSRemoteDOMWindowBase::JSRemoteDOMWindowBase):
(WebCore::toJSRemoteDOMWindow):
* bindings/js/JSRemoteDOMWindowBase.h:
* bindings/js/JSWindowProxy.cpp: Renamed from Source/WebCore/bindings/js/JSDOMWindowProxy.cpp.
(WebCore::JSWindowProxy::JSWindowProxy):
(WebCore::JSWindowProxy::finishCreation):
(WebCore::JSWindowProxy::create):
(WebCore::JSWindowProxy::destroy):
(WebCore::JSWindowProxy::setWindow):
(WebCore::JSWindowProxy::attachDebugger):
(WebCore::JSWindowProxy::wrapped const):
(WebCore::JSWindowProxy::toWrapped):
(WebCore::toJS):
(WebCore::toJSWindowProxy):
* bindings/js/JSWindowProxy.h: Renamed from Source/WebCore/bindings/js/JSDOMWindowProxy.h.
(WebCore::toJS):
(WebCore::toJSWindowProxy):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::initScriptForWindowProxy):
* bindings/js/ScriptController.h:
* bindings/js/WindowProxy.cpp:
(WebCore::WindowProxy::createJSWindowProxy):
(WebCore::WindowProxy::jsWindowProxiesAsVector const):
(WebCore::WindowProxy::createJSWindowProxyWithInitializedScript):
* bindings/js/WindowProxy.h:
(WebCore::WindowProxy::jsWindowProxy):
(WebCore::WindowProxy::existingJSWindowProxy const):
* bindings/scripts/CodeGeneratorJS.pm:
(AddToIncludesForIDLType):
(GenerateHeader):
(GenerateOverloadDispatcher):
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionOverloadedMethodOverloadDispatcher):
* page/Frame.cpp:
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::didCreateWindowProxy const):
* page/csp/ContentSecurityPolicy.h:

Source/WebInspectorUI:

* UserInterface/Workers/HeapSnapshot/HeapSnapshot.js:
(HeapSnapshot.prototype._isNodeGlobalObject):

Source/WebKitLegacy/mac:

* DOM/DOMUtility.mm:
(createDOMWrapper):
* WebView/WebFrame.mm:
(-[WebFrame _stringByEvaluatingJavaScriptFromString:withGlobalObject:inScriptWorld:]):

Source/WebKitLegacy/win:

* WebFrame.cpp:
(WebFrame::stringByEvaluatingJavaScriptInScriptWorld):

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

17 months agoWeb Automation: add support for mouse/keyboard interaction sequences
bburg@apple.com [Fri, 20 Apr 2018 01:45:21 +0000 (01:45 +0000)]
Web Automation: add support for mouse/keyboard interaction sequences
https://bugs.webkit.org/show_bug.cgi?id=184603
<rdar://problem/39421839>

Reviewed by Timothy Hatcher.

Add new protocol methods and WebKit support for implementing the W3C Actions API.
This is a generic command for sending low-level mouse, key, and touch events to
test page behavior when performing drag-and-drop, gestures, or specific keydown/keyups.

To implement this functionality, this patch adds SimulatedInputDispatcher, a class
for dispatching input events asynchronously. Similar to the WebDriver specification,
this is designed as a keyframing API. Callers set up several "input sources" such
as keyboard or mouse, and then specify the states of that input source over time. The
dispatcher calculates diffs between the previous and current keyframes and generates
the appropriate events that would happen if a user caused the state transition.

For example, if a mouse input source's state changes, the dispatcher sends synthetic mousemove,
mousedown, or mouseup events depending on the pre- and post-state. This is uninteresting
and overcomplicated for simple key and mouse presses, but it's really designed with an
eye towards supporting mousemove interpolation and touch event interpolation in later patches.

The strategy for dispatching events depends on the input source type; right now, these
map directly to the existing platformSimulate{Mouse, Keyboard}Interaction methods. In
the future, the dispatch strategy may be elaborated for interpolated mousemove events.

This patch depends on support added in bug 184462.

No tests yet. When this command is hooked up to a driver, the code will be exercised by
W3C actions test suite, which is fairly complex at this point relative to end-user code.

* UIProcess/Automation/Automation.json: Add new types and commands.

* UIProcess/Automation/SimulatedInputDispatcher.h: Added.
(WebKit::SimulatedInputSourceState::emptyState):
(WebKit::SimulatedInputSource::create):
(WebKit::SimulatedInputSource::SimulatedInputSource):
(WebKit::SimulatedInputDispatcher::Client::~Client):
Add structs for input source, source state, and keyframe.
The dispatcher's client interface is implemented by WebAutomationSession.

(WebKit::SimulatedInputDispatcher::create):
* UIProcess/Automation/SimulatedInputDispatcher.cpp: Added.
(WebKit::SimulatedInputKeyFrame::SimulatedInputKeyFrame):
(WebKit::SimulatedInputKeyFrame::maximumDuration const):
(WebKit::SimulatedInputKeyFrame::keyFrameFromStateOfInputSources):
(WebKit::SimulatedInputKeyFrame::keyFrameToResetInputSources):
(WebKit::SimulatedInputDispatcher::SimulatedInputDispatcher):
(WebKit::SimulatedInputDispatcher::~SimulatedInputDispatcher):
(WebKit::SimulatedInputDispatcher::isActive const):
(WebKit::SimulatedInputDispatcher::keyFrameTransitionDurationTimerFired):
(WebKit::SimulatedInputDispatcher::isKeyFrameTransitionComplete const):
(WebKit::SimulatedInputDispatcher::transitionToNextKeyFrame):
(WebKit::SimulatedInputDispatcher::transitionToNextInputSourceState):
(WebKit::SimulatedInputDispatcher::transitionBetweenKeyFrames):
(WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
(WebKit::SimulatedInputDispatcher::run):
(WebKit::SimulatedInputDispatcher::cancel):
(WebKit::SimulatedInputDispatcher::finishDispatching):
The dispatcher handles one interaction at a time. The interaction is described
by an array of keyframes, and each keyframe has an array of states. The dispatcher
transitions between keyframes by sequentially and asynchronously emitting events
that cause each input source state to transition as desired. Keyframe transitions
are additionally gated by a "maximum duration" timer. Each step that the dispatcher
executes is asynchronous, so the dispatcher keeps most state in members and uses
error argument lambdas as completion handlers for various async things.

* UIProcess/Automation/WebAutomationSession.h:
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::WebAutomationSession):
(WebKit::WebAutomationSession::inputDispatcherForPage):
(WebKit::WebAutomationSession::inputSourceForType const):
Add canonical input sources that are used to keep track of state across
interaction sequences.

(WebKit::WebAutomationSession::isSimulatingUserInteraction const):
(WebKit::WebAutomationSession::mouseEventsFlushedForPage):
(WebKit::WebAutomationSession::keyboardEventsFlushedForPage):
Remove m_simulatingUserInteraction since it can be computed based on other members.

(WebKit::WebAutomationSession::willClosePage):
If the page is being torn down, stop the dispatcher if needed and cancel any
callbacks waiting for mouse/key events to be retired.

(WebKit::WebAutomationSession::simulateMouseInteraction):
(WebKit::WebAutomationSession::simulateKeyboardInteraction):
Add easy-to-use async methods for simulating mouse and key events. These are
hooked up to SimulatedInputDispatcher using async completion handlers.

(WebKit::protocolMouseButtonToWebMouseEventButton):
(WebKit::WebAutomationSession::performMouseInteraction):
(WebKit::WebAutomationSession::performKeyboardInteractions):
Adjust some naming.

(WebKit::simulatedInputSourceTypeFromProtocolSourceType):
(WebKit::WebAutomationSession::performInteractionSequence):
(WebKit::WebAutomationSession::cancelInteractionSequence):
Add command handlers for the new action commands in Automation protocol.

* UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
(WebKit::mouseButtonToGdkButton):
(WebKit::WebAutomationSession::platformSimulateMouseInteraction):
(WebKit::WebAutomationSession::platformSimulateKeyboardInteraction):
(WebKit::WebAutomationSession::platformSimulateKeyStroke): Deleted.
* UIProcess/Automation/ios/WebAutomationSessionIOS.mm:
(WebKit::WebAutomationSession::platformSimulateKeyboardInteraction):
(WebKit::WebAutomationSession::platformSimulateKeyStroke): Deleted.
Rename the keyboard platform method to match the naming of the mouse platform method.
Take advantage of the 'using' alias to make the tedious switches easier to read.

* UIProcess/Automation/mac/WebAutomationSessionMac.mm:
(WebKit::WebAutomationSession::platformSimulateMouseInteraction):
(WebKit::virtualKeyHasStickyModifier):
(WebKit::keyCodeForVirtualKey):
(WebKit::eventModifierFlagsForVirtualKey):
(WebKit::WebAutomationSession::platformSimulateKeyboardInteraction):
(WebKit::WebAutomationSession::platformSimulateKeySequence):
(WebKit::keyHasStickyModifier): Deleted.
(WebKit::WebAutomationSession::platformSimulateKeyStroke): Deleted.
Allow the keyboard simulation method to take a virtual key and unichar to better
match how this is used by the Perform Actions command and its machinery.

* WebKit.xcodeproj/project.pbxproj:

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

17 months agoIntroduce SVGGeometryElement interface
commit-queue@webkit.org [Fri, 20 Apr 2018 01:00:40 +0000 (01:00 +0000)]
Introduce SVGGeometryElement interface
https://bugs.webkit.org/show_bug.cgi?id=184768

Source/WebCore:

Patch by Dirk Schulze <krit@webbkit.org> on 2018-04-19
Reviewed by Antti Koivisto.

Start implementing SVGGeometryElement interface from SVG2.
https://svgwg.org/svg2-draft/types.html#InterfaceSVGGeometryElement

Start with SVGPathElement only for now. Also, just inferface gets implemented
by this patch. No new functionality like isPointInFill yet.
Fix getPointAtLength and make it more restrictive. This follows the spec and
all other implementations.

Added additional test scenarios to existing tests.

* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/scripts/CodeGeneratorJS.pm:
(GetGnuVTableOffsetForType):
* svg/SVGAllInOne.cpp:
* svg/SVGGeometryElement.cpp: Added.
(WebCore::SVGGeometryElement::SVGGeometryElement):
(WebCore::SVGGeometryElement::isSupportedAttribute):
(WebCore::SVGGeometryElement::parseAttribute):
(WebCore::SVGGeometryElement::svgAttributeChanged):
(WebCore::SVGGeometryElement::createElementRenderer):
* svg/SVGGeometryElement.h: Added.
* svg/SVGGeometryElement.idl: Added.
* svg/SVGGradientElement.cpp:
* svg/SVGPathElement.cpp:
(WebCore::SVGPathElement::SVGPathElement):
(WebCore::SVGPathElement::parseAttribute):
(WebCore::SVGPathElement::svgAttributeChanged):
(WebCore::SVGPathElement::insertedIntoAncestor):
(WebCore::SVGPathElement::removedFromAncestor):
* svg/SVGPathElement.h:
* svg/SVGPathElement.idl:

LayoutTests:

Patch by Dirk Schulze <krit@webkit.org> on 2018-04-19
Reviewed by Antti Koivisto.

Start implementing SVGGeometryElement interface from SVG2.

* svg/dom/SVGPolygonElement-baseVal-list-removal-crash.html: pointAtLength requires value now.
* svg/dom/path-pointAtLength-expected.txt:
* svg/dom/path-pointAtLength.html: Added throw tests for pointAtLength.
* svg/dom/svg2-inheritance-expected.txt: Inheritance fixed for SVGPathElement only for now.

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

17 months agoREGRESSION(r227340): ArrayBuffers were not being serialized when sent via MessagePorts
commit-queue@webkit.org [Thu, 19 Apr 2018 23:59:50 +0000 (23:59 +0000)]
REGRESSION(r227340): ArrayBuffers were not being serialized when sent via MessagePorts
https://bugs.webkit.org/show_bug.cgi?id=184254
<rdar://problem/39140200>

Patch by Tadeu Zagallo <tzagallo@apple.com> on 2018-04-19
Reviewed by Daniel Bates.

Source/JavaScriptCore:

Expose an extra constructor of ArrayBufferContents in order to be able to decode SerializedScriptValues.

* runtime/ArrayBuffer.h:
(JSC::ArrayBufferContents::ArrayBufferContents):

Source/WebCore:

Add a new encoding method to SerializedScriptValue that includes ArrayBuffers.

Test: workers/message-port.html

* bindings/js/SerializedScriptValue.h:
(WebCore::SerializedScriptValue::encode const):
(WebCore::SerializedScriptValue::decode):
* dom/messageports/MessageWithMessagePorts.h:
(WebCore::MessageWithMessagePorts::encode const):
(WebCore::MessageWithMessagePorts::decode):

LayoutTests:

The regression test provided with the bug report verifies that the ArrayBuffer is properly
serialized - before, the whole data object would be null.
Test case provided by Yann Cabon <ycabon@esri.com> as part of the bug report.

* workers/message-port-expected.txt: Added.
* workers/message-port.html: Added.

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

17 months agoRemove access to keychain from the WebContent process
jiewen_tan@apple.com [Thu, 19 Apr 2018 23:51:56 +0000 (23:51 +0000)]
Remove access to keychain from the WebContent process
https://bugs.webkit.org/show_bug.cgi?id=184428
<rdar://problem/13150903>

Reviewed by Brent Fulgham.

Part 1.

Remove com.apple.identities from WebContent-iOS.entitlements, which is needed to encode/decode NSError’s userInfo[NSErrorClientCertificateChainKey]
when the corresponding NSErorr is relayed through WebContent Process from Networking Process to UI Process after a HTTPS client certificate
authentication is rejected becuase of bad certificates. This patch implements corresponding workarounds as well. The workaround works for mac, too.

Sadly, this change can only be tested manually at this moment. Please refer to the radar for testing steps.

* Configurations/WebContent-iOS.entitlements:
* Shared/mac/WebCoreArgumentCodersMac.mm:
(IPC::encodeNSError):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitialize):

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

17 months agoApply pointer profiling to Signal pointers.
mark.lam@apple.com [Thu, 19 Apr 2018 23:30:47 +0000 (23:30 +0000)]
Apply pointer profiling to Signal pointers.
https://bugs.webkit.org/show_bug.cgi?id=184790
<rdar://problem/39301369>

Reviewed by Michael Saboff.

1. Change stackPointer, framePointer, and instructionPointer accessors to
   be a pair of getter/setter functions.
2. Add support for USE(PLATFORM_REGISTERS_WITH_PROFILE) to allow use of a
   a pointer profiling variants of these accessors.
3. Also add a linkRegister accessor only for ARM64 on OS(DARWIN).

* JavaScriptCorePrefix.h:
* runtime/MachineContext.h:
(JSC::MachineContext::stackPointerImpl):
(JSC::MachineContext::stackPointer):
(JSC::MachineContext::setStackPointer):
(JSC::MachineContext::framePointerImpl):
(JSC::MachineContext::framePointer):
(JSC::MachineContext::setFramePointer):
(JSC::MachineContext::instructionPointerImpl):
(JSC::MachineContext::instructionPointer):
(JSC::MachineContext::setInstructionPointer):
(JSC::MachineContext::linkRegisterImpl):
(JSC::MachineContext::linkRegister):
(JSC::MachineContext::setLinkRegister):
* runtime/SamplingProfiler.cpp:
(JSC::SamplingProfiler::takeSample):
* runtime/VMTraps.cpp:
(JSC::SignalContext::SignalContext):
(JSC::VMTraps::tryInstallTrapBreakpoints):
* tools/CodeProfiling.cpp:
(JSC::profilingTimer):
* tools/SigillCrashAnalyzer.cpp:
(JSC::SignalContext::dump):
(JSC::installCrashHandler):
(JSC::SigillCrashAnalyzer::analyze):
* wasm/WasmFaultSignalHandler.cpp:
(JSC::Wasm::trapHandler):

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

17 months agoUnreviewed, update TestExpectations for iOS Simulator.
ryanhaddad@apple.com [Thu, 19 Apr 2018 22:55:12 +0000 (22:55 +0000)]
Unreviewed, update TestExpectations for iOS Simulator.

* platform/ios-wk2/TestExpectations:

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

17 months agoEnable Objective-C weak references
ddkilzer@apple.com [Thu, 19 Apr 2018 22:53:45 +0000 (22:53 +0000)]
Enable Objective-C weak references
<https://webkit.org/b/184789>
<rdar://problem/39571716>

Reviewed by Dan Bernstein.

Source/bmalloc:

* Configurations/Base.xcconfig:
(CLANG_ENABLE_OBJC_WEAK): Enable.

Source/JavaScriptCore:

* Configurations/Base.xcconfig:
(CLANG_ENABLE_OBJC_WEAK): Enable.
* Configurations/ToolExecutable.xcconfig:
(CLANG_ENABLE_OBJC_ARC): Simplify.

Source/ThirdParty/ANGLE:

* Configurations/Base.xcconfig:
(CLANG_ENABLE_OBJC_WEAK): Enable.

Source/ThirdParty/libwebrtc:

* Configurations/Base.xcconfig:
(CLANG_ENABLE_OBJC_WEAK): Enable.

Source/WebCore:

* Configurations/Base.xcconfig:
(CLANG_ENABLE_OBJC_WEAK): Enable.

Source/WebCore/PAL:

* Configurations/Base.xcconfig:
(CLANG_ENABLE_OBJC_WEAK): Enable.

Source/WebInspectorUI:

* Configurations/Base.xcconfig:
(CLANG_ENABLE_OBJC_WEAK): Enable.

Source/WebKit:

* Configurations/Base.xcconfig:
(CLANG_ENABLE_OBJC_WEAK): Enable.

Source/WebKitLegacy/mac:

* Configurations/Base.xcconfig:
(CLANG_ENABLE_OBJC_WEAK): Enable.

Source/WTF:

* Configurations/Base.xcconfig:
(CLANG_ENABLE_OBJC_WEAK): Enable.

Tools:

* ContentExtensionTester/Configurations/Base.xcconfig:
(CLANG_ENABLE_OBJC_WEAK): Enable.
* DumpRenderTree/mac/Configurations/Base.xcconfig:
(CLANG_ENABLE_OBJC_WEAK): Enable.
* ImageDiff/cg/Configurations/Base.xcconfig:
(CLANG_ENABLE_OBJC_WEAK): Enable.
* MiniBrowser/Configurations/Base.xcconfig:
(CLANG_ENABLE_OBJC_WEAK): Enable.
* TestWebKitAPI/Configurations/Base.xcconfig:
(CLANG_ENABLE_OBJC_WEAK): Enable.
* WebEditingTester/Configurations/Base.xcconfig:
(CLANG_ENABLE_OBJC_ARC): Re-order.
* WebKitLauncher/Configurations/Base.xcconfig: Add newline at
end of file.
(CLANG_ENABLE_OBJC_WEAK): Enable.
* WebKitTestRunner/Configurations/Base.xcconfig:
(CLANG_ENABLE_OBJC_WEAK): Enable.

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

17 months agoDon't use RenderTreeBuilder::current() in RenderTreeUpdater
antti@apple.com [Thu, 19 Apr 2018 22:31:05 +0000 (22:31 +0000)]
Don't use RenderTreeBuilder::current() in RenderTreeUpdater
https://bugs.webkit.org/show_bug.cgi?id=184794

Reviewed by Zalan Bujtas.

Pass the builder as a parameter where needed.

* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateElementRenderer):
(WebCore::RenderTreeUpdater::updateTextRenderer):
(WebCore::RenderTreeUpdater::tearDownRenderers):
(WebCore::RenderTreeUpdater::tearDownRenderer):
(WebCore::RenderTreeUpdater::tearDownTextRenderer):
(WebCore::RenderTreeUpdater::tearDownLeftoverPaginationRenderersIfNeeded):
(WebCore::RenderTreeUpdater::tearDownLeftoverShadowHostChildren):
* rendering/updating/RenderTreeUpdater.h:
* rendering/updating/RenderTreeUpdaterGeneratedContent.cpp:
(WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
(WebCore::RenderTreeUpdater::GeneratedContent::removeBeforePseudoElement):
(WebCore::RenderTreeUpdater::GeneratedContent::removeAfterPseudoElement):
* rendering/updating/RenderTreeUpdaterGeneratedContent.h:

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

17 months agoRuntime logging during GC can cause crash
eric.carlson@apple.com [Thu, 19 Apr 2018 22:21:21 +0000 (22:21 +0000)]
Runtime logging during GC can cause crash
https://bugs.webkit.org/show_bug.cgi?id=184792
<rdar://problem/39567927>

Reviewed by Jer Noble.

Source/WebCore:

Test: media/destructor-logging-crash.html

* dom/Document.cpp:
(WebCore::Document::~Document): Clear the logger observer immediately so anything logged
as a side effect of the destructor won't cause a problem.
(WebCore::Document::didLogMessage): Create the ConsoleMessage in a task.
* dom/Document.h:

LayoutTests:

* media/destructor-logging-crash-expected.txt: Added.
* media/destructor-logging-crash.html: Added.

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

17 months agoAdd a bisect button to automatically schedule bisecting A/B tasks.
dewei_zhu@apple.com [Thu, 19 Apr 2018 22:16:23 +0000 (22:16 +0000)]
Add a bisect button to automatically schedule bisecting A/B tasks.
https://bugs.webkit.org/show_bug.cgi?id=183888

Reviewed by Ryosuke Niwa.

Extended AnalysisTask's ability to figure out bisecting A/B tasks based on existing data points and test groups.
Updated analysis page UI to show bisect button which will only appear when the middle commit set of the range in
test group can be found.

Finding middle commit set algorithm is described as follows:
1. Find all commits from multiple repositories among the ranges specified by two commit sets in test group. In
the meanwhile, merge all commits that have commit time into a single list. For commits only have commit order,
put those commits into separate lists.
2. Filter all the available commit sets in current analysis task by keeping the ones have exact repositories
as the two commit sets in specified test group, and every commit of a commit set is in side the commit range.
After filtering the commit sets, sort the remaining ones and only keep one commit set if multiple commit sets
are equal to each other.
3. Among commits processed by step 2, find the commit sets that have the commit which is closest to the middle of
all commits that have commit time created from step 1.
4. Among commits processed by step 3, find the commit sets that have the commit which is closest to the middle of
commits that only have commit order and categorized by repository. We have to iterate through repository as commit
order is not granted to be comparable between different repositories.
5. If more than one commit sets are found, choose the middle commit set.

* public/v3/commit-set-range-bisector.js: Added.
(CommitSetRangeBisector.async.commitSetClosestToMiddleOfAllCommits): Instead of naively returning the middle of
existing commit set array, this function selects a bisect bisection points that is closest to actually middle of
the revision range based on all revisions reported to performance dashboard.
(CommitSetRangeBisector._findCommitSetsWithinRange): Helper function to find commit sets those are in specified range.
(CommitSetRangeBisector._orderCommitSetsByTimeAndOrderThenDeduplicate): Helper function to sort and deduplicate commit sets.
(CommitSetRangeBisector._closestCommitSetsToBisectingCommitByTime): Helper function to find the commit sets those
are closest to the middle of among all the commits in the range that have commit time.
(CommitSetRangeBisector._findCommitSetsClosestToMiddleOfCommitsWithOrder): Helper function which goes through all
repositories the commit of which has commit order, and find the commit sets those are closest to the middle of
commits for each repository.
(CommitSetRangeBisector._buildCommitToCommitSetMap): Helper function to builder mapping from a commit to commit
sets those contain this commit.
(CommitSetRangeBisector._findCommitClosestToMiddleIndex): Helper function to find closest commit to the middle of index.
(CommitSetRangeBisector):
* public/v3/index.html: Imports 'public/v3/commit-set-range-bisector.js'.
* public/v3/models/analysis-task.js:
(AnalysisTask.prototype.async.commitSetsFromTestGroupsAndMeasurementSet): Aggregates all existing commit sets in
test groups of current analysis tasks.
* public/v3/models/commit-log.js:
(CommitLog.prototype.hasCommitTime): A helper function determine whether a commit has a commit time. For commit
that does not have time, server will return commit time as zero. As it is unrealistic for a commit has commit time
0, it would be safe to assume a valid commit time is greater than 0.
(CommitLog.prototype.hasCommitOrder): Returns whether a commit has a commit oder.
(CommitLog.hasOrdering): Determine whether we can order two commits by commit time or commit order.
(CommitLog.orderTwoCommits): Order two commits incrementally.
* public/v3/models/commit-set.js:
(CommitSet.prototype.hasSameRepositories): A helper function to determine whether a commit set has same repositories
as current repository.
(CommitSet.containsRootOrPatchOrOwnedCommit): A helper function to determine whether current commit set has root,
patch or owned commit.
(CommitSet.commitForRepository): This function defined twice identically, remove one of them.
* public/v3/models/test-group.js: Make '_computeRequestedCommitSets' a static function as it does not use any
instance variables.
* public/v3/pages/analysis-task-page.js: Added bisect button.
(AnalysisTaskTestGroupPane):
(AnalysisTaskTestGroupPane.prototype.didConstructShadowTree):
(AnalysisTaskTestGroupPane.prototype.setTestGroups): Update 'setTestGroups' to update _bisectingCommitSetByTestGroup
when the test groups changes.
(AnalysisTaskTestGroupPane.prototype._renderCurrentTestGroup): Added code to conditionally show bisect button.
Bisect button will only show when there is a middle commit set for that test group.
(AnalysisTaskTestGroupPane.htmlTemplate):
(AnalysisTaskTestGroupPane.cssTemplate):
(AnalysisTaskPage.prototype.didConstructShadowTree):
(AnalysisTaskPage.prototype._retryCurrentTestGroup):
(AnalysisTaskPage.prototype.async._bisectCurrentTestGroup): A callback when bisect button is clicked.
* tools/js/v3-models.js:
* unit-tests/commit-log-tests.js: Added unit tests for 'CommitLog.hasCommitTime', 'CommitLog.hasCommitOrder',
'CommitLog.orderTwoCommits', 'CommitLog.hasOrdering'.
* unit-tests/commit-set-range-bisector-tests.js: Unit tests for 'CommitSetRangeBisector.commitSetClosestToMiddleOfAllCommits'.
* unit-tests/commit-set-tests.js: Added unit tests for 'CommitSet.hasSameRepositories' and 'CommitSet.containsRootOrPatchOrOwnedCommit'.

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

17 months agoWeb Inspector backend should get headers & cookies from network process separately...
youenn@apple.com [Thu, 19 Apr 2018 21:27:02 +0000 (21:27 +0000)]
Web Inspector backend should get headers & cookies from network process separately from resource requests
https://bugs.webkit.org/show_bug.cgi?id=184396
<rdar://problem/38877384>

Reviewed by Brian Burg.

Source/WebCore:

Add two new loader strategies to get response and network metrics directly from
NetworkProcess based on resource loader identifier.
Use these methods in InspectorNetworkAgent when response/metrics might be filtered.

Covered by existing tests, in particular http/tests/inspector/network/fetch-network-data.html which would fail
without this since we are now setting the sourceOrigin for NetworkResourceLoader, which is used to sanitize response headers.

* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::didReceiveResponse):
(WebCore::InspectorNetworkAgent::didFinishLoading):
* loader/LoaderStrategy.cpp:
(WebCore::LoaderStrategy::responseFromResourceLoaIdentifier):
(WebCore::LoaderStrategy::networkMetricsFromResourceLoaIdentifier):
* loader/LoaderStrategy.h:

Source/WebKit:

Add support for storing response and network metrics for every resource load.
This is made conditional on inspector being activated.
NetworkConnectionToWebProcess keeps a response and network metrics for every load.
This is cleared when inspector is going away or when a web process requests
the data.

WebLoaderStrategy gets this data through synchronous IPC.
Synchronous IPC is a temporary implementation until Inspector code gets refactored.

Updated WebLoaderStrategy to pass the sourceOrigin for every NetworkResourceLoader.
This activates additional sanitization based on cross origin status.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::setCaptureExtraNetworkLoadMetricsEnabled):
* NetworkProcess/NetworkConnectionToWebProcess.h:
(WebKit::NetworkConnectionToWebProcess::takeNetworkLoadInformationResponse):
(WebKit::NetworkConnectionToWebProcess::takeNetworkLoadInformationMetrics):
(WebKit::NetworkConnectionToWebProcess::addNetworkLoadInformationResponse):
(WebKit::NetworkConnectionToWebProcess::addNetworkLoadInformationMetrics):
(WebKit::NetworkConnectionToWebProcess::removeNetworkLoadInformation):
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::didReceiveResponse):
(WebKit::NetworkResourceLoader::didFinishLoading):
(WebKit::NetworkResourceLoader::didFailLoading):
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::responseFromResourceLoadIdentifier):
(WebKit::WebLoaderStrategy::networkMetricsFromResourceLoadIdentifier):
* WebProcess/Network/WebLoaderStrategy.h:
* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::didReceiveResponse):

LayoutTests:

* http/wpt/service-workers/header-filtering.https-expected.txt:

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

17 months ago[Extra zoom mode] Add a mechanism to extend the height of the layout viewport in...
wenson_hsieh@apple.com [Thu, 19 Apr 2018 21:00:50 +0000 (21:00 +0000)]
[Extra zoom mode] Add a mechanism to extend the height of the layout viewport in extra zoom mode
https://bugs.webkit.org/show_bug.cgi?id=184782
<rdar://problem/38346712>

Reviewed by Tim Horton.

Source/WebCore:

Add a new helper on FrameView to compute an expanded layout viewport size, as well as a new setting for the
height expansion factor when computing visual viewport dimensions. See WebKit/ChangeLog for more detail.

Test: fast/visual-viewport/extrazoom/layout-viewport-after-scrolling-and-resizing.html

* page/FrameView.cpp:
(WebCore::FrameView::expandedLayoutViewportSize):
* page/FrameView.h:
* page/Settings.yaml:

Source/WebKit:

In extra zoom mode, at initial scale, fixed position elements may take up a large portion of the viewport. This
leaves little room for non-fixed-position elements; to improve this experience, we introduce a mechanism to
extend the height of the layout viewport. By default, the layout viewport size is determined by the FrameView's
baseLayoutViewportSize, and passed into FrameView::computeUpdatedLayoutViewportRect in the client layer; in
extra zoom mode, if the layout viewport is shorter than the document width, we try to double the height of the
layout viewport and clamp to the document height if necessary.

* Shared/WebPreferences.yaml:

Add a new preference to determine the factor by which we should expand the height of the layout viewport. By
default, this is 0 (no increase in layout viewport height); in extra zoom mode, this is 1, which means we'll
increase the layout viewport's height by 1x the default height.

* Shared/WebPreferencesDefaultValues.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView activeMinimumLayoutSizes:]):

Fixes a bug when computing the active minimum layout size. If a minimum allowed layout width is specified, we
clamp the active layout width (normally the view size) so that it is no less than the minimum allowed layout
width. However, the height is currently unaffected, which causes FrameView::baseLayoutViewportSize to return a
bogus size, where the width is scaled to 320px but the height isn't. Instead, we should scale the layout height
to match the new width here.

* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::computeCustomFixedPositionRect const):

Expand the base viewport layout size if necessary, given the expansion factor in WebPreferences.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::dynamicViewportSizeUpdate):

Expand the base viewport layout size if necessary, given the expansion factor in Settings.

LayoutTests:

Add a new layout test to exercise the following scenarios:
•   The layout viewport should be fully extended when the document is much taller than the viewport.
•   Programmatically shrinking the document height to less than the viewport height causes the layout viewport
    to shrink to the viewport height.
•   Programmatically extending the document height to a little more than the viewport height causes the layout
    viewport to also expand, but this time, only to the new document height.

* TestExpectations:

Skip tests in fast/visual-viewport/extrazoom by default.

* fast/visual-viewport/extrazoom/layout-viewport-after-scrolling-and-resizing-expected.txt: Added.
* fast/visual-viewport/extrazoom/layout-viewport-after-scrolling-and-resizing.html: Added.

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

17 months agoREGRESSION (r229133): decidePolicyForNavigationAction not called for loading an HTML...
cdumez@apple.com [Thu, 19 Apr 2018 20:57:52 +0000 (20:57 +0000)]
REGRESSION (r229133): decidePolicyForNavigationAction not called for loading an HTML string
https://bugs.webkit.org/show_bug.cgi?id=184209
<rdar://problem/39145306>

Reviewed by Ryosuke Niwa.

Source/WebCore:

In r229133, we stopped doing navigation policy checks for about:blank because about:blank
loads need to happen synchronously for Web-compatibility. However, this regressed loading
an HTML string in a WebView because in such cases, the URL is also about:blank with
substitute data.

In this patch, we take a more conservative approach and restore policy checking for
'about:blank' but using synchronous IPC.

* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):

Tools:

Add API test coverage.

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

LayoutTests:

Rebaseline existing layout tests. Their output is back to what it was before r229133.

* fast/loader/iframe-src-invalid-url-expected.txt:
* fast/loader/policy-delegate-action-hit-test-zoomed-expected.txt:
* loader/navigation-policy/should-open-external-urls/subframe-click-target-self-expected.txt:
* loader/navigation-policy/should-open-external-urls/subframe-click-target-top-expected.txt:

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