WebKit-https.git
3 years ago[LayoutReloaded] Set inline-block box position.
zalan@apple.com [Tue, 17 Apr 2018 14:32:46 +0000 (14:32 +0000)]
[LayoutReloaded] Set inline-block box position.
https://bugs.webkit.org/show_bug.cgi?id=184690

Reviewed by Antti Koivisto.

* LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js:
(InlineFormattingContext.prototype._handleInlineBlock):
* LayoutReloaded/Utils.js:
(Utils._dumpBox):
* LayoutReloaded/test/inline-block-with-fixed-width-height.html:

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

3 years ago[GTK] Build fix after r230529 (WaylandCompositorDisplay leaks its wl_display)
clopez@igalia.com [Tue, 17 Apr 2018 11:29:26 +0000 (11:29 +0000)]
[GTK] Build fix after r230529 (WaylandCompositorDisplay leaks its wl_display)
https://bugs.webkit.org/show_bug.cgi?id=184406

Rubber-stamped by Michael Catanzaro.

Fix build with clang 3.8

No new tests, it is a build fix.

* platform/graphics/wayland/PlatformDisplayWayland.cpp:
(WebCore::PlatformDisplayWayland::create):

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

3 years ago[GLIB] Add API to clear JSCContext uncaught exception
carlosgc@webkit.org [Tue, 17 Apr 2018 08:41:04 +0000 (08:41 +0000)]
[GLIB] Add API to clear JSCContext uncaught exception
https://bugs.webkit.org/show_bug.cgi?id=184685

Reviewed by Žan Doberšek.

Source/JavaScriptCore:

Add jsc_context_clear_exception() to clear any possible uncaught exception in a JSCContext.

* API/glib/JSCContext.cpp:
(jsc_context_clear_exception):
* API/glib/JSCContext.h:
* API/glib/docs/jsc-glib-4.0-sections.txt:

Tools:

Add test cases for the new API.

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

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

3 years ago[GLIB] Add API to query, delete and enumerate properties
carlosgc@webkit.org [Tue, 17 Apr 2018 08:15:28 +0000 (08:15 +0000)]
[GLIB] Add API to query, delete and enumerate properties
https://bugs.webkit.org/show_bug.cgi?id=184647

Reviewed by Michael Catanzaro.

Source/JavaScriptCore:

Add jsc_value_object_has_property(), jsc_value_object_delete_property() and jsc_value_object_enumerate_properties().

* API/glib/JSCValue.cpp:
(jsc_value_object_has_property):
(jsc_value_object_delete_property):
(jsc_value_object_enumerate_properties):
* API/glib/JSCValue.h:
* API/glib/docs/jsc-glib-4.0-sections.txt:

Tools:

Add test cases for the new API.

* TestWebKitAPI/Tests/JavaScriptCore/glib/TestJSC.cpp:
(testJSCObject):
(testJSCClass):
(testJSCPrototypes):

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

3 years agoLayout Test animations/needs-layout.html is a flaky Image Failure.
graouts@webkit.org [Tue, 17 Apr 2018 07:33:57 +0000 (07:33 +0000)]
Layout Test animations/needs-layout.html is a flaky Image Failure.
https://bugs.webkit.org/show_bug.cgi?id=172397

Reviewed by Dean Jackson.

Source/WebCore:

Animations that animate a transform and uses a relative value for either the x or y components
require a layout before starting, which CSSAnimationController would perform in the call to
CSSAnimationControllerPrivate::animationTimerFired() made immediately after a CSS animation was
created.

We now perform a similar task where upon setting new blending keyframes we compute a flag indicating
if the keyframe effect is animating a transform with relative x or y components. Then, when we perform
the first invalidation task, which runs in the next run loop after a change to the timing model has
been made, such as a call to play() on a CSSAnimation made in the TreeResolver::createAnimatedElementUpdate()
where the CSSAnimation was created, we call forceLayout() on this element's FrameView. We also ensure
we commit animations on the compositor immediately after that too, instead of waiting until the next
DisplayRefreshMonitor callback.

* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::performInvalidationTask):
(WebCore::DocumentTimeline::updateAnimations):
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::forceLayoutIfNeeded):
(WebCore::KeyframeEffectReadOnly::setBlendingKeyframes):
(WebCore::KeyframeEffectReadOnly::computedNeedsForcedLayout):
(WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions):
* animation/KeyframeEffectReadOnly.h:

LayoutTests:

No longer mark this test as flaky.

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

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

3 years agoInconsistent EGL defines in ImageBufferCairo
commit-queue@webkit.org [Tue, 17 Apr 2018 06:54:26 +0000 (06:54 +0000)]
Inconsistent EGL defines in ImageBufferCairo
https://bugs.webkit.org/show_bug.cgi?id=184661

Patch by Pablo Saavedra <psaavedra@igalia.com> on 2018-04-16
Reviewed by Žan Doberšek.

On revision r219391 libepoxy is added. The headers in
ImageBufferCairo.cpp become inconsistent when 2D canvas is enabled
(-DENABLE_ACCELERATED_2D_CANVAS=ON) due to a redefinition error during
the Webkit build:

    ...
    /usr/include/GLES2/gl2.h:503:82: error: 'voi
    epoxy_glAttachShader(GLuint, GLuint)' redeclared as different kind
    of symbol
    GL_APICALL void         GL_APIENTRY glAttachShader (GLuint
    program, GLuint shader);

No new tests.

* platform/graphics/cairo/ImageBufferCairo.cpp:

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

3 years agoWeb Inspector: Can't select and copy text from Network tab popover
nvasilyev@apple.com [Tue, 17 Apr 2018 05:48:41 +0000 (05:48 +0000)]
Web Inspector: Can't select and copy text from Network tab popover
https://bugs.webkit.org/show_bug.cgi?id=184606

Reviewed by Matt Baker.

* UserInterface/Views/ResourceTimingBreakdownView.css:
(.waterfall-popover .resource-timing-breakdown):

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

3 years ago[LayoutReloaded] Add support for replaced box.
zalan@apple.com [Tue, 17 Apr 2018 05:17:26 +0000 (05:17 +0000)]
[LayoutReloaded] Add support for replaced box.
https://bugs.webkit.org/show_bug.cgi?id=184680

Reviewed by Antti Koivisto.

Basic support for inline replaced.

* LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js:
(InlineFormattingContext.prototype._handleInlineBox):
(InlineFormattingContext.prototype._handleInlineBlock):
(InlineFormattingContext.prototype._handleReplaced):
* LayoutReloaded/FormattingContext/InlineFormatting/Line.js:
(Line.prototype.lastLineBox):
(Line.prototype.addInlineBox):
(Line.prototype.addInlineContainerBox): Deleted.
* LayoutReloaded/TreeBuilder.js:
(TreeBuilder.prototype._createAndAttachBox):
* LayoutReloaded/Utils.js:
(Utils._dumpBox):
* LayoutReloaded/test/index.html:
* LayoutReloaded/test/inline-simple-replaced.html: Added.

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

3 years ago[LayoutReloaded] Minor InlineFormattingContext::layout() cleanup.
zalan@apple.com [Tue, 17 Apr 2018 03:15:16 +0000 (03:15 +0000)]
[LayoutReloaded] Minor InlineFormattingContext::layout() cleanup.
https://bugs.webkit.org/show_bug.cgi?id=184679

Reviewed by Antti Koivisto.

* LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js:
(InlineFormattingContext):
(InlineFormattingContext.prototype.layout):
(InlineFormattingContext.prototype._handleInlineContainer):
(InlineFormattingContext.prototype._handleInlineContent):
(InlineFormattingContext.prototype._handleInlineBlock):
(InlineFormattingContext.prototype._handleReplacedBox):
(InlineFormattingContext.prototype._clearNeedsLayoutAndMoveToNextSibling):
(InlineFormattingContext.prototype._handleInlineBlockContainer): Deleted.
(InlineFormattingContext.prototype._clearAndMoveToNext): Deleted.

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

3 years agoUnreviewed 32-bit build fix for r230673.
timothy@apple.com [Tue, 17 Apr 2018 03:01:08 +0000 (03:01 +0000)]
Unreviewed 32-bit build fix for r230673.

https://bugs.webkit.org/show_bug.cgi?id=184657
rdar://problem/39463307

* Configurations/PluginProcessShim.xcconfig: Use the correct names.

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

3 years ago[WebAssembly][Modules] Prototype wasm import
utatane.tea@gmail.com [Tue, 17 Apr 2018 02:38:59 +0000 (02:38 +0000)]
[WebAssembly][Modules] Prototype wasm import
https://bugs.webkit.org/show_bug.cgi?id=184600

Reviewed by JF Bastien.

JSTests:

Add wasm and wat files since module loader want to load wasm files from FS.
Currently, importing the other modules from wasm is not supported.

* wasm.yaml:
* wasm/modules/constant.wasm: Added.
* wasm/modules/constant.wat: Added.
* wasm/modules/js-wasm-function-namespace.js: Added.
(assert.throws):
* wasm/modules/js-wasm-function.js: Added.
(assert.throws):
* wasm/modules/js-wasm-global-namespace.js: Added.
(assert.throws):
* wasm/modules/js-wasm-global.js: Added.
(assert.throws):
* wasm/modules/js-wasm-memory-namespace.js: Added.
(assert.throws):
* wasm/modules/js-wasm-memory.js: Added.
(assert.throws):
* wasm/modules/js-wasm-start.js: Added.
(then):
* wasm/modules/js-wasm-table-namespace.js: Added.
(assert.throws):
* wasm/modules/js-wasm-table.js: Added.
(assert.throws):
* wasm/modules/memory.wasm: Added.
* wasm/modules/memory.wat: Added.
* wasm/modules/start.wasm: Added.
* wasm/modules/start.wat: Added.
* wasm/modules/sum.wasm: Added.
* wasm/modules/sum.wat: Added.
* wasm/modules/table.wasm: Added.
* wasm/modules/table.wat: Added.

Source/JavaScriptCore:

This patch is an initial attempt to implement Wasm loading in module pipeline.
Currently,

1. We only support Wasm loading in the JSC shell. Once loading mechanism is specified
   in whatwg HTML, we should integrate this into WebCore.

2. We only support exporting values from Wasm. Wasm module cannot import anything from
   the other modules now.

When loading a file, JSC shell checks wasm magic. If the wasm magic is found, JSC shell
loads the file with WebAssemblySourceProvider. It is wrapped into JSSourceCode and
module loader pipeline just handles it as the same to JS. When parsing a module, we
checks the type of JSSourceCode. If the source code is Wasm source code, we create a
WebAssemblyModuleRecord instead of JSModuleRecord. Our module pipeline handles
AbstractModuleRecord and Wasm module is instantiated, linked, and evaluated.

* builtins/ModuleLoaderPrototype.js:
(globalPrivate.newRegistryEntry):
(requestInstantiate):
(link):
* jsc.cpp:
(convertShebangToJSComment):
(fillBufferWithContentsOfFile):
(fetchModuleFromLocalFileSystem):
(GlobalObject::moduleLoaderFetch):
* parser/SourceProvider.h:
(JSC::WebAssemblySourceProvider::create):
(JSC::WebAssemblySourceProvider::WebAssemblySourceProvider):
* runtime/AbstractModuleRecord.cpp:
(JSC::AbstractModuleRecord::hostResolveImportedModule):
(JSC::AbstractModuleRecord::link):
(JSC::AbstractModuleRecord::evaluate):
(JSC::identifierToJSValue): Deleted.
* runtime/AbstractModuleRecord.h:
* runtime/JSModuleLoader.cpp:
(JSC::JSModuleLoader::evaluate):
* runtime/JSModuleRecord.cpp:
(JSC::JSModuleRecord::link):
(JSC::JSModuleRecord::instantiateDeclarations):
* runtime/JSModuleRecord.h:
* runtime/ModuleLoaderPrototype.cpp:
(JSC::moduleLoaderPrototypeParseModule):
(JSC::moduleLoaderPrototypeRequestedModules):
(JSC::moduleLoaderPrototypeModuleDeclarationInstantiation):
* wasm/js/JSWebAssemblyHelpers.h:
(JSC::getWasmBufferFromValue):
(JSC::createSourceBufferFromValue):
* wasm/js/JSWebAssemblyInstance.cpp:
(JSC::JSWebAssemblyInstance::finalizeCreation):
(JSC::JSWebAssemblyInstance::createPrivateModuleKey):
(JSC::JSWebAssemblyInstance::create):
* wasm/js/JSWebAssemblyInstance.h:
* wasm/js/WebAssemblyInstanceConstructor.cpp:
(JSC::constructJSWebAssemblyInstance):
* wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::WebAssemblyModuleRecord::prepareLink):
(JSC::WebAssemblyModuleRecord::link):
* wasm/js/WebAssemblyModuleRecord.h:
* wasm/js/WebAssemblyPrototype.cpp:
(JSC::resolve):
(JSC::instantiate):
(JSC::compileAndInstantiate):
(JSC::WebAssemblyPrototype::instantiate):
(JSC::webAssemblyInstantiateFunc):
(JSC::webAssemblyValidateFunc):
* wasm/js/WebAssemblyPrototype.h:

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

3 years ago[LayoutReloaded] Introduce fragmentation state/context.
zalan@apple.com [Tue, 17 Apr 2018 02:02:06 +0000 (02:02 +0000)]
[LayoutReloaded] Introduce fragmentation state/context.
https://bugs.webkit.org/show_bug.cgi?id=184677

Reviewed by Antti Koivisto.

State/context for fragmented content (multicol, regions, pagination etc).

* LayoutReloaded/FormattingContext/FragmentationContext.js: Added.
(FragmentationContext):
* LayoutReloaded/FormattingState/FragmentationState.js: Added.
(FragmentationState):
(FragmentationState.prototype.formattingState):

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

3 years agoMutationObserver should be in an IsoHeap
fpizlo@apple.com [Tue, 17 Apr 2018 01:56:15 +0000 (01:56 +0000)]
MutationObserver should be in an IsoHeap
https://bugs.webkit.org/show_bug.cgi?id=184671
<rdar://problem/36081981>

Reviewed by Sam Weinig.

No new tests because no new behavior.

* dom/MutationObserver.cpp:
* dom/MutationObserver.h:

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

3 years ago[iOS] Enable WKPDFView by default
aestes@apple.com [Tue, 17 Apr 2018 01:20:43 +0000 (01:20 +0000)]
[iOS] Enable WKPDFView by default
https://bugs.webkit.org/show_bug.cgi?id=184675
<rdar://problem/27885452>

Reviewed by Darin Adler.

Source/WebKit:

* UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
(-[WKWebViewContentProviderRegistry init]):

Source/WTF:

* wtf/FeatureDefines.h:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/WKPDFView.mm:

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

3 years agoREGRESSION: [mac-wk2 release] LayoutTest http/tests/security/contentSecurityPolicy...
krollin@apple.com [Mon, 16 Apr 2018 23:57:08 +0000 (23:57 +0000)]
REGRESSION: [mac-wk2 release] LayoutTest http/tests/security/contentSecurityPolicy/script-src-blocked-error-event.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=184673
<rdar://problem/39474698>

