WebKit-https.git
3 years agoSource/WebCore:
Ms2ger@igalia.com [Fri, 10 Nov 2017 15:43:33 +0000 (15:43 +0000)]
Source/WebCore:
[GTK] Use fallible allocation in ImageBuffer::ImageBuffer().
https://bugs.webkit.org/show_bug.cgi?id=179051

Reviewed by Michael Catanzaro.

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

* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBuffer::ImageBuffer):

Source/WTF:
Export tryFastZeroedMalloc.
https://bugs.webkit.org/show_bug.cgi?id=179051

Reviewed by Michael Catanzaro.

The other functions were exported in bug 72855. There does not seem to be a
reason not to export this one.

* wtf/FastMalloc.h:

LayoutTests:
[GTK] Update test expectations for imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args.html.
https://bugs.webkit.org/show_bug.cgi?id=179051

Reviewed by Michael Catanzaro.

The expectations are platform-specific because the test times out on mac.
The difference with the mac expectations is only in the last part of the
test, after the timeout.

This follows our policy of creating -expected files with failures for
imported wpt tests, to allow using them as regression tests.

* platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt:

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

3 years agoUnreviewed, mark imported/w3c/web-platform-tests/service-workers/service-worker/unreg...
cdumez@apple.com [Fri, 10 Nov 2017 15:07:47 +0000 (15:07 +0000)]
Unreviewed, mark imported/w3c/web-platform-tests/service-workers/service-worker/unregister-then-register-new-script.https.html as flaky

I unskipped it yesterday but it turns out to be flaky.

* TestExpectations:

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

3 years ago[GTK][WPE] Switch to use API::NavigationClient
carlosgc@webkit.org [Fri, 10 Nov 2017 13:03:51 +0000 (13:03 +0000)]
[GTK][WPE] Switch to use API::NavigationClient
https://bugs.webkit.org/show_bug.cgi?id=178720

Reviewed by Alex Christensen.

Replace WebKitLoaderClient and WebKitPolicyClient with WebKitNavigationClient that implements
API::NavigationClient.

* PlatformGTK.cmake:
* PlatformWPE.cmake:
* UIProcess/API/APINavigationAction.h: Add new constructor that receives a target frame name instead of a target
frame info.
* UIProcess/API/APINavigationClient.h:
(API::NavigationClient::didDisplayInsecureContent): Added.
(API::NavigationClient::didRunInsecureContent): Added.
(API::NavigationClient::decidePolicyForNavigationResponse): Change NavigationResponse parameter to be a
Ref<NavigationResponse>&& instead of a NavigationResponse&.
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageNavigationClient): Update NavigationResponse parameter.
* UIProcess/API/glib/WebKitBackForwardList.cpp:
(webkitBackForwardListChanged):
* UIProcess/API/glib/WebKitBackForwardListPrivate.h:
* UIProcess/API/glib/WebKitNavigationAction.cpp:
(webkitNavigationActionCreate): Wrap the given API::NavigationAction.
(webkit_navigation_action_get_navigation_type): Use the wrapped API::NavigationAction.
(webkit_navigation_action_get_mouse_button): Ditto.
(webkit_navigation_action_get_modifiers): Ditto.
(webkit_navigation_action_get_request): Ditto.
(webkit_navigation_action_is_user_gesture): Ditto.
(webkit_navigation_action_is_redirect): Ditto.
* UIProcess/API/glib/WebKitNavigationActionPrivate.h:
(_WebKitNavigationAction::_WebKitNavigationAction):
* UIProcess/API/glib/WebKitNavigationClient.cpp: Renamed from Source/WebKit/UIProcess/API/glib/WebKitLoaderClient.cpp.
(NavigationClient::NavigationClient):
(attachNavigationClientToView):
* UIProcess/API/glib/WebKitNavigationClient.h: Renamed from Source/WebKit/UIProcess/API/glib/WebKitLoaderClient.h.
* UIProcess/API/glib/WebKitNavigationPolicyDecision.cpp:
(webkit_navigation_policy_decision_get_frame_name): Add FIXME.
(webkitNavigationPolicyDecisionCreate): Get the target frame name from the API::NavigationAction.
* UIProcess/API/glib/WebKitNavigationPolicyDecisionPrivate.h:
* UIProcess/API/glib/WebKitPolicyClient.cpp: Removed.
* UIProcess/API/glib/WebKitPolicyClient.h: Removed.
* UIProcess/API/glib/WebKitPolicyDecision.cpp:
(webkitPolicyDecisionSetListener): Remove the madePolicyDecision boolean member, we can null-check the listener instead.
(webkit_policy_decision_use): Ensure listener is nullptr after being invoked to prevent the decision from being made
more than once.
(webkit_policy_decision_ignore): Ditto.
(webkit_policy_decision_download): Ditto.
* UIProcess/API/glib/WebKitPolicyDecisionPrivate.h:
* UIProcess/API/glib/WebKitResponsePolicyDecision.cpp:
(webkit_response_policy_decision_get_request): Use the wrapped API::NavigationResponse.
(webkit_response_policy_decision_get_response): Ditto.
(webkit_response_policy_decision_is_mime_type_supported): Ditto.
(webkitResponsePolicyDecisionCreate): Wrap the given API::NavigationResponse.
* UIProcess/API/glib/WebKitResponsePolicyDecisionPrivate.h:
* UIProcess/API/glib/WebKitUIClient.cpp:
(UIClient::createNewPage): Create the WebKitNavigationAction from a new API::NavigationAction.
* UIProcess/API/glib/WebKitWebView.cpp:
(webkitWebViewConstructed): Attach navigation client.
* UIProcess/Cocoa/NavigationState.h: Update API::NavigationResponse parameter of decidePolicyForNavigationResponse.
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didDisplayInsecureContentForFrame): Notify the navigation client if it's used.
(WebKit::WebPageProxy::didRunInsecureContentForFrame): Ditto.
(WebKit::WebPageProxy::decidePolicyForNewWindowAction): Use the new API::NavigationAction constructor to pass
the target frame name, instead of a null target frame info.
(WebKit::WebPageProxy::decidePolicyForResponse): Move the API::NavigationResponse.

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

3 years ago[GTK][WPE] CoordinatedGraphicsLayer::setNeedsDisplayInRect() converts FloatRect to...
magomez@igalia.com [Fri, 10 Nov 2017 08:51:03 +0000 (08:51 +0000)]
[GTK][WPE] CoordinatedGraphicsLayer::setNeedsDisplayInRect() converts FloatRect to IntRect erroneously
https://bugs.webkit.org/show_bug.cgi?id=179476

Reviewed by Žan Doberšek.

Convert the passed FloatRect into an IntRect using enclosingIntRect(), so we are guaranteed that
the rectangle to paint fits into the buffer that the backingStore will allocate.

No behaviour change.

* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::setNeedsDisplayInRect):

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

3 years agoWebInjectedScriptHost.cpp: warning: variable ‘scope’ set but not used
commit-queue@webkit.org [Fri, 10 Nov 2017 08:30:28 +0000 (08:30 +0000)]
WebInjectedScriptHost.cpp: warning: variable ‘scope’ set but not used
https://bugs.webkit.org/show_bug.cgi?id=179524

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-11-10
Reviewed by Joseph Pecoraro.

r224606 has introduced a new compilation warning if not
ENABLE(PAYMENT_REQUEST).

No new tests (No behavior change).

* inspector/WebInjectedScriptHost.cpp:
(WebCore::WebInjectedScriptHost::getInternalProperties): Do not
define the variable 'scope' if not ENABLE(PAYMENT_REQUEST). Marked
a variable 'vm' with UNUSED_PARAM.

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

3 years ago[Cairo] Start grouping Cairo GraphicsContext operations behind a separate interface
zandobersek@gmail.com [Fri, 10 Nov 2017 08:18:02 +0000 (08:18 +0000)]
[Cairo] Start grouping Cairo GraphicsContext operations behind a separate interface
https://bugs.webkit.org/show_bug.cgi?id=179467

Reviewed by Carlos Garcia Campos.

Start moving the Cairo operations in GraphicsContext into a separate
translation unit, CairoOperations.cpp. This will ease leveraging these
operations from a pre-recorded list of GraphicsContext commands, or
from a Cairo-specific GraphicsContextImpl, without undermining the
current GraphicsContext implementation that we'll want to maintain
in a working state until necessary.

We start with the clipping operations. Each operation is encapsulated
in a static function inside the WebCore::Cairo namespace that expects
PlatformContextCairo reference as the first argument, which makes sense
since we have to utilize the cairo_t state object that's kept there.
Other parameters are passed as well, as required for some specific
operation.

In the Cairo implementation of GraphicsContext, the affected methods
are changed to assert presence of the platform context (i.e. this is a
GraphicsContext that operates on a valid cairo_t object, and is not
using an m_impl object or is in non-painting mode) before the
PlatformContextCairo object is dereferenced and passed along with
other arguments to the Cairo::clip*() function.

No new tests -- no change in behavior.

* platform/SourcesCairo.txt:
* platform/graphics/cairo/CairoOperations.cpp: Added.
(WebCore::Cairo::clip):
(WebCore::Cairo::clipOut):
(WebCore::Cairo::clipPath):
(WebCore::Cairo::clipToImageBuffer):
* platform/graphics/cairo/CairoOperations.h: Added.
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::clip):
(WebCore::GraphicsContext::clipPath):
(WebCore::GraphicsContext::clipToImageBuffer):
(WebCore::GraphicsContext::clipOut):

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

3 years agoWebDriver: WebDriverService::matchCapabilities should follow the spec
carlosgc@webkit.org [Fri, 10 Nov 2017 07:27:30 +0000 (07:27 +0000)]
WebDriver: WebDriverService::matchCapabilities should follow the spec
https://bugs.webkit.org/show_bug.cgi?id=179371

Reviewed by Brian Burg.

The returned object should contain all the entries mentioned in the spec, not only the ones already present in
the passed in capabilities object.

7.2 Processing Capabilities
https://w3c.github.io/webdriver/webdriver-spec.html#dfn-matching-capabilities

* WebDriverService.cpp:
(WebDriver::WebDriverService::matchCapabilities const):
(WebDriver::WebDriverService::processCapabilities const):
* WebDriverService.h:

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

3 years agoWebDriver: capabilities with null value shouldn't be added to the validated capabilit...
carlosgc@webkit.org [Fri, 10 Nov 2017 07:25:59 +0000 (07:25 +0000)]
WebDriver: capabilities with null value shouldn't be added to the validated capabilities object
https://bugs.webkit.org/show_bug.cgi?id=179369

Reviewed by Brian Burg.

"4. If deserialized is not null, set a property on result with name name and value deserialized."

7.2 Processing Capabilities
https://w3c.github.io/webdriver/webdriver-spec.html#dfn-validate-capabilities

Fixes: imported/w3c/webdriver/tests/sessions/new_session/create_firstMatch.py::test_valid[platformName-None]

* WebDriverService.cpp:
(WebDriver::WebDriverService::validatedCapabilities const):

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

3 years ago[Xcode] An extra copy of FileSizeFormatter.h is installed in /usr/local/include
mitz@apple.com [Fri, 10 Nov 2017 07:21:44 +0000 (07:21 +0000)]
[Xcode] An extra copy of FileSizeFormatter.h is installed in /usr/local/include
https://bugs.webkit.org/show_bug.cgi?id=179525

Reviewed by Wenson Hsieh.

* PAL.xcodeproj/project.pbxproj: Demoted FileSizeFormatter.h to a project header in the PAL target. The
  Copy PAL Headers target takes care of installing this header under /usr/local/include/pal.

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

3 years agoUnreviewed, rolling out r224661.
cdumez@apple.com [Fri, 10 Nov 2017 07:03:24 +0000 (07:03 +0000)]
Unreviewed, rolling out r224661.

Broke build on several internal Mac/iOS bots

Reverted changeset:

"Ignore HSTS for partitioned, cross-origin subresource
requests"
https://bugs.webkit.org/show_bug.cgi?id=178993
https://trac.webkit.org/changeset/224661

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

3 years agoServiceWorkerRegistration objects may get recycled for different SWServerRegistration...
cdumez@apple.com [Fri, 10 Nov 2017 06:26:40 +0000 (06:26 +0000)]
ServiceWorkerRegistration objects may get recycled for different SWServerRegistration objects
https://bugs.webkit.org/show_bug.cgi?id=179517

Reviewed by Brady Eidson.

LayoutTests/imported/w3c:

* web-platform-tests/service-workers/service-worker/ready.https-expected.txt:
The test fails differently. The failure is expected here since we do not implement the
"Try Clear Registration" algorithm. As a result, we do not support resurrecting a
registration with the 'uninstalling' flag set. We always clear uninstalling registrations
on server side for now.

* web-platform-tests/service-workers/service-worker/unregister-then-register.https-expected.txt:
Same reason as above. The second checks calls unregister() for a registration that is "in use"
as expects it to get resurrected when calling register() again. We currently always clear
registrations that are unregistered on server side.

Source/WebCore:

ServiceWorkerRegistration objects could get recycled for different SWServerRegistration objects, leading to
flakiness in the tests. We uses ServiceWorkerRegistrationKey as key in the m_registration map on WebProcess
side. The lifetime of the ServiceWorkerRegistration objects is tied to the lifetime of their JS wrapper.
When a test does a registration for a given scope, then unregisters, then registers again for the same scope,
we would end up creating a new SWServerRegistration object on server side, but possibly reuse the same
ServiceWorkerRegistration object on WebProcess side, if its wrapper has not yet been garbage collected.
This is because the registrations have the same ServiceWorkerRegistrationKey in this case.

To address the issue, we now use the ServiceWorkerRegistrationIdentifier as key in the m_registration
hash map. A SWServerRegistration has a unique ServiceWorkerRegistrationIdentifier on server side.
All its clients ServiceWorkerRegistration also use the same ServiceWorkerRegistrationIdentifier.

Test: http/tests/workers/service/basic-unregister-then-register-again-no-reuse.html

* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::getRegistration):
(WebCore::ServiceWorkerContainer::scheduleTaskToUpdateRegistrationState):
(WebCore::ServiceWorkerContainer::scheduleTaskToFireUpdateFoundEvent):
(WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
(WebCore::ServiceWorkerContainer::addRegistration):
(WebCore::ServiceWorkerContainer::removeRegistration):
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerRegistration.h:
* workers/service/ServiceWorkerRegistrationData.h:
(WebCore::ServiceWorkerRegistrationData::decode):
* workers/service/server/SWClientConnection.cpp:
(WebCore::SWClientConnection::updateRegistrationState):
(WebCore::SWClientConnection::fireUpdateFoundEvent):
* workers/service/server/SWClientConnection.h:
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::Connection::addServiceWorkerRegistrationInServer):
(WebCore::SWServer::Connection::removeServiceWorkerRegistrationInServer):
(WebCore::SWServer::resolveRegistrationJob):
(WebCore::SWServer::addClientServiceWorkerRegistration):
(WebCore::SWServer::removeClientServiceWorkerRegistration):
* workers/service/server/SWServer.h:
* workers/service/server/SWServerRegistration.cpp:
(WebCore::generateServiceWorkerRegistrationIdentifier):
(WebCore::SWServerRegistration::SWServerRegistration):
(WebCore::SWServerRegistration::updateRegistrationState):
(WebCore::SWServerRegistration::fireUpdateFoundEvent):
(WebCore::SWServerRegistration::forEachConnection):
(WebCore::SWServerRegistration::addClientServiceWorkerRegistration):
(WebCore::SWServerRegistration::removeClientServiceWorkerRegistration):
* workers/service/server/SWServerRegistration.h:
(WebCore::SWServerRegistration::identifier const):

Source/WebKit:

* Scripts/webkit/messages.py:
(forward_declarations_and_headers):
* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::updateRegistrationStateInClient):
(WebKit::WebSWServerConnection::fireUpdateFoundEvent):
* StorageProcess/ServiceWorker/WebSWServerConnection.h:
* StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::addServiceWorkerRegistrationInServer):
(WebKit::WebSWClientConnection::removeServiceWorkerRegistrationInServer):
* WebProcess/Storage/WebSWClientConnection.h:
* WebProcess/Storage/WebSWClientConnection.messages.in:

LayoutTests:

Add layout test coverage.

* http/tests/workers/service/basic-unregister-then-register-again-no-reuse-expected.txt: Added.
* http/tests/workers/service/basic-unregister-then-register-again-no-reuse.html: Added.

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

3 years agoLayoutTests/imported/w3c:
cdumez@apple.com [Fri, 10 Nov 2017 06:06:12 +0000 (06:06 +0000)]
LayoutTests/imported/w3c:
Unreviewed, ebaseline flaky / skipped service worker tests
https://bugs.webkit.org/show_bug.cgi?id=179521

Rebaseline skipped / flaky service worker tests to get better estimates of our pass rate.

* web-platform-tests/service-workers/service-worker/extendable-event-waituntil.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-cache.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-canvas-tainting.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-cors-xhr.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-request-redirect.https-expected.txt:
* web-platform-tests/service-workers/service-worker/foreign-fetch-basics.https-expected.txt:
* web-platform-tests/service-workers/service-worker/performance-timeline.https-expected.txt:
* web-platform-tests/service-workers/service-worker/register-foreign-fetch-errors.https-expected.txt:
* web-platform-tests/service-workers/service-worker/registration-updateviacache.https-expected.txt:
* web-platform-tests/service-workers/service-worker/unregister-controller.https-expected.txt:
* web-platform-tests/service-workers/service-worker/unregister-then-register-new-script.https-expected.txt:
* web-platform-tests/service-workers/service-worker/update-bytecheck.https-expected.txt:

LayoutTests:
Unreviewed, rebaseline flaky / skipped service worker tests
https://bugs.webkit.org/show_bug.cgi?id=179521

