WebKit.git
3 years agoTest fast/writing-mode/english-bt-text-with-spelling-marker.html should wait for...
dbates@webkit.org [Tue, 24 Oct 2017 23:33:03 +0000 (23:33 +0000)]
Test fast/writing-mode/english-bt-text-with-spelling-marker.html should wait for editing commands to complete
https://bugs.webkit.org/show_bug.cgi?id=178759

Reviewed by Ryosuke Niwa.

Make use of typeCharacterCommand() from (LayoutTests/editing/editing.js) to type each character
with a delay and delay test completion until all characters have been typed.

* fast/writing-mode/english-bt-text-with-spelling-marker-expected.html:
* fast/writing-mode/english-bt-text-with-spelling-marker.html:

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

3 years agoAllow OjbC Weak References when building TestAPI
msaboff@apple.com [Tue, 24 Oct 2017 22:59:51 +0000 (22:59 +0000)]
Allow OjbC Weak References when building TestAPI
https://bugs.webkit.org/show_bug.cgi?id=178748

Reviewed by Dan Bernstein.

Set TestAPI build flag Weak References in Manual Retain Release to true.

* JavaScriptCore.xcodeproj/project.pbxproj: Reverted.
* Configurations/ToolExecutable.xcconfig: Changed the flag here instead.

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

3 years agoNeed to pass non-nil argument to SimulateCrash() in bmalloc::logVMFailure()
ddkilzer@apple.com [Tue, 24 Oct 2017 22:30:15 +0000 (22:30 +0000)]
Need to pass non-nil argument to SimulateCrash() in bmalloc::logVMFailure()
<https://webkit.org/b/178740>
<rdar://problem/35154943>

Reviewed by Saam Barati.

* bmalloc/BPlatform.h:
(BUNUSED_PARAM): Define macro.
* bmalloc/Logging.cpp:
(SimulateCrash): Change third argument of SimulateCrash() to
CFStringRef since it's an NSString * in Objective-C.
(bmalloc::logVMFailure): Create a CFStringRef to use as a
description string.  Use new vmSize parameter to log size.
* bmalloc/Logging.h:
(bmalloc::logVMFailure): Update function signature to take a
size_t parameter representing vmSize.
* bmalloc/VMAllocate.h:
(bmalloc::tryVMAllocate): Pass vmSize into logVMFailure().

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

3 years agoEnable service worker to use cache storage api
commit-queue@webkit.org [Tue, 24 Oct 2017 22:28:44 +0000 (22:28 +0000)]
Enable service worker to use cache storage api
https://bugs.webkit.org/show_bug.cgi?id=178684

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-24
Reviewed by Brady Eidson.

Source/WebCore:

Test: http/tests/workers/service/service-worker-cache-api.https.html

Updated WorkerLoaderProxy so that it can create a CacheStorageConnection.
Update WorkerCacheStorageConnection to take benefit of that.
This allows creating a CacheStorageConnection based on the page for regular workers and differently for Service Worker context.

Added ServiceWorkerThreadProxy as a proxy to ServiceWorkerThread.
It is in particular responsible to do proxy for loading tasks.
It implements cache API support for service worker by creating a dedicated CacheStorageConnection.

* Modules/cache/WorkerCacheStorageConnection.cpp:
(WebCore::WorkerCacheStorageConnection::create):
(WebCore::WorkerCacheStorageConnection::~WorkerCacheStorageConnection):
(WebCore::WorkerCacheStorageConnection::doOpen):
(WebCore::WorkerCacheStorageConnection::doRemove):
(WebCore::WorkerCacheStorageConnection::doRetrieveCaches):
(WebCore::WorkerCacheStorageConnection::reference):
(WebCore::WorkerCacheStorageConnection::dereference):
(WebCore::WorkerCacheStorageConnection::doRetrieveRecords):
(WebCore::WorkerCacheStorageConnection::doBatchDeleteOperation):
(WebCore::WorkerCacheStorageConnection::doBatchPutOperation):
* WebCore.xcodeproj/project.pbxproj:
* workers/WorkerLoaderProxy.h:
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::createCacheStorageConnection):
* workers/WorkerMessagingProxy.h:
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::ServiceWorkerThread):
* workers/service/context/ServiceWorkerThread.h:
* workers/service/context/ServiceWorkerThreadProxy.cpp: Added.
(WebCore::ServiceWorkerThreadProxy::create):
(WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
(WebCore::ServiceWorkerThreadProxy::postTaskForModeToWorkerGlobalScope):
(WebCore::ServiceWorkerThreadProxy::postTaskToLoader):
(WebCore::ServiceWorkerThreadProxy::createCacheStorageConnection):
* workers/service/context/ServiceWorkerThreadProxy.h: Added.

Source/WebKit:

Passing the WebPreferences store of the default page group of the WebProcessPool to its ServiceWorker process.
ServiceWorkerContextManager then uses it to initialize the preferences accordingly.
Patch is covered by new test which is using cache api previously disabled and now enabled through the store.

Made use of the new ServiceWorkerThreadProxy in ServiceWorkerContextManager to enable a cache storage connection.
Fixed the default size of quota in WebsiteDataStore.

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::getWorkerContextProcessConnection):
* UIProcess/WebsiteData/WebsiteDataStore.h:
* WebProcess/Storage/ServiceWorkerContextManager.cpp:
(WebKit::ServiceWorkerContextManager::ServiceWorkerContextManager):
(WebKit::ServiceWorkerContextManager::updatePreferences):
(WebKit::ServiceWorkerContextManager::startServiceWorker):
(WebKit::ServiceWorkerContextManager::startFetch):
* WebProcess/Storage/ServiceWorkerContextManager.h:
(WebKit::ServiceWorkerContextManager::ServiceWorkerContextManager): Deleted.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::getWorkerContextConnection):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

LayoutTests:

* http/tests/workers/service/resources/service-worker-cache-api-worker.js: Added.
* http/tests/workers/service/resources/service-worker-cache-api.js: Added.
* http/tests/workers/service/service-worker-cache-api.https-expected.txt: Added.
* http/tests/workers/service/service-worker-cache-api.https.html: Added.

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

3 years agoSelecting and right-clicking URL-like strings with IDNA-disallowed characters in...
achristensen@apple.com [Tue, 24 Oct 2017 22:23:12 +0000 (22:23 +0000)]
Selecting and right-clicking URL-like strings with IDNA-disallowed characters in host or authority causes rendering engine crash
https://bugs.webkit.org/show_bug.cgi?id=174267

Reviewed by Tim Horton.

Source/WebKit:

* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageCanHandleRequest):

Tools:

* TestWebKitAPI/Tests/WebKit/CanHandleRequest_Bundle.cpp:
(TestWebKitAPI::runTest):

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

3 years agoOptionally store entire ResourceRequest for ping loads
achristensen@apple.com [Tue, 24 Oct 2017 22:20:59 +0000 (22:20 +0000)]
Optionally store entire ResourceRequest for ping loads
https://bugs.webkit.org/show_bug.cgi?id=178756

Reviewed by Tim Horton.

No change in behavior.
This uses less memory in the common loading case.
This will be needed for moving appcache loading to the Networking Process.
See https://bugs.webkit.org/show_bug.cgi?id=178540

* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::load):
* loader/cache/CachedResource.h:
(WebCore::CachedResource::setOriginalRequest):
(WebCore::CachedResource::originalRequest const):
(WebCore::CachedResource::setOriginalRequestHeaders): Deleted.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):

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

3 years agoSkipped imported/w3c/web-platform-tests/html/dom/dynamic-markup-insertion/opening...
jlewis3@apple.com [Tue, 24 Oct 2017 22:19:44 +0000 (22:19 +0000)]
Skipped imported/w3c/web-platform-tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/011.html on High Sierra Release.
https://bugs.webkit.org/show_bug.cgi?id=178553

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

3 years agoWeb Inspector: Console Drawer resizing doesn't match cursor position
joepeck@webkit.org [Tue, 24 Oct 2017 22:11:59 +0000 (22:11 +0000)]
Web Inspector: Console Drawer resizing doesn't match cursor position
https://bugs.webkit.org/show_bug.cgi?id=178753
<rdar://problem/35160484>

Reviewed by Brian Burg.

* UserInterface/Views/ConsoleDrawer.js:
(WI.ConsoleDrawer.prototype._updateDrawerHeight):
Drive-by fix an early return that would never have worked.

* UserInterface/Views/Main.css:
(#content):
Give the #content a flex grow of 1. This causes the space to grow as it
already was but now it does not affect the size of the fixed height sibling.

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

3 years ago[WebIDL] Support the ExportMacro attribute for dictionaries
aestes@apple.com [Tue, 24 Oct 2017 22:05:30 +0000 (22:05 +0000)]
[WebIDL] Support the ExportMacro attribute for dictionaries
https://bugs.webkit.org/show_bug.cgi?id=178752

Reviewed by Sam Weinig.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryHeaderContent):
* bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
* bindings/scripts/test/TestStandaloneDictionary.idl:

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

3 years agoWeb Inspector: Enable WebKit logging configuration and display
eric.carlson@apple.com [Tue, 24 Oct 2017 22:00:53 +0000 (22:00 +0000)]
Web Inspector: Enable WebKit logging configuration and display
https://bugs.webkit.org/show_bug.cgi?id=177027
<rdar://problem/33964767>

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/ConsoleMessage.cpp:
(Inspector::messageSourceValue): Inspector::Protocol::Console::ConsoleMessage ->
    Inspector::Protocol::Console::ChannelSource.
* inspector/agents/JSGlobalObjectConsoleAgent.cpp:
(Inspector::JSGlobalObjectConsoleAgent::getLoggingChannels): There are no logging channels
    specific to a JSContext yet, so return an empty channel array.
(Inspector::JSGlobalObjectConsoleAgent::setLoggingChannelLevel): No channels, return an error.
* inspector/agents/JSGlobalObjectConsoleAgent.h:

* inspector/protocol/Console.json: Add ChannelSource, ChannelLevel, and Channel. Add getLoggingChannels
    and setLoggingChannelLevel.

* inspector/scripts/codegen/generator.py: Special case "webrtc"-> "WebRTC".
* inspector/scripts/tests/generic/expected/enum-values.json-result:
* inspector/scripts/tests/generic/expected/type-declaration-array-type.json-result:
* inspector/scripts/tests/generic/expected/type-declaration-enum-type.json-result:
* inspector/scripts/tests/generic/expected/type-declaration-object-type.json-result:
* inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result:

* runtime/ConsoleTypes.h: Add Media and WebRTC.

Source/WebCore:

Test: inspector/console/webcore-logging.html

* dom/Document.cpp:
(WebCore::Document::~Document): Stop observing the logger.
(WebCore::Document::logger): Observe the logger.
(WebCore::Document::didLogMessage): Forward logging messages to the inspector.
* dom/Document.h:

* inspector/WebConsoleAgent.cpp:
(WebCore::WebConsoleAgent::getLoggingChannels): New, return the state of log runtime channels.
(WebCore::WebConsoleAgent::setLoggingChannelLevel): New, set the state of a channel.
* inspector/WebConsoleAgent.h:

* platform/Logging.cpp:
(WebCore::getLogChannel): New, get a log channel by name.
* platform/Logging.h:

Source/WebCore/PAL:

* pal/Logger.h:
(PAL::Logger::willLog const): Always return true for Always and Error so those messages are
    always logged to the system.
(PAL::Logger::log): Always log Always and Error to the system, but pay strict attention to level
    and channel state for logging to observers so logging only shows up in the inspector when
    explicitly enabled by the user.

Source/WebInspectorUI:

* Localizations/en.lproj/localizedStrings.js: Add new localized strings.

* UserInterface/Controllers/LogManager.js:
(WI.LogManager): Initialize _loggingChannelSources, fetch _customLoggingChannels.
(WI.LogManager.supportsLogChannels): New.
(WI.LogManager.prototype.get customLoggingChannels): New.
(WI.LogManager.prototype.get logChannelSources): New.

* UserInterface/Main.html:
* UserInterface/Models/ConsoleMessage.js: Add Media and WebRTC.

* UserInterface/Models/IssueMessage.js:
(WI.IssueMessage): Add media and webrtc.

* UserInterface/Models/LoggingChannel.js: Added.
(WI.LoggingChannel):
(WI.LoggingChannel.fromPayload):
(WI.LoggingChannel.prototype.get source):
(WI.LoggingChannel.prototype.get level):

* UserInterface/Views/LogContentView.js:
(WI.LogContentView): Add new scope buttons for "Log", "Info", and "Debug". Create log channel
    scope buttons once logging has started.
(WI.LogContentView.prototype.get navigationItems): Add the log message scope bar when necessary.
(WI.LogContentView.prototype._scopeFromMessageSource): New.
(WI.LogContentView.prototype._scopeFromMessageLevel): Don't group Info, Log, and Debug.
(WI.LogContentView.prototype._messageAdded): Force a UI update the first time a WebKit log
    message is added.

(WI.LogContentView.prototype._messageShouldBeVisible): New, deal with message source bar buttons.
(WI.LogContentView.prototype._messageSourceBarSelectionDidChange): New.
(WI.LogContentView.prototype._filterMessageElements): Deal with message source bar buttons.

* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createGeneralSettingsView): Create and initialize menus
    for each log channel.

Source/WebKitLegacy/mac:

* WebCoreSupport/WebChromeClient.mm:
(stringForMessageSource): Deal with Media and WebRTC message sources.

Tools:

Allow new 'dumpJSConsoleLogInStdErr' test header to redirect log console output to stderr.

* DumpRenderTree/TestOptions.h:
* DumpRenderTree/TestOptions.mm:
(TestOptions::TestOptions):
* DumpRenderTree/mac/DumpRenderTree.mm:
(runTest):
* WebKitTestRunner/TestController.cpp:
(WTR::updateTestOptionsFromTestHeader):
(WTR::TestController::runTest):
* WebKitTestRunner/TestOptions.h:
(WTR::TestOptions::hasSameInitializationOptions const):

LayoutTests:

* inspector/console/webcore-logging-expected.txt: Added.
* inspector/console/webcore-logging.html: Added.
* platform/mac/TestExpectations: Skip new test on Yosemite and ElCapitan.
* platform/win/TestExpectations: Skip new test.

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

3 years agoAttempted build fix for Sierra.
dino@apple.com [Tue, 24 Oct 2017 21:58:48 +0000 (21:58 +0000)]
Attempted build fix for Sierra.

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

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