Unreviewed test gardening. The test was flaky because the HTTP parser
would try to preload the Javascript resource. Sometimes this operation
would complete in time to print its own console message, duplicating a
subsequent one when the non-preloading resource-load occurs. Updated
the test to load the Javascript in such a way that it skips the reload
step.

* TestExpectations:
* http/tests/security/contentSecurityPolicy/script-src-blocked-error-event-expected.txt:
* http/tests/security/contentSecurityPolicy/script-src-blocked-error-event.html:

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

3 years ago[macOS] Don't establish unneeded Dock connections
bfulgham@apple.com [Mon, 16 Apr 2018 23:43:05 +0000 (23:43 +0000)]
[macOS] Don't establish unneeded Dock connections
https://bugs.webkit.org/show_bug.cgi?id=184664
<rdar://problem/16863698>

Reviewed by Simon Fraser.

There is no reason for the WebContent or Plugin processes to interact with
the Dock. We should tell AppKit that we don't want this connection, and to
avoid creating such connections.

Source/WebCore/PAL:

* pal/spi/mac/NSApplicationSPI.h: Add Dock connection declaration.

Source/WebKit:

* PluginProcess/mac/PluginProcessMac.mm:
(WebKit::PluginProcess::platformInitializeProcess): Tell NSApplication to
not create a Dock connection.
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess): Ditto.

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

3 years agoUnreviewed. Update WinCairo TestExpectations in preparation for LayoutTests automation.
ross.kirsling@sony.com [Mon, 16 Apr 2018 23:18:45 +0000 (23:18 +0000)]
Unreviewed. Update WinCairo TestExpectations in preparation for LayoutTests automation.

* platform/wincairo/TestExpectations:
Updated current failures for directories A-E. Added temporary skips for everything after.

* platform/wincairo/accessibility:
* platform/wincairo/animations/3d:
* platform/wincairo/css2.1:
* platform/wincairo/css3:
* platform/wincairo/editing:
* platform/wincairo/fast/css-generated-content:
* platform/wincairo/fast/dom:
* platform/wincairo/legacy-animation-engine/animations/3d:
* platform/wincairo/legacy-animation-engine/compositing:
Added expectation files.

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

3 years agoSet H264 VT encoder usage to 1
youenn@apple.com [Mon, 16 Apr 2018 22:59:04 +0000 (22:59 +0000)]
Set H264 VT encoder usage to 1
https://bugs.webkit.org/show_bug.cgi?id=184668

Reviewed by Eric Carlson.

* Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoEncoderH264.mm:
(-[RTCVideoEncoderH264 configureCompressionSession]):

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

3 years agoSwitch to UIWKTextInteractionAssistant for non-editable text
megan_gardner@apple.com [Mon, 16 Apr 2018 22:46:47 +0000 (22:46 +0000)]
Switch to UIWKTextInteractionAssistant for non-editable text
https://bugs.webkit.org/show_bug.cgi?id=182834

Reviewed by Beth Dakin.

Source/WebKit:

Switch to only using one assistant for text selection.

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

LayoutTests:

Marking tests as flaky and to be fixed later.

* platform/ios-wk2/TestExpectations:

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

3 years agoUse NetworkLoadChecker to handle synchronous HTTP loads
youenn@apple.com [Mon, 16 Apr 2018 21:50:26 +0000 (21:50 +0000)]
Use NetworkLoadChecker to handle synchronous HTTP loads
https://bugs.webkit.org/show_bug.cgi?id=184240

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* web-platform-tests/cors/request-headers-expected.txt:
* web-platform-tests/XMLHttpRequest/access-control-and-redirects-expected.txt:
* web-platform-tests/XMLHttpRequest/send-authentication-cors-basic-setrequestheader-expected.txt:
* web-platform-tests/XMLHttpRequest/send-authentication-cors-setrequestheader-no-cred-expected.txt:

Source/WebCore:

Update LoaderStrategy::loadResourceSynchronously to pass FetchOptions directly.
Update various call sites accordingly. This allows NetworkProcess to do all necessary checks.
Add an option to disable security checks if NetworkProcess does it for WebProcess.
This option will be also used for regular asynchronous loads in future patches.

Update DocumentThreadableLoader to bypass preflighting and response validation checks in case they are done in NetworkProcess.

Covered by existing and rebased tests.

* loader/CrossOriginPreflightChecker.cpp:
(WebCore::CrossOriginPreflightChecker::doPreflight):
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
(WebCore::DocumentThreadableLoader::loadRequest):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadResourceSynchronously):
* loader/FrameLoader.h:
* loader/LoaderStrategy.h:
* xml/XSLTProcessorLibxslt.cpp:
(WebCore::docLoaderFunc):
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::openFunc):

Source/WebKit:

For every NetworkResourceLoader synchronous load, we create a NetworkLoadChecker.
NetworkLoadChecker handles all security checks in that case.
This allows supporting cross-origin loads for synchronous XHR.

Updated NetworkCORSPreflightChecker to return the result as a ResourceError.
This is used to convey any error message from NetworkProcess to the JS console.
Ensure NetworkCORSPreflightChecker computes correctly Access-Control-Request-Headers value
by providing the headers set by the application plus Referrer/Origin.

* NetworkProcess/NetworkCORSPreflightChecker.cpp:
(WebKit::NetworkCORSPreflightChecker::~NetworkCORSPreflightChecker):
(WebKit::NetworkCORSPreflightChecker::willPerformHTTPRedirection):
(WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
(WebKit::NetworkCORSPreflightChecker::didCompleteWithError):
(WebKit::NetworkCORSPreflightChecker::wasBlocked):
(WebKit::NetworkCORSPreflightChecker::cannotShowURL):
* NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::NetworkResourceLoader):
(WebKit::NetworkResourceLoader::retrieveCacheEntry):
(WebKit::NetworkResourceLoader::didReceiveResponse):
(WebKit::NetworkResourceLoader::willSendRedirectedRequest):
(WebKit::NetworkResourceLoader::continueWillSendRequest):
(WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
(WebKit::NetworkResourceLoader::validateCacheEntry):
* NetworkProcess/NetworkResourceLoader.h:
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::loadResourceSynchronously):
* WebProcess/Network/WebLoaderStrategy.h:

Source/WebKitLegacy:

* WebCoreSupport/WebResourceLoadScheduler.cpp:
(WebResourceLoadScheduler::loadResourceSynchronously):
* WebCoreSupport/WebResourceLoadScheduler.h:

LayoutTests:

* http/tests/xmlhttprequest/access-control-preflight-not-successful-expected.txt:
* http/wpt/beacon/cors/cors-preflight-blob-failure.html: Fix buggy assertion.
Test should check for actual request header and not header name in Access-Control-Request-Headers.
* http/wpt/beacon/cors/cors-preflight-blob-success.html: Ditto.
* platform/mac-wk1/http/tests/xmlhttprequest/access-control-and-redirects-expected.txt: Added.
* platform/mac-wk1/http/tests/xmlhttprequest/access-control-preflight-not-successful-expected.txt: Added.
* platform/mac-wk1/http/tests/xmlhttprequest/cross-origin-no-authorization-expected.txt: Added.
* platform/mac-wk1/imported/w3c/web-platform-tests/XMLHttpRequest/access-control-and-redirects-expected.txt: Added.
* platform/win/http/tests/xmlhttprequest/access-control-and-redirects-expected.txt: Added.
* platform/win/http/tests/xmlhttprequest/access-control-preflight-not-successful-expected.txt: Added.
* platform/win/http/tests/xmlhttprequest/cross-origin-no-authorization-expected.txt: Added.
* platform/mac-highsierra-wk2/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-cors-basic-setrequestheader-expected.txt: Copied from LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-cors-basic-setrequestheader-expected.txt.
* platform/mac-highsierra-wk2/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-cors-setrequestheader-no-cred-expected.txt: Copied from LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-cors-setrequestheader-no-cred-expected.txt.
* platform/mac-wk1/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-cors-basic-setrequestheader-expected.txt: Copied from LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-cors-basic-setrequestheader-expected.txt.
* platform/mac-wk1/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-cors-setrequestheader-no-cred-expected.txt: Copied from LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-cors-setrequestheader-no-cred-expected.txt.
* platform/mac-wk1/imported/w3c/web-platform-tests/cors/request-headers-expected.txt: Copied from LayoutTests/imported/w3c/web-platform-tests/cors/request-headers-expected.txt.
* platform/win/http/tests/xmlhttprequest/access-control-and-redirects-expected.txt:
* platform/win/http/tests/xmlhttprequest/access-control-preflight-not-successful-expected.txt:
* platform/win/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-cors-basic-setrequestheader-expected.txt: Copied from LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-cors-basic-setrequestheader-expected.txt.
* platform/win/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-cors-setrequestheader-no-cred-expected.txt: Copied from LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-cors-setrequestheader-no-cred-expected.txt.
* platform/win/imported/w3c/web-platform-tests/cors/request-headers-expected.txt: Copied from LayoutTests/imported/w3c/web-platform-tests/cors/request-headers-expected.txt.

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

3 years agoPerl-based Test262 runner
msaboff@apple.com [Mon, 16 Apr 2018 21:03:59 +0000 (21:03 +0000)]
Perl-based Test262 runner
https://bugs.webkit.org/show_bug.cgi?id=183343

Patch by Leo Balter <leonardo.balter@gmail.com> on 2018-04-16
Reviewed by Michael Saboff.

* Scripts/test262-helpers/README.md: Added.
* Scripts/test262-helpers/agent.js: Added.
(262.getGlobal):
(262.setGlobal):
(262.destroy):
(262.IsHTMLDDA):
* Scripts/test262-helpers/cpanfile: Added.
* Scripts/test262-helpers/cpanfile.snapshot: Added.
* Scripts/test262-helpers/test262-runner.pl: Added.
(main):
(processFile):
(getScenarios):
(addScenario):
(compileTest):
(runTest):
(processResult):
(getTempFile):
(getContents):
(parseData):
(getHarness):
* Scripts/test262-helpers/tests.log: Added.

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

3 years ago[WinCairo] Media elements should be enabled by default
commit-queue@webkit.org [Mon, 16 Apr 2018 19:45:27 +0000 (19:45 +0000)]
[WinCairo] Media elements should be enabled by default
https://bugs.webkit.org/show_bug.cgi?id=184597

Patch by Christopher Reid <chris.reid@sony.com> on 2018-04-16
Reviewed by Per Arne Vollan.

Enabling media elements by default with media foundation.

* page/SettingsDefaultValues.h:

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

3 years ago[Curl] Add the Accept-Language field to curl request headers
commit-queue@webkit.org [Mon, 16 Apr 2018 19:22:17 +0000 (19:22 +0000)]
[Curl] Add the Accept-Language field to curl request headers
https://bugs.webkit.org/show_bug.cgi?id=184605

Patch by Christopher Reid <chris.reid@sony.com> on 2018-04-16
Reviewed by Alex Christensen.

Add Accept-Language field to curl request headers

* platform/network/curl/CurlRequest.cpp:
* platform/network/curl/CurlRequest.h:

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

3 years agoDeactivate the WindowServer connection for the WebContent process.
pvollan@apple.com [Mon, 16 Apr 2018 19:20:17 +0000 (19:20 +0000)]
Deactivate the WindowServer connection for the WebContent process.
https://bugs.webkit.org/show_bug.cgi?id=184451
<rdar://problem/38313938>

Reviewed by Brent Fulgham.

Defining ENABLE_WEBPROCESS_WINDOWSERVER_BLOCKING as 1 will deactivate the WindowServer connection
for the WebContent process by enabling the call to 'CGSSetDenyWindowServerConnections(true)' on
process startup. After calling this function, every attempt to establish a connection to the
WindowServer from the WebContent process will fail, except for CA render server connections.

* wtf/FeatureDefines.h:

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

3 years agoMove more WindowProxy-related logic from ScriptController to WindowProxyController
cdumez@apple.com [Mon, 16 Apr 2018 19:02:40 +0000 (19:02 +0000)]
Move more WindowProxy-related logic from ScriptController to WindowProxyController
https://bugs.webkit.org/show_bug.cgi?id=184640

Reviewed by Ryosuke Niwa.

Move more WindowProxy-related logic from ScriptController to WindowProxyController,
for clarity.

* bindings/js/JSDOMWindowProxy.cpp:
(WebCore::JSDOMWindowProxy::attachDebugger):
* bindings/js/JSDOMWindowProxy.h:
* bindings/js/ScriptCachedFrameData.cpp:
(WebCore::ScriptCachedFrameData::ScriptCachedFrameData):
(WebCore::ScriptCachedFrameData::restore):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::~ScriptController):
(WebCore::ScriptController::initScriptForWindowProxy):
* bindings/js/ScriptController.h:
(WebCore::ScriptController::existingCacheableBindingRootObject const):
* bindings/js/WindowProxyController.cpp:
(WebCore::collectGarbageAfterWindowProxyDestruction):
(WebCore::WindowProxyController::~WindowProxyController):
(WebCore::WindowProxyController::clearWindowProxiesNotMatchingDOMWindow):
(WebCore::WindowProxyController::setDOMWindowForWindowProxy):
(WebCore::WindowProxyController::attachDebugger):
* bindings/js/WindowProxyController.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::clear):
* page/Page.cpp:
(WebCore::Page::setDebugger):

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

3 years ago[Cocoa] Web Automation: add SPI to terminate automation session and disconnect the...
bburg@apple.com [Mon, 16 Apr 2018 18:53:50 +0000 (18:53 +0000)]
[Cocoa] Web Automation: add SPI to terminate automation session and disconnect the remote end
https://bugs.webkit.org/show_bug.cgi?id=184523
<rdar://problem/39368599>

Reviewed by Simon Fraser.

When a user breaks the automation glass pane and chooses "Stop Session", there is no way
for Safari to actually disconnect the remote connection using automation-related ObjC SPI.
This can lead to sessions getting stuck and safaridriver is unable to request a new session.

Expose the -terminate method as SPI. This disconnects the remote connection and then notifies
the session delegate that the remote disconnected. At that point, Safari can uninstall
the session from the process pool and tear down other session state.

* UIProcess/API/Cocoa/_WKAutomationSession.h:
* UIProcess/API/Cocoa/_WKAutomationSession.mm:
(-[_WKAutomationSession terminate]):

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

3 years ago[GStreamer] Set *TrackPrivateGStreamer::active based on GstStream default select...
commit-queue@webkit.org [Mon, 16 Apr 2018 18:33:13 +0000 (18:33 +0000)]
[GStreamer] Set *TrackPrivateGStreamer::active based on GstStream default select in constructor
https://bugs.webkit.org/show_bug.cgi?id=184652

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

In the constructor we should mark selected streams based on the default values from GstStream,
if the user changes them, they will be updated as required later on.

No new tests are added as we already have a few ones that are currently disabled in
the mediastream testsuite. This patch is part of the work to enable them.

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

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