Unskip a test that is no longer timing out.

* TestExpectations:

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

3 years ago[JSC] Retry module fetching if previous request fails
utatane.tea@gmail.com [Fri, 10 Nov 2017 05:28:34 +0000 (05:28 +0000)]
[JSC] Retry module fetching if previous request fails
https://bugs.webkit.org/show_bug.cgi?id=178168

Reviewed by Saam Barati.

Source/JavaScriptCore:

According to the latest spec, the failed fetching operation can be retried if it is requested again.
For example,

    <script type="module" integrity="shaXXX-bad" src="./A.js"></script>
    <script type="module" integrity="shaXXX-correct" src="./A.js"></script>

When performing the first module fetching, integrity check fails, and the load of this module becomes failed.
But when loading the second module, we do not use the cached failure result in the first module loading.
We retry fetching for "./A.js". In this case, we have a correct integrity and module fetching succeeds.
This is specified in whatwg/HTML[1]. If the fetching fails, we do not cache it.

Interestingly, fetching result and instantiation result will be cached if they succeeds. This is because we would
like to cache modules based on their URLs. As a result,

    <script type="module" integrity="shaXXX-correct" src="./A.js"></script>
    <script type="module" integrity="shaXXX-bad" src="./A.js"></script>

In the above case, the first loading succeeds. And the second loading also succeeds since the succeeded fetching and
instantiation are cached in the module pipeline.

This patch implements the above semantics. Previously, our module pipeline always caches the result. If the fetching
failed, all the subsequent fetching for the same URL fails even if we have different integrity values. We retry fetching
if the previous one fails. As an overview of our change,

1. Fetching result should be cached only if it succeeds. Two or more on-the-fly fetching requests to the same URLs should
   be unified. But if currently executing one fails, other attempts should retry fetching.

2. Instantiation should be cached if fetching succeeds.

3. Satisfying should be cached if it succeeds.

[1]: https://html.spec.whatwg.org/#fetch-a-single-module-script

* builtins/ModuleLoaderPrototype.js:
(requestFetch):
(requestInstantiate):
(requestSatisfy):
(link):
(loadModule):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):

LayoutTests:

* js/dom/modules/module-fetch-failure-not-cached-expected.txt: Added.
* js/dom/modules/module-fetch-failure-not-cached.html: Added.
* js/dom/modules/module-integrity-bad-value-success-with-cache-expected.txt: Added.
* js/dom/modules/module-integrity-bad-value-success-with-cache.html: Added.
* js/dom/modules/script-tests/module-fetch-failure-not-cached.js: Added.
* js/dom/modules/script-tests/module-integrity-bad-value-success-with-cache.js: Added.

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

3 years agoIgnore HSTS for partitioned, cross-origin subresource requests
bfulgham@apple.com [Fri, 10 Nov 2017 03:21:23 +0000 (03:21 +0000)]
Ignore HSTS for partitioned, cross-origin subresource requests
https://bugs.webkit.org/show_bug.cgi?id=178993
<rdar://problem/34962462>

Patch by John Wilander <wilander@apple.com> on 2017-11-09
Reviewed by Brent Fulgham.

Source/WebCore:

No new tests. HSTS is not supported in layout tests.
Tested manually.

* platform/network/mac/WebCoreURLResponse.mm:
(WebCore::synthesizeRedirectResponseIfNecessary):

Source/WebCore/PAL:

* pal/spi/cf/CFNetworkSPI.h:
    Added
    - (BOOL)_schemeWasUpgradedDueToDynamicHSTS
    - (BOOL)_preventHSTSStorage
    - (BOOL)_ignoreHSTS
    - (void)_setPreventHSTSStorage:(BOOL)preventHSTSStorage
    - (void)_setIgnoreHSTS:(BOOL)ignoreHSTS

Source/WebKit:

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(downgradeRequest):
    Convenience function to downgrade a request if
    CFNetwork as already upgraded it during
    canonicalization. This allows the rest of
    WebKit's processing to function, such as UIR
    and mixed content blocking.
(updateIgnoreStrictTransportSecuritySettingIfNecessary):
    Adds and removed the ignore request accordingly.
(-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
    Now asks CFNetwork to ignore HSTS on resource loads we
    partition cookies for.
(-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
    Now asks CFNetwork to ignore HSTS on resource loads we
    partition cookies for.

Source/WTF:

* wtf/Platform.h:
    Added HAVE_CFNETWORK_IGNORE_HSTS.

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

3 years agoMark multiple service worker tests as flaky.
ryanhaddad@apple.com [Fri, 10 Nov 2017 01:56:10 +0000 (01:56 +0000)]
Mark multiple service worker tests as flaky.

Unreviewed test gardening.

* TestExpectations: Add flaky tests and alphabetize existing entries.

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

3 years ago[iOS] Rebaseline and re-enable editing/deleting tests
ryanhaddad@apple.com [Fri, 10 Nov 2017 01:50:30 +0000 (01:50 +0000)]
[iOS] Rebaseline and re-enable editing/deleting tests
https://bugs.webkit.org/show_bug.cgi?id=179119

Unreviewed test gardening.

* platform/ios-wk2/TestExpectations:
* platform/ios/TestExpectations:
* platform/ios/editing/deleting/collapse-whitespace-3587601-fix-expected.txt: Added.
* platform/ios/editing/deleting/delete-3608445-fix-expected.txt: Added.
* platform/ios/editing/deleting/delete-3800834-fix-expected.txt: Added.
* platform/ios/editing/deleting/delete-after-span-ws-001-expected.txt: Added.
* platform/ios/editing/deleting/delete-after-span-ws-002-expected.txt: Added.
* platform/ios/editing/deleting/delete-after-span-ws-003-expected.txt: Added.
* platform/ios/editing/deleting/delete-at-paragraph-boundaries-004-expected.txt:
* platform/ios/editing/deleting/delete-at-paragraph-boundaries-010-expected.txt:
* platform/ios/editing/deleting/delete-at-paragraph-boundaries-011-expected.txt:
* platform/ios/editing/deleting/delete-at-start-or-end-expected.txt: Added.
* platform/ios/editing/deleting/delete-block-contents-001-expected.txt: Added.
* platform/ios/editing/deleting/delete-block-contents-002-expected.txt: Copied from LayoutTests/platform/ios/editing/deleting/delete-br-010-expected.txt.
* platform/ios/editing/deleting/delete-block-merge-contents-005-expected.txt:
* platform/ios/editing/deleting/delete-block-merge-contents-006-expected.txt:
* platform/ios/editing/deleting/delete-block-merge-contents-007-expected.txt:
* platform/ios/editing/deleting/delete-block-merge-contents-008-expected.txt:
* platform/ios/editing/deleting/delete-block-merge-contents-023-expected.txt:
* platform/ios/editing/deleting/delete-block-merge-contents-024-expected.txt:
* platform/ios/editing/deleting/delete-br-002-expected.txt: Copied from LayoutTests/platform/ios/editing/deleting/delete-to-select-table-expected.txt.
* platform/ios/editing/deleting/delete-br-004-expected.txt: Copied from LayoutTests/platform/ios/editing/deleting/delete-to-select-table-expected.txt.
* platform/ios/editing/deleting/delete-br-005-expected.txt: Copied from LayoutTests/platform/ios/editing/deleting/delete-to-select-table-expected.txt.
* platform/ios/editing/deleting/delete-br-006-expected.txt: Copied from LayoutTests/platform/ios/editing/deleting/delete-to-select-table-expected.txt.
* platform/ios/editing/deleting/delete-br-008-expected.txt:
* platform/ios/editing/deleting/delete-br-009-expected.txt: Copied from LayoutTests/platform/ios/editing/deleting/delete-br-008-expected.txt.
* platform/ios/editing/deleting/delete-br-010-expected.txt:
* platform/ios/editing/deleting/delete-image-004-expected.txt: Added.
* platform/ios/editing/deleting/delete-leading-ws-001-expected.txt: Copied from LayoutTests/platform/ios/editing/deleting/delete-br-010-expected.txt.
* platform/ios/editing/deleting/delete-line-011-expected.txt: Copied from LayoutTests/platform/ios/editing/deleting/delete-to-select-table-expected.txt.
* platform/ios/editing/deleting/delete-line-015-expected.txt:
* platform/ios/editing/deleting/delete-line-016-expected.txt:
* platform/ios/editing/deleting/delete-line-017-expected.txt:
* platform/ios/editing/deleting/delete-line-end-ws-001-expected.txt: Added.
* platform/ios/editing/deleting/delete-line-end-ws-002-expected.txt: Added.
* platform/ios/editing/deleting/delete-tab-001-expected.txt: Added.
* platform/ios/editing/deleting/delete-tab-004-expected.txt: Added.
* platform/ios/editing/deleting/delete-to-select-table-expected.txt:
* platform/ios/editing/deleting/merge-no-br-expected.txt:
* platform/ios/editing/deleting/table-cells-expected.txt:

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

3 years agowebkitpy: Unify version parsing code
jbedard@apple.com [Fri, 10 Nov 2017 01:48:40 +0000 (01:48 +0000)]
webkitpy: Unify version parsing code
https://bugs.webkit.org/show_bug.cgi?id=179426
<rdar://problem/35415191>

Unreviewed fix to r224657.

* Scripts/webkitpy/common/version.py:
(Version.__init__): Check if an object is iterable.

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

3 years agowebkitpy: Unify version parsing code
jbedard@apple.com [Fri, 10 Nov 2017 00:58:32 +0000 (00:58 +0000)]
webkitpy: Unify version parsing code
https://bugs.webkit.org/show_bug.cgi?id=179426
<rdar://problem/35415191>

Reviewed by David Kilzer.

webkitpy needs to parse version strings or version lists frequently. Rather than
duplicate this code each time it's needed, unify it in a Version class.

* Scripts/webkitpy/common/system/platforminfo.py:
(PlatformInfo.__init__): Convert mac version string to version object and
use _win_version instead of _win_version_tuple.
(PlatformInfo.xcode_sdk_version): Convert SDK version string to Version object
before returning it.
(PlatformInfo.xcode_version): Return Version object instead of version string.
(PlatformInfo._determine_mac_version): Accept Version object instead of string,
eliminate parsing.
(PlatformInfo._determine_win_version): Accept Version object instead of tuple.
(PlatformInfo._win_version): Return Version object instead of tuple, have Version
object own version string parsing.
(PlatformInfo._win_version_tuple): Renamed to _win_version().
(PlatformInfo._win_version_tuple_from_cmd): Deleted.
* Scripts/webkitpy/common/system/platforminfo_mock.py:
(MockPlatformInfo.xcode_sdk_version): Return Version object instead of string.
(MockPlatformInfo.xcode_version): Dittio.
* Scripts/webkitpy/common/version.py: Added.
(Version): Version object.
(Version.__init__): Initialize the Version object with a string, integer,
tuple of integers, list of integers or another Version object.
(Version.__len__): Return 5 so that the Version object can be treated as
a list or tuple.
(Version.__getitem__): Get item in Version object by index or string.
(Version.__setitem__): Set item in Version object by index or string.
(Version.__str__): Convert version to printable string, omitting trailing 0's.
(Version.__cmp__): Compare two version strings, major taking precedence over
minor, minor taking precedence over build.
* Scripts/webkitpy/common/version_unittest.py: Added.
(VersionTestCase): Test behavior of Version object.
* Scripts/webkitpy/port/ios.py:
(IOSPort.default_baseline_search_path): ios_version now returns a Version object.
(IOSPort._is_valid_ios_version): Deleted.
(IOSPort.get_option): Deleted.
* Scripts/webkitpy/port/ios_device.py:
(IOSDevicePort.determine_full_port_name): Use Version object instead of owning parsing.
(IOSDevicePort.ios_version): Return Version object instead of string.
* Scripts/webkitpy/port/ios_simulator.py:
(IOSSimulatorPort.simulator_runtime): Use from_version instead of from_version_string.
(IOSSimulatorPort.ios_version): Return Version object instead of string.
(IOSSimulatorPort.use_multiple_simulator_apps): Use Version object instead of string.
* Scripts/webkitpy/xcode/simulator.py:
(Runtime.from_version): Accept Version object instead of string.
(Runtime.from_version_string): Replaced by from_version.
(Runtime.__repr__): When printing, a runtime's version will be a Version object instead
of a tuple.
(Simulator._parse_runtimes): Use Version object instead of tuple.
(Simulator._parse_devices): Ditto.
* Scripts/webkitpy/xcode/simulator_unittest.py: Use Version object instead of tuples.

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

3 years ago[WinCairo] Cannot find ImageDiff executable
commit-queue@webkit.org [Fri, 10 Nov 2017 00:48:51 +0000 (00:48 +0000)]
[WinCairo] Cannot find ImageDiff executable
https://bugs.webkit.org/show_bug.cgi?id=179508

Patch by Basuke Suzuki <Basuke.Suzuki@sony.com> on 2017-11-09
Reviewed by Per Arne Vollan.

* Scripts/webkitpy/port/win.py:
(WinPort.is_cygwin):
(WinPort._path_to_image_diff):
(WinPort.find_system_pid):

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

3 years agoMark media/modern-media-controls/media-controller/media-controller-auto-hide-mouse...
ryanhaddad@apple.com [Fri, 10 Nov 2017 00:41:27 +0000 (00:41 +0000)]
Mark media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-and-mouse-leave.html as a flaky timeout.
https://bugs.webkit.org/show_bug.cgi?id=169876

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years agoSkip slow encoding WPT LayoutTests.
ryanhaddad@apple.com [Fri, 10 Nov 2017 00:31:34 +0000 (00:31 +0000)]
Skip slow encoding WPT LayoutTests.

Unreviewed test gardening.

* TestExpectations:

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

3 years ago[LayoutState cleanup] Remove explicit pop from LayoutState
zalan@apple.com [Fri, 10 Nov 2017 00:31:24 +0000 (00:31 +0000)]
[LayoutState cleanup] Remove explicit pop from LayoutState
https://bugs.webkit.org/show_bug.cgi?id=179509
<rdar://problem/35454323>

Reviewed by Antti Koivisto.

Both relayoutForPagination()/relayoutToAvoidWidows() call layout recursively which requires
manual layout state pop. This patch addresses this issue by constructing a new LayoutState object
for the positioned descendants.

Covered by existing tests.

* rendering/LayoutState.cpp:
(WebCore::LayoutStateMaintainer::~LayoutStateMaintainer):
(WebCore::LayoutStateMaintainer::pop): Deleted.
* rendering/LayoutState.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutBlock):
(WebCore::RenderBlockFlow::relayoutToAvoidWidows):
(WebCore::RenderBlockFlow::relayoutForPagination):
* rendering/RenderBlockFlow.h:

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

3 years agoImplement real post 'install' event steps of the Install algorithm (steps 14+)
cdumez@apple.com [Thu, 9 Nov 2017 23:45:29 +0000 (23:45 +0000)]
Implement real post 'install' event steps of the Install algorithm (steps 14+)
https://bugs.webkit.org/show_bug.cgi?id=179401

Reviewed by Brady Eidson.

LayoutTests/imported/w3c:

Rebaseline a test that is now failing later (progression).

* web-platform-tests/service-workers/service-worker/navigate-window.https-expected.txt:

Source/WebCore:

Implement step 14+ of Install algorithm, as per:
- https://w3c.github.io/ServiceWorker/#installation-algorithm

* dom/Microtasks.h:
* workers/service/ServiceWorker.cpp:
(WebCore::ServiceWorker::ServiceWorker):
(WebCore::ServiceWorker::scheduleTaskToUpdateState):
* workers/service/ServiceWorker.h:
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::scheduleTaskToUpdateRegistrationState):
(WebCore::ServiceWorkerContainer::jobFailedWithException):
(WebCore::ServiceWorkerContainer::scheduleTaskToFireUpdateFoundEvent):
(WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
(WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerJob.cpp:
(WebCore::ServiceWorkerJob::resolvedWithRegistration):
* workers/service/ServiceWorkerJob.h:
* workers/service/ServiceWorkerJobClient.h:
* workers/service/ServiceWorkerRegistration.cpp:
(WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration):
* workers/service/ServiceWorkerTypes.h:
* workers/service/server/SWClientConnection.cpp:
(WebCore::SWClientConnection::registrationJobResolvedInServer):
(WebCore::SWClientConnection::forEachContainer):
(WebCore::SWClientConnection::updateRegistrationState):
(WebCore::SWClientConnection::updateWorkerState):
(WebCore::SWClientConnection::fireUpdateFoundEvent):
* workers/service/server/SWClientConnection.h:
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::Connection::didResolveRegistrationPromise):
(WebCore::SWServer::resolveRegistrationJob):
(WebCore::SWServer::didResolveRegistrationPromise):
* workers/service/server/SWServer.h:
* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::install):
(WebCore::SWServerJobQueue::didResolveRegistrationPromise):
(WebCore::SWServerJobQueue::didFinishInstall):
(WebCore::SWServerJobQueue::runRegisterJob):
* workers/service/server/SWServerJobQueue.h:
* workers/service/server/SWServerRegistration.cpp:
* workers/service/server/SWServerRegistration.h:
(WebCore::SWServerRegistration::installingWorker const):
(WebCore::SWServerRegistration::waitingWorker const):
(WebCore::SWServerRegistration::activeWorker const):
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::terminate):
* workers/service/server/SWServerWorker.h:

Source/WebKit:

Implement step 14+ of Install algorithm, as per:
- https://w3c.github.io/ServiceWorker/#installation-algorithm