3 years agoUncaught Exception: TypeError: null is not an object (evaluating 'this.treeOutline...
commit-queue@webkit.org [Tue, 24 Oct 2017 21:55:36 +0000 (21:55 +0000)]
Uncaught Exception: TypeError: null is not an object (evaluating 'this.treeOutline.isXMLMimeType')
https://bugs.webkit.org/show_bug.cgi?id=178745

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

* UserInterface/Views/DOMTreeUpdater.js:
(WI.DOMTreeUpdater.prototype._updateModifiedNodes):
An earlier tree element update might have caused this other tree element's
waiting to be updated to actually be removed. So just skip past them.

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

3 years agoWTF: Eliminated PLATFORM checks for HAVE_MACH_EXCEPTIONS
msaboff@apple.com [Tue, 24 Oct 2017 21:48:10 +0000 (21:48 +0000)]
WTF: Eliminated PLATFORM checks for HAVE_MACH_EXCEPTIONS
https://bugs.webkit.org/show_bug.cgi?id=178747

Reviewed by Saam Barati.

Removed unnecessary PLATFORM checks as they can cause build failures
when the include file is present.

* wtf/Platform.h:

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

3 years agoImplement resizing options for ImageBitmap rendering
dino@apple.com [Tue, 24 Oct 2017 21:46:41 +0000 (21:46 +0000)]
Implement resizing options for ImageBitmap rendering
https://bugs.webkit.org/show_bug.cgi?id=178687
<rdar://problem/35135417>

Reviewed by Sam Weinig.

Source/WebCore:

Implement many of the sizing options for createImageBitmap.

Test: http/wpt/2dcontext/imagebitmap/createImageBitmap-sizing.html

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

    Implement the first bit of the algorithm from
    the HTML specification.

(WebCore::outputSizeForSourceRectangle):

    ... and then the second bit. Leave the rest in
    comments for now.

(WebCore::interpolationQualityForResizeQuality):

    Helper function to map ImageBitmapOptions to
    GraphicsContext.

(WebCore::ImageBitmap::createPromise):

    Implement more of the sizing algorithm.

* html/ImageBitmap.h: Origin tainting is defined to be false by default.

LayoutTests:

More ImageBitmap tests, this time focusing on sizing.

* http/wpt/2dcontext/imagebitmap/common.js:
(createCanvasOfSize):
(create9x9CanvasWith2dContext):
(create18x18CanvasWith2dContext):

    Helper functions.

* http/wpt/2dcontext/imagebitmap/createImageBitmap-sizing-expected.txt: Added.
* http/wpt/2dcontext/imagebitmap/createImageBitmap-sizing.html: Added.
* http/wpt/2dcontext/imagebitmap/drawImage-ImageBitmap.html:
* http/wpt/2dcontext/imagebitmap/resources/target-blue-dot-no-intrinsic.svg: Added.
* http/wpt/2dcontext/imagebitmap/resources/target-blue-dot.png: Renamed from LayoutTests/http/wpt/2dcontext/imagebitmap/target-blue-dot.png.
* http/wpt/2dcontext/imagebitmap/resources/target-blue-dot.svg: Added.

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

3 years ago[GTK] Web Inspector: Add Recording.svg
commit-queue@webkit.org [Tue, 24 Oct 2017 21:35:30 +0000 (21:35 +0000)]
[GTK] Web Inspector: Add Recording.svg
https://bugs.webkit.org/show_bug.cgi?id=175045

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-10-24
Reviewed by Brian Burg.

* UserInterface/Images/gtk/Recording.svg: Added.

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

3 years agoAllow OjbC Weak References when building TestAPI
msaboff@apple.com [Tue, 24 Oct 2017 21:31:01 +0000 (21:31 +0000)]
Allow OjbC Weak References when building TestAPI
https://bugs.webkit.org/show_bug.cgi?id=178748

Reviewed by Saam Barati.

Set TestAPI build flag Weak References in Manual Retain Release to true.

* JavaScriptCore.xcodeproj/project.pbxproj:

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

3 years agoAdd initial implementation for serviceWorker.postMessage()
cdumez@apple.com [Tue, 24 Oct 2017 21:22:54 +0000 (21:22 +0000)]
Add initial implementation for serviceWorker.postMessage()
https://bugs.webkit.org/show_bug.cgi?id=178534

Reviewed by Youenn Fablet.

Source/WebCore:

Add initial implementation for serviceWorker.postMessage():
- https://w3c.github.io/ServiceWorker/#service-worker-postmessage

Test: http/tests/workers/service/basic-ServiceWorker-postMessage.https.html

* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSExtendableMessageEvent.cpp: Added.
(WebCore::JSExtendableMessageEvent::data const):
* bindings/js/WebCoreBuiltinNames.h:
* dom/Document.h:
* dom/EventNames.in:
* dom/MessagePortChannel.h:
* dom/ScriptExecutionContext.h:
* workers/WorkerGlobalScope.h:
* workers/service/ExtendableEvent.cpp:
(WebCore::ExtendableEvent::ExtendableEvent):
(WebCore::ExtendableEvent::~ExtendableEvent):
* workers/service/ExtendableEvent.h:
* workers/service/ExtendableMessageEvent.cpp: Added.
(WebCore::ExtendableMessageEvent::create):
(WebCore::ExtendableMessageEvent::ExtendableMessageEvent):
(WebCore::ExtendableMessageEvent::~ExtendableMessageEvent):
* workers/service/ExtendableMessageEvent.h: Added.
* workers/service/ExtendableMessageEvent.idl: Added.
* workers/service/ServiceWorker.cpp:
(WebCore::ServiceWorker::ServiceWorker):
(WebCore::ServiceWorker::postMessage):
(WebCore::ServiceWorker::state const):
(WebCore::ServiceWorker::scriptExecutionContext const):
* workers/service/ServiceWorker.h:
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::controller const):
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerGlobalScope.cpp:
(WebCore::ServiceWorkerGlobalScope::thread):
* workers/service/ServiceWorkerGlobalScope.h:
(isType):
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::postMessageToServiceWorkerGlobalScope):
* workers/service/context/ServiceWorkerThread.h:
* workers/service/server/SWClientConnection.h:

Source/WebKit:

Add initial implementation for serviceWorker.postMessage():
- https://w3c.github.io/ServiceWorker/#service-worker-postmessage

* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
* StorageProcess/ServiceWorker/WebSWServerConnection.h:
* StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
* WebProcess/Storage/ServiceWorkerContextManager.cpp:
(WebKit::ServiceWorkerContextManager::postMessageToServiceWorkerGlobalScope):
* WebProcess/Storage/ServiceWorkerContextManager.h:
* WebProcess/Storage/ServiceWorkerContextManager.messages.in:
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope):
* WebProcess/Storage/WebSWClientConnection.h:

LayoutTests:

Add layout test coverage.

* http/tests/workers/service/basic-ServiceWorker-postMessage.https-expected.txt: Added.
* http/tests/workers/service/basic-ServiceWorker-postMessage.https.html: Added.
* http/tests/workers/service/resources/basic-ServiceWorker-postMessage-worker.js: Added.
* http/tests/workers/service/resources/basic-ServiceWorker-postMessage.js: Added.

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

3 years agoWeb Inspector: allow ShaderProgram to be shown in CanvasContentView
webkit@devinrousso.com [Tue, 24 Oct 2017 21:17:17 +0000 (21:17 +0000)]
Web Inspector: allow ShaderProgram to be shown in CanvasContentView
https://bugs.webkit.org/show_bug.cgi?id=178714

Reviewed by Brian Burg.

* UserInterface/Views/CanvasDetailsSidebarPanel.js:
(WI.CanvasDetailsSidebarPanel.prototype.inspect):
Allow ShaderProgram to show the related Canvas information.

* UserInterface/Views/CanvasTabContentView.js:
(WI.CanvasTabContentView.prototype.canShowRepresentedObject):
(WI.CanvasTabContentView.prototype.showRepresentedObject):
(WI.CanvasTabContentView.prototype._canvasTreeOutlineSelectionDidChange):
If a ShaderProgram is selected in the path component, display a ShaderProgramContentView.

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

3 years agoWeb Inspector: remove canvases from Resources and experimental setting/UI
webkit@devinrousso.com [Tue, 24 Oct 2017 21:08:01 +0000 (21:08 +0000)]
Web Inspector: remove canvases from Resources and experimental setting/UI
https://bugs.webkit.org/show_bug.cgi?id=178711

Reviewed by Brian Burg.

* UserInterface/Base/Main.js:
(WI.tabContentViewClassForRepresentedObject):
* UserInterface/Base/Setting.js:
* UserInterface/Controllers/CanvasManager.js:
(WI.CanvasManager.prototype.canvasAdded):
(WI.CanvasManager.prototype.canvasRemoved):
* UserInterface/Models/Canvas.js:
* UserInterface/Models/Frame.js:
(WI.Frame):
(WI.Frame.prototype.get extraScriptCollection):
(WI.Frame.prototype.commitProvisionalLoad):
(WI.Frame.prototype.get canvasCollection): Deleted.
* UserInterface/Views/CanvasTabContentView.js:
(WI.CanvasTabContentView.isTabAllowed):
* UserInterface/Views/FrameTreeElement.js:
(WI.FrameTreeElement):
(WI.FrameTreeElement.prototype.onattach):
(WI.FrameTreeElement.prototype.ondetach):
(WI.FrameTreeElement.prototype.onpopulate):
(WI.FrameTreeElement.prototype._styleSheetAdded):
(WI.FrameTreeElement.prototype._canvasWasAdded): Deleted.
(WI.FrameTreeElement.prototype._canvasWasRemoved): Deleted.
* UserInterface/Views/ResourceSidebarPanel.js:
(WI.ResourceSidebarPanel):
(WI.ResourceSidebarPanel.prototype.matchTreeElementAgainstCustomFilters.match):
(WI.ResourceSidebarPanel.prototype.matchTreeElementAgainstCustomFilters):
(WI.ResourceSidebarPanel.prototype._treeSelectionDidChange):
* UserInterface/Views/ResourcesTabContentView.js:
(WI.ResourcesTabContentView):
(WI.ResourcesTabContentView.prototype.canShowRepresentedObject):
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createExperimentalSettingsView):

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

3 years ago[FTL] Support NewStringObject
utatane.tea@gmail.com [Tue, 24 Oct 2017 20:48:03 +0000 (20:48 +0000)]
[FTL] Support NewStringObject
https://bugs.webkit.org/show_bug.cgi?id=178737

Reviewed by Saam Barati.

JSTests:

* stress/new-string-object.js: Added.
(shouldBe):
(test):

Source/JavaScriptCore:

FTL should support NewStringObject and encourage use of NewStringObject in DFG pipeline.
After this change, we can convert `CallObjectConstructor(String)` to `NewStringObject(String)`.

* ftl/FTLAbstractHeapRepository.h:
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileNewStringObject):

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

3 years agoWeb Inspector: Show recordings in CanvasTabContentView
webkit@devinrousso.com [Tue, 24 Oct 2017 20:47:11 +0000 (20:47 +0000)]
Web Inspector: Show recordings in CanvasTabContentView
https://bugs.webkit.org/show_bug.cgi?id=177606
<rdar://problem/34715819>

Reviewed by Brian Burg.

Original patch by Matt Baker <mattbaker@apple.com>.

This patch folds canvas recordings into the new Canvas tab, which now
supports showing both CanvasCollections and Recordings.

When viewing recordings, a back button is shown at the start of the
navigation bar, allowing the user to return to the overview. It has been
styled with a back arrow, to make its function as clear as possible.
Like other navigation path components, the item for the recording can
clicked to select another recording taken from the same canvas.

The recording action scrubber has been moved from the content browser's
navigation bar to a more prominent location in the recording content view.
Selecting a frame tree element in the navigation sidebar no longer selects
the last action for that frame. This was changed to prevent the scrubber
position from behaving non-monotonically when selecting actions in sequential
order.

While this patch retains support for importing recordings, the feature
is not polished. Currently it is not possible to return to an imported
recording after leaving closing the view. In the future we may want to
consider including a navigation sidebar panel for the overview, which
could list canvas recordings (and eventually shaders).

* .eslintrc:
Drive-by: remove duplicate key.
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Base/Main.js:
(WI.contentLoaded):
(WI.tabContentViewClassForRepresentedObject):
* UserInterface/Main.html:
* UserInterface/Views/RecordingTabContentView.js: Removed.
Remove RecordingTabContentView.

* UserInterface/Images/Recording.svg:
New recording icon, used for tree elements and canvas preview UI.

* UserInterface/Models/Recording.js:
(WI.Recording):
(WI.Recording.prototype.get visualActionIndexes):
Visual action indexes should be computed by the recording.

* UserInterface/Views/CanvasContentView.js:
(WI.CanvasContentView):
(WI.CanvasContentView.prototype.refresh):
(WI.CanvasContentView.prototype.initialLayout):
(WI.CanvasContentView.prototype.attached):
(WI.CanvasContentView.prototype._recordingStopped):
(WI.CanvasContentView.prototype._handleRecordingSelectElementChange):
New UI for showing CanvasContentView as a CollectionView item. Includes
recordings button and select for choosing a recording to view.

* UserInterface/Views/CanvasOverviewContentView.css:
(.content-view.canvas-overview .content-view.canvas > header):
Switch to 13px, which is more frequently used.

(.content-view.canvas-overview .content-view.canvas > header .subtitle::before):
Switch to literal em dash. Surrounding spaces were ignored when using
the backslash-escaped character.

(.content-view.canvas-overview .content-view.canvas:not(:hover, .is-recording, .selected) > header > .navigation-bar):
(.content-view.canvas-overview .content-view.canvas > footer > .recordings):
(.content-view.canvas-overview .content-view.canvas > footer > .recordings::before):
(.content-view.canvas-overview .content-view.canvas > footer > .recordings > select):
(.content-view.canvas-overview .content-view.canvas > footer .recordings > select:focus):
(.content-view.canvas-overview .content-view.canvas > footer > .flexible-space):
(.popover-content > .tree-outline .item.recording > .icon):
(.popover-content > .tree-outline .item.recording:hover):
(.popover-content > .tree-outline .item.recording:hover > .icon):
(.content-view.canvas-overview .content-view.canvas:not(:hover, .is-recording) > header > .navigation-bar): Deleted.
(.content-view.canvas-overview .content-view.canvas > footer): Deleted.
New styles for the recording picker.

* UserInterface/Views/CanvasOverviewContentView.js:
(WI.CanvasOverviewContentView):
(WI.CanvasOverviewContentView.prototype.get selectionPathComponents):
(WI.CanvasOverviewContentView.prototype.contentViewAdded):
(WI.CanvasOverviewContentView.prototype.contentViewRemoved):
(WI.CanvasOverviewContentView.prototype._supplementalRepresentedObjectsDidChange):
(WI.CanvasOverviewContentView.prototype._selectedPathComponentChanged): Deleted.
(WI.CanvasOverviewContentView.prototype._supplementalRepresentedObjectsDidChange.createCanvasPathComponent): Deleted.
Canvas tree elements are now managed by CanvasTabContentView, which is
now responsible for maintaining the tree of canvas objects. For now the
tree holds canvases and recordings, but will eventually include shader programs.

* UserInterface/Views/CanvasTabContentView.css:
(.content-view.tab.canvas .navigation-bar > .item .recording > .icon):
(.content-view.tab.canvas .navigation-bar > .item > .canvas-overview > .icon): Deleted.
Add styles for recording path components.

* UserInterface/Views/CanvasTabContentView.js:
(WI.CanvasTabContentView):
(WI.CanvasTabContentView.prototype.treeElementForRepresentedObject):
(WI.CanvasTabContentView.prototype.canShowRepresentedObject):
(WI.CanvasTabContentView.prototype.showRepresentedObject):
(WI.CanvasTabContentView.prototype.shown):
(WI.CanvasTabContentView.prototype.restoreStateFromCookie):
(WI.CanvasTabContentView.prototype.attached):
(WI.CanvasTabContentView.prototype.detached):
(WI.CanvasTabContentView.prototype._canvasAdded):
(WI.CanvasTabContentView.prototype._canvasRemoved):
(WI.CanvasTabContentView.prototype._canvasTreeOutlineSelectionDidChange):
(WI.CanvasTabContentView.prototype._recordingStopped):
(WI.CanvasTabContentView.prototype._navigationSidebarImport):
(WI.CanvasTabContentView.prototype._navigationSidebarTreeOutlineSelectionChanged):
(WI.CanvasTabContentView.prototype._recordingAdded):
(WI.CanvasTabContentView.prototype._recordingActionIndexChanged):
(WI.CanvasTabContentView.prototype._updateActionIndex):
(WI.CanvasTabContentView.prototype.restoreFromCookie): Deleted.
(WI.CanvasTabContentView.prototype._overviewPathComponentClicked): Deleted.