3 years agoClean up OTHER_LDFLAGS for WebKit processes
timothy@apple.com [Mon, 16 Apr 2018 18:29:19 +0000 (18:29 +0000)]
Clean up OTHER_LDFLAGS for WebKit processes
https://bugs.webkit.org/show_bug.cgi?id=184657

Reviewed by Jer Noble.

* Configurations/PluginProcessShim.xcconfig:
* Configurations/PluginService.32.xcconfig:
* Configurations/PluginService.64.xcconfig:
* Configurations/WebContentService.xcconfig:

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

3 years agoVersioning.
bshafiei@apple.com [Mon, 16 Apr 2018 17:55:49 +0000 (17:55 +0000)]
Versioning.

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

3 years ago[GStreamer] Set TrackPrivateBaseGStreamer metadata information even if no client...
commit-queue@webkit.org [Mon, 16 Apr 2018 16:01:56 +0000 (16:01 +0000)]
[GStreamer] Set TrackPrivateBaseGStreamer metadata information even if no client is avalaible
https://bugs.webkit.org/show_bug.cgi?id=184651

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

We can't notify the client if none is connected, but still we need to fill our metadatas from
the provided GstTagList, especially in the case of playbin3 where the client is not set yet
at construct time but the metadata might already be preset (and won't be updated later on).

No new tests are added as we already have a few ones that are currently disabled in
the mediastream testsuite. This patch is part of the work to enable them.

* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
(WebCore::TrackPrivateBaseGStreamer::notifyTrackOfTagsChanged):

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

3 years agoMark css3/filters/blur-various-radii.html as a crash on Windows.
pvollan@apple.com [Mon, 16 Apr 2018 14:36:58 +0000 (14:36 +0000)]
Mark css3/filters/blur-various-radii.html as a crash on Windows.
https://bugs.webkit.org/show_bug.cgi?id=184649

Unreviewed test gardening.

* platform/win/TestExpectations:

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

3 years ago[Web Animations] Ensure we never return -0 through the API
graouts@webkit.org [Mon, 16 Apr 2018 08:47:17 +0000 (08:47 +0000)]
[Web Animations] Ensure we never return -0 through the API
https://bugs.webkit.org/show_bug.cgi?id=184644

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Record one progression in the Web Animations WPT tests.

* web-platform-tests/web-animations/timing-model/animations/updating-the-finished-state-expected.txt:

Source/WebCore:

We could sometimes return -0 instead of 0, which is surprising and leads to an error in WPT tests.
This would happen when playbackRate < 0.

* animation/WebAnimationUtilities.h:
(WebCore::secondsToWebAnimationsAPITime):

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

3 years agoMake it possible to hide some repository groups
rniwa@webkit.org [Mon, 16 Apr 2018 06:58:36 +0000 (06:58 +0000)]
Make it possible to hide some repository groups
https://bugs.webkit.org/show_bug.cgi?id=184632

Reviewed by Saam Barati.

Added the ability to hide repository groups in the custom analysis task configurator from the admin page.
Hidden repositroy groups will continue to function for existing test groups. This is purely an UI change.

* init-database.sql: Added repositorygroup_hidden as a new column to triggerable_repository_groups.
* public/admin/triggerables.php: Added a form field to hide a repository group.
* public/include/manifest-generator.php: Include hidden state in the manifest file.
* public/v3/components/custom-analysis-task-configurator.js:
(CustomAnalysisTaskConfigurator.prototype._renderRepositoryPanes): Filter out hidden repository groups.
* public/v3/models/triggerable.js:
(prototype.isHidden): Added.
* server-tests/api-manifest-tests.js: Updated an existing test case to test a hidden repository group.

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

3 years ago[Web Animations] Animations do not naturally get a finish event
graouts@webkit.org [Mon, 16 Apr 2018 05:38:01 +0000 (05:38 +0000)]
[Web Animations] Animations do not naturally get a finish event
https://bugs.webkit.org/show_bug.cgi?id=184639
<rdar://problem/39397649>

Reviewed by Jon Lee.

LayoutTests/imported/w3c:

Record two progressions in the Web Animations WPT tests.

* web-platform-tests/web-animations/timing-model/animations/updating-the-finished-state-expected.txt:

Source/WebCore:

We must call updateFinishedState() when an animation gets sampled as it means its timeline's time has progressed
and it may have crossed to a finished state. Calling updateFinishedState() when sampling means that we'll correctly
set the animation's hold time to its end value, which means that currentTime() will now always be clamped to return
the end time once its has reached it, so we must not schedule animations to resolve immediately anymore since otherwise
they will keep being scheduled in a loop.

* animation/WebAnimation.cpp:
(WebCore::WebAnimation::timeToNextRequiredTick const):
(WebCore::WebAnimation::resolve):

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

3 years agoChange Event's returnValue so it doesn't expose a new primitive
cdumez@apple.com [Mon, 16 Apr 2018 01:01:18 +0000 (01:01 +0000)]
Change Event's returnValue so it doesn't expose a new primitive
https://bugs.webkit.org/show_bug.cgi?id=184415

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Import test coverage from https://github.com/w3c/web-platform-tests/pull/10258.

* web-platform-tests/dom/events/AddEventListenerOptions-passive-expected.txt:
* web-platform-tests/dom/events/AddEventListenerOptions-passive.html:
* web-platform-tests/dom/events/Event-constructors.html:
* web-platform-tests/dom/events/Event-defaultPrevented-after-dispatch-expected.txt:
* web-platform-tests/dom/events/Event-defaultPrevented-after-dispatch.html:
* web-platform-tests/dom/events/Event-defaultPrevented-expected.txt:
* web-platform-tests/dom/events/Event-defaultPrevented.html:
* web-platform-tests/dom/events/Event-dispatch-click.html:
* web-platform-tests/dom/events/Event-dispatch-detached-click.html:
* web-platform-tests/dom/events/Event-dispatch-other-document.html:
* web-platform-tests/dom/events/Event-initEvent.html:
* web-platform-tests/dom/events/Event-returnValue-expected.txt: Added.
* web-platform-tests/dom/events/Event-returnValue.html: Added.
* web-platform-tests/dom/events/EventListener-handleEvent.html:
* web-platform-tests/dom/events/EventTarget-dispatchEvent-returnvalue-expected.txt:
* web-platform-tests/dom/events/EventTarget-dispatchEvent-returnvalue.html:
* web-platform-tests/dom/events/w3c-import.log:
* web-platform-tests/dom/interfaces-expected.txt:
* web-platform-tests/interfaces/dom.idl:

Source/WebCore:

Update Event.returnValue setter to match the latest DOM specification after:
- https://github.com/whatwg/dom/pull/626

In particular, the returnValue setter is now a no-op if the new flag value
is true. If the input flag value is false, it only sets the 'canceled' flag
if the event is cancelable and the event’s in passive listener flag is unset.

Test: imported/w3c/web-platform-tests/dom/events/Event-returnValue.html

* dom/Event.cpp:
(WebCore::Event::setLegacyReturnValue):
(WebCore::Event::setCanceledFlagIfPossible):
(WebCore::Event::preventDefault):
* dom/Event.h:

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

3 years ago[iOS] Add API tests for PDF find-in-page
aestes@apple.com [Sun, 15 Apr 2018 21:21:51 +0000 (21:21 +0000)]
[iOS] Add API tests for PDF find-in-page
https://bugs.webkit.org/show_bug.cgi?id=184634

Reviewed by Dan Bernstein.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit/find.pdf: Added.
* TestWebKitAPI/Tests/WebKitCocoa/WKPDFView.mm:
(-[TestFindDelegate findString]):
(-[TestFindDelegate _webView:didCountMatches:forString:]):
(-[TestFindDelegate _webView:didFindMatches:forString:withMatchIndex:]):
(-[TestFindDelegate _webView:didFailToFindString:]):
(loadWebView):
(TEST):

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

3 years agoFunction.prototype.caller shouldn't return generator bodies
fpizlo@apple.com [Sun, 15 Apr 2018 17:38:01 +0000 (17:38 +0000)]
Function.prototype.caller shouldn't return generator bodies
https://bugs.webkit.org/show_bug.cgi?id=184630

Reviewed by Yusuke Suzuki.
JSTests:

* stress/function-caller-async-arrow-function-body.js: Added.
* stress/function-caller-async-function-body.js: Added.
* stress/function-caller-async-generator-body.js: Added.
* stress/function-caller-generator-body.js: Added.
* stress/function-caller-generator-method-body.js: Added.

Source/JavaScriptCore:

Function.prototype.caller no longer returns generator bodies. Those are meant to be
private.

Also added some builtin debugging tools so that it's easier to do the investigation that I
did.

* builtins/BuiltinNames.h:
* runtime/JSFunction.cpp:
(JSC::JSFunction::callerGetter):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::globalFuncBuiltinDescribe):
* runtime/JSGlobalObjectFunctions.h:

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

3 years ago[WPE] Install files needed for WebKitWebExtensions
mcatanzaro@igalia.com [Sun, 15 Apr 2018 16:32:26 +0000 (16:32 +0000)]
[WPE] Install files needed for WebKitWebExtensions
https://bugs.webkit.org/show_bug.cgi?id=179915

Reviewed by Žan Doberšek.

.:

* Source/cmake/OptionsWPE.cmake:

Source/WebKit:

* PlatformWPE.cmake: Install pkg-config file, injected bundle, and API headers.
* UIProcess/API/glib/WebKitWebContext.cpp: Load the injected bundle when installed.
* wpe/wpe-web-extension.pc.in: Added.

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

3 years agoUnreviewed, rolling out r230659.
commit-queue@webkit.org [Sun, 15 Apr 2018 01:42:00 +0000 (01:42 +0000)]
Unreviewed, rolling out r230659.
https://bugs.webkit.org/show_bug.cgi?id=184633