* Scripts/webkit/messages.py:
(headers_for_type):
* Shared/WebCoreArgumentCoders.h:
* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::resolveRegistrationJobInClient):
* StorageProcess/ServiceWorker/WebSWServerConnection.h:
* StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::didResolveRegistrationPromise):
* WebProcess/Storage/WebSWClientConnection.h:
* WebProcess/Storage/WebSWClientConnection.messages.in:

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

3 years agoWeb Inspector: Styles Redesign: clicking on inline swatches and property checkboxes...
nvasilyev@apple.com [Thu, 9 Nov 2017 23:40:51 +0000 (23:40 +0000)]
Web Inspector: Styles Redesign: clicking on inline swatches and property checkboxes should not add a new property
https://bugs.webkit.org/show_bug.cgi?id=179507
<rdar://problem/35452204>

Reviewed by Brian Burg.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.initialLayout):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleClick):
Don't add new properties when clicking on selector fields, source links, and property checkboxes.

* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype._update):
It is safe to replace "change" event with "click" since it fires even when pressing Space key when the checkbox is focused.

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

3 years agoBug 179068 - AX: search predicate returns containing group for plain text instead...
d_russell@apple.com [Thu, 9 Nov 2017 23:35:34 +0000 (23:35 +0000)]
Bug 179068 - AX: search predicate returns containing group for plain text instead of text element
https://bugs.webkit.org/show_bug.cgi?id=179068

Reviewed by Darin Adler

Implement a check in AccessibilityRenderObject::hasPlainText(), AccessibilityObject::canHavePlainText(), to confirm the element is capable of providing text.

Source/WebCore:

Tests: accessibility/mac/search-predicate-plaintext.html
       accessibility/mac/search-predicate-visible-button.html
       accessibility/mac/search-predicate-visited-links.html

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::text const):
(WebCore::AccessibilityNodeObject::stringValue const):
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::isARIAStaticText const):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::stringValue const):
(WebCore::AccessibilityRenderObject::canHavePlainText const):
(WebCore::AccessibilityRenderObject::hasPlainText const):
* accessibility/AccessibilityRenderObject.h:

LayoutTests:

* accessibility/mac/search-predicate-expected.txt:
* accessibility/mac/search-predicate-plaintext-expected.txt: Added.
* accessibility/mac/search-predicate-plaintext.html: Added.
* accessibility/mac/search-predicate-visible-button-expected.txt: Added.
* accessibility/mac/search-predicate-visible-button.html: Added.
* accessibility/mac/search-predicate-visited-links-expected.txt: Added.
* accessibility/mac/search-predicate-visited-links.html: Added.
* accessibility/mac/search-predicate.html:
* platform/mac-wk2/TestExpectations:

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

3 years agoInserting an image, selecting, underlining, and then deleting leaves the typing style...
wenson_hsieh@apple.com [Thu, 9 Nov 2017 23:26:55 +0000 (23:26 +0000)]
Inserting an image, selecting, underlining, and then deleting leaves the typing style with both "-webkit-text-decorations-in-effect" and "text-decoration"
https://bugs.webkit.org/show_bug.cgi?id=179431

Reviewed by Ryosuke Niwa.

Source/WebCore:

When inserting an image element, selecting it, underlining the selection, deleting, and then inserting text, we
crash on a debug assert. This codepath was exercised by an API test added in <https://trac.webkit.org/r224512>.
This assertion happens due to the following sequence of events:
1. DeleteSelectionCommand::saveTypingStyleState computes a typing style.
2. In doing so, it calls into EditingStyle::init, which observes that "-webkit-text-decorations-in-effect" is
   present and appends "text-decoration" with an identical CSS value to the EditingStyle's mutable style
   properties.
3. DeleteSelectionCommand::calculateTypingStyleAfterDelete sets the current selection's typing style to the
   above typing style.
4. Later on, when we try to insert text, we compute the StyleChange using the above typing style, which calls
   into reconcileTextDecorationProperties.
5. reconcileTextDecorationProperties debug asserts that "-webkit-text-decorations-in-effect" and
   "text-decoration" don't coexist on the EditingStyle's (i.e. the typing style's) mutable properties; since (2)
   added both properties, this assertion fires.

It appears that step (2) shouldn't be adding "text-decoration" in addition to EditingStyle's mutable style
properties, since doing so would violate the requirements of reconcileTextDecorationProperties. As such, we can
tweak EditingStyle::init to *replace* the "-webkit-text-decorations-in-effect" property with "text-decoration"
instead; this matches the behavior of reconcileTextDecorationProperties, and ensures that we only have the
"text-decorations" property when we try to insert text in step (4).

Test: editing/execCommand/underline-selection-containing-image.html

* editing/EditingStyle.cpp:
(WebCore::EditingStyle::init):

LayoutTests:

Adds a new layout test to fix a debug assertion. See WebCore/ChangeLog for more details. Additionally
rebaselines a few existing tests that serialize markup strings to include `text-decoration: none;`.

* editing/execCommand/underline-selection-containing-image-expected.txt: Added.
* editing/execCommand/underline-selection-containing-image.html: Added.
* editing/pasteboard/data-transfer-get-data-on-drop-rich-text-expected.txt:
* fast/events/before-input-events-prevent-drag-and-drop-expected.txt:
* fast/events/input-events-paste-rich-datatransfer-expected.txt:
* fast/events/ondrop-text-html-expected.txt:

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

3 years agoWeb Inspector: support undo/redo of insertAdjacentHTML
webkit@devinrousso.com [Thu, 9 Nov 2017 23:12:01 +0000 (23:12 +0000)]
Web Inspector: support undo/redo of insertAdjacentHTML
https://bugs.webkit.org/show_bug.cgi?id=179283

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/protocol/DOM.json:
Add `insertAdjacentHTML` command that executes an undoable version of `insertAdjacentHTML`
on the given node.

Source/WebCore:

Test: inspector/dom/insertAdjacentHTML.html

Create another version of Element::insertAdjacentHTML that keeps track of the nodes that are
added. This is necessary because the children of a DocumentFragment are removed when it is
added to a ContainerNode. In this way, it is possible to remove those nodes during an undo.

* dom/Element.h:
* dom/Element.cpp:
(WebCore::Element::insertAdjacentHTML):

* inspector/DOMEditor.h:
* inspector/DOMEditor.cpp:
(WebCore::DOMEditor::insertAdjacentHTML):
Drive-by fix: sort functions and class declarations.

* inspector/agents/InspectorDOMAgent.h:
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::insertAdjacentHTML):

Source/WebInspectorUI:

* UserInterface/Models/DOMNode.js:
(WI.DOMNode.prototype.insertAdjacentHTML):

* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype._startEditingAsHTML):
Drive-by: only attempt to update the cursor if an initialValue is supplied.
LayoutTests:

* inspector/dom/insertAdjacentHTML-expected.txt: Added.
* inspector/dom/insertAdjacentHTML.html: Added.

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

3 years ago[WinCairo EWS] svn-apply: 'cp' is not recognized as an internal or external command
commit-queue@webkit.org [Thu, 9 Nov 2017 22:13:16 +0000 (22:13 +0000)]
[WinCairo EWS] svn-apply: 'cp' is not recognized as an internal or external command
https://bugs.webkit.org/show_bug.cgi?id=179469

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-11-09
Reviewed by Per Arne Vollan.

WinCairo EWS bots haven't installed Cygwin.

* Scripts/svn-apply:
(scmCopy): Use 'copy' function instead of 'cp' command.

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

3 years ago[LayoutState cleanup] Remove redundant LayoutState c'tor
zalan@apple.com [Thu, 9 Nov 2017 22:03:19 +0000 (22:03 +0000)]
[LayoutState cleanup] Remove redundant LayoutState c'tor
https://bugs.webkit.org/show_bug.cgi?id=179505
<rdar://problem/35450650>

Reviewed by Antti Koivisto.

No change in functionality.

* rendering/LayoutState.cpp:
* rendering/LayoutState.h:

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

3 years agoFetchResponse should set the mime type of its internal ResourceResponse
commit-queue@webkit.org [Thu, 9 Nov 2017 21:09:24 +0000 (21:09 +0000)]
FetchResponse should set the mime type of its internal ResourceResponse
https://bugs.webkit.org/show_bug.cgi?id=179487

Patch by Youenn Fablet <youenn@apple.com> on 2017-11-09
Reviewed by Chris Dumez.

No observable change.
Setting the mime type of the response as navigation loads use that field.
This will be used for navigation loads served by service worker.

* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::create):

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

3 years agoServiceWorker ResourceResponse should not assert in platformCertificateInfo()
commit-queue@webkit.org [Thu, 9 Nov 2017 20:58:15 +0000 (20:58 +0000)]
ServiceWorker ResourceResponse should not assert in platformCertificateInfo()
https://bugs.webkit.org/show_bug.cgi?id=179486

Patch by Youenn Fablet <youenn@apple.com> on 2017-11-09
Reviewed by Chris Dumez.

No change of behavior.
In case a Response is returned by Service Worker, there may be no related internal response.
In that case, platformCertificateInfo is returning an empty CertificateInfo.

* platform/network/cocoa/ResourceResponseCocoa.mm:
(WebCore::ResourceResponse::platformCertificateInfo const):

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

3 years ago[WPE] Update dyz (WPE MiniBrowser)
clopez@igalia.com [Thu, 9 Nov 2017 20:56:27 +0000 (20:56 +0000)]
[WPE] Update dyz (WPE MiniBrowser)
https://bugs.webkit.org/show_bug.cgi?id=179492

Reviewed by Michael Catanzaro.

Update it to the last version as of today.
This version not longer uses the C API.

* wpe/jhbuild.modules:

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

3 years ago[WPE] Use linker script to control exported symbols
mcatanzaro@igalia.com [Thu, 9 Nov 2017 20:56:03 +0000 (20:56 +0000)]
[WPE] Use linker script to control exported symbols
https://bugs.webkit.org/show_bug.cgi?id=179358

Reviewed by Carlos Alberto Lopez Perez.

The C API is being inadvertently exported because it's marked as WEBKIT_EXPORT in the header
files. But of course it should only be exported in DEVELOPER_MODE, where it's needed for
WebKitTestRunner. Use (almost) the same linker version script as GTK to fix this. It's
slightly different because WPE does not have WebKitPluginProcess.

This also reduces binary size of libWPEWebKit.so in debug mode from 615 MB down to 497 MB.
(Haven't checked release mode.)

* Source/cmake/OptionsWPE.cmake:
* Source/cmake/wpesymbols.filter: Added.

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

3 years ago[LayoutState cleanup] Remove conditional push from RenderTableSection::calcRowLogical...
zalan@apple.com [Thu, 9 Nov 2017 20:22:10 +0000 (20:22 +0000)]
[LayoutState cleanup] Remove conditional push from RenderTableSection::calcRowLogicalHeight
https://bugs.webkit.org/show_bug.cgi?id=179493
<rdar://problem/35446631>

Reviewed by Antti Koivisto.

Pushing layout states is cheap and we do it for every container anyway.

Covered by existing tests.

* rendering/LayoutState.cpp:
(WebCore::LayoutStateMaintainer::LayoutStateMaintainer):
(WebCore::LayoutStateMaintainer::~LayoutStateMaintainer):
(WebCore::LayoutStateMaintainer::pop):
(WebCore::LayoutStateMaintainer::push): Deleted.
* rendering/LayoutState.h:
(WebCore::LayoutStateMaintainer::didPush const): Deleted.
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::calcRowLogicalHeight):

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

3 years agoClean out unused selection items from UIKitSPI
megan_gardner@apple.com [Thu, 9 Nov 2017 19:30:16 +0000 (19:30 +0000)]
Clean out unused selection items from UIKitSPI
https://bugs.webkit.org/show_bug.cgi?id=179459

Reviewed by Tim Horton.

Many of these should have been removed from previous commits, but they were missed.
None of these enums or methods are being used by WebKit anymore, and removing them will keep things
clean and allow UIKit to remove things that are not used at all by anyone anymore.

* Platform/spi/ios/UIKitSPI.h:

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

3 years agoCachedResourceLoader::requestRawResource should not assert when destination is set...
commit-queue@webkit.org [Thu, 9 Nov 2017 19:13:36 +0000 (19:13 +0000)]
CachedResourceLoader::requestRawResource should not assert when destination is set in the context of a service worker
https://bugs.webkit.org/show_bug.cgi?id=179491

Patch by Youenn Fablet <youenn@apple.com> on 2017-11-09
Reviewed by Chris Dumez.

No change of behavior.
requestRawResource on web page should have the destination set as the empty string as per fetch spec.
In the context of a service worker, requestRawResource may be used with any destination.
Updating assertion accordingly.

* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestRawResource):

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

3 years agoResourceErrorBase::setType should not ASSERT if it is a no op
commit-queue@webkit.org [Thu, 9 Nov 2017 19:00:59 +0000 (19:00 +0000)]
ResourceErrorBase::setType should not ASSERT if it is a no op
https://bugs.webkit.org/show_bug.cgi?id=179490

Patch by Youenn Fablet <youenn@apple.com> on 2017-11-09
Reviewed by Chris Dumez.

No change of behavior.

* platform/network/ResourceErrorBase.cpp:
(WebCore::ResourceErrorBase::setType):

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

3 years ago[LayoutState cleanup] Remove renderer data members from state maintainers.
zalan@apple.com [Thu, 9 Nov 2017 18:50:03 +0000 (18:50 +0000)]
[LayoutState cleanup] Remove renderer data members from state maintainers.
https://bugs.webkit.org/show_bug.cgi?id=179483
<rdar://problem/35442548>

Reviewed by Darin Adler.

Although layout is not supposed to mutate the tree anymore, it's safer to use LayoutContext instead.

No change in functionality.

* page/LayoutContext.cpp:
* page/LayoutContext.h:
* rendering/LayoutState.cpp:
(WebCore::SubtreeLayoutStateMaintainer::SubtreeLayoutStateMaintainer):
(WebCore::SubtreeLayoutStateMaintainer::~SubtreeLayoutStateMaintainer):
(WebCore::PaginatedLayoutStateMaintainer::PaginatedLayoutStateMaintainer):
(WebCore::PaginatedLayoutStateMaintainer::~PaginatedLayoutStateMaintainer):
* rendering/LayoutState.h:

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

3 years agoRemove support for iOS-only softbank-sjis encoding if possible
mjs@apple.com [Thu, 9 Nov 2017 18:37:09 +0000 (18:37 +0000)]
Remove support for iOS-only softbank-sjis encoding if possible
https://bugs.webkit.org/show_bug.cgi?id=179416

Reviewed by Darin Adler.

Source/WebCore:

* platform/text/TextCodecICU.cpp:
(WebCore::TextCodecICU::registerEncodingNames): Remove support for softbank-sjis
codec, because by code inspection it couldn't have possibly worked.
(WebCore::TextCodecICU::registerCodecs): Ditto.

LayoutTests:

* fast/encoding/charset-softbank-sjis.html: Added. Test that <meta charset>
declaration for softbank-sjis is ignored.
* fast/encoding/charset-softbank-sjis-expected.txt: Added.
* fast/encoding/resources/softbank-sjis-iframe.html: Added. Helper for above test.
* fast/encoding/legacy-ios-encodings.html: Add a case for softbank-sjis.
* fast/encoding/legacy-ios-encodings-expected.txt: Result for above.

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

3 years agoUse enum classes within FileSystem
commit-queue@webkit.org [Thu, 9 Nov 2017 18:33:34 +0000 (18:33 +0000)]
Use enum classes within FileSystem
https://bugs.webkit.org/show_bug.cgi?id=175172

Patch by Christopher Reid <chris.reid@sony.com> on 2017-11-09
Reviewed by Darin Adler.

Source/WebCore:

No new tests, no change in behavior.

Further cleanup to FileSystem's enum classes.
Shortening FileSystem's enum names now that they are enum classes.
Adding OptionSet<FileLockMode> to functions using the FileLockMode enum.

* Modules/webdatabase/OriginLock.cpp:
* loader/appcache/ApplicationCacheStorage.cpp:
* platform/FileHandle.h:
* platform/FileStream.cpp:
* platform/FileSystem.cpp:
* platform/FileSystem.h:
* platform/cocoa/FileMonitorCocoa.mm:
* platform/glib/FileSystemGlib.cpp:
* platform/network/curl/CurlCacheEntry.cpp:
* platform/network/curl/CurlCacheManager.cpp:
* platform/posix/FileSystemPOSIX.cpp:
* platform/win/FileSystemWin.cpp:
* rendering/RenderThemeWin.cpp:

Source/WebKit:

* NetworkProcess/Downloads/BlobDownloadClient.cpp:
* NetworkProcess/NetworkDataTaskBlob.cpp:
* NetworkProcess/cache/NetworkCache.cpp:
* NetworkProcess/capture/NetworkCaptureManager.cpp:
* NetworkProcess/capture/NetworkCaptureRecorder.cpp:
* Shared/WebMemorySampler.cpp:
* UIProcess/API/APIContentRuleListStore.cpp:
* UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:

Source/WebKitLegacy/win:

* Plugins/PluginDatabase.cpp:

Tools:

* TestWebKitAPI/Tests/WebCore/FileMonitor.cpp:
* TestWebKitAPI/Tests/WebCore/cocoa/DatabaseTrackerTest.mm:

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

3 years agoWeb Inspector: Make domain availability a list of types instead of a single type
commit-queue@webkit.org [Thu, 9 Nov 2017 18:32:26 +0000 (18:32 +0000)]
Web Inspector: Make domain availability a list of types instead of a single type
https://bugs.webkit.org/show_bug.cgi?id=179457

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-11-09
Reviewed by Brian Burg.

Source/JavaScriptCore:

* inspector/scripts/codegen/generate_js_backend_commands.py:
(JSBackendCommandsGenerator.generate_domain):
Update output of `InspectorBackend.activateDomain` to include the list.