* UserInterface/Views/ContentView.js:
(WI.ContentView.createFromRepresentedObject):

* UserInterface/Views/RecordingActionTreeElement.css:
(body:not(.window-inactive, .window-docked-inactive) .tree-outline:matches(:focus, .force-focus) .item.action.selected > .titles .parameter.swizzled,):
(body:not(.window-inactive, .window-docked-inactive) :matches(:focus, .force-focus) .item.action.selected > .titles .parameter.swizzled,): Deleted.

* UserInterface/Views/RecordingContentView.css:
(.content-view:not(.tab).recording):
(.content-view:not(.tab).recording > header):
(.content-view:not(.tab).recording > header > .slider-container):
(.content-view:not(.tab).recording > header > .slider-container > input[type=range]):
(.content-view:not(.tab).recording > header > .slider-container > input[type=range]::-webkit-slider-runnable-track):
(.content-view:not(.tab).recording > header > .slider-container > input[type=range]::-webkit-slider-thumb):
(.content-view:not(.tab).recording > .preview-container):

* UserInterface/Views/RecordingContentView.js:
(WI.RecordingContentView):
(WI.RecordingContentView.prototype.updateActionIndex):
(WI.RecordingContentView.prototype.initialLayout):
(WI.RecordingContentView.prototype.async._generateContentCanvas2D):
(WI.RecordingContentView.prototype._updateSliderValue):
(WI.RecordingContentView.prototype._sliderChanged):
(WI.RecordingContentView.prototype.get supplementalRepresentedObjects): Deleted.

* UserInterface/Views/RecordingNavigationSidebarPanel.js:
(WI.RecordingNavigationSidebarPanel.prototype.set recording):
(WI.RecordingNavigationSidebarPanel.prototype.updateActionIndex):

* UserInterface/Views/ResourceIcons.css:
(.canvas .icon):
(.canvas.canvas-2d .icon): Deleted.
(.canvas:matches(.webgl, .webgl2, .webgpu) .icon): Deleted.

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

3 years agoUnreviewed test gardening. Update inspector/network/har tests.
joepeck@webkit.org [Tue, 24 Oct 2017 20:45:02 +0000 (20:45 +0000)]
Unreviewed test gardening. Update inspector/network/har tests.

* http/tests/inspector/network/har/har-page-expected.txt:
Size of the test file changed and results needed to be updated.

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

3 years ago[mips] fix offsets of branches that have to go over a jump
guijemont@igalia.com [Tue, 24 Oct 2017 20:36:49 +0000 (20:36 +0000)]
[mips] fix offsets of branches that have to go over a jump
https://bugs.webkit.org/show_bug.cgi?id=153464

The jump() function creates 8 instructions, but the offsets of branches
meant to go over them only account for 6. In most cases, this is not an
issue as the last two instructions of jump() would be nops, but in the
rarer case where the jump destination is in a different 256 MB segment,
MIPSAssembler::linkWithOffset() will rewrite the code in a way in which
the last 4 instructions would be a 2 instruction load (lui/ori) into
$t9, a "j $t9" and then a nop. The wrong offset will mean that the
previous branches meant to go over the whole jump will branch to the
"j $t9" instruction, which would jump to whatever is currently in $t9
(since lui/ori would not be executed).

Reviewed by Michael Catanzaro.

* assembler/MacroAssemblerMIPS.h:
(JSC::MacroAssemblerMIPS::branchAdd32):
(JSC::MacroAssemblerMIPS::branchMul32):
(JSC::MacroAssemblerMIPS::branchSub32):
Fix the offsets of branches meant to go over code generated by jump().

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

3 years agoSkip fast/html/marquee-reparent-check.html on macOS debug.
ryanhaddad@apple.com [Tue, 24 Oct 2017 20:21:47 +0000 (20:21 +0000)]
Skip fast/html/marquee-reparent-check.html on macOS debug.
https://bugs.webkit.org/show_bug.cgi?id=178465

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years agoWeb Inspector: Layer mutations should be purely based on layerId, not based on nodeId
commit-queue@webkit.org [Tue, 24 Oct 2017 20:11:35 +0000 (20:11 +0000)]
Web Inspector: Layer mutations should be purely based on layerId, not based on nodeId
https://bugs.webkit.org/show_bug.cgi?id=178554

Patch by Ross Kirsling <ross.kirsling@sony.com> on 2017-10-24
Reviewed by Devin Rousso.

Source/WebInspectorUI:

* UserInterface/Controllers/LayerTreeManager.js:
(WI.LayerTreeManager.prototype.layerTreeMutations):
Looking for special cases involving nodeIds is incorrect, as nodeIds need not be unique in the layer list (such
as when an element and a pseudo-element thereof each give rise to a layer). A layer object marked "preserved" in
this way shares no data with its predecessor, meaning that no consumer can act upon this so-called preservation.
A preserved layer should be nothing more or less than a recycled layerId (the thing that *is* unique).

LayoutTests:

* inspector/layers/layer-tree-manager-expected.txt:
* inspector/layers/layer-tree-manager.html:

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

3 years ago[GTK] Unskip layout tests editing/deleting/delete-emoji-1.html & editing/deleting...
aperez@igalia.com [Tue, 24 Oct 2017 20:06:10 +0000 (20:06 +0000)]
[GTK] Unskip layout tests editing/deleting/delete-emoji-1.html & editing/deleting/delete-emoji-1.html
https://bugs.webkit.org/show_bug.cgi?id=178742

Unreviewed test gardening.

* platform/gtk/TestExpectations: Updated expectations for the emoji deletion layout tests.
* platform/gtk/editing/deleting/delete-emoji-1-expected.txt: Added.
* platform/gtk/editing/deleting/delete-emoji-expected.txt: Added.

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

3 years ago[WPE] Remove expectations for tests which do not exist anymore
aperez@igalia.com [Tue, 24 Oct 2017 20:04:46 +0000 (20:04 +0000)]
[WPE] Remove expectations for tests which do not exist anymore
https://bugs.webkit.org/show_bug.cgi?id=178717

Unreviewed WPE test gardening.

This avoids the following warning being emitted by run-webkit-tests:

  --lint-test-files warnings:
  LayoutTests/platform/wpe/TestExpectations:366 Path does not exist. fast/events/constructors/device-proximity-event-constructor.html
  LayoutTests/platform/wpe/TestExpectations:902 Path does not exist. http/tests/dom/document-attributes-null-handling

* platform/wpe/TestExpectations:

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

3 years agoUnreviewed GTK+ test gardening.
aperez@igalia.com [Tue, 24 Oct 2017 19:56:39 +0000 (19:56 +0000)]
Unreviewed GTK+ test gardening.

* platform/gtk/TestExpectations:

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

3 years ago[Payment Request] Implement the "PaymentRequest updated" algorithm
aestes@apple.com [Tue, 24 Oct 2017 19:53:44 +0000 (19:53 +0000)]
[Payment Request] Implement the "PaymentRequest updated" algorithm
https://bugs.webkit.org/show_bug.cgi?id=178689

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

* web-platform-tests/payment-request/payment-request-update-event-updatewith-method.https-expected.txt:

Source/WebCore:

Implemented the "PaymentRequest updated" algorithm by firing shippingaddresschange and
shippingoptionchange events at the right times and implementing
PaymentRequestUpdateEvent.updateWith().

Tests: http/tests/paymentrequest/payment-request-change-shipping-address.https.html
       http/tests/paymentrequest/payment-request-change-shipping-option.https.html
       http/tests/paymentrequest/updateWith-method-pmi-handling.https.html

* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::convertAndValidate): Added. Converts a PaymentDetailsInit to a
ApplePaySessionPaymentRequest::TotalAndLineItems.
(WebCore::ApplePayPaymentHandler::shippingAddressUpdated): Created a ShippingContactUpdate
and passed it to PaymentCoordinator::completeShippingContactSelection().
(WebCore::ApplePayPaymentHandler::shippingOptionUpdated): Created a ShippingMethodUpdate and
passed it to PaymentCoordinator::completeShippingMethodSelection().
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
* Modules/paymentrequest/PaymentHandler.h:
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::checkAndCanonicalizeDetails): Moved the logic for checking and canonicalizing a
PaymentDetailsBase from PaymentRequest::create() to here.
(WebCore::PaymentRequest::create): Called checkAndCanonicalizeDetails().
(WebCore::PaymentRequest::abortWithException): Moved the body of stop() to here and
parameterized the Exception with which to abort m_showPromise.
(WebCore::PaymentRequest::stop): Called abortWithException() with an AbortError.
(WebCore::PaymentRequest::shippingAddressChanged): Called dispatchUpdateEvent() with
shippingaddresschangeEvent.
(WebCore::PaymentRequest::shippingOptionChanged): Ditto with shippingoptionchangeEvent.
(WebCore::PaymentRequest::dispatchUpdateEvent): Created a PaymentRequestUpdateEvent and
dispatched it.
(WebCore::PaymentRequest::updateWith): Added a settle handler to m_detailsPromise.
(WebCore::PaymentRequest::settleDetailsPromise): Updated the PaymentRequest with the new
details and called PaymentHandler::shippingAddressUpdated() or
PaymentHandler::shippingOptionUpdated().
* Modules/paymentrequest/PaymentRequest.h:
* Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
(WebCore::PaymentRequestUpdateEvent::PaymentRequestUpdateEvent):
(WebCore::PaymentRequestUpdateEvent::updateWith): Called PaymentRequest::updateWith().
(WebCore::PaymentRequestUpdateEvent::eventInterface const): Returned
PaymentRequestUpdateEventInterfaceType.
* Modules/paymentrequest/PaymentRequestUpdateEvent.h:
* Modules/paymentrequest/PaymentRequestUpdateEvent.idl:
* testing/MockPaymentCoordinator.cpp:
(WebCore::MockPaymentCoordinator::canMakePaymentsWithActiveCard):
(WebCore::MockPaymentCoordinator::openPaymentSetup):
(WebCore::MockPaymentCoordinator::completeMerchantValidation): Stopped calling
PaymentCoordinator::didAuthorizePayment().
(WebCore::MockPaymentCoordinator::changeShippingOption): Called
PaymentCoordinator::didSelectShippingMethod().
(WebCore::MockPaymentCoordinator::acceptPayment): Called
PaymentCoordinator::didAuthorizePayment().
* testing/MockPaymentCoordinator.h:
* testing/MockPaymentCoordinator.idl:

LayoutTests:

* http/tests/paymentrequest/payment-request-change-shipping-address.https-expected.txt: Added.
* http/tests/paymentrequest/payment-request-change-shipping-address.https.html: Copied from imported/w3c/web-platform-tests/payment-request/shipping-address-changed-manual.https.html.
* http/tests/paymentrequest/payment-request-change-shipping-option.https-expected.txt: Added.
* http/tests/paymentrequest/payment-request-change-shipping-option.https.html: Copied from imported/w3c/web-platform-tests/payment-request/change-shipping-option-manual.https.html.
* http/tests/paymentrequest/resources/helpers.js:
(async.getPaymentRequestResponse):
* http/tests/paymentrequest/updateWith-method-pmi-handling.https-expected.txt: Added.
* http/tests/paymentrequest/updateWith-method-pmi-handling.https.html: Copied from imported/w3c/web-platform-tests/payment-request/updateWith-method-pmi-handling-manual.https.html.

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

3 years agoApply custom header fields from WebsitePolicies to same-domain requests
achristensen@apple.com [Tue, 24 Oct 2017 19:33:20 +0000 (19:33 +0000)]
Apply custom header fields from WebsitePolicies to same-domain requests
https://bugs.webkit.org/show_bug.cgi?id=178356
Source/WebCore:

<rdar://problem/31073436>

Reviewed by Brady Eidson.

Covered by new API tests.

* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::setCachePolicy):
(WebCore::ResourceRequestBase::setTimeoutInterval):
(WebCore::ResourceRequestBase::setHTTPMethod):
(WebCore::ResourceRequestBase::setHTTPHeaderField):
(WebCore::ResourceRequestBase::clearHTTPAuthorization):
(WebCore::ResourceRequestBase::clearHTTPContentType):
(WebCore::ResourceRequestBase::clearHTTPReferrer):
(WebCore::ResourceRequestBase::clearHTTPOrigin):
(WebCore::ResourceRequestBase::clearHTTPUserAgent):
(WebCore::ResourceRequestBase::clearHTTPAccept):
(WebCore::ResourceRequestBase::clearHTTPAcceptEncoding):
(WebCore::ResourceRequestBase::setResponseContentDispositionEncodingFallbackArray):
(WebCore::ResourceRequestBase::setHTTPBody):
(WebCore::ResourceRequestBase::setAllowCookies):
(WebCore::ResourceRequestBase::setPriority):
(WebCore::ResourceRequestBase::addHTTPHeaderFieldIfNotPresent):
(WebCore::ResourceRequestBase::addHTTPHeaderField):
(WebCore::ResourceRequestBase::setHTTPHeaderFields):
If we only update the platform request when headers are added (or other changes) for HTTP requests,
then the changes will not affect the NSURLRequest that is sent over IPC or visible to the API.
This is necessary for these new tests to work, but it's also of growing importance since our
introduction of WKURLSchemeHandler.

Tools:

Reviewed by Brady Eidson.

* TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm:
(expectHeaders):

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

3 years agoAdopt new secure coding APIs
bfulgham@apple.com [Tue, 24 Oct 2017 19:07:18 +0000 (19:07 +0000)]
Adopt new secure coding APIs
https://bugs.webkit.org/show_bug.cgi?id=178484
<rdar://problem/34837193>

Reviewed by Tim Horton.

Source/WebCore:

Switch to new NSKeyed[Un]Archiver methods that active and use
NSSecureCoding by default.

Most of the new API is wrapped in a set of convenience methods so we can
build without the new API on older systems.

No change in behavior.

* editing/cocoa/EditorCocoa.mm:
(WebCore::archivedDataForAttributedString): Use new convenience method
to archive the string object.
* loader/archive/cf/LegacyWebArchiveMac.mm:
(WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Update to
use secure coding where possible.
(WebCore::LegacyWebArchive::createPropertyListRepresentation): Ditto.
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::write): Use new secure API.
(WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const): Ditto.
* testing/cocoa/WebArchiveDumpSupport.mm:
(WebCoreTestSupport::createCFURLResponseFromResponseData): Update to
secure coding API where possible.

Source/WebCore/PAL:

Add new convenience methods (and SPI headers) so we can adopt new NSKeyedArchiver
API that uses secure coding by default.

* PAL.xcodeproj/project.pbxproj:
* pal/spi/cocoa/NSKeyedArchiverSPI.h: Added.
(securelyArchivedDataWithRootObject): New convenience method.
(securelyUnarchiveRootObjectOfClassFromData): Ditto.
(secureArchiverFromMutableData): Ditto.
(secureUnarchiverFromData): Ditto.

Source/WebKit:

Switch to new NSKeyed[Un]Archiver methods that active and use
NSSecureCoding by default.

