WebKit.git
2 years agoRange bisector should check the commits for repositories without change in specified...
dewei_zhu@apple.com [Wed, 9 May 2018 20:58:27 +0000 (20:58 +0000)]
Range bisector should check the commits for repositories without change in specified range.
https://bugs.webkit.org/show_bug.cgi?id=185269

Reviewed by Ryosuke Niwa.

For repositories without a change in the specified range, we still need to use them to filter commit
sets. Before this change, code does not apply filtering by those repositories against commit set. As
a result, commit sets with different commits for those repositories may be chosen as bisecting commit set.

* public/v3/commit-set-range-bisector.js: Updated the logic to verify range for repositories without
change in range.
(CommitSetRangeBisector.async.commitSetClosestToMiddleOfAllCommits):
* unit-tests/commit-set-range-bisector-tests.js: Added a unit test to guard against this change.

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

2 years ago[Cocoa] Some fields are not identified as [WKWebProcessPlugInNodeHandle isTextField]
commit-queue@webkit.org [Wed, 9 May 2018 20:31:13 +0000 (20:31 +0000)]
[Cocoa] Some fields are not identified as [WKWebProcessPlugInNodeHandle isTextField]
https://bugs.webkit.org/show_bug.cgi?id=185260
<rdar://problem/39290394>

Source/WebKit:

INPUT element are not considered to be text fields when
calling -[WKWebProcessPlugInNodeHandle isTextField]
when they are of type number.

Patch by Richard Houle <rhoule@apple.com> on 2018-05-09
Reviewed by Tim Horton.

* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
(WebKit::InjectedBundleNodeHandle::isTextField const):

Tools:

Patch by Richard Houle <rhoule@apple.com> on 2018-05-09
Reviewed by Tim Horton.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/InjectedBundleNodeHandleIsTextField.mm: Added.
(-[InjectedBundleNodeHandleIsTextField isTextFieldForHTMLInputType:document:jsContext:]):
(-[InjectedBundleNodeHandleIsTextField webProcessPlugIn:didCreateBrowserContextController:]):
* TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm:
(-[InjectedBundleNodeHandleIsTextFieldDelegate webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:completionHandler:]):

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

2 years agoSource/WebCore:
commit-queue@webkit.org [Wed, 9 May 2018 20:24:23 +0000 (20:24 +0000)]
Source/WebCore:
Hooked up ASTC support in WebGL; requires OpenGL ES 3 context to work.
https://bugs.webkit.org/show_bug.cgi?id=185272
<rdar://problem/15745737>

Patch by Justin Fan <justin_fan@apple.com> on 2018-05-09
Reviewed by Dean Jackson.

Also added in Khronos' ASTC test from version 1.0.4 beta of their conformance test suite,
although again, this requires OpenGL ES 3 context for WebKit to detect proper support.

Test: fast/canvas/webgl/webgl-compressed-texture-astc.html

* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMConvertWebGL.cpp:
(WebCore::convertToJSValue):
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::getExtension):
(WebCore::WebGL2RenderingContext::getSupportedExtensions):
* html/canvas/WebGLCompressedTextureASTC.cpp: Added.
(WebCore::WebGLCompressedTextureASTC::WebGLCompressedTextureASTC):
(WebCore::WebGLCompressedTextureASTC::getName const):
(WebCore::WebGLCompressedTextureASTC::supported):
(WebCore::WebGLCompressedTextureASTC::getSupportedProfiles):
* html/canvas/WebGLCompressedTextureASTC.h: Added.
* html/canvas/WebGLCompressedTextureASTC.idl: Added.
* html/canvas/WebGLExtension.h:
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getExtension):
(WebCore::WebGLRenderingContext::getSupportedExtensions):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::validateCompressedTexFuncData):
(WebCore::WebGLRenderingContextBase::validateCompressedTexDimensions):
* html/canvas/WebGLRenderingContextBase.h:
* platform/graphics/Extensions3D.h:

LayoutTests:
Added Khronos conformance test for ASTC compressed texture support.
https://bugs.webkit.org/show_bug.cgi?id=185272
<rdar://problem/15745737>

Patch by Justin Fan <justin_fan@apple.com> on 2018-05-09
Reviewed by Dean Jackson.

This requires OpenGL ES 3 context for WebKit to detect proper support.

* fast/canvas/webgl/resources/js-test-post.js: Added.
* fast/canvas/webgl/resources/js-test-pre.js: Added.
* fast/canvas/webgl/resources/js-test-style.css: Added.
* fast/canvas/webgl/resources/webgl-test-utils-khr.js: Added.
* fast/canvas/webgl/webgl-compressed-texture-astc-expected.txt: Added.
* fast/canvas/webgl/webgl-compressed-texture-astc.html: Added.

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

2 years agoAdd JSVirtualMachine SPI to shrink the memory footprint of the VM
sbarati@apple.com [Wed, 9 May 2018 20:11:31 +0000 (20:11 +0000)]
Add JSVirtualMachine SPI to shrink the memory footprint of the VM
https://bugs.webkit.org/show_bug.cgi?id=185441
<rdar://problem/39999414>

Reviewed by Keith Miller.

This patch adds JSVirtualMachine SPI to release as much memory as possible.
The SPI does:
- Deletes all code caches.
- Synchronous GC.
- Run the scavenger.

* API/JSVirtualMachine.mm:
(-[JSVirtualMachine shrinkFootprint]):
* API/JSVirtualMachinePrivate.h: Added.
* API/tests/testapi.mm:
(testObjectiveCAPIMain):
* JavaScriptCore.xcodeproj/project.pbxproj:
* runtime/VM.cpp:
(JSC::VM::shrinkFootprint):
* runtime/VM.h:

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

2 years agoAllow WebResourceLoader to cancel a load served from a service worker
youenn@apple.com [Wed, 9 May 2018 19:59:46 +0000 (19:59 +0000)]
Allow WebResourceLoader to cancel a load served from a service worker
https://bugs.webkit.org/show_bug.cgi?id=185274

Reviewed by Chris Dumez.

Source/WebCore:

Add support for cancelling a fetch from WebProcess to service worker process.
Use FetchIdentifier instead of uint64_t.

* Modules/fetch/FetchIdentifier.h: Added.
* WebCore.xcodeproj/project.pbxproj:
* workers/service/context/ServiceWorkerFetch.h:
* workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::ServiceWorkerThreadProxy::startFetch):
(WebCore::ServiceWorkerThreadProxy::cancelFetch):
* workers/service/context/ServiceWorkerThreadProxy.h:

Source/WebKit:

Use FetchIdentifier instead of uint64_t.
Add IPC support for cancelling a fetch from WebProcess to service worker process.
Ask service worker process to cancel the fetch when its corresponding WebResourceLoader is cancelled.
No change of behavior as once a WebResourceLoader is cancelled, any related IPC is not processed.
A follow-up patch should try to cancel the FetchResponse load, meaning to either cancel the network load
or to abort reading the readable stream.

* Scripts/webkit/messages.py:
* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::cancelFetch):
(WebKit::WebSWServerConnection::startFetch):
(WebKit::WebSWServerConnection::didReceiveFetchResponse):
(WebKit::WebSWServerConnection::didReceiveFetchData):
(WebKit::WebSWServerConnection::didReceiveFetchFormData):
(WebKit::WebSWServerConnection::didFinishFetch):
(WebKit::WebSWServerConnection::didFailFetch):
(WebKit::WebSWServerConnection::didNotHandleFetch):
* StorageProcess/ServiceWorker/WebSWServerConnection.h:
* StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::didFailFetch):
(WebKit::StorageProcess::didNotHandleFetch):
(WebKit::StorageProcess::didReceiveFetchResponse):
(WebKit::StorageProcess::didReceiveFetchData):
(WebKit::StorageProcess::didReceiveFetchFormData):
(WebKit::StorageProcess::didFinishFetch):
* StorageProcess/StorageProcess.h:
* StorageProcess/StorageProcess.messages.in:
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::remove):
* WebProcess/Storage/ServiceWorkerClientFetch.cpp:
(WebKit::ServiceWorkerClientFetch::create):
(WebKit::ServiceWorkerClientFetch::ServiceWorkerClientFetch):
(WebKit::ServiceWorkerClientFetch::start):
(WebKit::ServiceWorkerClientFetch::cancel):
* WebProcess/Storage/ServiceWorkerClientFetch.h:
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::startFetch):
(WebKit::WebSWClientConnection::cancelFetch):
* WebProcess/Storage/WebSWClientConnection.h:
* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::cancelFetch):
(WebKit::WebSWContextManagerConnection::startFetch):
* WebProcess/Storage/WebSWContextManagerConnection.h:
* WebProcess/Storage/WebSWContextManagerConnection.messages.in:
* WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
(WebKit::WebServiceWorkerFetchTaskClient::WebServiceWorkerFetchTaskClient):
(WebKit::WebServiceWorkerFetchTaskClient::cancel):
* WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:
* WebProcess/Storage/WebServiceWorkerProvider.cpp:
(WebKit::WebServiceWorkerProvider::handleFetch):
(WebKit::WebServiceWorkerProvider::cancelFetch):
(WebKit::WebServiceWorkerProvider::fetchFinished):
* WebProcess/Storage/WebServiceWorkerProvider.h:

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

2 years ago[tests][GStreamer]: Pass USE_PLAYBIN3 to the tests subprocess
commit-queue@webkit.org [Wed, 9 May 2018 19:14:02 +0000 (19:14 +0000)]
[tests][GStreamer]: Pass USE_PLAYBIN3 to the tests subprocess
https://bugs.webkit.org/show_bug.cgi?id=185481

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

[tests][GStreamer]: Pass USE_PLAYBIN3 to the tests subprocess

* Scripts/webkitpy/port/gtk.py:
(GtkPort.setup_environ_for_server):

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

2 years ago[iOS] Consider the annotation bounds when positioning action sheets near long-pressed...
aestes@apple.com [Wed, 9 May 2018 19:08:30 +0000 (19:08 +0000)]
[iOS] Consider the annotation bounds when positioning action sheets near long-pressed PDF links
https://bugs.webkit.org/show_bug.cgi?id=185472
<rdar://problem/39967092>

Reviewed by Daniel Bates.

Adopted new PDFHostViewControllerDelegate methods that include annotation rects
when URLs and page indices are long-pressed. This allows us to avoid obscuring
annotations when positioning action sheet popovers.

We also no longer need to convert the press location into host view coordinate
space, as PDFKit now does that for us.

* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView _showActionSheetForURL:atLocation:withAnnotationRect:]):
(-[WKPDFView pdfHostViewController:didLongPressURL:atLocation:withAnnotationRect:]):
(-[WKPDFView pdfHostViewController:didLongPressPageIndex:atLocation:withAnnotationRect:]):
(-[WKPDFView _showActionSheetForURL:atLocation:]): Deleted.
(-[WKPDFView pdfHostViewController:didLongPressURL:atLocation:]): Deleted.
(-[WKPDFView pdfHostViewController:didLongPressPageIndex:atLocation:]): Deleted.

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

2 years ago[GStreamer] Fix style issue in MediaPlayerPrivateGStreamer
commit-queue@webkit.org [Wed, 9 May 2018 19:01:44 +0000 (19:01 +0000)]
[GStreamer] Fix style issue in MediaPlayerPrivateGStreamer
https://bugs.webkit.org/show_bug.cgi?id=185479

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

ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:114:  Multi line control clauses should use braces.  [whitespace/braces] [4]
ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:194:  Multi line control clauses should use braces.  [whitespace/braces] [4]
ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:398:  One line control clauses should not use braces.  [whitespace/braces] [4]
ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:440:  One line control clauses should not use braces.  [whitespace/braces] [4]
ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:806:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:869:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:880:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:940:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:1102:  Multi line control clauses should use braces.  [whitespace/braces] [4]
ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:1109:  Multi line control clauses should use braces.  [whitespace/braces] [4]

Indentation and style issue fixed only.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::registerMediaEngine):
(WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
(WebCore::MediaPlayerPrivateGStreamer::changePipelineState):
(WebCore::MediaPlayerPrivateGStreamer::play):
(WebCore::MediaPlayerPrivateGStreamer::videoChangedCallback):
(WebCore::MediaPlayerPrivateGStreamer::videoSinkCapsChangedCallback):
(WebCore::MediaPlayerPrivateGStreamer::audioChangedCallback):
(WebCore::MediaPlayerPrivateGStreamer::textChangedCallback):
(WebCore::MediaPlayerPrivateGStreamer::buffered const):
(WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):

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

2 years agoREGRESSION (r231479): com.apple.WebCore crash in WebCore::DocumentLoader::stopLoading...
dbates@webkit.org [Wed, 9 May 2018 18:42:05 +0000 (18:42 +0000)]
REGRESSION (r231479): com.apple.WebCore crash in WebCore::DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied()
https://bugs.webkit.org/show_bug.cgi?id=185475
<rdar://problem/40093853>

Reviewed by Andy Estes.

DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied() must extends its lifetime
until completion as dispatching a DOM load event at the associated frame can cause JavaScript execution
that can do anything, including destroying the loader that dispatched the event.

Following r231479 DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied() is now
invoked by both DocumentLoader::responseReceived() and WebResourceLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied().
The latter only can happen when using WebKit2 and the experimental feature Restricted HTTP Response Access
is enabled (RuntimeEnabledFeatures::sharedFeatures().restrictedHTTPResponseAccess()). Unlike DocumentLoader::responseReceived()
WebResourceLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied() does not take out a ref
on the DocumentLoader before invoking DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied().
Therefore, DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied() can cause its
own destruction as a result of dispatching a DOM load event at the frame. We should take out a ref on
the DocumentLoader when executing DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied().

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied):

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

2 years agoFix the build by ignoring some deprecation warnings
timothy_horton@apple.com [Wed, 9 May 2018 18:31:24 +0000 (18:31 +0000)]
Fix the build by ignoring some deprecation warnings

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep):

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

2 years agoUnflake some additional AppCache tests
youenn@apple.com [Wed, 9 May 2018 18:02:32 +0000 (18:02 +0000)]
Unflake some additional AppCache tests
https://bugs.webkit.org/show_bug.cgi?id=185467

Reviewed by Alex Christensen.

Remove JS console logging for two tests that are testing crash scenarios.
Increase the time it takes to load appcache entries so that aborting
is done prior entry loading completion for two other tests.

* TestExpectations:
* http/tests/appcache/deferred-events-delete-while-raising-expected.txt:
* http/tests/appcache/deferred-events-delete-while-raising-timer-expected.txt:
* http/tests/appcache/resources/abort-cache-onprogress.manifest:
* http/tests/appcache/resources/not-exist.vob.php:

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

2 years ago[iOS] Tell PDFHostViewController when animated resizes begin and end
aestes@apple.com [Wed, 9 May 2018 17:30:39 +0000 (17:30 +0000)]
[iOS] Tell PDFHostViewController when animated resizes begin and end
https://bugs.webkit.org/show_bug.cgi?id=185477
<rdar://problem/39875372>

Reviewed by Anders Carlsson.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _beginAnimatedResizeWithUpdates:]):
(-[WKWebView _endAnimatedResize]):
* UIProcess/Cocoa/WKWebViewContentProvider.h:
* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView web_beginAnimatedResize]):
(-[WKPDFView web_endAnimatedResize]):

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

2 years ago[JSC] Fix ArraySpeciesCreate to return a new Array when the given object is not an...
commit-queue@webkit.org [Wed, 9 May 2018 17:29:39 +0000 (17:29 +0000)]
[JSC] Fix ArraySpeciesCreate to return a new Array when the given object is not an array
Error found in the following Test262 tests:

- test/built-ins/Array/prototype/slice/create-non-array-invalid-len.js
- test/built-ins/Array/prototype/slice/create-proxied-array-invalid-len.js
- test/built-ins/Array/prototype/splice/create-species-undef-invalid-len.js

The ArraySpeciesCreate should throw a RangeError with non-Array custom objects
presenting a length > 2**32-1
https://bugs.webkit.org/show_bug.cgi?id=185476

Patch by Leo Balter <leonardo.balter@gmail.com> on 2018-05-09
Reviewed by Yusuke Suzuki.

* runtime/ArrayPrototype.cpp:

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

2 years agoSet build.webkit.org to use the new Test262-runner
commit-queue@webkit.org [Wed, 9 May 2018 17:06:23 +0000 (17:06 +0000)]
Set build.webkit.org to use the new Test262-runner
https://bugs.webkit.org/show_bug.cgi?id=184933

Patch by Leo Balter <leonardo.balter@gmail.com> on 2018-05-09
Reviewed by Aakash Jain.

* BuildSlaveSupport/build.webkit.org-config/steps.py:
(RunTest262Tests):
(RunTest262Tests.countFailures):
* BuildSlaveSupport/build.webkit.org-config/steps_unittest.py:

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

2 years ago[GTK][JHBuild] LLVM 3.7.0 build is broken with GCC 8.1
commit-queue@webkit.org [Wed, 9 May 2018 17:02:56 +0000 (17:02 +0000)]
[GTK][JHBuild] LLVM 3.7.0 build is broken with GCC 8.1
https://bugs.webkit.org/show_bug.cgi?id=185461