Landed prematurely (Requested by ap on #webkit).

Reverted changeset:

"Deactivate the WindowServer connection for the WebContent
process."
https://bugs.webkit.org/show_bug.cgi?id=184451
https://trac.webkit.org/changeset/230659

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

3 years agoDeactivate the WindowServer connection for the WebContent process.
pvollan@apple.com [Sat, 14 Apr 2018 17:57:52 +0000 (17:57 +0000)]
Deactivate the WindowServer connection for the WebContent process.
https://bugs.webkit.org/show_bug.cgi?id=184451
<rdar://problem/38313938>

Reviewed by Brent Fulgham.

Defining ENABLE_WEBPROCESS_WINDOWSERVER_BLOCKING as 1 will deactivate the WindowServer connection
for the WebContent process by enabling the call to 'CGSSetDenyWindowServerConnections(true)' on
process startup. After calling this function, every attempt to establish a connection to the
WindowServer from the WebContent process will fail, except for CA render server connections.

* wtf/FeatureDefines.h:

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

3 years ago[GStreamer] Expose a method to retrieve the GstStream from a TrackPrivateBaseGStreamer
commit-queue@webkit.org [Sat, 14 Apr 2018 09:11:11 +0000 (09:11 +0000)]
[GStreamer] Expose a method to retrieve the GstStream from a TrackPrivateBaseGStreamer
https://bugs.webkit.org/show_bug.cgi?id=184620

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

This is a minor change, a dedicated test doesn't really make sense here.

* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
(WebCore::TrackPrivateBaseGStreamer::stream):

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

3 years ago[GTK][WPE] Build is broken after r230640
commit-queue@webkit.org [Sat, 14 Apr 2018 07:00:54 +0000 (07:00 +0000)]
[GTK][WPE] Build is broken after r230640
https://bugs.webkit.org/show_bug.cgi?id=184623

Patch by Carlos Eduardo Ramalho <cadubentzen@gmail.com> on 2018-04-14
Reviewed by Žan Doberšek.

UIProcess/SuspendedPageProxy.cpp was not included to CMake build in r230640.

* CMakeLists.txt: Added UIProcess/SuspendedPageProxy.cpp to WebKit_SOURCES.

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

3 years ago[LayoutReloaded] Update class documentation
zalan@apple.com [Sat, 14 Apr 2018 04:48:35 +0000 (04:48 +0000)]
[LayoutReloaded] Update class documentation
https://bugs.webkit.org/show_bug.cgi?id=184625

Reviewed by Antti Koivisto.

* LayoutReloaded/DisplayTree/Box.js:
* LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js:
* LayoutReloaded/FormattingContext/BlockFormatting/BlockMarginCollapse.js:
* LayoutReloaded/FormattingContext/FloatingContext.js:
* LayoutReloaded/FormattingContext/FormattingContext.js:
* LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js:
* LayoutReloaded/FormattingContext/InlineFormatting/Line.js:
* LayoutReloaded/FormattingState/BlockFormattingState.js:
* LayoutReloaded/FormattingState/FloatingState.js:
* LayoutReloaded/FormattingState/FormattingState.js:
* LayoutReloaded/FormattingState/InlineFormattingState.js:
* LayoutReloaded/LayoutState.js:
* LayoutReloaded/LayoutTree/BlockContainer.js:
* LayoutReloaded/LayoutTree/Box.js:
* LayoutReloaded/LayoutTree/Container.js:
* LayoutReloaded/LayoutTree/InlineBox.js:
* LayoutReloaded/LayoutTree/InlineContainer.js:
* LayoutReloaded/LayoutTree/Text.js:
* LayoutReloaded/misc/headers/BlockContainer.h: Removed.
* LayoutReloaded/misc/headers/BlockFormattingContext.h: Removed.
* LayoutReloaded/misc/headers/BlockMarginCollapse.h: Removed.
* LayoutReloaded/misc/headers/Box.h: Removed.
* LayoutReloaded/misc/headers/Container.h: Removed.
* LayoutReloaded/misc/headers/FloatingContext.h: Removed.
* LayoutReloaded/misc/headers/FormattingContext.h: Removed.
* LayoutReloaded/misc/headers/InitialBlockContainer.h: Removed.
* LayoutReloaded/misc/headers/InlineBox.h: Removed.
* LayoutReloaded/misc/headers/LayoutContext.h: Removed.
* LayoutReloaded/misc/headers/Line.h: Removed.
* LayoutReloaded/misc/headers/Text.h: Removed.

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

3 years ago[LayoutReloaded] Add simple implementation for FormattingState::markNeedsLayout()
zalan@apple.com [Sat, 14 Apr 2018 03:21:59 +0000 (03:21 +0000)]
[LayoutReloaded] Add simple implementation for FormattingState::markNeedsLayout()
https://bugs.webkit.org/show_bug.cgi?id=184621

Reviewed by Antti Koivisto.

This is just a simple, mark ancestors dirty implementation.

* LayoutReloaded/FormattingState/FormattingState.js:
(FormattingState.prototype.markNeedsLayout):
* LayoutReloaded/LayoutState.js:
(LayoutState.prototype.markNeedsLayout):
(LayoutState.prototype.setNeedsLayoutById): Deleted.
(LayoutState.prototype.setNeedsLayout): Deleted.
* LayoutReloaded/TreeBuilder.js:
(TreeBuilder.prototype._createAndAttachBox):
(TreeBuilder.prototype._findBox): Deleted.
* LayoutReloaded/Utils.js:
(Utils.layoutBoxById):
* LayoutReloaded/test/index.html:
* LayoutReloaded/test/simple-incremental-layout-with-static-content.html:

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

3 years ago[GTK][Wayland] Unflag test-case fast/canvas/canvas-createPattern-video-modify.html
commit-queue@webkit.org [Sat, 14 Apr 2018 03:14:45 +0000 (03:14 +0000)]
[GTK][Wayland] Unflag test-case fast/canvas/canvas-createPattern-video-modify.html
https://bugs.webkit.org/show_bug.cgi?id=182432

Patch by Carlos Ramalho <cadubentzen@gmail.com> on 2018-04-13
Reviewed by Michael Catanzaro.

* platform/gtk-wayland/TestExpectations: Unmarked fast/canvas/canvas-createPattern-video-modify.html

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

3 years ago[WPE] [webkitpy] The driver requirements should be checked before starting the tests
clopez@igalia.com [Sat, 14 Apr 2018 02:14:02 +0000 (02:14 +0000)]
[WPE] [webkitpy] The driver requirements should be checked before starting the tests
https://bugs.webkit.org/show_bug.cgi?id=184595

Reviewed by Michael Catanzaro.

Ensure Driver.check_driver() is checked at check_sys_deps() time.

* Scripts/webkitpy/port/wpe.py:
(WPEPort.check_sys_deps):

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

3 years agoUnreviewed, rolling out r230447.
ryanhaddad@apple.com [Sat, 14 Apr 2018 01:07:24 +0000 (01:07 +0000)]
Unreviewed, rolling out r230447.

Caused flaky selection test failures on iOS

Reverted changeset:

"Switch to UIWKTextInteractionAssistant for non-editable text"
https://bugs.webkit.org/show_bug.cgi?id=182834
https://trac.webkit.org/changeset/230447

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

3 years agoMark http/wpt/service-workers/header-filtering.https.html as flaky.
ryanhaddad@apple.com [Sat, 14 Apr 2018 00:39:59 +0000 (00:39 +0000)]
Mark http/wpt/service-workers/header-filtering.https.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=184469

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

3 years agoMark http/tests/cache-storage/cache-records-persistency.https.html as flaky.
ryanhaddad@apple.com [Sat, 14 Apr 2018 00:39:58 +0000 (00:39 +0000)]
Mark http/tests/cache-storage/cache-records-persistency.https.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=177380

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

3 years agoMark media/audio-concurrent-supported.html as flaky.
ryanhaddad@apple.com [Sat, 14 Apr 2018 00:39:56 +0000 (00:39 +0000)]
Mark media/audio-concurrent-supported.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=184612

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years agoMark media/video-volume-slider-drag.html as flaky.
ryanhaddad@apple.com [Sat, 14 Apr 2018 00:39:53 +0000 (00:39 +0000)]
Mark media/video-volume-slider-drag.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=184610

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years agoSkip animations/added-while-suspended.html and transitions/created-while-suspended...
ryanhaddad@apple.com [Fri, 13 Apr 2018 23:30:46 +0000 (23:30 +0000)]
Skip animations/added-while-suspended.html and transitions/created-while-suspended.html.
https://bugs.webkit.org/show_bug.cgi?id=184608

Unreviewed test gardening.

* platform/ios/TestExpectations:
* platform/mac/TestExpectations:

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

3 years agoWebKit crashes when libwebrtc.dylib is missing
rniwa@webkit.org [Fri, 13 Apr 2018 22:42:24 +0000 (22:42 +0000)]
WebKit crashes when libwebrtc.dylib is missing
https://bugs.webkit.org/show_bug.cgi?id=184607

Rubber-stamped by Jer Noble.

Don't call LibWebRTC related code when libwebrtc is not available.

* dom/Document.cpp:
(WebCore::Document::prepareForDestruction):
(WebCore::Document::suspend):

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

3 years agoSplit WindowProxy handling out of ScriptController and into a new class owned by...
cdumez@apple.com [Fri, 13 Apr 2018 21:23:54 +0000 (21:23 +0000)]
Split WindowProxy handling out of ScriptController and into a new class owned by AbstractFrame
https://bugs.webkit.org/show_bug.cgi?id=184591

Reviewed by Sam Weinig.

Source/WebCore:

Split WindowProxy handling out of ScriptController and into a new class owned by AbstractFrame.
RemoteFrames do not need a ScriptController but do need to maintain WindowProxies.
This is work towards fixing Bug 184515.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/DOMWrapperWorld.cpp:
(WebCore::DOMWrapperWorld::~DOMWrapperWorld):
(WebCore::DOMWrapperWorld::clearWrappers):
* bindings/js/DOMWrapperWorld.h:
(WebCore::DOMWrapperWorld::didCreateWindowProxy):
(WebCore::DOMWrapperWorld::didDestroyWindowProxy):
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::toJSDOMWindow):
* bindings/js/JSDOMWindowProxy.cpp:
(WebCore::toJS):
(WebCore::toJSDOMWindowProxy):
* bindings/js/ScriptCachedFrameData.cpp:
(WebCore::ScriptCachedFrameData::ScriptCachedFrameData):
(WebCore::ScriptCachedFrameData::restore):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::~ScriptController):
(WebCore::ScriptController::evaluateInWorld):
(WebCore::ScriptController::loadModuleScriptInWorld):
(WebCore::ScriptController::linkAndEvaluateModuleScriptInWorld):
(WebCore::ScriptController::evaluateModule):
(WebCore::ScriptController::clearWindowProxiesNotMatchingDOMWindow):
(WebCore::ScriptController::setDOMWindowForWindowProxy):
(WebCore::ScriptController::initScriptForWindowProxy):
(WebCore::ScriptController::setupModuleScriptHandlers):
(WebCore::ScriptController::windowProxyController):
(WebCore::ScriptController::enableEval):
(WebCore::ScriptController::enableWebAssembly):
(WebCore::ScriptController::disableEval):
(WebCore::ScriptController::disableWebAssembly):
(WebCore::ScriptController::attachDebugger):
(WebCore::ScriptController::updateDocument):
(WebCore::ScriptController::collectIsolatedContexts):
(WebCore::ScriptController::windowScriptNPObject):
(WebCore::ScriptController::executeIfJavaScriptURL):
* bindings/js/ScriptController.h:
(WebCore::ScriptController::globalObject):
* bindings/js/ScriptControllerMac.mm:
(WebCore::ScriptController::windowScriptObject):
* bindings/js/ScriptState.cpp:
(WebCore::mainWorldExecState):
* bindings/js/WindowProxyController.cpp: Added.
(WebCore::WindowProxyController::WindowProxyController):
(WebCore::WindowProxyController::destroyWindowProxy):
(WebCore::WindowProxyController::createWindowProxy):
(WebCore::WindowProxyController::windowProxies):
(WebCore::WindowProxyController::createWindowProxyWithInitializedScript):
* bindings/js/WindowProxyController.h: Added.
(WebCore::WindowProxyController::releaseWindowProxies):
(WebCore::WindowProxyController::setWindowProxies):
(WebCore::WindowProxyController::windowProxy):
(WebCore::WindowProxyController::existingWindowProxy const):
(WebCore::WindowProxyController::globalObject):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::dispatchDidClearWindowObjectInWorld):
* page/AbstractFrame.cpp:
(WebCore::AbstractFrame::AbstractFrame):
* page/AbstractFrame.h:
(WebCore::AbstractFrame::windowProxyController):
(WebCore::AbstractFrame::windowProxyController const):

Source/WebKit:

Split WindowProxy handling out of ScriptController and into a new class owned by AbstractFrame.
RemoteFrames do not need a ScriptController but do need to maintain WindowProxies.
This is work towards fixing Bug 184515.

* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::windowScriptNPObject):

Source/WebKitLegacy/mac:

Split WindowProxy handling out of ScriptController and into a new class owned by AbstractFrame.
RemoteFrames do not need a ScriptController but do need to maintain WindowProxies.
This is work towards fixing Bug 184515.

* Plugins/Hosted/NetscapePluginInstanceProxy.mm:
(WebKit::NetscapePluginInstanceProxy::getWindowNPObject):
* WebView/WebFrame.mm:
(-[WebFrame _attachScriptDebugger]):

Source/WTF:

Add isEmpty() convenience method to SizedIteratorRange.

* wtf/IteratorRange.h:
(WTF::SizedIteratorRange::isEmpty const):

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

3 years agoRebaseline LayoutReloaded patch file (collectRenderersWithNeedsLayout).
zalan@apple.com [Fri, 13 Apr 2018 18:40:07 +0000 (18:40 +0000)]
Rebaseline LayoutReloaded patch file (collectRenderersWithNeedsLayout).

* LayoutReloaded/misc/LayoutReloadedWebKit.patch:

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

3 years agoBoot fewer simulators in CI/EWS machines
jbedard@apple.com [Fri, 13 Apr 2018 18:11:14 +0000 (18:11 +0000)]
Boot fewer simulators in CI/EWS machines
https://bugs.webkit.org/show_bug.cgi?id=184594
<rdar://problem/39188082>

Reviewed by Alexey Proskuryakov.

This is a temporary workaround fro <rdar://problem/39393590>.

* Scripts/webkitpy/xcode/simulated_device.py:
(SimulatedDeviceManager): Treat simulators as taking 6 gigs instead of 2.

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

3 years agoIntroduce SuspendedPageProxy to keep old web processes around after their WebPageProx...
beidson@apple.com [Fri, 13 Apr 2018 18:04:22 +0000 (18:04 +0000)]
Introduce SuspendedPageProxy to keep old web processes around after their WebPageProxy has been swapped to a new one.
https://bugs.webkit.org/show_bug.cgi?id=184559

Reviewed by Alex Christensen.

Source/WebCore:

Covered by new API test.

WebCore changes rework the meaning of a "ForSuspension" policy to simply navigate the page to about:blank.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::redirectReceived):
(WebCore::DocumentLoader::willSendRequest):
(WebCore::DocumentLoader::startLoadingMainResource):
* loader/DocumentLoader.h:

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::init):
(WebCore::FrameLoader::continueLoadAfterNavigationPolicy):

Source/WebKit:

Before this patch, when a WebPageProxy navigates and is swapped to a new process, the old process almost always goes away.

This is not desirable for a few reasons:
1 - We can't keep the PageCache working for back/forward scenarios
2 - We throw away a "foo.com" web process, meaning the next time we need to host a "foo.com" web page we have to launch
    and initialize a new web process.

This patch adds a SuspendedPageProxy object to keep around the old web process and to manage communication with it.

For now, a WebPageProxy keeps exactly one "suspended page" representing the most recently visited page and its process.
Additionally, that process is never reused.

So no benefit is achieved with this patch, but it enables future benefits.

* Platform/Logging.h:

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

New object to represent the state of a WebPageProxy in an old web process that is not currently hosting the view.
* UIProcess/SuspendedPageProxy.cpp: Added.
(WebKit::SuspendedPageProxy::SuspendedPageProxy):
(WebKit::SuspendedPageProxy::~SuspendedPageProxy):
(WebKit::SuspendedPageProxy::webProcessDidClose):
(WebKit::SuspendedPageProxy::didFinishLoad):
(WebKit::SuspendedPageProxy::didReceiveMessage):
(WebKit::SuspendedPageProxy::loggingString const):
* UIProcess/SuspendedPageProxy.h: Copied from Source/WebKit/Platform/Logging.h.
(WebKit::SuspendedPageProxy::create):
(WebKit::SuspendedPageProxy::page const):
(WebKit::SuspendedPageProxy::process const):
(WebKit::SuspendedPageProxy::item const):
(WebKit::SuspendedPageProxy::finishedSuspending const):

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::reattachToWebProcess):
(WebKit::WebPageProxy::attachToProcessForNavigation):
(WebKit::WebPageProxy::maybeCreateSuspendedPage):
(WebKit::WebPageProxy::suspendedPageProcessClosed):
(WebKit::WebPageProxy::receivedPolicyDecision):
(WebKit::WebPageProxy::didFinishLoadForFrame):
* UIProcess/WebPageProxy.h:

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::suspendWebPageProxy):
(WebKit::WebProcessProxy::suspendedPageWasDestroyed):
(WebKit::WebProcessProxy::removeWebPage):
(WebKit::WebProcessProxy::didReceiveMessage): Optionally pass WebPageProxy messages along to SuspendedPageProxy objects.
(WebKit::WebProcessProxy::didClose):
(WebKit::WebProcessProxy::maybeShutDown):
(WebKit::WebProcessProxy::canTerminateChildProcess): Don't terminate child processes if they still have suspended pages.
* UIProcess/WebProcessProxy.h:

* WebKit.xcodeproj/project.pbxproj:

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setIsSuspended):
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::isSuspended const): For now, used only by WebProcess::updateActivePages. Will have more uses soon.
* WebProcess/WebPage/WebPage.messages.in:

* WebProcess/WebProcess.messages.in:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::updateActivePages): Allow the UIProcess to request an update of the web processes user visible name.

Source/WTF:

* wtf/DebugUtilities.h:
(WTF::debugString): Add a debug utility to easily construct a "const char*" that is released after a spin of the run loop.
  This greatly eases uses our String classes and functions inside of "%s" style environments like printf and LOG.

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

3 years agoinput.webkitEntries does not work as expected when folder contains accented chars
cdumez@apple.com [Fri, 13 Apr 2018 17:37:31 +0000 (17:37 +0000)]
input.webkitEntries does not work as expected when folder contains accented chars
https://bugs.webkit.org/show_bug.cgi?id=184517
<rdar://problem/39265537>

Reviewed by Alex Christensen.

Source/WebCore:

Use String::fromUTF8() to construct a WTF String from the char* returned by
dirname() in FileSystem::directoryName(). Previously, we were just calling
the String constructor, which would treat the input as latin 1 instead of
UTF-8.

Change is covered by an API test rather than a layout test due to file versioning
limitations.

* platform/posix/FileSystemPOSIX.cpp:
(WebCore::FileSystem::directoryName):

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebCore/FileSystem.cpp:
(TestWebKitAPI::TEST_F):

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

3 years agoUpdate my emails ordering in contributors.json
philn@webkit.org [Fri, 13 Apr 2018 17:31:45 +0000 (17:31 +0000)]
Update my emails ordering in contributors.json
https://bugs.webkit.org/show_bug.cgi?id=184587

Patch by Thibault Saunier <tsaunier@igalia.com> on 2018-04-13
Rubber-stamped by Philippe Normand.

Bugzilla seems to pick up tsaunier@igalia.com which is not the one I use there.

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

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

3 years ago[WebCore] Use @getByIdDirectPrivate / @putByIdDirectPrivate in WebCore JS
utatane.tea@gmail.com [Fri, 13 Apr 2018 17:01:40 +0000 (17:01 +0000)]
[WebCore] Use @getByIdDirectPrivate / @putByIdDirectPrivate in WebCore JS
https://bugs.webkit.org/show_bug.cgi?id=184401