* Platform/ios/AccessibilityIOS.mm:
(WebKit::newAccessibilityRemoteToken): Use secure-by-default API.
* Shared/Cocoa/DataDetectionResult.mm:
(WebKit::DataDetectionResult::encode const): Ditto.
(WebKit::DataDetectionResult::decode): Ditto.
* Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
(IPC::ArgumentCoder<WebCore::Payment>::encode): Ditto.
(IPC::ArgumentCoder<WebCore::Payment>::decode): Ditto.
(IPC::ArgumentCoder<WebCore::PaymentContact>::encode): Ditto.
(IPC::ArgumentCoder<WebCore::PaymentContact>::decode): Ditto.
(IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::encode): Ditto.
(IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::decode): Ditto.
(IPC::ArgumentCoder<WebCore::PaymentMethod>::encode): Ditto.
(IPC::ArgumentCoder<WebCore::PaymentMethod>::decode): Ditto.
* Shared/ios/InteractionInformationAtPosition.mm:
(WebKit::InteractionInformationAtPosition::encode const): Ditto.
(WebKit::InteractionInformationAtPosition::decode): Ditto.
* Shared/mac/WebCoreArgumentCodersMac.mm:
(IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData): Ditto.
(IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData): Ditto.
(IPC::ArgumentCoder<Credential>::encodePlatformData): Ditto.
(IPC::ArgumentCoder<Credential>::decodePlatformData): Ditto.
(IPC::ArgumentCoder<ContentFilterUnblockHandler>::encode): Ditto.
(IPC::ArgumentCoder<ContentFilterUnblockHandler>::decode): Ditto.
(IPC::ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData): Ditto.
(IPC::ArgumentCoder<MediaPlaybackTargetContext>::decodePlatformData): Ditto.
* Shared/mac/WebHitTestResultData.mm:
(WebKit::WebHitTestResultData::platformEncode const): Ditto.
(WebKit::WebHitTestResultData::platformDecode): Ditto.
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _setObject:forBundleParameter:]): Ditto.
(-[WKProcessPool _setObjectsForBundleParametersWithDictionary:]): Ditto.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setInputDelegate:]): Ditto.
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess): Ditto.
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::startAssistingNode): Ditto.
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Ditto.
* WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
(WebKit::InjectedBundle::initialize): Ditto.
(WebKit::InjectedBundle::setBundleParameter): Ditto.
(WebKit::InjectedBundle::setBundleParameters): Ditto.

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

3 years agoWebAssembly: NFC renames of things that aren't JS-specific
jfbastien@apple.com [Tue, 24 Oct 2017 18:55:52 +0000 (18:55 +0000)]
WebAssembly: NFC renames of things that aren't JS-specific
https://bugs.webkit.org/show_bug.cgi?id=178738

Reviewed by Saam Barati.

* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::parseAndCompile):
* wasm/WasmB3IRGenerator.h:
* wasm/WasmBBQPlan.cpp:
(JSC::Wasm::BBQPlan::complete):
* wasm/WasmCodeBlock.cpp:
(JSC::Wasm::CodeBlock::CodeBlock):
* wasm/WasmCodeBlock.h:
(JSC::Wasm::CodeBlock::embedderEntrypointCalleeFromFunctionIndexSpace):
(JSC::Wasm::CodeBlock::jsEntrypointCalleeFromFunctionIndexSpace): Deleted.
* wasm/WasmFormat.h:
* wasm/js/JSToWasm.cpp:
(JSC::Wasm::createJSToWasmWrapper):
* wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::WebAssemblyModuleRecord::link):
(JSC::WebAssemblyModuleRecord::evaluate):

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

3 years agoHTMLMediaElement should iterate HTMLTrackElements consistently.
commit-queue@webkit.org [Tue, 24 Oct 2017 18:52:47 +0000 (18:52 +0000)]
HTMLMediaElement should iterate HTMLTrackElements consistently.
https://bugs.webkit.org/show_bug.cgi?id=178423
rdar://problem/35044967

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

No new tests because no expected behavior change.

HTMLMediaElement iterates HTMLTrackElements as children in every place but one, where it iterates them
as descendants. It should always iterate them as children.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::finishParsingChildren):

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

3 years agoSerializedScriptValue::deserialize() should take ports as a const Vector&
cdumez@apple.com [Tue, 24 Oct 2017 18:50:54 +0000 (18:50 +0000)]
SerializedScriptValue::deserialize() should take ports as a const Vector&
https://bugs.webkit.org/show_bug.cgi?id=178727

Reviewed by Alex Christensen.

SerializedScriptValue::deserialize() should take ports as a const Vector&, not a Vector&.
It does not modify the input vector.

* bindings/js/JSMessageEventCustom.cpp:
(WebCore::JSMessageEvent::data const):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneDeserializer::deserialize):
(WebCore::CloneDeserializer::CloneDeserializer):
(WebCore::SerializedScriptValue::deserialize):
* bindings/js/SerializedScriptValue.h:

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

3 years ago[Win][JSCOnly] Make jsconly build testapi and dlls and copy dlls when running tests
commit-queue@webkit.org [Tue, 24 Oct 2017 18:46:31 +0000 (18:46 +0000)]
[Win][JSCOnly] Make jsconly build testapi and dlls and copy dlls when running tests
https://bugs.webkit.org/show_bug.cgi?id=177279

Patch by Stephan Szabo <stephan.szabo@sony.com> on 2017-10-24
Reviewed by Yusuke Suzuki.

.:

* Source/cmake/OptionsJSCOnly.cmake:

Source/JavaScriptCore:

* shell/PlatformJSCOnly.cmake: Added.

Tools:

* Scripts/build-jsc:
* Scripts/run-jsc-stress-tests:

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

3 years ago[Settings] Add initial support for generating preferences related code
commit-queue@webkit.org [Tue, 24 Oct 2017 18:43:31 +0000 (18:43 +0000)]
[Settings] Add initial support for generating preferences related code
https://bugs.webkit.org/show_bug.cgi?id=178656

Patch by Sam Weinig <sam@webkit.org> on 2017-10-24
Reviewed by Dean Jackson.

As a first step towards getting off the macros in WebPreferencesDefinitions.h
and reducing the overhead of adding a preference, this change generates adds
WebPreferences.yaml where preference changes will go, and generates much of
WebPreferencesDefinitions.h from it (all the custom defaults moved to
WebPreferencesDefinitionsBase.h). Subsequent changes will remove the need for
the macros in WebPreferencesDefinitions.h entirely.

* CMakeLists.txt:
* DerivedSources.make:
* WebKit.xcodeproj/project.pbxproj:

    Add new files / rules to generate WebPreferencesDefinitions.h.

* Scripts/GeneratePreferences.rb: Added.
* Scripts/PreferencesTemplates: Added.
* Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb: Added.

    Add scripts and template to generate WebPreferencesDefinitions.h from
    WebPreferences.yaml.

* Shared/WebPreferences.yaml: Added.

    Configuration file for preferences.

* Shared/WebPreferencesDefinitions.h: Removed.
* Shared/WebPreferencesDefinitionsBase.h: Copied from Source/WebKit/Shared/WebPreferencesDefinitions.h.

    Moved custom defaults to new WebPreferencesDefinitionsBase.h. Removed the need for
    FOR_EACH_WEBKIT_STRING_PREFERENCE by using custom defaults for the font family values.

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

3 years ago[MediaFoundation] Videos are always autoplaying for local files
commit-queue@webkit.org [Tue, 24 Oct 2017 18:40:17 +0000 (18:40 +0000)]
[MediaFoundation] Videos are always autoplaying for local files
https://bugs.webkit.org/show_bug.cgi?id=178693

Patch by Doug Massay.
Patch by Konstantin Tokarev <annulen@yandex.ru> on 2017-10-24
Reviewed by Alex Christensen.

r199114 fixes autoplay issue only if starting session invokes
buffering stage. However when local files are played, onBufferingStarted
and onBufferingStopped are not called, and video is not paused.

* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::MediaPlayerPrivateMediaFoundation::endGetEvent):
(WebCore::MediaPlayerPrivateMediaFoundation::onSessionStarted):
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:

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

3 years ago[Regression] Webkit "-apple-system" font fallback token handles font weights of PingF...
ddkilzer@apple.com [Tue, 24 Oct 2017 18:19:00 +0000 (18:19 +0000)]
[Regression] Webkit "-apple-system" font fallback token handles font weights of PingFang incorrectly.
https://bugs.webkit.org/show_bug.cgi?id=177345
<rdar://problem/32975942>

Unreviewed fix to move tests into LayoutTests.

If these tests start failing, please roll out this commit and
r223589.

* fast/text/system-ui-chinese-bold-fallback-expected.html: Renamed from fast/text/system-ui-chinese-bold-fallback-expected.html.
* fast/text/system-ui-chinese-bold-fallback.html: Renamed from fast/text/system-ui-chinese-bold-fallback.html.

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

3 years agoUnreviewed, rolling out r223889.
jlewis3@apple.com [Tue, 24 Oct 2017 18:14:03 +0000 (18:14 +0000)]
Unreviewed, rolling out r223889.

This caused multiple crashes on all platforms

Reverted changeset:

"Adopt new secure coding APIs"
https://bugs.webkit.org/show_bug.cgi?id=178484
https://trac.webkit.org/changeset/223889

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

3 years agoUnreviewed test gardening. Improved attempt to reduce flakiness of inspector/network...
joepeck@webkit.org [Tue, 24 Oct 2017 18:04:37 +0000 (18:04 +0000)]
Unreviewed test gardening. Improved attempt to reduce flakiness of inspector/network/har tests.

* http/tests/inspector/network/har/har-page-expected.txt:
* http/tests/inspector/network/har/har-page.html:
Earlier filters were taking affect, so move these checks up.

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

3 years agoCreate inline wrappers for before/after pseudo elements that have display:contents
antti@apple.com [Tue, 24 Oct 2017 17:50:19 +0000 (17:50 +0000)]
Create inline wrappers for before/after pseudo elements that have display:contents
https://bugs.webkit.org/show_bug.cgi?id=178722

Reviewed by Ryosuke Niwa.

Source/WebCore:

We can handle before and after pseudo elements with display:contents by giving them
inline renderers with style inherited from display:contents style. This removes
need for complicated logic for this case and handles everything correctly.

This is a better approach and replaces the one taken in bug 178584.
It also fixes two display:contents WPTs.

* dom/PseudoElement.h:

    There is no need to track content renderers separately anymore. They always descendants of
    pseudo element's renderer (which is an inline wrapper in case of display:contents).

* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::copyContentFrom):
* rendering/style/RenderStyle.h:
* style/RenderTreeUpdaterGeneratedContent.cpp:
(WebCore::createContentRenderers):
(WebCore::updateStyleForContentRenderers):
(WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
(WebCore::removeAndDestroyContentRenderers): Deleted.

    Since content renderers are now always descendants of the pseudo renderer
    there is no need for a separate destruction path.

* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolvePseudoStyle):

    Create ElementUpdate with a style that will produce an inline wrapper.

LayoutTests:

* TestExpectations:

Enable

imported/w3c/web-platform-tests/css/css-display-3/display-contents-dynamic-before-after-first-letter-001.html and
imported/w3c/web-platform-tests/css/css-display-3/display-contents-dynamic-before-after-001.html

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

3 years ago[iOS] MediaPlayer::isAvailable() takes ~150 ms during web process initialization
wenson_hsieh@apple.com [Tue, 24 Oct 2017 17:38:44 +0000 (17:38 +0000)]
[iOS] MediaPlayer::isAvailable() takes ~150 ms during web process initialization
https://bugs.webkit.org/show_bug.cgi?id=178713
<rdar://problem/35115906>

Reviewed by Eric Carlson.

Loading AVFoundation should not be required to answer the question of MediaPlayer::isAvailable() on iOS, where
both AVFoundation and CoreMedia frameworks should always exist. As such, we can bail early and return true to
avoid always dynamically loading AVFoundation and CoreMedia.

* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::isAvailable):

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

3 years agoRenderThemeCocoa::mediaControlsFormattedStringForDuration may cause a crash due to...
commit-queue@webkit.org [Tue, 24 Oct 2017 17:32:11 +0000 (17:32 +0000)]
RenderThemeCocoa::mediaControlsFormattedStringForDuration may cause a crash due to unhandled Obj-C exception
https://bugs.webkit.org/show_bug.cgi?id=178716
<rdar://problem/35112900>

Patch by Antoine Quint <graouts@apple.com> on 2017-10-24
Reviewed by Dean Jackson.

* rendering/RenderThemeCocoa.mm:
(WebCore::RenderThemeCocoa::mediaControlsFormattedStringForDuration):

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

3 years agoSizesAttributeParser::SizesAttributeParser triggers layout
rniwa@webkit.org [Tue, 24 Oct 2017 17:24:40 +0000 (17:24 +0000)]
SizesAttributeParser::SizesAttributeParser triggers layout
https://bugs.webkit.org/show_bug.cgi?id=178712

Reviewed by Antti Koivisto.

Revert r213711 as this change introduced an unwated synchronous layout inside Node::insertedIntoAncestor.

The test had been marked as timing out since r191379 and changed to failing expectation in r199225
as the test result's error message changes from run to run.

Disabled Tests: imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/environment-changes/viewport-change.html
                had been marked failing since r199225, prior to which it was marked as timeout in r191379.
                imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute.html
                is now marked as flaky.

* css/parser/SizesAttributeParser.cpp:
(WebCore::SizesAttributeParser::SizesAttributeParser):

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

3 years ago[JSC] modules can be visited more than once when resolving bindings through "star...
utatane.tea@gmail.com [Tue, 24 Oct 2017 17:11:39 +0000 (17:11 +0000)]
[JSC] modules can be visited more than once when resolving bindings through "star" exports as long as the exportName is different each time
https://bugs.webkit.org/show_bug.cgi?id=178308

Reviewed by Mark Lam.

JSTests:

* test262.yaml:

Source/JavaScriptCore:

With the change of the spec[1], we now do not need to remember star resolution modules.
We reflect this change to our implementation. Since this change is covered by test262,
this patch improves the score of test262.

We also add logging to ResolveExport to debug it easily.

[1]: https://github.com/tc39/ecma262/commit/a865e778ff0fc60e26e3e1c589635103710766a1

* runtime/AbstractModuleRecord.cpp:
(JSC::AbstractModuleRecord::ResolveQuery::dump const):
(JSC::AbstractModuleRecord::resolveExportImpl):

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

3 years agoUnreviewed, fix internal iOS build.
keith_miller@apple.com [Tue, 24 Oct 2017 17:05:23 +0000 (17:05 +0000)]
Unreviewed, fix internal iOS build.

* Sources.txt:

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

3 years ago[JSC] Use emitDumbVirtualCall in 32bit JIT
utatane.tea@gmail.com [Tue, 24 Oct 2017 16:42:16 +0000 (16:42 +0000)]
[JSC] Use emitDumbVirtualCall in 32bit JIT
https://bugs.webkit.org/show_bug.cgi?id=178644

Reviewed by Mark Lam.

This patch aligns 32bit JIT op_call_eval slow case to 64bit version by using emitDumbVirtualCall.

* jit/JITCall32_64.cpp:
(JSC::JIT::compileCallEvalSlowCase):

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

3 years ago[JSC] Drop ArityCheckData
utatane.tea@gmail.com [Tue, 24 Oct 2017 16:36:37 +0000 (16:36 +0000)]
[JSC] Drop ArityCheckData
https://bugs.webkit.org/show_bug.cgi?id=178648

Reviewed by Mark Lam.