Patch by Carlos Eduardo Ramalho <cadubentzen@gmail.com> on 2018-05-09
Reviewed by Michael Catanzaro.

JHBuild now compiles LLVM 6 and Mesa 18.0.3.

* gtk/jhbuild.modules:

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

2 years agoUnreviewed. Bump WPE soname for good measure.
mcatanzaro@igalia.com [Wed, 9 May 2018 16:43:08 +0000 (16:43 +0000)]
Unreviewed. Bump WPE soname for good measure.

* Source/cmake/OptionsWPE.cmake:

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

2 years agoUnreviewed. Update OptionsWPE.cmake and NEWS for 2.21.1 release.
mcatanzaro@igalia.com [Wed, 9 May 2018 16:26:17 +0000 (16:26 +0000)]
Unreviewed. Update OptionsWPE.cmake and NEWS for 2.21.1 release.

.:

* Source/cmake/OptionsWPE.cmake: Bump version numbers.

Source/WebKit:

* wpe/NEWS: Added. Add release notes for 2.21.1.

Tools:

* wpe/manifest.txt.in: Distribute the NEWS.

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

2 years ago[WPE] Build cleanly with GCC 8 and ICU 60
mcatanzaro@igalia.com [Wed, 9 May 2018 16:21:09 +0000 (16:21 +0000)]
[WPE] Build cleanly with GCC 8 and ICU 60
https://bugs.webkit.org/show_bug.cgi?id=185462

Reviewed by Carlos Alberto Lopez Perez.

Source/JavaScriptCore:

* API/glib/JSCClass.cpp: Silence many -Wcast-function-type warnings.
(jsc_class_add_constructor):
(jsc_class_add_method):
* API/glib/JSCValue.cpp: Silence many -Wcast-function-type warnings.
(jsc_value_object_define_property_accessor):
(jsc_value_new_function):
* CMakeLists.txt: Build BuiltinNames.cpp with -fno-var-tracking-assignments. This was a
problem with GCC 7 too, but might as well fix it now.
* assembler/ProbeContext.h:
(JSC::Probe::CPUState::gpr const): Silence a -Wclass-memaccess warning.
(JSC::Probe::CPUState::spr const): Ditto. Assume std::remove_const is safe to clobber.
* b3/air/AirArg.h:
(JSC::B3::Air::Arg::isRepresentableAs): Silence -Wfallthrough warning.
* builtins/BuiltinNames.cpp:
(JSC::BuiltinNames::BuiltinNames): Moved from BuiltinNames.h so we can use a special flag.
* builtins/BuiltinNames.h:
(JSC::BuiltinNames::BuiltinNames): Moved to BuiltinNames.cpp.
* dfg/DFGDoubleFormatState.h:
(JSC::DFG::mergeDoubleFormatStates): Silence -Wfallthrough warnings.
* heap/MarkedBlockInlines.h:
(JSC::MarkedBlock::Handle::finishSweepKnowingHeapCellType): Silence -Wfallthrough warnings.
* runtime/ConfigFile.cpp:
(JSC::ConfigFile::canonicalizePaths): Here GCC found a genuine mistake, strncat is called
with the wrong length parameter and the result is not null-terminated. Also, silence a
-Wstringop-truncation warning as we intentionally truncate filenames that exceed PATH_MAX.
* runtime/IntlDateTimeFormat.cpp:
(JSC::IntlDateTimeFormat::partTypeString): Avoid an ICU deprecation warning.
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init): We were unconditionally running some BigInt code by accident.
(JSC::JSGlobalObject::visitChildren): Probably a serious bug? Fixed.

Source/ThirdParty:

* xdgmime/CMakeLists.txt: Silence -Wno-cast-function-type. I'm not fighting xdg-mime.

Source/WebCore:

* PlatformGTK.cmake: Include directories are in the wrong place.
* accessibility/AXObjectCache.cpp: Silence -Wclass-memaccess problems and leave warnings.
(WebCore::AXObjectCache::startOrEndTextMarkerDataForRange):
(WebCore::AXObjectCache::textMarkerDataForCharacterOffset):
(WebCore::AXObjectCache::textMarkerDataForVisiblePosition):
(WebCore::AXObjectCache::textMarkerDataForFirstPositionInTextControl):
* css/CSSFontFace.cpp: Silence -Wfallthrough
(WebCore::CSSFontFace::fontLoadTiming const):
* css/CSSSelectorList.cpp: Silence -Wclass-memaccess, this one is intentional.
(WebCore::CSSSelectorList::adoptSelectorVector):
* editing/TextIterator.cpp: Silence ICU deprecation warnings.
* platform/Length.h:
(WebCore::Length::operator=): More -Wclass-memaccess, looks benign.
* platform/graphics/Gradient.cpp:
(WebCore::Gradient::hash const): -Wclass-memaccess again. Leave a warning.
* platform/graphics/SurrogatePairAwareTextIterator.cpp: Silence ICU deprecation warnings.
* platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
(WebCore::FontCascade::fontForCombiningCharacterSequence const): Silence ICU deprecation.
* platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
(WebCore::FontCustomPlatformData::FontCustomPlatformData): Silence -Wcast-function-type.
* platform/graphics/freetype/SimpleFontDataFreeType.cpp:
(WebCore::Font::canRenderCombiningCharacterSequence const): Silence ICU deprecation.
* platform/graphics/gstreamer/GstAllocatorFastMalloc.cpp:
(gstAllocatorFastMallocMemUnmap): Fix -Wcast-function-type.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::updateTracks): Fix bad printf.
(WebCore::MediaPlayerPrivateGStreamer::enableTrack): Another bad printf.
(WebCore::findHLSQueue): Fix -Wcast-function-type.
* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
(webKitMediaClearKeyDecryptorDecrypt): Fix another bad printf.
* platform/network/soup/SocketStreamHandleImplSoup.cpp: Silence -Wcast-function-type.
(WebCore::SocketStreamHandleImpl::beginWaitingForSocketWritability):
* platform/text/TextEncoding.cpp: Silence ICU deprecration.

Source/WebKit:

* Platform/IPC/glib/GSocketMonitor.cpp:
(IPC::GSocketMonitor::start): Silence -Wcast-function-type warning.
* Shared/API/glib/WebKitContextMenu.cpp:
(webkit_context_menu_new_with_items): Ditto.

Source/WTF:

* wtf/HashTable.h:
(WTF::HashTableBucketInitializer<true>::initialize): Since -Wclass-memaccess warning. This
is probably safe enough, since it's for an empty bucket.
* wtf/StdLibExtras.h:
(WTF::bitwise_cast): Silence -Wclass-memaccess as we use type traits to ensure safety here.
* wtf/Vector.h: Ditto, all uses are safe.
* wtf/glib/WTFGType.h: Silence -Wcast-function-type.

Tools:

* TestWebKitAPI/CMakeLists.txt: Fix weird build failure, we were missing a directory. Not
sure why this was never noticed until now or why the bots are OK.
* gtk/jhbuild.modules: Add upstream patch to avoid warnings inside G_DEFINE_TYPE.
* gtk/patches/glib-cast-function-type.patch: Added.
* wpe/jhbuild.modules: Add upstream patch to avoid warnings inside G_DEFINE_TYPE.
* wpe/patches/glib-cast-function-type.patch: Added.

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

2 years agoVersioning.
jmarcell@apple.com [Wed, 9 May 2018 16:19:55 +0000 (16:19 +0000)]
Versioning.

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

2 years ago[ARMv7] Drop ARMv7 disassembler in favor of capstone
utatane.tea@gmail.com [Wed, 9 May 2018 15:43:49 +0000 (15:43 +0000)]
[ARMv7] Drop ARMv7 disassembler in favor of capstone
https://bugs.webkit.org/show_bug.cgi?id=185423

Reviewed by Michael Catanzaro.

Source/JavaScriptCore:

This patch removes ARMv7Disassembler in our tree.
We already adopted Capstone, and it is already used in ARMv7 JIT environments.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* disassembler/ARMv7/ARMv7DOpcode.cpp: Removed.
* disassembler/ARMv7/ARMv7DOpcode.h: Removed.
* disassembler/ARMv7Disassembler.cpp: Removed.

Source/WTF:

Remove USE_ARMV7_DISASSEMBLER. Just use Capstone.

* wtf/Platform.h:

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

2 years agoSVG lighting colors need to be converted into linearSRGB
simon.fraser@apple.com [Wed, 9 May 2018 15:21:59 +0000 (15:21 +0000)]
SVG lighting colors need to be converted into linearSRGB
https://bugs.webkit.org/show_bug.cgi?id=181196

Reviewed by Darin Adler.

Address post-commit comments. Don't make a Color that contains linearRGB components,
but use FloatComponents instead. Since these FloatComponents are in the 0-1 range,
FELighting::setPixelInternal() needs to multiply by 255 since the output pixels are
8-bit 0-255.

Change linearToSRGBColorComponent() and sRGBToLinearColorComponent() to do math in
floats without promoting to doubles.

* platform/graphics/ColorUtilities.cpp:
(WebCore::FloatComponents::FloatComponents):
(WebCore::linearToSRGBColorComponent):
(WebCore::sRGBToLinearColorComponent):
(WebCore::sRGBColorToLinearComponents):
(WebCore::linearToSRGBColor): Deleted.
(WebCore::sRGBToLinearColor): Deleted.
* platform/graphics/ColorUtilities.h:
* platform/graphics/filters/FELighting.cpp:
(WebCore::FELighting::setPixelInternal):
(WebCore::FELighting::drawLighting):

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

2 years agoUse StyleColor::Options in more places.
timothy@apple.com [Wed, 9 May 2018 15:17:09 +0000 (15:17 +0000)]
Use StyleColor::Options in more places.

https://bugs.webkit.org/show_bug.cgi?id=185458
rdar://problem/39853798

Add UseDefaultAppearance to StyleColor::Options, to avoid passing yet another
boolean on some of these functions.

Reviewed by Tim Horton.

* css/MediaQueryEvaluator.cpp:
* css/StyleColor.h:
* dom/Document.cpp:
(WebCore::Document::useDefaultAppearance const):
(WebCore::Document::styleColorOptions const):
* dom/Document.h:
* platform/Theme.cpp:
(WebCore::Theme::paint):
* platform/Theme.h:
* platform/mac/LocalDefaultSystemAppearance.h:
* platform/mac/LocalDefaultSystemAppearance.mm:
(WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
(WebCore::LocalDefaultSystemAppearance::~LocalDefaultSystemAppearance):
* platform/mac/ThemeMac.h:
* platform/mac/ThemeMac.mm:
(WebCore::paintToggleButton):
(WebCore::paintButton):
(WebCore::ThemeMac::ensuredView):
(WebCore::ThemeMac::drawCellOrFocusRingWithViewIntoContext):
(WebCore::ThemeMac::paint):
(-[WebCoreThemeView initWithUseSystemAppearance:]): Deleted.
* platform/wpe/ThemeWPE.cpp:
(WebCore::ThemeWPE::paint):
* platform/wpe/ThemeWPE.h:
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::paintItemBackground):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paint):
(WebCore::RenderTheme::inactiveListBoxSelectionBackgroundColor const):
(WebCore::RenderTheme::platformInactiveListBoxSelectionBackgroundColor const):
* rendering/RenderTheme.h:
* rendering/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::platformInactiveListBoxSelectionBackgroundColor const):
* rendering/RenderThemeGtk.h:
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::documentViewFor const):
(WebCore::RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor const):
(WebCore::RenderThemeMac::systemColor const):
(WebCore::RenderThemeMac::paintCellAndSetFocusedElementNeedsRepaintIfNecessary):
(WebCore::RenderThemeMac::paintSliderThumb):

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

2 years ago[Win] The test http/tests/security/webaudio-render-remote-audio-allowed-crossorigin...
pvollan@apple.com [Wed, 9 May 2018 14:27:46 +0000 (14:27 +0000)]
[Win] The test http/tests/security/webaudio-render-remote-audio-allowed-crossorigin.html is timing out.
https://bugs.webkit.org/show_bug.cgi?id=185471

Unreviewed test gardening.

* platform/win/TestExpectations:

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

2 years ago[MIPS] Optimize generated JIT code using r2
commit-queue@webkit.org [Wed, 9 May 2018 14:17:01 +0000 (14:17 +0000)]
[MIPS] Optimize generated JIT code using r2
https://bugs.webkit.org/show_bug.cgi?id=184584

Patch by Srdjan Lazarevic <srdjan.lazarevic@rt-rk.com> on 2018-05-09
Reviewed by Yusuke Suzuki.

EXT and MFHC1 instructions from MIPSR2 implemented and used where it is possible.
Also, done some code size optimizations that were discovered in meantime.

* assembler/MIPSAssembler.h:
(JSC::MIPSAssembler::ext):
(JSC::MIPSAssembler::mfhc1):
* assembler/MacroAssemblerMIPS.cpp:
* assembler/MacroAssemblerMIPS.h:
(JSC::MacroAssemblerMIPS::isPowerOf2):
(JSC::MacroAssemblerMIPS::bitPosition):
(JSC::MacroAssemblerMIPS::loadAddress):
(JSC::MacroAssemblerMIPS::getEffectiveAddress):
(JSC::MacroAssemblerMIPS::load8):
(JSC::MacroAssemblerMIPS::load8SignedExtendTo32):
(JSC::MacroAssemblerMIPS::load32):
(JSC::MacroAssemblerMIPS::load16Unaligned):
(JSC::MacroAssemblerMIPS::load32WithUnalignedHalfWords):
(JSC::MacroAssemblerMIPS::load16):
(JSC::MacroAssemblerMIPS::load16SignedExtendTo32):
(JSC::MacroAssemblerMIPS::store8):
(JSC::MacroAssemblerMIPS::store16):
(JSC::MacroAssemblerMIPS::store32):
(JSC::MacroAssemblerMIPS::branchTest32):
(JSC::MacroAssemblerMIPS::loadFloat):
(JSC::MacroAssemblerMIPS::loadDouble):
(JSC::MacroAssemblerMIPS::storeFloat):
(JSC::MacroAssemblerMIPS::storeDouble):

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

2 years ago[JSC][GTK][JSCONLY] Use capstone disassembler
utatane.tea@gmail.com [Wed, 9 May 2018 11:42:09 +0000 (11:42 +0000)]
[JSC][GTK][JSCONLY] Use capstone disassembler
https://bugs.webkit.org/show_bug.cgi?id=185283

Reviewed by Michael Catanzaro.

.:

* Source/CMakeLists.txt:
* Source/cmake/FindLLVM.cmake: Removed.
* Source/cmake/OptionsCommon.cmake:
* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsJSCOnly.cmake:
* Source/cmake/OptionsWPE.cmake:

Source/JavaScriptCore:

Instead of adding MIPS disassembler baked by ourselves, we import capstone disassembler.
And use capstone disassembler for MIPS, ARM, and ARMv7 in GTK, WPE, WinCairo and JSCOnly ports.

And we remove ARM LLVM disassembler.

Capstone is licensed under 3-clause BSD, which is acceptable in WebKit tree.

* CMakeLists.txt:
* Sources.txt:
* disassembler/ARMLLVMDisassembler.cpp: Removed.
* disassembler/CapstoneDisassembler.cpp: Added.
(JSC::tryToDisassemble):

Source/ThirdParty:

Add capstone to ThirdParty. We build capstone as a static library,
and link it against JSC. We only build disassembler for target architecture.
So for MIPS target, we only enable MIPS part of capstone.

We also remove unnecessary architectures in capstone, XCore, PowerPC, SystemZ, etc.
This is simply done by deleting these architecture directories.

We pick "next" branch instead of "master" branch since "next" branch is actively
developed.