* inspector/scripts/codegen/models.py:
(Protocol.parse_domain):
Parse `availability` as a list and include a new supported value of "service-worker".

* inspector/protocol/ApplicationCache.json:
* inspector/protocol/CSS.json:
* inspector/protocol/Canvas.json:
* inspector/protocol/DOM.json:
* inspector/protocol/DOMDebugger.json:
* inspector/protocol/DOMStorage.json:
* inspector/protocol/Database.json:
* inspector/protocol/IndexedDB.json:
* inspector/protocol/LayerTree.json:
* inspector/protocol/Memory.json:
* inspector/protocol/Network.json:
* inspector/protocol/Page.json:
* inspector/protocol/Timeline.json:
* inspector/protocol/Worker.json:
Update `availability` to be a list.

* inspector/scripts/tests/generic/domain-availability.json:
* inspector/scripts/tests/generic/expected/domain-availability.json-result:
* inspector/scripts/tests/generic/expected/fail-on-domain-availability-type.json-error: Added.
* inspector/scripts/tests/generic/expected/fail-on-domain-availability-value.json-error: Added.
* inspector/scripts/tests/generic/expected/fail-on-domain-availability.json-error:
* inspector/scripts/tests/generic/fail-on-domain-availability-type.json: Copied from Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-domain-availability.json.
* inspector/scripts/tests/generic/fail-on-domain-availability-value.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-domain-availability.json.
Update tests to include a test for the type and an invalid value.

Source/WebInspectorUI:

* UserInterface/Protocol/InspectorBackend.js:
(InspectorBackendClass.prototype.activateDomain):
The second value changed to be an optional list. Check if the active
debuggable type is in the list or not.

* UserInterface/Protocol/Legacy/10.0/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/10.3/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/11.0/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/8.0/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/9.0/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/9.3/InspectorBackendCommands.js:
* Versions/Inspector-iOS-10.0.json:
* Versions/Inspector-iOS-10.3.json:
* Versions/Inspector-iOS-11.0.json:
* Versions/Inspector-iOS-8.0.json:
* Versions/Inspector-iOS-9.0.json:
* Versions/Inspector-iOS-9.3.json:
Since this is a change to how we generate the frontend resource,
update the legacy versioned backends and regenerate their resource.

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

3 years agoServiceWorkerClientFetch should create not null ResourceError
commit-queue@webkit.org [Thu, 9 Nov 2017 18:24:21 +0000 (18:24 +0000)]
ServiceWorkerClientFetch should create not null ResourceError
https://bugs.webkit.org/show_bug.cgi?id=179485

Patch by Youenn Fablet <youenn@apple.com> on 2017-11-09
Reviewed by Darin Adler.

* WebProcess/Storage/ServiceWorkerClientFetch.cpp:
(WebKit::ServiceWorkerClientFetch::didReceiveResponse):

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

3 years ago[LayoutState cleanup] LayouState::m_lineGrid should be a weak pointer
zalan@apple.com [Thu, 9 Nov 2017 18:21:58 +0000 (18:21 +0000)]
[LayoutState cleanup] LayouState::m_lineGrid should be a weak pointer
https://bugs.webkit.org/show_bug.cgi?id=179484
<rdar://problem/35442725>

Reviewed by Darin Adler.

Covered by existing tests.

* rendering/LayoutState.cpp:
(WebCore::LayoutState::propagateLineGridInfo):
(WebCore::LayoutState::establishLineGrid):
* rendering/LayoutState.h:
(WebCore::LayoutState::lineGrid const):

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

3 years agoTest fix after r224609
bfulgham@apple.com [Thu, 9 Nov 2017 17:36:11 +0000 (17:36 +0000)]
Test fix after r224609
https://bugs.webkit.org/show_bug.cgi?id=178565
<rdar://problem/11115901>

Unreviewed test fix after r224609.

Correct two test cases that attempt to push local file URLs in violation of our
same origin policies. The fix is to grant universal file access, as we do for similar
LayoutTests.

* TestWebKitAPI/Tests/WebKit/EphemeralSessionPushStateNoHistoryCallback.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/PrivateBrowsingPushStateNoHistoryCallback.cpp:
(TestWebKitAPI::TEST):

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

3 years ago[iOS] Adopt UIPreviewDataAttachmentListIsContentManaged
aestes@apple.com [Thu, 9 Nov 2017 17:20:27 +0000 (17:20 +0000)]
[iOS] Adopt UIPreviewDataAttachmentListIsContentManaged
https://bugs.webkit.org/show_bug.cgi?id=179458
<rdar://problem/35034691>

Reviewed by Dan Bernstein.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _dataForPreviewItemController:atPosition:type:]):

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

3 years ago[Win] Add WebKitQuartzCoreAdditions library.
pvollan@apple.com [Thu, 9 Nov 2017 17:11:24 +0000 (17:11 +0000)]
[Win] Add WebKitQuartzCoreAdditions library.
https://bugs.webkit.org/show_bug.cgi?id=179331

Reviewed by Alex Christensen.

Source/WebKitLegacy:

This library should be added to the OpenSource repository.

* CMakeLists.txt:

Source/WebKitLegacy/win:

* WebKitQuartzCoreAdditions: Added.
* WebKitQuartzCoreAdditions/API: Added.
* WebKitQuartzCoreAdditions/API/WKCACFImage.cpp: Added.
(toImage):
(WKCACFImageGetWidth):
(WKCACFImageGetHeight):
(WKCACFImageCopyFileMapping):
(WKCACFImageCreateWithImage):
(WKCACFImageFinalize):
(WKCACFImageCopyFormattingDescription):
(WKCACFImageCopyDebugDescription):
(WKCACFImageGetTypeID):
* WebKitQuartzCoreAdditions/API/WKCACFImage.h: Added.
* WebKitQuartzCoreAdditions/API/WKCACFImageInternal.h: Added.
* WebKitQuartzCoreAdditions/API/WKCACFView.cpp: Added.
(toView):
(toImpl):
(WKCACFViewCreate):
(WKCACFViewSetLayer):
(WKCACFViewUpdate):
(WKCACFViewFlushContext):
(WKCACFViewInvalidateRects):
(WKCACFViewCanDraw):
(WKCACFViewDraw):
(WKCACFViewCopyDrawnImage):
(WKCACFViewDrawIntoDC):
(contextDidChangeCallback):
(WKCACFViewSetContextDidChangeCallback):
(WKCACFViewGetLastCommitTime):
(WKCACFViewSetContextUserData):
(WKCACFViewGetContext):
(WKCACFViewFinalize):
(WKCACFViewCopyFormattingDescription):
(WKCACFViewCopyDebugDescription):
(WKCACFViewGetTypeID):
(WKCACFViewSetShouldInvertColors):
(WKCACFViewGetD3DDevice9):
* WebKitQuartzCoreAdditions/API/WKCACFView.h: Added.
* WebKitQuartzCoreAdditions/API/WKCACFViewPrivate.h: Added.
* WebKitQuartzCoreAdditions/API/WebKitQuartzCoreAdditions.cpp: Added.
(WKQCA::dllInstance):
(DllMain):
(WKCACFShutDown):
* WebKitQuartzCoreAdditions/API/WebKitQuartzCoreAdditionsBase.h: Added.
* WebKitQuartzCoreAdditions/CAD3DRenderer.cpp: Added.
(WKQCA::D3DPostProcessingContext::D3DPostProcessingContext):
(WKQCA::d3d):
(WKQCA::initialPresentationParameters):
(WKQCA::CAD3DRenderer::shared):
(WKQCA::CAD3DRenderer::CAD3DRenderer):
(WKQCA::CAD3DRenderer::swapChain):
(WKQCA::CAD3DRenderer::createD3DPostProcessingContext):
(WKQCA::hardwareCapabilitiesIndicateCoreAnimationSupport):
(WKQCA::CAD3DRenderer::initialize):
(WKQCA::D3DMatrixOrthoOffCenterRH):
(WKQCA::prepareDevice):
(WKQCA::updateBounds):
(WKQCA::CAD3DRenderer::renderAndPresent):
(WKQCA::CAD3DRenderer::renderToImage):
(WKQCA::CAD3DRenderer::setDeviceIsLost):
(WKQCA::CAD3DRenderer::renderInternal):
(WKQCA::CAD3DRenderer::postProcess):
(WKQCA::CAD3DRenderer::resetD3DDevice):
(WKQCA::CAD3DRenderer::createShaderIfNeeded):
(WKQCA::CAD3DRenderer::release):
* WebKitQuartzCoreAdditions/CAD3DRenderer.h: Added.
(WKQCA::D3DPostProcessingContext::sceneTexture const):
(WKQCA::D3DPostProcessingContext::overlayQuad const):
(WKQCA::CAD3DRenderer::d3dDevice9 const):
* WebKitQuartzCoreAdditions/CAView.cpp: Added.
(WKQCA::CAView::Handle::create):
(WKQCA::CAView::Handle::~Handle):
(WKQCA::CAView::Handle::mutex):
(WKQCA::CAView::Handle::view const):
(WKQCA::CAView::Handle::clear):
(WKQCA::CAView::Handle::Handle):
(WKQCA::globalStateMutex):
(WKQCA::registerMessageWindowClass):
(WKQCA::createMessageWindow):
(WKQCA::CAView::releaseAllD3DResources):
(WKQCA::CAView::CAView):
(WKQCA::CAView::~CAView):
(WKQCA::CAView::create):
(WKQCA::CAView::setContextDidChangeCallback):
(WKQCA::CAView::setLayer):
(WKQCA::CAView::update):
(WKQCA::CAView::invalidateRects):
(WKQCA::CAView::drawToWindow):
(WKQCA::CAView::drawToWindowInternal):
(WKQCA::CAView::drawToImage):
(WKQCA::CAView::willDraw):
(WKQCA::CAView::didDraw):
(WKQCA::CAView::drawIntoDC):
(WKQCA::CAView::setShouldInvertColors):
(WKQCA::CAView::scheduleNextDraw):
(WKQCA::CAView::displayLinkReachedCAMediaTime):
(WKQCA::CAView::contextDidChangeCallback):
(WKQCA::CAView::contextDidChange):
(WKQCA::CAView::updateSoon):
(WKQCA::CAView::updateViewsNow):
(WKQCA::CAView::d3dDevice9):
* WebKitQuartzCoreAdditions/CAView.h: Added.
(WKQCA::CAView::context const):
(WKQCA::CAView::canDraw const):
(WKQCA::CAView::ContextDidChangeCallback::ContextDidChangeCallback):
* WebKitQuartzCoreAdditions/CMakeLists.txt: Added.
* WebKitQuartzCoreAdditions/CVDisplayLink.cpp: Added.
(WKQCA::CVDisplayLink::CVDisplayLink):
(WKQCA::CVDisplayLink::~CVDisplayLink):
(WKQCA::CVDisplayLink::create):
(WKQCA::CVDisplayLink::start):
(WKQCA::CVDisplayLink::stop):
(WKQCA::CVDisplayLink::setPaused):
(WKQCA::CVDisplayLink::runIOThread):
* WebKitQuartzCoreAdditions/CVDisplayLink.h: Added.
* WebKitQuartzCoreAdditions/CVDisplayLinkClient.h: Added.
(WKQCA::CVDisplayLinkClient::~CVDisplayLinkClient):
* WebKitQuartzCoreAdditions/Image.cpp: Added.
(WKQCA::numBytesForSize):
(WKQCA::Image::create):
(WKQCA::Image::Image):
(WKQCA::Image::~Image):
(WKQCA::bitmapInfo):
(WKQCA::Image::createDIB const):
(WKQCA::Image::copyFileMapping):
* WebKitQuartzCoreAdditions/Image.h: Added.
(WKQCA::Image::size const):
* WebKitQuartzCoreAdditions/ImageConversion.cpp: Added.
(WKQCA::getBackBufferRectAsRenderTarget):
(WKQCA::getSystemMemoryCopy):
(WKQCA::copyRectToBitmap):
(WKQCA::getImageCopy):
(WKQCA::getBackBufferRectAsImage):
* WebKitQuartzCoreAdditions/ImageConversion.h: Added.
* WebKitQuartzCoreAdditions/InvertColorPS.hlsl: Added.
* WebKitQuartzCoreAdditions/WebKitQuartzCoreAdditionsInternal.h: Added.
* WebKitQuartzCoreAdditions/WebKitQuartzCoreAdditionsPrefix.cpp: Added.
* WebKitQuartzCoreAdditions/WebKitQuartzCoreAdditionsPrefix.h: Added.

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

3 years agoUnreviewed, remove Dan from the soup network watchlist
mcatanzaro@igalia.com [Thu, 9 Nov 2017 16:18:32 +0000 (16:18 +0000)]
Unreviewed, remove Dan from the soup network watchlist

Per his request. It's not Hotel California; we should probably let him leave.

* Scripts/webkitpy/common/config/watchlist:

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

3 years ago[JSC][JIT] Clean up SlowPathCall stubs
utatane.tea@gmail.com [Thu, 9 Nov 2017 15:16:22 +0000 (15:16 +0000)]
[JSC][JIT] Clean up SlowPathCall stubs
https://bugs.webkit.org/show_bug.cgi?id=179247

Reviewed by Saam Barati.

We have bunch of duplicate functions that just call a slow path function.
This patch cleans up the above duplication.

* jit/JIT.cpp:
(JSC::JIT::emitSlowCaseCall):
(JSC::JIT::privateCompileSlowCases):
* jit/JIT.h:
* jit/JITArithmetic.cpp:
(JSC::JIT::emitSlow_op_unsigned): Deleted.
(JSC::JIT::emitSlow_op_inc): Deleted.
(JSC::JIT::emitSlow_op_dec): Deleted.
(JSC::JIT::emitSlow_op_bitand): Deleted.
(JSC::JIT::emitSlow_op_bitor): Deleted.
(JSC::JIT::emitSlow_op_bitxor): Deleted.
(JSC::JIT::emitSlow_op_lshift): Deleted.
(JSC::JIT::emitSlow_op_rshift): Deleted.
(JSC::JIT::emitSlow_op_urshift): Deleted.
(JSC::JIT::emitSlow_op_div): Deleted.
* jit/JITArithmetic32_64.cpp:
(JSC::JIT::emitSlow_op_unsigned): Deleted.
(JSC::JIT::emitSlow_op_inc): Deleted.
(JSC::JIT::emitSlow_op_dec): Deleted.
* jit/JITOpcodes.cpp:
(JSC::JIT::emitSlow_op_create_this): Deleted.
(JSC::JIT::emitSlow_op_check_tdz): Deleted.
(JSC::JIT::emitSlow_op_to_this): Deleted.
(JSC::JIT::emitSlow_op_to_primitive): Deleted.
(JSC::JIT::emitSlow_op_not): Deleted.
(JSC::JIT::emitSlow_op_stricteq): Deleted.
(JSC::JIT::emitSlow_op_nstricteq): Deleted.
(JSC::JIT::emitSlow_op_to_number): Deleted.
(JSC::JIT::emitSlow_op_to_string): Deleted.
(JSC::JIT::emitSlow_op_to_object): Deleted.
(JSC::JIT::emitSlow_op_get_direct_pname): Deleted.
(JSC::JIT::emitSlow_op_has_structure_property): Deleted.
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emitSlow_op_to_primitive): Deleted.
(JSC::JIT::emitSlow_op_not): Deleted.
(JSC::JIT::emitSlow_op_stricteq): Deleted.
(JSC::JIT::emitSlow_op_nstricteq): Deleted.
(JSC::JIT::emitSlow_op_to_number): Deleted.
(JSC::JIT::emitSlow_op_to_string): Deleted.
(JSC::JIT::emitSlow_op_to_object): Deleted.
(JSC::JIT::emitSlow_op_create_this): Deleted.
(JSC::JIT::emitSlow_op_to_this): Deleted.
(JSC::JIT::emitSlow_op_check_tdz): Deleted.
(JSC::JIT::emitSlow_op_get_direct_pname): Deleted.
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emitSlow_op_resolve_scope): Deleted.
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emit_op_resolve_scope):
(JSC::JIT::emitSlow_op_resolve_scope): Deleted.
* jit/SlowPathCall.h:
(JSC::JITSlowPathCall::JITSlowPathCall):
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/CommonSlowPaths.h:

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

3 years ago[LayoutState cleanup] Add pagination parameter to subtree LayoutState
zalan@apple.com [Thu, 9 Nov 2017 15:08:46 +0000 (15:08 +0000)]
[LayoutState cleanup] Add pagination parameter to subtree LayoutState
https://bugs.webkit.org/show_bug.cgi?id=179465
<rdar://problem/35434096>

Reviewed by Antti Koivisto.

It enables us to remove the last setters from LayoutState.

No change in functionality.

* page/LayoutContext.cpp:
(WebCore::LayoutContext::pushLayoutStateForPaginationIfNeeded):
* rendering/LayoutState.cpp:
(WebCore::LayoutState::LayoutState):
(WebCore::LayoutState::layoutDeltaMatches const):
(WebCore::LayoutState::layoutDeltaMatches): Deleted.
* rendering/LayoutState.h:
(WebCore::LayoutState::isPaginated const):
(WebCore::LayoutState::setIsPaginated): Deleted.
(WebCore::LayoutState::setPageLogicalHeight): Deleted.

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

3 years ago[GTK] Gardening 09 nov
clopez@igalia.com [Thu, 9 Nov 2017 12:36:07 +0000 (12:36 +0000)]
[GTK] Gardening 09 nov
https://bugs.webkit.org/show_bug.cgi?id=179472

Unreviewed GTK gardening

* platform/gtk/TestExpectations:

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