Rubber stamped by Saam Barati.

Apply bug 183970 changes to WebCore JS too. This offers solid type checking
with @getByIdDirectPrivate().

* Modules/mediastream/RTCPeerConnection.js:
(initializeRTCPeerConnection):
(getLocalStreams):
(getStreamById):
(addStream):
* Modules/mediastream/RTCPeerConnectionInternals.js:
(isRTCPeerConnection):
* Modules/streams/ReadableByteStreamController.js:
(enqueue):
(error):
(close):
(getter.byobRequest):
* Modules/streams/ReadableByteStreamInternals.js:
(privateInitializeReadableStreamBYOBReader):
(privateInitializeReadableByteStreamController):
(privateInitializeReadableStreamBYOBRequest):
(isReadableByteStreamController):
(isReadableStreamBYOBRequest):
(isReadableStreamBYOBReader):
(readableByteStreamControllerCancel):
(readableByteStreamControllerError):
(readableByteStreamControllerClose):
(readableByteStreamControllerClearPendingPullIntos):
(readableByteStreamControllerGetDesiredSize):
(readableStreamHasBYOBReader):
(readableStreamHasDefaultReader):
(readableByteStreamControllerHandleQueueDrain):
(readableByteStreamControllerPull):
(readableByteStreamControllerShouldCallPull):
(readableByteStreamControllerCallPullIfNeeded):
(readableByteStreamControllerEnqueue):
(readableByteStreamControllerEnqueueChunk):
(readableByteStreamControllerRespondWithNewView):
(readableByteStreamControllerRespond):
(readableByteStreamControllerRespondInternal):
(readableByteStreamControllerRespondInReadableState):
(readableByteStreamControllerRespondInClosedState):
(readableByteStreamControllerProcessPullDescriptors):
(readableByteStreamControllerFillDescriptorFromQueue):
(readableByteStreamControllerShiftPendingDescriptor):
(readableByteStreamControllerInvalidateBYOBRequest):
(readableByteStreamControllerCommitDescriptor):
(readableStreamFulfillReadIntoRequest):
(readableByteStreamControllerPullInto):
(readableStreamAddReadIntoRequest):
* Modules/streams/ReadableStream.js:
(initializeReadableStream):
(pipeThrough):
* Modules/streams/ReadableStreamBYOBReader.js:
(cancel):
(read):
(releaseLock):
(getter.closed):
* Modules/streams/ReadableStreamBYOBRequest.js:
(respond):
(respondWithNewView):
(getter.view):
* Modules/streams/ReadableStreamDefaultController.js:
(error):
* Modules/streams/ReadableStreamDefaultReader.js:
(cancel):
(read):
(releaseLock):
(getter.closed):
* Modules/streams/ReadableStreamInternals.js:
(privateInitializeReadableStreamDefaultReader):
(readableStreamReaderGenericInitialize):
(readableStreamDefaultControllerError):
(readableStreamPipeTo):
(readableStreamTee):
(isReadableStream):
(isReadableStreamDefaultReader):
(isReadableStreamDefaultController):
(readableStreamError):
(readableStreamDefaultControllerCallPullIfNeeded):
(readableStreamDefaultControllerGetDesiredSize):
(readableStreamReaderGenericCancel):
(readableStreamCancel):
(readableStreamDefaultControllerCancel):
(readableStreamDefaultControllerPull):
(readableStreamDefaultControllerClose):
(readableStreamClose):
(readableStreamFulfillReadRequest):
(readableStreamDefaultReaderRead):
(readableStreamAddReadRequest):
(isReadableStreamDisturbed):
(readableStreamReaderGenericRelease):
(readableStreamDefaultControllerCanCloseOrEnqueue):
(privateInitializeReadableStreamDefaultController): Deleted.
* Modules/streams/StreamInternals.js:
(validateAndNormalizeQueuingStrategy):
* Modules/streams/WritableStream.js:
(initializeWritableStream):
(abort):
(close):
(write):
(getter.closed):
(getter.ready):
(getter.state):
* Modules/streams/WritableStreamInternals.js:
(isWritableStream):
(syncWritableStreamStateWithQueue):
(errorWritableStream):
(callOrScheduleWritableStreamAdvanceQueue):
* bindings/js/JSDOMBindingInternals.js:
(mapLikeForEach):

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

3 years agoInline NetworkLoad::sharedWillSendRedirectedRequest() into NetworkLoad::willPerformHT...
dbates@webkit.org [Fri, 13 Apr 2018 16:54:12 +0000 (16:54 +0000)]
Inline NetworkLoad::sharedWillSendRedirectedRequest() into NetworkLoad::willPerformHTTPRedirection()
https://bugs.webkit.org/show_bug.cgi?id=184593

Reviewed by Alex Christensen.

Following the removal of the pre-Network Session code in r227364, NetworkLoad::sharedWillSendRedirectedRequest()
is only referenced from NetworkLoad::willPerformHTTPRedirection(). We should inline its
implementation into the NetworkLoad::willPerformHTTPRedirection(), remove a function call,
and the cognitive load to follow such a function call when reading the code.

No functionality changed. So, no new tests.

* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::willPerformHTTPRedirection): Moved the implementation of NetworkLoad::sharedWillSendRedirectedRequest()
into this function.
(WebKit::NetworkLoad::sharedWillSendRedirectedRequest): Deleted. Moved its implementation
into NetworkLoad::willPerformHTTPRedirection().
* NetworkProcess/NetworkLoad.h:

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

3 years agoInline NetworkLoad::sharedWillSendRedirectedRequest() into NetworkLoad::willPerformHT...
dbates@webkit.org [Fri, 13 Apr 2018 16:48:56 +0000 (16:48 +0000)]
Inline NetworkLoad::sharedWillSendRedirectedRequest() into NetworkLoad::willPerformHTTPRedirection()
https://bugs.webkit.org/show_bug.cgi?id=184593

Reviewed by Alex Christensen.

Following the removal of the pre-Network Session code in r227364, NetworkLoad::sharedWillSendRedirectedRequest()
is only referenced from NetworkLoad::willPerformHTTPRedirection(). We should inline its
implementation into the NetworkLoad::willPerformHTTPRedirection(), remove a function call,
and the cognitive load to follow such a function call when reading the code.

No functionality changed. So, no new tests.

* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::willPerformHTTPRedirection): Moved the implementation of NetworkLoad::sharedWillSendRedirectedRequest()
into this function.
(WebKit::NetworkLoad::sharedWillSendRedirectedRequest): Deleted. Moved its implementation
into NetworkLoad::willPerformHTTPRedirection().
* NetworkProcess/NetworkLoad.h:

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

3 years ago[WPE] xkbcommon: ERROR: failed to add default include path /home/mcatanzaro/Projects...
mcatanzaro@igalia.com [Fri, 13 Apr 2018 16:29:08 +0000 (16:29 +0000)]
[WPE] xkbcommon: ERROR: failed to add default include path /home/mcatanzaro/Projects/WebKit/WebKitBuild/DependenciesWPE/Root/share/X11/xkb
https://bugs.webkit.org/show_bug.cgi?id=184388

Reviewed by Carlos Alberto Lopez Perez.

Remove libxkbcommon from the JHBuild environment. We could alternatively add
xkeyboard-config, but there doesn't seem to be any need to build libxkbcommon because I do
not believe it depends on anything else in the JHBuild environment.

* wpe/install-dependencies:
* wpe/jhbuild.modules:

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

3 years agoREGRESSION(r230468): Improper assertion firing under STP
bfulgham@apple.com [Fri, 13 Apr 2018 16:17:44 +0000 (16:17 +0000)]
REGRESSION(r230468): Improper assertion firing under STP
<rdar://problem/39411676>

Unreviewed, rolling out an improper assertion.

I added an assertion in Bug 184322 that should not have been added. I did not notice that this
call stack was always used in builds where NSApp is still active. Builds where we stop relying
on AppKit runloops uses a different code path to shut down.

* Shared/mac/ChildProcessMac.mm:
(WebKit::ChildProcess::stopNSAppRunLoop):

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

3 years ago[Web Animations] Turn CSS Animations and CSS Transitions as Web Animations on by...
graouts@webkit.org [Fri, 13 Apr 2018 16:02:11 +0000 (16:02 +0000)]
[Web Animations] Turn CSS Animations and CSS Transitions as Web Animations on by default
https://bugs.webkit.org/show_bug.cgi?id=184569
<rdar://problem/38671301>

Reviewed by Jon Lee.

LayoutTests/imported/w3c:

This test now fails at a later assertion, so updating the expectation for it.

* web-platform-tests/web-animations/interfaces/Animatable/animate-expected.txt:

Source/WebCore:

We now set the CSS Animations and CSS Transitions as Web Animations flag on by default. To ensure that some remaining
tests pass with this flag on, we expose a way to get to a PseudoElement via a new internals.pseudoElement() method. This
allows tests that used internals.pauseAnimationAtTimeOnPseudoElement() and internals.pauseTransitionAtTimeOnPseudoElement()
to now work with the Web Animations API.

* page/RuntimeEnabledFeatures.h:
* testing/Internals.cpp:
(WebCore::Internals::pseudoElement):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit:

* Shared/WebPreferences.yaml:

Source/WebKitLegacy/mac:

* WebView/WebPreferences.mm:

Source/WebKitLegacy/win:

Make sure Web Animations and CSS Animations and CSS Transitions are enabled by default on Windows.

* WebPreferences.cpp:

Tools:

We set the default value for the CSS Animations and CSS Transitions as Web Animations flag to true
but override it to be false always in the LayoutTests/legacy-animation-engine directory.

* DumpRenderTree/TestOptions.h:
* DumpRenderTree/mac/DumpRenderTree.mm:
(shouldOverrideAndDisableCSSAnimationsAndCSSTransitionsBackedByWebAnimationsPreference):
(runTest):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):
* WebKitTestRunner/TestOptions.cpp:
(WTR::isLegacyAnimationEngineTestPath):
(WTR::TestOptions::TestOptions):
* WebKitTestRunner/TestOptions.h:

LayoutTests:

* TestExpectations: A small number of tests regressed with the flag on, so we list them and have raised
bugs to fix them ASAP.
* animations/animation-direction-alternate-reverse-expected.txt:
* animations/animation-direction-alternate-reverse.html: This test was incorrect since it assumes that at the
end active boundary time we are using the end value whereas we are using the start value. Indeed, since the
fill-mode is "none", at the end of the active time, the progress is null per the Web Animations spec.
* animations/animation-hit-test-transform.html: Stop using the internals method.
* animations/animation-internals-api-expected.txt: Removed.
* animations/animation-internals-api-multiple-keyframes-expected.txt: Removed.
* animations/animation-internals-api-multiple-keyframes.html: Removed. This test only tests an internals method
that is no longer relevant for the new animation engine, but preserved for compatibility with legacy tests.
* animations/animation-internals-api.html: Removed. This test only tests an internals method that is no longer
relevant for the new animation engine, but preserved for compatibility with legacy tests.
* animations/big-rotation-expected.txt:
* animations/big-rotation.html: Here again we are correcting a test which made the wrong assumption about the
value generated at the end active boundary time.
* animations/duplicated-keyframes-name.html: We make the animation fill forwards to check that we are using
the correct end value for an animation with multiple 100% keyframe.
* animations/fill-forwards-end-state.html: Same as previous test.
* animations/fill-mode-forwards-zero-duration-expected.txt:
* animations/fill-mode-forwards-zero-duration.html: This test should seek after its delay + duration, so we test
at 3s instead of 1s. This is due to a behavior difference between internals.pauseAnimationAtTimeOnElement() and
its replacement.
* fast/css-generated-content/pseudo-animation.html: Use internals.pseudoElement() and the Web Animations API rather
than internals.pauseAnimationAtTimeOnPseudoElement().
* fast/css-generated-content/pseudo-transition.html: Use internals.pseudoElement() and the Web Animations API rather
than internals.pauseTransitionAtTimeOnPseudoElement().
* platform/ios/TestExpectations:
* platform/win/TestExpectations: Remove references to tests that we are removing.
* transitions/remove-transition-style.html: Use document.getAnimations() to figure out how many animations are running.
* transitions/transition-drt-api-delay-expected.txt: Removed.
* transitions/transition-drt-api-delay.html: Removed. This test only tests an internals method that is no longer
relevant for the new animation engine, but preserved for compatibility with legacy tests.
* transitions/transition-drt-api-expected.txt: Removed.
* transitions/transition-drt-api.html: Removed. This test only tests an internals method that is no longer
relevant for the new animation engine, but preserved for compatibility with legacy tests.
* transitions/transition-hit-test-transform.html: Stop using internals.pauseTransitionAtTimeOnElement().
* transitions/zero-duration-with-non-zero-delay-end.html: Use the Web Animations API instead of internals.numberOfActiveAnimations().

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

3 years agoMark some legacy-animation-engine tests as failures on Windows.
pvollan@apple.com [Fri, 13 Apr 2018 15:46:15 +0000 (15:46 +0000)]
Mark some legacy-animation-engine tests as failures on Windows.
https://bugs.webkit.org/show_bug.cgi?id=184482

Unreviewed test gardening.

* platform/win/TestExpectations:

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

3 years ago[WebVR][OpenVR] Implement requestPresent()/exitPresent() and getLayers()
svillar@igalia.com [Fri, 13 Apr 2018 15:19:00 +0000 (15:19 +0000)]
[WebVR][OpenVR] Implement requestPresent()/exitPresent() and getLayers()
https://bugs.webkit.org/show_bug.cgi?id=184530

Reviewed by Žan Doberšek.

WebVR apps should invoke requestPresent() to start presenting contents of a VRLayerInit
(right now a HTML canvas with a WebGL context) on the VRDisplay. This request might fail for
a variety of reasons and can be eventually cancelled with exitPresent(). Once we are
presenting we could access the presenting layers (right now just one) with getLayers().

Note that we are not presenting anything to the HMD yet, that will be done later in a follow
up patch.

I took the chance to correct a mistak in the VRDisplayCapabilities object which has a method
that should be called maxLayers instead of maxLayer.

* Modules/webvr/VRDisplay.cpp:
(WebCore::VRDisplay::requestPresent):
(WebCore::VRDisplay::stopPresenting):
(WebCore::VRDisplay::exitPresent):
(WebCore::VRDisplay::getLayers const):
(WebCore::VRDisplay::isPresenting const): Deleted. Implemented in the header file.
* Modules/webvr/VRDisplay.h:
(WebCore::VRDisplay::isPresenting const):
* Modules/webvr/VRDisplayCapabilities.h:
(WebCore::VRDisplayCapabilities::maxLayers const): Renamed from maxLayer().
(WebCore::VRDisplayCapabilities::maxLayer const): Deleted.
* Modules/webvr/VRDisplayCapabilities.idl:

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