* capstone/CMakeLists.txt: Added.
* capstone/Source/.appveyor.yml: Added.
* capstone/Source/.gitattributes: Added.
* capstone/Source/.gitignore: Added.
* capstone/Source/.travis.yml: Added.
* capstone/Source/CMakeLists.txt: Added.
* capstone/Source/COMPILE.TXT: Added.
* capstone/Source/COMPILE_CMAKE.TXT: Added.
* capstone/Source/COMPILE_MSVC.TXT: Added.
* capstone/Source/CREDITS.TXT: Added.
* capstone/Source/ChangeLog-capstone: Added.
* capstone/Source/HACK.TXT: Added.
* capstone/Source/LEB128.h: Added.
(decodeULEB128):
* capstone/Source/LICENSE.TXT: Added.
* capstone/Source/LICENSE_LLVM.TXT: Added.
* capstone/Source/MCDisassembler.h: Added.
* capstone/Source/MCFixedLenDisassembler.h: Added.
* capstone/Source/MCInst.c: Added.
(MCInst_Init):
(MCInst_clear):
(MCInst_insert0):
(MCInst_setOpcode):
(MCInst_setOpcodePub):
(MCInst_getOpcode):
(MCInst_getOpcodePub):
(MCInst_getOperand):
(MCInst_getNumOperands):
(MCInst_addOperand2):
(MCOperand_Init):
(MCOperand_isValid):
(MCOperand_isReg):
(MCOperand_isImm):
(MCOperand_isFPImm):
(MCOperand_getReg):
(MCOperand_setReg):
(MCOperand_getImm):
(MCOperand_setImm):
(MCOperand_getFPImm):
(MCOperand_setFPImm):
(MCOperand_CreateReg1):
(MCOperand_CreateReg0):
(MCOperand_CreateImm1):
(MCOperand_CreateImm0):
* capstone/Source/MCInst.h: Added.
* capstone/Source/MCInstrDesc.c: Added.
(MCOperandInfo_isPredicate):
(MCOperandInfo_isOptionalDef):
* capstone/Source/MCInstrDesc.h: Added.
* capstone/Source/MCRegisterInfo.c: Added.
(MCRegisterInfo_InitMCRegisterInfo):
(DiffListIterator_init):
(DiffListIterator_getVal):
(DiffListIterator_next):
(DiffListIterator_isValid):
(MCRegisterInfo_getMatchingSuperReg):
(MCRegisterInfo_getSubReg):
(MCRegisterInfo_getRegClass):
(MCRegisterClass_contains):
* capstone/Source/MCRegisterInfo.h: Added.
* capstone/Source/Makefile: Added.
* capstone/Source/MathExtras.h: Added.
(Hi_32):
(Lo_32):
(isUIntN):
(isMask_32):
(isMask_64):
(isShiftedMask_32):
(isShiftedMask_64):
(isPowerOf2_32):
(CountLeadingZeros_32):
(CountLeadingOnes_32):
(CountLeadingZeros_64):
(CountLeadingOnes_64):
(CountTrailingZeros_32):
(CountTrailingOnes_32):
(CountTrailingZeros_64):
(CountTrailingOnes_64):
(CountPopulation_32):
(CountPopulation_64):
(Log2_32):
(Log2_64):
(Log2_32_Ceil):
(Log2_64_Ceil):
(GreatestCommonDivisor64):
(BitsToDouble):
(BitsToFloat):
(DoubleToBits):
(FloatToBits):
(MinAlign):
(NextPowerOf2):
(RoundUpToAlignment):
(OffsetToAlignment):
(abs64):
(SignExtend32):
(SignExtend64):
(countLeadingZeros):
* capstone/Source/README.md: Added.
* capstone/Source/RELEASE_NOTES: Added.
* capstone/Source/SStream.c: Added.
(SStream_Init):
(SStream_concat0):
(SStream_concat):
(printInt64Bang):
(printUInt64Bang):
(printInt64):
(printInt32BangDec):
(printInt32Bang):
(printInt32):
(printUInt32Bang):
(printUInt32):
* capstone/Source/SStream.h: Added.
* capstone/Source/TODO: Added.
* capstone/Source/arch/ARM/ARMAddressingModes.h: Added.
(ARM_AM_getAddrOpcStr):
(ARM_AM_getShiftOpcStr):
(ARM_AM_getShiftOpcEncoding):
(ARM_AM_getAMSubModeStr):
(rotr32):
(rotl32):
(getSORegOpc):
(getSORegOffset):
(ARM_AM_getSORegShOp):
(getSOImmValImm):
(getSOImmValRot):
(getSOImmValRotate):
(getSOImmVal):
(isSOImmTwoPartVal):
(getSOImmTwoPartFirst):
(getSOImmTwoPartSecond):
(getThumbImmValShift):
(isThumbImmShiftedVal):
(getThumbImm16ValShift):
(isThumbImm16ShiftedVal):
(getThumbImmNonShiftedVal):
(getT2SOImmValSplatVal):
(getT2SOImmValRotateVal):
(getT2SOImmVal):
(getT2SOImmValRotate):
(isT2SOImmTwoPartVal):
(getT2SOImmTwoPartFirst):
(getT2SOImmTwoPartSecond):
(ARM_AM_getAM2Opc):
(getAM2Offset):
(getAM2Op):
(getAM2ShiftOpc):
(getAM2IdxMode):
(getAM3Opc):
(getAM3Offset):
(getAM3Op):
(getAM3IdxMode):
(getAM4SubMode):
(getAM4ModeImm):
(ARM_AM_getAM5Opc):
(ARM_AM_getAM5Offset):
(ARM_AM_getAM5Op):
(createNEONModImm):
(getNEONModImmOpCmode):
(getNEONModImmVal):
(ARM_AM_decodeNEONModImm):
(getFPImmFloat):
* capstone/Source/arch/ARM/ARMBaseInfo.h: Added.
(ARMCC_getOppositeCondition):
(ARMCC_ARMCondCodeToString):
(ARM_PROC_IFlagsToString):
(ARM_PROC_IModToString):
(ARM_MB_MemBOptToString):
(ARM_ISB_InstSyncBOptToString):
(isARMLowRegister):
(ARMII_AddrModeToString):
* capstone/Source/arch/ARM/ARMDisassembler.c: Added.
(ITStatus_push_back):
(ITStatus_instrInITBlock):
(ITStatus_instrLastInITBlock):
(ITStatus_getITCC):
(ITStatus_advanceITState):
(ITStatus_setITState):
(Check):
(ARM_getFeatureBits):
(DecodePredicateOperand):
(ARM_init):
(checkDecodedInstruction):
(_ARM_getInstruction):
(AddThumb1SBit):
(AddThumbPredicate):
(UpdateThumbVFPPredicate):
(_Thumb_getInstruction):
(Thumb_getInstruction):
(ARM_getInstruction):
(DecodeGPRnopcRegisterClass):
(DecodeGPRwithAPSRRegisterClass):
(DecodetGPRRegisterClass):
(DecodetcGPRRegisterClass):
(DecoderGPRRegisterClass):
(DecodeDPRRegisterClass):
(DecodeDPR_8RegisterClass):
(DecodeDPR_VFP2RegisterClass):
(DecodeDPairRegisterClass):
(DecodeCCOutOperand):
(DecodeSORegImmOperand):
(DecodeSORegRegOperand):
(DecodeRegListOperand):
(DecodeSPRRegListOperand):
(DecodeDPRRegListOperand):
(DecodeBitfieldMaskOperand):
(DecodeCopMemInstruction):
(DecodeAddrMode2IdxInstruction):
(DecodeSORegMemOperand):
(DecodeAddrMode3Instruction):
(DecodeRFEInstruction):
(DecodeQADDInstruction):
(DecodeMemMultipleWritebackInstruction):
(DecodeCPSInstruction):
(DecodeT2CPSInstruction):
(DecodeT2MOVTWInstruction):
(DecodeArmMOVTWInstruction):
(DecodeSMLAInstruction):
(DecodeAddrModeImm12Operand):
(DecodeAddrMode5Operand):
(DecodeAddrMode7Operand):
(DecodeT2BInstruction):
(DecodeBranchImmInstruction):
(DecodeAddrMode6Operand):
(DecodeVLDInstruction):
(DecodeVLDST1Instruction):
(DecodeVLDST2Instruction):
(DecodeVLDST3Instruction):
(DecodeVLDST4Instruction):
(DecodeVSTInstruction):
(DecodeVLD1DupInstruction):
(DecodeVLD2DupInstruction):
(DecodeVLD3DupInstruction):
(DecodeVLD4DupInstruction):
(DecodeNEONModImmInstruction):
(DecodeVSHLMaxInstruction):
(DecodeShiftRight8Imm):
(DecodeShiftRight16Imm):
(DecodeShiftRight32Imm):
(DecodeShiftRight64Imm):
(DecodeTBLInstruction):
(DecodeThumbAddSpecialReg):
(DecodeThumbBROperand):
(DecodeT2BROperand):
(DecodeThumbCmpBROperand):
(DecodeThumbAddrModeRR):
(DecodeThumbAddrModeIS):
(DecodeThumbAddrModePC):
(DecodeThumbAddrModeSP):
(DecodeT2AddrModeSOReg):
(DecodeT2LoadShift):
(DecodeT2LoadImm8):
(DecodeT2LoadImm12):
(DecodeT2LoadT):
(DecodeT2LoadLabel):
(DecodeT2Imm8S4):
(DecodeT2AddrModeImm8s4):
(DecodeT2AddrModeImm0_1020s4):
(DecodeT2Imm8):
(DecodeT2AddrModeImm8):
(DecodeT2LdStPre):
(DecodeT2AddrModeImm12):
(DecodeThumbAddSPImm):
(DecodeThumbAddSPReg):
(DecodeThumbCPS):
(DecodePostIdxReg):
(DecodeThumbBLXOffset):
(DecodeCoprocessor):
(DecodeThumbTableBranch):
(DecodeThumb2BCCInstruction):
(DecodeT2SOImm):
(DecodeThumbBCCTargetOperand):
(DecodeThumbBLTargetOperand):
(DecodeMemBarrierOption):
(DecodeInstSyncBarrierOption):
(DecodeMSRMask):
(DecodeBankedReg):
(DecodeDoubleRegLoad):
(DecodeDoubleRegStore):
(DecodeLDRPreImm):
(DecodeLDRPreReg):
(DecodeSTRPreImm):
(DecodeSTRPreReg):
(DecodeVLD1LN):
(DecodeVST1LN):
(DecodeVLD2LN):
(DecodeVST2LN):
(DecodeVLD3LN):
(DecodeVST3LN):
(DecodeVLD4LN):
(DecodeVST4LN):
(DecodeVMOVSRR):
(DecodeVMOVRRS):
(DecodeIT):
(DecodeT2LDRDPreInstruction):
(DecodeT2STRDPreInstruction):
(DecodeT2Adr):
(DecodeT2ShifterImmOperand):
(DecodeSwap):
(DecodeVCVTD):
(DecodeVCVTQ):
(DecodeLDR):
(DecodeMRRC2):
* capstone/Source/arch/ARM/ARMDisassembler.h: Added.
* capstone/Source/arch/ARM/ARMGenAsmWriter.inc: Added.
* capstone/Source/arch/ARM/ARMGenDisassemblerTables.inc: Added.
* capstone/Source/arch/ARM/ARMGenInstrInfo.inc: Added.
* capstone/Source/arch/ARM/ARMGenRegisterInfo.inc: Added.
* capstone/Source/arch/ARM/ARMGenSubtargetInfo.inc: Added.
* capstone/Source/arch/ARM/ARMInstPrinter.c: Added.
(get_op_access):
(set_mem_access):
(op_addImm):
(ARM_getRegName):
(translateShiftImm):
(printRegImmShift):
(printRegName):
(ARM_printInst):
(printOperand):
(printThumbLdrLabelOperand):
(printSORegRegOperand):
(printSORegImmOperand):
(printAM2PreOrOffsetIndexOp):
(printAddrModeTBB):
(printAddrModeTBH):
(printAddrMode2Operand):
(printAddrMode2OffsetOperand):
(printAM3PreOrOffsetIndexOp):
(printAddrMode3Operand):
(printAddrMode3OffsetOperand):
(printPostIdxImm8Operand):
(printPostIdxRegOperand):
(printPostIdxImm8s4Operand):
(printAddrMode5Operand):
(printAddrMode6Operand):
(printAddrMode7Operand):
(printAddrMode6OffsetOperand):
(printBitfieldInvMaskImmOperand):
(printMemBOption):
(printInstSyncBOption):
(printShiftImmOperand):
(printPKHLSLShiftImm):
(printPKHASRShiftImm):
(printRegisterList):
(printGPRPairOperand):
(printSetendOperand):
(printCPSIMod):
(printCPSIFlag):
(printMSRMaskOperand):
(printBankedRegOperand):
(printPredicateOperand):
(printMandatoryPredicateOperand):
(printSBitModifierOperand):
(printNoHashImmediate):
(printPImmediate):
(printCImmediate):
(printCoprocOptionImm):
(printAdrLabelOperand):
(printThumbS4ImmOperand):
(printThumbSRImm):
(printThumbITMask):
(printThumbAddrModeRROperand):
(printThumbAddrModeImm5SOperand):
(printThumbAddrModeImm5S1Operand):
(printThumbAddrModeImm5S2Operand):
(printThumbAddrModeImm5S4Operand):
(printThumbAddrModeSPOperand):
(printT2SOOperand):
(printAddrModeImm12Operand):
(printT2AddrModeImm8Operand):
(printT2AddrModeImm8s4Operand):
(printT2AddrModeImm0_1020s4Operand):
(printT2AddrModeImm8OffsetOperand):
(printT2AddrModeImm8s4OffsetOperand):
(printT2AddrModeSoRegOperand):
(printFPImmOperand):
(printNEONModImmOperand):
(printImmPlusOneOperand):
(printRotImmOperand):
(printModImmOperand):
(printFBits16):
(printFBits32):
(printVectorIndex):
(printVectorListOne):
(printVectorListTwo):
(printVectorListTwoSpaced):
(printVectorListThree):
(printVectorListFour):
(printVectorListOneAllLanes):
(printVectorListTwoAllLanes):
(printVectorListThreeAllLanes):
(printVectorListFourAllLanes):
(printVectorListTwoSpacedAllLanes):
(printVectorListThreeSpacedAllLanes):
(printVectorListFourSpacedAllLanes):
(printVectorListThreeSpaced):
(printVectorListFourSpaced):
(ARM_addVectorDataType):
(ARM_addVectorDataSize):
(ARM_addReg):
(ARM_addUserMode):
(ARM_addSysReg):
* capstone/Source/arch/ARM/ARMInstPrinter.h: Added.
* capstone/Source/arch/ARM/ARMMapping.c: Added.
(ARM_reg_name2):
(ARM_insn_name):
(ARM_rel_branch):
(ARM_blx_to_arm_mode):
(ARM_reg_access):
* capstone/Source/arch/ARM/ARMMapping.h: Added.
* capstone/Source/arch/ARM/ARMMappingInsn.inc: Added.
* capstone/Source/arch/ARM/ARMMappingInsnOp.inc: Added.
* capstone/Source/arch/ARM/ARMModule.c: Added.
(init):
(option):
(ARM_enable):
* capstone/Source/arch/Mips/MipsDisassembler.c: Added.
(getFeatureBits):
(Mips_init):
(readInstruction16):
(readInstruction32):
(MipsDisassembler_getInstruction):
(Mips_getInstruction):
(getReg):
(DecodeINSVE_DF_4):
(DecodeAddiGroupBranch_4):
(DecodeDaddiGroupBranch_4):
(DecodeBlezlGroupBranch_4):
(DecodeBgtzlGroupBranch_4):
(DecodeBgtzGroupBranch_4):
(DecodeBlezGroupBranch_4):
(DecodeCPU16RegsRegisterClass):
(DecodeGPR64RegisterClass):
(DecodeGPRMM16RegisterClass):
(DecodeGPRMM16ZeroRegisterClass):
(DecodeGPRMM16MovePRegisterClass):
(DecodeGPR32RegisterClass):
(DecodePtrRegisterClass):
(DecodeDSPRRegisterClass):
(DecodeFGR64RegisterClass):
(DecodeFGR32RegisterClass):
(DecodeCCRRegisterClass):
(DecodeFCCRegisterClass):
(DecodeCCRegisterClass):
(DecodeFGRCCRegisterClass):
(DecodeMem):
(DecodeCacheOp):
(DecodeCacheOpMM):
(DecodeCacheOpR6):
(DecodeSyncI):
(DecodeMSA128Mem):
(DecodeMemMMImm4):
(DecodeMemMMSPImm5Lsl2):
(DecodeMemMMGPImm7Lsl2):
(DecodeMemMMReglistImm4Lsl2):
(DecodeMemMMImm12):
(DecodeMemMMImm16):
(DecodeFMem):
(DecodeFMem2):
(DecodeFMem3):
(DecodeFMemCop2R6):
(DecodeSpecial3LlSc):
(DecodeHWRegsRegisterClass):
(DecodeAFGR64RegisterClass):
(DecodeACC64DSPRegisterClass):
(DecodeHI32DSPRegisterClass):
(DecodeLO32DSPRegisterClass):
(DecodeMSA128BRegisterClass):
(DecodeMSA128HRegisterClass):
(DecodeMSA128WRegisterClass):
(DecodeMSA128DRegisterClass):
(DecodeMSACtrlRegisterClass):
(DecodeCOP2RegisterClass):
(DecodeBranchTarget):
(DecodeJumpTarget):
(DecodeBranchTarget21):
(DecodeBranchTarget26):
(DecodeBranchTarget7MM):
(DecodeBranchTarget10MM):
(DecodeBranchTargetMM):
(DecodeJumpTargetMM):
(DecodeAddiur2Simm7):
(DecodeUImm6Lsl2):
(DecodeLiSimm7):
(DecodeSimm4):
(DecodeSimm16):
(DecodeLSAImm):
(DecodeInsSize):
(DecodeExtSize):
(DecodeSimm19Lsl2):
(DecodeSimm18Lsl3):
(DecodeSimm9SP):
(DecodeANDI16Imm):
(DecodeUImm5lsl2):
(DecodeRegListOperand):
(DecodeRegListOperand16):
(DecodeMovePRegPair):
(DecodeSimm23Lsl2):
* capstone/Source/arch/Mips/MipsDisassembler.h: Added.
* capstone/Source/arch/Mips/MipsGenAsmWriter.inc: Added.
* capstone/Source/arch/Mips/MipsGenDisassemblerTables.inc: Added.
* capstone/Source/arch/Mips/MipsGenInstrInfo.inc: Added.
* capstone/Source/arch/Mips/MipsGenRegisterInfo.inc: Added.
* capstone/Source/arch/Mips/MipsGenSubtargetInfo.inc: Added.
* capstone/Source/arch/Mips/MipsInstPrinter.c: Added.
(set_mem_access):
(isReg):
(MipsFCCToString):
(printRegName):
(Mips_printInst):
(printOperand):
(printUnsignedImm):
(printUnsignedImm8):
(printMemOperand):
(printMemOperandEA):
(printFCCOperand):
(printRegisterPair):
(printAlias1):
(printAlias2):
(printAlias):
(printRegisterList):
* capstone/Source/arch/Mips/MipsInstPrinter.h: Added.
* capstone/Source/arch/Mips/MipsMapping.c: Added.
(Mips_get_insn_id):
(Mips_group_name):
(Mips_map_insn):
(Mips_map_register):
* capstone/Source/arch/Mips/MipsMapping.h: Added.
* capstone/Source/arch/Mips/MipsMappingInsn.inc: Added.
* capstone/Source/arch/Mips/MipsModule.c: Added.
(init):
(option):
(Mips_enable):
* capstone/Source/capstone.pc.in: Added.
* capstone/Source/config.mk: Added.
* capstone/Source/cs.c: Added.
(cs_kern_os_calloc):
(cs_version):
(cs_support):
(cs_errno):
(cs_strerror):
(cs_open):
(cs_close):
(fill_insn):
(skipdata_size):
(cs_option):
(skipdata_opstr):
(cs_disasm):
(cs_disasm_ex):
(cs_free):
(cs_malloc):
(cs_disasm_iter):
(cs_reg_name):
(cs_insn_name):
(cs_group_name):
(cs_insn_group):
(cs_reg_read):
(cs_reg_write):
(cs_op_count):
(cs_op_index):
(cs_regs_access):
* capstone/Source/cs_priv.h: Added.
* capstone/Source/functions.mk: Added.
* capstone/Source/include/capstone/arm.h: Added.
* capstone/Source/include/capstone/arm64.h: Added.
* capstone/Source/include/capstone/capstone.h: Added.
* capstone/Source/include/capstone/evm.h: Added.
* capstone/Source/include/capstone/m680x.h: Added.
* capstone/Source/include/capstone/m68k.h: Added.
* capstone/Source/include/capstone/mips.h: Added.
* capstone/Source/include/capstone/platform.h: Added.
* capstone/Source/include/capstone/ppc.h: Added.
* capstone/Source/include/capstone/sparc.h: Added.
* capstone/Source/include/capstone/systemz.h: Added.
* capstone/Source/include/capstone/tms320c64x.h: Added.
* capstone/Source/include/capstone/x86.h: Added.
* capstone/Source/include/capstone/xcore.h: Added.
* capstone/Source/include/windowsce/intrin.h: Added.
* capstone/Source/include/windowsce/stdint.h: Added.
* capstone/Source/make.sh: Added.
* capstone/Source/nmake-x86.bat: Added.
* capstone/Source/nmake.bat: Added.
* capstone/Source/pkgconfig.mk: Added.
* capstone/Source/utils.c: Added.
(make_id2insn):
(insn_find):
(name2id):
(id2name):
(count_positive):
(count_positive8):
(cs_strdup):
(cs_snprintf):
(arr_exist8):
(arr_exist):
* capstone/Source/utils.h: Added.
* capstone/capstone-Revision.txt: Added.