3 years ago[JSC][MIPS] Use fcsr to check the validity of the result of trunc.w.d
guijemont@igalia.com [Thu, 9 Nov 2017 09:02:10 +0000 (09:02 +0000)]
[JSC][MIPS] Use fcsr to check the validity of the result of trunc.w.d
https://bugs.webkit.org/show_bug.cgi?id=179446

Reviewed by Žan Doberšek.

The trunc.w.d mips instruction should give a 0x7fffffff result when
the source value is Infinity, NaN, or rounds to an integer outside the
range -2^31 to 2^31 -1. This is what branchTruncateDoubleToInt32() and
branchTruncateDoubleToUInt32() have been relying on. It turns out that
this assumption is not true on some CPUs, including on the ci20 on
which we run the testbot (we get 0x80000000 instead). We should the
invalid operation cause bit instead to check whether the source value
could be properly truncated. This requires the addition of the cfc1
instruction, as well as the special registers that can be used with it
(control registers of CP1).

* assembler/MIPSAssembler.h:
(JSC::MIPSAssembler::firstSPRegister):
(JSC::MIPSAssembler::lastSPRegister):
(JSC::MIPSAssembler::numberOfSPRegisters):
(JSC::MIPSAssembler::sprName):
Added control registers of CP1.
(JSC::MIPSAssembler::cfc1):
Added.
* assembler/MacroAssemblerMIPS.h:
(JSC::MacroAssemblerMIPS::branchOnTruncateResult):
(JSC::MacroAssemblerMIPS::branchTruncateDoubleToInt32):
(JSC::MacroAssemblerMIPS::branchTruncateDoubleToUint32):
Use fcsr to check if the value could be properly truncated.

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

3 years ago[GTK] Test gardening
commit-queue@webkit.org [Thu, 9 Nov 2017 08:51:50 +0000 (08:51 +0000)]
[GTK] Test gardening
https://bugs.webkit.org/show_bug.cgi?id=179447

Patch by Alicia Boya García <aboya@igalia.com> on 2017-11-09
Reviewed by Michael Catanzaro.

* platform/gtk/TestExpectations:

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

3 years agoREGRESSION(r224566): [GTK][WPE] Many inspector tests are failing after r224566
commit-queue@webkit.org [Thu, 9 Nov 2017 08:12:04 +0000 (08:12 +0000)]
REGRESSION(r224566): [GTK][WPE] Many inspector tests are failing after r224566
https://bugs.webkit.org/show_bug.cgi?id=179419

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2017-11-09
Reviewed by Carlos Alberto Lopez Perez.

All of them fail with the following error:

Uncaught exception in Inspector page: ReferenceError: Can't find variable: CodeMirror [TestCombined.js:36658:15]

This is because Test.html, even when combined, is trying to load CodeMirror from External/CodeMirror, but
CodeMirror was already combined for Main.html. We need to also combine CodeMirror for Test.html.

* Scripts/copy-user-interface-resources.pl:

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

3 years agoAVSampleBufferGenerator leaks seen on leaks bot
commit-queue@webkit.org [Thu, 9 Nov 2017 07:59:31 +0000 (07:59 +0000)]
AVSampleBufferGenerator leaks seen on leaks bot
https://bugs.webkit.org/show_bug.cgi?id=179464

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-11-08
Reviewed by Jer Noble.

* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
(WebCore::ImageDecoderAVFObjC::readSampleMetadata):
(WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex):
Adopt the allocation into our RetainPtr.

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

3 years agoInclude a more complete block signature in public headers to avoid potential -Wstrict...
commit-queue@webkit.org [Thu, 9 Nov 2017 06:05:07 +0000 (06:05 +0000)]
Include a more complete block signature in public headers to avoid potential -Wstrict-prototypes warnings
https://bugs.webkit.org/show_bug.cgi?id=179466

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-11-08
Reviewed by Dan Bernstein.

* UIProcess/API/Cocoa/WKHTTPCookieStore.h:
* UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
(-[WKHTTPCookieStore setCookie:completionHandler:]):
(-[WKHTTPCookieStore deleteCookie:completionHandler:]):

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

3 years agoContent not painted when scrolling an overflow node inside an iframe
simon.fraser@apple.com [Thu, 9 Nov 2017 05:35:34 +0000 (05:35 +0000)]
Content not painted when scrolling an overflow node inside an iframe
https://bugs.webkit.org/show_bug.cgi?id=179315
rdar://problem/35364166

Reviewed by Tim Horton.

Source/WebCore:

When scrolling overflow:scroll, we need to check for overlap updates just as we do
for page scrolls.

Test: compositing/ios/overflow-scroll-update-overlap.html

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingLayers):

LayoutTests:

* compositing/ios/overflow-scroll-update-overlap-expected.html: Added.
* compositing/ios/overflow-scroll-update-overlap.html: Added.

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

3 years agoCordova: elements with tag position:fixed disappears (flickering) when a long content...
simon.fraser@apple.com [Thu, 9 Nov 2017 05:27:22 +0000 (05:27 +0000)]
Cordova: elements with tag position:fixed disappears (flickering) when a long content is scrolling and appears again when the scroll is finished.
https://bugs.webkit.org/show_bug.cgi?id=178066

Reviewed by Tim Horton.

In UIWebView, we were failing to call setIsViewportConstrained() on layers for position:fixed,
causing us to detach their backing store sometimes on page scrolling.

Fix by hoisting the call to RenderLayerBacking::setIsScrollCoordinatedWithViewportConstrainedRole()
up the stack into code that runs for both UIWebView and WKWebView. This required moving some of
the sanity check code up out of updateScrollCoordinatedLayer() into the caller.

Not testable because the bug only manifested in UIWebView.

* rendering/RenderLayerCompositor.cpp:
(WebCore::canCoordinateScrollingForLayer):
(WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):

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

3 years ago[LayoutState cleanup] Move RenderMultiColumnFlow::computeLineGridPaginationOrigin...
zalan@apple.com [Thu, 9 Nov 2017 04:57:38 +0000 (04:57 +0000)]
[LayoutState cleanup] Move RenderMultiColumnFlow::computeLineGridPaginationOrigin to LayoutState
https://bugs.webkit.org/show_bug.cgi?id=179462

Reviewed by Antti Koivisto.

This is in preparation for having no setters on LayoutState.
Having all the related functions (pagination/line-grid) in one place also helps with moving
them to a more appropriate place later.

No change in functionality.

* rendering/LayoutState.cpp:
(WebCore::LayoutState::computePaginationInformation):
(WebCore::LayoutState::computeLineGridPaginationOrigin):
(WebCore::LayoutState::establishLineGrid):
* rendering/LayoutState.h:
(WebCore::LayoutState::setLineGridPaginationOrigin): Deleted.
(WebCore::LayoutState::currentRenderFragmentedFlow const): Deleted.
(WebCore::LayoutState::setCurrentRenderFragmentedFlow): Deleted.
* rendering/RenderMultiColumnFlow.cpp:
(WebCore::RenderMultiColumnFlow::computeLineGridPaginationOrigin const): Deleted.

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

3 years agoReplace some stack raw pointers with RefPtrs within WebCore/svg
jiewen_tan@apple.com [Thu, 9 Nov 2017 03:55:05 +0000 (03:55 +0000)]
Replace some stack raw pointers with RefPtrs within WebCore/svg
https://bugs.webkit.org/show_bug.cgi?id=179314
<rdar://problem/34842204>

Reviewed by Ryosuke Niwa.

Besides replacing pointers directly, some of the methods are changed to return
RefPtrs as well.

No changes in behaviors.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::remoteSVGRootElement const):
* dom/EventPath.h:
(WebCore::EventPath::eventTargetRespectingTargetRules):
* page/FrameView.cpp:
(WebCore::FrameView::scrollToAnchor):
* svg/SVGAElement.cpp:
(WebCore::SVGAElement::defaultEventHandler):
* svg/SVGAltGlyphElement.cpp:
(WebCore::SVGAltGlyphElement::hasValidGlyphElements const):
* svg/SVGAnimateElementBase.cpp:
(WebCore::SVGAnimateElementBase::hasValidAttributeType):
(WebCore::SVGAnimateElementBase::calculateAnimatedValue):
(WebCore::SVGAnimateElementBase::calculateFromAndToValues):
(WebCore::SVGAnimateElementBase::calculateFromAndByValues):
(WebCore::SVGAnimateElementBase::resetAnimatedType):
(WebCore::SVGAnimateElementBase::applyResultsToTarget):
(WebCore::SVGAnimateElementBase::calculateDistance):
* svg/SVGAnimateMotionElement.cpp:
(WebCore::SVGAnimateMotionElement::hasValidAttributeType):
(WebCore::SVGAnimateMotionElement::updateAnimationPath):
(WebCore::SVGAnimateMotionElement::resetAnimatedType):
(WebCore::SVGAnimateMotionElement::calculateAnimatedValue):
(WebCore::SVGAnimateMotionElement::applyResultsToTarget):
* svg/SVGAnimateTransformElement.cpp:
(WebCore::SVGAnimateTransformElement::hasValidAttributeType):
* svg/SVGAnimatedPath.cpp:
(WebCore::SVGAnimatedPathAnimator::resetAnimValToBaseVal):
* svg/SVGAnimationElement.cpp:
(WebCore::SVGAnimationElement::adjustForInheritance):
(WebCore::SVGAnimationElement::determinePropertyValueTypes):
* svg/SVGDocument.cpp:
(WebCore::SVGDocument::rootElement):
(WebCore::SVGDocument::zoomAndPanEnabled const):
(WebCore::SVGDocument::startPan):
(WebCore::SVGDocument::updatePan const):
* svg/SVGDocument.h:
* svg/SVGDocumentExtensions.cpp:
(WebCore::SVGDocumentExtensions::removeElementFromPendingResourcesForRemovalMap):
* svg/SVGDocumentExtensions.h:
* svg/SVGElement.cpp:
(WebCore::SVGElement::~SVGElement):
(WebCore::SVGElement::correspondingUseElement const):
(WebCore::SVGElement::setCorrespondingElement):
(WebCore::SVGElement::resolveCustomStyle):
(WebCore::SVGElement::computedStyle):
(WebCore::SVGElement::buildPendingResourcesIfNeeded):
(WebCore::SVGElement::updateRelativeLengthsInformation):
(WebCore::SVGElement::invalidateInstances):
* svg/SVGElement.h:
* svg/SVGFEBlendElement.cpp:
(WebCore::SVGFEBlendElement::build):
* svg/SVGFEColorMatrixElement.cpp:
(WebCore::SVGFEColorMatrixElement::build):
* svg/SVGFEComponentTransferElement.cpp:
(WebCore::SVGFEComponentTransferElement::build):
* svg/SVGFECompositeElement.cpp:
(WebCore::SVGFECompositeElement::build):
* svg/SVGFEConvolveMatrixElement.cpp:
(WebCore::SVGFEConvolveMatrixElement::build):
* svg/SVGFEDiffuseLightingElement.cpp:
(WebCore::SVGFEDiffuseLightingElement::build):
* svg/SVGFEDisplacementMapElement.cpp:
(WebCore::SVGFEDisplacementMapElement::build):
* svg/SVGFEDropShadowElement.cpp:
(WebCore::SVGFEDropShadowElement::build):
* svg/SVGFEGaussianBlurElement.cpp:
(WebCore::SVGFEGaussianBlurElement::build):
* svg/SVGFEImageElement.cpp:
(WebCore::SVGFEImageElement::buildPendingResource):
(WebCore::SVGFEImageElement::notifyFinished):
* svg/SVGFELightElement.cpp:
(WebCore::SVGFELightElement::findLightSource):
(WebCore::SVGFELightElement::svgAttributeChanged):
(WebCore::SVGFELightElement::childrenChanged):
* svg/SVGFEMergeElement.cpp:
(WebCore::SVGFEMergeElement::build):
* svg/SVGFEMorphologyElement.cpp:
(WebCore::SVGFEMorphologyElement::build):
* svg/SVGFEOffsetElement.cpp:
(WebCore::SVGFEOffsetElement::build):
* svg/SVGFESpecularLightingElement.cpp:
(WebCore::SVGFESpecularLightingElement::build):
* svg/SVGFETileElement.cpp:
(WebCore::SVGFETileElement::build):
* svg/SVGFilterPrimitiveStandardAttributes.cpp:
(WebCore::invalidateFilterPrimitiveParent):
* svg/SVGFontFaceElement.cpp:
(WebCore::SVGFontFaceElement::rebuildFontFace):
* svg/SVGFontFaceFormatElement.cpp:
(WebCore::SVGFontFaceFormatElement::childrenChanged):
* svg/SVGFontFaceUriElement.cpp:
(WebCore::SVGFontFaceUriElement::childrenChanged):
* svg/SVGForeignObjectElement.cpp:
(WebCore::SVGForeignObjectElement::rendererIsNeeded):
* svg/SVGLengthContext.cpp:
(WebCore::SVGLengthContext::determineViewport const):
* svg/SVGLinearGradientElement.cpp:
(WebCore::SVGLinearGradientElement::collectGradientAttributes):
* svg/SVGMPathElement.cpp:
(WebCore::SVGMPathElement::buildPendingResource):
(WebCore::SVGMPathElement::pathElement):
* svg/SVGMPathElement.h:
* svg/SVGRadialGradientElement.cpp:
(WebCore::SVGRadialGradientElement::collectGradientAttributes):
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::frameForCurrentScale const):
(WebCore::SVGSVGElement::currentScale const):
(WebCore::SVGSVGElement::setCurrentScale):
(WebCore::SVGSVGElement::deselectAll):
(WebCore::SVGSVGElement::localCoordinateSpaceTransform const):
(WebCore::SVGSVGElement::scrollToAnchor):
(WebCore::SVGSVGElement::getElementById):
* svg/SVGSVGElement.h:
* svg/SVGStyleElement.cpp:
(WebCore::SVGStyleElement::setDisabled):
* svg/SVGTRefElement.cpp:
(WebCore::SVGTRefElement::detachTarget):
* svg/SVGTextContentElement.cpp:
(WebCore::SVGTextContentElement::elementFromRenderer):
* svg/SVGTextPathElement.cpp:
(WebCore::SVGTextPathElement::buildPendingResource):
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::transferSizeAttributesToTargetClone const):
(WebCore::SVGUseElement::svgAttributeChanged):
(WebCore::SVGUseElement::targetClone const):
(WebCore::SVGUseElement::toClipPath):
(WebCore::SVGUseElement::rendererClipChild const):
(WebCore::SVGUseElement::findTarget const):
(WebCore::SVGUseElement::invalidateDependentShadowTrees):
(WebCore::SVGUseElement::selfHasRelativeLengths const):
* svg/SVGUseElement.h:
* svg/animation/SMILTimeContainer.cpp:
(WebCore::SMILTimeContainer::updateAnimations):
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::buildPendingResource):
(WebCore::SVGSMILElement::insertedIntoAncestor):
(WebCore::SVGSMILElement::connectConditions):
(WebCore::SVGSMILElement::disconnectConditions):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::rootElement const):
(WebCore::SVGImage::hasSingleSecurityOrigin const):
(WebCore::SVGImage::setContainerSize):
(WebCore::SVGImage::containerSize const):
(WebCore::SVGImage::draw):
(WebCore::SVGImage::embeddedContentBox const):
(WebCore::SVGImage::hasRelativeWidth const):
(WebCore::SVGImage::hasRelativeHeight const):
(WebCore::SVGImage::computeIntrinsicDimensions):
(WebCore::SVGImage::startAnimation):
(WebCore::SVGImage::stopAnimation):
(WebCore::SVGImage::isAnimating const):
(WebCore::SVGImage::reportApproximateMemoryCost const):
* svg/graphics/SVGImage.h:
* svg/graphics/filters/SVGFEImage.cpp:
(WebCore::FEImage::platformApplySoftware):
* svg/graphics/filters/SVGFilterBuilder.cpp:
(WebCore::SVGFilterBuilder::getEffectById const):
* svg/graphics/filters/SVGFilterBuilder.h:
* svg/properties/SVGAnimatedPathSegListPropertyTearOff.h:
* svg/properties/SVGListPropertyTearOff.h:

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

3 years agoMark imported/w3c/web-platform-tests/service-workers/service-worker/register-same...
ryanhaddad@apple.com [Thu, 9 Nov 2017 01:47:56 +0000 (01:47 +0000)]
Mark imported/w3c/web-platform-tests/service-workers/service-worker/register-same-scope-different-script-url.https.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=179452

Unreviewed test gardening.

* TestExpectations:

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

3 years agoMark http/tests/workers/service/registration-task-queue-scheduling-1.html as flaky.
ryanhaddad@apple.com [Thu, 9 Nov 2017 01:44:21 +0000 (01:44 +0000)]
Mark http/tests/workers/service/registration-task-queue-scheduling-1.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=179342

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years ago[LayoutState cleanup] LayoutContext should own the stack of LayoutState objects
zalan@apple.com [Thu, 9 Nov 2017 01:32:17 +0000 (01:32 +0000)]
[LayoutState cleanup] LayoutContext should own the stack of LayoutState objects
https://bugs.webkit.org/show_bug.cgi?id=179408
<rdar://problem/35423075>

Reviewed by Antti Koivisto.

No change in functionality.

* page/LayoutContext.cpp:
(WebCore::LayoutContext::layoutDelta const):
(WebCore::LayoutContext::addLayoutDelta):
(WebCore::LayoutContext::layoutDeltaMatches):
(WebCore::LayoutContext::layoutState const):
(WebCore::LayoutContext::pushLayoutState):
(WebCore::LayoutContext::pushLayoutStateForPaginationIfNeeded):
(WebCore::LayoutContext::popLayoutState):
* page/LayoutContext.h:
(WebCore::LayoutContext::isPaintOffsetCacheEnabled const):
(WebCore::LayoutContext::layoutState const): Deleted.
* rendering/LayoutState.cpp:
(WebCore::LayoutState::LayoutState):
(WebCore::LayoutState::computeOffsets):
(WebCore::LayoutState::computeClipRect):
(WebCore::LayoutState::computePaginationInformation):
(WebCore::LayoutState::propagateLineGridInfo):
(WebCore::LayoutState::establishLineGrid):
(WebCore::LayoutState::clearPaginationInformation): Deleted.
* rendering/LayoutState.h:
(WebCore::LayoutState::setIsPaginated):

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