ArityCheckData is used to return a pair of `slotsToAdd` and `thunkToCall`.
However, use of `thunkToCall` is removed in 64bit environment at r189575.

We remove `thunkToCall` and align 32bit implementation to 64bit implementation.
Since we no longer need to have the above pair, we can remove ArityCheckData too.

* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
(JSC::setupArityCheckData): Deleted.
* runtime/CommonSlowPaths.h:
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:

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

3 years agoASSERTION FAILED: !m_serviceWorkerManager in WebProcess::getWorkerContextConnection...
commit-queue@webkit.org [Tue, 24 Oct 2017 16:33:16 +0000 (16:33 +0000)]
ASSERTION FAILED: !m_serviceWorkerManager in WebProcess::getWorkerContextConnection() on API tests
https://bugs.webkit.org/show_bug.cgi?id=178586
<rdar://problem/35115902>

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-24
Reviewed by Brady Eidson.

       Covered by API tests no longer crashing.

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::getWorkerContextProcessConnection): Sending a worker context process connection message only at creation of the service worker process.

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

3 years agoAdopt new secure coding APIs
bfulgham@apple.com [Tue, 24 Oct 2017 16:21:36 +0000 (16:21 +0000)]
Adopt new secure coding APIs
https://bugs.webkit.org/show_bug.cgi?id=178484
<rdar://problem/34837193>

Reviewed by Tim Horton.

Source/WebCore:

Switch to new NSKeyed[Un]Archiver methods that active and use
NSSecureCoding by default.

Most of the new API is wrapped in a set of convenience methods so we can
build without the new API on older systems.

No change in behavior.

* editing/cocoa/EditorCocoa.mm:
(WebCore::archivedDataForAttributedString): Use new convenience method
to archive the string object.
* loader/archive/cf/LegacyWebArchiveMac.mm:
(WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Update to
use secure coding where possible.
(WebCore::LegacyWebArchive::createPropertyListRepresentation): Ditto.
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::write): Use new secure API.
(WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const): Ditto.
* testing/cocoa/WebArchiveDumpSupport.mm:
(WebCoreTestSupport::createCFURLResponseFromResponseData): Update to
secure coding API where possible.

Source/WebCore/PAL:

Add new convenience methods (and SPI headers) so we can adopt new NSKeyedArchiver
API that uses secure coding by default.

* PAL.xcodeproj/project.pbxproj:
* pal/spi/cocoa/NSKeyedArchiverSPI.h: Added.
(securelyArchivedDataWithRootObject): New convenience method.
(securelyUnarchiveRootObjectOfClassFromData): Ditto.
(secureArchiverFromMutableData): Ditto.
(secureUnarchiverFromData): Ditto.

Source/WebKit:

Switch to new NSKeyed[Un]Archiver methods that active and use
NSSecureCoding by default.

* Platform/ios/AccessibilityIOS.mm:
(WebKit::newAccessibilityRemoteToken): Use secure-by-default API.
* Shared/Cocoa/DataDetectionResult.mm:
(WebKit::DataDetectionResult::encode const): Ditto.
(WebKit::DataDetectionResult::decode): Ditto.
* Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
(IPC::ArgumentCoder<WebCore::Payment>::encode): Ditto.
(IPC::ArgumentCoder<WebCore::Payment>::decode): Ditto.
(IPC::ArgumentCoder<WebCore::PaymentContact>::encode): Ditto.
(IPC::ArgumentCoder<WebCore::PaymentContact>::decode): Ditto.
(IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::encode): Ditto.
(IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::decode): Ditto.
(IPC::ArgumentCoder<WebCore::PaymentMethod>::encode): Ditto.
(IPC::ArgumentCoder<WebCore::PaymentMethod>::decode): Ditto.
* Shared/ios/InteractionInformationAtPosition.mm:
(WebKit::InteractionInformationAtPosition::encode const): Ditto.
(WebKit::InteractionInformationAtPosition::decode): Ditto.
* Shared/mac/WebCoreArgumentCodersMac.mm:
(IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData): Ditto.
(IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData): Ditto.
(IPC::ArgumentCoder<Credential>::encodePlatformData): Ditto.
(IPC::ArgumentCoder<Credential>::decodePlatformData): Ditto.
(IPC::ArgumentCoder<ContentFilterUnblockHandler>::encode): Ditto.
(IPC::ArgumentCoder<ContentFilterUnblockHandler>::decode): Ditto.
(IPC::ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData): Ditto.
(IPC::ArgumentCoder<MediaPlaybackTargetContext>::decodePlatformData): Ditto.
* Shared/mac/WebHitTestResultData.mm:
(WebKit::WebHitTestResultData::platformEncode const): Ditto.
(WebKit::WebHitTestResultData::platformDecode): Ditto.
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _setObject:forBundleParameter:]): Ditto.
(-[WKProcessPool _setObjectsForBundleParametersWithDictionary:]): Ditto.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setInputDelegate:]): Ditto.
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess): Ditto.
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::startAssistingNode): Ditto.
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Ditto.
* WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
(WebKit::InjectedBundle::initialize): Ditto.
(WebKit::InjectedBundle::setBundleParameter): Ditto.
(WebKit::InjectedBundle::setBundleParameters): Ditto.

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

3 years agoMark fast/css-generated-content/details-summary-before-after.html as failing on Windows.
pvollan@apple.com [Tue, 24 Oct 2017 14:14:15 +0000 (14:14 +0000)]
Mark fast/css-generated-content/details-summary-before-after.html as failing on Windows.
https://bugs.webkit.org/show_bug.cgi?id=178724

Unreviewed test gardening.

* platform/win/TestExpectations:

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

3 years ago[GTK][X11] Windy.com shows always straight wind lines
magomez@igalia.com [Tue, 24 Oct 2017 12:06:13 +0000 (12:06 +0000)]
[GTK][X11] Windy.com shows always straight wind lines
https://bugs.webkit.org/show_bug.cgi?id=176718

Reviewed by Carlos Garcia Campos.

WebGL's GL_LUMINANCE_ALPHA format is not available in OpenGL when using a version >= 3.2
and a core profile. In that case, we need to replace it with GL_RG and swizzle the color
components appropriately.

No new behavior.

* platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
(WebCore::GraphicsContext3D::texImage2D):
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::texSubImage2D):

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

3 years agoDocumentOrderedMap::add should release assert that tree scopes match
rniwa@webkit.org [Tue, 24 Oct 2017 08:54:42 +0000 (08:54 +0000)]
DocumentOrderedMap::add should release assert that tree scopes match
https://bugs.webkit.org/show_bug.cgi?id=178708

Reviewed by Antti Koivisto.

Assert that the tree scope of element matches the given tree scope instead of asserting that
element is in tree scope, and replaced the use of RELEASE_ASSERT by the newly added
RELEASE_ASSERT_WITH_SECURITY_IMPLICATION to clarify the semantics of these assertions.

Also removed now redudnant early exits which would never execute due to release assertions.

* dom/DocumentOrderedMap.cpp:
(WebCore::DocumentOrderedMap::add):
(WebCore::DocumentOrderedMap::remove):
(WebCore::DocumentOrderedMap::get const):

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

3 years ago-Wsubobject-linkage warning in InspectorIndexedDBAgent.cpp
mcatanzaro@igalia.com [Tue, 24 Oct 2017 08:38:28 +0000 (08:38 +0000)]
-Wsubobject-linkage warning in InspectorIndexedDBAgent.cpp
https://bugs.webkit.org/show_bug.cgi?id=178698

Reviewed by Joseph Pecoraro.

* inspector/InspectorIndexedDBAgent.cpp:

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

3 years ago[GTK][WPE] generate-forwarding-headers.pl should also scan derived sources in WebKit...
zandobersek@gmail.com [Tue, 24 Oct 2017 08:20:03 +0000 (08:20 +0000)]
[GTK][WPE] generate-forwarding-headers.pl should also scan derived sources in WebKit framework
https://bugs.webkit.org/show_bug.cgi?id=178579

Reviewed by Carlos Garcia Campos.

* PlatformGTK.cmake: When generating forwarding headers, derived sources
should be scanned as well. The DERIVED_SOURCES_WEBKIT_DIR value has to
be passed as an include path to the generate-forward-headers.pl script
to achieve that. This target then also has to depend on all the derived
source files to be generated before this can be performed.
* PlatformWPE.cmake: Ditto.

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

3 years ago[Web Animations] Add basic timing and target properties
commit-queue@webkit.org [Tue, 24 Oct 2017 07:51:59 +0000 (07:51 +0000)]
[Web Animations] Add basic timing and target properties
https://bugs.webkit.org/show_bug.cgi?id=178674

Patch by Antoine Quint <graouts@apple.com> on 2017-10-24
Reviewed by Dean Jackson.

Source/WebCore:

We add three new interfaces to expose enough properties to establish basic timing properties,
a start time and duration, and the target of an animation. The startTime property is set on
the Animation object, the target is set on the KeyframeEffect set as the effect property on
the Animation object, and the duration is set on the AnimationEffectTiming set on the effect.

Tests: webanimations/animation-effect-timing.html
       webanimations/animation-effect.html
       webanimations/animation-interface-effect-property.html
       webanimations/animation-interface-start-time-property.html
       webanimations/keyframe-effect-interface-timing-duration.html
       webanimations/keyframe-effect.html

* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* animation/AnimationEffect.cpp: Copied from Source/WebCore/animation/WebAnimation.idl.
(WebCore::AnimationEffect::AnimationEffect):
(WebCore::AnimationEffect::~AnimationEffect):
* animation/AnimationEffect.h: Copied from Source/WebCore/animation/WebAnimation.h.
(WebCore::AnimationEffect::isKeyframeEffect const):
(WebCore::AnimationEffect::timing const):
(WebCore::AnimationEffect::classType const):
* animation/AnimationEffect.idl: Copied from Source/WebCore/animation/WebAnimation.idl.
* animation/AnimationEffectTiming.cpp: Copied from Source/WebCore/animation/WebAnimation.idl.
(WebCore::AnimationEffectTiming::create):
(WebCore::AnimationEffectTiming::AnimationEffectTiming):
(WebCore::AnimationEffectTiming::~AnimationEffectTiming):
* animation/AnimationEffectTiming.h: Copied from Source/WebCore/animation/WebAnimation.h.
* animation/AnimationEffectTiming.idl: Copied from Source/WebCore/animation/WebAnimation.idl.
* animation/KeyframeEffect.cpp: Copied from Source/WebCore/animation/WebAnimation.idl.
(WebCore::KeyframeEffect::create):
(WebCore::KeyframeEffect::KeyframeEffect):
* animation/KeyframeEffect.h: Copied from Source/WebCore/animation/WebAnimation.h.
* animation/KeyframeEffect.idl: Copied from Source/WebCore/animation/WebAnimation.idl.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::setEffect):
* animation/WebAnimation.h:
* animation/WebAnimation.idl:
* bindings/js/JSAnimationEffectCustom.cpp: Copied from Source/WebCore/animation/WebAnimation.cpp.
(WebCore::toJSNewlyCreated):
(WebCore::toJS):
* bindings/js/WebCoreBuiltinNames.h:

LayoutTests:

Add new tests to check the behavior of the newly exposed interfaces,
constructors and properties.

* webanimations/animation-effect-expected.txt: Added.
* webanimations/animation-effect-timing-expected.txt: Added.
* webanimations/animation-effect-timing.html: Added.
* webanimations/animation-effect.html: Added.
* webanimations/animation-interface-effect-property-expected.txt: Added.
* webanimations/animation-interface-effect-property.html: Added.
* webanimations/animation-interface-start-time-property-expected.txt: Added.
* webanimations/animation-interface-start-time-property.html: Added.
* webanimations/keyframe-effect-expected.txt: Added.
* webanimations/keyframe-effect-interface-timing-duration-expected.txt: Added.
* webanimations/keyframe-effect-interface-timing-duration.html: Added.
* webanimations/keyframe-effect.html: Added.

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

3 years agoRenderSVGModelObject::checkIntersection triggers layout
rniwa@webkit.org [Tue, 24 Oct 2017 07:41:39 +0000 (07:41 +0000)]
RenderSVGModelObject::checkIntersection triggers layout
https://bugs.webkit.org/show_bug.cgi?id=178710

Reviewed by Antti Koivisto.

Don't trigger a layout inside getElementCTM. Update the layout upfront in getEnclosureList.

* rendering/svg/RenderSVGModelObject.cpp:
(WebCore::getElementCTM):
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::getEnclosureList):

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

3 years agoAX: Crash at -[WebAccessibilityObjectWrapper _accessibilityMinValue] + 24
n_wang@apple.com [Tue, 24 Oct 2017 07:25:08 +0000 (07:25 +0000)]
AX: Crash at -[WebAccessibilityObjectWrapper _accessibilityMinValue] + 24
https://bugs.webkit.org/show_bug.cgi?id=178697

Reviewed by Chris Fleizach.

Source/WebCore:

When we are calling _accessibilityMinValue and _accessibilityMaxValue on iOS,
it might cause crash if the AX object has already been detached. Fixed this
by adding the necessary checks.

Test: accessibility/ios-simulator/slider-min-value-crash.html

* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _accessibilityMinValue]):
(-[WebAccessibilityObjectWrapper _accessibilityMaxValue]):

LayoutTests:

* accessibility/ios-simulator/slider-min-value-crash-expected.txt: Added.
* accessibility/ios-simulator/slider-min-value-crash.html: Added.

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

3 years ago[Cocoa] Web Automation: add SPI to tell whether the automation session is currently...
bburg@apple.com [Tue, 24 Oct 2017 05:13:56 +0000 (05:13 +0000)]
[Cocoa] Web Automation: add SPI to tell whether the automation session is currently simulating user interactions
https://bugs.webkit.org/show_bug.cgi?id=178616

Reviewed by Joseph Pecoraro.

This is needed to disambiguate whether an action (such as selectAll:) came from
a user clicking on "Edit > Select All" in a menu or whether it was produced by
simulating the keystrokes to produce the chord for "Command + a". Some clients,
such as Safari, would allow the latter but not the former during automation.

* UIProcess/API/Cocoa/_WKAutomationSession.h:
* UIProcess/API/Cocoa/_WKAutomationSession.mm:
(-[_WKAutomationSession isSimulatingUserInteraction]):
Add new SPI property that's backed by the same WebAutomationSession method.

* UIProcess/Automation/WebAutomationSession.h:
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::keyboardEventsFlushedForPage):
(WebKit::WebAutomationSession::performMouseInteraction):
(WebKit::WebAutomationSession::performKeyboardInteractions):
Set m_simulatingUserInteraction prior to sending the synthesized events. It will
be cleared when keyboardEventsFlushedForPage() is called by WebPageProxy.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didReceiveEvent):
Notify the automation session that the key event queue was flushed *after* giving
delegates a chance to do something with the key event. This is necessary so that
any actions that are created from the NSEvent by the delegates are handled prior
to the automation session finishing its keyboard interaction command.

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

3 years agoUnreviewed WPE test gardening
mcatanzaro@igalia.com [Tue, 24 Oct 2017 04:21:25 +0000 (04:21 +0000)]
Unreviewed WPE test gardening

* platform/wpe/TestExpectations:

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

3 years agoUnreviewed, restore unneeded all in ones.
keith_miller@apple.com [Tue, 24 Oct 2017 04:17:58 +0000 (04:17 +0000)]
Unreviewed, restore unneeded all in ones.

* CMakeLists.txt:

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