Source/WTF:

Add USE_CAPSTONE used for MIPS and ARM.

* wtf/Platform.h:

Tools:

* gtk/manifest.txt.in:
* wpe/manifest.txt.in:

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

2 years ago[MIPS] Use mfhc1 and mthc1 to fix assembler error
commit-queue@webkit.org [Wed, 9 May 2018 08:53:16 +0000 (08:53 +0000)]
[MIPS] Use mfhc1 and mthc1 to fix assembler error
https://bugs.webkit.org/show_bug.cgi?id=185464

Patch by Dominik Infuehr <dinfuehr@igalia.com> on 2018-05-09
Reviewed by Yusuke Suzuki.

The binutils-assembler started to report failures for copying words between
GP and FP registers for odd FP register indices. Use mfhc1 and mthc1 instead
of mfc1 and mtc1 for conversion.

* offlineasm/mips.rb:

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

2 years ago[EME][GStreamer] Crash when the mediaKeys are created before loading the media in...
commit-queue@webkit.org [Wed, 9 May 2018 07:38:45 +0000 (07:38 +0000)]
[EME][GStreamer] Crash when the mediaKeys are created before loading the media in debug conf
https://bugs.webkit.org/show_bug.cgi?id=185244

Patch by Yacine Bandou <yacine.bandou_ext@softathome.com> on 2018-05-09
Reviewed by Xabier Rodriguez-Calvar.

The function "MediaPlayerPrivateGStreamerBase::cdmInstanceAttached" is expected to be called once,
so there is an ASSERT(!m_cdmInstance).
But when the MediaKeys are created before loading the media, the cdminstance is created and attached
to the MediaPlayerPrivate via "MediaPlayerPrivateGStreamerBase::cdmInstanceAttached" before loading
the media, then when the media is loading, the function "MediaPlayerPrivateGStreamerBase::cdmInstanceAttached"
will be called several times via the function "mediaEngineWasUpdated" wich is called for each change
in the MediaElement state, thus the WebProcess crashes in the ASSERT(!m_cdmInstance).

This commit avoid the crash by replacing the assert with a simple check.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceAttached):
(WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceDetached):

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

2 years ago[ARM] Disable test on Linux due to lack of executable memory
commit-queue@webkit.org [Wed, 9 May 2018 07:38:23 +0000 (07:38 +0000)]
[ARM] Disable test on Linux due to lack of executable memory
https://bugs.webkit.org/show_bug.cgi?id=185466

Patch by Dominik Infuehr <dinfuehr@igalia.com> on 2018-05-09
Reviewed by Yusuke Suzuki.

Do not run tests with LLInt disabled, otherwise test runs out of executable memory.

* js/script-tests/dfg-uint32array-overflow-values.js:
* js/script-tests/dfg-uint8clampedarray.js:

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

2 years agoUpdate fast/events/constructors/(mouse|wheel)-event-constructor.html and expectations.
Ms2ger@igalia.com [Wed, 9 May 2018 07:35:20 +0000 (07:35 +0000)]
Update fast/events/constructors/(mouse|wheel)-event-constructor.html and expectations.
https://bugs.webkit.org/show_bug.cgi?id=115025

Reviewed by Michael Catanzaro.

clientX/Y values are clamped to a signed 26 bit-integer by using LayoutPoint.
I updated the test to expect that. (Alternatively, we could keep the
current expectations in the test and leave FAIL lines in the test
expectation file.)

Expectation files are updated or removed to match the test change, as
well as a number of code changes since the last time they were accurate.

* fast/events/constructors/mouse-event-constructor-expected.txt:
* fast/events/constructors/mouse-event-constructor.html:
* fast/events/constructors/wheel-event-constructor-expected.txt:
* fast/events/constructors/wheel-event-constructor.html:
* platform/gtk/TestExpectations:
* platform/gtk/fast/events/constructors/mouse-event-constructor-expected.txt: Removed.
* platform/gtk/fast/events/constructors/wheel-event-constructor-expected.txt: Removed.
* platform/mac/fast/events/constructors/mouse-event-constructor-expected.txt: Removed.
* platform/mac/fast/events/constructors/wheel-event-constructor-expected.txt: Removed.
* platform/wpe/TestExpectations:

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

2 years agoAdd OptionSet::operator& and operator bool
antti@apple.com [Wed, 9 May 2018 07:05:46 +0000 (07:05 +0000)]
Add OptionSet::operator& and operator bool
https://bugs.webkit.org/show_bug.cgi?id=185306

Reviewed by Anders Carlsson.

Source/WebCore:

Use it in a few places.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::reload):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::logReasonsForCompositing):
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):

Source/WTF:

This is primarily to allow writing

    if (options & Option:A)

instead of

    if (options.contains(Option:A))

This is consistent with other OptionSet operators.

* wtf/OptionSet.h:
(WTF::OptionSet::operator bool):
(WTF::OptionSet::operator&):

Also remove T versions of operator| and operator-, they are not needed due to
implicit conversion from T to OptionSet<T>.

Tools:

* TestWebKitAPI/Tests/WTF/OptionSet.cpp:
(TestWebKitAPI::TEST):

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

2 years ago[MIPS] Collect callee-saved register using inline assembly
commit-queue@webkit.org [Wed, 9 May 2018 06:29:05 +0000 (06:29 +0000)]
[MIPS] Collect callee-saved register using inline assembly
https://bugs.webkit.org/show_bug.cgi?id=185428

Patch by Dominik Infuehr <dinfuehr@igalia.com> on 2018-05-08
Reviewed by Yusuke Suzuki.

MIPS used setjmp instead of collecting registers with inline assembly like
other architectures.

* heap/RegisterState.h:

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

2 years ago[BigInt] Simplifying JSBigInt by using bool addition
utatane.tea@gmail.com [Wed, 9 May 2018 06:01:19 +0000 (06:01 +0000)]
[BigInt] Simplifying JSBigInt by using bool addition
https://bugs.webkit.org/show_bug.cgi?id=185374

Reviewed by Alex Christensen.

Since using TWO_DIGIT does not produce good code, we remove this part from digitAdd and digitSub.
Just adding overflow flag to carry/borrow produces setb + add in x86.

Also we annotate small helper functions and accessors with `inline` not to call these functions
inside internalMultiplyAdd loop.

* runtime/JSBigInt.cpp:
(JSC::JSBigInt::isZero):
(JSC::JSBigInt::inplaceMultiplyAdd):
(JSC::JSBigInt::digitAdd):
(JSC::JSBigInt::digitSub):
(JSC::JSBigInt::digitMul):
(JSC::JSBigInt::digitPow):
(JSC::JSBigInt::digitDiv):
(JSC::JSBigInt::offsetOfData):
(JSC::JSBigInt::dataStorage):
(JSC::JSBigInt::digit):
(JSC::JSBigInt::setDigit):

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

2 years agoDisable system preview link fetching
dino@apple.com [Wed, 9 May 2018 04:32:00 +0000 (04:32 +0000)]
Disable system preview link fetching
https://bugs.webkit.org/show_bug.cgi?id=185463

Reviewed by Jon Lee.

Temporarily disable system preview detection when a link
is clicked.

* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::handleClick):

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

2 years agoUnreviewed, fix the internal iOS build
wenson_hsieh@apple.com [Wed, 9 May 2018 04:14:48 +0000 (04:14 +0000)]
Unreviewed, fix the internal iOS build

Add a missing import statement in an implementation file.

* editing/cocoa/WebContentReaderCocoa.mm:

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

2 years agoAdopt new async _savecookies SPI for keeping networking process active during flushin...
commit-queue@webkit.org [Wed, 9 May 2018 01:48:44 +0000 (01:48 +0000)]
Adopt new async _savecookies SPI for keeping networking process active during flushing cookies
https://bugs.webkit.org/show_bug.cgi?id=185261
<rdar://problem/37214391>

Patch by Sihui Liu <sihui_liu@apple.com> on 2018-05-08
Reviewed by Chris Dumez.

Source/WebCore/PAL:

* pal/spi/cf/CFNetworkSPI.h:

Source/WebKit:

By adopting new async SPI _savecookies, we can keep networking process active(not suspended)
until cookies are fully synced to disk with process assertion.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::didSyncAllCookies):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::syncAllCookies):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::didClose):
(WebKit::NetworkProcessProxy::syncAllCookies):
(WebKit::NetworkProcessProxy::didSyncAllCookies):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::syncNetworkProcessCookies):

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

2 years agoSet colorspace in the PDF plugin.
pvollan@apple.com [Wed, 9 May 2018 01:34:56 +0000 (01:34 +0000)]
Set colorspace in the PDF plugin.
https://bugs.webkit.org/show_bug.cgi?id=185445
<rdar://problem/40030981>

Reviewed by Simon Fraser.

* WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::PDFPlugin):

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

2 years agoReplace multiple Watchpoint Set fireAll() methods with templates
msaboff@apple.com [Wed, 9 May 2018 01:11:40 +0000 (01:11 +0000)]
Replace multiple Watchpoint Set fireAll() methods with templates
https://bugs.webkit.org/show_bug.cgi?id=185456

Reviewed by Saam Barati.

Refactored to minimize duplicate code.

* bytecode/Watchpoint.h:
(JSC::WatchpointSet::fireAll):
(JSC::InlineWatchpointSet::fireAll):

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

2 years agoDon't clear selection until we are actually interacting with a Node.
megan_gardner@apple.com [Wed, 9 May 2018 00:41:51 +0000 (00:41 +0000)]
Don't clear selection until we are actually interacting with a Node.
https://bugs.webkit.org/show_bug.cgi?id=185455

Reviewed by Wenson Hsieh.

The presence of TextInteractionAssistant should not be used as a proxy for it we are actually editing content.
We need to check to see if we have an active node, and then we should clear the selection.

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

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

2 years agoUnreviewed, rolling out r231486.
ryanhaddad@apple.com [Wed, 9 May 2018 00:40:29 +0000 (00:40 +0000)]
Unreviewed, rolling out r231486.

Caused service worker LayoutTest failures on macOS Debug WK2.

Reverted changeset:

"Allow WebResourceLoader to cancel a load served from a
service worker"
https://bugs.webkit.org/show_bug.cgi?id=185274
https://trac.webkit.org/changeset/231486

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

2 years agoConsolidate WebContentReaderIOS and WebContentReaderMac into WebContentReaderCocoa
wenson_hsieh@apple.com [Wed, 9 May 2018 00:37:55 +0000 (00:37 +0000)]
Consolidate WebContentReaderIOS and WebContentReaderMac into WebContentReaderCocoa
https://bugs.webkit.org/show_bug.cgi?id=185340

Reviewed by Tim Horton.

Source/WebCore:

WebContentReader::readURL is currently the only method implemented separately in iOS and macOS platform
WebContentReader files. The implementation across macOS and iOS is nearly identical (with some exceptions with
the way iOS handles file URLs and plain text editing), so we can merge these into a single method
WebContentReaderCocoa and delete WebContentReaderIOS and WebContentReaderMac.

This also has the added bonus of fixing a latent bug in WebContentReaderMac, wherein URLs written to the
pasteboard using -[NSPasteboard writeObjects:] are currently pasted as empty anchor elements. In this case, the
link title isn't made explicit, so the `title` passed in to WebContentReader::readURL is empty. On iOS, we have
code to fall back to pasting the absolute string of the URL if the title is empty, but on macOS, we'll just use
this empty string as the title of the anchor.

Test: PasteMixedContent.PasteURLWrittenToPasteboardUsingWriteObjects

* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::WebContentReader::readURL):
* editing/ios/WebContentReaderIOS.mm: Removed.
* editing/mac/WebContentReaderMac.mm: Removed.

Tools:

Adds a new API test to verify that URLs written using -[NSPasteboard writeObjects:] are pasted as anchors with
non-empty text in a contenteditable.

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

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

2 years ago[iOS] _WKWebViewPrintFormatter should return a page count of 0 for PDF documents...
aestes@apple.com [Wed, 9 May 2018 00:31:04 +0000 (00:31 +0000)]
[iOS] _WKWebViewPrintFormatter should return a page count of 0 for PDF documents that do not allow printing
https://bugs.webkit.org/show_bug.cgi?id=185133

Reviewed by Andreas Kling.

* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView _ensureDocumentForPrinting]):
(-[WKPDFView _wk_pageCountForPrintFormatter:]):
(-[WKPDFView _wk_printedDocument]):

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

2 years ago[Simple line layout] Cache run resolver.
zalan@apple.com [Wed, 9 May 2018 00:20:18 +0000 (00:20 +0000)]
[Simple line layout] Cache run resolver.
https://bugs.webkit.org/show_bug.cgi?id=185411

Reviewed by Antti Koivisto.

This patch caches the run resolver on the [SimpleLine]Layout object.
In certain cases, when the block container has thousands of elements (foobar1<br>foobar2<br>.....foobar9999<br>),
constructing the resolver (and its dependencies) in a repeating fashion could hang the WebProcess.

Covered by existing tests.

* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::create):
(WebCore::SimpleLineLayout::Layout::create):
(WebCore::SimpleLineLayout::Layout::Layout):
* rendering/SimpleLineLayout.h:
(WebCore::SimpleLineLayout::Layout::runResolver const):
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::paintFlow):
(WebCore::SimpleLineLayout::hitTestFlow):
(WebCore::SimpleLineLayout::collectFlowOverflow):
(WebCore::SimpleLineLayout::computeBoundingBox):
(WebCore::SimpleLineLayout::computeFirstRunLocation):
(WebCore::SimpleLineLayout::collectAbsoluteRects):
(WebCore::SimpleLineLayout::collectAbsoluteQuads):
(WebCore::SimpleLineLayout::textOffsetForPoint):
(WebCore::SimpleLineLayout::collectAbsoluteQuadsForRange):
(WebCore::SimpleLineLayout::generateLineBoxTree):
* rendering/SimpleLineLayoutResolver.cpp:
(WebCore::SimpleLineLayout::LineResolver::LineResolver):
* rendering/SimpleLineLayoutResolver.h:
(WebCore::SimpleLineLayout::lineResolver):

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

2 years ago[iOS] WKPDFView remains in the view hierarchy after navigating away
aestes@apple.com [Wed, 9 May 2018 00:13:40 +0000 (00:13 +0000)]
[iOS] WKPDFView remains in the view hierarchy after navigating away
https://bugs.webkit.org/show_bug.cgi?id=185449
<rdar://problem/39693469>

Reviewed by Tim Horton.

WKPDFView removes the PDF host view from the view hierarchy in its -dealloc
method, and relies on WKWebView releasing its last reference in
-_setHasCustomContentView:loadedMIMEType: when the user navigates.

However, WKWPDFView was capturing a strong reference to self in the block passed
to +[PDFHostViewController createHostView:forExtensionIdentifier:], and PDFKit
(actually UIKit) is retaining this block beyond its being called. This results in
the PDF host view remaining as a child of the WKScrollView even after the user
navigates to another page.

Changed the aforementioned block to a lambda that captures a weak reference to
self to prevent WKPDFView from outliving the current navigation.

* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView retain]):
(-[WKPDFView web_setContentProviderData:suggestedFilename:]):

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

2 years agoWeb Inspector: Console drawer resizing is broken when console prompt has >1 line...
mattbaker@apple.com [Wed, 9 May 2018 00:09:41 +0000 (00:09 +0000)]
Web Inspector: Console drawer resizing is broken when console prompt has >1 line of code
https://bugs.webkit.org/show_bug.cgi?id=185369
<rdar://problem/40013202>

Reviewed by Devin Rousso.

Mouse offset calculation should account for the height of the quick console.
The only reason resizing worked with the single-line quick console is that
the offset calculation included the resizer height, which is very close
to that of the single-line quick console (27px and 30px respectively).

* UserInterface/Views/ConsoleDrawer.js:

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

2 years agotest262/Runner.pm: create results dir for results of test262 run
commit-queue@webkit.org [Wed, 9 May 2018 00:04:10 +0000 (00:04 +0000)]
test262/Runner.pm: create results dir for results of test262 run
https://bugs.webkit.org/show_bug.cgi?id=185392

Patch by Valerie R Young <valerie@bocoup.com> on 2018-05-08
Reviewed by Michael Saboff.

.:

Remove reference to no longer existing files.

* .gitignore:

Tools:

New directory test262-results created from where ever script is
called.

* Scripts/test262/Runner.pm:
(processCLI):

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

2 years agotest262/Runner.pm: lower number of processes per core
commit-queue@webkit.org [Wed, 9 May 2018 00:00:13 +0000 (00:00 +0000)]
test262/Runner.pm: lower number of processes per core
https://bugs.webkit.org/show_bug.cgi?id=185426

Patch by Valerie R Young <valerie@bocoup.com> on 2018-05-08
Reviewed by Michael Saboff.

* Scripts/test262/Runner.pm:
(getProcesses):

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

2 years agoStorage Access API: Make user opt-in sticky
wilander@apple.com [Tue, 8 May 2018 23:59:29 +0000 (23:59 +0000)]
Storage Access API: Make user opt-in sticky
https://bugs.webkit.org/show_bug.cgi?id=185454
<rdar://problem/40003946>

Reviewed by Alex Christensen.

This patch persists the user's choice to opt-in to access under specific domains.
Such storage access should age out with the accessing domain's cookies and website
data. The opt-in prompt is still an experimental feature.

* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
(WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
(WebKit::WebResourceLoadStatisticsStore::grantStorageAccessInternal):
(WebKit::WebResourceLoadStatisticsStore::hasUserGrantedStorageAccessThroughPrompt const):
(WebKit::WebResourceLoadStatisticsStore::hasHadUnexpiredRecentUserInteraction const):
* UIProcess/WebResourceLoadStatisticsStore.h:

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

2 years agoTest262-Runner: Add base Perl UnicodeData
commit-queue@webkit.org [Tue, 8 May 2018 23:33:13 +0000 (23:33 +0000)]
Test262-Runner: Add base Perl UnicodeData
https://bugs.webkit.org/show_bug.cgi?id=185444

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

* Scripts/test262/local/lib/perl5/unicore/lib/gc_sc/SpacePer.pl: Added.
* Scripts/test262/local/lib/perl5/unicore/lib/gc_sc/Word.pl: Added.

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

2 years agoDFG::FlowMap::resize() shouldn't resize the shadow map unless we're in SSA
fpizlo@apple.com [Tue, 8 May 2018 23:30:31 +0000 (23:30 +0000)]
DFG::FlowMap::resize() shouldn't resize the shadow map unless we're in SSA
https://bugs.webkit.org/show_bug.cgi?id=185453

Reviewed by Michael Saboff.

Tiny improvement for compile times.

* dfg/DFGFlowMap.h:
(JSC::DFG::FlowMap::resize): Remove one Vector::resize() when we're not in SSA.
* dfg/DFGInPlaceAbstractState.cpp:
(JSC::DFG::InPlaceAbstractState::beginBasicBlock): Record some data about how long we spend in different parts of this and add a FIXME linking bug 185452.

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

2 years agoDo not apply X-Frame-Options and CSP frame-ancestors to Quick Look-applicable respons...
dbates@webkit.org [Tue, 8 May 2018 23:28:05 +0000 (23:28 +0000)]
Do not apply X-Frame-Options and CSP frame-ancestors to Quick Look-applicable responses in NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=185442
<rdar://problem/40067209>

Reviewed by Andy Estes.

Source/WebKit:

Just as we exempt responses in WebContent process that will be handled by Quick Look from the Content
Security Policy frame-ancestors directive and X-Frame-Options checking we need to do the same when
such checks are performed in NetworkProcess following r231479.

HTTP responses that will be previewed using Quick Look are not considered web pages and are subject
to the security model for Quick Look documents. That is, they are exempt from Content Security Policy
and X-Frame-Options processing.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::shouldInterruptLoadForCSPFrameAncestorsOrXFrameOptions):

LayoutTests:

Remove test http/tests/quicklook/csp-header-ignored.html from TestExpectations now that it passes.

* platform/ios/TestExpectations:

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

2 years agoSwitch some RELEASE_ASSERTS to plain debug ASSERTS in PlatformScreenMac.mm
bfulgham@apple.com [Tue, 8 May 2018 23:26:39 +0000 (23:26 +0000)]
Switch some RELEASE_ASSERTS to plain debug ASSERTS in PlatformScreenMac.mm
https://bugs.webkit.org/show_bug.cgi?id=185451
<rdar://problem/39620348>

Reviewed by Zalan Bujtas.

Change a set of RELEASE_ASSERTS used to prevent accessing NSScreen related functions in the
PlatformScreenMac implementation to less expensive Debug ASSERTS.

No change in behavior.

* platform/mac/PlatformScreenMac.mm:
(WebCore::screenHasInvertedColors):
(WebCore::screenDepth):
(WebCore::screenDepthPerComponent):
(WebCore::screenRectForDisplay):
(WebCore::screenRect):
(WebCore::screenAvailableRect):
(WebCore::screenColorSpace):
(WebCore::screenSupportsExtendedColor):

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

2 years agoAdd tests to ensure that the Strong Password appearance is removed on form reset
dbates@webkit.org [Tue, 8 May 2018 23:22:06 +0000 (23:22 +0000)]
Add tests to ensure that the Strong Password appearance is removed on form reset
https://bugs.webkit.org/show_bug.cgi?id=185440

Reviewed by Ryosuke Niwa.

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/DidResignInputElementStrongPasswordAppearance.mm:
(-[DidResignInputElementStrongPasswordAppearance webProcessPlugIn:didCreateBrowserContextController:]):
* TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm:
(TEST):

LayoutTests:

* fast/forms/auto-fill-button/hide-auto-fill-strong-password-button-when-form-is-reset-expected.html: Added.
* fast/forms/auto-fill-button/hide-auto-fill-strong-password-button-when-form-is-reset.html: Added.

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

2 years agoDeferred firing of structure transition watchpoints is racy
msaboff@apple.com [Tue, 8 May 2018 23:20:33 +0000 (23:20 +0000)]
Deferred firing of structure transition watchpoints is racy
https://bugs.webkit.org/show_bug.cgi?id=185438

Reviewed by Saam Barati.

Changed DeferredStructureTransitionWatchpointFire to take the watchpoints to fire
and fire them in the destructor.  When the watchpoints are taken from the
original WatchpointSet, that WatchpointSet if marked invalid.

* bytecode/Watchpoint.cpp:
(JSC::WatchpointSet::fireAllSlow):
(JSC::WatchpointSet::take):
(JSC::DeferredWatchpointFire::DeferredWatchpointFire):
(JSC::DeferredWatchpointFire::~DeferredWatchpointFire):
(JSC::DeferredWatchpointFire::fireAll):
(JSC::DeferredWatchpointFire::takeWatchpointsToFire):
* bytecode/Watchpoint.h:
(JSC::WatchpointSet::fireAll):
(JSC::InlineWatchpointSet::fireAll):
* runtime/JSObject.cpp:
(JSC::JSObject::setPrototypeDirect):
(JSC::JSObject::convertToDictionary):
* runtime/JSObjectInlines.h:
(JSC::JSObject::putDirectInternal):
* runtime/Structure.cpp:
(JSC::Structure::Structure):
(JSC::DeferredStructureTransitionWatchpointFire::DeferredStructureTransitionWatchpointFire):
(JSC::DeferredStructureTransitionWatchpointFire::~DeferredStructureTransitionWatchpointFire):
(JSC::DeferredStructureTransitionWatchpointFire::dump const):
(JSC::Structure::didTransitionFromThisStructure const):
(JSC::DeferredStructureTransitionWatchpointFire::add): Deleted.
* runtime/Structure.h:
(JSC::DeferredStructureTransitionWatchpointFire::structure const):

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

2 years agoResign Strong Password appearance when text field value changes
dbates@webkit.org [Tue, 8 May 2018 23:16:33 +0000 (23:16 +0000)]
Resign Strong Password appearance when text field value changes
https://bugs.webkit.org/show_bug.cgi?id=185433
<rdar://problem/39958508>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Remove the Strong Password decoration when the text field's value changes to avoid interfering
with web sites that allow a person to clear the password field.

Tests: fast/forms/auto-fill-button/auto-fill-strong-password-button-when-maxlength-changes.html
       fast/forms/auto-fill-button/auto-fill-strong-password-button-when-minlength-changes.html
       fast/forms/auto-fill-button/hide-auto-fill-strong-password-button-when-value-changes.html

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::resignStrongPasswordAppearance): Extracted from HTMLInputElement::updateType().
(WebCore::HTMLInputElement::updateType): Extract out logic to resign the Strong Password appearance
into a function that can be shared by this function and HTMLInputElement::setValue().
(WebCore::HTMLInputElement::setValue): Resign the Strong Password appearance if this field was
changed programmatically (i.e. no DOM change event was dispatched).
* html/HTMLInputElement.h:

Tools:

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

* TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm:
(testDidResignInputElementStrongPasswordAppearanceAfterEvaluatingJavaScript):
(TEST):

LayoutTests:

Add a test to ensure we remove the Strong Password appearance when the value of the text field value changes.

* fast/forms/auto-fill-button/auto-fill-strong-password-button-when-maxlength-changes-expected.html: Added.
* fast/forms/auto-fill-button/auto-fill-strong-password-button-when-maxlength-changes.html: Added.
* fast/forms/auto-fill-button/auto-fill-strong-password-button-when-minlength-changes-expected.html: Added.
* fast/forms/auto-fill-button/auto-fill-strong-password-button-when-minlength-changes.html: Added.
* fast/forms/auto-fill-button/hide-auto-fill-strong-password-button-when-value-changes-expected.html: Added.
* fast/forms/auto-fill-button/hide-auto-fill-strong-password-button-when-value-changes.html: Added.
* fast/forms/auto-fill-button/resources/process-auto-fill-button-type-and-invoke-runTest.js: Add support for
setting the autofilled state of a field.
(window.onload):

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

2 years agoUnreviewed build fix; add missing function definition.
jer.noble@apple.com [Tue, 8 May 2018 23:12:09 +0000 (23:12 +0000)]
Unreviewed build fix; add missing function definition.

* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::didPassCORSAccessCheck const):

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

2 years agoConsecutive messages logged as JSON are coalesced
eric.carlson@apple.com [Tue, 8 May 2018 21:53:01 +0000 (21:53 +0000)]
Consecutive messages logged as JSON are coalesced
https://bugs.webkit.org/show_bug.cgi?id=185432

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/ConsoleMessage.cpp:
(Inspector::ConsoleMessage::isEqual const): Messages with JSON arguments are not equal.

LayoutTests:

* inspector/console/webcore-logging-expected.txt:
* inspector/console/webcore-logging.html:

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

2 years agoInPlaceAbstractState::beginBasicBlock shouldn't have to clear any abstract values
fpizlo@apple.com [Tue, 8 May 2018 21:49:09 +0000 (21:49 +0000)]
InPlaceAbstractState::beginBasicBlock shouldn't have to clear any abstract values
https://bugs.webkit.org/show_bug.cgi?id=185365

Reviewed by Saam Barati.

Source/JavaScriptCore:

This patch does three things to improve compile times:

- Fixes some inlining goofs.

- Adds the ability to measure compile times with run-jsc-benchmarks.

- Dramatically improves the performance of InPlaceAbstractState::beginBasicBlock by removing the
  code that clears abstract values. It turns out that on constant folding "needed" this, in the
  sense that this was the only thing protecting it from loading the abstract value of a no-result
  node and then concluding that because it had a non-empty m_value, it could be constant-folded.
  Any node that produces a result will explicitly set its abstract value, so this problem can
  also be guarded by just having constant folding check if the node it wants to fold returns any
  result.

Solid 0.96% compile time speed-up across SunSpider-CompileTime and V8Spider-CompileTime.

Rolling back in after fixing cloop build.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGAbstractValue.cpp:
(JSC::DFG::AbstractValue::set):
* dfg/DFGAbstractValue.h:
(JSC::DFG::AbstractValue::merge):
* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::foldConstants):
* dfg/DFGGraph.h:
(JSC::DFG::Graph::doToChildrenWithNode):
(JSC::DFG::Graph::doToChildren):
* dfg/DFGInPlaceAbstractState.cpp:
(JSC::DFG::InPlaceAbstractState::beginBasicBlock):
* jit/JIT.cpp:
(JSC::JIT::totalCompileTime):
* jit/JIT.h:
* jsc.cpp:
(GlobalObject::finishCreation):
(functionTotalCompileTime):

Source/WTF:

Fix some inlining goof-ups.

Rolling back in after fixing cloop build.

* wtf/TinyPtrSet.h:
(WTF::TinyPtrSet::add):
(WTF::TinyPtrSet::merge):
(WTF::TinyPtrSet::addOutOfLine):
(WTF::TinyPtrSet::mergeOtherOutOfLine):

Tools:

Make it possible to measure compile times.

Rolling back in after fixing cloop builds.

* Scripts/run-jsc-benchmarks:

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

2 years agoMute MediaElementSourceNode when tainted.
jer.noble@apple.com [Tue, 8 May 2018 21:32:03 +0000 (21:32 +0000)]
Mute MediaElementSourceNode when tainted.
https://bugs.webkit.org/show_bug.cgi?id=184866

Reviewed by Eric Carlson.

Source/WebCore:

Test: http/tests/security/webaudio-render-remote-audio-blocked-no-crossorigin.html

* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::wouldTaintOrigin const):
* Modules/webaudio/AudioContext.h:
* Modules/webaudio/MediaElementAudioSourceNode.cpp:
(WebCore::MediaElementAudioSourceNode::setFormat):
(WebCore::MediaElementAudioSourceNode::wouldTaintOrigin):
(WebCore::MediaElementAudioSourceNode::process):
* Modules/webaudio/MediaElementAudioSourceNode.h:

LayoutTests:

* http/tests/media/resources/1000Hz-sin.wav: Added.
* http/tests/security/webaudio-render-remote-audio-allowed-crossorigin-expected.txt: Added.
* http/tests/security/webaudio-render-remote-audio-allowed-crossorigin.html: Added.
* http/tests/security/webaudio-render-remote-audio-blocked-no-crossorigin-expected.txt: Added.
* http/tests/security/webaudio-render-remote-audio-blocked-no-crossorigin.html: Added.

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