3 years agoServiceWorkerRegistration::updateStateFromServer fix! (Don't always create a new...
beidson@apple.com [Thu, 9 Nov 2017 01:13:27 +0000 (01:13 +0000)]
ServiceWorkerRegistration::updateStateFromServer fix! (Don't always create a new ServiceWorker every time).
https://bugs.webkit.org/show_bug.cgi?id=179456

Reviewed by Chris Dumez.

No new tests (No behavior change yet).

* workers/service/ServiceWorkerRegistration.cpp:
(WebCore::ServiceWorkerRegistration::updateStateFromServer): Re-use a previous worker instead of always creating a new one.

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

3 years agoAdd Windows powershell EWS script
don.olmstead@sony.com [Thu, 9 Nov 2017 00:53:58 +0000 (00:53 +0000)]
Add Windows powershell EWS script
https://bugs.webkit.org/show_bug.cgi?id=179453

Reviewed by Brent Fulgham.

* EWSTools/Start-Queue.ps1: Added.

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

3 years agoXMLHttpRequest should not treat file URLs as same origin
bfulgham@apple.com [Thu, 9 Nov 2017 00:46:33 +0000 (00:46 +0000)]
XMLHttpRequest should not treat file URLs as same origin
https://bugs.webkit.org/show_bug.cgi?id=178565
<rdar://problem/11115901>

Reviewed by Daniel Bates.

Source/WebCore:

Based on a Blink patch by <jannhorn@googlemail.com>.
https://chromium.googlesource.com/chromium/src/+/c362e001551abc2bea392773f32eaf043d8bc29f

Test: security/cannot-read-self-from-file.html

* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::passesFileCheck const): Do not treat file as same-origin.

LayoutTests:

* security/cannot-read-self-from-file-expected.txt: Added.
* security/cannot-read-self-from-file.html: Added.
* security/resources/cannot-read-self-from-file.html: Added.

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

3 years agoMake WKFullScreenWidnowController more robust against modification by the embedding...
commit-queue@webkit.org [Thu, 9 Nov 2017 00:45:47 +0000 (00:45 +0000)]
Make WKFullScreenWidnowController more robust against modification by the embedding app.
https://bugs.webkit.org/show_bug.cgi?id=179413
rdar://problem/35408061

Patch by Jeremy Jones <jeremyj@apple.com> on 2017-11-08
Reviewed by Darin Adler.

Present fullscreen UViewController in a separate UIWindow to prevent interaction with the embedding app's
UIViewController hierarchy.

Immediately tear down the fullscreen interface if the embedding app removes the WKWebView from the fullscreen window.
This prevents the fullscreen interface from getting into an invalid state.

Preserve scrollView.zoomScale because it is not effectively preserved by the more indirect _viewScale.

Use a custom root view controller to allow hiding of the status bar.

Remove the no-longer-necessary dispatch_after calls during enter and exit fullscreen.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView removeFromSuperview]):
* UIProcess/ios/WKFullScreenWindowControllerIOS.h:
* UIProcess/ios/WKFullScreenWindowControllerIOS.mm:
(WebKit::WKWebViewState::applyTo):
(WebKit::WKWebViewState::store):
(-[_WKFullScreenViewController loadView]):
(-[_WKFullscreenRootViewController prefersStatusBarHidden]):
(-[WKFullScreenWindowController enterFullScreen]):
(-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
(-[WKFullScreenWindowController completedExitFullScreen]):
(-[WKFullScreenWindowController exitFullscreenImmediately]):
(-[WKFullScreenWindowController close]):
(-[WKFullScreenWindowController webViewDidRemoveFromSuperviewWhileInFullscreen]):
(-[_WKFullScreenViewController viewDidDisappear:]): Deleted.

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

3 years agoHTMLMediaElement should not use element fullscreen on iOS
commit-queue@webkit.org [Thu, 9 Nov 2017 00:43:35 +0000 (00:43 +0000)]
HTMLMediaElement should not use element fullscreen on iOS
https://bugs.webkit.org/show_bug.cgi?id=179418
rdar://problem/35409277

Patch by Jeremy Jones <jeremyj@apple.com> on 2017-11-08
Reviewed by Eric Carlson.

Add ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN to determine if HTMLMediaElement should use element full screen or not.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::enterFullscreen):

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@224607 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoWeb Inspector: Show Internal properties of PaymentRequest in Web Inspector Console
joepeck@webkit.org [Thu, 9 Nov 2017 00:36:15 +0000 (00:36 +0000)]
Web Inspector: Show Internal properties of PaymentRequest in Web Inspector Console
https://bugs.webkit.org/show_bug.cgi?id=179276

Reviewed by Andy Estes.

Source/JavaScriptCore:

* inspector/InjectedScriptHost.h:
* inspector/JSInjectedScriptHost.cpp:
(Inspector::JSInjectedScriptHost::getInternalProperties):
Call through to virtual implementation so that WebCore can provide custom
internal properties for Web / DOM objects.

Source/WebCore:

Test: http/tests/inspector/runtime/internal-properties-payment-request.https.html

* Modules/paymentrequest/PaymentRequest.h:
Expose access to internal state.

* inspector/WebInjectedScriptHost.h:
* inspector/WebInjectedScriptHost.cpp:
(WebCore::constructInternalProperty):
(WebCore::WebInjectedScriptHost::getInternalProperties):
Provide internal properties for a PaymentRequest.

* testing/Internals.cpp:
(WebCore::Internals::withUserGesture):
* testing/Internals.h:
* testing/Internals.idl:
Provide a simple way to run code inside of a user gesture.

Source/WebInspectorUI:

* UserInterface/Test.html:
* UserInterface/Test/FrontendTestHarness.js:
(FrontendTestHarness.prototype.evaluateInPage):
* UserInterface/Test/TestUtilities.js: Added.
(promisify):
Make async tests a little easier to work with by providing promises
in some cases that would normally take a callback.

LayoutTests:

* TestExpectations:
* platform/mac-wk2/TestExpectations:
Pass test on platforms that support Payment Requests.

* http/tests/inspector/paymentrequest/payment-request-internal-properties.https-expected.txt: Added.
* http/tests/inspector/paymentrequest/payment-request-internal-properties.https.html: Added.
Test for internal properties on PaymentRequest instances.

* resources/ui-helper.js:
(window.UIHelper.withUserGesture):
Provide an easier way to simulate work inside of a user gesture.

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

3 years agoMark many service worker tests as flaky on iOS.
ryanhaddad@apple.com [Thu, 9 Nov 2017 00:25:05 +0000 (00:25 +0000)]
Mark many service worker tests as flaky on iOS.
https://bugs.webkit.org/show_bug.cgi?id=179454

Unreviewed test gardening.

* platform/ios/TestExpectations:

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

3 years agoREGRESSION(r224534): Crash inside Document::updateStyleIfNeeded
rniwa@webkit.org [Wed, 8 Nov 2017 23:54:15 +0000 (23:54 +0000)]
REGRESSION(r224534): Crash inside Document::updateStyleIfNeeded
https://bugs.webkit.org/show_bug.cgi?id=179442

Reviewed by Simon Fraser.

Disable the assertion when the web thread is used.

* dom/Document.cpp:
(WebCore::Document::updateStyleIfNeeded):
(WebCore::Document::updateLayout):

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

3 years agoA JSFunction's ObjectAllocationProfile should watch the poly prototype watchpoint...
sbarati@apple.com [Wed, 8 Nov 2017 23:38:55 +0000 (23:38 +0000)]
A JSFunction's ObjectAllocationProfile should watch the poly prototype watchpoint so it can clear its object allocation profile
https://bugs.webkit.org/show_bug.cgi?id=177792

Reviewed by Yusuke Suzuki.

JSTests:

* microbenchmarks/poly-proto-clear-js-function-allocation-profile.js: Added.
(assert):
(foo.Foo.prototype.ensureX):
(foo.Foo):
(foo):
(access):

Source/JavaScriptCore:

Before this patch, if a JSFunction's rare data initialized its allocation profile
before its backing Executable's poly proto watchpoint was invalidated, that
JSFunction would continue to allocate non-poly proto objects until its allocation
profile was cleared (which essentially never happens in practice). This patch
improves on this pathology. A JSFunction's rare data will now watch the poly
proto watchpoint if it's still valid and clear its allocation profile when we
detect that we should go poly proto.

* bytecode/ObjectAllocationProfile.h:
* bytecode/ObjectAllocationProfileInlines.h:
(JSC::ObjectAllocationProfile::initializeProfile):
* runtime/FunctionRareData.cpp:
(JSC::FunctionRareData::initializeObjectAllocationProfile):
(JSC::FunctionRareData::AllocationProfileClearingWatchpoint::fireInternal):
* runtime/FunctionRareData.h:
(JSC::FunctionRareData::hasAllocationProfileClearingWatchpoint const):
(JSC::FunctionRareData::createAllocationProfileClearingWatchpoint):
(JSC::FunctionRareData::AllocationProfileClearingWatchpoint::AllocationProfileClearingWatchpoint):

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

3 years agoSource/WebCore:
commit-queue@webkit.org [Wed, 8 Nov 2017 23:22:32 +0000 (23:22 +0000)]
Source/WebCore:
Added mime type check to the picture source preloader to avoid downloading incompatible resources.
https://bugs.webkit.org/show_bug.cgi?id=179231

Patch by Colin Bendell <colin@bendell.ca> on 2017-11-08
Reviewed by Alex Christensen.

Test: http/tests/loading/preload-picture-type.html

* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::StartTagScanner::processAttributes): include type match state when selecting candidate imgs
(WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): added type attribute evaluation and matching

LayoutTests:
Add tests to ensure that <source> tags are only preloaded when the `type`
attribute matches.
https://bugs.webkit.org/show_bug.cgi?id=179231

Patch by Colin Bendell <colin@bendell.ca> on 2017-11-08
Reviewed by Alex Christensen.

The actual execution of the test is a bit racy because of the need to refresh
the browser to change the DPR. Should also move the other testHad to move the tests to /preload (instead of tests/loading with the other
picture tests) to avoid the logging from

* http/tests/preload/picture-type-expected.txt: Added.
* http/tests/preload/picture-type.html: Added.

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

3 years agoSome SW Container and Registration tweaks.
beidson@apple.com [Wed, 8 Nov 2017 23:15:03 +0000 (23:15 +0000)]
Some SW Container and Registration tweaks.
https://bugs.webkit.org/show_bug.cgi?id=179450

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* web-platform-tests/service-workers/service-worker/claim-with-redirect.https-expected.txt:

Source/WebCore:

No new tests (Progression in an existing test).

* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
* workers/service/ServiceWorkerRegistration.cpp:
(WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration):

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

3 years agoMove inlineElementContinuation function to RenderBoxModelObject and rename to inlineC...
antti@apple.com [Wed, 8 Nov 2017 23:13:42 +0000 (23:13 +0000)]
Move inlineElementContinuation function to RenderBoxModelObject and rename to inlineContinuation
https://bugs.webkit.org/show_bug.cgi?id=179437

Reviewed by Zalan Bujtas.

Unify RenderInline::inlineElementContinuation and RenderBlock::inlineElementContinuation.
It is simply a function to find the next RenderInline in the continuation chain.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::lastChildConsideringContinuation):
(WebCore::startOfContinuations):
(WebCore::endOfContinuations):
(WebCore::childBeforeConsideringContinuations):
(WebCore::AccessibilityRenderObject::nextSibling const):
(WebCore::nextContinuation):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintObject):
(WebCore::RenderBlock::absoluteRects const):
(WebCore::RenderBlock::addFocusRingRects):
(WebCore::RenderBlock::inlineElementContinuation const): Deleted.
* rendering/RenderBlock.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::accumulateInFlowPositionOffsets):
(WebCore::RenderBoxModelObject::inlineContinuation const):
* rendering/RenderBoxModelObject.h:
* rendering/RenderInline.cpp:
(WebCore::updateStyleOfAnonymousBlockContinuations):
(WebCore::RenderInline::styleDidChange):
(WebCore::nextContinuation):
(WebCore::RenderInline::positionForPoint):
(WebCore::RenderInline::inlineElementContinuation const): Deleted.
* rendering/RenderInline.h:
* rendering/line/LineInlineHeaders.h:
(WebCore::hasInlineDirectionBordersPaddingOrMargin):

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

3 years agoMark test262.yaml/test262/test/language/statements/try/tco-catch.js as passing.
ryanhaddad@apple.com [Wed, 8 Nov 2017 23:11:56 +0000 (23:11 +0000)]
Mark test262.yaml/test262/test/language/statements/try/tco-catch.js as passing.
https://bugs.webkit.org/show_bug.cgi?id=178592

Unreviewed test gardening.

* test262.yaml:

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

3 years ago[ios-simulator] API test WebKit.BundleParameters is a flaky failure
timothy_horton@apple.com [Wed, 8 Nov 2017 22:50:59 +0000 (22:50 +0000)]
[ios-simulator] API test WebKit.BundleParameters is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=178363
<rdar://problem/35043144>

Reviewed by Brent Fulgham.

* wtf/RefCounter.h:
(WTF::RefCounter<T>::Count::deref):
(WTF::RefCounter<T>::Count::refCounterWasDeleted):
(WTF::RefCounter<T>::~RefCounter):
If a RefCounter::Count is deref()'d and drops its RefCounter's value to
zero, and the RefCounter is deleted in that valueDidChangeCallback, it
will delete the Counter that is in the middle of deref(). Keep track
of whether we're inside the callback and defer the deletion until
the end of deref().

* TestWebKitAPI/Tests/WTF/RefCounter.cpp:
(TestWebKitAPI::TEST):
Add a test.

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

3 years agoWeb Inspector: Eliminate unnecessary hash lookups with NetworkResourceData
commit-queue@webkit.org [Wed, 8 Nov 2017 22:01:15 +0000 (22:01 +0000)]
Web Inspector: Eliminate unnecessary hash lookups with NetworkResourceData
https://bugs.webkit.org/show_bug.cgi?id=179361

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-11-08
Reviewed by Brian Burg.

* inspector/NetworkResourcesData.h:
(WebCore::NetworkResourcesData::ResourceData::setURL):
(WebCore::NetworkResourcesData::ResourceData::setUrl): Deleted.
Drive-by fix the name `setUrl` to `setURL`.

* inspector/NetworkResourcesData.h:
Store unique_ptrs in the HashMap.

* inspector/NetworkResourcesData.cpp:
(WebCore::NetworkResourcesData::resourceCreated):
(WebCore::NetworkResourcesData::responseReceived):
Create new versions of methods that combine two operations.

(WebCore::NetworkResourcesData::removeCachedResource):
(WebCore::NetworkResourcesData::clear):
(WebCore::NetworkResourcesData::ensureNoDataForRequestId):
Handle unique_ptrs in the HashMap.

* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::frameIdentifier):
(WebCore::InspectorNetworkAgent::willSendRequest):
(WebCore::InspectorNetworkAgent::didReceiveResponse):
(WebCore::InspectorNetworkAgent::didFailLoading):
Use the new version of operations to avoid multiple lookups.

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

3 years agoWeb Inspector: fix incorrect curly quote orientation in a UIString
bburg@apple.com [Wed, 8 Nov 2017 21:48:13 +0000 (21:48 +0000)]
Web Inspector: fix incorrect curly quote orientation in a UIString
https://bugs.webkit.org/show_bug.cgi?id=179353
<rdar://problem/35368697>

Reviewed by Joseph Pecoraro.

I didn't see any other instances of this mistake in our localized strings.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Views/ResourceTimelineDataGridNode.js:
Fix it.

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

3 years agoAdd super sampler begin and end bytecodes.
keith_miller@apple.com [Wed, 8 Nov 2017 21:26:33 +0000 (21:26 +0000)]
Add super sampler begin and end bytecodes.
https://bugs.webkit.org/show_bug.cgi?id=179376

Reviewed by Filip Pizlo.

This patch adds a way to measure a narrow range of bytecodes for
performance. This is done using the same infrastructure as the
super sampler. I also added a class that helps do the bytecode
checking with RAII. One problem with the current way this is done
is that we don't handle decrementing early exits, either from
branches or exceptions. So, when using this API users need to
ensure that there are no early exits or that those exits don't
occur on the measure code.

* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/BytecodeDumper.cpp:
(JSC::BytecodeDumper<Block>::dumpBytecode):
* bytecode/BytecodeList.json:
* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitSuperSamplerBegin):
(JSC::BytecodeGenerator::emitSuperSamplerEnd):
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/SuperSamplerBytecodeScope.h: Added.
(JSC::SuperSamplerBytecodeScope::SuperSamplerBytecodeScope):
(JSC::SuperSamplerBytecodeScope::~SuperSamplerBytecodeScope):
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGClobbersExitState.cpp:
(JSC::DFG::clobbersExitState):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGMayExit.cpp:
* dfg/DFGNodeType.h:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileSuperSamplerBegin):
(JSC::FTL::DFG::LowerDFGToB3::compileSuperSamplerEnd):
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
* jit/JIT.h:
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_super_sampler_begin):
(JSC::JIT::emit_op_super_sampler_end):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* llint/LLIntSlowPaths.h:
* llint/LowLevelInterpreter.asm:

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