3 years agoUnreviewed, roll out r222731
mcatanzaro@igalia.com [Tue, 24 Oct 2017 03:32:24 +0000 (03:32 +0000)]
Unreviewed, roll out r222731
https://bugs.webkit.org/show_bug.cgi?id=177745
<rdar://problem/34773148>

Unfortunately Gigacage has broken core dump generation.

* bmalloc/Gigacage.h:

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

3 years agoUnreviewed, rolling out r223870 and r223871.
commit-queue@webkit.org [Tue, 24 Oct 2017 03:26:50 +0000 (03:26 +0000)]
Unreviewed, rolling out r223870 and r223871.
https://bugs.webkit.org/show_bug.cgi?id=178702

broke the windows build (Requested by keith_miller on
#webkit).

Reverted changesets:

"Add html, inspector, loader to unified sources"
https://bugs.webkit.org/show_bug.cgi?id=178695
https://trac.webkit.org/changeset/223870

"Unrievwed, fix windows build."
https://trac.webkit.org/changeset/223871

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

3 years agoUnreviewed, reland r223866
keith_miller@apple.com [Tue, 24 Oct 2017 03:20:31 +0000 (03:20 +0000)]
Unreviewed, reland r223866

Didn't break the windows build...

Restored changeset:

"WebAssembly: topEntryFrame on Wasm::Instance"
https://bugs.webkit.org/show_bug.cgi?id=178690
https://trac.webkit.org/changeset/223866

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

3 years agoUnreviewed, rolling out r223866.
commit-queue@webkit.org [Tue, 24 Oct 2017 02:33:13 +0000 (02:33 +0000)]
Unreviewed, rolling out r223866.
https://bugs.webkit.org/show_bug.cgi?id=178699

Probably broke the windows build (Requested by keith_miller on
#webkit).

Reverted changeset:

"WebAssembly: topEntryFrame on Wasm::Instance"
https://bugs.webkit.org/show_bug.cgi?id=178690
https://trac.webkit.org/changeset/223866

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

3 years agoUnreviewed test gardening. Try to reduce flakiness of inspector/network/har tests.
joepeck@webkit.org [Tue, 24 Oct 2017 01:44:14 +0000 (01:44 +0000)]
Unreviewed test gardening. Try to reduce flakiness of inspector/network/har tests.

* http/tests/inspector/network/har/har-page-expected.txt:
* http/tests/inspector/network/har/har-page.html:
Remove properties which may sometimes be optional.
Filter contents which are shared across tests and might change.

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

3 years agoUnreviewed, attempt to fix initializeSupportedImageMIMETypes after r223860
mcatanzaro@igalia.com [Tue, 24 Oct 2017 01:42:52 +0000 (01:42 +0000)]
Unreviewed, attempt to fix initializeSupportedImageMIMETypes after r223860
https://bugs.webkit.org/show_bug.cgi?id=178618
<rdar://problem/35108852>

* platform/MIMETypeRegistry.cpp:
(WebCore::initializeSupportedImageMIMETypes):

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

3 years agoUnrievwed, fix windows build.
keith_miller@apple.com [Tue, 24 Oct 2017 01:31:28 +0000 (01:31 +0000)]
Unrievwed, fix windows build.

* CMakeLists.txt:

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

3 years agoAdd html, inspector, loader to unified sources
keith_miller@apple.com [Tue, 24 Oct 2017 01:25:50 +0000 (01:25 +0000)]
Add html, inspector, loader to unified sources
https://bugs.webkit.org/show_bug.cgi?id=178695

Rubber-stamped by Tim Horton.

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

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

3 years ago[Mac] Web Automation: key modifiers for synthesized NSEvents are incorrect
bburg@apple.com [Tue, 24 Oct 2017 01:16:59 +0000 (01:16 +0000)]
[Mac] Web Automation: key modifiers for synthesized NSEvents are incorrect
https://bugs.webkit.org/show_bug.cgi?id=178615

Reviewed by Joseph Pecoraro.

In both PLATFORM(MAC) platform methods for simulating keyboard interactions,
we errantly relied on +[NSEvent modifierFlags] to get the current state of
sticky modifiers when creating synthesized events. This is incorrect for two reasons:
modifierFlags is never updated when simulating a sequence of events (because
all the events are synthesized before any are delivered); and the NSEvent class
method only reflects the modifier state of the primary physical keyboard, which
is not affected by synthesized NSEvents that happen to have modifier flags.

Instead, just keep our own m_currentModifiers state in the session and compute
the necessary NSEventModifierFlags to put on each synthesized event. This aligns
the implementation with the treatment of sticky keys in the iOS and GTK platform methods.

* UIProcess/Automation/WebAutomationSession.h: Every port gets this variable now.
* UIProcess/Automation/mac/WebAutomationSessionMac.mm:
(WebKit::WebAutomationSession::platformSimulateKeyStroke):
(WebKit::WebAutomationSession::platformSimulateKeySequence):
Use and update m_currentModifiers.

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

3 years agoWeb Inspector: Remove unused Console.setMonitoringXHREnabled
bburg@apple.com [Tue, 24 Oct 2017 00:55:54 +0000 (00:55 +0000)]
Web Inspector: Remove unused Console.setMonitoringXHREnabled
https://bugs.webkit.org/show_bug.cgi?id=178617

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-10-23
Reviewed by Sam Weinig.

Source/JavaScriptCore:

* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* inspector/agents/InspectorConsoleAgent.h:
* inspector/agents/JSGlobalObjectConsoleAgent.cpp: Removed.
* inspector/agents/JSGlobalObjectConsoleAgent.h: Removed.
* inspector/protocol/Console.json:
Removed files and method.

* inspector/JSGlobalObjectInspectorController.cpp:
(Inspector::JSGlobalObjectInspectorController::JSGlobalObjectInspectorController):
This can use the base ConsoleAgent now.

Source/WebCore:

* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didFinishXHRLoadingImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didFinishXHRLoading):
* inspector/WebConsoleAgent.cpp:
(WebCore::WebConsoleAgent::setMonitoringXHREnabled): Deleted.
(WebCore::WebConsoleAgent::didFinishXHRLoading): Deleted.
* inspector/WebConsoleAgent.h:
Remove XHR monitoring code.

* xml/XMLHttpRequest.h:
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::send):
(WebCore::XMLHttpRequest::didFinishLoading):
(WebCore::XMLHttpRequest::setLastSendLineAndColumnNumber): Deleted.
* xml/XMLHttpRequest.idl:
Remove now unused state on XHR and ExecState requirement for send().

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

3 years agoWeb Inspector: Styles Redesign: Inline widgets don't hide when starting editing by...
nvasilyev@apple.com [Tue, 24 Oct 2017 00:35:42 +0000 (00:35 +0000)]
Web Inspector: Styles Redesign: Inline widgets don't hide when starting editing by tabbing from property name
https://bugs.webkit.org/show_bug.cgi?id=178638

Reviewed by Joseph Pecoraro.

* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype.spreadsheetTextFieldDidBlur):
Blur event on the property name text field caused WI.SpreadsheetStyleProperty.prototype._renderValue,
which displayed inline swatches. Display inline swatches only after blur event on the property value.

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

3 years agoWebAssembly: topEntryFrame on Wasm::Instance
jfbastien@apple.com [Tue, 24 Oct 2017 00:29:40 +0000 (00:29 +0000)]
WebAssembly: topEntryFrame on Wasm::Instance
https://bugs.webkit.org/show_bug.cgi?id=178690

Reviewed by Saam Barati.

topEntryFrame is usually on VM, but for a no-VM WebAssembly we
need to hold topEntryFrame elsewhere, and generated code cannot
hard-code where topEntryFrame live. Do this at creation time of
Wasm::Instance, and then generated code will just load from
wherever Wasm::Instance was told topEntryFrame is. In a JavaScript
embedding this is still from VM, so all of the unwinding machinery
stays the same.

* dfg/DFGOSREntry.cpp:
(JSC::DFG::prepareOSREntry):
* dfg/DFGOSRExit.cpp:
(JSC::DFG::restoreCalleeSavesFromVMEntryFrameCalleeSavesBuffer):
(JSC::DFG::copyCalleeSavesToVMEntryFrameCalleeSavesBuffer):
* ftl/FTLOSRExitCompiler.cpp:
(JSC::FTL::compileStub):
* interpreter/Interpreter.cpp:
(JSC::UnwindFunctor::copyCalleeSavesToEntryFrameCalleeSavesBuffer const):
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::restoreCalleeSavesFromEntryFrameCalleeSavesBuffer):
(JSC::AssemblyHelpers::copyCalleeSavesToEntryFrameCalleeSavesBufferImpl):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::copyCalleeSavesToEntryFrameCalleeSavesBuffer):
The default parameter was never non-defaulted from any of the
callers. The new version calls the impl directly because it
doesn't have VM and doesn't hard-code the address of
topEntryFrame.
* jit/RegisterSet.cpp:
(JSC::RegisterSet::vmCalleeSaveRegisterOffsets): This was weird on
VM because it's not really VM-specific.
* jit/RegisterSet.h:
* runtime/VM.cpp:
(JSC::VM::getAllCalleeSaveRegisterOffsets): Deleted.
* runtime/VM.h:
(JSC::VM::getCTIStub):
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::B3IRGenerator):
(JSC::Wasm::B3IRGenerator::addCall):
(JSC::Wasm::B3IRGenerator::addCallIndirect):
* wasm/WasmInstance.cpp:
(JSC::Wasm::Instance::Instance):
* wasm/WasmInstance.h: topEntryFramePointer will eventually live
here for real. Right now it's mirrored in JSWebAssemblyInstance
because that's the acting Context.
(JSC::Wasm::Instance::create):
(JSC::Wasm::Instance::offsetOfTopEntryFramePointer):
* wasm/WasmThunks.cpp:
(JSC::Wasm::throwExceptionFromWasmThunkGenerator):
* wasm/js/JSWebAssemblyInstance.cpp:
(JSC::JSWebAssemblyInstance::JSWebAssemblyInstance):
* wasm/js/JSWebAssemblyInstance.h: Mirror Wasm::Instance temporarily.
(JSC::JSWebAssemblyInstance::offsetOfCallee):
(JSC::JSWebAssemblyInstance::offsetOfTopEntryFramePointer):
(JSC::JSWebAssemblyInstance::offsetOfVM): Deleted.
* wasm/js/WebAssemblyInstanceConstructor.cpp:
(JSC::constructJSWebAssemblyInstance):
* wasm/js/WebAssemblyPrototype.cpp:
(JSC::instantiate):

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

3 years agoAdd dom, editing, fileapi, and history to unified sources
keith_miller@apple.com [Tue, 24 Oct 2017 00:27:34 +0000 (00:27 +0000)]
Add dom, editing, fileapi, and history to unified sources
https://bugs.webkit.org/show_bug.cgi?id=178694

Rubber-stamped by Tim Horton.

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

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

3 years agoUpdate perf dashboard upload logic to support uploading binaries from owned commits.
dewei_zhu@apple.com [Tue, 24 Oct 2017 00:22:57 +0000 (00:22 +0000)]
Update perf dashboard upload logic to support uploading binaries from owned commits.
https://bugs.webkit.org/show_bug.cgi?id=178610

Reviewed by Ryosuke Niwa.

Update build requests to 'completed' only when all commit set items are satisfied.
Extend 'repositoryList' parameter to be able to specified own commit information.
Items in 'repositoryList' can either be a string for top level repository,
or a dictionary with two keys: 'ownerRepository' and 'ownedRepository'.

* public/api/upload-root.php: Extend upload logic for support uploading binaries from owned commits.
* server-tests/api-upload-root-tests.js: Added unit tests.
* server-tests/tools-sync-buildbot-integration-tests.js: Added unit tests.

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

3 years agoMove bridge, contentextensions, crypto, and css to unified sources.
keith_miller@apple.com [Tue, 24 Oct 2017 00:08:40 +0000 (00:08 +0000)]
Move bridge, contentextensions, crypto, and css to unified sources.
https://bugs.webkit.org/show_bug.cgi?id=178691

Reviewed by Tim Horton.

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

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

3 years agoUnreviewed, fix the Windows build after r223860
wenson_hsieh@apple.com [Mon, 23 Oct 2017 23:40:18 +0000 (23:40 +0000)]
Unreviewed, fix the Windows build after r223860

UTIUtilities only exists on Cocoa platforms, so we need to guard it accordingly.

* platform/MIMETypeRegistry.cpp:
(WebCore::initializeSupportedImageMIMETypes):

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

3 years agoFix ASAN test after r222824
achristensen@apple.com [Mon, 23 Oct 2017 23:23:05 +0000 (23:23 +0000)]
Fix ASAN test after r222824
https://bugs.webkit.org/show_bug.cgi?id=178688
<rdar://problem/35104706>

Reviewed by Tim Horton.

* UIProcess/WebBackForwardList.cpp:
(WebKit::WebBackForwardList::clear):
Resizing a list of Ref<T> after we've WTFMoved all the elements doesn't make ASAN happy.

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

3 years ago[iOS] DocumentWriter::createDocument can spend ~100ms unnecessarily converting image...
wenson_hsieh@apple.com [Mon, 23 Oct 2017 22:37:33 +0000 (22:37 +0000)]
[iOS] DocumentWriter::createDocument can spend ~100ms unnecessarily converting image UTIs to MIME types
https://bugs.webkit.org/show_bug.cgi?id=178618
<rdar://problem/35108852>

Reviewed by Said Abou-Hallawa.

Currently, in setting up a new Document, DocumentWriter::createDocument() always asks whether or not the
Document should be a PDF document by calling MIMETypeRegistry::isPDFMIMEType(), which forces lazy initialization
of every MIME type dictionary (e.g. image types, PDF types, JavaScript types, etc.). As evidenced by traces,
this can be an expensive operation on certain devices.

This patch implements two optimizations. First, we refactor the initializeSupportedImageMIMETypes() helper to
stop asking for MIMETypeForImageSourceType for each of the supported UTIs. This is because the known MIME types
corresponding to these hard-coded UTI types is a fixed set anyways, so we can simply iterate over a constant
array of MIME types and populate the supported image (and image resource) types. Also, add assertions to ensure
that we keep allowed image MIME types in sync with allowed image UTIs.

The second optimization removes initializeMIMETypeRegistry() altogether in favor of calling just the
initialize*MIMETypes() functions needed to ensure the information required. For instance, getPDFMIMETypes()
currently calls initializeMIMETypeRegistry() if the pdfMIMETypes dictionary doesn't exist, when it really only
needs to ensure that the pdfMIMETypes is initialized, for which initializePDFMIMETypes() is sufficient.

* platform/MIMETypeRegistry.cpp:
(WebCore::initializeSupportedImageMIMETypes):
(WebCore::initializeSupportedJavaScriptMIMETypes):
(WebCore::initializePDFMIMETypes):
(WebCore::initializeSupportedNonImageMimeTypes):
(WebCore::initializeUnsupportedTextMIMETypes):

Move MIME type dictionary creation into initialize*MIMETypes() helpers. Additionally, remove
initializePDFAndPostScriptMIMETypes, which is no longer necessary.

(WebCore::MIMETypeRegistry::isSupportedImageMIMEType):
(WebCore::MIMETypeRegistry::isSupportedImageResourceMIMEType):
(WebCore::MIMETypeRegistry::isSupportedJavaScriptMIMEType):
(WebCore::MIMETypeRegistry::isSupportedNonImageMIMEType):
(WebCore::MIMETypeRegistry::isUnsupportedTextMIMEType):
(WebCore::MIMETypeRegistry::isPDFOrPostScriptMIMEType):