2 years agoLog rtcstats as JSON
eric.carlson@apple.com [Tue, 8 May 2018 21:22:30 +0000 (21:22 +0000)]
Log rtcstats as JSON
https://bugs.webkit.org/show_bug.cgi?id=185437
<rdar://problem/40065332>

Reviewed by Youenn Fablet.

* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::RTCStatsLogger::RTCStatsLogger): Create a wrapper class so we don't have to add a
toJSONString method to libwebrtc.
(WebCore::RTCStatsLogger::toJSONString const): Log stats as JSON.
(WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered): Don't use the LOGIDENTIFIER macro because
it doesn't work well inside of a lambda.
(WTF::LogArgument<WebCore::RTCStatsLogger>::toString): Move into .cpp file because it is only
used here.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
(WTF::LogArgument<webrtc::RTCStats>::toString): Deleted. Move to .cpp file.

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

2 years agoREGRESSION(r230743): Mousemove events are not coalesced properly, mousemove/drag...
bburg@apple.com [Tue, 8 May 2018 21:19:36 +0000 (21:19 +0000)]
REGRESSION(r230743): Mousemove events are not coalesced properly, mousemove/drag is very laggy
https://bugs.webkit.org/show_bug.cgi?id=185425
<rdar://problem/39323336>

Reviewed by Simon Fraser.

When mousemove events come in faster than they can be processed, we should coalesce
pending mousemoves that have not yet been sent to WebProcess. This has the effect of
processing the most recent mousemove location, which is the old behavior that regressed.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::handleMouseEvent):
If there is >1 event in the mouse queue, then the first one is being processed by WebProcess
and the second one is eligible for coalescing. Replace it if the last event and new event
are both mousemoves.

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

2 years agoThe PDF context menu should not be created in the WebContent process.
pvollan@apple.com [Tue, 8 May 2018 20:34:05 +0000 (20:34 +0000)]
The PDF context menu should not be created in the WebContent process.
https://bugs.webkit.org/show_bug.cgi?id=185401

Reviewed by Tim Horton.

Send a sync IPC message from the WebContent process to the UI process with the necessary context
menu information when the menu is requested. The NSMenu will then be created and shown in the
UI process. The reply will contain the selected menu item index.

* Shared/mac/PDFContextMenu.h: Added.
(WebKit::PDFContextMenuItem::encode const):
(WebKit::PDFContextMenuItem::decode):
(WebKit::PDFContextMenu::encode const):
(WebKit::PDFContextMenu::decode):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/mac/WebPageProxyMac.mm:
(-[WKPDFMenuTarget menuItem]):
(-[WKPDFMenuTarget contextMenuAction:]):
(WebKit::WebPageProxy::showPDFContextMenu):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::handleContextMenuEvent):

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

2 years agoSkip test http/tests/appcache/x-frame-options-prevents-framing.php for now in WebKit2.
dbates@webkit.org [Tue, 8 May 2018 20:29:13 +0000 (20:29 +0000)]
Skip test http/tests/appcache/x-frame-options-prevents-framing.php for now in WebKit2.

Will address in <https://bugs.webkit.org/show_bug.cgi?id=185443>.

* platform/wk2/TestExpectations:

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

2 years ago[iOS] WKAttachmentTestsIOS.InsertDroppedItemProvidersInOrder fails after r231396
wenson_hsieh@apple.com [Tue, 8 May 2018 20:16:44 +0000 (20:16 +0000)]
[iOS] WKAttachmentTestsIOS.InsertDroppedItemProvidersInOrder fails after r231396
https://bugs.webkit.org/show_bug.cgi?id=185414

Reviewed by Tim Horton.

Adjust a test expectation to check that the resulting DOM contains an attachment element,
anchor element, and another attachment element in that order. This ensures that the test
still passes, even after the anchor element is followed by a line break.

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

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

2 years agoSystem Preview links should trigger a download
dino@apple.com [Tue, 8 May 2018 20:12:24 +0000 (20:12 +0000)]
System Preview links should trigger a download
https://bugs.webkit.org/show_bug.cgi?id=185439
<rdar://problem/40065545>

Reviewed by Jon Lee.

Source/WebCore:

Add a new field to FrameLoadRequest, which then is copied
into ResourceRequest, identifying if the link clicked
is a system preview.

* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::handleClick): Look for isSystemPreviewLink().
* loader/FrameLoadRequest.cpp:
(WebCore::FrameLoadRequest::FrameLoadRequest):
* loader/FrameLoadRequest.h: New property.
(WebCore::FrameLoadRequest::FrameLoadRequest):
(WebCore::FrameLoadRequest::isSystemPreview const):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::urlSelected):
(WebCore::FrameLoader::loadURL):
* loader/FrameLoader.h:
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::isSystemPreview const):
(WebCore::ResourceRequestBase::setSystemPreview):
* platform/network/ResourceRequestBase.h:

Source/WebKit:

Encode the new field identifying a system preview. And
if you encounter such a resource request, trigger
a download.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<ResourceRequest>::encode):
(IPC::ArgumentCoder<ResourceRequest>::decode):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction):

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

2 years agoStorage Access API: Add a request roundtrip to check whether prompting is needed
wilander@apple.com [Tue, 8 May 2018 19:36:01 +0000 (19:36 +0000)]
Storage Access API: Add a request roundtrip to check whether prompting is needed
https://bugs.webkit.org/show_bug.cgi?id=185368
<rdar://problem/40011556>

Reviewed by Alex Christensen and Youenn Fablet.

This patch adds an enum WebKit::StorageAccessStatus to handle our three access
states:
- WebKit::StorageAccessStatus::CannotRequestAccess.
    This means the domain is blocked from cookie access.
- WebKit::StorageAccessStatus::RequiresUserPrompt.
    This means that access has not been granted yet and a prompt is required.
- WebKit::StorageAccessStatus::HasAccess.
    This either means that this domain does not need to ask for access,
    access was already granted, or access was granted now.

If the call to WebResourceLoadStatisticsStore::requestStorageAccess() comes
back as WebKit::StorageAccessStatus::RequiresUserPrompt, the WebPageProxy
prompts the user and if the user said yes, calls a direct
WebResourceLoadStatisticsStore::grantStorageAccess().

Existing test cases pass because requestStorageAccessConfirm in WKPage.cpp
does not have m_client.requestStorageAccessConfirm and thus returns true.

* UIProcess/Network/NetworkProcessProxy.messages.in:
    Added a missing #endif.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::requestStorageAccess):
    Here we now handle the various cases encoded in WebKit::StorageAccessStatus.
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
    Now covers the optional prompt case.
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
(WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
(WebKit::WebResourceLoadStatisticsStore::grantStorageAccessInternal):
    Granting access is broken out to allow WebKit::WebPageProxy to call it
    directly.
* UIProcess/WebResourceLoadStatisticsStore.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::requestStorageAccess):
(WebKit::WebsiteDataStore::grantStorageAccess):
    Piping through calls from from WebKit::WebResourceLoadStatisticsStore
    to WebKit::WebPageProxy.
* UIProcess/WebsiteData/WebsiteDataStore.h:

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

2 years agoMark test http/tests/quicklook/csp-header-ignored.html as Failure.
dbates@webkit.org [Tue, 8 May 2018 19:34:13 +0000 (19:34 +0000)]
Mark test http/tests/quicklook/csp-header-ignored.html as Failure.

Will fix in <https://bugs.webkit.org/show_bug.cgi?id=185442>.

* platform/ios/TestExpectations:

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

2 years agoSome appcache crash tests are flaky due to console messages
youenn@apple.com [Tue, 8 May 2018 19:23:54 +0000 (19:23 +0000)]
Some appcache crash tests are flaky due to console messages
https://bugs.webkit.org/show_bug.cgi?id=185431

Reviewed by Geoffrey Garen.

Mark 3 tests that were written to test crashes as DumpJSConsoleLogInStdErr.
It is better to mark them as such than to changing them since they might no longer cover the crash reasons.
Rebase two other tests that might need further work to stop being flaky.

* TestExpectations:
* http/tests/appcache/404-resource-with-slow-main-resource-expected.txt:
* http/tests/appcache/abort-cache-onchecking-manifest-404-expected.txt:
* http/tests/appcache/deferred-events-expected.txt:
* http/tests/appcache/fail-on-update-2-expected.txt:
* http/tests/appcache/fail-on-update-expected.txt:
* platform/mac/TestExpectations:

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

2 years agoUnreviewed, rolling out r231376 and r231458.
cdumez@apple.com [Tue, 8 May 2018 18:58:25 +0000 (18:58 +0000)]
Unreviewed, rolling out r231376 and r231458.

Caused some API tests failures on iOS

Reverted changesets:

"[iOS] Apps that are not visible may not get suspended if they
trigger page loads while in the background"
https://bugs.webkit.org/show_bug.cgi?id=185318
https://trac.webkit.org/changeset/231376

"[iOS] Release page load process assertion if the screen is
locked"
https://bugs.webkit.org/show_bug.cgi?id=185333
https://trac.webkit.org/changeset/231458

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

2 years agoUse thumbnails in System Previews
dino@apple.com [Tue, 8 May 2018 18:57:48 +0000 (18:57 +0000)]
Use thumbnails in System Previews
https://bugs.webkit.org/show_bug.cgi?id=185397
<rdar://problem/40039376>

Reviewed by Jon Lee.

Source/WebCore/PAL:

* PAL.xcodeproj/project.pbxproj:
* pal/spi/ios/SystemPreviewSPI.h: New file holding the non-public parts of System Preview.

Source/WebKit:

A system preview that goes through the WKWebViewContentProvider will
show a static thumbnail/snapshot of the item, rather than jumping
directly to QuickLook.

This means we have to link to the AssetViewer framework. That provides
a ASVThumbnailView that will trigger QuickLook for us.

* Configurations/WebKit.xcconfig: Link to AssetViewer.

* UIProcess/ios/WKSystemPreviewView.h: Better macro use. Remove some unneeded protocols.
* UIProcess/ios/WKSystemPreviewView.mm:
(-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]): Update this
to use an ASVThumbnailView, when on the internal SDK (because it is private).
(-[WKSystemPreviewView _layoutThumbnailView]): Use the content insets to put
the thumbnail in the right place.
(-[WKSystemPreviewView thumbnailView:wantsToPresentPreviewController:forItem:]):
Delegate method.
(-[WKSystemPreviewView web_contentView]):
(-[WKSystemPreviewView web_computedContentInsetDidChange]):
(-[WKSystemPreviewView numberOfPreviewItemsInPreviewController:]): Deleted.
(-[WKSystemPreviewView previewController:previewItemAtIndex:]): Deleted.
(-[WKSystemPreviewView previewControllerWillDismiss:]): Deleted.

Source/WTF:

SYSTEM_PREVIEW is only available on some platforms.

* wtf/Platform.h:

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

2 years agoSkip http/tests/appcache/load-from-appcache-defer-resume-crash.html for iOS sim WK2
youenn@apple.com [Tue, 8 May 2018 18:32:38 +0000 (18:32 +0000)]
Skip http/tests/appcache/load-from-appcache-defer-resume-crash.html for iOS sim WK2
https://bugs.webkit.org/show_bug.cgi?id=185430

Unreviewed.

Skip the test as it is using WK1-only test runner API.

* platform/ios-wk2/TestExpectations:

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

2 years agoUnreviewed, rolling out r231491.
commit-queue@webkit.org [Tue, 8 May 2018 18:27:24 +0000 (18:27 +0000)]
Unreviewed, rolling out r231491.
https://bugs.webkit.org/show_bug.cgi?id=185434

Setting the Created key on a cookie does not work yet, due a
bug in CFNetwork (Requested by ggaren on #webkit).

Reverted changeset:

"[WKHTTPCookieStore getAllCookies] returns inconsistent
creation time"
https://bugs.webkit.org/show_bug.cgi?id=185041
https://trac.webkit.org/changeset/231491

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

2 years agotest262/Runner.pm: move input files to JSTests/test262
commit-queue@webkit.org [Tue, 8 May 2018 18:05:12 +0000 (18:05 +0000)]
test262/Runner.pm: move input files to JSTests/test262
https://bugs.webkit.org/show_bug.cgi?id=185389

Patch by Valerie R Young <valerie@bocoup.com> on 2018-05-08
Reviewed by Michael Saboff.

JSTests:

* test262/config.yaml: Renamed from Tools/Scripts/test262/config.yaml.
* test262/expectations.yaml: Renamed from Tools/Scripts/test262/expectations.yaml.

Tools:

* Scripts/test262/Runner.pm:
(processCLI):

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

2 years agoUnreviewed, simplify Speedometer fixes landed in r231489, r231483 & r231474.
cdumez@apple.com [Tue, 8 May 2018 17:56:26 +0000 (17:56 +0000)]
Unreviewed, simplify Speedometer fixes landed in r231489, r231483 & r231474.

* Scripts/webkitpy/performance_tests/perftest.py:
(PerfTest):

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

2 years agoUnreviewed, rolling out r231468.
ryanhaddad@apple.com [Tue, 8 May 2018 17:52:55 +0000 (17:52 +0000)]
Unreviewed, rolling out r231468.

Broke the CLoop build

Reverted changeset:

"InPlaceAbstractState::beginBasicBlock shouldn't have to clear
any abstract values"
https://bugs.webkit.org/show_bug.cgi?id=185365
https://trac.webkit.org/changeset/231468

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

2 years ago[WKHTTPCookieStore getAllCookies] returns inconsistent creation time
commit-queue@webkit.org [Tue, 8 May 2018 17:44:02 +0000 (17:44 +0000)]
[WKHTTPCookieStore getAllCookies] returns inconsistent creation time
https://bugs.webkit.org/show_bug.cgi?id=185041
<rdar://problem/34684214>

Patch by Sihui Liu <sihui_liu@apple.com> on 2018-05-08
Reviewed by Geoffrey Garen.

Source/WebCore:

Set creationtime property when creating Cookie object to keep consistency after conversion.

New API test: WebKit.WKHTTPCookieStoreCreationTime.

* platform/network/cocoa/CookieCocoa.mm:
(WebCore::Cookie::operator NSHTTPCookie * const):

Tools:

Add API test Coverage.

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

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

2 years agoText track cue logging should include cue text
eric.carlson@apple.com [Tue, 8 May 2018 17:20:09 +0000 (17:20 +0000)]
Text track cue logging should include cue text
https://bugs.webkit.org/show_bug.cgi?id=185353
<rdar://problem/40003565>

Reviewed by Brent Fulgham.

No new tests, tested manually.

* html/track/VTTCue.cpp:
(WebCore::VTTCue::toJSON const):
* platform/graphics/InbandTextTrackPrivateClient.h:
(WebCore::GenericCueData::toJSONString const):
* platform/graphics/iso/ISOVTTCue.cpp:
(WebCore::ISOWebVTTCue::toJSONString const):

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

2 years agoUnreviewed, fix issue with running Speedometer PerfTest after r231450.
cdumez@apple.com [Tue, 8 May 2018 17:15:38 +0000 (17:15 +0000)]
Unreviewed, fix issue with running Speedometer PerfTest after r231450.

* Scripts/webkitpy/performance_tests/perftest.py:
(PerfTest):

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

2 years agoMore cleanup of XMLHttpRequestUpload
commit-queue@webkit.org [Tue, 8 May 2018 16:34:07 +0000 (16:34 +0000)]
More cleanup of XMLHttpRequestUpload
https://bugs.webkit.org/show_bug.cgi?id=185409

Patch by Sam Weinig <sam@webkit.org> on 2018-05-08
Reviewed by Alex Christensen.

- Remove unneeded #includes
- Rename m_xmlHttpRequest to m_request
- Make some overloaded some methods private, and mark them as final rather
  than override.

* xml/XMLHttpRequestUpload.cpp:
(WebCore::XMLHttpRequestUpload::XMLHttpRequestUpload):
* xml/XMLHttpRequestUpload.h:

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

2 years ago[LFC] Start using BlockMarginCollapse
zalan@apple.com [Tue, 8 May 2018 16:31:04 +0000 (16:31 +0000)]
[LFC] Start using BlockMarginCollapse
https://bugs.webkit.org/show_bug.cgi?id=185424

Reviewed by Antti Koivisto.

BlockMarginCollapse could be all static.

* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::marginTop const):
(WebCore::Layout::BlockFormattingContext::marginBottom const):
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::isMarginTopCollapsedWithSibling):
(WebCore::Layout::isMarginBottomCollapsedWithSibling):
(WebCore::Layout::isMarginTopCollapsedWithParent):
(WebCore::Layout::isMarginBottomCollapsedWithParent):
(WebCore::Layout::collapsedMarginTopFromFirstChild):
(WebCore::Layout::collapsedMarginBottomFromLastChild):
(WebCore::Layout::nonCollapsedMarginTop):
(WebCore::Layout::nonCollapsedMarginBottom):
(WebCore::Layout::BlockMarginCollapse::marginTop):
(WebCore::Layout::BlockMarginCollapse::marginBottom):
(WebCore::Layout::BlockMarginCollapse::BlockMarginCollapse): Deleted.
(WebCore::Layout::BlockMarginCollapse::marginTop const): Deleted.
(WebCore::Layout::BlockMarginCollapse::marginBottom const): Deleted.
(WebCore::Layout::BlockMarginCollapse::isMarginTopCollapsedWithSibling const): Deleted.
(WebCore::Layout::BlockMarginCollapse::isMarginBottomCollapsedWithSibling const): Deleted.
(WebCore::Layout::BlockMarginCollapse::isMarginTopCollapsedWithParent const): Deleted.
(WebCore::Layout::BlockMarginCollapse::isMarginBottomCollapsedWithParent const): Deleted.
(WebCore::Layout::BlockMarginCollapse::nonCollapsedMarginTop const): Deleted.
(WebCore::Layout::BlockMarginCollapse::nonCollapsedMarginBottom const): Deleted.
(WebCore::Layout::BlockMarginCollapse::collapsedMarginTopFromFirstChild const): Deleted.
(WebCore::Layout::BlockMarginCollapse::collapsedMarginBottomFromLastChild const): Deleted.
(WebCore::Layout::BlockMarginCollapse::hasAdjoiningMarginTopAndBottom const): Deleted.
* layout/blockformatting/BlockMarginCollapse.h:

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