3 years ago[Attachment Support] Implement delegate hooks for attachment element insertion and...
wenson_hsieh@apple.com [Wed, 8 Nov 2017 21:10:00 +0000 (21:10 +0000)]
[Attachment Support] Implement delegate hooks for attachment element insertion and removal
https://bugs.webkit.org/show_bug.cgi?id=179016
<rdar://problem/35250890>

Reviewed by Tim Horton.

Source/WebCore:

Relanding this patch with a tweaked API test. WKAttachmentTests.AttachmentUpdatesWhenChangingFontStyles, in its
original form, hit a debug assertion and exposed an existing bug related to EditingStyles and text decoration.
After some investigation, this debug assertion is unrelated to the attachment logic introduced here; see
<https://bugs.webkit.org/show_bug.cgi?id=179431> for additional analysis, and several proposed fixes.

* editing/Editor.cpp:
(WebCore::Editor::respondToChangedSelection):
(WebCore::Editor::editorUIUpdateTimerFired):
(WebCore::Editor::scheduleEditorUIUpdate):
(WebCore::Editor::didInsertAttachmentElement):
(WebCore::Editor::didRemoveAttachmentElement):
(WebCore::Editor::notifyClientOfAttachmentUpdates):
(WebCore::Editor::insertAttachmentFromFile):
* editing/Editor.h:
* html/HTMLAttachmentElement.cpp:
(WebCore::HTMLAttachmentElement::HTMLAttachmentElement):
(WebCore::HTMLAttachmentElement::insertedIntoAncestor):
(WebCore::HTMLAttachmentElement::removedFromAncestor):
(WebCore::HTMLAttachmentElement::uniqueIdentifier const):
(WebCore::HTMLAttachmentElement::setUniqueIdentifier):
* html/HTMLAttachmentElement.h:
* html/HTMLAttributeNames.in:
* page/EditorClient.h:
(WebCore::EditorClient::didInsertAttachment):
(WebCore::EditorClient::didRemoveAttachment):

Source/WebKit:

See WebCore/ChangeLog for more details.

* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _didInsertAttachment:]):
(-[WKWebView _didRemoveAttachment:]):
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/Cocoa/PageClientImplCocoa.h:
* UIProcess/Cocoa/PageClientImplCocoa.mm:
(WebKit::PageClientImplCocoa::didInsertAttachment):
(WebKit::PageClientImplCocoa::didRemoveAttachment):
* UIProcess/PageClient.h:
(WebKit::PageClient::didInsertAttachment):
(WebKit::PageClient::didRemoveAttachment):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didInsertAttachment):
(WebKit::WebPageProxy::didRemoveAttachment):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::didInsertAttachment):
(WebKit::WebEditorClient::didRemoveAttachment):
* WebProcess/WebCoreSupport/WebEditorClient.h:

Tools:

See WebCore/ChangeLog for more details.

* TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm:
(-[AttachmentUpdateObserver init]):
(-[AttachmentUpdateObserver inserted]):
(-[AttachmentUpdateObserver removed]):
(-[AttachmentUpdateObserver _webView:didInsertAttachment:]):
(-[AttachmentUpdateObserver _webView:didRemoveAttachment:]):
(TestWebKitAPI::ObserveAttachmentUpdatesForScope::ObserveAttachmentUpdatesForScope):
(TestWebKitAPI::ObserveAttachmentUpdatesForScope::~ObserveAttachmentUpdatesForScope):
(TestWebKitAPI::ObserveAttachmentUpdatesForScope::observer const):
(TestWebKitAPI::ObserveAttachmentUpdatesForScope::expectAttachmentUpdates):
(-[TestWKWebView _synchronouslyExecuteEditCommand:argument:]):
(-[TestWKWebView expectUpdatesAfterCommand:withArgument:expectedRemovals:expectedInsertions:]):
(TestWebKitAPI::TEST):

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

3 years agoTurn recursive tail calls into loops
rmorisset@apple.com [Wed, 8 Nov 2017 20:42:15 +0000 (20:42 +0000)]
Turn recursive tail calls into loops
https://bugs.webkit.org/show_bug.cgi?id=176601

Reviewed by Saam Barati.

Relanding after https://bugs.webkit.org/show_bug.cgi?id=178834.

JSTests:

Add some simple test that computes factorial in several ways, and other trivial computations.
They all tests the case where foo calls bar (in an inlineable way) that then does a tail call.
Depending on the nature of both calls, it is possible or not to turn the tail call into a loop.
I have no clear way of checking that the call was indeed transformed, but I can check that the code computes the right result
(which it doesn't if that tail call is transformed into a loop in the unsound cases).

* stress/inline-call-to-recursive-tail-call.js: Added.
(factorial.aux):
(factorial):
(factorial2.aux2):
(factorial2.id):
(factorial2):
(factorial3.aux3):
(factorial3):
(aux4):
(factorial4):
(foo):
(auxBar):
(bar):
(test):

Source/JavaScriptCore:

We want to turn recursive tail calls into loops early in the pipeline, so that the loops can then be optimized.
One difficulty is that we need to split the entry block of the function we are jumping to in order to have somewhere to jump to.
Worse: it is not necessarily the first block of the codeBlock, because of inlining! So we must do the splitting in the DFGByteCodeParser, at the same time as inlining.
We do this part through modifying the computation of the jump targets.
Importantly, we only do this splitting for functions that have tail calls.
It is the only case where the optimisation is sound, and doing the splitting unconditionnaly destroys performance on Octane/raytrace.

We must then do the actual transformation also in DFGByteCodeParser, to avoid code motion moving code out of the body of what will become a loop.
The transformation is entirely contained in handleRecursiveTailCall, which is hooked to the inlining machinery.

* bytecode/CodeBlock.h:
(JSC::CodeBlock::hasTailCalls const):
* bytecode/PreciseJumpTargets.cpp:
(JSC::getJumpTargetsForBytecodeOffset):
(JSC::computePreciseJumpTargetsInternal):
* bytecode/UnlinkedCodeBlock.cpp:
(JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):
* bytecode/UnlinkedCodeBlock.h:
(JSC::UnlinkedCodeBlock::hasTailCalls const):
(JSC::UnlinkedCodeBlock::setHasTailCalls):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitEnter):
(JSC::BytecodeGenerator::emitCallInTailPosition):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::allocateTargetableBlock):
(JSC::DFG::ByteCodeParser::makeBlockTargetable):
(JSC::DFG::ByteCodeParser::handleCall):
(JSC::DFG::ByteCodeParser::handleRecursiveTailCall):
(JSC::DFG::ByteCodeParser::parseBlock):
(JSC::DFG::ByteCodeParser::parse):

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

3 years agoSimplify ServiceWorkerContainer::jobResolvedWithRegistration()
cdumez@apple.com [Wed, 8 Nov 2017 20:02:58 +0000 (20:02 +0000)]
Simplify ServiceWorkerContainer::jobResolvedWithRegistration()
https://bugs.webkit.org/show_bug.cgi?id=179429

Reviewed by Brady Eidson.

* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):

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

3 years ago[Service Workers] Make sure SWServerRegistration update functions always message...
cdumez@apple.com [Wed, 8 Nov 2017 20:02:24 +0000 (20:02 +0000)]
[Service Workers] Make sure SWServerRegistration update functions always message back the connection that scheduled the job
https://bugs.webkit.org/show_bug.cgi?id=179428

Reviewed by Brady Eidson.

* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::install):
(WebCore::SWServerJobQueue::didFinishInstall):
* workers/service/server/SWServerRegistration.cpp:
(WebCore::SWServerRegistration::updateRegistrationState):
(WebCore::SWServerRegistration::updateWorkerState):
(WebCore::SWServerRegistration::fireUpdateFoundEvent):
(WebCore::SWServerRegistration::firePostInstallEvents):
(WebCore::SWServerRegistration::forEachConnection):
* workers/service/server/SWServerRegistration.h:

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

3 years agoiOS supports some text encodings supposedly due to lack of TEC that aren't supported...
mjs@apple.com [Wed, 8 Nov 2017 19:35:18 +0000 (19:35 +0000)]
iOS supports some text encodings supposedly due to lack of TEC that aren't supported by the TEC decoder on macOS
https://bugs.webkit.org/show_bug.cgi?id=179309

Reviewed by Darin Adler.

Source/WebCore:

Test: fast/encoding/legacy-ios-encodings.html

* platform/text/TextCodecICU.cpp:
(WebCore::TextCodecICU::registerEncodingNames): Remove most iOS-specific adding of names, leaving only softbank-sjis.
Most were either redundant or unnecessary.
(WebCore::TextCodecICU::registerCodecs): ditto

LayoutTests:

* fast/encoding/legacy-ios-encodings-expected.txt: Added.
* fast/encoding/legacy-ios-encodings.html: Added. Check that we don't support some old iOS-only encoding names
and check for some nonstandard encoding names that we do support (for now).

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

3 years agoGigacage.cpp:44:46: warning: ‘*’ in boolean context, suggest ‘&&’ instead [-Wint...
mcatanzaro@igalia.com [Wed, 8 Nov 2017 19:30:36 +0000 (19:30 +0000)]
Gigacage.cpp:44:46: warning: ‘*’ in boolean context, suggest ‘&&’ instead [-Wint-in-bool-context]
https://bugs.webkit.org/show_bug.cgi?id=179427

Reviewed by Saam Barati.

Tweak the conditional to suppress the warning.

* bmalloc/Gigacage.cpp:
(Gigacage::ensureGigacage):

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

3 years agoUnreviewed. Attempting to unbork the WinCairo bot after r224578.
zandobersek@gmail.com [Wed, 8 Nov 2017 19:08:48 +0000 (19:08 +0000)]
Unreviewed. Attempting to unbork the WinCairo bot after r224578.

* platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h:
Add a missing semicolon after the deafult initialization of a member
variable in the GraphicsContextPlatformPrivate class.

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

3 years agoWeb Inspector: Remove unused Page.ScriptIdentifier protocol type
commit-queue@webkit.org [Wed, 8 Nov 2017 18:32:24 +0000 (18:32 +0000)]
Web Inspector: Remove unused Page.ScriptIdentifier protocol type
https://bugs.webkit.org/show_bug.cgi?id=179407

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-11-08
Reviewed by Matt Baker.

Source/JavaScriptCore:

* inspector/protocol/Page.json:
Remove unused protocol type.

Source/WebInspectorUI:

* Versions/Inspector-iOS-10.0.json:
* Versions/Inspector-iOS-10.3.json:
* Versions/Inspector-iOS-11.0.json:
* Versions/Inspector-iOS-7.0.json:
* Versions/Inspector-iOS-8.0.json:
* Versions/Inspector-iOS-9.0.json:
* Versions/Inspector-iOS-9.3.json:
Remove unused protocol type.

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

3 years agoSwitch encoding WPT test suite to updating via import-w3c-tests
mjs@apple.com [Wed, 8 Nov 2017 17:44:39 +0000 (17:44 +0000)]
Switch encoding WPT test suite to updating via import-w3c-tests
https://bugs.webkit.org/show_bug.cgi?id=179412

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

* resources/import-expectations.json: Import encoding tests instead of skipping.
* web-platform-tests/encoding/eof-utf-8-one-expected.html: Added.
* web-platform-tests/encoding/eof-utf-8-three-expected.html: Added.
* web-platform-tests/encoding/eof-utf-8-two-expected.html: Added.
* web-platform-tests/encoding/legacy-mb-japanese/shift_jis/w3c-import.log: Added.
* web-platform-tests/encoding/legacy-mb-korean/euc-kr/w3c-import.log: Added.
* web-platform-tests/encoding/legacy-mb-tchinese/big5/w3c-import.log: Added.
* web-platform-tests/encoding/resources/w3c-import.log: Added.
* web-platform-tests/encoding/textdecoder-copy.any-expected.txt: Added.
* web-platform-tests/encoding/textdecoder-copy.any.html: Added.
* web-platform-tests/encoding/textdecoder-copy.any.worker-expected.txt: Added.
* web-platform-tests/encoding/textdecoder-copy.any.worker.html: Added.
* web-platform-tests/encoding/textdecoder-labels-expected.txt.rej: Added.
* web-platform-tests/encoding/textencoder-constructor-non-utf-expected.txt.rej: Added.
* web-platform-tests/encoding/w3c-import.log: Added.

LayoutTests:

* TestExpectations: Remove mention of slow encoding tests here...
* tests-options.json: ...because they are now recorded here.

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

3 years ago[Service Workers] Support waitUntil() on the 'install' event
cdumez@apple.com [Wed, 8 Nov 2017 17:26:22 +0000 (17:26 +0000)]
[Service Workers] Support waitUntil() on the 'install' event
https://bugs.webkit.org/show_bug.cgi?id=179396

Reviewed by Brady Eidson.

LayoutTests/imported/w3c:

Rebaseline a few WPT tests.

* web-platform-tests/service-workers/service-worker/oninstall-script-error.https-expected.txt:
* web-platform-tests/service-workers/service-worker/register-wait-forever-in-install-worker.https-expected.txt:

Source/WebCore:

Support waitUntil() on the 'install' event:
- https://w3c.github.io/ServiceWorker/#installation-algorithm (step 10.4)
- https://w3c.github.io/ServiceWorker/#wait-until-method

Tests: http/tests/workers/service/basic-install-event-waitUntil-multiple-promises.html
       http/tests/workers/service/basic-install-event-waitUntil-reject.html
       http/tests/workers/service/basic-install-event-waitUntil-resolve.html

* testing/Internals.cpp:
* testing/Internals.h:
* testing/Internals.idl:
* workers/service/ExtendableEvent.cpp:
(WebCore::ExtendableEvent::waitUntil):
(WebCore::ExtendableEvent::addExtendLifetimePromise):
(WebCore::ExtendableEvent::whenAllExtendLifetimePromisesAreSettled):
* workers/service/ExtendableEvent.h:
(WebCore::ExtendableEvent::pendingPromiseCount const):
* workers/service/FetchEvent.cpp:
(WebCore::FetchEvent::respondWith):
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::addRegistration):
(WebCore::ServiceWorkerContainer::removeRegistration):
* workers/service/ServiceWorkerContainer.h:
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::fireInstallEvent):
* workers/service/server/SWClientConnection.h:
* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::didFinishInstall):
* workers/service/server/SWServerRegistration.cpp:
(WebCore::SWServerRegistration::firePostInstallEvents):

LayoutTests:

Add layout test coverage.

* http/tests/workers/service/basic-install-event-waitUntil-multiple-promises-expected.txt: Added.
* http/tests/workers/service/basic-install-event-waitUntil-multiple-promises.html: Added.
* http/tests/workers/service/basic-install-event-waitUntil-reject-expected.txt: Added.
* http/tests/workers/service/basic-install-event-waitUntil-reject.html: Added.
* http/tests/workers/service/basic-install-event-waitUntil-resolve-expected.txt: Added.
* http/tests/workers/service/basic-install-event-waitUntil-resolve.html: Added.
* http/tests/workers/service/resources/basic-install-event-waitUntil-multiple-promises-worker.js: Added.
(event.i.event.waitUntil.new.Promise):
* http/tests/workers/service/resources/basic-install-event-waitUntil-reject-worker.js: Added.
(event.event.waitUntil.new.Promise):
* http/tests/workers/service/resources/basic-install-event-waitUntil-resolve-worker.js: Added.
(event.event.waitUntil.new.Promise):
* http/wpt/service-workers/extendableEvent.https-expected.txt:
* http/wpt/service-workers/extendableEvent.https.html:

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

3 years agoRemove Element::isInlineElementContinuation
antti@apple.com [Wed, 8 Nov 2017 16:39:02 +0000 (16:39 +0000)]
Remove Element::isInlineElementContinuation
https://bugs.webkit.org/show_bug.cgi?id=179425

Reviewed by Zalan Bujtas.

It is really just isInline+isContinuation test and most callers know it is an inline already.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::firstChildConsideringContinuation):
(WebCore::startOfContinuations):
(WebCore::firstChildIsInlineContinuation):
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::determineSpacingForFlowBoxes):
(WebCore::InlineFlowBox::paint):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::addContinuationWithOutline):
* rendering/RenderElement.h:
(WebCore::RenderElement::setIsContinuation):
(WebCore::RenderElement::isElementContinuation const): Deleted.
(WebCore::RenderElement::isInlineElementContinuation const): Deleted.
* rendering/RenderInline.cpp:
(WebCore::RenderInline::willBeDestroyed):
(WebCore::RenderInline::updateHitTestResult):
* rendering/line/LineInlineHeaders.h:
(WebCore::hasInlineDirectionBordersPaddingOrMargin):

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

3 years ago[Experiment] Implement code to detect high frequency painting
hyatt@apple.com [Wed, 8 Nov 2017 16:11:55 +0000 (16:11 +0000)]
[Experiment] Implement code to detect high frequency painting
https://bugs.webkit.org/show_bug.cgi?id=179118
Source/WebCore:

<rdar://problem/35347068>

Reviewed by Simon Fraser.

This patch implements a model for detecting that objects whose
graphics resources we want to cache (like glyphs or paths) are painting
frequently enough that it's worth taking the memory hit to cache them.

Paint frequency detection is done at the self-painting RenderLayer level, since
a lower level of granularity (e.g., per-RenderObject) would be too memory-intensive.

* rendering/PaintInfo.h:
(WebCore::PaintInfo::PaintInfo):
(WebCore::PaintInfo::enclosingSelfPaintingLayer):
Add the enclosing self-painting layer that is currently painting to the PaintInfo
so that objects that have cachaeble graphics resources can notify the layer when
they actually paint them.