Tweak to check that the type isPDFMIMEType(), or that it's otherwise "application/postscript".

(WebCore::MIMETypeRegistry::isPDFMIMEType):
(WebCore::MIMETypeRegistry::getSupportedImageMIMETypes):
(WebCore::MIMETypeRegistry::getSupportedImageResourceMIMETypes):
(WebCore::MIMETypeRegistry::getSupportedNonImageMIMETypes):
(WebCore::MIMETypeRegistry::getPDFMIMETypes):
(WebCore::MIMETypeRegistry::getUnsupportedTextMIMETypes):

Call only the relevant MIME type initializers when needed.

(WebCore::initializePostScriptMIMETypes): Deleted.
(WebCore::initializeMIMETypeRegistry): Deleted.
(WebCore::MIMETypeRegistry::getPDFAndPostScriptMIMETypes): Deleted.

Remove an unused and unexported function.

* platform/MIMETypeRegistry.h:

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

3 years agoMultiple imported layout tests are crashing and timing out.
commit-queue@webkit.org [Mon, 23 Oct 2017 22:30:23 +0000 (22:30 +0000)]
Multiple imported layout tests are crashing and timing out.
https://bugs.webkit.org/show_bug.cgi?id=178685

Unreviewed.

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-23

* TestExpectations: skipping cache storage tests in service worker context until it is functional.

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

3 years ago[Payment Request] Take the JSC API lock before creating the PaymentResponse.details...
aestes@apple.com [Mon, 23 Oct 2017 22:14:55 +0000 (22:14 +0000)]
[Payment Request] Take the JSC API lock before creating the PaymentResponse.details object
https://bugs.webkit.org/show_bug.cgi?id=178686

Reviewed by Keith Miller.

This fixes several flaky crashes in http/tests/paymentrequest/ after r223855.

* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::ApplePayPaymentHandler::didAuthorizePayment):

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

3 years agoStop using _UIApplicationUsesLegacyUI()
timothy_horton@apple.com [Mon, 23 Oct 2017 21:58:42 +0000 (21:58 +0000)]
Stop using _UIApplicationUsesLegacyUI()
https://bugs.webkit.org/show_bug.cgi?id=178680
<rdar://problem/35131949>

Reviewed by Dan Bernstein.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/forms/WKFormSelectPopover.mm:
(-[WKSelectTableViewController tableView:cellForRowAtIndexPath:]):
(-[WKSelectPopover initWithView:hasGroups:]):
Resolve _UIApplicationUsesLegacyUI to false and simplify.

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

3 years agoWeb Inspector: Please support HAR Export for network traffic
joepeck@webkit.org [Mon, 23 Oct 2017 21:34:59 +0000 (21:34 +0000)]
Web Inspector: Please support HAR Export for network traffic
https://bugs.webkit.org/show_bug.cgi?id=146692
<rdar://problem/7463672>

Reviewed by Brian Burg.

Source/JavaScriptCore:

* inspector/protocol/Network.json:
Add a walltime to each send request.

Source/WebCore:

Tests: http/tests/inspector/network/har/har-basic.html
       http/tests/inspector/network/har/har-page.html

* inspector/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::willSendRequest):
Include the wall time when sending a request. This is needed for HAR to
include a wall time, and can be used for Cookie expiration time calculation
as well.

Source/WebInspectorUI:

* UserInterface/Main.html:
* UserInterface/Test.html:
New resources.

* UserInterface/Base/Platform.js:
Include a build number as well.

* UserInterface/Base/URLUtilities.js:
(parseLocationQueryParameters): Deleted.
Remove unused function.

* UserInterface/Controllers/FrameResourceManager.js:
(WI.FrameResourceManager.prototype.frameDidNavigate):
(WI.FrameResourceManager.prototype.resourceRequestWillBeSent):
(WI.FrameResourceManager.prototype.resourceRequestWasServedFromMemoryCache):
(WI.FrameResourceManager.prototype.resourceRequestDidReceiveResponse):
(WI.FrameResourceManager.prototype._addNewResourceToFrameOrTarget):
Pass along a walltime.

* UserInterface/Protocol/NetworkObserver.js:
(WI.NetworkObserver.prototype.requestWillBeSent):
Pass along a walltime. This new parameter shifts old parameters.

* UserInterface/Controllers/HARBuilder.js: Added.
(WI.HARBuilder.async.buildArchive):
(WI.HARBuilder.creator):
(WI.HARBuilder.pages):
(WI.HARBuilder.pageTimings):
(WI.HARBuilder.entry):
(WI.HARBuilder.request):
(WI.HARBuilder.response):
(WI.HARBuilder.cookies):
(WI.HARBuilder.headers):
(WI.HARBuilder.content):
(WI.HARBuilder.postData):
(WI.HARBuilder.cache):
(WI.HARBuilder.timings):
(WI.HARBuilder.ipAddress):
(WI.HARBuilder.date):
(WI.HARBuilder.fetchType):
HAR construction and helpers.

* UserInterface/Models/Cookie.js:
(WI.Cookie.prototype.expirationDate):
* UserInterface/Models/Resource.js:
(WI.Resource.prototype.get queryStringParameters):
(WI.Resource.prototype.get requestFormParameters):
(WI.Resource.prototype.get requestSentWalltime):
(WI.Resource.prototype.get requestSentDate):
(WI.Resource.prototype.hasRequestFormParameters):
Helpers for HAR generation and sub-sets of data.

* UserInterface/Models/SourceCode.js:
(WI.SourceCode.prototype._processContent):
Capture the raw, unmodified, base64 encoded flag and content. This ends
up getting used by HAR generation and is otherwise lost.

* UserInterface/Test/TestHarness.js:
(TestHarness.prototype.json):
Helper for just logging JSON data with a filter. This defaults to
a reasonable 2 space indent for JSON logs in our test output.

* UserInterface/Views/DOMTreeContentView.js:
(WI.DOMTreeContentView.prototype.get saveData):
(WI.DOMTreeContentView.get saveData.saveHandler): Deleted.
Drive-by simplify while looking at other save handlers.

* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView.prototype.get supportsSave):
(WI.NetworkTableContentView.prototype.get saveData):
(WI.NetworkTableContentView.prototype.tableCellContextMenuClicked):
(WI.NetworkTableContentView.prototype._HARResources):
(WI.NetworkTableContentView.prototype._exportHAR):
Provide a context menu and save keyboard handler to export a HAR.
This matches other browsers.

* UserInterface/Views/ResourceClusterContentView.js:
(WI.ResourceClusterContentView.prototype._canShowRequestContentView):
Use code that is now available in Resource.

LayoutTests:

* http/tests/inspector/network/har/har-basic-expected.txt: Added.
* http/tests/inspector/network/har/har-basic.html: Added.
* http/tests/inspector/network/har/har-page-expected.txt: Added.
* http/tests/inspector/network/har/har-page.html: Added.
Tests with mock resources / data and real resources.

* platform/mac-wk1/TestExpectations:
* platform/mac/TestExpectations:
* platform/win/TestExpectations:
Skip on platforms that cannot provide complete metrics, so some optional
fields may be missing.

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

3 years ago[Payment Request] Resolve PaymentRequest.show()'s accept promise when a payment is...
aestes@apple.com [Mon, 23 Oct 2017 21:00:45 +0000 (21:00 +0000)]
[Payment Request] Resolve PaymentRequest.show()'s accept promise when a payment is authorized
https://bugs.webkit.org/show_bug.cgi?id=178609
<rdar://problem/33542813>

Reviewed by Alex Christensen.

Source/WebCore:

This patch implements the logic for resolving PaymentRequest.show()'s accept promise when
the user authorizes a payment, and implements PaymentResponse.complete().

Tests: http/tests/paymentrequest/payment-address-attributes-and-toJSON-method.https.html
       http/tests/paymentrequest/payment-response-complete-method.https.html
       http/tests/paymentrequest/payment-response-methodName-attribute.https.html
       http/tests/paymentrequest/payment-response-payerEmail-attribute.https.html
       http/tests/paymentrequest/payment-response-payerName-attribute.https.html
       http/tests/paymentrequest/payment-response-payerPhone-attribute.https.html

* DerivedSources.make:
* Modules/applepay/ApplePayPaymentContact.h:
* Modules/applepay/Payment.h:
(WebCore::Payment::Payment): Deleted.
(WebCore::Payment::pkPayment const): Deleted.
* Modules/applepay/PaymentContact.h:
(WebCore::PaymentContact::PaymentContact): Deleted.
(WebCore::PaymentContact::pkContact const): Deleted.
* Modules/applepay/cocoa/PaymentContactCocoa.mm:
(WebCore::convert):
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::ApplePayPaymentHandler::hasActiveSession):
(WebCore::ApplePayPaymentHandler::ApplePayPaymentHandler):
(WebCore::ApplePayPaymentHandler::document):
(WebCore::ApplePayPaymentHandler::paymentCoordinator):
(WebCore::ApplePayPaymentHandler::convertData):
(WebCore::ApplePayPaymentHandler::show):
(WebCore::ApplePayPaymentHandler::hide):
(WebCore::ApplePayPaymentHandler::canMakePayment):
(WebCore::ApplePayPaymentHandler::complete):
(WebCore::convert):
(WebCore::ApplePayPaymentHandler::didAuthorizePayment):
(WebCore::ApplePayPaymentHandler::didSelectShippingMethod):
(WebCore::ApplePayPaymentHandler::didSelectShippingContact):
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
* Modules/paymentrequest/PaymentAddress.h:
* Modules/paymentrequest/PaymentAddress.idl:
* Modules/paymentrequest/PaymentHandler.cpp:
(WebCore::PaymentHandler::create):
* Modules/paymentrequest/PaymentHandler.h:
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::show):
(WebCore::PaymentRequest::stop):
(WebCore::PaymentRequest::canMakePayment):
(WebCore::PaymentRequest::canSuspendForDocumentSuspension const):
(WebCore::PaymentRequest::shippingAddressChanged):
(WebCore::PaymentRequest::shippingOptionChanged):
(WebCore::PaymentRequest::accept):
(WebCore::PaymentRequest::complete):
* Modules/paymentrequest/PaymentRequest.h:
* Modules/paymentrequest/PaymentResponse.cpp:
(WebCore::PaymentResponse::PaymentResponse):
(WebCore::PaymentResponse::complete):
* Modules/paymentrequest/PaymentResponse.h:
* WebCore.xcodeproj/project.pbxproj:
* testing/Internals.cpp:
(WebCore::Internals::Internals):
(WebCore::Internals::mockPaymentCoordinator const):
* testing/Internals.h:
* testing/Internals.idl:
* testing/MockPayment.h: Added.
* testing/MockPaymentAddress.h: Added.
* testing/MockPaymentAddress.idl: Added.
* testing/MockPaymentContact.h: Added.
* testing/MockPaymentCoordinator.cpp:
(WebCore::MockPaymentCoordinator::canMakePaymentsWithActiveCard):
(WebCore::MockPaymentCoordinator::openPaymentSetup):
(WebCore::dispatchIfShowing):
(WebCore::MockPaymentCoordinator::showPaymentUI):
(WebCore::MockPaymentCoordinator::completeMerchantValidation):
(WebCore::MockPaymentCoordinator::completePaymentSession):
(WebCore::MockPaymentCoordinator::abortPaymentSession):
(WebCore::MockPaymentCoordinator::cancelPaymentSession):
(WebCore::MockPaymentCoordinator::paymentCoordinatorDestroyed):
* testing/MockPaymentCoordinator.h:
* testing/MockPaymentCoordinator.idl: Added.

LayoutTests:

* http/tests/paymentrequest/payment-address-attributes-and-toJSON-method.https-expected.txt: Added.
* http/tests/paymentrequest/payment-address-attributes-and-toJSON-method.https.html: Copied from imported/w3c/web-platform-tests/payment-request/PaymentAddress/attributes-and-toJSON-method-manual.https.html.
* http/tests/paymentrequest/payment-response-complete-method.https-expected.txt: Added.
* http/tests/paymentrequest/payment-response-complete-method.https.html: Copied from imported/w3c/web-platform-tests/payment-request/payment-response/complete-method-manual.https.html.
* http/tests/paymentrequest/payment-response-methodName-attribute.https-expected.txt: Added.
* http/tests/paymentrequest/payment-response-methodName-attribute.https.html: Copied from imported/w3c/web-platform-tests/payment-request/payment-response/methodName-attribute-manual.https.html.
* http/tests/paymentrequest/payment-response-payerEmail-attribute.https-expected.txt: Added.
* http/tests/paymentrequest/payment-response-payerEmail-attribute.https.html: Copied from imported/w3c/web-platform-tests/payment-request/payment-response/payerEmail-attribute-manual.https.html.
* http/tests/paymentrequest/payment-response-payerName-attribute.https-expected.txt: Added.
* http/tests/paymentrequest/payment-response-payerName-attribute.https.html: Copied from imported/w3c/web-platform-tests/payment-request/payment-response/payerName-attribute-manual.https.html.
* http/tests/paymentrequest/payment-response-payerPhone-attribute.https-expected.txt: Added.
* http/tests/paymentrequest/payment-response-payerPhone-attribute.https.html: Copied from imported/w3c/web-platform-tests/payment-request/payment-response/payerPhone-attribute-manual.https.html.
* http/tests/paymentrequest/resources/helpers.js: Copied from imported/w3c/web-platform-tests/payment-request/payment-response/helpers.js.
(test):
(async.getPaymentResponse):
(async.getPaymentRequestResponse):
(async.runTest):

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

3 years agoAttempt to stop iOS Simulator tests from failing because
dino@apple.com [Mon, 23 Oct 2017 20:59:40 +0000 (20:59 +0000)]
Attempt to stop iOS Simulator tests from failing because
we don't support Accelerated ImageBuffer.

* html/ImageBitmap.cpp:

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

3 years ago[FrameView::layout cleanup] Make m_subtreeLayoutRoot weak.
zalan@apple.com [Mon, 23 Oct 2017 20:42:50 +0000 (20:42 +0000)]
[FrameView::layout cleanup] Make m_subtreeLayoutRoot weak.
https://bugs.webkit.org/show_bug.cgi?id=178621
<rdar://problem/35110321>

Reviewed by Simon Fraser.

This patch turn m_subtreeLayoutRoot into a weak pointer to handle both the optional and the mutation cases.

Covered by existing cases.

* page/FrameView.cpp:
(WebCore::FrameView::reset):
(WebCore::FrameView::willDestroyRenderTree):
(WebCore::FrameView::didDestroyRenderTree):
(WebCore::FrameView::calculateScrollbarModesForLayout):
(WebCore::FrameView::handleLayoutWithFrameFlatteningIfNeeded):
(WebCore::FrameView::canPerformLayout const):
(WebCore::FrameView::layout): WeakPtr<RenderElement> protects us from recursive layouts triggering UAF on layoutRoot.
(WebCore::FrameView::convertSubtreeLayoutToFullLayout):
(WebCore::FrameView::scheduleRelayout):
(WebCore::FrameView::scheduleRelayoutOfSubtree):
(WebCore::FrameView::needsLayout const):
(WebCore::FrameView::autoSizeIfEnabled):
* page/FrameView.h:

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

3 years agoUnreviewed, fix windows build.
keith_miller@apple.com [Mon, 23 Oct 2017 20:40:13 +0000 (20:40 +0000)]
Unreviewed, fix windows build.