3 years agoREGRESSION(r230627): [GTK][WPE] Possible deadlock when destroying the player in non...
magomez@igalia.com [Fri, 13 Apr 2018 13:18:29 +0000 (13:18 +0000)]
REGRESSION(r230627): [GTK][WPE] Possible deadlock when destroying the player in non AC mode
https://bugs.webkit.org/show_bug.cgi?id=184583

Reviewed by Carlos Garcia Campos.

In non AC mode, ensure that a deadlock can't happen when destroying MediaPlayerPrivateGStreamerBase.

Covered by existent tests.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
(WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
(WebCore::MediaPlayerPrivateGStreamerBase::cancelRepaint):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:

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

3 years ago[GTK][GStreamer] Mark a few crashing tests since playbin3 was made available
csaavedra@igalia.com [Fri, 13 Apr 2018 10:27:35 +0000 (10:27 +0000)]
[GTK][GStreamer] Mark a few crashing tests since playbin3 was made available

Unreviewed gardening
* platform/gtk/TestExpectations:

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

3 years ago[GTK] [gstreamer] video won't unpause when built with -DUSE_GSTREAMER_GL=OFF
magomez@igalia.com [Fri, 13 Apr 2018 10:09:23 +0000 (10:09 +0000)]
[GTK] [gstreamer] video won't unpause when built with -DUSE_GSTREAMER_GL=OFF
https://bugs.webkit.org/show_bug.cgi?id=183362

Reviewed by Carlos Garcia Campos.

Remove the drawCancelled flag and use a new one to indicate that the player is being destroyed.
That new flag is only enabled on destruction and it's not modified by cancelRepaint(), which
can be used to handle the pause event without avoiding future renderings. Also cancelRepaint()
has only effect when not in AC mode.

Covered by existent tests.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
(WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
(WebCore::MediaPlayerPrivateGStreamerBase::cancelRepaint):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:

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

3 years ago[DFG] Remove duplicate 32bit ProfileType implementation
utatane.tea@gmail.com [Fri, 13 Apr 2018 09:05:52 +0000 (09:05 +0000)]
[DFG] Remove duplicate 32bit ProfileType implementation
https://bugs.webkit.org/show_bug.cgi?id=184536

Reviewed by Saam Barati.

This patch removes duplicate 32bit ProfileType implementation by unifying 32/64 implementations.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileProfileType):
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::branchIfUndefined):
(JSC::AssemblyHelpers::branchIfNull):

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

3 years ago[GStreamer] Convert GStreamerUtilities in GStreamerCommon and include the GStreamer...
calvaris@igalia.com [Fri, 13 Apr 2018 08:50:42 +0000 (08:50 +0000)]
[GStreamer] Convert GStreamerUtilities in GStreamerCommon and include the GStreamer smart pointer traits
https://bugs.webkit.org/show_bug.cgi?id=184533

Reviewed by Philippe Normand.

Renamed GStreamerUtilities* files into GStreamerCommon* and
modified files including them accordingly. Include
GRefPtrGStreamer.h and GUniquePtrGStreamer.h in GStreamerCommon.h
to avoid problems destroying objects when those files are
forgotten to be included.

Source/WebCore:

* Modules/webaudio/AudioContext.cpp:
* platform/GStreamer.cmake:
* platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
* platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h:
* platform/graphics/gstreamer/GStreamerCommon.cpp: Renamed from Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.cpp.
* platform/graphics/gstreamer/GStreamerCommon.h: Renamed from Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.h.
* platform/graphics/gstreamer/ImageGStreamer.h:
* platform/graphics/gstreamer/ImageGStreamerCairo.cpp:
* platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
* platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/gstreamer/MediaSampleGStreamer.cpp:
* platform/graphics/gstreamer/MediaSampleGStreamer.h:
* platform/graphics/gstreamer/TextCombinerGStreamer.cpp:
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
* platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
* platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h:
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
* platform/graphics/gstreamer/eme/GStreamerEMEUtilities.cpp:
* platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h:
* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
* platform/graphics/gstreamer/mse/AppendPipeline.h:
* platform/graphics/gstreamer/mse/GStreamerMediaDescription.cpp:
* platform/graphics/gstreamer/mse/GStreamerMediaDescription.h:
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
* platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
* platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
* platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.h:

Source/WebKit:

* UIProcess/gtk/WebProcessPoolGtk.cpp:
* UIProcess/wpe/WebProcessPoolWPE.cpp:
* WebProcess/soup/WebProcessSoup.cpp:

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

3 years ago[GLIB] Tests WTF_RefPtr.ReleaseInNonMainThread and WTF_RefPtr.ReleaseInNonMainThreadD...
carlosgc@webkit.org [Fri, 13 Apr 2018 07:26:59 +0000 (07:26 +0000)]
[GLIB] Tests WTF_RefPtr.ReleaseInNonMainThread and WTF_RefPtr.ReleaseInNonMainThreadDestroyInMainThread are crashing since they were added
https://bugs.webkit.org/show_bug.cgi?id=184531

Reviewed by Michael Catanzaro.

It's not a bug in WebKit, but in the tests. The problem is that those tests are using RunLoop::main() but main
run loop hasn't been initialized. ReleaseInNonMainThread doesn't really need to initialize the main run loop if
we change Util::run() to always use RunLop::current() instead of RunLoop::main(). But
ReleaseInNonMainThreadDestroyInMainThread ends up scheduling a task to the main thread, and the generic
implementation fo that uses RunLoop::main(), so we need to initialize the main loop in this case.

* TestWebKitAPI/Tests/WTF/RefPtr.cpp:
(TestWebKitAPI::TEST): Call RunLoop::initializeMainRunLoop().
* TestWebKitAPI/glib/UtilitiesGLib.cpp:
(TestWebKitAPI::Util::run): Use RunLop::current() to stop the current run loop.
(TestWebKitAPI::Util::sleep): Ditto.

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

3 years agoLessen partial scavenge interval on x86-64
sbarati@apple.com [Fri, 13 Apr 2018 06:52:36 +0000 (06:52 +0000)]
Lessen partial scavenge interval on x86-64
https://bugs.webkit.org/show_bug.cgi?id=184577

Rubber-stamped by Filip Pizlo.

I initially made the scavenge interval longer because I had thought the
shorter interval caused a JetStream regression. I was mistaken though.
I was looking at the wrong commit range when analyzing perf data.

This patch shortens the interval, but still keeps x86-64 50% longer than
other architectures. We know that scavenging frequently on Mac is less
important to overall system performance than it is on iOS.

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

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

3 years ago[LayoutReloaded] Add support for incremental layout
zalan@apple.com [Fri, 13 Apr 2018 05:27:52 +0000 (05:27 +0000)]
[LayoutReloaded] Add support for incremental layout
https://bugs.webkit.org/show_bug.cgi?id=184578

Reviewed by Antti Koivisto.

* LayoutReloaded/Layout.js:
(layout):
* LayoutReloaded/LayoutState.js:
(LayoutState.prototype.rootContainer):
(LayoutState.prototype.setNeedsLayoutById):
* LayoutReloaded/Utils.js:
(Utils.layoutTreeDump):
* LayoutReloaded/test/TestHarness.js:
(verifyLayout):
(runLayout):
(verifyLayoutTreeDump): Deleted.
* LayoutReloaded/test/index.html:
* LayoutReloaded/test/simple-incremental-layout-with-static-content.html: Added.

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

3 years ago[LayoutReloaded] Move root container ownership to layout state
zalan@apple.com [Fri, 13 Apr 2018 03:09:03 +0000 (03:09 +0000)]
[LayoutReloaded] Move root container ownership to layout state
https://bugs.webkit.org/show_bug.cgi?id=184575

Reviewed by Antti Koivisto.

Now the root container is on the associated layout state (ICB only at this point though).

* LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js:
(BlockFormattingContext.prototype.layout):
* LayoutReloaded/FormattingContext/FormattingContext.js:
(FormattingContext.prototype._layoutOutOfFlowDescendants):
* LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js:
(InlineFormattingContext.prototype._handleInlineBlockContainer):
(InlineFormattingContext.prototype._handleFloatingBox):
* LayoutReloaded/Layout.js:
(layout):
* LayoutReloaded/LayoutState.js:
(LayoutState):
(LayoutState.prototype.formattingContext):
(LayoutState.prototype.establishedFormattingState):
(LayoutState.prototype.formattingStateForBox):
(LayoutState.prototype.needsLayout):
(LayoutState.prototype.displayBox):
(LayoutState.prototype._formattingContext):
(LayoutState.prototype.layout): Deleted.
(LayoutState.prototype.formattingStates): Deleted.
(LayoutState.prototype.initialDisplayBox): Deleted.
* LayoutReloaded/Utils.js:
(Utils._dumpBox):
(Utils._findDisplayBox): Deleted.

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

3 years ago[Curl] Fix clang build error in CurlContext.cpp
commit-queue@webkit.org [Fri, 13 Apr 2018 01:56:24 +0000 (01:56 +0000)]
[Curl] Fix clang build error in CurlContext.cpp
https://bugs.webkit.org/show_bug.cgi?id=184561

Patch by Christopher Reid <chris.reid@sony.com> on 2018-04-12
Reviewed by Darin Adler.

MSVC allows explicit template specialization in classes but gcc/clang do not.

* platform/network/curl/CurlContext.cpp:

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

3 years ago[Curl] Cookie Database on memory path should be :memory:
commit-queue@webkit.org [Fri, 13 Apr 2018 01:27:54 +0000 (01:27 +0000)]
[Curl] Cookie Database on memory path should be :memory:
https://bugs.webkit.org/show_bug.cgi?id=184572

Patch by Christopher Reid <chris.reid@sony.com> on 2018-04-12
Reviewed by Alex Christensen.

CookieJarDB::isOnMemory is comparing the database path with :onmemory: but it should be using :memory:
For reference, see: https://www.sqlite.org/inmemorydb.html

* platform/network/curl/CookieJarDB.h:

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

3 years agoWeb Inspector: Refactoring: move popover styles from JS to CSS
nvasilyev@apple.com [Fri, 13 Apr 2018 01:09:50 +0000 (01:09 +0000)]
Web Inspector: Refactoring: move popover styles from JS to CSS
https://bugs.webkit.org/show_bug.cgi?id=184558

Reviewed by Brian Burg.

Introduce several CSS variables to customize popover appearance in CSS
and not JavaScript.

* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView.prototype._waterfallPopoverContentForResource):
(WI.NetworkTableContentView.prototype._handleMousedownWaterfall):
* UserInterface/Views/Popover.css:
(.popover):
* UserInterface/Views/Popover.js:
(WI.Popover):
(WI.Popover.prototype._drawBackground):
Replace `var` with `let`.

(WI.Popover.prototype.get backgroundStyle): Deleted.
(WI.Popover.prototype.set backgroundStyle): Deleted.
* UserInterface/Views/ResourceTimingBreakdownView.css:
(.popover.waterfall-popover):
(.waterfall-popover-content .resource-timing-breakdown):
(.waterfall-popover .resource-timing-breakdown): Deleted.

* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView.prototype._waterfallPopoverContentForResource):
(WI.NetworkTableContentView.prototype._handleMousedownWaterfall):
* UserInterface/Views/Popover.css:
(.popover):
* UserInterface/Views/Popover.js:
(WI.Popover):
(WI.Popover.prototype._drawBackground):
* UserInterface/Views/ResourceTimingBreakdownView.css:
(.popover.waterfall-popover):
(.waterfall-popover-content .resource-timing-breakdown):

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