* rendering/RenderLayer.cpp:
(WebCore::PaintFrequencyInfo::PaintFrequencyInfo):
(WebCore::PaintFrequencyInfo::paintingFrequently const):
(WebCore::PaintFrequencyInfo::updatePaintFrequency):
(WebCore::PaintFrequencyInfo::paintingCacheableResource):
RenderLayers have a pointer to PaintFrequencyInfo that is allocated once you've
painted cachaeble resources.

(WebCore::RenderLayer::paintLayerContents):
(WebCore::RenderLayer::paintBackgroundForFragments):
(WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
(WebCore::RenderLayer::paintOutlineForFragments):
(WebCore::RenderLayer::paintMaskForFragments):
(WebCore::RenderLayer::paintChildClippingMaskForFragments):
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderLayer.h:
Patch to pass the layer with the PaintInfo.

* testing/Internals.cpp:
(WebCore::Internals::isPaintingFrequently):
(WebCore::Internals::incrementFrequentPaintCounter):
* testing/Internals.h:
* testing/Internals.idl:
Test methods for making layout tests to ensure we go into the mode properly.

LayoutTests:

Reviewed by Simon Fraser.

* fast/block/block-move-frequent-paint-expected.txt: Added.
* fast/block/block-move-frequent-paint.html: Added.

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

3 years agoUpdate XMLHttpRequest tests.
Ms2ger@igalia.com [Wed, 8 Nov 2017 16:00:18 +0000 (16:00 +0000)]
Update XMLHttpRequest tests.
https://bugs.webkit.org/show_bug.cgi?id=179421

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

* resources/import-expectations.json: enabled some more tests
* web-platform-tests/XMLHttpRequest/abort-during-done.htm:
* web-platform-tests/XMLHttpRequest/abort-during-headers-received.htm:
* web-platform-tests/XMLHttpRequest/abort-during-loading.htm:
* web-platform-tests/XMLHttpRequest/open-after-abort.htm:
* web-platform-tests/XMLHttpRequest/open-url-multi-window-2-expected.txt:
* web-platform-tests/XMLHttpRequest/open-url-multi-window-2.htm:
* web-platform-tests/XMLHttpRequest/open-url-multi-window-3-expected.txt:
* web-platform-tests/XMLHttpRequest/open-url-multi-window-3.htm:
* web-platform-tests/XMLHttpRequest/open-url-multi-window-4.htm:
* web-platform-tests/XMLHttpRequest/open-url-multi-window-6.htm:
* web-platform-tests/XMLHttpRequest/open-url-redirected-worker-origin-expected.txt:
* web-platform-tests/XMLHttpRequest/open-url-redirected-worker-origin.htm:
* web-platform-tests/XMLHttpRequest/open-url-worker-origin-expected.txt: Added.
* web-platform-tests/XMLHttpRequest/open-url-worker-origin.htm: Added.
* web-platform-tests/XMLHttpRequest/overridemimetype-open-state-force-xml.htm:
* web-platform-tests/XMLHttpRequest/resources/workerxhr-origin-referrer.js:
* web-platform-tests/XMLHttpRequest/resources/workerxhr-simple.js:
* web-platform-tests/XMLHttpRequest/resources/xmlhttprequest-timeout-simple.js:
* web-platform-tests/XMLHttpRequest/resources/xmlhttprequest-timeout-synconmain.js:
* web-platform-tests/XMLHttpRequest/resources/xmlhttprequest-timeout-synconworker.js:
* web-platform-tests/XMLHttpRequest/resources/xmlhttprequest-timeout-twice.js:
* web-platform-tests/XMLHttpRequest/resources/xmlhttprequest-timeout.js:
* web-platform-tests/XMLHttpRequest/responsedocument-decoding.htm:
* web-platform-tests/XMLHttpRequest/send-authentication-basic-cors-expected.txt: Added.
* web-platform-tests/XMLHttpRequest/send-authentication-basic-cors.htm: Added.
* web-platform-tests/XMLHttpRequest/send-authentication-basic-repeat-no-args-expected.txt: Added.
* web-platform-tests/XMLHttpRequest/send-authentication-basic-repeat-no-args.htm: Added.
* web-platform-tests/XMLHttpRequest/send-authentication-basic-setrequestheader.htm: Added.
* web-platform-tests/XMLHttpRequest/send-authentication-basic.htm: Added.
* web-platform-tests/XMLHttpRequest/send-authentication-competing-names-passwords-expected.txt: Added.
* web-platform-tests/XMLHttpRequest/send-authentication-competing-names-passwords.htm: Added.
* web-platform-tests/XMLHttpRequest/send-entity-body-basic-expected.txt: Added.
* web-platform-tests/XMLHttpRequest/send-entity-body-basic.htm: Added.
* web-platform-tests/XMLHttpRequest/send-entity-body-document-expected.txt:
* web-platform-tests/XMLHttpRequest/send-entity-body-document.htm:
* web-platform-tests/XMLHttpRequest/send-entity-body-get-head-async.htm:
* web-platform-tests/XMLHttpRequest/send-entity-body-get-head.htm:
* web-platform-tests/XMLHttpRequest/send-network-error-async-events.sub-expected.txt: Added.
* web-platform-tests/XMLHttpRequest/send-network-error-async-events.sub.htm: Added.
* web-platform-tests/XMLHttpRequest/send-redirect-infinite.htm:
* web-platform-tests/XMLHttpRequest/send-redirect-no-location.htm:
* web-platform-tests/XMLHttpRequest/send-redirect-post-upload.htm:
* web-platform-tests/XMLHttpRequest/setrequestheader-after-send.htm:
* web-platform-tests/XMLHttpRequest/setrequestheader-before-open.htm:
* web-platform-tests/XMLHttpRequest/w3c-import.log:
* web-platform-tests/XMLHttpRequest/xmlhttprequest-timeout-reused.html:
* web-platform-tests/XMLHttpRequest/xmlhttprequest-unsent.htm:

LayoutTests:

* TestExpectations: removed flaky expectation: the test was fixed upstream.

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

3 years ago[WPE] Turn on ENABLE_INDEXED_DATABASE_IN_WORKERS
mcatanzaro@igalia.com [Wed, 8 Nov 2017 15:53:41 +0000 (15:53 +0000)]
[WPE] Turn on ENABLE_INDEXED_DATABASE_IN_WORKERS
https://bugs.webkit.org/show_bug.cgi?id=179094

Reviewed by Carlos Alberto Lopez Perez.

* Source/cmake/OptionsWPE.cmake:

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

3 years ago[LayoutState cleanup] Make public data members private.
zalan@apple.com [Wed, 8 Nov 2017 15:02:10 +0000 (15:02 +0000)]
[LayoutState cleanup] Make public data members private.
https://bugs.webkit.org/show_bug.cgi?id=179409
<rdar://problem/35406184>

Reviewed by Sam Weinig.

No change in functionality.

* page/LayoutContext.cpp:
(WebCore::LayoutContext::layoutDelta const):
(WebCore::LayoutContext::addLayoutDelta):
(WebCore::LayoutContext::layoutDeltaMatches):
(WebCore::LayoutContext::pushLayoutStateForPaginationIfNeeded):
* rendering/LayoutState.cpp:
(WebCore::LayoutState::LayoutState):
(WebCore::LayoutState::addLayoutDelta):
(WebCore::LayoutState::layoutDeltaMatches):
* rendering/LayoutState.h:
(WebCore::LayoutState::setIsPaginated):
(WebCore::LayoutState::setPageLogicalHeight):
(WebCore::LayoutState::paintOffset const):
(WebCore::LayoutState::renderer const):
(WebCore::LayoutState::clipRect const):
(WebCore::LayoutState::isClipped const):
(WebCore::LayoutState::layoutDelta const):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::offsetFromLogicalTopOfFirstPage const):
(WebCore::RenderBlock::childBoxIsUnsplittableForFragmentation const):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutBlock):
(WebCore::RenderBlockFlow::applyBeforeBreak):
(WebCore::RenderBlockFlow::applyAfterBreak):
(WebCore::RenderBlockFlow::pageLogicalTopForOffset const):
(WebCore::RenderBlockFlow::pageLogicalHeightForOffset const):
(WebCore::RenderBlockFlow::pageRemainingLogicalHeightForOffset const):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::mapLocalToContainer const):
(WebCore::RenderBox::computeRectForRepaint const):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::computeRectForRepaint const):
(WebCore::RenderInline::mapLocalToContainer const):

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

3 years ago[Cairo] Improve PlatformContextCairo lifetime management in GraphicsContextPlatformPr...
zandobersek@gmail.com [Wed, 8 Nov 2017 13:55:46 +0000 (13:55 +0000)]
[Cairo] Improve PlatformContextCairo lifetime management in GraphicsContextPlatformPrivate
https://bugs.webkit.org/show_bug.cgi?id=179424

Reviewed by Carlos Garcia Campos.

When the PlatformContextCairo object is owned by GraphicsContextPlatformPrivate,
the latter should hold it in a std::unique_ptr<>. When PlatformContextCairo is
not owned, the std::unique_ptr<> should remain null, and the PlatformContextCairo
reference should point to the externally-managed object.

A new GraphicsContextPlatformPrivate constructor accepts a std::unique_ptr<> that
manages a PlatformContextCairo object and moves it into the member variable, tying
lifetime of that PlatformContextCairo object to the private object.

This enables dropping the GraphicsContextPlatformPrivateToplevel class, and the
virtual table is no longer required. Small cleanups to the remaining class are
also performed.

No new tests -- no changes in behavior.

* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::GraphicsContext):
(WebCore::GraphicsContext::platformInit):
(WebCore::GraphicsContext::platformContext const):
* platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h:
(WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
(WebCore::GraphicsContextPlatformPrivate::save):
(WebCore::GraphicsContextPlatformPrivate::restore):
(WebCore::GraphicsContextPlatformPrivate::flush):
(WebCore::GraphicsContextPlatformPrivate::clip):
(WebCore::GraphicsContextPlatformPrivate::scale):
(WebCore::GraphicsContextPlatformPrivate::rotate):
(WebCore::GraphicsContextPlatformPrivate::translate):
(WebCore::GraphicsContextPlatformPrivate::concatCTM):
(WebCore::GraphicsContextPlatformPrivate::setCTM):
(WebCore::GraphicsContextPlatformPrivate::~GraphicsContextPlatformPrivate): Deleted.
(WebCore::GraphicsContextPlatformPrivateToplevel::GraphicsContextPlatformPrivateToplevel): Deleted.
(WebCore::GraphicsContextPlatformPrivateToplevel::~GraphicsContextPlatformPrivateToplevel): Deleted.
* platform/graphics/win/GraphicsContextCairoWin.cpp:
(WebCore::GraphicsContext::platformInit):

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

3 years ago[Cairo] Move transparency layers Vector to PlatformContextCairo
zandobersek@gmail.com [Wed, 8 Nov 2017 13:37:51 +0000 (13:37 +0000)]
[Cairo] Move transparency layers Vector to PlatformContextCairo
https://bugs.webkit.org/show_bug.cgi?id=179420

Reviewed by Carlos Garcia Campos.

Move the Vector of transparency layer float values from the
GraphicsContextPlatformPrivate class to PlatformContextCairo.
It fits better there since it's a platform-specific context
state, just like e.g. the ShadowBlur member.

No new tests -- no change in behavior.

* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::beginPlatformTransparencyLayer):
(WebCore::GraphicsContext::endPlatformTransparencyLayer):
* platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h:
* platform/graphics/cairo/PlatformContextCairo.h:
(WebCore::PlatformContextCairo::layers):
* platform/graphics/win/GraphicsContextCairoWin.cpp:
(WebCore::drawBitmapToContext):
(WebCore::GraphicsContext::releaseWindowsContext):
(WebCore::GraphicsContext::drawWindowsBitmap):

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

3 years agoWeb Inspector: use JSON::{Array,Object,Value} instead of Inspector{Array,Object,Value}
carlosgc@webkit.org [Wed, 8 Nov 2017 13:02:13 +0000 (13:02 +0000)]
Web Inspector: use JSON::{Array,Object,Value} instead of Inspector{Array,Object,Value}
https://bugs.webkit.org/show_bug.cgi?id=173619

Source/JavaScriptCore:

Reviewed by Alex Christensen and Brian Burg.

Eventually all classes used for our JSON-RPC message passing should be outside
of the Inspector namespace since the protocol is used outside of Inspector code.
This will also allow us to unify the primitive JSON types with parameteric types
like Inspector::Protocol::Array<T> and other protocol-related types which don't
need to be in the Inspector namespace.

Start this refactoring off by making JSON::Value a typedef for InspectorValue. In following
patches, other clients will move to use JSON::Value and friends. When all uses are
changed, the actual implementation will be renamed. This patch just focuses on the typedef
and making changes in generated protocol code.

Original patch by Brian Burg, rebased and updated by me.

* inspector/InspectorValues.cpp:
* inspector/InspectorValues.h:
* inspector/scripts/codegen/cpp_generator.py:
(CppGenerator.cpp_protocol_type_for_type):
(CppGenerator.cpp_type_for_unchecked_formal_in_parameter):
(CppGenerator.cpp_type_for_type_with_name):
(CppGenerator.cpp_type_for_stack_in_parameter):
* inspector/scripts/codegen/cpp_generator_templates.py:
(void):
* inspector/scripts/codegen/generate_cpp_protocol_types_header.py:
(_generate_class_for_object_declaration):
(_generate_forward_declarations_for_binding_traits):
* inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py:
(CppProtocolTypesImplementationGenerator._generate_assertion_for_object_declaration):
(CppProtocolTypesImplementationGenerator._generate_assertion_for_enum):
* inspector/scripts/tests/all/expected/definitions-with-mac-platform.json-result:
* inspector/scripts/tests/generic/expected/commands-with-async-attribute.json-result:
* inspector/scripts/tests/generic/expected/commands-with-optional-call-return-parameters.json-result:
* inspector/scripts/tests/generic/expected/domain-availability.json-result:
* inspector/scripts/tests/generic/expected/domains-with-varying-command-sizes.json-result:
* inspector/scripts/tests/generic/expected/enum-values.json-result:
* inspector/scripts/tests/generic/expected/events-with-optional-parameters.json-result:
* inspector/scripts/tests/generic/expected/generate-domains-with-feature-guards.json-result:
* inspector/scripts/tests/generic/expected/shadowed-optional-type-setters.json-result:
* inspector/scripts/tests/generic/expected/type-declaration-object-type.json-result:
* inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result:
* inspector/scripts/tests/generic/expected/type-with-open-parameters.json-result:
* inspector/scripts/tests/generic/expected/worker-supported-domains.json-result:
* inspector/scripts/tests/mac/expected/definitions-with-mac-platform.json-result:

Tools:

Reviewed by Brian Burg.

Update InspectorValue unit tests to use JSON namespace and add more basic tests to cover all the API.

* TestWebKitAPI/PlatformGTK.cmake:
* TestWebKitAPI/Tests/JavaScriptCore/InspectorValue.cpp:
(TestWebKitAPI::TEST):

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

3 years agoREGRESSION(r223773): [GTK] WebKitWebInspector bring-to-front signal is emitted right...
carlosgc@webkit.org [Wed, 8 Nov 2017 12:55:22 +0000 (12:55 +0000)]
REGRESSION(r223773): [GTK] WebKitWebInspector bring-to-front signal is emitted right after open-window
https://bugs.webkit.org/show_bug.cgi?id=179365

Reviewed by Michael Catanzaro.

In the GTK+ API, open-window already implies presenting the window to bring it to the front, so it's not
expected that bring-to-front is emitted on open. This is happening since r223773 that moved common code from
platform specific inspector files to the main file, but in the case of open the mac implementation was not
exactly the same as the GTK+ one. This broke /webkit2/WebKitWebInspector/default and
/webkit2/WebKitWebInspector/manual-attach-detach.

* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::open): Set m_isOpening for the scope of the function.
* UIProcess/WebInspectorProxy.h: Add m_isOpening.
* UIProcess/gtk/WebInspectorProxyGtk.cpp:
(WebKit::WebInspectorProxy::platformBringToFront): Return early if m_isOpening is true.

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

3 years agoDisable implicit animations when adding or removing text track representation layers.
commit-queue@webkit.org [Wed, 8 Nov 2017 09:49:03 +0000 (09:49 +0000)]
Disable implicit animations when adding or removing text track representation layers.
https://bugs.webkit.org/show_bug.cgi?id=179406
rdar://problem/34369835

Patch by Jeremy Jones <jeremyj@apple.com> on 2017-11-08
Reviewed by Simon Fraser.

No new tests because this has no effect on the DOM.

This change prevents implicit animations when the text track layer is added or removed from
the video layer.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::syncTextTrackBounds):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setTextTrackRepresentation):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVideoFullscreenLayer):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::syncTextTrackBounds):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setTextTrackRepresentation):
* platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm:
(WebCore::VideoFullscreenLayerManager::setVideoFullscreenLayer):

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

3 years agoREGRESSION(r224179): [GTK] Several WebViewEditor tests are failing since r224179
carlosgc@webkit.org [Wed, 8 Nov 2017 07:25:40 +0000 (07:25 +0000)]
REGRESSION(r224179): [GTK] Several WebViewEditor tests are failing since r224179
https://bugs.webkit.org/show_bug.cgi?id=179366

Reviewed by Michael Catanzaro.

Source/WebKit:

In r224179, webkit_web_view_can_execute_editing_command() was optimized to use the sync path for commands
supported by the WebViewEditorState, but the state requires a redraw to be up to date. We can't know if
WebViewEditorState is in sync, when webkit_web_view_can_execute_editing_command() is called, so we always need
to ask the web process.

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

Tools:

Use always a toplevel window for WebViewEditor tests instead of creating and destroying one only to flush editor
state.

* TestWebKitAPI/Tests/WebKitGtk/TestWebViewEditor.cpp:

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