* CMakeLists.txt:

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

3 years agoUnreviewed, suppress deprecation warnings to fix the build.
ryanhaddad@apple.com [Mon, 23 Oct 2017 20:32:34 +0000 (20:32 +0000)]
Unreviewed, suppress deprecation warnings to fix the build.
<rdar://problem/35131949>

* UIProcess/ios/forms/WKFormSelectPopover.mm:
(-[WKSelectTableViewController tableView:cellForRowAtIndexPath:]):
(-[WKSelectPopover initWithView:hasGroups:]):

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

3 years agoMove shared accessibility and animiations files to unified sources.
keith_miller@apple.com [Mon, 23 Oct 2017 20:23:06 +0000 (20:23 +0000)]
Move shared accessibility and animiations files to unified sources.
https://bugs.webkit.org/show_bug.cgi?id=178677

Reviewed by Tim Horton.

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

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

3 years agoDrop confusing Event::dispatched() method
cdumez@apple.com [Mon, 23 Oct 2017 19:36:24 +0000 (19:36 +0000)]
Drop confusing Event::dispatched() method
https://bugs.webkit.org/show_bug.cgi?id=178670

Reviewed by Youenn Fablet.

Source/WebCore:

Drop confusing Event::dispatched() method. What the call sites want to do is check
that the Event's "dispatch" flag is set:
- https://dom.spec.whatwg.org/#dispatch-flag

This flag gets set at the beginning of dispatchEvent() and unset at the end of
dispatchEvent():
- https://dom.spec.whatwg.org/#ref-for-dispatch-flag③

See as an example event.initEvent():
- https://dom.spec.whatwg.org/#dom-event-initevent

The right way to check the Event's "dispatch" flag is the Event::isBeingDispatched()
method, so use this instead. One side effect of this change is that it is now
possible to call the init*Event() method on events that have already been dispatched
in order to dispatch them again, as per the specification.

Test: fast/events/initEvent-after-dispatching.html

* dom/CompositionEvent.cpp:
(WebCore::CompositionEvent::initCompositionEvent):
* dom/DeviceMotionEvent.cpp:
(WebCore::DeviceMotionEvent::initDeviceMotionEvent):
* dom/DeviceOrientationEvent.cpp:
(WebCore::DeviceOrientationEvent::initDeviceOrientationEvent):
* dom/Event.h:
* dom/HashChangeEvent.h:
* dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::initKeyboardEvent):
* dom/MessageEvent.cpp:
(WebCore::MessageEvent::initMessageEvent):
* dom/MouseEvent.cpp:
(WebCore::MouseEvent::initMouseEvent):
* dom/OverflowEvent.cpp:
(WebCore::OverflowEvent::initOverflowEvent):
* dom/TextEvent.cpp:
(WebCore::TextEvent::initTextEvent):
* dom/TouchEvent.cpp:
(WebCore::TouchEvent::initTouchEvent):
* dom/UIEvent.cpp:
(WebCore::UIEvent::initUIEvent):
* dom/WheelEvent.cpp:
(WebCore::WheelEvent::initWheelEvent):
* storage/StorageEvent.cpp:
(WebCore::StorageEvent::initStorageEvent):

LayoutTests:

Add layout test coverage.

* fast/events/initEvent-after-dispatching-expected.txt: Added.
* fast/events/initEvent-after-dispatching.html: Added.

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

3 years agoRemember previous child renderer during render tree update
antti@apple.com [Mon, 23 Oct 2017 18:59:06 +0000 (18:59 +0000)]
Remember previous child renderer during render tree update
https://bugs.webkit.org/show_bug.cgi?id=178659

Reviewed by Zalan Bujtas.

Source/WebCore:

We shouldn't need to recompute the previous renderer, we know it already.

* style/RenderTreePosition.cpp:
(WebCore::RenderTreePosition::previousSiblingRenderer const): Deleted.

    No longer needed. This was also subtly wrong as doesn't take display:contents into account.

* style/RenderTreePosition.h:
* style/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateRenderTree):
(WebCore::RenderTreeUpdater::textRendererIsNeeded):

    Use the saved previous renderer.

(WebCore::RenderTreeUpdater::updateTextRenderer):
(WebCore::RenderTreeUpdater::storePreviousRenderer):

    Save the previous renderere as we walk the tree.

(WebCore::textRendererIsNeeded): Deleted.
* style/RenderTreeUpdater.h:

LayoutTests:

* fast/block/float/float-not-removed-from-pre-block-expected.txt:
* platform/mac/fast/css-generated-content/details-summary-before-after-expected.txt:

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

3 years agoAdd Shared Modules files to the unified source build.
keith_miller@apple.com [Mon, 23 Oct 2017 18:57:50 +0000 (18:57 +0000)]
Add Shared Modules files to the unified source build.
https://bugs.webkit.org/show_bug.cgi?id=178675

Reviewed by Tim Horton.

This patch all the Modules sources files shared across all ports to
unified sources.

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

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

3 years ago<rdar://problem/35045445>
lforschler@apple.com [Mon, 23 Oct 2017 18:42:09 +0000 (18:42 +0000)]
<rdar://problem/35045445>
Update README to reference WebKit build archives, instead of 'nightly'

Reviewed by Aakash Jain.

* WebKitArchiveSupport/README:

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

3 years agoAdd tests to ensure spelling error dots are drawn in the correct place in bottom...
dbates@webkit.org [Mon, 23 Oct 2017 18:10:15 +0000 (18:10 +0000)]
Add tests to ensure spelling error dots are drawn in the correct place in bottom-to-top
and right-to-left writing modes
https://bugs.webkit.org/show_bug.cgi?id=178671

Reviewed by Simon Fraser.

* fast/writing-mode/english-bt-text-with-spelling-marker-expected.html: Added.
* fast/writing-mode/english-bt-text-with-spelling-marker.html: Added.
* fast/writing-mode/english-rl-text-with-spelling-marker-expected.html: Added.
* fast/writing-mode/english-rl-text-with-spelling-marker.html: Added.
* platform/ios/TestExpectations: Skip the test on iOS as it does not support spelling and grammar
marker painting.
* platform/mac-wk2/TestExpectations: Mark the test as an image failure until we fix <https://bugs.webkit.org/show_bug.cgi?id=105616>.

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

3 years agobmalloc::api::tryLargeMemalignVirtual() shouldn't assert on a failed allocation
zandobersek@gmail.com [Mon, 23 Oct 2017 17:56:41 +0000 (17:56 +0000)]
bmalloc::api::tryLargeMemalignVirtual() shouldn't assert on a failed allocation
https://bugs.webkit.org/show_bug.cgi?id=178654

Reviewed by Geoffrey Garen.

* bmalloc/bmalloc.h:
(bmalloc::api::tryLargeMemalignVirtual): Call Heap::tryAllocateLarge()
instead of Heap::allocateLarge(). The former will return a null pointer
upon a failed allocation, allowing the caller to fail gracefully just as
the API entrypoint implies, while the latter currently provokes a crash
in these circumstances.

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

3 years agoImplement drawImage(ImageBitmap) on 2d canvas
dino@apple.com [Mon, 23 Oct 2017 17:51:08 +0000 (17:51 +0000)]
Implement drawImage(ImageBitmap) on 2d canvas
https://bugs.webkit.org/show_bug.cgi?id=178653
<rdar://problem/35104360>

Reviewed by Antoine Quint.

LayoutTests/imported/w3c:

Update expected results now that drawImage is implemented.

* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt:

Source/WebCore:

Implement CanvasRenderingContext2D::drawImage with ImageBitmap.
It's probably not going to be a very common operation, but
it importantly allows us to test the ImageBitmap creation
code.

Test: http/wpt/2dcontext/imagebitmap/drawImage-ImageBitmap.html

* html/ImageBitmap.cpp:
(WebCore::taintsOrigin): New helper function to determine if a
CachedImage would provide a clean origin.
(WebCore::ImageBitmap::createPromise): Set the flag that records
if this ImageBitmap has a clean origin.
* html/ImageBitmap.h:
(WebCore::ImageBitmap::buffer): Exposes the ImageBuffer backing
store, allowing access to the data for drawing.
(WebCore::ImageBitmap::originClean const): Is this ImageBitmap
going to taint a destination.
* html/canvas/CanvasRenderingContext.cpp:
(WebCore::CanvasRenderingContext::wouldTaintOrigin): Implement
the ImageBitmap version of this template function.
* html/canvas/CanvasRenderingContext.h:
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::drawImage): Implement the
actual drawing of an ImageBitmap.

LayoutTests:

Add a new test that exercises drawImage(ImageBitmap)
that will be contributed back to Web Platform Tests.

* http/wpt/2dcontext/imagebitmap/common.js: Copied (mostly) from WPT.
(create9x9CanvasWith2dContext): New helper function to create a canvas
and provide a rendering context.
* http/wpt/2dcontext/imagebitmap/drawImage-ImageBitmap-expected.txt: Added.
* http/wpt/2dcontext/imagebitmap/drawImage-ImageBitmap.html: Added.
* http/wpt/2dcontext/imagebitmap/target-blue-dot.png: Added.

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

3 years agoAdd tests to ensure spelling error dots are drawn in the correct place for overlappin...
dbates@webkit.org [Mon, 23 Oct 2017 17:49:22 +0000 (17:49 +0000)]
Add tests to ensure spelling error dots are drawn in the correct place for overlapping lines
https://bugs.webkit.org/show_bug.cgi?id=178611
<rdar://problem/35105805>

Reviewed by Zalan Bujtas.

Add tests to ensure that we paint the spelling error dots in the correct place for
overlapping lines.

* editing/spelling/spelling-markers-in-overlapping-lines-expected.html: Added.
* editing/spelling/spelling-markers-in-overlapping-lines-large-font-expected.html: Added.
* editing/spelling/spelling-markers-in-overlapping-lines-large-font.html: Added.
* editing/spelling/spelling-markers-in-overlapping-lines.html: Added.
* platform/ios/TestExpectations: Skip the test on iOS as it does not support spelling and grammar
marker painting.
* platform/mac-wk2/TestExpectations: Mark the test as an image failure until we fix <https://bugs.webkit.org/show_bug.cgi?id=105616>.

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

3 years agoUnreviewed WPE gardening. Unskip the SVG tests and generate the
zandobersek@gmail.com [Mon, 23 Oct 2017 17:35:23 +0000 (17:35 +0000)]
Unreviewed WPE gardening. Unskip the SVG tests and generate the
required platform-specific baselines.

* platform/wpe/TestExpectations:
* platform/wpe/svg: Added ~800 baselines.

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

3 years agoUnreviewed, rolling out r223699.
dbates@webkit.org [Mon, 23 Oct 2017 17:28:18 +0000 (17:28 +0000)]
Unreviewed, rolling out r223699.

Caused regressions with right-to-left text selection and
painting of markers in flipped writing mode and in overlapping
lines. Will investigate offline.

Reverted changeset:

"Share logic in InlineTextBox to compute selection rect"
https://bugs.webkit.org/show_bug.cgi?id=178232
https://trac.webkit.org/changeset/223699

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

3 years agoSource/WebCore:
commit-queue@webkit.org [Mon, 23 Oct 2017 17:25:32 +0000 (17:25 +0000)]
Source/WebCore:
Create a Fetch event when ServiceWorker has to handle a fetch
https://bugs.webkit.org/show_bug.cgi?id=178491

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

Covered by existing test.

Updating FetchEvent to pass a FetchResponse* within its onResponse callback.
Making it a CompletionHandler.
Fixing a check on respondWith to ensure that event is dispatched when respondWith is called.

Adding ServiceWorkerFetch class to handle the creation of the fetch event, waiting for the fetch event to be responded
and processing when fetch event is responded.
ServiceWorkerFetchTask takes a client to which will be sent the response body or the error.
WebKit implementation of it will be to send the related IPC message back to the WebProcess that made the fetch request.

Adding a method to ServiceWorkerThread to create the fetch event on worker thread and dispatch on the global scope.

* WebCore.xcodeproj/project.pbxproj:
* platform/network/ResourceResponseBase.h:
* testing/Internals.cpp:
(WebCore::Internals::waitForFetchEventToFinish):
* workers/service/FetchEvent.cpp:
(WebCore::FetchEvent::~FetchEvent):
(WebCore::FetchEvent::respondWith):
(WebCore::FetchEvent::onResponse):
(WebCore::FetchEvent::respondWithError):
(WebCore::FetchEvent::processResponse):
(WebCore::FetchEvent::promiseIsSettled):
* workers/service/FetchEvent.h:
* workers/service/context/ServiceWorkerFetch.cpp: Added.
(WebCore::ServiceWorkerFetch::dispatchFetchTask):
(WebCore::ServiceWorkerFetch::processResponse):
* workers/service/context/ServiceWorkerFetch.h: Added.
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::m_workerObjectProxy):
(WebCore::ServiceWorkerThread::dispatchFetchEvent):
* workers/service/context/ServiceWorkerThread.h:

Source/WebKit:
TestController should clear all fetch caches when resetting its state
https://bugs.webkit.org/show_bug.cgi?id=178486
<rdar://problem/35066305>

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

Adding a new DidNotHandle message to disambiguate with the DidFail fetch case.
With DidNotHandle, the loading should go the network process.
With DidFail, the loading should return a network error.

On receiving an order to start a fetch, ServiceWorkerThread will dispatch a fetch event.
The client of this event will retrieve the response and return it to the WebProcess through IPC.

* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::didNotHandleFetch):
* StorageProcess/ServiceWorker/WebSWServerConnection.h:
* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::didNotHandleFetch):
* StorageProcess/StorageProcess.h:
* StorageProcess/StorageProcess.messages.in:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Storage/ServiceWorkerClientFetch.cpp:
(WebKit::ServiceWorkerClientFetch::didFail):
(WebKit::ServiceWorkerClientFetch::didNotHandle):
* WebProcess/Storage/ServiceWorkerClientFetch.h:
* WebProcess/Storage/ServiceWorkerClientFetch.messages.in:
* WebProcess/Storage/ServiceWorkerContextManager.cpp:
(WebKit::ServiceWorkerContextManager::startFetch):
* WebProcess/Storage/ServiceWorkerContextManager.h:
* WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp: Added.
(WebKit::WebServiceWorkerFetchTaskClient::~WebServiceWorkerFetchTaskClient):
(WebKit::WebServiceWorkerFetchTaskClient::WebServiceWorkerFetchTaskClient):
(WebKit::WebServiceWorkerFetchTaskClient::didReceiveResponse):
(WebKit::WebServiceWorkerFetchTaskClient::didReceiveData):
(WebKit::WebServiceWorkerFetchTaskClient::didFail):
(WebKit::WebServiceWorkerFetchTaskClient::didFinish):
* WebProcess/Storage/WebServiceWorkerFetchTaskClient.h: Added.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::startFetchInServiceWorker):
* WebProcess/WebProcess.h:

LayoutTests:
TestController should clear all fetch caches when resetting its state
https://bugs.webkit.org/show_bug.cgi?id=178486
<rdar://problem/35066305>

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

Beefing up the test by using fetch event handler to return responses
previously hard coded in ServiceWorkerContextManager.

* http/tests/workers/service/basic-fetch.https-expected.txt:
* http/tests/workers/service/resources/basic-fetch-worker.js:
(event.event.request.url.indexOf):
* http/tests/workers/service/resources/basic-fetch.js:

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