2 years agoAllow WebResourceLoader to cancel a load served from a service worker
youenn@apple.com [Tue, 8 May 2018 16:26:54 +0000 (16:26 +0000)]
Allow WebResourceLoader to cancel a load served from a service worker
https://bugs.webkit.org/show_bug.cgi?id=185274

Reviewed by Chris Dumez.

Source/WebCore:

Add support for cancelling a fetch from WebProcess to service worker process.
Use FetchIdentifier instead of uint64_t.

* Modules/fetch/FetchIdentifier.h: Added.
* WebCore.xcodeproj/project.pbxproj:
* workers/service/context/ServiceWorkerFetch.h:
* workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::ServiceWorkerThreadProxy::startFetch):
(WebCore::ServiceWorkerThreadProxy::cancelFetch):
* workers/service/context/ServiceWorkerThreadProxy.h:

Source/WebKit:

Use FetchIdentifier instead of uint64_t.
Add IPC support for cancelling a fetch from WebProcess to service worker process.
Ask service worker process to cancel the fetch when its corresponding WebResourceLoader is cancelled.
No change of behavior as once a WebResourceLoader is cancelled, any related IPC is not processed.
A follow-up patch should try to cancel the FetchResponse load, meaning to either cancel the network load
or to abort reading the readable stream.

* Scripts/webkit/messages.py:
* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::cancelFetch):
(WebKit::WebSWServerConnection::startFetch):
(WebKit::WebSWServerConnection::didReceiveFetchResponse):
(WebKit::WebSWServerConnection::didReceiveFetchData):
(WebKit::WebSWServerConnection::didReceiveFetchFormData):
(WebKit::WebSWServerConnection::didFinishFetch):
(WebKit::WebSWServerConnection::didFailFetch):
(WebKit::WebSWServerConnection::didNotHandleFetch):
* StorageProcess/ServiceWorker/WebSWServerConnection.h:
* StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::didFailFetch):
(WebKit::StorageProcess::didNotHandleFetch):
(WebKit::StorageProcess::didReceiveFetchResponse):
(WebKit::StorageProcess::didReceiveFetchData):
(WebKit::StorageProcess::didReceiveFetchFormData):
(WebKit::StorageProcess::didFinishFetch):
* StorageProcess/StorageProcess.h:
* StorageProcess/StorageProcess.messages.in:
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::remove):
* WebProcess/Storage/ServiceWorkerClientFetch.cpp:
(WebKit::ServiceWorkerClientFetch::create):
(WebKit::ServiceWorkerClientFetch::ServiceWorkerClientFetch):
(WebKit::ServiceWorkerClientFetch::start):
(WebKit::ServiceWorkerClientFetch::cancel):
* WebProcess/Storage/ServiceWorkerClientFetch.h:
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::startFetch):
(WebKit::WebSWClientConnection::cancelFetch):
* WebProcess/Storage/WebSWClientConnection.h:
* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::cancelFetch):
(WebKit::WebSWContextManagerConnection::startFetch):
* WebProcess/Storage/WebSWContextManagerConnection.h:
* WebProcess/Storage/WebSWContextManagerConnection.messages.in:
* WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
(WebKit::WebServiceWorkerFetchTaskClient::WebServiceWorkerFetchTaskClient):
(WebKit::WebServiceWorkerFetchTaskClient::cancel):
* WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:
* WebProcess/Storage/WebServiceWorkerProvider.cpp:
(WebKit::WebServiceWorkerProvider::handleFetch):
(WebKit::WebServiceWorkerProvider::cancelFetch):
(WebKit::WebServiceWorkerProvider::fetchFinished):
* WebProcess/Storage/WebServiceWorkerProvider.h:

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

2 years agofeTurbulence is not rendered correctly on Retina display
commit-queue@webkit.org [Tue, 8 May 2018 16:20:06 +0000 (16:20 +0000)]
feTurbulence is not rendered correctly on Retina display
https://bugs.webkit.org/show_bug.cgi?id=183798

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2018-05-08
Reviewed by Simon Fraser.

Source/WebCore:

On 2x display the feTurbulence filter creates a scaled ImageBuffer but
processes only the unscaled size. This is a remaining work of r168577 and
is very similar to what was done for the feMorphology filter in r188271.

Test: fast/hidpi/filters-turbulence.html

* platform/graphics/filters/FETurbulence.cpp:
(WebCore::FETurbulence::fillRegion const):
(WebCore::FETurbulence::platformApplySoftware):

LayoutTests:

* fast/hidpi/filters-turbulence-expected.html: Added.
* fast/hidpi/filters-turbulence.html: Added.

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

2 years agoDon't use mapped cache files in case of Class A/B protected app
antti@apple.com [Tue, 8 May 2018 16:15:19 +0000 (16:15 +0000)]
Don't use mapped cache files in case of Class A/B protected app
https://bugs.webkit.org/show_bug.cgi?id=185422
<rdar://problem/34001688>

Reviewed by Chris Dumez.

Currently we don't use shared memory maps in these cases. This still leaves us open for crashes
in the network process when the device is locked.

This patch disables use of blob storage (mapped cache files) in apps that use class A/B protection.
Normally we use blobs for resources > 16KB. Since use of shared memory is already disabled,
the only optimization lost for these apps is body data deduplication.

Any existing cache entries with blobs are ignored and deleted. New entries are created with
body data inlined with the metadata.

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::store):
* NetworkProcess/cache/NetworkCache.h:
(WebKit::NetworkCache::Cache::canUseSharedMemoryForBodyData const): Deleted.
* NetworkProcess/cache/NetworkCacheEntry.cpp:
(WebKit::NetworkCache::Entry::initializeShareableResourceHandleFromStorageRecord const):

    Remove the code the prevented use of shared memory in these cases. Non-mapped Data objects
    are never shareable.

(WebKit::NetworkCache::Entry::setNeedsValidation):
* NetworkProcess/cache/NetworkCacheFileSystem.cpp:
(WebKit::NetworkCache::isSafeToUseMemoryMapForPath):
(WebKit::NetworkCache::canUseSharedMemoryForPath): Deleted.
* NetworkProcess/cache/NetworkCacheFileSystem.h:
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::Storage::Storage):
(WebKit::NetworkCache::Storage::mayContainBlob const):
(WebKit::NetworkCache::Storage::shouldStoreBodyAsBlob):
(WebKit::NetworkCache::shouldStoreBodyAsBlob): Deleted.
* NetworkProcess/cache/NetworkCacheStorage.h:
(WebKit::NetworkCache::Storage::canUseSharedMemoryForBodyData const): Deleted.

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

2 years agoUnreviewed, fix issue with running Speedometer PerfTest after r231450.
cdumez@apple.com [Tue, 8 May 2018 14:02:45 +0000 (14:02 +0000)]
Unreviewed, fix issue with running Speedometer PerfTest after r231450.

* Scripts/webkitpy/performance_tests/perftest.py:
(PerfTest):

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

2 years agoUnreviewed. Add missing exit not included in r231298.
carlosgc@webkit.org [Tue, 8 May 2018 06:09:06 +0000 (06:09 +0000)]
Unreviewed. Add missing exit not included in r231298.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::ensureWebToStorageProcessConnection):

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

2 years ago[JSCONLY] Enable ARMv7 DFG
utatane.tea@gmail.com [Tue, 8 May 2018 06:05:46 +0000 (06:05 +0000)]
[JSCONLY] Enable ARMv7 DFG
https://bugs.webkit.org/show_bug.cgi?id=185415

Reviewed by Mark Lam.

Enable ARMv7 DFG JIT by default on Linux and FreeBSD.

* wtf/Platform.h:

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

2 years ago[LFC] Add FormattingContext::layoutOutOfFlowDescendants implementation
zalan@apple.com [Tue, 8 May 2018 05:26:39 +0000 (05:26 +0000)]
[LFC] Add FormattingContext::layoutOutOfFlowDescendants implementation
https://bugs.webkit.org/show_bug.cgi?id=185377

Reviewed by Antti Koivisto.

Also, remove FormattingContext's m_layoutContext member and pass it in to ::layout() instead.
In theory LayoutContext is needed only during ::layout() call.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
* layout/FormattingContext.h:
(WebCore::Layout::FormattingContext::layoutContext const):
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::updateLayout):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
* layout/blockformatting/BlockFormattingContext.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout const):
* layout/inlineformatting/InlineFormattingContext.h:

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

2 years agoCheck X-Frame-Options and CSP frame-ancestors in network process
dbates@webkit.org [Tue, 8 May 2018 05:02:52 +0000 (05:02 +0000)]
Check X-Frame-Options and CSP frame-ancestors in network process
https://bugs.webkit.org/show_bug.cgi?id=185410
<rdar://problem/37733934>

Reviewed by Ryosuke Niwa.

Source/JavaScriptCore:

Add enum traits for MessageSource and MessageLevel so that we can encode and decode them for IPC.

* runtime/ConsoleTypes.h:

Source/WebCore:

* WebCore.xcodeproj/project.pbxproj: Make PingLoader.h a private header so that we can include it in WebKit.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::responseReceived): Only check CSP frame-ancestors and X-Frame-Options here if
we are not checking them in the NetworkProcess and HTTP response access is restricted. I code is otherwise kept
unchanged. There may be opportunities to clean this code up more and share more of it. We should look into this
in subsequent bugs.
* loader/DocumentLoader.h: Change visibility of stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied() from
private to public and export it so that we can call it from the WebKit.
* loader/PingLoader.h:
* page/Settings.yaml: Add a new setting called networkProcessCSPFrameAncestorsCheckingEnabled (defaults: false)
and is hardcoded in WebPage.cpp to be enabled. This setting is used to determine if we will be using the NetworkProcess.
Ideally we wouldn't have this setting and just key off RuntimeEnabledFeatures::sharedFeatures().restrictedHTTPResponseAccess().
However RuntimeEnabledFeatures::sharedFeatures().restrictedHTTPResponseAccess() is always enabled in WebKit Legacy
at the time of writing (why?). And, strangely, RuntimeEnabledFeatures::sharedFeatures().restrictedHTTPResponseAccess()
is conditionally enabled in WebKit. For now, we add a new setting, networkProcessCSPFrameAncestorsCheckingEnabled,
to determine if CSP checking should be performed in NetworkProcess. For checking to actually happen in NetworkProcess
and not in DocumentLoader::responseReceived() RuntimeEnabledFeatures::sharedFeatures().restrictedHTTPResponseAccess()
will also need to be enabled.
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::allowFrameAncestors const): Added a variant that takes a vector of ancestor origins.
* page/csp/ContentSecurityPolicy.h:
* page/csp/ContentSecurityPolicyDirectiveList.cpp:
(WebCore::checkFrameAncestors): Ditto.
(WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForFrameAncestorOrigins const): Ditto.
* page/csp/ContentSecurityPolicyDirectiveList.h: Export constructor so that we can invoke it from NetworkResourceLoader::shouldInterruptLoadForCSPFrameAncestorsOrXFrameOptions().
* page/csp/ContentSecurityPolicyResponseHeaders.h:
* platform/network/HTTPParsers.h: Export XFrameOptionsDisposition() so that we can use in WebKit.

Source/WebKit:

* NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::encode const): Always encode the frame ancestor origins.
(WebKit::NetworkResourceLoadParameters::decode): Always decode the frame ancestor origins.
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::shouldInterruptLoadForXFrameOptions): Added.
(WebKit::NetworkResourceLoader::shouldInterruptLoadForCSPFrameAncestorsOrXFrameOptions): Added.
(WebKit::NetworkResourceLoader::didReceiveResponse): Check if the load needs to be interrupted due
to a violation of the CSP frame-ancestors directive or X-Frame-Options. If there is a violation
then stop the load.
(WebKit::NetworkResourceLoader::didRetrieveCacheEntry): Ditto.
(NetworkResourceLoader::addConsoleMessage): Added.
(NetworkResourceLoader::sendCSPViolationReport): Added.
* NetworkProcess/NetworkResourceLoader.h:
* Scripts/webkit/messages.py: Teach the generator about data types MessageLevel and MessageSource
as they are both defined in file JavaScriptCore/ConsoleTypes.h as opposed to independent headers.
Also tell the generator that these types should not be forward declared so that we can use these
types without their JSC:: prefix in WebPage.messages.in.
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::didReceiveMessage): Route WebPage messages to the appropriate
web page.
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): Added message StopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied.
* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied): Added.
* WebProcess/Network/WebResourceLoader.h:
* WebProcess/Network/WebResourceLoader.messages.in:
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::addConsoleMessage):
* WebProcess/WebPage/WebFrame.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::addConsoleMessage): Added.
(WebKit::WebPage::sendCSPViolationReport): Added.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in: Add messages AddConsoleMessage and SendCSPViolationReport
for adding a console message to Web Inspector and sending a CSP report, respectively.

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

2 years ago[JSCOnly] Enable Intl.PluralRules
utatane.tea@gmail.com [Tue, 8 May 2018 04:19:22 +0000 (04:19 +0000)]
[JSCOnly] Enable Intl.PluralRules
https://bugs.webkit.org/show_bug.cgi?id=185359

Reviewed by Daniel Bates.

Enable Intl.PluralRules because JSCOnly port enables features aggressively.

* Source/cmake/OptionsJSCOnly.cmake:

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

2 years agoMake a compact version of VariableEnvironment that UnlinkedFunctionExecutable stores...
sbarati@apple.com [Tue, 8 May 2018 04:18:25 +0000 (04:18 +0000)]
Make a compact version of VariableEnvironment that UnlinkedFunctionExecutable stores and hash-cons these compact environments as we make them
https://bugs.webkit.org/show_bug.cgi?id=185329
<rdar://problem/39961536>

Reviewed by Michael Saboff.

I was made aware of a memory goof inside of JSC where we would inefficiently
use space to represent an UnlinkedFunctionExecutable's parent TDZ variables.

We did two things badly:
1. We used a HashMap instead of a Vector to represent the environment. Having
a HashMap is useful when looking things up when generating bytecode, but it's
space inefficient. Because UnlinkedFunctionExecutables live a long time because
of the code cache, we should have them store this information efficiently
inside of a Vector.

2. We didn't hash-cons these environments together. If you think about how
some programs are structured, hash-consing these together is hugely profitable.
Consider some code like this:
```
const/let V_1 = ...;
const/let V_2 = ...;
...
const/let V_n = ...;

function f_1() { ... };
function f_2() { ... };
...
function f_n() { ... };
```

Each f_i would store an identical hash map for its parent TDZ variables
consisting of {V_1, ..., V_n}. This was incredibly dumb. With hash-consing,
each f_i just holds onto a reference to the environment.

I benchmarked this change against an app that made heavy use of the
above code pattern and it reduced its peak memory footprint from ~220MB
to ~160MB.

* bytecode/UnlinkedFunctionExecutable.cpp:
(JSC::generateUnlinkedFunctionCodeBlock):
(JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable):
* bytecode/UnlinkedFunctionExecutable.h:
* parser/VariableEnvironment.cpp:
(JSC::CompactVariableEnvironment::CompactVariableEnvironment):
(JSC::CompactVariableEnvironment::operator== const):
(JSC::CompactVariableEnvironment::toVariableEnvironment const):
(JSC::CompactVariableMap::get):
(JSC::CompactVariableMap::Handle::~Handle):
* parser/VariableEnvironment.h:
(JSC::VariableEnvironmentEntry::bits const):
(JSC::VariableEnvironmentEntry::operator== const):
(JSC::VariableEnvironment::isEverythingCaptured const):
(JSC::CompactVariableEnvironment::hash const):
(JSC::CompactVariableMapKey::CompactVariableMapKey):
(JSC::CompactVariableMapKey::hash):
(JSC::CompactVariableMapKey::equal):
(JSC::CompactVariableMapKey::makeDeletedValue):
(JSC::CompactVariableMapKey::isHashTableDeletedValue const):
(JSC::CompactVariableMapKey::isHashTableEmptyValue const):
(JSC::CompactVariableMapKey::environment):
(WTF::HashTraits<JSC::CompactVariableMapKey>::emptyValue):
(WTF::HashTraits<JSC::CompactVariableMapKey>::isEmptyValue):
(WTF::HashTraits<JSC::CompactVariableMapKey>::constructDeletedValue):
(WTF::HashTraits<JSC::CompactVariableMapKey>::isDeletedValue):
(JSC::CompactVariableMap::Handle::Handle):
(JSC::CompactVariableMap::Handle::environment const):
(JSC::VariableEnvironment::VariableEnvironment): Deleted.
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:

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