3 years agoAttmept to fix the Windows build following <https://trac.webkit.org/changeset/230602/>
dbates@webkit.org [Fri, 13 Apr 2018 00:11:06 +0000 (00:11 +0000)]
Attmept to fix the Windows build following <https://trac.webkit.org/changeset/230602/>
(https://bugs.webkit.org/show_bug.cgi?id=184386)

Visual Studio cannot prove that all cases in the switch are covered :(
So, add an ASSERT_NOT_REACHED() and a return a value outside of the switch block.

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

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

3 years agoIntroduce remote variants of Frame / DOMWindow classes
cdumez@apple.com [Thu, 12 Apr 2018 23:55:02 +0000 (23:55 +0000)]
Introduce remote variants of Frame / DOMWindow classes
https://bugs.webkit.org/show_bug.cgi?id=184467
<rdar://problem/39011267>

Reviewed by Ryosuke Niwa.

Introduce remote variants of Frame / DOMWindow classes, for when these frames / windows
are hosted on another WebProcess. Those will be used in a follow-up patch.

The hierarchy is as follows (class naming will be improved in a follow-up patch to minimise
patch size):
- AbstractFrame: A frame that can be either local or remote (hosted on another WebProcess)
    - Frame: A local frame
    - RemoteFrame: A frame hosted on another WebProcess. A RemoteFrame's window is also remote.
- AbstractDOMWindow: A window that be either local or remote (hosted on another WebProcess)
    - DOMWindow: A local DOMWindow
    - RemoteDOMWindow: A window hosted on another WebProcess. A RemoteDOMWindow's frame is also
      remote. A RemoteDOMWindow is always cross-origin.

This patch introduces global identifiers (unique across all WebProcesses) for both Frames and
Windows. This is useful as we need to know which Frame / DOMWindow a particular RemoteFrame /
RemoteDOMWindow is pointing to.

Follow-up patch will add support for converting a local DOMWindow / Frame into a remote ones,
when a newly opened window (via window.open) is navigated cross-origin (Bug 184515).

Other things we'll need to implement in follow-ups:
- RemoteDOMWindow will need to know about its opener in order to support the window.opener
  API. Internally, the opener will be stored as a RemoteFrame so that window.opener always
  returns the current window in the opener frame (which changes upon navigation).
- Nullify a RemoteDOMWindow's frame whenever the window it is pointing to becomes frameless.
  A frameless window behaves very differently (e.g. very little API is exposed to the Web).
  This happens when either the newly opened window is either closed or navigated.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* loader/ContentFilter.cpp:
(WebCore::ContentFilter::didDecide):
* page/AbstractDOMWindow.cpp: Added.
(WebCore::AbstractDOMWindow::AbstractDOMWindow):
(WebCore::AbstractDOMWindow::~AbstractDOMWindow):
* page/AbstractDOMWindow.h: Added.
(WebCore::AbstractDOMWindow::identifier const):
* page/AbstractFrame.cpp: Added.
(WebCore::AbstractFrame::AbstractFrame):
(WebCore::AbstractFrame::~AbstractFrame):
* page/AbstractFrame.h: Added.
(WebCore::AbstractFrame::window const):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::DOMWindow):
* page/DOMWindow.h:
(isType):
* page/Frame.cpp:
(WebCore::Frame::window const):
(WebCore::Frame::virtualWindow const):
* page/Frame.h:
(isType):
* page/GlobalFrameIdentifier.h: Added.
(WebCore::GlobalFrameIdentifier::encode const):
(WebCore::GlobalFrameIdentifier::decode):
* page/GlobalWindowIdentifier.h: Added.
(WebCore::operator==):
(WebCore::GlobalWindowIdentifier::hash const):
(WebCore::GlobalWindowIdentifier::encode const):
(WebCore::GlobalWindowIdentifier::decode):
(WTF::GlobalWindowIdentifierHash::hash):
(WTF::GlobalWindowIdentifierHash::equal):
(WTF::HashTraits<WebCore::GlobalWindowIdentifier>::emptyValue):
(WTF::HashTraits<WebCore::GlobalWindowIdentifier>::constructDeletedValue):
(WTF::HashTraits<WebCore::GlobalWindowIdentifier>::isDeletedValue):

* page/RemoteDOMWindow.cpp: Added.
(WebCore::RemoteDOMWindow::RemoteDOMWindow):
(WebCore::RemoteDOMWindow::~RemoteDOMWindow):
(WebCore::RemoteDOMWindow::self const):
(WebCore::RemoteDOMWindow::location const):
(WebCore::RemoteDOMWindow::close):
(WebCore::RemoteDOMWindow::closed const):
(WebCore::RemoteDOMWindow::focus):
(WebCore::RemoteDOMWindow::blur):
(WebCore::RemoteDOMWindow::length const):
(WebCore::RemoteDOMWindow::top const):
(WebCore::RemoteDOMWindow::opener const):
(WebCore::RemoteDOMWindow::parent const):
(WebCore::RemoteDOMWindow::postMessage):
The DOM API exposed on RemoteDOMWindow is only the subset of the DOMWindow API that is exposed cross origin,
since remote DOMWindow are always from a different origin. The short-term plan is to implement these in a
follow-up by relying on IPC (synchronous when necessary) to fetch the information from the real window in
the WebProcess where it lives. Longer term, we should probably keep RemoteDOMWindow members in sync with the
DOMWindow they're pointing to, so we do not have to rely on synchronous IPC.

* page/RemoteDOMWindow.h: Added.
(isType):
* page/RemoteFrame.cpp: Added.
(WebCore::RemoteFrame::RemoteFrame):
(WebCore::RemoteFrame::~RemoteFrame):
(WebCore::RemoteFrame::virtualWindow const):
* page/RemoteFrame.h: Added.
(isType):

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

3 years ago[mac-wk2] LayoutTest http/tests/security/anchor-download-allow-data.html is a flaky...
krollin@apple.com [Thu, 12 Apr 2018 23:41:41 +0000 (23:41 +0000)]
[mac-wk2] LayoutTest http/tests/security/anchor-download-allow-data.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=161745
<rdar://problem/39391176>

Unreviewed test gardening. Re-enable this test now that it is
consistently passing.

* platform/mac-wk2/TestExpectations:

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

3 years agoREGRESSION: [mac-wk2 release] LayoutTest http/tests/security/cross-origin-plugin...
krollin@apple.com [Thu, 12 Apr 2018 23:40:22 +0000 (23:40 +0000)]
REGRESSION: [mac-wk2 release] LayoutTest http/tests/security/cross-origin-plugin-allowed.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=161539
<rdar://problem/39389781>

Unreviewed test gardening. Re-enabled this test. It passes in local
testing and the flakiness dashboard doesn't show any problems with it.

* platform/mac-wk2/TestExpectations:

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

3 years agoAddress possible "CFNetwork SSLHandshake failed (-9847)" test failure.
krollin@apple.com [Thu, 12 Apr 2018 23:38:19 +0000 (23:38 +0000)]
Address possible "CFNetwork SSLHandshake failed (-9847)" test failure.
https://bugs.webkit.org/show_bug.cgi?id=184487

Unreviewed test gardening. Mark
upgrade-redirect-https-to-http-script-in-iframe.html as no longer
flaky.

* platform/mac/TestExpectations:

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

3 years agoFix the MOBILE_WIFI build
bdakin@apple.com [Thu, 12 Apr 2018 23:33:56 +0000 (23:33 +0000)]
Fix the MOBILE_WIFI build
https://bugs.webkit.org/show_bug.cgi?id=184571
-and corresponding-
<rdar://problem/39398181>

Reviewed by Jer Noble.

* config.h:

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

3 years agoUse -iframework to ensure that frameworks from user paths and system paths are
bdakin@apple.com [Thu, 12 Apr 2018 23:24:14 +0000 (23:24 +0000)]
Use -iframework to ensure that frameworks from user paths and system paths are
ordered appropriately
https://bugs.webkit.org/show_bug.cgi?id=184557
-and corresponding-
rdar://problem/39386359

Reviewed by Dean Jackson.

* Configurations/WebKit.xcconfig:

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

3 years agoContent-Type not enforced for <script> allows for XSS
dbates@webkit.org [Thu, 12 Apr 2018 22:32:40 +0000 (22:32 +0000)]
Content-Type not enforced for <script> allows for XSS
https://bugs.webkit.org/show_bug.cgi?id=184386
<rdar://problem/39112268>

Reviewed by Brady Eidson.

LayoutTests/imported/w3c:

Update expected result now that we pass all sub tests.

* web-platform-tests/fetch/api/basic/block-mime-as-script-expected.txt:

Source/WebCore:

As per the Fetch standard, <https://fetch.spec.whatwg.org/#should-response-to-request-be-blocked-due-to-mime-type?> (16 March 2018),
we should block JavaScript scripts that are served with MIME type text/csv, or a MIME type
that begins with "audio/", "image/" or "video/".

As a side benefit of this change we now set the destination property [1] on preload requests.

[1] <https://fetch.spec.whatwg.org/#concept-request-destination>

Tests: http/tests/security/script-with-banned-mimetype.html
       http/tests/workers/worker-importScripts-banned-mimetype.html

* Sources.txt: Add file FetchIdioms.cpp.
* WebCore.xcodeproj/project.pbxproj: Add files FetchIdioms.{cpp, h}.
* dom/LoadableClassicScript.cpp:
(WebCore::LoadableClassicScript::notifyFinished): Check the MIME type of the response and
block the script if applicable.
* dom/LoadableScript.h: Add error type MIMEType.
* loader/FetchIdioms.cpp: Added.
(WebCore::shouldBlockResponseDueToMIMEType): Implements the "Should response to request be blocked
due to its MIME type?" algorithm from the Fetch standard.
* loader/FetchIdioms.h: Added.
* loader/FetchOptions.h:
(WebCore::isScriptLikeDestination): Implements the definition of "script like" as per <https://fetch.spec.whatwg.org/#request-destination-script-like>.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestImage): Removed logic to set the destination property as
CachedResourceLoader::requestResource() is now responsible for doing this.
(WebCore::CachedResourceLoader::requestFont): Ditto.
(WebCore::CachedResourceLoader::requestTextTrack): Ditto.
(WebCore::CachedResourceLoader::requestCSSStyleSheet): Ditto.
(WebCore::CachedResourceLoader::requestScript): Ditto.
(WebCore::CachedResourceLoader::requestXSLStyleSheet): Ditto.
(WebCore::CachedResourceLoader::requestMedia): Update comment to express that we should assert
that the destination property is either video or audio.
(WebCore::CachedResourceLoader::requestIcon): Remove logic to set the destination property as
CachedResourceLoader::requestResource() is now responsible for doing this.
(WebCore::CachedResourceLoader::requestRawResource): Removed assertion as this function is used to
load many kinds of requests that have different destination properties. The caller is responsible
for setting the appropriate destintion property.
(WebCore::CachedResourceLoader::requestMainResource): Remove logic to set the destination property
as CachedResourceLoader::requestResource() is now responsible for doing this.
(WebCore::destinationForType): Helper function that maps CachedResource::Type to FetchOptions::Destination.
(WebCore::CachedResourceLoader::requestResource): Set the destination property on the request if not
already set.
* loader/cache/CachedResourceLoader.h: Segregate requestRawResource() from the other request functions
and add a comment to explain what it is used for.
* workers/Worker.cpp:
(WebCore::Worker::create):
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::loadSynchronously): Set the destination property to FetchOptions::Destination::Script
and store it in an instance variable as we will need to reference it once we receive the HTTP response.
Note that this function is only used to support the Web API importScripts().
(WebCore::WorkerScriptLoader::loadAsynchronously): Store the passed destination property in an
instance as we will need to reference it once we receive the HTTP response.
(WebCore::WorkerScriptLoader::didReceiveResponse): Check the MIME type of the response and
block the script if applicable.
* workers/WorkerScriptLoader.h:
* workers/service/ServiceWorkerJob.cpp:
(WebCore::ServiceWorkerJob::fetchScriptWithContext): Set the destination property to FetchOptions::Destination::Serviceworker.

LayoutTests:

Add tests to ensure that we block JavaScript scripts with a banned MIME type and update expected results.

Update tests http/tests/security/{cross-origin-cached-scripts, cross-origin-cached-scripts-parallel}.html
to load JavaScript scripts with MIME type text/javascript. These tests load JavaScript scripts indirectly
via the helper script LayoutTests/http/tests/security/resources/allow-if-origin.php. The script
allow-if-origin.php returns a response with MIME type image/png in absence of query string argument
contentType. We need to update these tests to pass contentType=text/javascript to allow-if-origin.php.

* TestExpectations: Mark test web-platform-tests/fetch/api/basic/block-mime-as-script.html DumpJSConsoleLogInStdErr
to ignore console message output when comparing the actual and expected result because the order the
sub tests are run is non-deterministic and the blocked MIME error message is specific to the blocked
response.
* http/tests/security/contentTypeOptions/invalid-content-type-options-allowed-expected.txt:
* http/tests/security/contentTypeOptions/invalid-content-type-options-allowed.html:
* http/tests/security/contentTypeOptions/resources/script-with-header.pl: Modified to only
set the HTTP header X-Content-Type-Options if the query argument no-content-type-options it
not present or evaluates to false in a boolean context. This lets us make use of this script
to test banned JavaScript MIME types.
* http/tests/security/cross-origin-cached-scripts-expected.txt:
* http/tests/security/cross-origin-cached-scripts-parallel-expected.txt:
* http/tests/security/cross-origin-cached-scripts-parallel.html:
* http/tests/security/cross-origin-cached-scripts.html:
* http/tests/security/resources/abe-that-increments-scriptsSuccessfullyLoaded.jpg: Added.
This file is both a valid JPEG image and a valid JavaScript script. When interpreted as a JavaScript
script it will increment the global variable self.scriptsSuccessfullyLoaded (defining it if
not already defined).
* http/tests/security/script-with-banned-mimetype-expected.txt: Added.
* http/tests/security/script-with-banned-mimetype.html: Added.
* http/tests/workers/resources/worker-importScripts-banned-mimetype.php: Added.
* http/tests/workers/worker-importScripts-banned-mimetype-expected.txt: Added.
* http/tests/workers/worker-importScripts-banned-mimetype.html: Added.

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

3 years agoFix --build-directory flag for run-webkit-tests
jbedard@apple.com [Thu, 12 Apr 2018 22:03:34 +0000 (22:03 +0000)]
Fix --build-directory flag for run-webkit-tests
https://bugs.webkit.org/show_bug.cgi?id=184545
<rdar://problem/39385080>

Rubber-stamped by Aakash Jain.

The --build-directory path does not work with iOS-Simulator.

* Scripts/webkitpy/port/base.py:
(Port._build_path): Use the port configuration to calculate the root directory.
* Scripts/webkitpy/port/base_unittest.py:
(PortTest.test_build_path): Test build directories for embedded configurations.

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

3 years ago[Extra zoom mode] Suppress UI for inputs of type file in extra zoom mode
wenson_hsieh@apple.com [Thu, 12 Apr 2018 21:58:54 +0000 (21:58 +0000)]
[Extra zoom mode] Suppress UI for inputs of type file in extra zoom mode
https://bugs.webkit.org/show_bug.cgi?id=184556
<rdar://problem/39062239>

Reviewed by Andy Estes.

When running in this mode, we don't have the facilities to present document picker UI. For now, just make this
feature fail gracefully.

* UIProcess/ios/forms/WKFileUploadPanel.mm:
(-[WKFileUploadPanel presentWithParameters:resultListener:]):
(-[WKFileUploadPanel platformSupportsPickerViewController]):

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

3 years ago[Web Animations] Fix a host of small CSS Animations and CSS Transitions issues
graouts@webkit.org [Thu, 12 Apr 2018 21:25:56 +0000 (21:25 +0000)]
[Web Animations] Fix a host of small CSS Animations and CSS Transitions issues
https://bugs.webkit.org/show_bug.cgi?id=184555

Reviewed by Dean Jackson.

Source/WebCore:

A series of small and intertwined issues were preventing a number of CSS Animations and CSS Trantions
tests to fail when expressed as Web Animations.

* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::updateCSSAnimationsForElement): Pass the old and new RenderStyles to CSSAnimation::create()
since we're refactoring DeclarativeAnimation to create blending keyframes in initialize(), no longer requiring each subclass
to create them.
(WebCore::AnimationTimeline::cssAnimationForElementAndProperty): Return the animation, if any, for a property animated by
a CSS animation, so that we can determine if a property is already being animated when running a CSS Transition.
(WebCore::AnimationTimeline::updateCSSTransitionsForElement): Since a property can be specified twice in a "transition" property,
once via "all" and once explicitly, ensure we look at all currently running transitions for the currently-processed property to
see if we need to cancel this transition. Previously, we used to only see if it had been transitioned in the old style. We also
start transitions even if the duration is 0 provided the delay is a positive, non-zero value. Then, if there is a CSS Animation
for this property already running, use that animation's original unanimated style as the from value.
* animation/AnimationTimeline.h:
* animation/CSSAnimation.cpp:
(WebCore::CSSAnimation::create): The animation name is now set in the CSSAnimation constructor.
(WebCore::CSSAnimation::CSSAnimation): Set the animation name and keep a copy of the unanimated style such that we can
get it when a CSS Transition is created and takes precedence over this CSS Animation.
(WebCore::CSSAnimation::initialize): Deleted.
* animation/CSSAnimation.h:
* animation/CSSTransition.cpp:
(WebCore::CSSTransition::create):
(WebCore::CSSTransition::initialize):
* animation/CSSTransition.h:
* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::initialize): Call the new computeDeclarativeAnimationBlendingKeyframes() on the KeyframeEffect
directly in this method so that subclasses don't need to create it manually, but most important so that keyframes are created
before timing properties are set based on the backing animation.
* animation/DeclarativeAnimation.h:
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::getKeyframes): Ensure we have a CSSValue before trying to serialize it.
(WebCore::KeyframeEffectReadOnly::computeDeclarativeAnimationBlendingKeyframes):
(WebCore::KeyframeEffectReadOnly::computeCSSAnimationBlendingKeyframes): Use the animation's unanimated style to compute keyframes,
instead of a default RenderStyle which would not use the right values for implicit keyframes.
(WebCore::KeyframeEffectReadOnly::stylesWouldYieldNewCSSTransitionsBlendingKeyframes const): Look at the property used to create
the transition rather than that specified on the backing Animation object since it can be CSSPropertyInvalid in the case of
"transition: all".
(WebCore::KeyframeEffectReadOnly::setAnimatedPropertiesInStyle): If we're dealing with a CSS animation, we consider the first and
last keyframes to always have the property listed since the underlying style was provided and should be captured.
* animation/KeyframeEffectReadOnly.h:
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::createAnimatedElementUpdate): Apply CSS Animations after CSS Trasitions since they take precedence.