2 years agoAbstract logic to log console messages and send CSP violation reports into a client
dbates@webkit.org [Tue, 8 May 2018 03:51:10 +0000 (03:51 +0000)]
Abstract logic to log console messages and send CSP violation reports into a client
https://bugs.webkit.org/show_bug.cgi?id=185393
<rdar://problem/40036053>

Reviewed by Brent Fulgham.

Source/WebCore:

First pass at adding infrastructure to supporting CSP reporting from NetworkProcess and workers.
Replaces the existing ContentSecurityPolicy constructor that takes a Frame with one that
takes a ContentSecurityPolicyClient to delegate to for logging and sending reports. We will look
to remove ContentSecurityPolicy constructor that takes a ScriptExecutionContext in a follow up.

Standardize on instantiating a ContentSecurityPolicy with the full URL to resource that it protects
instead of taking only the SecurityOrigin of this URL. By taking the full URL the ContentSecurityPolicy
object is now capable of resolving a relative report URL without needing a Document/ScriptExecutionContext.

We are underutilizing the CSPInfo struct and ContentSecurityPolicyClient::willSendCSPViolationReport()
delegate callback in this patch. We will make use of this functionality in a subsequent patch to
support collecting script state (e.g. source line number) when reporting CSP violations in worker
threads. We also no longer go through the unnecessary motions to try to collect script state for a
frame-ancestors violation (since DocumentLoader extends ContentSecurityPolicyClient and does not
implement ContentSecurityPolicyClient::willSendCSPViolationReport()). The frame-ancestors directive
is checked before a document is parsed and executes script; => there will never be any script state
to collect; => it is not necessary to try to collect it as we currently do.

* Sources.txt: Add file ContentSecurityPolicyClient.cpp. See the remarks for ContentSecurityPolicyClient.cpp
below on why we have this file.
* WebCore.xcodeproj/project.pbxproj: Add files ContentSecurityPolicyClient.{h, cpp}.
* dom/Document.cpp:
(WebCore::Document::initSecurityContext): Pass the URL of the protected document.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::responseReceived): Ditto.
(WebCore::DocumentLoader::addConsoleMessage): Added.
(WebCore::DocumentLoader::sendCSPViolationReport): Added.
(WebCore::DocumentLoader::dispatchSecurityPolicyViolationEvent): Added.
* loader/DocumentLoader.h:
* loader/FrameLoaderClient.h: Fix typo in comment.
* loader/WorkerThreadableLoader.cpp:
(WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge): Pass the URL of the worker script.
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::ContentSecurityPolicy): Added overload that takes a URL&& and an optional
ContentSecurityPolicyClient*.
(WebCore::ContentSecurityPolicy::deprecatedURLForReporting const): Extracted and simplified stripURLForUseInReport()
into this member function.
(WebCore::ContentSecurityPolicy::reportViolation const): Modified to make use of the client, if we have
one and removed code for handling a ContentSecurityPolicy that was instantiated with a Frame.
(WebCore::ContentSecurityPolicy::logToConsole const): Ditto.
(WebCore::stripURLForUseInReport): Deleted; incorporated into ContentSecurityPolicy::deprecatedURLForReporting().
* page/csp/ContentSecurityPolicy.h:
* page/csp/ContentSecurityPolicyClient.cpp: Added. This file exists so that we can define the virtual
destructor out-of-line and export this abstract class so as to avoid the need for the vtable to be
defined in the translation unit of each derived class.
* page/csp/ContentSecurityPolicyClient.h: Added.
* page/csp/ContentSecurityPolicySource.cpp:
(WebCore::ContentSecurityPolicySource::operator SecurityOriginData const): Added.
* page/csp/ContentSecurityPolicySource.h:
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::WorkerGlobalScope): Instantiate the ContentSecurityPolicy object with the
URL of the worker script.

Source/WebKit:

For now, build a URL from the source origin associated with the NetworkResourceLoader
and pass this to the ContentSecurityPolicy constructor.

Additionally, make NetworkLoadChecker::contentSecurityPolicy() non-const since it returns
a non-const pointer to a ContentSecurityPolicy object; => callers can mutate this object
right from under NetworkLoadChecker. Making this non-const makes this clear to a reader.
Also remove the mutable keyword from the definition of NetworkLoadChecker::m_contentSecurityPolicy.

* NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::contentSecurityPolicy):
(WebKit::NetworkLoadChecker::contentSecurityPolicy const): Deleted.
* NetworkProcess/NetworkLoadChecker.h:

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

2 years agoUnreviewed, add frame name in form-iframe-target-before-load-crash.html
cdumez@apple.com [Tue, 8 May 2018 02:16:00 +0000 (02:16 +0000)]
Unreviewed, add frame name in form-iframe-target-before-load-crash.html
https://bugs.webkit.org/show_bug.cgi?id=185408

The test started causing flakiness after r231456 because it would submit
the form in the main frame instead of the test frame.

* fast/events/form-iframe-target-before-load-crash.html:

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

2 years agoUnreviewed, fix issue with running Speedometer PerfTest after r231450.
cdumez@apple.com [Tue, 8 May 2018 01:54:10 +0000 (01:54 +0000)]
Unreviewed, fix issue with running Speedometer PerfTest after r231450.

* Scripts/webkitpy/performance_tests/perftest.py:
(PerfTest):

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

2 years agoCSS filters which reference SVG filters fail to respect the "color-interpolation...
simon.fraser@apple.com [Tue, 8 May 2018 01:34:34 +0000 (01:34 +0000)]
CSS filters which reference SVG filters fail to respect the "color-interpolation-filters" of the filter
https://bugs.webkit.org/show_bug.cgi?id=185343

Reviewed by Dean Jackson.

Source/WebCore:

Test: css3/filters/color-interpolation-filters.html

When applying CSS reference filters, apply the value of "color-interpolation-filters" for the
referenced filter effect element, just as we do for SVG filters.

* rendering/FilterEffectRenderer.cpp:
(WebCore::FilterEffectRenderer::buildReferenceFilter):

LayoutTests:

* css3/filters/color-interpolation-filters-expected.html: Added.
* css3/filters/color-interpolation-filters.html: Added.

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

2 years ago[DFG][MIPS] Simplify DFG code by increasing MIPS temporary registers
utatane.tea@gmail.com [Tue, 8 May 2018 01:13:03 +0000 (01:13 +0000)]
[DFG][MIPS] Simplify DFG code by increasing MIPS temporary registers
https://bugs.webkit.org/show_bug.cgi?id=185371

Reviewed by Mark Lam.

Since MIPS GPRInfo claims it has only 7 registers, some of DFG code exhausts registers.
As a result, we need to maintain separated code for MIPS. This increases DFG maintenance burden,
but actually MIPS have much more registers.

This patch adds $a0 - $a3 to temporary registers. This is OK since our temporary registers can be overlapped with
argument registers (see ARM, X86 implementations). These registers are caller-save ones, so we do not need to
have extra mechanism.

Then, we remove several unnecessary MIPS code in our JIT infrastructure.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* jit/CCallHelpers.h:
* jit/GPRInfo.h:
(JSC::GPRInfo::toRegister):
(JSC::GPRInfo::toIndex):
* offlineasm/mips.rb:

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

2 years agoDFG AI should have O(1) clobbering
fpizlo@apple.com [Tue, 8 May 2018 01:05:21 +0000 (01:05 +0000)]
DFG AI should have O(1) clobbering
https://bugs.webkit.org/show_bug.cgi?id=185287

Reviewed by Saam Barati.
JSTests:

* stress/simple-ai-effect.js: Added.
(bar):
(foo):

Source/JavaScriptCore:

This fixes an old scalability probem in AI. Previously, if we did clobberWorld(), then we
would traverse all of the state available to the AI at that time and clobber it.

This changes clobberWorld() to be O(1). It just does some math to a clobber epoch.

This is a ~1% speed-up for compile times.

* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* dfg/DFGAbstractInterpreter.h:
(JSC::DFG::AbstractInterpreter::forNode):
(JSC::DFG::AbstractInterpreter::setForNode):
(JSC::DFG::AbstractInterpreter::clearForNode):
(JSC::DFG::AbstractInterpreter::variables): Deleted.
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
(JSC::DFG::AbstractInterpreter<AbstractStateType>::clobberWorld):
(JSC::DFG::AbstractInterpreter<AbstractStateType>::forAllValues):
(JSC::DFG::AbstractInterpreter<AbstractStateType>::clobberStructures):
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeDoubleUnaryOpEffects):
* dfg/DFGAbstractValue.cpp:
(JSC::DFG::AbstractValue::fastForwardToSlow):
* dfg/DFGAbstractValue.h:
(JSC::DFG::AbstractValue::fastForwardTo):
(JSC::DFG::AbstractValue::clobberStructuresFor): Deleted.
(JSC::DFG::AbstractValue::observeInvalidationPoint): Deleted.
(JSC::DFG::AbstractValue::observeInvalidationPointFor): Deleted.
* dfg/DFGAbstractValueClobberEpoch.cpp: Added.
(JSC::DFG::AbstractValueClobberEpoch::dump const):
* dfg/DFGAbstractValueClobberEpoch.h: Added.
(JSC::DFG::AbstractValueClobberEpoch::AbstractValueClobberEpoch):
(JSC::DFG::AbstractValueClobberEpoch::first):
(JSC::DFG::AbstractValueClobberEpoch::clobber):
(JSC::DFG::AbstractValueClobberEpoch::observeInvalidationPoint):
(JSC::DFG::AbstractValueClobberEpoch::operator== const):
(JSC::DFG::AbstractValueClobberEpoch::operator!= const):
(JSC::DFG::AbstractValueClobberEpoch::structureClobberState const):
(JSC::DFG::AbstractValueClobberEpoch::clobberEpoch const):
* dfg/DFGAtTailAbstractState.h:
(JSC::DFG::AtTailAbstractState::setForNode):
(JSC::DFG::AtTailAbstractState::clearForNode):
(JSC::DFG::AtTailAbstractState::numberOfArguments const):
(JSC::DFG::AtTailAbstractState::numberOfLocals const):
(JSC::DFG::AtTailAbstractState::operand):
(JSC::DFG::AtTailAbstractState::local):
(JSC::DFG::AtTailAbstractState::argument):
(JSC::DFG::AtTailAbstractState::clobberStructures):
(JSC::DFG::AtTailAbstractState::observeInvalidationPoint):
(JSC::DFG::AtTailAbstractState::variables): Deleted.
* dfg/DFGCFAPhase.cpp:
(JSC::DFG::CFAPhase::performBlockCFA):
* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::foldConstants):
* dfg/DFGFlowMap.h:
(JSC::DFG::FlowMap::at):
(JSC::DFG::FlowMap::atShadow):
(JSC::DFG::FlowMap::at const):
(JSC::DFG::FlowMap::atShadow const):
* dfg/DFGInPlaceAbstractState.cpp:
(JSC::DFG::InPlaceAbstractState::beginBasicBlock):
(JSC::DFG::InPlaceAbstractState::endBasicBlock):
* dfg/DFGInPlaceAbstractState.h:
(JSC::DFG::InPlaceAbstractState::forNode):
(JSC::DFG::InPlaceAbstractState::setForNode):
(JSC::DFG::InPlaceAbstractState::clearForNode):
(JSC::DFG::InPlaceAbstractState::variablesForDebugging):
(JSC::DFG::InPlaceAbstractState::numberOfArguments const):
(JSC::DFG::InPlaceAbstractState::numberOfLocals const):
(JSC::DFG::InPlaceAbstractState::operand):
(JSC::DFG::InPlaceAbstractState::local):
(JSC::DFG::InPlaceAbstractState::argument):
(JSC::DFG::InPlaceAbstractState::variableAt):
(JSC::DFG::InPlaceAbstractState::clobberStructures):
(JSC::DFG::InPlaceAbstractState::observeInvalidationPoint):
(JSC::DFG::InPlaceAbstractState::fastForward):
(JSC::DFG::InPlaceAbstractState::variables): Deleted.
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileGetStack):

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

2 years agoUpdate TestExpectations for imported/w3c/web-platform-tests/html/dom/interfaces.worke...
ryanhaddad@apple.com [Tue, 8 May 2018 00:28:12 +0000 (00:28 +0000)]
Update TestExpectations for imported/w3c/web-platform-tests/html/dom/interfaces.worker.html.
https://bugs.webkit.org/show_bug.cgi?id=185407

Unreviewed test gardening.

* TestExpectations:

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

2 years agoMark http/tests/security/contentTypeOptions/nosniff-importScript-blocked.html as...
ryanhaddad@apple.com [Tue, 8 May 2018 00:08:53 +0000 (00:08 +0000)]
Mark http/tests/security/contentTypeOptions/nosniff-importScript-blocked.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=184802

Unreviewed test gardening.

* TestExpectations:

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

2 years agoInPlaceAbstractState::beginBasicBlock shouldn't have to clear any abstract values
fpizlo@apple.com [Tue, 8 May 2018 00:07:20 +0000 (00:07 +0000)]
InPlaceAbstractState::beginBasicBlock shouldn't have to clear any abstract values
https://bugs.webkit.org/show_bug.cgi?id=185365

Reviewed by Saam Barati.

Source/JavaScriptCore:

This patch does three things to improve compile times:

- Fixes some inlining goofs.

- Adds the ability to measure compile times with run-jsc-benchmarks.

- Dramatically improves the performance of InPlaceAbstractState::beginBasicBlock by removing the
  code that clears abstract values. It turns out that on constant folding "needed" this, in the
  sense that this was the only thing protecting it from loading the abstract value of a no-result
  node and then concluding that because it had a non-empty m_value, it could be constant-folded.
  Any node that produces a result will explicitly set its abstract value, so this problem can
  also be guarded by just having constant folding check if the node it wants to fold returns any
  result.

Solid 0.96% compile time speed-up across SunSpider-CompileTime and V8Spider-CompileTime.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGAbstractValue.cpp:
(JSC::DFG::AbstractValue::set):
* dfg/DFGAbstractValue.h:
(JSC::DFG::AbstractValue::merge):
* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::foldConstants):
* dfg/DFGGraph.h:
(JSC::DFG::Graph::doToChildrenWithNode):
(JSC::DFG::Graph::doToChildren):
* dfg/DFGInPlaceAbstractState.cpp:
(JSC::DFG::InPlaceAbstractState::beginBasicBlock):
* jit/JIT.cpp:
(JSC::JIT::totalCompileTime):
* jit/JIT.h:
* jsc.cpp:
(GlobalObject::finishCreation):
(functionTotalCompileTime):

Source/WTF:

Fix some inlining goof-ups.

* wtf/TinyPtrSet.h:
(WTF::TinyPtrSet::add):
(WTF::TinyPtrSet::merge):
(WTF::TinyPtrSet::addOutOfLine):
(WTF::TinyPtrSet::mergeOtherOutOfLine):

Tools:

Make it possible to measure compile times.

* Scripts/run-jsc-benchmarks:

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

2 years agoDFG AI doesn't need to merge valuesAtTail - it can just assign them
fpizlo@apple.com [Tue, 8 May 2018 00:05:08 +0000 (00:05 +0000)]
DFG AI doesn't need to merge valuesAtTail - it can just assign them
https://bugs.webkit.org/show_bug.cgi?id=185355

Reviewed by Mark Lam.

This is a further attempt to improve compile times. Assigning AbstractValue ought to always
be faster than merging. There's no need to merge valuesAtTail. In most cases, assigning and
merging will get the same answer because the value computed this time will be either the same
as or more general than the value computed last time. If the value does change for some
reason, then valuesAtHead are already merged, which ensures monotonicity. Also, if the value
changes, then we have no reason to believe that this new value is less right than the last
one we computed. Finally, the one client of valuesAtTail (AtTailAbstractState) doesn't care
if it's getting the merged valuesAtTail or just some correct answer for valuesAtTail.

* dfg/DFGInPlaceAbstractState.cpp:
(JSC::DFG::InPlaceAbstractState::endBasicBlock):

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

2 years agoMark http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-ifram...
ryanhaddad@apple.com [Mon, 7 May 2018 23:59:37 +0000 (23:59 +0000)]
Mark http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-iframe-in-main-frame.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=185404

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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