LayoutTests:

Mark more tests as passing when the CSS Animations and CSS Transitions as Web Animations flag is on.

* animations/animation-border-overflow.html:
* animations/lineheight-animation.html:
* animations/missing-from-to-transforms.html:
* animations/missing-values-first-keyframe.html:
* animations/missing-values-last-keyframe.html:
* animations/transition-and-animation-1.html:
* animations/transition-and-animation-2.html:
* animations/transition-and-animation-3.html:
* animations/width-using-ems.html:
* compositing/layer-creation/mismatched-rotated-transform-animation-overlap.html:
* compositing/layer-creation/multiple-keyframes-animation-overlap.html:
* compositing/layer-creation/scale-rotation-animation-overlap.html:
* compositing/layer-creation/translate-scale-animation-overlap.html:
* css3/filters/filter-animation-from-none-hw.html:
* css3/filters/filter-animation-from-none-multi-hw.html:
* css3/filters/filter-animation-from-none-multi.html:
* css3/filters/filter-animation-from-none.html:
* imported/blink/transitions/unprefixed-transform.html:
* transitions/interrupted-all-transition.html:

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

3 years ago[Web Animations] Only cancel declarative animations upon element removal
graouts@webkit.org [Thu, 12 Apr 2018 21:23:48 +0000 (21:23 +0000)]
[Web Animations] Only cancel declarative animations upon element removal
https://bugs.webkit.org/show_bug.cgi?id=184553

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Make some WPT tests opt into the CSS Animations and CSS Transtions as Web Animations flag.

* web-platform-tests/web-animations/interfaces/Animation/ready.html:
* web-platform-tests/web-animations/timing-model/animations/playing-an-animation.html:
* web-platform-tests/web-animations/timing-model/animations/reversing-an-animation.html:

Source/WebCore:

Ensure we only call cancel() on CSSAnimation and CSSTransition objects as we might otherwise reject
the ready promise and produce spurious logging from WPT tests.

* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::cancelDeclarativeAnimationsForElement):
(WebCore::AnimationTimeline::cancelAnimationsForElement): Deleted.
* animation/AnimationTimeline.h:
* dom/Element.cpp:
(WebCore::Element::removedFromAncestor):
* dom/PseudoElement.cpp:
(WebCore::PseudoElement::clearHostElement):
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::tearDownRenderers):

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

3 years agopemfile.py should not assume POSIX line endings
ross.kirsling@sony.com [Thu, 12 Apr 2018 20:48:09 +0000 (20:48 +0000)]
pemfile.py should not assume POSIX line endings
https://bugs.webkit.org/show_bug.cgi?id=184507

Reviewed by Daniel Bates.

* Scripts/webkitpy/common/system/pemfile.py:
(_parse_pem_format):
* Scripts/webkitpy/common/system/pemfile_unittest.py:
(PemFileTest.test_parse_crlf):
(PemFileTest.test_parse_cr):

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

3 years agoConsolidate some PtrTags.
mark.lam@apple.com [Thu, 12 Apr 2018 20:14:21 +0000 (20:14 +0000)]
Consolidate some PtrTags.
https://bugs.webkit.org/show_bug.cgi?id=184552
<rdar://problem/39389404>

Reviewed by Filip Pizlo.

Consolidate CodeEntryPtrTag and CodeEntryWithArityCheckPtrTag into CodePtrTag.
Consolidate NearCallPtrTag and NearJumpPtrTag into NearCodePtrTag.

* assembler/AbstractMacroAssembler.h:
(JSC::AbstractMacroAssembler::repatchNearCall):
* assembler/MacroAssemblerARM.h:
(JSC::MacroAssemblerARM::readCallTarget):
* assembler/MacroAssemblerARMv7.h:
(JSC::MacroAssemblerARMv7::readCallTarget):
* assembler/MacroAssemblerMIPS.h:
(JSC::MacroAssemblerMIPS::readCallTarget):
* assembler/MacroAssemblerX86.h:
(JSC::MacroAssemblerX86::readCallTarget):
* assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::readCallTarget):
* bytecode/AccessCase.cpp:
(JSC::AccessCase::generateImpl):
* bytecode/InlineAccess.cpp:
(JSC::InlineAccess::rewireStubAsJump):
* bytecode/PolymorphicAccess.cpp:
(JSC::PolymorphicAccess::regenerate):
* dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::linkOSRExits):
(JSC::DFG::JITCompiler::link):
(JSC::DFG::JITCompiler::compileFunction):
* dfg/DFGJITFinalizer.cpp:
(JSC::DFG::JITFinalizer::finalize):
(JSC::DFG::JITFinalizer::finalizeFunction):
* dfg/DFGOSREntry.cpp:
(JSC::DFG::prepareOSREntry):
* dfg/DFGOSRExit.cpp:
(JSC::DFG::OSRExit::executeOSRExit):
(JSC::DFG::adjustAndJumpToTarget):
(JSC::DFG::OSRExit::compileOSRExit):
* dfg/DFGOSRExitCompilerCommon.cpp:
(JSC::DFG::adjustAndJumpToTarget):
* dfg/DFGOperations.cpp:
* ftl/FTLJITCode.cpp:
(JSC::FTL::JITCode::executableAddressAtOffset):
* ftl/FTLJITFinalizer.cpp:
(JSC::FTL::JITFinalizer::finalizeCommon):
* ftl/FTLLazySlowPath.cpp:
(JSC::FTL::LazySlowPath::generate):
* ftl/FTLLink.cpp:
(JSC::FTL::link):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstruct):
(JSC::FTL::DFG::LowerDFGToB3::compileDirectCallOrConstruct):
(JSC::FTL::DFG::LowerDFGToB3::compileTailCall):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargsSpread):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargs):
(JSC::FTL::DFG::LowerDFGToB3::lazySlowPath):
* ftl/FTLOSRExitCompiler.cpp:
(JSC::FTL::compileFTLOSRExit):
* ftl/FTLOSRExitHandle.cpp:
(JSC::FTL::OSRExitHandle::emitExitThunk):
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::emitDumbVirtualCall):
* jit/JIT.cpp:
(JSC::JIT::compileWithoutLinking):
(JSC::JIT::link):
* jit/JITCall.cpp:
(JSC::JIT::compileOpCallSlowCase):
* jit/JITCode.cpp:
(JSC::JITCodeWithCodeRef::executableAddressAtOffset):
(JSC::NativeJITCode::addressForCall):
* jit/JITInlines.h:
(JSC::JIT::emitNakedCall):
(JSC::JIT::emitNakedTailCall):
* jit/JITMathIC.h:
(JSC::isProfileEmpty):
* jit/JITOpcodes.cpp:
(JSC::JIT::privateCompileHasIndexedProperty):
* jit/JITOperations.cpp:
* jit/JITPropertyAccess.cpp:
(JSC::JIT::stringGetByValStubGenerator):
(JSC::JIT::privateCompileGetByVal):
(JSC::JIT::privateCompileGetByValWithCachedId):
(JSC::JIT::privateCompilePutByVal):
(JSC::JIT::privateCompilePutByValWithCachedId):
* jit/JITThunks.cpp:
(JSC::JITThunks::hostFunctionStub):
* jit/Repatch.cpp:
(JSC::linkSlowFor):
(JSC::linkFor):
(JSC::linkPolymorphicCall):
* jit/SpecializedThunkJIT.h:
(JSC::SpecializedThunkJIT::finalize):
* jit/ThunkGenerators.cpp:
(JSC::virtualThunkFor):
(JSC::nativeForGenerator):
(JSC::boundThisNoArgsFunctionCallGenerator):
* llint/LLIntData.cpp:
(JSC::LLInt::initialize):
* llint/LLIntEntrypoint.cpp:
(JSC::LLInt::setEvalEntrypoint):
(JSC::LLInt::setProgramEntrypoint):
(JSC::LLInt::setModuleProgramEntrypoint):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
(JSC::LLInt::setUpCall):
* llint/LLIntThunks.cpp:
(JSC::LLInt::generateThunkWithJumpTo):
(JSC::LLInt::functionForCallEntryThunkGenerator):
(JSC::LLInt::functionForConstructEntryThunkGenerator):
(JSC::LLInt::functionForCallArityCheckThunkGenerator):
(JSC::LLInt::functionForConstructArityCheckThunkGenerator):
(JSC::LLInt::evalEntryThunkGenerator):
(JSC::LLInt::programEntryThunkGenerator):
(JSC::LLInt::moduleProgramEntryThunkGenerator):
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/NativeExecutable.cpp:
(JSC::NativeExecutable::finishCreation):
* runtime/NativeFunction.h:
(JSC::TaggedNativeFunction::TaggedNativeFunction):
(JSC::TaggedNativeFunction::operator NativeFunction):
* runtime/PtrTag.h:
* wasm/WasmBBQPlan.cpp:
(JSC::Wasm::BBQPlan::complete):
* wasm/WasmOMGPlan.cpp:
(JSC::Wasm::OMGPlan::work):
* wasm/WasmThunks.cpp:
(JSC::Wasm::throwExceptionFromWasmThunkGenerator):
(JSC::Wasm::throwStackOverflowFromWasmThunkGenerator):
(JSC::Wasm::triggerOMGTierUpThunkGenerator):
* wasm/js/WasmToJS.cpp:
(JSC::Wasm::wasmToJS):
* wasm/js/WebAssemblyFunction.h:
* yarr/YarrJIT.cpp:
(JSC::Yarr::YarrGenerator::compile):

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

3 years agoRemove block selection code
megan_gardner@apple.com [Thu, 12 Apr 2018 19:57:30 +0000 (19:57 +0000)]
Remove block selection code
https://bugs.webkit.org/show_bug.cgi?id=184470

Reviewed by Timothy Hatcher.

Remove block selection code that isn't run and is currently not even used.
Had to put this back in for a bug in the mid-year release, but we're past that
so it's time for this to go away.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::stopAssistingNode):
(WebKit::PageClientImpl::didUpdateBlockSelectionWithTouch): Deleted.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(toSelectionHandlePosition): Deleted.
(-[WKContentView _didUpdateBlockSelectionWithTouch:withFlags:growThreshold:shrinkThreshold:]): Deleted.
(-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:]): Deleted.
(-[WKContentView changeBlockSelectionWithTouchAt:withSelectionTouch:forHandle:]): Deleted.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::saveImageToLibrary):
(WebKit::WebPageProxy::updateBlockSelectionWithTouch): Deleted.
(WebKit::WebPageProxy::didUpdateBlockSelectionWithTouch): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::rangeAtWordBoundaryForPosition):
(WebKit::distanceBetweenRectsForPosition): Deleted.
(WebKit::rectsEssentiallyTheSame): Deleted.
(WebKit::unionDOMRanges): Deleted.
(WebKit::computeEdgeCenter): Deleted.
(WebKit::WebPage::expandedRangeFromHandle): Deleted.
(WebKit::WebPage::contractedRangeFromHandle): Deleted.
(WebKit::WebPage::computeExpandAndShrinkThresholdsForHandle): Deleted.
(WebKit::WebPage::rangeForBlockAtPoint): Deleted.
(WebKit::shouldExpand): Deleted.
(WebKit::WebPage::changeBlockSelection): Deleted.
(WebKit::WebPage::updateBlockSelectionWithTouch): Deleted.

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

3 years agoFix flakiness in insecure-iframe-in-main-frame.html
krollin@apple.com [Thu, 12 Apr 2018 19:18:46 +0000 (19:18 +0000)]
Fix flakiness in insecure-iframe-in-main-frame.html
https://bugs.webkit.org/show_bug.cgi?id=184432

Reviewed by Daniel Bates.

Mark insecure-iframe-in-main-frame.html as no longer flaky. Tweak it
so that the frame-load events of the test window do no interleave with
the frame-load events of the window opened by the test so that any
non-deterministic behavior doesn't affect the order of the expect
sequence of messages.

* TestExpectations:
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-iframe-in-main-frame-expected.txt:
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-iframe-in-main-frame.html:
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-iframe-in-main-frame-expected.txt:

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

3 years agoRemove unused crash hook functionality
mcatanzaro@igalia.com [Thu, 12 Apr 2018 18:56:29 +0000 (18:56 +0000)]
Remove unused crash hook functionality
https://bugs.webkit.org/show_bug.cgi?id=183369

Reviewed by Alexey Proskuryakov.

WTFSetCrashHook and WTFInstallReportBacktraceOnCrashHook are not used on any platforms and
can be removed.

* wtf/Assertions.cpp:
* wtf/Assertions.h:

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

3 years agoDon't have selections get stuck in editable elements
megan_gardner@apple.com [Thu, 12 Apr 2018 18:50:33 +0000 (18:50 +0000)]
Don't have selections get stuck in editable elements
https://bugs.webkit.org/show_bug.cgi?id=184483

Reviewed by Timothy Hatcher.

When selecting in editable elements, if the keyboard does not come up, which is not required,
then the selections are stuck in that element. If you try and select something in web content,
it will only select in the editable element. By clearing the assisted node when clearing a selection,
it no longer sticks. Also, textSelectionAssistant should not be used as if we are currently editing.
Change it to the function we created for that purpose in a pervious patch.

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

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

3 years agoRaise the partial scavenge interval even more on x86-64
sbarati@apple.com [Thu, 12 Apr 2018 18:35:17 +0000 (18:35 +0000)]
Raise the partial scavenge interval even more on x86-64
https://bugs.webkit.org/show_bug.cgi?id=184551

Rubber-stamped by Filip Pizlo.

The JetStream regression didn't recover from my previous patch.
This is another attempt to get it to recover perf.

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

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

3 years agoUnreviewed, rolling out r230554.
ryanhaddad@apple.com [Thu, 12 Apr 2018 18:32:26 +0000 (18:32 +0000)]
Unreviewed, rolling out r230554.

The non-ASCII character in the filename causes issues with SVN

Reverted changeset:

"input.webkitEntries does not work as expected when folder
contains accented chars"
https://bugs.webkit.org/show_bug.cgi?id=184517
https://trac.webkit.org/changeset/230554

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

3 years ago[WPE] Move libWPEWebInspectorResources.so to pkglibdir
mcatanzaro@igalia.com [Thu, 12 Apr 2018 18:19:50 +0000 (18:19 +0000)]
[WPE] Move libWPEWebInspectorResources.so to pkglibdir
https://bugs.webkit.org/show_bug.cgi?id=184379

Reviewed by Žan Doberšek.

Source/JavaScriptCore:

Load the module from the new location.

* PlatformWPE.cmake:
* inspector/remote/glib/RemoteInspectorUtils.cpp:
(Inspector::backendCommands):

Source/WebKit:

This is important to allow parallel installation.

* PlatformWPE.cmake:

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