WebKit-https.git
2 years agoTransition GenericCallback from std::function to WTF::Function.
beidson@apple.com [Mon, 13 Mar 2017 01:37:36 +0000 (01:37 +0000)]
Transition GenericCallback from std::function to WTF::Function.
https://bugs.webkit.org/show_bug.cgi?id=169530

Reviewed by Dean Jackson.

* UIProcess/GenericCallback.h:
(WebKit::GenericCallback::create):
(WebKit::GenericCallback::performCallbackWithReturnValue):
(WebKit::GenericCallback::GenericCallback):
(WebKit::CallbackMap::put):

* UIProcess/WebCookieManagerProxy.cpp:
(WebKit::WebCookieManagerProxy::getHostnamesWithCookies):
(WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy):
* UIProcess/WebCookieManagerProxy.h:

* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::getWebArchive):
(WebKit::WebFrameProxy::getMainResourceData):
(WebKit::WebFrameProxy::getResourceData):
* UIProcess/WebFrameProxy.h:

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::getSelectionAsWebArchiveData):
(WebKit::WebPageProxy::getMainResourceDataOfFrame):
(WebKit::WebPageProxy::getResourceDataFromFrame):
(WebKit::WebPageProxy::getWebArchiveOfFrame):
* UIProcess/WebPageProxy.h:

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::getStatistics):
* UIProcess/WebProcessPool.h:

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

2 years ago[GTK] Unbreak build with GTK+ >=3.20 after r213772
mcatanzaro@igalia.com [Mon, 13 Mar 2017 00:34:38 +0000 (00:34 +0000)]
[GTK] Unbreak build with GTK+ >=3.20 after r213772
https://bugs.webkit.org/show_bug.cgi?id=169533

Patch by Adrian Perez de Castro <aperez@igalia.com> on 2017-03-12
Reviewed by Michael Catanzaro.

* UIProcess/API/gtk/WebKitWebView.cpp:
(webkitWebViewRunFileChooser): Add missing cast.

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

2 years ago[GTK] Unreviewed test gardening
jfernandez@igalia.com [Mon, 13 Mar 2017 00:16:54 +0000 (00:16 +0000)]
[GTK] Unreviewed test gardening
https://bugs.webkit.org/show_bug.cgi?id=169534

Unreviewed GTK+ gardening.

Rebaseline tests:
LayoutTests/imported/w3c:

   - imported/w3c/web-platform-tests/XMLHttpRequest/getresponseheader-case-insensitive.html

* web-platform-tests/XMLHttpRequest/getresponseheader-case-insensitive-expected.txt:

LayoutTests:

   - http/tests/xmlhttprequest/xmlhttprequest-test-custom-headers.html

* platform/gtk/TestExpectations:
   - fast/text/font-selection-font-face-parse.html [ Skip ]
* platform/gtk/http/tests/xmlhttprequest/xmlhttprequest-test-custom-headers-expected.txt:

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

2 years agoREGRESSION (r213764): Async image decoding is disabled for animated images
commit-queue@webkit.org [Sun, 12 Mar 2017 23:52:30 +0000 (23:52 +0000)]
REGRESSION (r213764): Async image decoding is disabled for animated images
https://bugs.webkit.org/show_bug.cgi?id=169529

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2017-03-12
Reviewed by Jon Lee.

The change r213764 causes the animated images to be decoded synchronously
because we were calling frameImageAtIndex() with an empty sizeForDrawing
but with a valid subsamplingLevel. This call is translated to be synchronous
image decoding. The fix is get the current image frame without any decoding.
This is because are sure that in the case of animated image, the current
image frame can not be deleted.

* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::draw):

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

2 years agoStructure::willStoreValueSlow needs to keep the property table alive until the end
fpizlo@apple.com [Sun, 12 Mar 2017 22:56:55 +0000 (22:56 +0000)]
Structure::willStoreValueSlow needs to keep the property table alive until the end
https://bugs.webkit.org/show_bug.cgi?id=169520

Reviewed by Michael Saboff.

We use pointers logically interior to `propertyTable` after doing a GC. We need to prevent the
compiler from optimizing away pointers to `propertyTable`.

* heap/HeapCell.cpp:
(JSC::HeapCell::use):
* heap/HeapCell.h:
(JSC::HeapCell::use): Introduce API for keeping a pointer alive until some point in execution.
* runtime/Structure.cpp:
(JSC::Structure::willStoreValueSlow): Use HeapCell::use() to keep the pointer alive.

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

2 years ago[GTK] File choosers should run as modal by default if possible
commit-queue@webkit.org [Sun, 12 Mar 2017 20:19:04 +0000 (20:19 +0000)]
[GTK] File choosers should run as modal by default if possible
https://bugs.webkit.org/show_bug.cgi?id=169526

Patch by Adrian Perez de Castro <aperez@igalia.com> on 2017-03-12
Reviewed by Michael Catanzaro.

* UIProcess/API/gtk/WebKitWebView.cpp:
(webkitWebViewRunFileChooser): If a top-level window containing the web view is found, call
gtk_native_dialog_set_modal() to configure the dialog accordingly.

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

2 years ago[iOS] Some more -respondsToSelector: checks are unnecessary
mitz@apple.com [Sun, 12 Mar 2017 18:47:35 +0000 (18:47 +0000)]
[iOS] Some more -respondsToSelector: checks are unnecessary
https://bugs.webkit.org/show_bug.cgi?id=169525

Reviewed by Tim Horton.

* Platform/spi/ios/UIKitSPI.h: Moved redeclarations of methods that are declared in the
  Apple internal SDK into the #if !USE(APPLE_INTERNAL_SDK) section.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]): Replaced unnecessary -respondsToSelector:
  check with compile-time check for the deployment target.
(-[WKWebView _computedContentInset]): Ditto.
(activeMinimumLayoutSize): Ditto.
(-[WKWebView safeAreaInsetsDidChange]): Ditto.

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

2 years ago[Readable Streams API] Implement ReadableStreamBYOBRequest respond() (closed stream...
commit-queue@webkit.org [Sun, 12 Mar 2017 17:27:48 +0000 (17:27 +0000)]
[Readable Streams API] Implement ReadableStreamBYOBRequest respond() (closed stream state)
https://bugs.webkit.org/show_bug.cgi?id=168781

Patch by Romain Bellessort <romain.bellessort@crf.canon.fr> on 2017-03-12
Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Updated WPT expectations for readable byte streams tests.

* web-platform-tests/streams/readable-byte-streams/general-expected.txt:
* web-platform-tests/streams/readable-byte-streams/general.dedicatedworker-expected.txt:

Source/WebCore:

Implemented ReadableStreamBYOBRequest respond() method in the case of a closed stream.

Added tests related to respond() method and updated WPT imported tests expectations.

* Modules/streams/ReadableByteStreamInternals.js:
(readableByteStreamControllerRespond): Added.
(readableByteStreamControllerRespondInternal): Added.
(readableByteStreamControllerRespondInClosedState): Added.
(readableByteStreamControllerShiftPendingPullInto): Added.
(readableByteStreamControllerInvalidateBYOBRequest): Added.
(readableByteStreamControllerCommitPullIntoDescriptor): Added.
(readableByteStreamControllerConvertPullIntoDescriptor): Added.
(readableStreamFulfillReadIntoRequest): Added.
* Modules/streams/ReadableStreamBYOBRequest.js:
(respond): Implemented.

LayoutTests:

Added new tests related to ReadableStreamBYOBRequeset respond() method.

* streams/readable-stream-byob-request-expected.txt:
* streams/readable-stream-byob-request.js:

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

2 years agoUnreviewed, suprress warnings in JSC B3
utatane.tea@gmail.com [Sun, 12 Mar 2017 07:54:19 +0000 (07:54 +0000)]
Unreviewed, suprress warnings in JSC B3

* b3/B3Opcode.cpp:

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

2 years agoAllow regular expressions to be used when selecting a process name in JSC config...
msaboff@apple.com [Sun, 12 Mar 2017 06:27:49 +0000 (06:27 +0000)]
Allow regular expressions to be used when selecting a process name in JSC config file
https://bugs.webkit.org/show_bug.cgi?id=169495

Reviewed by Saam Barati.

Only added regular expression selectors for unix like platforms.

* runtime/ConfigFile.cpp:
(JSC::ConfigFileScanner::tryConsumeRegExPattern):
(JSC::ConfigFile::parse):

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

2 years agoFix memory estimate for layers supporting subpixel-antialised text
simon.fraser@apple.com [Sun, 12 Mar 2017 06:21:05 +0000 (06:21 +0000)]
Fix memory estimate for layers supporting subpixel-antialised text
https://bugs.webkit.org/show_bug.cgi?id=169507
rdar://problem/30979337

Reviewed by Alexey Proskuryakov.

Deep color layers on iOS use 5 bytes per pixel, layers supporting subpixel-antialiaed
text on Mac use 8 bytes per pixel.

* platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(PlatformCALayerCocoa::backingStoreBytesPerPixel):

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

2 years agoXMLHttpRequest: make setRequestHeader() use `, ` as separator (including a space)
commit-queue@webkit.org [Sun, 12 Mar 2017 06:07:05 +0000 (06:07 +0000)]
XMLHttpRequest: make setRequestHeader() use `, ` as separator (including a space)
https://bugs.webkit.org/show_bug.cgi?id=169285

Patch by Youenn Fablet <youenn@apple.com> on 2017-03-11
Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

* web-platform-tests/XMLHttpRequest/setrequestheader-case-insensitive.htm:
* web-platform-tests/XMLHttpRequest/setrequestheader-header-allowed.htm:
* web-platform-tests/fetch/api/headers/headers-combine.html:

Source/WebCore:

Covered by updated tests.

* platform/network/HTTPHeaderMap.cpp:
(WebCore::HTTPHeaderMap::add): Reverting back to ', '.

LayoutTests:

* http/tests/xmlhttprequest/check-combining-headers-expected.txt:
* http/tests/xmlhttprequest/check-combining-headers.html:
* http/tests/xmlhttprequest/web-apps/005.html:

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

2 years agoWeb Inspector: Add "goto arrow" to DOMNodeTreeElements in the Debugger tab
mattbaker@apple.com [Sun, 12 Mar 2017 05:02:25 +0000 (05:02 +0000)]
Web Inspector: Add "goto arrow" to DOMNodeTreeElements in the Debugger tab
https://bugs.webkit.org/show_bug.cgi?id=168752

Reviewed by Devin Rousso.

* UserInterface/Base/DOMUtilities.js:
(WebInspector.linkifyNodeReference):
(WebInspector.linkifyNodeReferenceElement):
Expose linkifying an existing element.

* UserInterface/Views/DOMNodeTreeElement.js:
(WebInspector.DOMNodeTreeElement):
(WebInspector.DOMNodeTreeElement.prototype.populateContextMenu):
Add "Reveal in DOM Tree" context menu item.

* UserInterface/Views/DebuggerSidebarPanel.css:
(.sidebar > .panel.navigation.debugger .details-section.dom-breakpoints .item.dom-node:not(:hover, .selected) .status .go-to-arrow):
Hide the go-to arrow unless hovering or selected.

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

2 years agoEnable async image decoding for large images
commit-queue@webkit.org [Sun, 12 Mar 2017 03:00:46 +0000 (03:00 +0000)]
Enable async image decoding for large images
https://bugs.webkit.org/show_bug.cgi?id=165039

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2017-03-11
Reviewed by Simon Fraser.

Source/WebCore:

When BitmapImage::draw() is called for a large image, we are going to request async
image decoding for the native image instead of drawing it. If a lower resolution
native image is available for this, it is going to be drawn. Otherwise nothing will
be drawn. In both cases, a repaint will be scheduled for the image observer. This
should improve the image first time paint and the scrolling scenarios. It also makes
the scrolling more responsive by removing the decoding step from the main thread.

For now we are going to disable the asynchronous image decoding for the webkit test
runner because drawing the image does not block the page rendering anymore. An image
can be repainted later when its frame is ready for painting. This can cause a test
to fail because the webkit test runner may capture an image for the page before painting
all the images. The asynchronous image decoding can to be explicitly enabled from
the test page. Once the specs of the image 'async' attribute and 'ready' event is
approved, this should be revisited. It is important to test what we ship and eventually
async image decoding should be enabled in the webkit test runner.

* loader/cache/CachedImage.h: Change the default of LargeImageAsyncDecoding and AnimatedImageAsyncDecoding
to be false. This change fixes a layout test which creates an CachedImage inside an ImageDocument. The
CachedImage in this case does not have a loader so getting the values of these options from the settings
which is false for the DRT/WTR did not happen.
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::destroyDecodedData): ImageSource::hasDecodingQueue() is renamed to ImageSource::hasAsyncDecodingQueue().
(WebCore::BitmapImage::frameImageAtIndex): Use String::utf8().data() instead of String::characters8().
(WebCore::BitmapImage::draw): If drawing the current frame is called while it is being
decoded, draw the current native image if the current frame was decoded but for a
different size  and and will not invoke decoding while painting. If the frame is being
decoded and there isn't a decoded frame, return without drawing but set a flag that
that this image needs a repaint.
(WebCore::BitmapImage::shouldUseAsyncDecodingForLargeImage): Renaming a function.
(WebCore::BitmapImage::shouldUseAsyncDecodingForAnimatedImage): Ditto.
(WebCore::BitmapImage::internalStartAnimation): Use String::utf8().data() instead of String::characters8().
(WebCore::BitmapImage::advanceAnimation): Ditto.
(WebCore::BitmapImage::internalAdvanceAnimation): Ditto.
(WebCore::BitmapImage::newFrameNativeImageAvailableAtIndex): Now this callback can be
called form the ImageFrameCache when finishing a frame of an animated image or the
frame of a large image. For large images, we need to call CachedImage::changedInRect()
if this image needs a repaint. If the decoding queue is idle, we should close it.
(WebCore::BitmapImage::isLargeImageAsyncDecodingRequired): Deleted. Function was renamed.
(WebCore::BitmapImage::isAnimatedImageAsyncDecodingRequired): Deleted. Ditto.
* platform/graphics/BitmapImage.h:

* platform/graphics/ImageFrameCache.cpp:
(WebCore::ImageFrameCache::~ImageFrameCache): hasDecodingQueue() was renamed to hasAsyncDecodingQueue().
(WebCore::ImageFrameCache::decodingQueue): Change the QNS of the decoding thread to be WorkQueue::QOS::Default.
WorkQueue::QOS::UserInteractive causes the scrolling thread to preempted  which can make the scrolling choppy.
(WebCore::ImageFrameCache::startAsyncDecodingQueue): hasDecodingQueue() was renamed to hasAsyncDecodingQueue().
(WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex): Ditto.
(WebCore::ImageFrameCache::isAsyncDecodingQueueIdle): A helper function to tell whether the decoding thread is idle.
(WebCore::ImageFrameCache::stopAsyncDecodingQueue): hasDecodingQueue() was renamed to hasAsyncDecodingQueue().
* platform/graphics/ImageFrameCache.h:
(WebCore::ImageFrameCache::hasAsyncDecodingQueue): Rename this function to be consistent with the rest of the functions.
(WebCore::ImageFrameCache::hasDecodingQueue): Deleted.

* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::shouldUseAsyncDecoding): Renaming a function. Change the heuristic for large images be
a little bigger than the heuristic for animated images.
(WebCore::ImageSource::isAsyncDecodingRequired): Deleted.
* platform/graphics/ImageSource.h:
(WebCore::ImageSource::hasAsyncDecodingQueue): hasDecodingQueue() was renamed to hasAsyncDecodingQueue().
(WebCore::ImageSource::isAsyncDecodingQueueIdle): A wrapper for ImageFrameCache::isAsyncDecodingQueueIdle().
(WebCore::ImageSource::hasDecodingQueue): Deleted.

* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::ImageDecoder::createFrameImageAtIndex): CGImageSourceCreateThumbnailAtIndex() returns a CGImage with
the image native size regardless of the subsamplingLevel unless kCGImageSourceSubsampleFactor is passed. Here
we are trying to see which size is smaller: the image native size or the sizeForDrawing. If we want a CGImage
with the image native size, sizeForDrawing will not passed. So we need to get the image native size with the
default subsampling and then compare it with sizeForDrawing.

Source/WebKit2:

Add WK2 preferences for setting/getting LargeImageAsyncDecoding and
AnimatedImageAsyncDecoding.

* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetLargeImageAsyncDecodingEnabled):
(WKPreferencesGetLargeImageAsyncDecodingEnabled):
(WKPreferencesSetAnimatedImageAsyncDecodingEnabled):
(WKPreferencesGetAnimatedImageAsyncDecodingEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:

Tools:

Disable LargeImageAsyncDecoding for DRT/WTR.

* DumpRenderTree/mac/DumpRenderTree.mm:
(resetWebPreferencesToConsistentValues):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):

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

2 years agoWeb Inspector: RTL: fix broken font content view
mattbaker@apple.com [Sun, 12 Mar 2017 01:07:32 +0000 (01:07 +0000)]
Web Inspector: RTL: fix broken font content view
https://bugs.webkit.org/show_bug.cgi?id=169513

Reviewed by Brian Burg.

Add RTL support to the Font content view.

* UserInterface/Views/FontResourceContentView.css:
(.content-view.resource.font .preview > .line > .metric):
(body[dir=ltr] .content-view.resource.font .preview > .line > .metric):
(body[dir=rtl] .content-view.resource.font .preview > .line > .metric):
Compensate for the flipped z-order of the content and metric elements in
RTL by pushing metrics below the content.

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

2 years agoWebGPU prototype - Front-End
dino@apple.com [Sat, 11 Mar 2017 23:09:26 +0000 (23:09 +0000)]
WebGPU prototype - Front-End
https://bugs.webkit.org/show_bug.cgi?id=167952

Patch by Jon Lee <jonlee@apple.com> on 2017-03-11
Reviewed by Dean Jackson.

Source/JavaScriptCore:

* runtime/CommonIdentifiers.h: Add WebGPU objects.

Source/WebCore:

This patch adds all of the relevant front-end files, and builds successfully when
ENABLE(WEBGPU) is off. For the back-end components that are not yet
implemented, a stub was added with a FIXME.

* DerivedSources.make: Add all the new IDL files.
* WebCore.xcodeproj/project.pbxproj: New IDL, front-end and generated files.

JS custom bindings.
* bindings/js/JSDocumentCustom.cpp: Add WebGPU clause for getCSSCanvasContext.
* bindings/js/JSHTMLCanvasElementCustom.cpp:
(WebCore::JSHTMLCanvasElement::getContext):
* bindings/js/JSWebGPURenderPassAttachmentDescriptorCustom.cpp: Added.
* bindings/js/JSWebGPURenderingContextCustom.cpp: Added.
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::getContext):
(WebCore::HTMLCanvasElement::isWebGPUType):
(WebCore::HTMLCanvasElement::getContextWebGPU):
(WebCore::HTMLCanvasElement::reset):
(WebCore::HTMLCanvasElement::paint):
(WebCore::HTMLCanvasElement::isGPU):
(WebCore::HTMLCanvasElement::getContextWebGPU): For release builds, switch to ASSERT_UNUSED.
* html/HTMLCanvasElement.h:
* html/canvas/CanvasRenderingContext.h:
(WebCore::CanvasRenderingContext::isGPU):

.cpp, .h, .idl files, wrapped in WEBGPU conditional, and enabled at runtime.
* html/canvas/WebGPUBuffer:
* html/canvas/WebGPUCommandBuffer:
* html/canvas/WebGPUCommandQueue:
* html/canvas/WebGPUDepthStencilDescriptor:
* html/canvas/WebGPUDepthStencilState:
* html/canvas/WebGPUDrawable:
* html/canvas/WebGPUEnums:
* html/canvas/WebGPUFunction:
* html/canvas/WebGPULibrary:
* html/canvas/WebGPUObject (no IDL):
* html/canvas/WebGPURenderCommandEncoder:
* html/canvas/WebGPURenderPassAttachmentDescriptor:
* html/canvas/WebGPURenderPassColorAttachmentDescriptor:
* html/canvas/WebGPURenderPassDepthAttachmentDescriptor:
* html/canvas/WebGPURenderPassDescriptor:
* html/canvas/WebGPURenderPipelineColorAttachmentDescriptor:
* html/canvas/WebGPURenderPipelineDescriptor:
* html/canvas/WebGPURenderPipelineState:
* html/canvas/WebGPURenderingContext:
* html/canvas/WebGPUTexture:
* html/canvas/WebGPUTextureDescriptor:  Add stubs.

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

2 years agoAdd Swift syntax highlighting to webkit.org
jond@apple.com [Sat, 11 Mar 2017 19:59:30 +0000 (19:59 +0000)]
Add Swift syntax highlighting to webkit.org
https://bugs.webkit.org/show_bug.cgi?id=163672

Reviewed by Matt Baker.

* wp-content/plugins/hyperlight/hyperlight/languages/swift.php: Added.

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

2 years agoRollout r213746
achristensen@apple.com [Sat, 11 Mar 2017 18:03:46 +0000 (18:03 +0000)]
Rollout r213746
https://bugs.webkit.org/show_bug.cgi?id=169497

That change broke a bunch of tests in storage/indexeddb.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::NetworkProcess::ensurePrivateBrowsingSession):
* NetworkProcess/RemoteNetworkingContext.h:
* NetworkProcess/mac/RemoteNetworkingContext.mm:
(WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
* NetworkProcess/soup/RemoteNetworkingContextSoup.cpp: Copied from WebKit2/NetworkProcess/soup/RemoteNetworkingContextSoup.cpp.
* PlatformGTK.cmake:

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

2 years agoCleanup "addCookie" and its sole user.
beidson@apple.com [Sat, 11 Mar 2017 16:44:00 +0000 (16:44 +0000)]
Cleanup "addCookie" and its sole user.
https://bugs.webkit.org/show_bug.cgi?id=169486

Reviewed by Brian Burg.

Source/WebCore:

No new tests (Refactor, no behavior change)

* WebCore.xcodeproj/project.pbxproj:

* loader/CookieJar.cpp:
(WebCore::addCookie): Deleted.
* loader/CookieJar.h:

* platform/Cookie.h:
(WebCore::Cookie::Cookie):
(WebCore::CookieHash::hash):
(WebCore::CookieHash::equal):
(WebCore::Cookie::encode):
(WebCore::Cookie::decode):

* platform/CookiesStrategy.h:

* platform/network/NetworkStorageSession.h:

* platform/network/PlatformCookieJar.h:

* platform/network/cf/CookieJarCFNet.cpp:
(WebCore::addCookie): Deleted.

* platform/network/cocoa/CookieCocoa.mm: Copied from Source/WebCore/loader/CookieJar.h.
(WebCore::Cookie::operator NSHTTPCookie *):

* platform/network/cocoa/NetworkStorageSessionCocoa.mm: Copied from Source/WebCore/loader/CookieJar.h.
(WebCore::NetworkStorageSession::setCookies):
(WebCore::NetworkStorageSession::nsCookieStorage):

* platform/network/curl/CookieJarCurl.cpp:
(WebCore::addCookie): Deleted.

* platform/network/mac/CookieJarMac.mm:
(WebCore::deleteCookiesForHostnames):
(WebCore::deleteAllCookiesModifiedSince):
(WebCore::addCookie): Deleted.
(WebCore::cookieStorage): Deleted.

* platform/network/soup/CookieJarSoup.cpp:
(WebCore::toSoupCookie): Deleted.
(WebCore::addCookie): Deleted.

* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::toSoupCookie):
(WebCore::NetworkStorageSession::setCookies):

Source/WebKit/mac:

* WebCoreSupport/WebPlatformStrategies.h:
* WebCoreSupport/WebPlatformStrategies.mm:
(WebPlatformStrategies::addCookie): Deleted.

Source/WebKit2:

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::addCookie): Deleted.
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<Cookie>::encode): Deleted.
(IPC::ArgumentCoder<Cookie>::decode): Deleted.
* Shared/WebCoreArgumentCoders.h:

* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::addSingleCookie):

* UIProcess/WebCookieManagerProxy.cpp:
(WebKit::WebCookieManagerProxy::setCookies):
(WebKit::WebCookieManagerProxy::addCookie): Deleted.
* UIProcess/WebCookieManagerProxy.h:

* WebProcess/Cookies/WebCookieManager.cpp:
(WebKit::WebCookieManager::setCookies):
(WebKit::WebCookieManager::addCookie): Deleted.
* WebProcess/Cookies/WebCookieManager.h:
* WebProcess/Cookies/WebCookieManager.messages.in:

* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::addCookie): Deleted.
* WebProcess/WebCoreSupport/WebPlatformStrategies.h:

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

2 years agoREGRESSION(r213645): It made JSC tests super slow and timeout on AArch64 Linux
ossy@webkit.org [Sat, 11 Mar 2017 13:57:13 +0000 (13:57 +0000)]
REGRESSION(r213645): It made JSC tests super slow and timeout on AArch64 Linux
https://bugs.webkit.org/show_bug.cgi?id=169510

Unreviewed, disable LL_SC on Linux to unbreak this platform.

* wtf/Atomics.h:
* wtf/Platform.h:

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

2 years agoThe JITs should be able to emit fast TLS loads
fpizlo@apple.com [Sat, 11 Mar 2017 07:17:48 +0000 (07:17 +0000)]
The JITs should be able to emit fast TLS loads
https://bugs.webkit.org/show_bug.cgi?id=169483

Reviewed by Keith Miller.

Source/JavaScriptCore:

Added loadFromTLS32/64/Ptr to the MacroAssembler and added a B3 test for this.

* assembler/ARM64Assembler.h:
(JSC::ARM64Assembler::mrs_TPIDRRO_EL0):
* assembler/MacroAssembler.h:
(JSC::MacroAssembler::loadFromTLSPtr):
* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::loadFromTLS32):
(JSC::MacroAssemblerARM64::loadFromTLS64):
* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::loadFromTLS32):
* assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::loadFromTLS64):
* assembler/X86Assembler.h:
(JSC::X86Assembler::adcl_im):
(JSC::X86Assembler::addl_mr):
(JSC::X86Assembler::addl_im):
(JSC::X86Assembler::andl_im):
(JSC::X86Assembler::orl_im):
(JSC::X86Assembler::orl_rm):
(JSC::X86Assembler::subl_im):
(JSC::X86Assembler::cmpb_im):
(JSC::X86Assembler::cmpl_rm):
(JSC::X86Assembler::cmpl_im):
(JSC::X86Assembler::testb_im):
(JSC::X86Assembler::movb_i8m):
(JSC::X86Assembler::movb_rm):
(JSC::X86Assembler::movl_mr):
(JSC::X86Assembler::movq_mr):
(JSC::X86Assembler::movsxd_rr):
(JSC::X86Assembler::gs):
(JSC::X86Assembler::X86InstructionFormatter::SingleInstructionBufferWriter::memoryModRM):
* b3/testb3.cpp:
(JSC::B3::testFastTLS):
(JSC::B3::run):

Source/WTF:

Consolidated what we know about fast TLS in FastTLS.h.

* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/FastTLS.h: Added.
(WTF::loadFastTLS):
(WTF::fastTLSOffsetForKey):
* wtf/Platform.h:
* wtf/WTFThreadData.cpp:
(WTF::WTFThreadData::createAndRegisterForGetspecificDirect):
* wtf/WTFThreadData.h:
(WTF::wtfThreadData):

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

2 years agoFix watch and tv builds after r213294
achristensen@apple.com [Sat, 11 Mar 2017 06:56:12 +0000 (06:56 +0000)]
Fix watch and tv builds after r213294
https://bugs.webkit.org/show_bug.cgi?id=169508

Reviewed by Dan Bernstein.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

2 years agocheckpatchrelevance: Exception message is printed twice due to ScriptError handler
commit-queue@webkit.org [Sat, 11 Mar 2017 06:02:07 +0000 (06:02 +0000)]
checkpatchrelevance: Exception message is printed twice due to ScriptError handler
https://bugs.webkit.org/show_bug.cgi?id=169496

Unreviewed fix.

Patch by Srinivasan Vijayaraghavan <svijayaraghavan@apple.com> on 2017-03-10

* Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py: Add --quiet flag to expected logs.

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

2 years agocheckpatchrelevance: Exception message is printed twice due to ScriptError handler
commit-queue@webkit.org [Sat, 11 Mar 2017 04:30:46 +0000 (04:30 +0000)]
checkpatchrelevance: Exception message is printed twice due to ScriptError handler
https://bugs.webkit.org/show_bug.cgi?id=169496

Patch by Srinivasan Vijayaraghavan <svijayaraghavan@apple.com> on 2017-03-10
Reviewed by Alexey Proskuryakov.

* Scripts/webkitpy/tool/bot/patchanalysistask.py:
(PatchAnalysisTask._check_patch_relevance): Pass --quiet flag.
* Scripts/webkitpy/tool/steps/checkpatchrelevance.py:
(CheckPatchRelevance.options): Accept options.quiet to prevent duplicate output to stdout.

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

2 years agoPercentage constrained images shrinking inside blocks inside nested flex boxes
hyatt@apple.com [Sat, 11 Mar 2017 03:30:05 +0000 (03:30 +0000)]
Percentage constrained images shrinking inside blocks inside nested flex boxes
https://bugs.webkit.org/show_bug.cgi?id=169438

Reviewed by Dean Jackson.

Source/WebCore:

Added new test in fast/hidpi.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computeChildPreferredLogicalWidths):
Make sure to clear out flexbox override sizes when computing preferred logical widths,
since they should not ever influence the preferred size.

LayoutTests:

* fast/hidpi/percent-height-image-nested-expected.html: Added.
* fast/hidpi/percent-height-image-nested.html: Added.
* fast/hidpi/resources/pic.jpg: Added.

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

2 years agoAdd SPI to set NSURLSessionConfiguration.allowsCellularAccess from _WKProcessPoolConf...
achristensen@apple.com [Sat, 11 Mar 2017 03:24:30 +0000 (03:24 +0000)]
Add SPI to set NSURLSessionConfiguration.allowsCellularAccess from _WKProcessPoolConfiguration
https://bugs.webkit.org/show_bug.cgi?id=169500
<rdar://problem/29599569>

Reviewed by Joseph Pecoraro.

* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
* NetworkProcess/cocoa/NetworkSessionCocoa.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::globalAllowsCellularAccess):
(WebKit::NetworkSessionCocoa::setAllowsCellularAccess):
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration allowsCellularAccess]):
(-[_WKProcessPoolConfiguration setAllowsCellularAccess:]):

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

2 years agoDon't compile RemoteNetworkingContext when using NetworkSession
achristensen@apple.com [Sat, 11 Mar 2017 02:12:54 +0000 (02:12 +0000)]
Don't compile RemoteNetworkingContext when using NetworkSession
https://bugs.webkit.org/show_bug.cgi?id=169497

Reviewed by Andy Estes.

RemoteNetworkingContext is only really used because PingHandle requires a NetworkingContext.
When using NetworkSession, we use PingLoad instead of PingHandle, so there's no reason to
ensure there's a RemoteNetworkingContext corresponding to new private sessions when they're never used.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::NetworkProcess::ensurePrivateBrowsingSession):
* NetworkProcess/RemoteNetworkingContext.h:
* NetworkProcess/mac/RemoteNetworkingContext.mm:
(WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
* NetworkProcess/soup/RemoteNetworkingContextSoup.cpp: Removed.
* PlatformGTK.cmake:
GTK only uses NetworkSession, so RemoteNetworkingContextSoup is no longer necessary.

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

2 years agoWebAssembly: Make more demos run
sbarati@apple.com [Sat, 11 Mar 2017 02:04:37 +0000 (02:04 +0000)]
WebAssembly: Make more demos run
https://bugs.webkit.org/show_bug.cgi?id=165510
<rdar://problem/29760310>

Reviewed by Keith Miller.

JSTests:

* wasm/Builder.js:
(export.default.Builder.prototype._registerSectionBuilders.const.section.in.WASM.description.section.switch.section.case.string_appeared_here.this.section):
* wasm/js-api/wrapper-function.js: Added.
(exportImport):
(return.new.WebAssembly.Module):
(assert.throws.makeInstance):
(assert.throws.Bar):
(assert.throws):

Source/JavaScriptCore:

This patch makes another Wasm demo run:
https://kripken.github.io/BananaBread/cube2/bb.html

This patch fixes two bugs:
1. When WebAssemblyFunctionType was added, we did not properly
update the last JS type value.
2. Our code for our JS -> Wasm entrypoint was wrong. It lead to bad
code generation where we would emit B3 that would write over r12
and rbx (on x86) which is invalid since those are our pinned registers.
This patch just rewrites the entrypoint to use hand written assembler
code. I was planning on doing this anyways because it's a compile
time speed boost.

Also, this patch adds support for some new API features:
We can now export an import, either via a direct export, or via a Table and the
Element section. I've added a new class called WebAssemblyWrapperFunction that
just wraps over a JSObject that is a function. Wrapper functions have types
associated with them, so if they're re-imported, or called via call_indirect,
they can be type checked.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::webAssemblyWrapperFunctionStructure):
* runtime/JSType.h:
* wasm/JSWebAssemblyCodeBlock.h:
(JSC::JSWebAssemblyCodeBlock::wasmToJsCallStubForImport):
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::createJSToWasmWrapper):
* wasm/WasmCallingConvention.h:
(JSC::Wasm::CallingConvention::headerSizeInBytes):
* wasm/js/JSWebAssemblyHelpers.h:
(JSC::isWebAssemblyHostFunction):
* wasm/js/JSWebAssemblyInstance.cpp:
(JSC::JSWebAssemblyInstance::JSWebAssemblyInstance):
* wasm/js/JSWebAssemblyInstance.h:
(JSC::JSWebAssemblyInstance::importFunction):
(JSC::JSWebAssemblyInstance::importFunctions):
(JSC::JSWebAssemblyInstance::setImportFunction):
* wasm/js/JSWebAssemblyTable.cpp:
(JSC::JSWebAssemblyTable::JSWebAssemblyTable):
(JSC::JSWebAssemblyTable::grow):
(JSC::JSWebAssemblyTable::clearFunction):
(JSC::JSWebAssemblyTable::setFunction):
* wasm/js/JSWebAssemblyTable.h:
(JSC::JSWebAssemblyTable::getFunction):
* wasm/js/WebAssemblyFunction.cpp:
(JSC::callWebAssemblyFunction):
* wasm/js/WebAssemblyInstanceConstructor.cpp:
(JSC::WebAssemblyInstanceConstructor::createInstance):
* wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::WebAssemblyModuleRecord::link):
(JSC::WebAssemblyModuleRecord::evaluate):
* wasm/js/WebAssemblyModuleRecord.h:
* wasm/js/WebAssemblyTablePrototype.cpp:
(JSC::webAssemblyTableProtoFuncGet):
(JSC::webAssemblyTableProtoFuncSet):
* wasm/js/WebAssemblyWrapperFunction.cpp: Added.
(JSC::callWebAssemblyWrapperFunction):
(JSC::WebAssemblyWrapperFunction::WebAssemblyWrapperFunction):
(JSC::WebAssemblyWrapperFunction::create):
(JSC::WebAssemblyWrapperFunction::finishCreation):
(JSC::WebAssemblyWrapperFunction::createStructure):
(JSC::WebAssemblyWrapperFunction::visitChildren):
* wasm/js/WebAssemblyWrapperFunction.h: Added.
(JSC::WebAssemblyWrapperFunction::signatureIndex):
(JSC::WebAssemblyWrapperFunction::wasmEntrypoint):
(JSC::WebAssemblyWrapperFunction::function):

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

2 years agoWeb Inspector: Only show "Break on..." menu if backend supports DOM breakpoints
mattbaker@apple.com [Sat, 11 Mar 2017 01:56:08 +0000 (01:56 +0000)]
Web Inspector: Only show "Break on..." menu if backend supports DOM breakpoints
https://bugs.webkit.org/show_bug.cgi?id=169488

Reviewed by Joseph Pecoraro.

* UserInterface/Controllers/DOMBreakpointTreeController.js:
(WebInspector.DOMBreakpointTreeController.appendBreakpointContextMenuItems):
Added assert to catch future cases where UI is being added when
backend support doesn't exist.

* UserInterface/Views/DOMTreeElement.js:
(WebInspector.DOMTreeElement.prototype._populateNodeContextMenu):
Check for backend support.

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

2 years agoTurn ENABLE(MASM_PROBE) on by default for OS(DARWIN) release builds.
mark.lam@apple.com [Sat, 11 Mar 2017 01:39:44 +0000 (01:39 +0000)]
Turn ENABLE(MASM_PROBE) on by default for OS(DARWIN) release builds.
https://bugs.webkit.org/show_bug.cgi?id=169493

Reviewed by Saam Barati.

MASM_PROBE was already enabled for debug builds.  This change makes it so that we
don't have to rebuild the world every time we need to use it on a release build.

* wtf/Platform.h:

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

2 years agoJSC: BindingNode::bindValue doesn't increase the scope's reference count.
mark.lam@apple.com [Sat, 11 Mar 2017 01:38:22 +0000 (01:38 +0000)]
JSC: BindingNode::bindValue doesn't increase the scope's reference count.
https://bugs.webkit.org/show_bug.cgi?id=168546
<rdar://problem/30589551>

Reviewed by Saam Barati.

JSTests:

* stress/regress-168546.js: Added.

Source/JavaScriptCore:

We should protect the scope RegisterID with a RefPtr while it is still needed.

* bytecompiler/NodesCodegen.cpp:
(JSC::ForInNode::emitLoopHeader):
(JSC::ForOfNode::emitBytecode):
(JSC::BindingNode::bindValue):

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

2 years agoAdd new EWS queues to bot watcher's dashboard.
ryanhaddad@apple.com [Sat, 11 Mar 2017 01:13:46 +0000 (01:13 +0000)]
Add new EWS queues to bot watcher's dashboard.
https://bugs.webkit.org/show_bug.cgi?id=169485

Reviewed by Alexey Proskuryakov.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BubbleQueueServer.js:
(BubbleQueueServer): Add Bindings and JSC EWS queues.

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

2 years agoSwitch back to the Twitter API for the Tweet widget
jond@apple.com [Sat, 11 Mar 2017 01:01:19 +0000 (01:01 +0000)]
Switch back to the Twitter API for the Tweet widget
https://bugs.webkit.org/show_bug.cgi?id=168749

Reviewed by Lucas Forschler.

Updates the Twitter widget tile implementation to prefer the Twitter API to populate tweets
displayed through the widget. If the API fails for any reason, it falls back to using the
Tweet listener for updated tweets.

The Twitter API provides the benefit of embedding media and being able to display the full
URLs rather than Twitter-shortened URLs.

* wp-content/plugins/tweet-listener.php:
* wp-content/themes/webkit/style.css:
(.twitter-tile .tile-content):
(.twitter-tile.text-only):
(.twitter-tile .media):
(.twitter-tile img):
* wp-content/themes/webkit/widgets/twitter.php:

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

2 years agoWeb Inspector: popover with compositing reasons in Layers sidebar has hard to read...
commit-queue@webkit.org [Sat, 11 Mar 2017 00:59:39 +0000 (00:59 +0000)]
Web Inspector: popover with compositing reasons in Layers sidebar has hard to read layout
https://bugs.webkit.org/show_bug.cgi?id=167081

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2017-03-10
Reviewed by Brian Burg.

* UserInterface/Views/LayerTreeDetailsSidebarPanel.css:
(.layer-tree-popover):
(.layer-tree-popover p):
(.layer-tree-popover ul):
(body[dir=ltr] .layer-tree-popover ul):
(body[dir=rtl] .layer-tree-popover ul):
Show `list-item-style` and make the <p> element stand out more (larger and bold).

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

2 years agoWeb Inspector: in Resources tab navigation bar, can't save the same file from context...
commit-queue@webkit.org [Sat, 11 Mar 2017 00:59:24 +0000 (00:59 +0000)]
Web Inspector: in Resources tab navigation bar, can't save the same file from context menu item more than once
https://bugs.webkit.org/show_bug.cgi?id=165665

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2017-03-10
Reviewed by Brian Burg.

* UserInterface/Views/ContextMenuUtilities.js:
(WebInspector.appendContextMenuItemsForSourceCode):
Force the "Save As" dialog to appear when saving, as otherwise subsequent clicks on "Save"
in the context menu will just override the previously saved file.

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

2 years ago[Win] Re-export a few symbols for backwards compatibility
bfulgham@apple.com [Sat, 11 Mar 2017 00:58:42 +0000 (00:58 +0000)]
[Win] Re-export a few symbols for backwards compatibility
https://bugs.webkit.org/show_bug.cgi?id=169490
<rdar://problem/30983623>

Reviewed by Dean Jackson.

Re-introduce a workaround that re-exports a few JavaScriptCore functions
that had been erroneously exported by WebKit in older builds. This
is needed so that we do not break certain old software still being used.

* WebKitDLL.cpp:
(DllMain): Bind functions at startup.
(bindJavaScriptTrampoline): Find JavaScriptCore library functions and
re-export them from WebKit.dll.
* WebKitDLL.h: Only advertise these functions when building WebKt itself.

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

2 years agoMove libwebrtc backend to using tracks
commit-queue@webkit.org [Sat, 11 Mar 2017 00:46:44 +0000 (00:46 +0000)]
Move libwebrtc backend to using tracks
https://bugs.webkit.org/show_bug.cgi?id=169472

Patch by Youenn Fablet <youenn@apple.com> on 2017-03-10
Reviewed by Alex Christensen.

Source/ThirdParty/libwebrtc:

* Source/webrtc/pc/rtcstatscollector.cc: Moving from using media stream to tracks.

Source/WebCore:

Covered by current test sets.

This change allows to move away from streams and use more tracks.
This allows future better alignment with the spec and better implementation of sender/receover/transceiver.

Small refactoring to use more Ref<> in WebRTC track-based code.
Added a notifyAddedTrack to notify the backend that a track was added.
For libwebrtc, this allows calling AddTrack before making the offer.
Updated mock libwebrtc backend accordingly.

* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::replaceTrack):
(WebCore::MediaEndpointPeerConnection::replaceTrackTask):
* Modules/mediastream/MediaEndpointPeerConnection.h:
* Modules/mediastream/PeerConnectionBackend.h:
(WebCore::PeerConnectionBackend::notifyAddedTrack):
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::addTrack):
(WebCore::RTCPeerConnection::replaceTrack):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCRtpSender.cpp:
(WebCore::RTCRtpSender::create):
(WebCore::RTCRtpSender::RTCRtpSender):
(WebCore::RTCRtpSender::setTrack):
* Modules/mediastream/RTCRtpSender.h:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::addTrack):
(WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
(WebCore::LibWebRTCMediaEndpoint::doCreateAnswer):
(WebCore::LibWebRTCMediaEndpoint::getStats):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::doAddIceCandidate):
(WebCore::LibWebRTCPeerConnectionBackend::notifyAddedTrack):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
* testing/MockLibWebRTCPeerConnection.cpp:
(WebCore::MockLibWebRTCPeerConnection::AddTrack):
(WebCore::MockLibWebRTCPeerConnection::RemoveTrack):
(WebCore::MockLibWebRTCPeerConnection::CreateOffer):
(WebCore::MockLibWebRTCPeerConnection::CreateAnswer):
* testing/MockLibWebRTCPeerConnection.h:
(WebCore::MockRtpSender::MockRtpSender):
(WebCore::MockRtpSender::ssrc):
(WebCore::MockRtpSender::media_type):
(WebCore::MockRtpSender::id):
(WebCore::MockRtpSender::stream_ids):
(WebCore::MockRtpSender::GetParameters):
(WebCore::MockRtpSender::SetParameters):
(WebCore::MockRtpSender::GetDtmfSender):

LayoutTests:

* TestExpectations:

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

2 years agoMark compositing/regions/transformed-layer-inside-transformed-layer.html as failing...
ryanhaddad@apple.com [Sat, 11 Mar 2017 00:46:00 +0000 (00:46 +0000)]
Mark compositing/regions/transformed-layer-inside-transformed-layer.html as failing on ios-simulator.
https://bugs.webkit.org/show_bug.cgi?id=169457

Unreviewed test gardening.

* platform/ios-simulator-wk1/TestExpectations:
* platform/ios-simulator/TestExpectations:

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

2 years agoWeb Inspector: REGRESSION(r213149): scope bar items in elements sidebar have wrong...
commit-queue@webkit.org [Sat, 11 Mar 2017 00:45:39 +0000 (00:45 +0000)]
Web Inspector: REGRESSION(r213149): scope bar items in elements sidebar have wrong padding/margin
https://bugs.webkit.org/show_bug.cgi?id=169204

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2017-03-10
Reviewed by Brian Burg.

* UserInterface/Views/Sidebar.css:
(.sidebar > .navigation-bar):
Replace `align-content` with `align-items`, as the former causes the child elements to fill
as much vertical space as possible instead of only using the space necessary for its content.

* UserInterface/Views/ScopeRadioButtonNavigationItem.css:
(.scope-radio-button-navigation-item > .arrows):
Drive-by fix: ensure that the up/down arrows are not clickable, which would prevent the
<select> from showing.

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

2 years agoSimple line layout: Check how many orphans needed on the current page before breaking.
zalan@apple.com [Sat, 11 Mar 2017 00:33:18 +0000 (00:33 +0000)]
Simple line layout: Check how many orphans needed on the current page before breaking.
https://bugs.webkit.org/show_bug.cgi?id=169477

Reviewed by Antti Koivisto.

Source/WebCore:

Before breaking for the widows we actually need to check for orphans first.

Test: fast/multicol/simple-line-layout-orphans-and-widows.html

* rendering/SimpleLineLayoutPagination.cpp:
(WebCore::SimpleLineLayout::computeLineBreakIndex):
(WebCore::SimpleLineLayout::adjustLinePositionsForPagination):

LayoutTests:

* fast/multicol/simple-line-layout-orphans-and-widows-expected.html: Added.
* fast/multicol/simple-line-layout-orphans-and-widows.html: Added.

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

2 years agoCleaned up merge markers inadvertently left in the file.
msaboff@apple.com [Fri, 10 Mar 2017 23:47:42 +0000 (23:47 +0000)]
Cleaned up merge markers inadvertently left in the file.

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

2 years agoWebGPU: Backend - Textures and TextureDescriptors
dino@apple.com [Fri, 10 Mar 2017 22:56:06 +0000 (22:56 +0000)]
WebGPU: Backend - Textures and TextureDescriptors
https://bugs.webkit.org/show_bug.cgi?id=169365
<rdar://problem/30928716>

Reviewed by Jon Lee with help from Anders Carlsson.

Backend implementation of textures for WebGPU, which adds
the GPUTexture and GPUTextureDescriptor classes, as well
as a creation method on GPUDevice.

* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/cocoa/GPUTextureDescriptorMetal.mm: Added.
(WebCore::GPUTextureDescriptor::GPUTextureDescriptor):
(WebCore::GPUTextureDescriptor::width):
(WebCore::GPUTextureDescriptor::setWidth):
(WebCore::GPUTextureDescriptor::height):
(WebCore::GPUTextureDescriptor::setHeight):
(WebCore::GPUTextureDescriptor::sampleCount):
(WebCore::GPUTextureDescriptor::setSampleCount):
(WebCore::GPUTextureDescriptor::textureType):
(WebCore::GPUTextureDescriptor::setTextureType):
(WebCore::GPUTextureDescriptor::storageMode):
(WebCore::GPUTextureDescriptor::setStorageMode):
(WebCore::GPUTextureDescriptor::usage):
(WebCore::GPUTextureDescriptor::setUsage):
(WebCore::GPUTextureDescriptor::platformTextureDescriptor):
* platform/graphics/cocoa/GPUTextureMetal.mm:
(WebCore::GPUTexture::GPUTexture):
(WebCore::GPUTexture::width):
(WebCore::GPUTexture::height):
(WebCore::GPUTexture::platformTexture):
* platform/graphics/gpu/GPUDevice.cpp:
(WebCore::GPUDevice::createTexture):
* platform/graphics/gpu/GPUDevice.h:
* platform/graphics/gpu/GPUTexture.cpp:
(WebCore::GPUTexture::create):
(WebCore::GPUTexture::createFromExistingTexture):
(WebCore::GPUTexture::~GPUTexture):
(WebCore::GPUTexture::width):
(WebCore::GPUTexture::height):
* platform/graphics/gpu/GPUTexture.h:
* platform/graphics/gpu/GPUTextureDescriptor.cpp:
(WebCore::GPUTextureDescriptor::create):
(WebCore::GPUTextureDescriptor::~GPUTextureDescriptor):
(WebCore::GPUTextureDescriptor::width):
(WebCore::GPUTextureDescriptor::setWidth):
(WebCore::GPUTextureDescriptor::height):
(WebCore::GPUTextureDescriptor::setHeight):
(WebCore::GPUTextureDescriptor::sampleCount):
(WebCore::GPUTextureDescriptor::setSampleCount):
(WebCore::GPUTextureDescriptor::textureType):
(WebCore::GPUTextureDescriptor::setTextureType):
(WebCore::GPUTextureDescriptor::storageMode):
(WebCore::GPUTextureDescriptor::setStorageMode):
(WebCore::GPUTextureDescriptor::usage):
(WebCore::GPUTextureDescriptor::setUsage):
* platform/graphics/gpu/GPUTextureDescriptor.h:

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

2 years agoSkip an API test that isn't expected to pass on iOS 10.
aestes@apple.com [Fri, 10 Mar 2017 22:43:01 +0000 (22:43 +0000)]
Skip an API test that isn't expected to pass on iOS 10.

* TestWebKitAPI/Tests/WebKit2Cocoa/QuickLook.mm:

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

2 years agoMark webrtc/libwebrtc/descriptionGetters.html as a flaky.
ryanhaddad@apple.com [Fri, 10 Mar 2017 22:22:09 +0000 (22:22 +0000)]
Mark webrtc/libwebrtc/descriptionGetters.html as a flaky.
https://bugs.webkit.org/show_bug.cgi?id=169481

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

2 years ago[WebRTC][WK2][iOS] Support com.apple.coremedia.compressionsession for more WebRTC...
bfulgham@apple.com [Fri, 10 Mar 2017 20:54:52 +0000 (20:54 +0000)]
[WebRTC][WK2][iOS] Support com.apple.coremedia.compressionsession for more WebRTC Cases
https://bugs.webkit.org/show_bug.cgi?id=169480
<rdar://problem/30978577>

Reviewed by Youenn Fablet.

Always allow 'com.apple.coremedia.compressionsession' since it is also needed when sending
canvas data across a peer connection.

* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

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

2 years ago[Win] Scrollbars buttons have incorrect size in HiDPI.
pvollan@apple.com [Fri, 10 Mar 2017 20:25:40 +0000 (20:25 +0000)]
[Win] Scrollbars buttons have incorrect size in HiDPI.
https://bugs.webkit.org/show_bug.cgi?id=169463

Reviewed by Alex Christensen.

There seems to be a bug in DrawThemeBackground when the device context is scaled.
We can work around this by scaling the drawing rectangle instead.

* platform/win/ScrollbarThemeWin.cpp:
(WebCore::ScrollbarThemeWin::paintButton):

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

2 years agoAdd bindings-ews to queue status server
commit-queue@webkit.org [Fri, 10 Mar 2017 20:17:59 +0000 (20:17 +0000)]
Add bindings-ews to queue status server
https://bugs.webkit.org/show_bug.cgi?id=169307

Patch by Srinivasan Vijayaraghavan <svijayaraghavan@apple.com> on 2017-03-10
Reviewed by Alexey Proskuryakov.

* QueueStatusServer/config/queues.py: Add "bindings-ews" to the list of ewses.

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

2 years ago[QuickLook] Add WKNavigationDelegate SPI to notify when a password is requested
aestes@apple.com [Fri, 10 Mar 2017 20:07:03 +0000 (20:07 +0000)]
[QuickLook] Add WKNavigationDelegate SPI to notify when a password is requested
https://bugs.webkit.org/show_bug.cgi?id=169459
<rdar://problem/30621913>

Reviewed by Alex Christensen.

Source/WebKit2:

* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::setNavigationDelegate):
(WebKit::NavigationState::didRequestPasswordForQuickLookDocument):
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::requestPasswordForQuickLookDocument):

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/QuickLook.mm:
(runTest):
(TEST):
(-[QuickLookPasswordNavigationDelegate _webViewDidRequestPasswordForQuickLookDocument:]):

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

2 years agoFix CMake build.
achristensen@apple.com [Fri, 10 Mar 2017 19:45:58 +0000 (19:45 +0000)]
Fix CMake build.

Source/JavaScriptCore:

* CMakeLists.txt:
Make more forwarding headers so we can find WasmFaultSignalHandler.h from WebProcess.cpp.

Source/WebKit/mac:

* WebView/WebNotification.h:
Don't assume we have already included something that includes NSObject.h.

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

2 years agoSimple line layout: Oprhan lines with visual overflow does not work properly.
zalan@apple.com [Fri, 10 Mar 2017 19:36:37 +0000 (19:36 +0000)]
Simple line layout: Oprhan lines with visual overflow does not work properly.
https://bugs.webkit.org/show_bug.cgi?id=169409

Reviewed by Antti Koivisto.

Source/WebCore:

Add visual overflow checking for block strut. This logic is copied from RenderBlockFlow::adjustLinePositionForPagination.

Covered by existing test.

* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::computeOverflow):
* rendering/SimpleLineLayoutFunctions.h:
* rendering/SimpleLineLayoutPagination.cpp:
(WebCore::SimpleLineLayout::setPageBreakForLine):

LayoutTests:

* TestExpectations:

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

2 years agoAdd support for Bindings EWS
commit-queue@webkit.org [Fri, 10 Mar 2017 19:24:47 +0000 (19:24 +0000)]
Add support for Bindings EWS
https://bugs.webkit.org/show_bug.cgi?id=169308

Patch by Srinivasan Vijayaraghavan <svijayaraghavan@apple.com> on 2017-03-10
Reviewed by Alexey Proskuryakov.

* Scripts/webkitpy/common/config/ews.json: Add bindings-ews. Can test without building; should_build = False.
* Scripts/webkitpy/common/net/bindingstestresults.py:
(BindingsTestResults.__init__): Removed 'errors'.
(BindingsTestResults.results_from_string): Ditto.
(BindingsTestResults.is_subset): Ditto.
(BindingsTestResults.equals): Ditto.
(BindingsTestResults.all_passed): Ditto.
(BindingsTestResults.failing_tests): Ditto.
* Scripts/webkitpy/common/net/bindingstestresults_unittest.py:
(BindingsTestResultsTest.test_results_from_string): Removed 'errors'.
(BindingsTestResultsTest.test_results_from_string_success): Removed 'errors'.
* Scripts/webkitpy/tool/bot/earlywarningsystemtask.py:
(EarlyWarningSystemTask.__init__): Add should_build parameter.
(EarlyWarningSystemTask.run): Check should_build before calling self._build().
* Scripts/webkitpy/tool/bot/retrylogic_unittest.py: Renamed from Tools/Scripts/webkitpy/tool/bot/jscews_unittest.py.
(MockBindingsEarlyWarningSystem): Based of MockJSCEarlyWarningSystem. Mocked so we can provide test results.
(MockBindingsEarlyWarningSystem.__init__): Sets attributes.
(MockBindingsEarlyWarningSystem.test_results): Returns test results provided by us, instead of JSON output.
(BindingsEarlyWarningSystemTest): Class to test retry logic in below situations.
(BindingsEarlyWarningSystemTest._results_indicate_all_passed): False if None or or has failures, else True.
(BindingsEarlyWarningSystemTest._create_task):
(BindingsEarlyWarningSystemTest.test_success_case): Clean patch on clean tree.
(BindingsEarlyWarningSystemTest.test_test_failure): Red patch on clean tree.
(BindingsEarlyWarningSystemTest.test_fix): Clean patch on red tree.
(BindingsEarlyWarningSystemTest.test_ineffective_patch): Red patch on red tree.
(BindingsEarlyWarningSystemTest.test_partially_effective_patch): Red patch on redder tree.
(BindingsEarlyWarningSystemTest.test_different_test_failures_in_patch_and_tree): Red patch on red tree.
* Scripts/webkitpy/tool/bot/patchanalysistask.py:
(PatchAnalysisTask._build_and_test_without_patch): Don't build if should_build is False (eg. on Bindings EWS).
(PatchAnalysisTask._retry_bindings_tests): Retry logic for Bindings tests.
(PatchAnalysisTask._test_patch): If tests failed on Bindings EWS, and call _retry_bindings_tests.
* Scripts/webkitpy/tool/commands/earlywarningsystem.py:
(AbstractEarlyWarningSystem.begin_work_queue): Use BindingsTestResultsReader on Bindings EWS.
(AbstractEarlyWarningSystem._create_task): Pass should_build argument.
(AbstractEarlyWarningSystem.load_ews_classes): Add should_build argument (True by default).
* Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py:
(TestBindingsEWS): Bindings EWS class, derived from AbstractEarlyWarningSystem.
(AbstractEarlyWarningSystemTest.test_failing_bindings_tests_message): Unit test message posted to Bugzilla.
(EarlyWarningSystemTest._default_expected_logs): Not building on all ewses anymore; make build line optional.
(EarlyWarningSystemTest.test_ews_name): Add bindings-ews.
* Scripts/webkitpy/tool/steps/checkpatchrelevance.py:
(CheckPatchRelevance): Add bindings paths.
(CheckPatchRelevance._changes_are_relevant): Cleaner way to check if we should perform this step.
* Scripts/webkitpy/tool/steps/steps_unittest.py: Add unit tests for Bindings EWS patch relevance.
(test_patch_relevant_bindings): Test for patch relevant to bindings.
(test_patch_not_relevant_bindings): Test for patch not relevant to bindings.

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

2 years ago[iOS WK2] Layer content blurry with nested perspective and transforms
simon.fraser@apple.com [Fri, 10 Mar 2017 19:07:13 +0000 (19:07 +0000)]
[iOS WK2] Layer content blurry with nested perspective and transforms
https://bugs.webkit.org/show_bug.cgi?id=169457
Source/WebCore:

rdar://problem/29879484

Reviewed by Tim Horton.

We set rasterizationScale on CALayers to the same values as contentsScale, to
avoid blurry layers when CA rasterizes, which often happens with nested perspective
transforms.

However, in UI-side compositing, if the page is not zoomed, we never applied the
rasterizationScale in the UI process. This happened because the PlatformCALayerRemote
constructor set m_properties.contentsScale, but did not set the dirty bit that
triggers the application of contentsScale and rasterizationScale in RemoteLayerTreePropertyApplier.
The fix is to set this dirty bit.

The rest of the changes are for testing. Internals now exposes layerIDForElement()
for returns an internal (non-stable-across-loads) layerID, which can be passed
to UIScriptController.propertiesOfLayerWithID() in the UI process, which inspects
the built layer (UIView) hierarchy. propertiesOfLayerWithID() returns a dictionary
which the test can dump as JSON, or pull values out of.

A few #pragma once cleanups also.

Tests: compositing/ios/basic-layer-properties.html
       compositing/ios/rasterization-scale.html

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

Source/WebKit2:

rdar://problem/29879484

Reviewed by Tim Horton.

We set rasterizationScale on CALayers to the same values as contentsScale, to
avoid blurry layers when CA rasterizes, which often happens with nested perspective
transforms.

However, in UI-side compositing, if the page is not zoomed, we never applied the
rasterizationScale in the UI process. This happened because the PlatformCALayerRemote
constructor set m_properties.contentsScale, but did not set the dirty bit that
triggers the application of contentsScale and rasterizationScale in RemoteLayerTreePropertyApplier.
The fix is to set this dirty bit.

The rest of the changes are for testing. Internals now exposes layerIDForElement()
for returns an internal (non-stable-across-loads) layerID, which can be passed
to UIScriptController.propertiesOfLayerWithID() in the UI process, which inspects
the built layer (UIView) hierarchy. propertiesOfLayerWithID() returns a dictionary
which the test can dump as JSON, or pull values out of.

A few #pragma once cleanups also.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _propertiesOfLayerWithID:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::layerWithIDForTesting):
* UIProcess/mac/RemoteLayerTreeHost.h:
* UIProcess/mac/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::layerWithIDForTesting):
* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::PlatformCALayerRemote):

Tools:

rdar://problem/29879484

Reviewed by Tim Horton.

We set rasterizationScale on CALayers to the same values as contentsScale, to
avoid blurry layers when CA rasterizes, which often happens with nested perspective
transforms.

However, in UI-side compositing, if the page is not zoomed, we never applied the
rasterizationScale in the UI process. This happened because the PlatformCALayerRemote
constructor set m_properties.contentsScale, but did not set the dirty bit that
triggers the application of contentsScale and rasterizationScale in RemoteLayerTreePropertyApplier.
The fix is to set this dirty bit.

The rest of the changes are for testing. Internals now exposes layerIDForElement()
for returns an internal (non-stable-across-loads) layerID, which can be passed
to UIScriptController.propertiesOfLayerWithID() in the UI process, which inspects
the built layer (UIView) hierarchy. propertiesOfLayerWithID() returns a dictionary
which the test can dump as JSON, or pull values out of.

A few #pragma once cleanups also.

* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::propertiesOfLayerWithID):
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::propertiesOfLayerWithID):
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::propertiesOfLayerWithID):

LayoutTests:

Reviewed by Tim Horton.

We set rasterizationScale on CALayers to the same values as contentsScale, to
avoid blurry layers when CA rasterizes, which often happens with nested perspective
transforms.

However, in UI-side compositing, if the page is not zoomed, we never applied the
rasterizationScale in the UI process. This happened because the PlatformCALayerRemote
constructor set m_properties.contentsScale, but did not set the dirty bit that
triggers the application of contentsScale and rasterizationScale in RemoteLayerTreePropertyApplier.
The fix is to set this dirty bit.

The rest of the changes are for testing. Internals now exposes layerIDForElement()
for returns an internal (non-stable-across-loads) layerID, which can be passed
to UIScriptController.propertiesOfLayerWithID() in the UI process, which inspects
the built layer (UIView) hierarchy. propertiesOfLayerWithID() returns a dictionary
which the test can dump as JSON, or pull values out of.

A few #pragma once cleanups also.

* TestExpectations:
* compositing/ios/basic-layer-properties-expected.txt: Added.
* compositing/ios/basic-layer-properties.html: Added.
* compositing/ios/rasterization-scale-expected.txt: Added.
* compositing/ios/rasterization-scale.html: Added.
* platform/ios-simulator-wk2/TestExpectations:

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

2 years ago[Re-landing] Implement a StackTrace utility object that can capture stack traces...
mark.lam@apple.com [Fri, 10 Mar 2017 19:01:57 +0000 (19:01 +0000)]
[Re-landing] Implement a StackTrace utility object that can capture stack traces for debugging.
https://bugs.webkit.org/show_bug.cgi?id=169454

Reviewed by Michael Saboff.

The underlying implementation is hoisted right out of Assertions.cpp from the
implementations of WTFPrintBacktrace().

The reason we need this StackTrace object is because during heap debugging, we
sometimes want to capture the stack trace that allocated the objects of interest.
Dumping the stack trace directly to stdout (using WTFReportBacktrace()) may
perturb the execution profile sufficiently that an issue may not reproduce,
while alternatively, just capturing the stack trace and deferring printing it
till we actually need it later perturbs the execution profile less.

In addition, just capturing the stack traces (instead of printing them
immediately at each capture site) allows us to avoid polluting stdout with tons
of stack traces that may be irrelevant.

For now, we only capture the native stack trace.  We'll leave capturing and
integrating the JS stack trace as an exercise for the future if we need it then.

Here's an example of how to use this StackTrace utility:

    // Capture a stack trace of the top 10 frames.
    std::unique_ptr<StackTrace> trace(StackTrace::captureStackTrace(10));
    // Print the trace.
    dataLog(*trace);

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* tools/StackTrace.cpp: Added.
(JSC::StackTrace::instanceSize):
(JSC::StackTrace::captureStackTrace):
(JSC::StackTrace::dump):
* tools/StackTrace.h: Added.
(JSC::StackTrace::size):
(JSC::StackTrace::StackTrace):

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

2 years agoUnreviewed, rolling out r213618.
commit-queue@webkit.org [Fri, 10 Mar 2017 18:05:46 +0000 (18:05 +0000)]
Unreviewed, rolling out r213618.
https://bugs.webkit.org/show_bug.cgi?id=169475

Suspect this is the cause of a large memory regression
(Requested by jonlee_ on #webkit).

Reverted changeset:

"Enable async image decoding for large images"
https://bugs.webkit.org/show_bug.cgi?id=165039
http://trac.webkit.org/changeset/213618

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

2 years agoB3 should have comprehensive support for atomic operations
fpizlo@apple.com [Fri, 10 Mar 2017 17:49:42 +0000 (17:49 +0000)]
B3 should have comprehensive support for atomic operations
https://bugs.webkit.org/show_bug.cgi?id=162349

Reviewed by Keith Miller.

Source/JavaScriptCore:

This adds the following capabilities to B3:

- Atomic weak/strong unfenced/fenced compare-and-swap
- Atomic add/sub/or/and/xor/xchg
- Acquire/release fencing on loads/stores
- Fenceless load-load dependencies

This adds lowering to the following instructions on x86:

- lock cmpxchg
- lock xadd
- lock add/sub/or/and/xor/xchg

This adds lowering to the following instructions on ARM64:

- ldar and friends
- stlr and friends
- ldxr and friends (unfenced LL)
- stxr and friends (unfended SC)
- ldaxr and friends (fenced LL)
- stlxr and friends (fenced SC)
- eor as a fenceless load-load dependency

This does instruction selection pattern matching to ensure that weak/strong CAS and all of the
variants of fences and atomic math ops get lowered to the best possible instruction sequence.
For example, we support the Equal(AtomicStrongCAS(expected, ...), expected) pattern and a bunch
of its friends. You can say Branch(Equal(AtomicStrongCAS(expected, ...), expected)) and it will
generate the best possible branch sequence on x86 and ARM64.

B3 now knows how to model all of the kinds of fencing. It knows that acq loads are ordered with
respect to each other and with respect to rel stores, creating sequential consistency that
transcends just the acq/rel fences themselves (see Effects::fence). It knows that the phantom
fence effects may only target some abstract heaps but not others, so that load elimination and
store sinking can still operate across fences if you just tell B3 that the fence does not alias
those accesses. This makes it super easy to teach B3 that some of your heap is thread-local.
Even better, it lets you express fine-grained dependencies where the atomics that affect one
property in shared memory do not clobber non-atomics that ffect some other property in shared
memory.

One of my favorite features is Depend, which allows you to express load-load dependencies. On
x86 it lowers to nothing, while on ARM64 it lowers to eor.

This also exposes a common atomicWeakCAS API to the x86_64/ARM64 MacroAssemblers. Same for
acq/rel. JSC's 64-bit JITs are now a happy concurrency playground.

This doesn't yet expose the functionality to JS or wasm. SAB still uses the non-intrinsic
implementations of the Atomics object, for now.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* assembler/ARM64Assembler.h:
(JSC::ARM64Assembler::ldar):
(JSC::ARM64Assembler::ldxr):
(JSC::ARM64Assembler::ldaxr):
(JSC::ARM64Assembler::stxr):
(JSC::ARM64Assembler::stlr):
(JSC::ARM64Assembler::stlxr):
(JSC::ARM64Assembler::excepnGenerationImmMask):
(JSC::ARM64Assembler::exoticLoad):
(JSC::ARM64Assembler::storeRelease):
(JSC::ARM64Assembler::exoticStore):
* assembler/AbstractMacroAssembler.cpp: Added.
(WTF::printInternal):
* assembler/AbstractMacroAssembler.h:
(JSC::AbstractMacroAssemblerBase::invert):
* assembler/MacroAssembler.h:
* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::loadAcq8SignedExtendTo32):
(JSC::MacroAssemblerARM64::loadAcq8):
(JSC::MacroAssemblerARM64::storeRel8):
(JSC::MacroAssemblerARM64::loadAcq16SignedExtendTo32):
(JSC::MacroAssemblerARM64::loadAcq16):
(JSC::MacroAssemblerARM64::storeRel16):
(JSC::MacroAssemblerARM64::loadAcq32):
(JSC::MacroAssemblerARM64::loadAcq64):
(JSC::MacroAssemblerARM64::storeRel32):
(JSC::MacroAssemblerARM64::storeRel64):
(JSC::MacroAssemblerARM64::loadLink8):
(JSC::MacroAssemblerARM64::loadLinkAcq8):
(JSC::MacroAssemblerARM64::storeCond8):
(JSC::MacroAssemblerARM64::storeCondRel8):
(JSC::MacroAssemblerARM64::loadLink16):
(JSC::MacroAssemblerARM64::loadLinkAcq16):
(JSC::MacroAssemblerARM64::storeCond16):
(JSC::MacroAssemblerARM64::storeCondRel16):
(JSC::MacroAssemblerARM64::loadLink32):
(JSC::MacroAssemblerARM64::loadLinkAcq32):
(JSC::MacroAssemblerARM64::storeCond32):
(JSC::MacroAssemblerARM64::storeCondRel32):
(JSC::MacroAssemblerARM64::loadLink64):
(JSC::MacroAssemblerARM64::loadLinkAcq64):
(JSC::MacroAssemblerARM64::storeCond64):
(JSC::MacroAssemblerARM64::storeCondRel64):
(JSC::MacroAssemblerARM64::atomicStrongCAS8):
(JSC::MacroAssemblerARM64::atomicStrongCAS16):
(JSC::MacroAssemblerARM64::atomicStrongCAS32):
(JSC::MacroAssemblerARM64::atomicStrongCAS64):
(JSC::MacroAssemblerARM64::atomicRelaxedStrongCAS8):
(JSC::MacroAssemblerARM64::atomicRelaxedStrongCAS16):
(JSC::MacroAssemblerARM64::atomicRelaxedStrongCAS32):
(JSC::MacroAssemblerARM64::atomicRelaxedStrongCAS64):
(JSC::MacroAssemblerARM64::branchAtomicWeakCAS8):
(JSC::MacroAssemblerARM64::branchAtomicWeakCAS16):
(JSC::MacroAssemblerARM64::branchAtomicWeakCAS32):
(JSC::MacroAssemblerARM64::branchAtomicWeakCAS64):
(JSC::MacroAssemblerARM64::branchAtomicRelaxedWeakCAS8):
(JSC::MacroAssemblerARM64::branchAtomicRelaxedWeakCAS16):
(JSC::MacroAssemblerARM64::branchAtomicRelaxedWeakCAS32):
(JSC::MacroAssemblerARM64::branchAtomicRelaxedWeakCAS64):
(JSC::MacroAssemblerARM64::depend32):
(JSC::MacroAssemblerARM64::depend64):
(JSC::MacroAssemblerARM64::loadLink):
(JSC::MacroAssemblerARM64::loadLinkAcq):
(JSC::MacroAssemblerARM64::storeCond):
(JSC::MacroAssemblerARM64::storeCondRel):
(JSC::MacroAssemblerARM64::signExtend):
(JSC::MacroAssemblerARM64::branch):
(JSC::MacroAssemblerARM64::atomicStrongCAS):
(JSC::MacroAssemblerARM64::atomicRelaxedStrongCAS):
(JSC::MacroAssemblerARM64::branchAtomicWeakCAS):
(JSC::MacroAssemblerARM64::branchAtomicRelaxedWeakCAS):
(JSC::MacroAssemblerARM64::extractSimpleAddress):
(JSC::MacroAssemblerARM64::signExtend<8>):
(JSC::MacroAssemblerARM64::signExtend<16>):
(JSC::MacroAssemblerARM64::branch<64>):
* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::add32):
(JSC::MacroAssemblerX86Common::and32):
(JSC::MacroAssemblerX86Common::and16):
(JSC::MacroAssemblerX86Common::and8):
(JSC::MacroAssemblerX86Common::neg32):
(JSC::MacroAssemblerX86Common::neg16):
(JSC::MacroAssemblerX86Common::neg8):
(JSC::MacroAssemblerX86Common::or32):
(JSC::MacroAssemblerX86Common::or16):
(JSC::MacroAssemblerX86Common::or8):
(JSC::MacroAssemblerX86Common::sub16):
(JSC::MacroAssemblerX86Common::sub8):
(JSC::MacroAssemblerX86Common::sub32):
(JSC::MacroAssemblerX86Common::xor32):
(JSC::MacroAssemblerX86Common::xor16):
(JSC::MacroAssemblerX86Common::xor8):
(JSC::MacroAssemblerX86Common::not32):
(JSC::MacroAssemblerX86Common::not16):
(JSC::MacroAssemblerX86Common::not8):
(JSC::MacroAssemblerX86Common::store16):
(JSC::MacroAssemblerX86Common::atomicStrongCAS8):
(JSC::MacroAssemblerX86Common::atomicStrongCAS16):
(JSC::MacroAssemblerX86Common::atomicStrongCAS32):
(JSC::MacroAssemblerX86Common::branchAtomicStrongCAS8):
(JSC::MacroAssemblerX86Common::branchAtomicStrongCAS16):
(JSC::MacroAssemblerX86Common::branchAtomicStrongCAS32):
(JSC::MacroAssemblerX86Common::atomicWeakCAS8):
(JSC::MacroAssemblerX86Common::atomicWeakCAS16):
(JSC::MacroAssemblerX86Common::atomicWeakCAS32):
(JSC::MacroAssemblerX86Common::branchAtomicWeakCAS8):
(JSC::MacroAssemblerX86Common::branchAtomicWeakCAS16):
(JSC::MacroAssemblerX86Common::branchAtomicWeakCAS32):
(JSC::MacroAssemblerX86Common::atomicRelaxedWeakCAS8):
(JSC::MacroAssemblerX86Common::atomicRelaxedWeakCAS16):
(JSC::MacroAssemblerX86Common::atomicRelaxedWeakCAS32):
(JSC::MacroAssemblerX86Common::branchAtomicRelaxedWeakCAS8):
(JSC::MacroAssemblerX86Common::branchAtomicRelaxedWeakCAS16):
(JSC::MacroAssemblerX86Common::branchAtomicRelaxedWeakCAS32):
(JSC::MacroAssemblerX86Common::atomicAdd8):
(JSC::MacroAssemblerX86Common::atomicAdd16):
(JSC::MacroAssemblerX86Common::atomicAdd32):
(JSC::MacroAssemblerX86Common::atomicSub8):
(JSC::MacroAssemblerX86Common::atomicSub16):
(JSC::MacroAssemblerX86Common::atomicSub32):
(JSC::MacroAssemblerX86Common::atomicAnd8):
(JSC::MacroAssemblerX86Common::atomicAnd16):
(JSC::MacroAssemblerX86Common::atomicAnd32):
(JSC::MacroAssemblerX86Common::atomicOr8):
(JSC::MacroAssemblerX86Common::atomicOr16):
(JSC::MacroAssemblerX86Common::atomicOr32):
(JSC::MacroAssemblerX86Common::atomicXor8):
(JSC::MacroAssemblerX86Common::atomicXor16):
(JSC::MacroAssemblerX86Common::atomicXor32):
(JSC::MacroAssemblerX86Common::atomicNeg8):
(JSC::MacroAssemblerX86Common::atomicNeg16):
(JSC::MacroAssemblerX86Common::atomicNeg32):
(JSC::MacroAssemblerX86Common::atomicNot8):
(JSC::MacroAssemblerX86Common::atomicNot16):
(JSC::MacroAssemblerX86Common::atomicNot32):
(JSC::MacroAssemblerX86Common::atomicXchgAdd8):
(JSC::MacroAssemblerX86Common::atomicXchgAdd16):
(JSC::MacroAssemblerX86Common::atomicXchgAdd32):
(JSC::MacroAssemblerX86Common::atomicXchg8):
(JSC::MacroAssemblerX86Common::atomicXchg16):
(JSC::MacroAssemblerX86Common::atomicXchg32):
(JSC::MacroAssemblerX86Common::loadAcq8):
(JSC::MacroAssemblerX86Common::loadAcq8SignedExtendTo32):
(JSC::MacroAssemblerX86Common::loadAcq16):
(JSC::MacroAssemblerX86Common::loadAcq16SignedExtendTo32):
(JSC::MacroAssemblerX86Common::loadAcq32):
(JSC::MacroAssemblerX86Common::storeRel8):
(JSC::MacroAssemblerX86Common::storeRel16):
(JSC::MacroAssemblerX86Common::storeRel32):
(JSC::MacroAssemblerX86Common::storeFence):
(JSC::MacroAssemblerX86Common::loadFence):
(JSC::MacroAssemblerX86Common::replaceWithJump):
(JSC::MacroAssemblerX86Common::maxJumpReplacementSize):
(JSC::MacroAssemblerX86Common::patchableJumpSize):
(JSC::MacroAssemblerX86Common::supportsFloatingPointRounding):
(JSC::MacroAssemblerX86Common::supportsAVX):
(JSC::MacroAssemblerX86Common::updateEax1EcxFlags):
(JSC::MacroAssemblerX86Common::x86Condition):
(JSC::MacroAssemblerX86Common::atomicStrongCAS):
(JSC::MacroAssemblerX86Common::branchAtomicStrongCAS):
* assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::add64):
(JSC::MacroAssemblerX86_64::and64):
(JSC::MacroAssemblerX86_64::neg64):
(JSC::MacroAssemblerX86_64::or64):
(JSC::MacroAssemblerX86_64::sub64):
(JSC::MacroAssemblerX86_64::xor64):
(JSC::MacroAssemblerX86_64::not64):
(JSC::MacroAssemblerX86_64::store64):
(JSC::MacroAssemblerX86_64::atomicStrongCAS64):
(JSC::MacroAssemblerX86_64::branchAtomicStrongCAS64):
(JSC::MacroAssemblerX86_64::atomicWeakCAS64):
(JSC::MacroAssemblerX86_64::branchAtomicWeakCAS64):
(JSC::MacroAssemblerX86_64::atomicRelaxedWeakCAS64):
(JSC::MacroAssemblerX86_64::branchAtomicRelaxedWeakCAS64):
(JSC::MacroAssemblerX86_64::atomicAdd64):
(JSC::MacroAssemblerX86_64::atomicSub64):
(JSC::MacroAssemblerX86_64::atomicAnd64):
(JSC::MacroAssemblerX86_64::atomicOr64):
(JSC::MacroAssemblerX86_64::atomicXor64):
(JSC::MacroAssemblerX86_64::atomicNeg64):
(JSC::MacroAssemblerX86_64::atomicNot64):
(JSC::MacroAssemblerX86_64::atomicXchgAdd64):
(JSC::MacroAssemblerX86_64::atomicXchg64):
(JSC::MacroAssemblerX86_64::loadAcq64):
(JSC::MacroAssemblerX86_64::storeRel64):
* assembler/X86Assembler.h:
(JSC::X86Assembler::addl_mr):
(JSC::X86Assembler::addq_mr):
(JSC::X86Assembler::addq_rm):
(JSC::X86Assembler::addq_im):
(JSC::X86Assembler::andl_mr):
(JSC::X86Assembler::andl_rm):
(JSC::X86Assembler::andw_rm):
(JSC::X86Assembler::andb_rm):
(JSC::X86Assembler::andl_im):
(JSC::X86Assembler::andw_im):
(JSC::X86Assembler::andb_im):
(JSC::X86Assembler::andq_mr):
(JSC::X86Assembler::andq_rm):
(JSC::X86Assembler::andq_im):
(JSC::X86Assembler::incq_m):
(JSC::X86Assembler::negq_m):
(JSC::X86Assembler::negl_m):
(JSC::X86Assembler::negw_m):
(JSC::X86Assembler::negb_m):
(JSC::X86Assembler::notl_m):
(JSC::X86Assembler::notw_m):
(JSC::X86Assembler::notb_m):
(JSC::X86Assembler::notq_m):
(JSC::X86Assembler::orl_mr):
(JSC::X86Assembler::orl_rm):
(JSC::X86Assembler::orw_rm):
(JSC::X86Assembler::orb_rm):
(JSC::X86Assembler::orl_im):
(JSC::X86Assembler::orw_im):
(JSC::X86Assembler::orb_im):
(JSC::X86Assembler::orq_mr):
(JSC::X86Assembler::orq_rm):
(JSC::X86Assembler::orq_im):
(JSC::X86Assembler::subl_mr):
(JSC::X86Assembler::subl_rm):
(JSC::X86Assembler::subw_rm):
(JSC::X86Assembler::subb_rm):
(JSC::X86Assembler::subl_im):
(JSC::X86Assembler::subw_im):
(JSC::X86Assembler::subb_im):
(JSC::X86Assembler::subq_mr):
(JSC::X86Assembler::subq_rm):
(JSC::X86Assembler::subq_im):
(JSC::X86Assembler::xorl_mr):
(JSC::X86Assembler::xorl_rm):
(JSC::X86Assembler::xorl_im):
(JSC::X86Assembler::xorw_rm):
(JSC::X86Assembler::xorw_im):
(JSC::X86Assembler::xorb_rm):
(JSC::X86Assembler::xorb_im):
(JSC::X86Assembler::xorq_im):
(JSC::X86Assembler::xorq_rm):
(JSC::X86Assembler::xorq_mr):
(JSC::X86Assembler::xchgb_rm):
(JSC::X86Assembler::xchgw_rm):
(JSC::X86Assembler::xchgl_rm):
(JSC::X86Assembler::xchgq_rm):
(JSC::X86Assembler::movw_im):
(JSC::X86Assembler::movq_i32m):
(JSC::X86Assembler::cmpxchgb_rm):
(JSC::X86Assembler::cmpxchgw_rm):
(JSC::X86Assembler::cmpxchgl_rm):
(JSC::X86Assembler::cmpxchgq_rm):
(JSC::X86Assembler::xaddb_rm):
(JSC::X86Assembler::xaddw_rm):
(JSC::X86Assembler::xaddl_rm):
(JSC::X86Assembler::xaddq_rm):
(JSC::X86Assembler::X86InstructionFormatter::SingleInstructionBufferWriter::memoryModRM):
* b3/B3AtomicValue.cpp: Added.
(JSC::B3::AtomicValue::~AtomicValue):
(JSC::B3::AtomicValue::dumpMeta):
(JSC::B3::AtomicValue::cloneImpl):
(JSC::B3::AtomicValue::AtomicValue):
* b3/B3AtomicValue.h: Added.
* b3/B3BasicBlock.h:
* b3/B3BlockInsertionSet.cpp:
(JSC::B3::BlockInsertionSet::BlockInsertionSet):
(JSC::B3::BlockInsertionSet::insert): Deleted.
(JSC::B3::BlockInsertionSet::insertBefore): Deleted.
(JSC::B3::BlockInsertionSet::insertAfter): Deleted.
(JSC::B3::BlockInsertionSet::execute): Deleted.
* b3/B3BlockInsertionSet.h:
* b3/B3Effects.cpp:
(JSC::B3::Effects::interferes):
(JSC::B3::Effects::operator==):
(JSC::B3::Effects::dump):
* b3/B3Effects.h:
(JSC::B3::Effects::forCall):
(JSC::B3::Effects::mustExecute):
* b3/B3EliminateCommonSubexpressions.cpp:
* b3/B3Generate.cpp:
(JSC::B3::generateToAir):
* b3/B3GenericBlockInsertionSet.h: Added.
(JSC::B3::GenericBlockInsertionSet::GenericBlockInsertionSet):
(JSC::B3::GenericBlockInsertionSet::insert):
(JSC::B3::GenericBlockInsertionSet::insertBefore):
(JSC::B3::GenericBlockInsertionSet::insertAfter):
(JSC::B3::GenericBlockInsertionSet::execute):
* b3/B3HeapRange.h:
(JSC::B3::HeapRange::operator|):
* b3/B3InsertionSet.cpp:
(JSC::B3::InsertionSet::insertClone):
* b3/B3InsertionSet.h:
* b3/B3LegalizeMemoryOffsets.cpp:
* b3/B3LowerMacros.cpp:
(JSC::B3::lowerMacros):
* b3/B3LowerMacrosAfterOptimizations.cpp:
* b3/B3LowerToAir.cpp:
(JSC::B3::Air::LowerToAir::LowerToAir):
(JSC::B3::Air::LowerToAir::run):
(JSC::B3::Air::LowerToAir::effectiveAddr):
(JSC::B3::Air::LowerToAir::addr):
(JSC::B3::Air::LowerToAir::loadPromiseAnyOpcode):
(JSC::B3::Air::LowerToAir::appendShift):
(JSC::B3::Air::LowerToAir::tryAppendStoreBinOp):
(JSC::B3::Air::LowerToAir::storeOpcode):
(JSC::B3::Air::LowerToAir::createStore):
(JSC::B3::Air::LowerToAir::finishAppendingInstructions):
(JSC::B3::Air::LowerToAir::newBlock):
(JSC::B3::Air::LowerToAir::splitBlock):
(JSC::B3::Air::LowerToAir::fillStackmap):
(JSC::B3::Air::LowerToAir::appendX86Div):
(JSC::B3::Air::LowerToAir::appendX86UDiv):
(JSC::B3::Air::LowerToAir::loadLinkOpcode):
(JSC::B3::Air::LowerToAir::storeCondOpcode):
(JSC::B3::Air::LowerToAir::appendCAS):
(JSC::B3::Air::LowerToAir::appendVoidAtomic):
(JSC::B3::Air::LowerToAir::appendGeneralAtomic):
(JSC::B3::Air::LowerToAir::lower):
(JSC::B3::Air::LowerToAir::lowerX86Div): Deleted.
(JSC::B3::Air::LowerToAir::lowerX86UDiv): Deleted.
* b3/B3LowerToAir.h:
* b3/B3MemoryValue.cpp:
(JSC::B3::MemoryValue::isLegalOffset):
(JSC::B3::MemoryValue::accessType):
(JSC::B3::MemoryValue::accessBank):
(JSC::B3::MemoryValue::accessByteSize):
(JSC::B3::MemoryValue::dumpMeta):
(JSC::B3::MemoryValue::MemoryValue):
(JSC::B3::MemoryValue::accessWidth): Deleted.
* b3/B3MemoryValue.h:
* b3/B3MemoryValueInlines.h: Added.
(JSC::B3::MemoryValue::isLegalOffset):
(JSC::B3::MemoryValue::requiresSimpleAddr):
(JSC::B3::MemoryValue::accessWidth):
* b3/B3MoveConstants.cpp:
* b3/B3NativeTraits.h: Added.
* b3/B3Opcode.cpp:
(JSC::B3::storeOpcode):
(WTF::printInternal):
* b3/B3Opcode.h:
(JSC::B3::isLoad):
(JSC::B3::isStore):
(JSC::B3::isLoadStore):
(JSC::B3::isAtomic):
(JSC::B3::isAtomicCAS):
(JSC::B3::isAtomicXchg):
(JSC::B3::isMemoryAccess):
(JSC::B3::signExtendOpcode):
* b3/B3Procedure.cpp:
(JSC::B3::Procedure::dump):
* b3/B3Procedure.h:
(JSC::B3::Procedure::hasQuirks):
(JSC::B3::Procedure::setHasQuirks):
* b3/B3PureCSE.cpp:
(JSC::B3::pureCSE):
* b3/B3PureCSE.h:
* b3/B3ReduceStrength.cpp:
* b3/B3Validate.cpp:
* b3/B3Value.cpp:
(JSC::B3::Value::returnsBool):
(JSC::B3::Value::effects):
(JSC::B3::Value::key):
(JSC::B3::Value::performSubstitution):
(JSC::B3::Value::typeFor):
* b3/B3Value.h:
* b3/B3Width.cpp:
(JSC::B3::bestType):
* b3/B3Width.h:
(JSC::B3::canonicalWidth):
(JSC::B3::isCanonicalWidth):
(JSC::B3::mask):
* b3/air/AirArg.cpp:
(JSC::B3::Air::Arg::jsHash):
(JSC::B3::Air::Arg::dump):
(WTF::printInternal):
* b3/air/AirArg.h:
(JSC::B3::Air::Arg::isAnyUse):
(JSC::B3::Air::Arg::isColdUse):
(JSC::B3::Air::Arg::cooled):
(JSC::B3::Air::Arg::isEarlyUse):
(JSC::B3::Air::Arg::isLateUse):
(JSC::B3::Air::Arg::isAnyDef):
(JSC::B3::Air::Arg::isEarlyDef):
(JSC::B3::Air::Arg::isLateDef):
(JSC::B3::Air::Arg::isZDef):
(JSC::B3::Air::Arg::simpleAddr):
(JSC::B3::Air::Arg::statusCond):
(JSC::B3::Air::Arg::isSimpleAddr):
(JSC::B3::Air::Arg::isMemory):
(JSC::B3::Air::Arg::isStatusCond):
(JSC::B3::Air::Arg::isCondition):
(JSC::B3::Air::Arg::ptr):
(JSC::B3::Air::Arg::base):
(JSC::B3::Air::Arg::isGP):
(JSC::B3::Air::Arg::isFP):
(JSC::B3::Air::Arg::isValidForm):
(JSC::B3::Air::Arg::forEachTmpFast):
(JSC::B3::Air::Arg::forEachTmp):
(JSC::B3::Air::Arg::asAddress):
(JSC::B3::Air::Arg::asStatusCondition):
(JSC::B3::Air::Arg::isInvertible):
(JSC::B3::Air::Arg::inverted):
* b3/air/AirBasicBlock.cpp:
(JSC::B3::Air::BasicBlock::setSuccessors):
* b3/air/AirBasicBlock.h:
* b3/air/AirBlockInsertionSet.cpp: Added.
(JSC::B3::Air::BlockInsertionSet::BlockInsertionSet):
(JSC::B3::Air::BlockInsertionSet::~BlockInsertionSet):
* b3/air/AirBlockInsertionSet.h: Added.
* b3/air/AirDumpAsJS.cpp: Removed.
* b3/air/AirDumpAsJS.h: Removed.
* b3/air/AirEliminateDeadCode.cpp:
(JSC::B3::Air::eliminateDeadCode):
* b3/air/AirGenerate.cpp:
(JSC::B3::Air::prepareForGeneration):
* b3/air/AirInstInlines.h:
(JSC::B3::Air::isAtomicStrongCASValid):
(JSC::B3::Air::isBranchAtomicStrongCASValid):
(JSC::B3::Air::isAtomicStrongCAS8Valid):
(JSC::B3::Air::isAtomicStrongCAS16Valid):
(JSC::B3::Air::isAtomicStrongCAS32Valid):
(JSC::B3::Air::isAtomicStrongCAS64Valid):
(JSC::B3::Air::isBranchAtomicStrongCAS8Valid):
(JSC::B3::Air::isBranchAtomicStrongCAS16Valid):
(JSC::B3::Air::isBranchAtomicStrongCAS32Valid):
(JSC::B3::Air::isBranchAtomicStrongCAS64Valid):
* b3/air/AirOpcode.opcodes:
* b3/air/AirOptimizeBlockOrder.cpp:
(JSC::B3::Air::optimizeBlockOrder):
* b3/air/AirPadInterference.cpp:
(JSC::B3::Air::padInterference):
* b3/air/AirSpillEverything.cpp:
(JSC::B3::Air::spillEverything):
* b3/air/opcode_generator.rb:
* b3/testb3.cpp:
(JSC::B3::testLoadAcq42):
(JSC::B3::testStoreRelAddLoadAcq32):
(JSC::B3::testStoreRelAddLoadAcq8):
(JSC::B3::testStoreRelAddFenceLoadAcq8):
(JSC::B3::testStoreRelAddLoadAcq16):
(JSC::B3::testStoreRelAddLoadAcq64):
(JSC::B3::testTrappingStoreElimination):
(JSC::B3::testX86LeaAddAdd):
(JSC::B3::testX86LeaAddShlLeftScale1):
(JSC::B3::testAtomicWeakCAS):
(JSC::B3::testAtomicStrongCAS):
(JSC::B3::testAtomicXchg):
(JSC::B3::testDepend32):
(JSC::B3::testDepend64):
(JSC::B3::run):
* runtime/Options.h:

Websites/webkit.org:

Document the new opcodes!

* docs/b3/intermediate-representation.html:

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

2 years ago[GTK] Unreviewed test gardening
jfernandez@igalia.com [Fri, 10 Mar 2017 17:32:07 +0000 (17:32 +0000)]
[GTK] Unreviewed test gardening
https://bugs.webkit.org/show_bug.cgi?id=169470

Unreviewed GTK+ gardening. Updated test expectations after regressions r213671 and r213560.

* platform/gtk/TestExpectations:
   - imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/pbkdf2.worker.html [ Failure ]
   - imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/test_pbkdf2.html [ Failure ]
   - imported/w3c/web-platform-tests/WebCryptoAPI/import_export/ec_importKey.worker.html [ Failure ]
   - imported/w3c/web-platform-tests/WebCryptoAPI/import_export/test_ec_importKey.html [ Failure ]

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

2 years agoSource/WebCore:
antti@apple.com [Fri, 10 Mar 2017 16:01:50 +0000 (16:01 +0000)]
Source/WebCore:
Allow the page to render before <link> stylesheet tags in body
https://bugs.webkit.org/show_bug.cgi?id=149157
<rdar://problem/24658830>

Reviewed by Simon Fraser.

Currently we block style and renderer building completely if document has any loading
stylesheets. In case a script queries something layout dependent we construct the render
tree with whatever style we have but block painting in it.

This patch changes behavior so that a loading stylesheet in body only blocks rendering for elements
that are after it. The expectation is that such stylesheets rarely affect elements before them
and the elements can be rendered without causing ugly visible styling changes.

The patch replaces the old flash-of-unstyled-content (FOUC) preventation mechanism with a more
fine-grained one. Paint blocking is now done on per-renderer basis with based on isNonFinal flag in
RenderStyle.

For stylesheets in head the behavior should be largely unchanged.

Test: http/tests/incremental/stylesheet-body-incremental-rendering.html

* css/StyleResolver.cpp:
(WebCore::StyleResolver::pseudoStyleRulesForElement):
* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::Document::resolveStyle):
(WebCore::Document::updateLayoutIgnorePendingStylesheets):

    Remove the old FOUC preventation state tracking.

(WebCore::Document::shouldScheduleLayout):
(WebCore::Document::didRemoveAllPendingStylesheet):

    Repaints will now get triggered by the normal style mechanism.

* dom/Document.h:
(WebCore::Document::hasNodesWithNonFinalStyle):
(WebCore::Document::setHasNodesWithNonFinalStyle):

    Track if we need to recompute the style later because non-final or unstyled elements.

(WebCore::Document::didLayoutWithPendingStylesheets): Deleted.
(WebCore::Document::hasNodesWithPlaceholderStyle): Deleted.
(WebCore::Document::setHasNodesWithPlaceholderStyle): Deleted.
* html/HTMLFrameSetElement.cpp:
(WebCore::HTMLFrameSetElement::rendererIsNeeded):
* page/FrameView.cpp:
(WebCore::FrameView::qualifiesAsVisuallyNonEmpty):

    Don't qualify as visually non-empty if we have loading stylesheets in head (even if there is
    a fouc-prevented render tree).

(WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintContents):

    Instead of a global test, block painting if isNonFinal is set in the renderer's style.

* rendering/RenderLayer.cpp:
(WebCore::shouldSuppressPaintingLayer):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeRequiresRepaint):

    The isNonFinal flag prevents painting so we need to trigger repaint when it gets cleared.

* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::isNotFinal):
(WebCore::RenderStyle::setIsNotFinal):
(WebCore::RenderStyle::isPlaceholderStyle): Deleted.
(WebCore::RenderStyle::setIsPlaceholderStyle): Deleted.

    There is no need for placeholder styles anymore. Reuse the bit for isNotFinal.

* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator==):
* rendering/style/StyleRareNonInheritedData.h:
* style/StyleScope.cpp:
(WebCore::Style::Scope::analyzeStyleSheetChange):
(WebCore::Style::Scope::updateActiveStyleSheets):
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::styleForElement):
(WebCore::Style::TreeResolver::resolveElement):

    If we have seens a loading stylesheet and don't have a renderer yet don't style the element.
    In case there is a renderer or we are ignoring pending sheets, resolve the style normally
    but mark it as non-final.

(WebCore::Style::makePlaceholderStyle): Deleted.

LayoutTests:
Loading in-body stylesheets should not block rendering of elements before them
https://bugs.webkit.org/show_bug.cgi?id=169345

Reviewed by Simon Fraser.

* http/tests/incremental/resources/delayed-css.php: Added.
* http/tests/incremental/stylesheet-body-incremental-rendering-expected.html: Added.
* http/tests/incremental/stylesheet-body-incremental-rendering.html: Added.

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

2 years agoimported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/sizes...
antti@apple.com [Fri, 10 Mar 2017 15:38:40 +0000 (15:38 +0000)]
imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute.html is unreliable
https://bugs.webkit.org/show_bug.cgi?id=169465

Reviewed by Zalan Bujtas.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:

Source/WebCore:

It shows all subtests passing but that is a bug. We don't even support all the unit types.
The test occasionally fails when reloading, that failing results are actually the correct ones.

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

    Ensure we have correct size for the iframe before parsing 'sizes' attribute values. The interpretation of
    these may depend on the iframe dimensions.

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

2 years agoUnreviewed typo fixes after r213652.
ossy@webkit.org [Fri, 10 Mar 2017 13:47:19 +0000 (13:47 +0000)]
Unreviewed typo fixes after r213652.
https://bugs.webkit.org/show_bug.cgi?id=168920

* assembler/MacroAssemblerARM.h:
(JSC::MacroAssemblerARM::replaceWithBreakpoint):
* assembler/MacroAssemblerMIPS.h:
(JSC::MacroAssemblerMIPS::replaceWithBreakpoint):

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

2 years agoUnreviewed ARM buildfix after r213652.
ossy@webkit.org [Fri, 10 Mar 2017 13:32:18 +0000 (13:32 +0000)]
Unreviewed ARM buildfix after r213652.
https://bugs.webkit.org/show_bug.cgi?id=168920

r213652 used replaceWithBrk and replaceWithBkpt names for the same
function, which was inconsistent and caused build error in ARMAssembler.

* assembler/ARM64Assembler.h:
(JSC::ARM64Assembler::replaceWithBkpt): Renamed replaceWithBrk to replaceWithBkpt.
(JSC::ARM64Assembler::replaceWithBrk): Deleted.
* assembler/ARMAssembler.h:
(JSC::ARMAssembler::replaceWithBkpt): Renamed replaceWithBrk to replaceWithBkpt.
(JSC::ARMAssembler::replaceWithBrk): Deleted.
* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::replaceWithBreakpoint):

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

2 years ago[WK2] Guard GLib-specific typedefs in InjectedBundle.h with USE(GLIB)
zandobersek@gmail.com [Fri, 10 Mar 2017 13:02:16 +0000 (13:02 +0000)]
[WK2] Guard GLib-specific typedefs in InjectedBundle.h with USE(GLIB)
https://bugs.webkit.org/show_bug.cgi?id=169464

Reviewed by Carlos Garcia Campos.

* WebProcess/InjectedBundle/InjectedBundle.h: Use the more appropriate
USE(GLIB) guard for the two typedefs revolving around GModule, instead
of the PLATFORM(GTK) guard.

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

2 years agoUnreviewed Win64 build fix. FTL is not ready to be turned on yet.
pvollan@apple.com [Fri, 10 Mar 2017 11:56:19 +0000 (11:56 +0000)]
Unreviewed Win64 build fix. FTL is not ready to be turned on yet.

* Source/cmake/OptionsWin.cmake:

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

2 years ago[mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html...
commit-queue@webkit.org [Fri, 10 Mar 2017 11:31:56 +0000 (11:31 +0000)]
[mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=168409

Unreviewed.

Add some debugging in the hope of understanding why airplay-button.html fails once a day on bots.

Patch by Antoine Quint <graouts@apple.com> on 2017-03-10

Source/WebCore:

* Modules/modern-media-controls/controls/scheduler.js:
(const.scheduler.new.prototype.scheduleLayout):
(const.scheduler.new.prototype.unscheduleLayout):
(const.scheduler.new.prototype._requestFrameIfNeeded):
(const.scheduler.new.prototype._frameDidFire):
(const.scheduler.new.prototype._layout):

LayoutTests:

* media/modern-media-controls/airplay-button/airplay-button-expected.txt:
* media/modern-media-controls/airplay-button/airplay-button.html:

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

2 years agoUnreviewed AArch64 Linux buildfix after r213645.
ossy@webkit.org [Fri, 10 Mar 2017 10:30:30 +0000 (10:30 +0000)]
Unreviewed AArch64 Linux buildfix after r213645.
https://bugs.webkit.org/show_bug.cgi?id=169300

* wtf/Atomics.h: intptr_t and int64_t are typedefs for long int on Linux.
They are different types only on Darwin platforms.

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

2 years agoWin64 build fix.
achristensen@apple.com [Fri, 10 Mar 2017 08:36:11 +0000 (08:36 +0000)]
Win64 build fix.

.:

* Source/cmake/OptionsWin.cmake:
WASM got turned on on Win64.  Judging by the state of WasmMemory.cpp, I'm going to
assume this was a mistake and turn it off until someone writes a version that uses
VirtualAlloc/VirtualFree instead of mmap.
The FTL seems a bit unstable, though.  This fixes the build, but more fixes are necessary.

Source/JavaScriptCore:

* b3/B3FenceValue.h:
* b3/B3Value.h:
Putting JS_EXPORT_PRIVATE on member functions in classes that are declared with JS_EXPORT_PRIVATE
doesn't accomplish anything except making Visual Studio mad.
* b3/air/opcode_generator.rb:
winnt.h has naming collisions with enum values from AirOpcode.h.
For example, MemoryFence is #defined to be _mm_mfence, which is declared to be a function in emmintrin.h.
RotateLeft32 is #defined to be _rotl, which is declared to be a function in <stdlib.h>
A clean solution is just to put Opcode:: before the references to the opcode names to tell Visual Studio
that it is referring to the enum value in AirOpcode.h and not the function declaration elsewhere.

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

2 years agoUnreviewed, fix documentation typos
tpopela@redhat.com [Fri, 10 Mar 2017 07:19:04 +0000 (07:19 +0000)]
Unreviewed, fix documentation typos

* UIProcess/API/gtk/WebKitAuthenticationRequest.cpp:
* UIProcess/API/gtk/WebKitContextMenuActions.h:
* UIProcess/API/gtk/WebKitContextMenuItem.cpp:
* UIProcess/API/gtk/WebKitDownload.cpp:
(webkitDownloadNotifyProgress):
* UIProcess/API/gtk/WebKitEditorState.cpp:
* UIProcess/API/gtk/WebKitEditorState.h:
* UIProcess/API/gtk/WebKitError.h:
* UIProcess/API/gtk/WebKitFileChooserRequest.cpp:
* UIProcess/API/gtk/WebKitFindController.cpp:
* UIProcess/API/gtk/WebKitGeolocationPermissionRequest.cpp:
* UIProcess/API/gtk/WebKitHitTestResult.cpp:
* UIProcess/API/gtk/WebKitPolicyDecision.cpp:
* UIProcess/API/gtk/WebKitPrintOperation.h:
* UIProcess/API/gtk/WebKitResponsePolicyDecision.cpp:
* UIProcess/API/gtk/WebKitSecurityManager.cpp:
* UIProcess/API/gtk/WebKitSettings.cpp:
(webkit_settings_class_init):
* UIProcess/API/gtk/WebKitUserMediaPermissionRequest.cpp:
(webkitUserMediaPermissionRequestAllow):
* UIProcess/API/gtk/WebKitWebContext.cpp:
* UIProcess/API/gtk/WebKitWebInspector.cpp:
(webkit_web_inspector_class_init):
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkit_web_view_class_init):
* UIProcess/API/gtk/WebKitWebView.h:
* UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:
* WebProcess/InjectedBundle/API/gtk/WebKitFrame.cpp:
* WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp:
* WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
(webkit_web_page_class_init):

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

2 years agoUnreviewed, rolling out r213695.
ryanhaddad@apple.com [Fri, 10 Mar 2017 05:18:28 +0000 (05:18 +0000)]
Unreviewed, rolling out r213695.

This change broke the Windows build.

Reverted changeset:

"Implement a StackTrace utility object that can capture stack
traces for debugging."
https://bugs.webkit.org/show_bug.cgi?id=169454
http://trac.webkit.org/changeset/213695

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

2 years agoUnreviewed, rolling out r213633.
ryanhaddad@apple.com [Fri, 10 Mar 2017 05:08:40 +0000 (05:08 +0000)]
Unreviewed, rolling out r213633.

This change caused LayoutTest imported/w3c/web-platform-
tests/html/semantics/embedded-content/the-img-
element/sizes/parse-a-sizes-attribute.html to become a flaky
failure.

Reverted changeset:

"Loading in-body stylesheets should not block rendering of
elements before them"
https://bugs.webkit.org/show_bug.cgi?id=169345
http://trac.webkit.org/changeset/213633

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

2 years agoRebaseline js/dom/global-constructors-attributes.html.
ryanhaddad@apple.com [Fri, 10 Mar 2017 04:55:19 +0000 (04:55 +0000)]
Rebaseline js/dom/global-constructors-attributes.html.

Unreviewed test gardening.

* platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt:
* platform/mac/js/dom/global-constructors-attributes-expected.txt:

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

2 years agoFix CMake build
achristensen@apple.com [Fri, 10 Mar 2017 03:43:10 +0000 (03:43 +0000)]
Fix CMake build

* PlatformMac.cmake:

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

2 years agoFix GTK build after r213696
achristensen@apple.com [Fri, 10 Mar 2017 02:37:58 +0000 (02:37 +0000)]
Fix GTK build after r213696

Source/WebCore:

* PlatformMac.cmake:

Source/WebKit2:

* CMakeLists.txt:
* PlatformMac.cmake:

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

2 years ago[ESnext] Implement Object Rest - Implementing Object Rest Destructuring
commit-queue@webkit.org [Fri, 10 Mar 2017 02:00:33 +0000 (02:00 +0000)]
[ESnext] Implement Object Rest - Implementing Object Rest Destructuring
https://bugs.webkit.org/show_bug.cgi?id=167962

Patch by Caio Lima <ticaiolima@gmail.com> on 2017-03-09
Reviewed by Keith Miller.

JSTests:

* stress/object-rest-deconstruct.js: Added.
(let.assert):
(let.assertPropDescriptor):
(catch):
(get 3):
(foo):
(let.src.get y):
(let.src.set y):
(let.gen):

Source/JavaScriptCore:

Object Rest/Spread Destructing proposal is in stage 3[1] and this
Patch is a prototype implementation of it. A simple change over the
parser was necessary to support the new '...' token on Object Pattern
destruction rule. In the bytecode generator side, We changed the
bytecode generated on ObjectPatternNode::bindValue to store in an
array identifiers of already destructed properties, following spec draft
section[2], and then pass it as excludedNames to CopyDataProperties.
The rest destruction the calls copyDataProperties to perform the
copy of rest properties in rhs.

We also implemented CopyDataProperties as private JS global operation
on builtins/GlobalOperations.js following it's specification on [3].
It is implemented using Set object to verify if a property is on
excludedNames to keep this algorithm with O(n + m) complexity, where n
= number of source's own properties and m = excludedNames.length.

As a requirement to use JSSets as constants, a change in
CodeBlock::create API was necessary, because JSSet creation can throws OOM
exception. Now, CodeBlock::finishCreation returns ```false``` if an
execption is throwed by
CodeBlock::setConstantIdentifierSetRegisters and then we return
nullptr to ScriptExecutable::newCodeBlockFor. It is responsible to
check if CodeBlock was constructed properly and then, throw OOM
exception to the correct scope.

[1] - https://github.com/sebmarkbage/ecmascript-rest-spread
[2] - http://sebmarkbage.github.io/ecmascript-rest-spread/#Rest-RuntimeSemantics-PropertyDestructuringAssignmentEvaluation
[3] - http://sebmarkbage.github.io/ecmascript-rest-spread/#AbstractOperations-CopyDataProperties

* builtins/BuiltinNames.h:
* builtins/GlobalOperations.js:
(globalPrivate.copyDataProperties):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::finishCreation):
(JSC::CodeBlock::setConstantIdentifierSetRegisters):
* bytecode/CodeBlock.h:
* bytecode/EvalCodeBlock.h:
(JSC::EvalCodeBlock::create):
* bytecode/FunctionCodeBlock.h:
(JSC::FunctionCodeBlock::create):
* bytecode/ModuleProgramCodeBlock.h:
(JSC::ModuleProgramCodeBlock::create):
* bytecode/ProgramCodeBlock.h:
(JSC::ProgramCodeBlock::create):
* bytecode/UnlinkedCodeBlock.h:
(JSC::UnlinkedCodeBlock::addSetConstant):
(JSC::UnlinkedCodeBlock::constantIdentifierSets):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitLoad):
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::ObjectPatternNode::bindValue):
* parser/ASTBuilder.h:
(JSC::ASTBuilder::appendObjectPatternEntry):
(JSC::ASTBuilder::appendObjectPatternRestEntry):
(JSC::ASTBuilder::setContainsObjectRestElement):
* parser/Nodes.h:
(JSC::ObjectPatternNode::appendEntry):
(JSC::ObjectPatternNode::setContainsRestElement):
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseDestructuringPattern):
(JSC::Parser<LexerType>::parseProperty):
* parser/SyntaxChecker.h:
(JSC::SyntaxChecker::operatorStackPop):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::privateToObject):
* runtime/JSGlobalObjectFunctions.h:
* runtime/ScriptExecutable.cpp:
(JSC::ScriptExecutable::newCodeBlockFor):

Source/WTF:

* wtf/HashSet.h:
(WTF::=):

LayoutTests:

* js/parser-syntax-check-expected.txt:
* js/script-tests/parser-syntax-check.js:

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

2 years agoExpose public APIs for content filters
achristensen@apple.com [Fri, 10 Mar 2017 01:48:30 +0000 (01:48 +0000)]
Expose public APIs for content filters
https://bugs.webkit.org/show_bug.cgi?id=150479

Reviewed by Brady Eidson and Geoff Garen.

Source/WebCore:

* English.lproj/Localizable.strings:

Source/WebKit2:

This takes _WKUserContentExtensionStore and _WKUserContentFilter and turns them into the consistently-named public API
WKContentExtensionStore and WKContentExtension respectively with the same design and functionaly of the original SPI.
We also added public functions to WKUserContentController corresponding to existing private functions.

The old SPI ObjC classes are now just wrappers around the new ObjC classes, which are wrappers around C++ objects in the API namespace.

The peak-memory-reducing optimization of having NS_RELEASES_ARGUMENT in _compileContentExtensionForIdentifier is kept for Safari,
but the public API doesn't need such an optimization.  The public compileContentExtensionForIdentifier will not deallocate the input
NSString during compiling.

We moved the error codes into the WKErrorDomain, which requires changing the values of the error codes and domain, but source
compiled that uses the SPI before and after should still work.  Using new applications with old frameworks or vice versa will
have unexpected error codes, though.

* Shared/API/APIObject.h:
* Shared/API/c/WKDeprecatedFunctions.cpp:
(WKPageGroupAddUserContentFilter):
(WKPageGroupRemoveUserContentFilter):
* Shared/Cocoa/APIObject.mm:
(API::Object::newObject):
* UIProcess/API/APIContentExtension.cpp: Copied from UIProcess/API/APIUserContentExtension.cpp.
(API::ContentExtension::ContentExtension):
(API::ContentExtension::~ContentExtension):
(API::UserContentExtension::UserContentExtension): Deleted.
(API::UserContentExtension::~UserContentExtension): Deleted.
* UIProcess/API/APIContentExtension.h: Copied from UIProcess/API/APIUserContentExtension.h.
* UIProcess/API/APIContentExtensionStore.cpp: Copied from UIProcess/API/APIUserContentExtensionStore.cpp.
(API::ContentExtensionStore::defaultStore):
(API::ContentExtensionStore::storeWithPath):
(API::ContentExtensionStore::ContentExtensionStore):
(API::ContentExtensionStore::~ContentExtensionStore):
(API::compiledToFile):
(API::createExtension):
(API::ContentExtensionStore::lookupContentExtension):
(API::ContentExtensionStore::compileContentExtension):
(API::ContentExtensionStore::removeContentExtension):
(API::ContentExtensionStore::synchronousRemoveAllContentExtensions):
(API::ContentExtensionStore::invalidateContentExtensionVersion):
(API::contentExtensionStoreErrorCategory):
(API::UserContentExtensionStore::defaultStore): Deleted.
(API::UserContentExtensionStore::storeWithPath): Deleted.
(API::UserContentExtensionStore::UserContentExtensionStore): Deleted.
(API::UserContentExtensionStore::~UserContentExtensionStore): Deleted.
(API::UserContentExtensionStore::lookupContentExtension): Deleted.
(API::UserContentExtensionStore::compileContentExtension): Deleted.
(API::UserContentExtensionStore::removeContentExtension): Deleted.
(API::UserContentExtensionStore::synchronousRemoveAllContentExtensions): Deleted.
(API::UserContentExtensionStore::invalidateContentExtensionVersion): Deleted.
(API::userContentExtensionStoreErrorCategory): Deleted.
* UIProcess/API/APIContentExtensionStore.h: Copied from UIProcess/API/APIUserContentExtensionStore.h.
(API::make_error_code):
* UIProcess/API/APIUserContentExtension.cpp: Removed.
* UIProcess/API/APIUserContentExtension.h: Removed.
* UIProcess/API/APIUserContentExtensionStore.cpp: Removed.
* UIProcess/API/APIUserContentExtensionStore.h: Removed.
* UIProcess/API/C/WKAPICast.h:
* UIProcess/API/C/WKPageGroup.cpp:
* UIProcess/API/C/WKUserContentControllerRef.cpp:
(WKUserContentControllerAddUserContentFilter):
(WKUserContentControllerRemoveAllUserContentFilters):
* UIProcess/API/C/WKUserContentExtensionStoreRef.cpp:
(WKUserContentExtensionStoreGetTypeID):
* UIProcess/API/Cocoa/APIUserContentExtensionStoreCocoa.mm:
(API::ContentExtensionStore::defaultStorePath):
(API::UserContentExtensionStore::defaultStorePath): Deleted.
* UIProcess/API/Cocoa/WKContentExtension.h: Copied from UIProcess/API/Cocoa/_WKUserContentFilter.h.
* UIProcess/API/Cocoa/WKContentExtension.mm: Copied from UIProcess/API/Cocoa/_WKUserContentFilter.mm.
(-[WKContentExtension dealloc]):
(-[WKContentExtension _apiObject]):
(-[_WKUserContentFilter dealloc]): Deleted.
(-[_WKUserContentFilter _apiObject]): Deleted.
* UIProcess/API/Cocoa/WKContentExtensionInternal.h: Copied from UIProcess/API/Cocoa/_WKUserContentFilterInternal.h.
(WebKit::wrapper):
* UIProcess/API/Cocoa/WKContentExtensionStore.h: Copied from UIProcess/API/Cocoa/_WKUserContentExtensionStore.h.
* UIProcess/API/Cocoa/WKContentExtensionStore.mm: Copied from UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm.
(-[WKContentExtensionStore dealloc]):
(+[WKContentExtensionStore defaultStore]):
(+[WKContentExtensionStore storeWithURL:]):
(-[WKContentExtensionStore compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]):
(-[WKContentExtensionStore _compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:releasesArgument:]):
(-[WKContentExtensionStore lookupContentExtensionForIdentifier:completionHandler:]):
(-[WKContentExtensionStore removeContentExtensionForIdentifier:completionHandler:]):
(-[WKContentExtensionStore _apiObject]):
(-[WKContentExtensionStore _removeAllContentExtensions]):
(-[WKContentExtensionStore _invalidateContentExtensionVersionForIdentifier:]):
(-[WKContentExtensionStore _compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]):
(-[_WKUserContentExtensionStore dealloc]): Deleted.
(+[_WKUserContentExtensionStore defaultStore]): Deleted.
(+[_WKUserContentExtensionStore storeWithURL:]): Deleted.
(-[_WKUserContentExtensionStore compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]): Deleted.
(-[_WKUserContentExtensionStore lookupContentExtensionForIdentifier:completionHandler:]): Deleted.
(-[_WKUserContentExtensionStore removeContentExtensionForIdentifier:completionHandler:]): Deleted.
(-[_WKUserContentExtensionStore _apiObject]): Deleted.
(-[_WKUserContentExtensionStore _removeAllContentExtensions]): Deleted.
(-[_WKUserContentExtensionStore _invalidateContentExtensionVersionForIdentifier:]): Deleted.
* UIProcess/API/Cocoa/WKContentExtensionStoreInternal.h: Copied from UIProcess/API/Cocoa/_WKUserContentExtensionStoreInternal.h.
(WebKit::wrapper):
* UIProcess/API/Cocoa/WKContentExtensionStorePrivate.h: Copied from UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h.
* UIProcess/API/Cocoa/WKError.h:
* UIProcess/API/Cocoa/WKError.mm:
(localizedDescriptionForErrorCode):
* UIProcess/API/Cocoa/WKUserContentController.h:
* UIProcess/API/Cocoa/WKUserContentController.mm:
(-[WKUserContentController addContentExtension:]):
(-[WKUserContentController removeContentExtension:]):
(-[WKUserContentController removeAllContentExtensions]):
(-[WKUserContentController _addUserContentFilter:]):
(-[WKUserContentController _removeUserContentFilter:]):
(-[WKUserContentController _removeAllUserContentFilters]):
* UIProcess/API/Cocoa/_WKUserContentExtensionStore.h:
* UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm:
(+[_WKUserContentExtensionStore defaultStore]):
(+[_WKUserContentExtensionStore storeWithURL:]):
(-[_WKUserContentExtensionStore compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]):
(-[_WKUserContentExtensionStore lookupContentExtensionForIdentifier:completionHandler:]):
(-[_WKUserContentExtensionStore removeContentExtensionForIdentifier:completionHandler:]):
(-[_WKUserContentExtensionStore _apiObject]):
(-[_WKUserContentExtensionStore _removeAllContentExtensions]):
(-[_WKUserContentExtensionStore _invalidateContentExtensionVersionForIdentifier:]):
(-[_WKUserContentExtensionStore _initWithWKContentExtensionStore:]):
(-[_WKUserContentExtensionStore dealloc]): Deleted.
* UIProcess/API/Cocoa/_WKUserContentExtensionStoreInternal.h:
(WebKit::wrapper): Deleted.
* UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h:
* UIProcess/API/Cocoa/_WKUserContentFilter.mm:
(-[_WKUserContentFilter _apiObject]):
(-[_WKUserContentFilter _initWithWKContentExtension:]):
(-[_WKUserContentFilter dealloc]): Deleted.
* UIProcess/API/Cocoa/_WKUserContentFilterInternal.h:
(WebKit::wrapper): Deleted.
* UIProcess/API/Cocoa/_WKUserContentFilterPrivate.h: Added.
* UIProcess/UserContent/WebUserContentControllerProxy.cpp:
(WebKit::WebUserContentControllerProxy::addProcess):
(WebKit::WebUserContentControllerProxy::addContentExtension):
(WebKit::WebUserContentControllerProxy::removeContentExtension):
(WebKit::WebUserContentControllerProxy::removeAllContentExtensions):
(WebKit::WebUserContentControllerProxy::addUserContentExtension): Deleted.
(WebKit::WebUserContentControllerProxy::removeUserContentExtension): Deleted.
(WebKit::WebUserContentControllerProxy::removeAllUserContentExtensions): Deleted.
* UIProcess/UserContent/WebUserContentControllerProxy.h:
* UIProcess/WebPageGroup.cpp:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/UserContent/WebUserContentController.cpp:
(WebKit::WebUserContentController::addContentExtensions):
(WebKit::WebUserContentController::removeContentExtension):
(WebKit::WebUserContentController::removeAllContentExtensions):
(WebKit::WebUserContentController::addUserContentExtensions): Deleted.
(WebKit::WebUserContentController::removeUserContentExtension): Deleted.
(WebKit::WebUserContentController::removeAllUserContentExtensions): Deleted.
* WebProcess/UserContent/WebUserContentController.h:
* WebProcess/UserContent/WebUserContentController.messages.in:
* WebProcess/WebCoreSupport/mac/WebErrorsMac.mm:
(WebKit::blockedByContentFilterError):

Tools:

Keep the existing tests to verify that I made the wrapper classes for the old SPI work correctly.
Add new identical tests for the new API are added with the new names.
We should keep both until we migrate from and remove the old SPI.
Enum error code values and strings have changed, but the API is source compatible.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/WKUserContentExtensionStore.mm: Copied from Tools/TestWebKitAPI/Tests/WebKit2Cocoa/_WKUserContentExtensionStore.mm.
(WKUserContentExtensionStoreTest::SetUp):
(TEST_F):
(checkDomain):
(_WKUserContentExtensionStoreTest::SetUp): Deleted.
* TestWebKitAPI/Tests/WebKit2Cocoa/_WKUserContentExtensionStore.mm:
(checkDomain):

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

2 years agoImplement a StackTrace utility object that can capture stack traces for debugging.
mark.lam@apple.com [Fri, 10 Mar 2017 01:27:32 +0000 (01:27 +0000)]
Implement a StackTrace utility object that can capture stack traces for debugging.
https://bugs.webkit.org/show_bug.cgi?id=169454

Reviewed by Michael Saboff.

The underlying implementation is hoisted right out of Assertions.cpp from the
implementations of WTFPrintBacktrace().

The reason we need this StackTrace object is because during heap debugging, we
sometimes want to capture the stack trace that allocated the objects of interest.
Dumping the stack trace directly to stdout (using WTFReportBacktrace()) may
perturb the execution profile sufficiently that an issue may not reproduce,
while alternatively, just capturing the stack trace and deferring printing it
till we actually need it later perturbs the execution profile less.

In addition, just capturing the stack traces (instead of printing them
immediately at each capture site) allows us to avoid polluting stdout with tons
of stack traces that may be irrelevant.

For now, we only capture the native stack trace.  We'll leave capturing and
integrating the JS stack trace as an exercise for the future if we need it then.

Here's an example of how to use this StackTrace utility:

    // Capture a stack trace of the top 10 frames.
    std::unique_ptr<StackTrace> trace(StackTrace::captureStackTrace(10));
    // Print the trace.
    dataLog(*trace);

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* tools/StackTrace.cpp: Added.
(JSC::StackTrace::instanceSize):
(JSC::StackTrace::captureStackTrace):
(JSC::StackTrace::dump):
* tools/StackTrace.h: Added.
(JSC::StackTrace::StackTrace):
(JSC::StackTrace::size):

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

2 years agoAttempt to fix the WebKit2 test bots following <https://trac.webkit.org/changeset...
dbates@webkit.org [Fri, 10 Mar 2017 01:08:25 +0000 (01:08 +0000)]
Attempt to fix the WebKit2 test bots following <https://trac.webkit.org/changeset/213676>
(https://bugs.webkit.org/show_bug.cgi?id=169364)

Create new WebView with Credential Management enabled when the enableCredentialManagement
WebKitTestRunner option is specified.

* WebKitTestRunner/ios/PlatformWebViewIOS.mm:
(WTR::PlatformWebView::viewSupportsOptions):
* WebKitTestRunner/mac/PlatformWebViewMac.mm:
(WTR::PlatformWebView::viewSupportsOptions):

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

2 years agoFix some debug builds after r213686
beidson@apple.com [Fri, 10 Mar 2017 00:59:51 +0000 (00:59 +0000)]
Fix some debug builds after r213686

Unreviewed.

* UIProcess/Cocoa/WebURLSchemeHandlerCocoa.mm:
(WebKit::WebURLSchemeHandlerCocoa::WebURLSchemeHandlerCocoa): Remove the 32-bit NOT_REACHED protection for now.

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

2 years agoWebAssembly: Enable fast memory for WK2
keith_miller@apple.com [Fri, 10 Mar 2017 00:57:06 +0000 (00:57 +0000)]
WebAssembly: Enable fast memory for WK2
https://bugs.webkit.org/show_bug.cgi?id=169437

Reviewed by Tim Horton.

Source/JavaScriptCore:

* JavaScriptCore.xcodeproj/project.pbxproj:

Source/WebKit2:

I forgot to do this when I enabled implemented fast memory
for wasm.

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

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

2 years agoWeb Inspector: Add XHR breakpoints UI
mattbaker@apple.com [Fri, 10 Mar 2017 00:53:48 +0000 (00:53 +0000)]
Web Inspector: Add XHR breakpoints UI
https://bugs.webkit.org/show_bug.cgi?id=168763
<rdar://problem/30952439>

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/protocol/DOMDebugger.json:
Added clarifying comments to command descriptions.

Source/WebCore:

Test: inspector/dom-debugger/xhr-breakpoints.html

* inspector/InspectorDOMDebuggerAgent.cpp:
(WebCore::InspectorDOMDebuggerAgent::discardBindings):
(WebCore::InspectorDOMDebuggerAgent::willSendXMLHttpRequest):
Don't break for XHRs when breakpoints are disabled.

Source/WebInspectorUI:

* Localizations/en.lproj/localizedStrings.js:
New UI strings.

* UserInterface/Controllers/DOMDebuggerManager.js:
Plumbing for XHR breakpoints. Like DOM breakpoints, they are tracked
per-page. Unlike DOM breakpoints, they have no separate "resolved"
state, and are simply added/removed as the main frame changes.

(WebInspector.DOMDebuggerManager):
(WebInspector.DOMDebuggerManager.prototype.get allRequestsBreakpoint):
(WebInspector.DOMDebuggerManager.prototype.get xhrBreakpoints):
(WebInspector.DOMDebuggerManager.prototype.isBreakpointRemovable):
(WebInspector.DOMDebuggerManager.prototype.removeDOMBreakpoint):
(WebInspector.DOMDebuggerManager.prototype.addXHRBreakpoint):
(WebInspector.DOMDebuggerManager.prototype.removeXHRBreakpoint):
(WebInspector.DOMDebuggerManager.prototype._speculativelyResolveBreakpoints):
(WebInspector.DOMDebuggerManager.prototype._detachXHRBreakpoint):
(WebInspector.DOMDebuggerManager.prototype._updateXHRBreakpoint.breakpointUpdated):
(WebInspector.DOMDebuggerManager.prototype._updateXHRBreakpoint):
(WebInspector.DOMDebuggerManager.prototype._resolveXHRBreakpoint):
(WebInspector.DOMDebuggerManager.prototype._saveXHRBreakpoints):
(WebInspector.DOMDebuggerManager.prototype._domBreakpointDisabledStateDidChange):
(WebInspector.DOMDebuggerManager.prototype._xhrBreakpointDisabledStateDidChange):
(WebInspector.DOMDebuggerManager.prototype._mainResourceDidChange):
(WebInspector.DOMDebuggerManager.prototype._saveBreakpoints): Deleted.
Renamed `saveDOMBreakpoints`.

* UserInterface/Controllers/DebuggerManager.js:
(WebInspector.DebuggerManager.prototype._pauseReasonFromPayload):
Plumbing for XHR breakpoint pause reason.

* UserInterface/Controllers/XHRBreakpointTreeController.js: Added.
Creates the "All Requests" breakpoint, handles DOMDebuggerManager messages,
and updates an associated tree outline as XHR breakpoints are added and removed.

(WebInspector.XHRBreakpointTreeController):
(WebInspector.XHRBreakpointTreeController.prototype.revealAndSelect):
(WebInspector.XHRBreakpointTreeController.prototype.disconnect):
(WebInspector.XHRBreakpointTreeController.prototype._xhrBreakpointAdded):
(WebInspector.XHRBreakpointTreeController.prototype._xhrBreakpointRemoved):
(WebInspector.XHRBreakpointTreeController.prototype._mainResourceDidChange):
(WebInspector.XHRBreakpointTreeController.prototype._reset):

* UserInterface/Main.html:
New files.

* UserInterface/Models/XHRBreakpoint.js: Added.
New model class. XHR breakpoints have an associated URL, which is matched
against the request URL when deciding whether to break. An empty URL matches
all XMLHttpRequests.

(WebInspector.XHRBreakpoint):
(WebInspector.XHRBreakpoint.prototype.get documentURL):
(WebInspector.XHRBreakpoint.prototype.get url):
(WebInspector.XHRBreakpoint.prototype.get disabled):
(WebInspector.XHRBreakpoint.prototype.set disabled):
(WebInspector.XHRBreakpoint.prototype.get serializableInfo):
(WebInspector.XHRBreakpoint.prototype.saveIdentityToCookie):

* UserInterface/Test.html:
New files.

* UserInterface/Views/ContentView.js:
(WebInspector.ContentView.createFromRepresentedObject):
Plumbing for new represented object type, to prevent runtime assertion.

* UserInterface/Views/DOMBreakpointTreeElement.js:
(WebInspector.DOMBreakpointTreeElement):
Reuse BreakpointTreeElement styles.

* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel):
(WebInspector.DebuggerSidebarPanel.prototype.saveStateToCookie):
(WebInspector.DebuggerSidebarPanel.prototype.restoreStateFromCookie):
(WebInspector.DebuggerSidebarPanel.prototype._updatePauseReasonSection):
(WebInspector.DebuggerSidebarPanel.prototype._addXHRBreakpointButtonClicked):
(WebInspector.DebuggerSidebarPanel.prototype.willDismissPopover):

* UserInterface/Views/InputPopover.css: Added.
(.popover .input-popover-content):
(.popover .input-popover-content > .editor):
(.popover .input-popover-content > .editor > .CodeMirror):
(.popover .input-popover-content > .editor > .CodeMirror-scroll):

* UserInterface/Views/InputPopover.js: Added.
New general purpose popover class. Style and structure lifted from
the Popover implementation used by the Probe Expressions UI. A follow-up
has been filed to switch that UI over to this new class:
https://bugs.webkit.org/show_bug.cgi?id=169428.

(WebInspector.InputPopover):
(WebInspector.InputPopover.prototype.get value):
(WebInspector.InputPopover.prototype.get result):
(WebInspector.InputPopover.prototype.show):
(WebInspector.InputPopover.prototype._presentOverTargetElement):

* UserInterface/Views/XHRBreakpointTreeElement.js: Added.
Tree element class for XHR breakpoints. Behaves identically to
script and DOM breakpoint tree elements.

(WebInspector.XHRBreakpointTreeElement):
Reuse BreakpointTreeElement styles.
(WebInspector.XHRBreakpointTreeElement.prototype.onattach):
(WebInspector.XHRBreakpointTreeElement.prototype.ondetach):
(WebInspector.XHRBreakpointTreeElement.prototype.ondelete):
(WebInspector.XHRBreakpointTreeElement.prototype.onenter):
(WebInspector.XHRBreakpointTreeElement.prototype.onspace):
(WebInspector.XHRBreakpointTreeElement.prototype.populateContextMenu):
(WebInspector.XHRBreakpointTreeElement.prototype._statusImageElementClicked):
(WebInspector.XHRBreakpointTreeElement.prototype._statusImageElementFocused):
(WebInspector.XHRBreakpointTreeElement.prototype._statusImageElementMouseDown):
(WebInspector.XHRBreakpointTreeElement.prototype._toggleBreakpoint):
(WebInspector.XHRBreakpointTreeElement.prototype._updateStatus):

LayoutTests:

Tests for pausing on XMLHttpRequests using XHR breakpoints.

* inspector/dom-debugger/xhr-breakpoints-expected.txt: Added.
* inspector/dom-debugger/xhr-breakpoints.html: Added.

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

2 years agoSource/JavaScriptCore:
msaboff@apple.com [Fri, 10 Mar 2017 00:53:09 +0000 (00:53 +0000)]
Source/JavaScriptCore:
Add plumbing to WebProcess to enable JavaScriptCore configuration and logging
https://bugs.webkit.org/show_bug.cgi?id=169387

Reviewed by Filip Pizlo.

Added a helper function, processConfigFile(), to process configuration file.
Changed jsc.cpp to use that function in lieu of processing the config file
manually.

* JavaScriptCore.xcodeproj/project.pbxproj: Made ConfigFile.h a private header file.
* jsc.cpp:
(jscmain):
* runtime/ConfigFile.cpp:
(JSC::processConfigFile):
* runtime/ConfigFile.h:

Source/WebCore:
Add plumbing to WebProcess to enable JavaScriptCore configuration and logging
https://bugs.webkit.org/show_bug.cgi?id=169387

Reviewed by Filip Pizlo.

Added a forwarding header file for JavScriptCore/runtime/ConfigFile.h.

* ForwardingHeaders/runtime/ConfigFile.h: Added.

Source/WebKit2:
<<<<<<< .mine

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

2 years agoREGRESSION (r196271): Web Inspector: DOM element loses focus/active selection after...
mattbaker@apple.com [Fri, 10 Mar 2017 00:52:07 +0000 (00:52 +0000)]
REGRESSION (r196271): Web Inspector: DOM element loses focus/active selection after committing an inline attribute editor in DOMTreeOutline
https://bugs.webkit.org/show_bug.cgi?id=168119
<rdar://problem/30466013>

Reviewed by Brian Burg.

Fix a regression caused by http://trac.webkit.org/changeset/196271, which
updated WebInspector.isEventTargetAnEditableField to detect the editing
scenarios used by DOMTreeElement and DataGrid. This subtly changed the
behavior of WebInspector._focusChanged, which expected all editable fields
to be backed by a CodeMirror instance.

* UserInterface/Base/Main.js:

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

2 years agoResource Load Statistics: Remove statistics data as part of full website data removal
wilander@apple.com [Fri, 10 Mar 2017 00:46:25 +0000 (00:46 +0000)]
Resource Load Statistics: Remove statistics data as part of full website data removal
https://bugs.webkit.org/show_bug.cgi?id=169448

Reviewed by Alex Christensen.

Source/WebCore:

Test: http/tests/loading/resourceLoadStatistics/clear-in-memory-and-persistent-store.html

* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::clearInMemoryAndPersistentStore):
    The version of this function that takes a modifiedSince parameter
    checks if it is equal to or less than the start of the Unix epoch.
    If so, it clears the store. This is to support clear all website
    data.
* loader/ResourceLoadObserver.h:
* loader/ResourceLoadStatisticsStore.cpp:
(WebCore::ResourceLoadStatisticsStore::clearInMemoryAndPersistent):
(WebCore::ResourceLoadStatisticsStore::setWritePersistentStoreCallback):
* loader/ResourceLoadStatisticsStore.h:
    Added m_writePersistentStoreHandler, a setter for it, and
    ResourceLoadStatisticsStore::clearInMemoryAndPersistent().

Source/WebKit2:

* UIProcess/API/C/WKResourceLoadStatisticsManager.cpp:
(WKResourceLoadStatisticsManagerClearInMemoryAndPersistentStore):
    Infrastructure for test.
* UIProcess/API/C/WKResourceLoadStatisticsManager.h:
* UIProcess/WebResourceLoadStatisticsManager.cpp:
(WebKit::WebResourceLoadStatisticsManager::clearInMemoryAndPersistentStore):
    Infrastructure for test.
* UIProcess/WebResourceLoadStatisticsManager.h:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
    Change due to the break-out of
    WebResourceLoadStatisticsStore::writeStoreToDisk().
(WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver):
    Now sets m_writePersistentStoreHandler in
    WebCore::ResourceLoadStatisticsStore.
(WebKit::WebResourceLoadStatisticsStore::writeStoreToDisk):
    Separated out this function to make it available for the function set as
    m_writePersistentStoreHandler in WebCore::ResourceLoadStatisticsStore.
* UIProcess/WebResourceLoadStatisticsStore.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::removeData):
    Both WebsiteDataStore::removeData() functions now cover resource load
    statistics.

Tools:

This patch adds infrastructure for the new TestRunner function
statisticsClearInMemoryAndPersistentStore().

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::statisticsClearInMemoryAndPersistentStore):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::statisticsClearInMemoryAndPersistentStore):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):

LayoutTests:

* http/tests/loading/resourceLoadStatistics/clear-in-memory-and-persistent-store-expected.txt: Added.
* http/tests/loading/resourceLoadStatistics/clear-in-memory-and-persistent-store.html: Added.
* platform/wk2/TestExpectations:
    Marked as [ Pass ] for WebKit2.

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

2 years agoOnly consider autoplay interference in the first 10 seconds of playback.
mrajca@apple.com [Fri, 10 Mar 2017 00:44:42 +0000 (00:44 +0000)]
Only consider autoplay interference in the first 10 seconds of playback.
https://bugs.webkit.org/show_bug.cgi?id=169455

Reviewed by Alex Christensen.

If the media duration is relatively long, say, 10 minutes, and you pause 5 minutes in, that's
probably not a strong indication users may not want auto-play. This patch limits interference
events to the first 10 seconds of automatic playback.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setReadyState):
(WebCore::HTMLMediaElement::play):
(WebCore::HTMLMediaElement::playInternal):
(WebCore::HTMLMediaElement::pauseInternal):
(WebCore::HTMLMediaElement::setMuted):
(WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
(WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer):
(WebCore::HTMLMediaElement::userDidInterfereWithAutoplay):
(WebCore::HTMLMediaElement::setPlaybackWithoutUserGesture):
(WebCore::HTMLMediaElement::pageMutedStateDidChange):
* html/HTMLMediaElement.h:

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

2 years agoAdd WKURLSchemeHandler API for handling custom protocols.
beidson@apple.com [Fri, 10 Mar 2017 00:38:20 +0000 (00:38 +0000)]
Add WKURLSchemeHandler API for handling custom protocols.
https://bugs.webkit.org/show_bug.cgi?id=169422

Reviewed by Tim Horton.

Source/WebCore:

* platform/URLParser.cpp:
(WebCore::URLParser::maybeCanonicalizeScheme):
(WebCore::URLParser::isSpecialScheme):
* platform/URLParser.h:

Source/WebKit2:

This introduces two new protocols to the WK2 API surface:
- WKURLSchemeHandler
- WKURLSchemeHandlerTask

By registering an object that conforms to the WKURLSchemeHandler protocol with a WKWebViewConfiguration an application will
be handed an object conforming to WKURLSchemeHandlerTask for each resource load in that WKWebView with a custom URL scheme.

Using that id <WKURLSchemeHandlerTask>, the application can communicate the data for the resource back to WebKit.

* Shared/API/APIObject.h:
* Shared/Cocoa/APIObject.mm:
(API::Object::newObject):

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:

* UIProcess/API/APIURLSchemeHandlerTask.cpp:
(API::URLSchemeHandlerTask::create):
(API::URLSchemeHandlerTask::URLSchemeHandlerTask):
* UIProcess/API/APIURLSchemeHandlerTask.h:

Add the WKURLSchemeHandler @protocol:
* UIProcess/API/Cocoa/WKURLSchemeHandler.h: Added.

Add the WKURLSchemeHandlerTask @protocol, as well as WebKit's concrete implementation of it:
* UIProcess/API/Cocoa/WKURLSchemeHandlerTask.h: Added.
* UIProcess/API/Cocoa/WKURLSchemeHandlerTask.mm: Added.
(raiseExceptionIfNecessary):
(-[WKURLSchemeHandlerTaskImpl request]):
(-[WKURLSchemeHandlerTaskImpl didReceiveResponse:]):
(-[WKURLSchemeHandlerTaskImpl didReceiveData:]):
(-[WKURLSchemeHandlerTaskImpl didFinish]):
(-[WKURLSchemeHandlerTaskImpl didFailWithError:]):
(-[WKURLSchemeHandlerTaskImpl _apiObject]):
* UIProcess/API/Cocoa/WKURLSchemeHandlerTaskInternal.h:
(WebKit::wrapper):

* UIProcess/API/Cocoa/WKWebView.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
(-[WKWebView urlSchemeHandlerForURLScheme:]):
(+[WKWebView handlesURLScheme:]):

* UIProcess/API/Cocoa/WKWebViewConfiguration.h:
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration copyWithZone:]):
(-[WKWebViewConfiguration setURLSchemeHandler:forURLScheme:]):
(-[WKWebViewConfiguration urlSchemeHandlerForURLScheme:]):
(-[WKWebViewConfiguration _urlSchemeHandlers]):
* UIProcess/API/Cocoa/WKWebViewConfigurationInternal.h:

* UIProcess/Cocoa/WebURLSchemeHandlerCocoa.h:
(WebKit::WebURLSchemeHandlerCocoa::apiHandler):
* UIProcess/Cocoa/WebURLSchemeHandlerCocoa.mm: Added.
(WebKit::WebURLSchemeHandlerCocoa::create):
(WebKit::WebURLSchemeHandlerCocoa::WebURLSchemeHandlerCocoa):
(WebKit::WebURLSchemeHandlerCocoa::platformStartTask):
(WebKit::WebURLSchemeHandlerCocoa::platformStopTask):

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
(WebKit::WebPageProxy::setURLSchemeHandlerForScheme):
(WebKit::WebPageProxy::urlSchemeHandlerForScheme):
(WebKit::WebPageProxy::startURLSchemeHandlerTask):
(WebKit::WebPageProxy::stopURLSchemeHandlerTask):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:

* UIProcess/WebURLSchemeHandler.cpp:
(WebKit::generateWebURLSchemeHandlerIdentifier):
(WebKit::WebURLSchemeHandler::WebURLSchemeHandler):
(WebKit::WebURLSchemeHandler::~WebURLSchemeHandler):
(WebKit::WebURLSchemeHandler::startTask):
(WebKit::WebURLSchemeHandler::stopTask):
* UIProcess/WebURLSchemeHandler.h:
(WebKit::WebURLSchemeHandler::identifier):

* UIProcess/WebURLSchemeHandlerTask.cpp: Added.
(WebKit::WebURLSchemeHandlerTask::create):
(WebKit::WebURLSchemeHandlerTask::WebURLSchemeHandlerTask):
(WebKit::WebURLSchemeHandlerTask::didReceiveResponse):
(WebKit::WebURLSchemeHandlerTask::didReceiveData):
(WebKit::WebURLSchemeHandlerTask::didComplete):
(WebKit::WebURLSchemeHandlerTask::pageDestroyed):
(WebKit::WebURLSchemeHandlerTask::stop):
* UIProcess/WebURLSchemeHandlerTask.h: Added.
(WebKit::WebURLSchemeHandlerTask::identifier):
(WebKit::WebURLSchemeHandlerTask::request):

* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoad):
(WebKit::WebLoaderStrategy::remove):
* WebProcess/Network/WebLoaderStrategy.h:

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::urlSchemeHandlerForScheme):
(WebKit::WebPage::registerURLSchemeHandler):
(WebKit::WebPage::urlSchemeHandlerTaskDidReceiveResponse):
(WebKit::WebPage::urlSchemeHandlerTaskDidReceiveData):
(WebKit::WebPage::urlSchemeHandlerTaskDidComplete):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

* WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp: Added.
(WebKit::WebURLSchemeHandlerProxy::WebURLSchemeHandlerProxy):
(WebKit::WebURLSchemeHandlerProxy::~WebURLSchemeHandlerProxy):
(WebKit::WebURLSchemeHandlerProxy::startNewTask):
(WebKit::WebURLSchemeHandlerProxy::taskDidReceiveResponse):
(WebKit::WebURLSchemeHandlerProxy::taskDidReceiveData):
(WebKit::WebURLSchemeHandlerProxy::taskDidComplete):
* WebProcess/WebPage/WebURLSchemeHandlerProxy.h:
(WebKit::WebURLSchemeHandlerProxy::identifier):
(WebKit::WebURLSchemeHandlerProxy::page):

* WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.cpp: Added.
(WebKit::WebURLSchemeHandlerTaskProxy::WebURLSchemeHandlerTaskProxy):
(WebKit::WebURLSchemeHandlerTaskProxy::startLoading):
(WebKit::WebURLSchemeHandlerTaskProxy::stopLoading):
(WebKit::WebURLSchemeHandlerTaskProxy::didReceiveResponse):
(WebKit::WebURLSchemeHandlerTaskProxy::didReceiveData):
(WebKit::WebURLSchemeHandlerTaskProxy::didComplete):
* WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.h:
(WebKit::WebURLSchemeHandlerTaskProxy::request):

* WebKit2.xcodeproj/project.pbxproj:
* CMakeLists.txt:

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

2 years agoUnreviewed follow-up to r213682.
joepeck@webkit.org [Fri, 10 Mar 2017 00:16:02 +0000 (00:16 +0000)]
Unreviewed follow-up to r213682.

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
Forward declare SPIs to address possible build errors.

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

2 years agoWebGPU: Backend - Buffers
dino@apple.com [Fri, 10 Mar 2017 00:00:41 +0000 (00:00 +0000)]
WebGPU: Backend - Buffers
https://bugs.webkit.org/show_bug.cgi?id=169451
<rdar://problem/30959168>

Reviewed by Tim Horton.

Source/WebCore:

Implement the backend for GPUBuffer, which
represents a chunk of memory that can be used
by the GPU. You create one using an ArrayBufferView.

WebKit API Test: GPUBuffer.mm

* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/cocoa/GPUBufferMetal.mm:
(WebCore::GPUBuffer::GPUBuffer):
(WebCore::GPUBuffer::length):
(WebCore::GPUBuffer::contents):
(WebCore::GPUBuffer::platformBuffer):
* platform/graphics/gpu/GPUBuffer.cpp:
(WebCore::GPUBuffer::create):
(WebCore::GPUBuffer::~GPUBuffer):
(WebCore::GPUBuffer::length):
(WebCore::GPUBuffer::contents):
* platform/graphics/gpu/GPUBuffer.h:
* platform/graphics/gpu/GPUDevice.cpp:
(WebCore::GPUDevice::createBufferFromData):
* platform/graphics/gpu/GPUDevice.h:

Tools:

Test for GPUBuffer object.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebCore/mac/GPUBuffer.mm: Added.
(TestWebKitAPI::TEST_F):
* TestWebKitAPI/Tests/WebCore/mac/GPUFunction.mm:
* TestWebKitAPI/Tests/WebCore/mac/GPULibrary.mm:

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

2 years agoWKWebView should provide a way for clients to know the specific media state.
commit-queue@webkit.org [Thu, 9 Mar 2017 23:58:02 +0000 (23:58 +0000)]
WKWebView should provide a way for clients to know the specific media state.
https://bugs.webkit.org/show_bug.cgi?id=169140
<rdar://problem/30838285>

Patch by Andrew Gold <agold@apple.com> on 2017-03-09
Reviewed by Alex Christensen.

Instead of notifying the UIDelegate only when a capture begins and ends,
we now notify the UIDelegate of any change in capture state.

* UIProcess/API/APIUIClient.h:

(API::UIClient::mediaCaptureStateDidChange):
(API::UIClient::didBeginCaptureSession): Deleted.
(API::UIClient::didEndCaptureSession): Deleted.

* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:

* UIProcess/API/Cocoa/WKWebViewPrivate.h:

* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::setDelegate):
(WebKit::UIDelegate::UIClient::mediaCaptureStateDidChange):
(WebKit::UIDelegate::UIClient::didBeginCaptureSession): Deleted.
(WebKit::UIDelegate::UIClient::didEndCaptureSession): Deleted.

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

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

2 years agoWeb Inspector: Show HTTP protocol version and other Network Load Metrics (IP Address...
joepeck@webkit.org [Thu, 9 Mar 2017 23:44:12 +0000 (23:44 +0000)]
Web Inspector: Show HTTP protocol version and other Network Load Metrics (IP Address, Priority, Connection ID)
https://bugs.webkit.org/show_bug.cgi?id=29687
<rdar://problem/19281586>

Reviewed by Matt Baker and Brian Burg.

Source/JavaScriptCore:

* inspector/protocol/Network.json:
Add metrics object with optional properties to loadingFinished event.

Source/WebCore:

Test: http/tests/inspector/network/resource-metrics.html

* inspector/InspectorNetworkAgent.cpp:
(WebCore::toProtocol):
(WebCore::InspectorNetworkAgent::buildObjectForMetrics):
(WebCore::InspectorNetworkAgent::didFinishLoading):
Send metrics at didFinishLoading time, we do not have all of
these at didReceiveResponse time.

* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didFinishLoadingImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didFinishLoading):
* inspector/InspectorNetworkAgent.h:
* loader/CrossOriginPreflightChecker.cpp:
(WebCore::CrossOriginPreflightChecker::validatePreflightResponse):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::finishedLoading):
* loader/ResourceLoadNotifier.cpp:
(WebCore::ResourceLoadNotifier::didFinishLoad):
(WebCore::ResourceLoadNotifier::dispatchDidFinishLoading):
(WebCore::ResourceLoadNotifier::sendRemainingDelegateMessages):
* loader/ResourceLoadNotifier.h:
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didFinishLoading):
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::didFinishLoading):
Include or pass on NetworkLoadMetrics to Web Inspector.

* platform/network/NetworkLoadMetrics.h:
(WebCore::NetworkLoadMetrics::isolatedCopy):
(WebCore::NetworkLoadMetrics::reset):
(WebCore::NetworkLoadMetrics::operator==):
(WebCore::NetworkLoadMetrics::encode):
(WebCore::NetworkLoadMetrics::decode):
Add new optional metrics properties.

(WTF::Persistence::Coder<std::optional<WebCore::NetworkLoadPriority>>::encode):
(WTF::Persistence::Coder<std::optional<WebCore::NetworkLoadPriority>>::decode):
We never encode this but this is needed for the compiler.

* platform/spi/cocoa/NSURLConnectionSPI.h:
New SPI for NSURLSessionTaskTransactionMetrics details.

Source/WebInspectorUI:

These columns are available in the Network DataGrids, but are
initially hidden. They can be shown by right clicking on the
table header and showing these columns. We are going to rework
the default list of visible columns later.

* Localizations/en.lproj/localizedStrings.js:
New localized strings for data grid headers and Low/Medium/High.

* UserInterface/Controllers/FrameResourceManager.js:
(WebInspector.FrameResourceManager.prototype.resourceRequestDidFinishLoading):
* UserInterface/Protocol/NetworkObserver.js:
(WebInspector.NetworkObserver.prototype.loadingFinished):
Pass metrics on to the Resource.

* UserInterface/Models/Resource.js:
(WebInspector.Resource):
(WebInspector.Resource.displayNameForType):
(WebInspector.Resource.responseSourceFromPayload):
(WebInspector.Resource.networkPriorityFromPayload):
(WebInspector.Resource.connectionIdentifierFromPayload):
(WebInspector.Resource.prototype.get protocol):
(WebInspector.Resource.prototype.get priority):
(WebInspector.Resource.prototype.get remoteAddress):
(WebInspector.Resource.prototype.get connectionIdentifier):
(WebInspector.Resource.prototype.updateWithMetrics):
Include metrics accessors and default values.

* UserInterface/Views/NetworkGridContentView.js:
(WebInspector.NetworkGridContentView):
* UserInterface/Views/NetworkTimelineView.js:
(WebInspector.NetworkTimelineView):
Add metrics columns if the backend may be sending them.

* UserInterface/Views/ResourceTimelineDataGridNode.js:
(WebInspector.ResourceTimelineDataGridNode.prototype.get data):
(WebInspector.ResourceTimelineDataGridNode.prototype.createCellContent):
(WebInspector.ResourceTimelineDataGridNode.prototype._displayNameForPriority):
(WebInspector.ResourceTimelineDataGridNode.prototype._cachedCellContent):
Display strings for new columns.

* UserInterface/Views/TimelineDataGridNode.js:
* UserInterface/Views/TimelineRecordBar.js:
(WebInspector.TimelineRecordBar.prototype.refresh):
Avoid assertions if Graph column is unavailable.

* UserInterface/Views/DataGrid.js:
(WebInspector.DataGrid):
(WebInspector.DataGrid.prototype.createSettings):
(WebInspector.DataGrid.prototype.setColumnVisible):
Better support for restoring user preference of initially
hidden columns which the user may have shown.

* UserInterface/Views/ResourceDetailsSidebarPanel.js:
(WebInspector.ResourceDetailsSidebarPanel):
(WebInspector.ResourceDetailsSidebarPanel.prototype._refreshRequestAndResponse):
Show the Protocol and Priority in the Resources sidebar.

Source/WebKit2:

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(toNetworkLoadPriority):
(-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
* Shared/WebCoreArgumentCoders.h:
Additional optional metrics on NetworkLoadMetrics.

LayoutTests:

* http/tests/inspector/network/resource-metrics-expected.txt: Added.
* http/tests/inspector/network/resource-metrics.html: Added.

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

2 years agoAdd iOS baseline for compositing/contents-format/subpixel-antialiased-text-traversal.
ryanhaddad@apple.com [Thu, 9 Mar 2017 23:21:19 +0000 (23:21 +0000)]
Add iOS baseline for compositing/contents-format/subpixel-antialiased-text-traversal.

Unreviewed test gardening.

* platform/ios-simulator/compositing/contents-format/subpixel-antialiased-text-traversal-expected.txt: Added.

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

2 years agoMinimal build is broken
commit-queue@webkit.org [Thu, 9 Mar 2017 23:14:20 +0000 (23:14 +0000)]
Minimal build is broken
https://bugs.webkit.org/show_bug.cgi?id=169416

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

Since we now have some JS built-ins that are not tied to a compilation flag, we can remove compilation guards around m_vm.
We could probably remove m_vm by ensuring m_jsDOMBindingInternals appear first but this might break very easily.

* Scripts/builtins/builtins_generate_internals_wrapper_header.py:
(generate_members):
* Scripts/builtins/builtins_generate_internals_wrapper_implementation.py:
(BuiltinsInternalsWrapperImplementationGenerator.generate_constructor):
* Scripts/tests/builtins/expected/WebCoreJSBuiltins.h-result:

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

2 years agoUse the right conditional.
andersca@apple.com [Thu, 9 Mar 2017 22:49:45 +0000 (22:49 +0000)]
Use the right conditional.

* Modules/applepay/ApplePayError.idl:

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

2 years agoActivate VideoToolbox when WebRTC is enabled on iOS
commit-queue@webkit.org [Thu, 9 Mar 2017 22:47:29 +0000 (22:47 +0000)]
Activate VideoToolbox when WebRTC is enabled on iOS
https://bugs.webkit.org/show_bug.cgi?id=169423

Patch by Youenn Fablet <youenn@apple.com> on 2017-03-09
Reviewed by Jon Lee.

* wtf/Platform.h: Activate VIDEOTOOLBOX if WEBRTC is enabled.

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

2 years agoGuard Credential Management implementation behind a runtime enabled feature flag
dbates@webkit.org [Thu, 9 Mar 2017 22:47:01 +0000 (22:47 +0000)]
Guard Credential Management implementation behind a runtime enabled feature flag
https://bugs.webkit.org/show_bug.cgi?id=169364
<rdar://problem/30957425>

Reviewed by Brent Fulgham.

Add common identifiers for Credential, PasswordCredential, and SiteBoundCredential that are
needed to guard these interfaces behind a runtime enabled feature flag.

* runtime/CommonIdentifiers.h:

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

2 years agoGuard Credential Management implementation behind a runtime enabled feature flag
dbates@webkit.org [Thu, 9 Mar 2017 22:40:25 +0000 (22:40 +0000)]
Guard Credential Management implementation behind a runtime enabled feature flag
https://bugs.webkit.org/show_bug.cgi?id=169364
<rdar://problem/30957425>

Reviewed by Brent Fulgham.

Source/JavaScriptCore:

Add common identifiers for Credential, PasswordCredential, and SiteBoundCredential that are
needed to guard these interfaces behind a runtime enabled feature flag.

* runtime/CommonIdentifiers.h:

Source/WebCore:

Add a runtime enabled feature flag for Credential Management (disabled by default).
Once we are happy with this feature we can enable the feature by default or remove the
the runtime enabled feature flag so as to enable it by default.

* Modules/credentials/BasicCredential.idl: Enable only if the runtime enabled feature flag is
 enabled.
* Modules/credentials/PasswordCredential.idl: Ditto.
* Modules/credentials/SiteBoundCredential.idl: Ditto.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setCredentialManagementEnabled): Added.
(WebCore::RuntimeEnabledFeatures::credentialManagementEnabled): Added.

Source/WebKit/mac:

Add WebKit preference for Credential Management (disabled by default).

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences credentialManagementEnabled]): Added.
(-[WebPreferences setCredentialManagementEnabled:]): Added.
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKit2:

Add WebKit2 preference for Credential Management (disabled by default).

* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetCredentialManagementEnabled): Added.
(WKPreferencesGetCredentialManagementEnabled): Added.
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

Tools:

Add a new test option header, enableCredentialManagement, to DumpRenderTree/WebKitTestRunner
to enable Credential Management.

* DumpRenderTree/TestOptions.h:
* DumpRenderTree/TestOptions.mm:
(TestOptions::TestOptions):
* DumpRenderTree/mac/DumpRenderTree.mm:
(enableExperimentalFeatures):
(setWebPreferencesForTestOptions):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):
(WTR::updateTestOptionsFromTestHeader):
* WebKitTestRunner/TestOptions.h:

LayoutTests:

* credentials/idlharness.html: Use comment header to enable Credential Management API.
* platform/mac-elcapitan/js/dom/global-constructors-attributes-expected.txt: Update expected results now
that we no longer expose the Credential Management API by default.
* platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt: Ditto.
* platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt: Ditto.
* platform/mac/js/dom/global-constructors-attributes-expected.txt: Ditto.
* platform/win/TestExpectations: For now, skip the Credential Management API tests.

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

2 years agoRefactoring some HeapVerifier code.
mark.lam@apple.com [Thu, 9 Mar 2017 22:39:09 +0000 (22:39 +0000)]
Refactoring some HeapVerifier code.
https://bugs.webkit.org/show_bug.cgi?id=169443

Reviewed by Filip Pizlo.

Renamed LiveObjectData to CellProfile.
Renamed LiveObjectList to CellList.
Moved CellProfile.*, CellList.*, and HeapVerifier.* from the heap folder to the tools folder.
Updated the HeapVerifier to handle JSCells instead of just JSObjects.

This is in preparation for subsequent patches to fix up the HeapVerifier for service again.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* heap/Heap.cpp:
(JSC::Heap::runBeginPhase):
(JSC::Heap::runEndPhase):
* heap/HeapVerifier.cpp: Removed.
* heap/HeapVerifier.h: Removed.
* heap/LiveObjectData.h: Removed.
* heap/LiveObjectList.cpp: Removed.
* heap/LiveObjectList.h: Removed.
* tools/CellList.cpp: Copied from Source/JavaScriptCore/heap/LiveObjectList.cpp.
(JSC::CellList::findCell):
(JSC::LiveObjectList::findObject): Deleted.
* tools/CellList.h: Copied from Source/JavaScriptCore/heap/LiveObjectList.h.
(JSC::CellList::CellList):
(JSC::CellList::reset):
(JSC::LiveObjectList::LiveObjectList): Deleted.
(JSC::LiveObjectList::reset): Deleted.
* tools/CellProfile.h: Copied from Source/JavaScriptCore/heap/LiveObjectData.h.
(JSC::CellProfile::CellProfile):
(JSC::LiveObjectData::LiveObjectData): Deleted.
* tools/HeapVerifier.cpp: Copied from Source/JavaScriptCore/heap/HeapVerifier.cpp.
(JSC::GatherCellFunctor::GatherCellFunctor):
(JSC::GatherCellFunctor::visit):
(JSC::GatherCellFunctor::operator()):
(JSC::HeapVerifier::gatherLiveCells):
(JSC::HeapVerifier::cellListForGathering):
(JSC::trimDeadCellsFromList):
(JSC::HeapVerifier::trimDeadCells):
(JSC::HeapVerifier::verifyButterflyIsInStorageSpace):
(JSC::HeapVerifier::reportCell):
(JSC::HeapVerifier::checkIfRecorded):
(JSC::GatherLiveObjFunctor::GatherLiveObjFunctor): Deleted.
(JSC::GatherLiveObjFunctor::visit): Deleted.
(JSC::GatherLiveObjFunctor::operator()): Deleted.
(JSC::HeapVerifier::gatherLiveObjects): Deleted.
(JSC::HeapVerifier::liveObjectListForGathering): Deleted.
(JSC::trimDeadObjectsFromList): Deleted.
(JSC::HeapVerifier::trimDeadObjects): Deleted.
(JSC::HeapVerifier::reportObject): Deleted.
* tools/HeapVerifier.h: Copied from Source/JavaScriptCore/heap/HeapVerifier.h.

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

2 years ago[iOS] Add SPI to print to a single tall PDF page
aestes@apple.com [Thu, 9 Mar 2017 22:37:13 +0000 (22:37 +0000)]
[iOS] Add SPI to print to a single tall PDF page
https://bugs.webkit.org/show_bug.cgi?id=169439
<rdar://problem/30120532>

Reviewed by Tim Horton.

* Shared/PrintInfo.cpp:
(WebKit::PrintInfo::encode): Encoded snapshotFirstPage.
(WebKit::PrintInfo::decode): Decoded snapshotFirstPage.
(WebKit::PrintInfo::PrintInfo): Deleted.
* Shared/PrintInfo.h: Initialized member variables in place instead of in a default ctor.
* UIProcess/_WKWebViewPrintFormatter.h: Declared BOOL property snapshotFirstPage.
* UIProcess/_WKWebViewPrintFormatter.mm:
(-[_WKWebViewPrintFormatter _setSnapshotPaperRect:]): Added to set a custom paper size.
(-[_WKWebViewPrintFormatter rectForPageAtIndex:]): Returned the custom paper rect if
snapshotFirstPage is true.
* UIProcess/_WKWebViewPrintFormatterInternal.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _wk_pageCountForPrintFormatter:]): Computed the custom paper size to be the
smaller of the document height and the maximum PDF page height.
* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView _wk_pageCountForPrintFormatter:]): Changed to return a maximum page size of 1
if snapshotFirstPage is true.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::computePagesForPrintingAndDrawToPDF): Ditto.

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

2 years agoAdd delegate support to WebCore
andersca@apple.com [Thu, 9 Mar 2017 22:34:52 +0000 (22:34 +0000)]
Add delegate support to WebCore
https://bugs.webkit.org/show_bug.cgi?id=169427
Part of rdar://problem/28880714.

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:
Add feature define.

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:
Add feature define.

* DerivedSources.make:
Add idl files.

* Modules/applepay/ApplePayError.cpp:
(WebCore::ApplePayError::create):
(WebCore::ApplePayError::ApplePayError):
(WebCore::ApplePayError::~ApplePayError):
* Modules/applepay/ApplePayError.h:
* Modules/applepay/ApplePayError.idl:
* Modules/applepay/ApplePayPaymentAuthorizationResult.h:
* Modules/applepay/ApplePayPaymentAuthorizationResult.idl:
* Modules/applepay/ApplePayPaymentMethodUpdate.h:
* Modules/applepay/ApplePayPaymentMethodUpdate.idl:
* Modules/applepay/ApplePayShippingContactUpdate.h:
* Modules/applepay/ApplePayShippingContactUpdate.idl:
* Modules/applepay/ApplePayShippingMethodUpdate.h:
* Modules/applepay/ApplePayShippingMethodUpdate.idl:
Add new files.

* Modules/applepay/ApplePaySession.cpp:
(WebCore::toPaymentAuthorizationStatus):
Move this function to the top.

(WebCore::convertAndValidate):
Add new convertAndValidate functions.

(WebCore::ApplePaySession::completeShippingMethodSelection):
(WebCore::ApplePaySession::completeShippingContactSelection):
(WebCore::ApplePaySession::completePaymentMethodSelection):
(WebCore::ApplePaySession::completePayment):
* Modules/applepay/ApplePaySession.h:
* Modules/applepay/ApplePaySession.idl:
Implement the old functions in terms of the new functions.

* Modules/applepay/PaymentCoordinator.cpp:
* WebCore.xcodeproj/project.pbxproj:
Add new files.

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:
Add feature define.

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:
Add feature define.

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:
Add feature define.

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

2 years ago[link preload] Double downloads of preloaded CSS
yoav@yoav.ws [Thu, 9 Mar 2017 22:29:39 +0000 (22:29 +0000)]
[link preload] Double downloads of preloaded CSS
https://bugs.webkit.org/show_bug.cgi?id=169274

Reviewed by Antti Koivisto.

Source/WebCore:

Avoid reloading link preloads in case of a charset mismatch.

Charset mismatch can happen for header based preloads, as they are requested before
the HTML's `<meta charset>` tag is processed. This change makes sure that in those
cases, we modify the resource's encoding setting instead of reloading it.

Test: http/tests/preload/single_download_preload_headers.php

* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::CachedResource): Initialize m_unknownCharset to be the same as the preload flag.
* loader/cache/CachedResource.h:
(WebCore::CachedResource::hasUnknownEncoding):
(WebCore::CachedResource::setHasUnknownEncoding):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::determineRevalidationPolicy): In case of a charset
mismatch, set the encoding of the Resource instead of reloading it if the charset is unknown.

LayoutTests:

Added tests making sure that header based preloads also trigger a single download,
and that we properly handle multiple charsets for the same preloaded resource.

* http/tests/preload/single_download_preload_headers-expected.txt: Added.
* http/tests/preload/single_download_preload_headers.php: Added.
* http/tests/preload/preload-encoding-expected.txt: Added.
* http/tests/preload/preload-encoding.php: Added.

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

2 years agoImplement PBKDF2 in WebCrypto
jiewen_tan@apple.com [Thu, 9 Mar 2017 22:24:26 +0000 (22:24 +0000)]
Implement PBKDF2 in WebCrypto
https://bugs.webkit.org/show_bug.cgi?id=143458
<rdar://problem/27311703>

Reviewed by Brent Fulgham.

LayoutTests/imported/w3c:

* web-platform-tests/WebCryptoAPI/derive_bits_keys/pbkdf2.worker-expected.txt:
* web-platform-tests/WebCryptoAPI/derive_bits_keys/test_pbkdf2-expected.txt:
* web-platform-tests/WebCryptoAPI/import_export/symmetric_importKey.worker-expected.txt:
* web-platform-tests/WebCryptoAPI/import_export/test_symmetric_importKey-expected.txt:

Source/WebCore:

This patch implements PBKDF2 according to the spec:
https://www.w3.org/TR/WebCryptoAPI/#pbkdf2. Supported
operations include deriveKey, deriveBits, importKey and
getKeyLength.

Tests: crypto/subtle/ecdh-import-key-derive-pbkdf2-key.html
       crypto/subtle/pbkdf2-derive-bits-malformed-parametrs.html
       crypto/subtle/pbkdf2-import-key-derive-bits.html
       crypto/subtle/pbkdf2-import-key-derive-hmac-key.html
       crypto/subtle/pbkdf2-import-key-malformed-parameters.html
       crypto/subtle/pbkdf2-import-key.html
       crypto/workers/subtle/pbkdf2-import-key-derive-bits.html
       crypto/workers/subtle/pbkdf2-import-key-derive-hmac-key.html
       crypto/workers/subtle/pbkdf2-import-key.html

* CMakeLists.txt:
* DerivedSources.make:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSCryptoKeyCustom.cpp:
(WebCore::JSCryptoKey::algorithm):
Added RawKeyAlgorithm.
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::normalizeCryptoAlgorithmParameters):
A bit of reordering.
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::write):
Faked implementation.
* crypto/CryptoAlgorithmParameters.h:
* crypto/CryptoKey.h:
* crypto/algorithms/CryptoAlgorithmPBKDF2.cpp: Added.
(WebCore::CryptoAlgorithmPBKDF2::create):
(WebCore::CryptoAlgorithmPBKDF2::identifier):
(WebCore::CryptoAlgorithmPBKDF2::deriveBits):
(WebCore::CryptoAlgorithmPBKDF2::importKey):
(WebCore::CryptoAlgorithmPBKDF2::getKeyLength):
* crypto/algorithms/CryptoAlgorithmPBKDF2.h: Added.
* crypto/gnutls/CryptoAlgorithmPBKDF2GnuTLS.cpp: Added.
(WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
* crypto/keys/CryptoKeyRaw.cpp: Added.
(WebCore::CryptoKeyRaw::CryptoKeyRaw):
(WebCore::CryptoKeyRaw::buildAlgorithm):
(WebCore::CryptoKeyRaw::exportData):
* crypto/keys/CryptoKeyRaw.h: Added.
(WebCore::RawKeyAlgorithm::RawKeyAlgorithm):
The CryptoKey class for PBKDF2 and later on HKDF.
* crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp: Added.
(WebCore::commonCryptoHMACAlgorithm):
(WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
* crypto/mac/CryptoAlgorithmRegistryMac.cpp:
(WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
* crypto/parameters/CryptoAlgorithmPbkdf2Params.h: Added.
* crypto/parameters/Pbkdf2Params.idl: Added.

LayoutTests:

* TestExpectations:
Mark slow tests as slow.
* crypto/subtle/derive-key-malformed-parameters.html:
* crypto/subtle/ecdh-import-key-derive-pbkdf2-key-expected.txt: Added.
* crypto/subtle/ecdh-import-key-derive-pbkdf2-key.html: Added.
* crypto/subtle/pbkdf2-derive-bits-malformed-parametrs-expected.txt: Added.
* crypto/subtle/pbkdf2-derive-bits-malformed-parametrs.html: Added.
* crypto/subtle/pbkdf2-import-key-derive-bits-expected.txt: Added.
* crypto/subtle/pbkdf2-import-key-derive-bits.html: Added.
* crypto/subtle/pbkdf2-import-key-derive-hmac-key-expected.txt: Added.
* crypto/subtle/pbkdf2-import-key-derive-hmac-key.html: Added.
* crypto/subtle/pbkdf2-import-key-expected.txt: Added.
* crypto/subtle/pbkdf2-import-key-malformed-parameters-expected.txt: Added.
* crypto/subtle/pbkdf2-import-key-malformed-parameters.html: Added.
* crypto/subtle/pbkdf2-import-key.html: Added.
* crypto/workers/subtle/pbkdf2-import-key-derive-bits-expected.txt: Added.
* crypto/workers/subtle/pbkdf2-import-key-derive-bits.html: Added.
* crypto/workers/subtle/pbkdf2-import-key-derive-hmac-key-expected.txt: Added.
* crypto/workers/subtle/pbkdf2-import-key-derive-hmac-key.html: Added.
* crypto/workers/subtle/pbkdf2-import-key-expected.txt: Added.
* crypto/workers/subtle/pbkdf2-import-key.html: Added.
* crypto/workers/subtle/resources/pbkdf2-import-key-derive-bits.js: Added.
* crypto/workers/subtle/resources/pbkdf2-import-key-derive-hmac-key.js: Added.
* crypto/workers/subtle/resources/pbkdf2-import-key.js: Added.

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

2 years ago[Modern Media Controls] iOS: long press on play button shows the Copy menu
commit-queue@webkit.org [Thu, 9 Mar 2017 22:17:57 +0000 (22:17 +0000)]
[Modern Media Controls] iOS: long press on play button shows the Copy menu
https://bugs.webkit.org/show_bug.cgi?id=169355
<rdar://problem/30928998>

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

Source/WebCore:

Disable built-in UI behavior that shows a magnifier or a copy callout when pressing
on an element for a long time. These do not make sense for media controls.

Test: media/modern-media-controls/audio/audio-controls-styles.html

* Modules/modern-media-controls/controls/media-controls.css:
(:host):

LayoutTests:

Add a test to check that the expected properties are set as they should to disable
built-in UI behavior that shows a magnifier or a copy callout when pressing on an
element for a long time.

* media/modern-media-controls/audio/audio-controls-styles-expected.txt: Added.
* media/modern-media-controls/audio/audio-controls-styles.html: Added.
* platform/mac/TestExpectations:

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

2 years ago[Content Extensions] Introduce if-top-url and unless-top-url
achristensen@apple.com [Thu, 9 Mar 2017 22:17:13 +0000 (22:17 +0000)]
[Content Extensions] Introduce if-top-url and unless-top-url
https://bugs.webkit.org/show_bug.cgi?id=169433

Reviewed by Brady Eidson.

Source/WebCore:

In r184116 I added if-domain and unless-domain to control whether a rule applies
based on the domain of the main document URL.  I'm expanding this by adding if-top-url
and unless-top-url that run regular expressions on the entire main document URL so that
example.com/user1content can be distinguished from example.com/user2content.
To not add to the number of passes we make on the URLs for each load and to maintain JSON
backwards compatibility, I've made it so that if-top-url and unless-top-url can be used
instead of if-domain and unless-domain (which continue to work) but the two condition types
cannot be used together since running regular expressions on the entire main document URL
is strictly more powerful than checking the domain and subdomains.
As a minor detail, content extension regexes are by default ASCII-case-insensitive, so I've
done the same with top URL regexes, adding top-url-filter-is-case-sensitive to mirror the existing
url-filter-is-case-sensitive if the JSON author decides to make regexes case sensitive.

Covered by new API tests.

* contentextensions/CompiledContentExtension.h:
* contentextensions/ContentExtension.cpp:
(WebCore::ContentExtensions::ContentExtension::populateConditionCacheIfNeeded):
(WebCore::ContentExtensions::ContentExtension::topURLActions):
(WebCore::ContentExtensions::ContentExtension::cachedConditionedActions): Deleted.
* contentextensions/ContentExtension.h:
* contentextensions/ContentExtensionCompiler.cpp:
(WebCore::ContentExtensions::addUniversalActionsToDFA):
(WebCore::ContentExtensions::compileToBytecode):
We had three copies of compiling to bytecode that were almost the same and would've been made into three copies of the same code.
I moved them to one helper function that is called three times.
(WebCore::ContentExtensions::compileRuleList):
* contentextensions/ContentExtensionCompiler.h:
* contentextensions/ContentExtensionError.cpp:
(WebCore::ContentExtensions::contentExtensionErrorCategory):
Add the new error type for JSON that tries to use if-top-url and unless-top-url with if-domain and unless-domain.
* contentextensions/ContentExtensionError.h:
* contentextensions/ContentExtensionParser.cpp:
(WebCore::ContentExtensions::loadTrigger):
Parse the new values if-top-url, unless-top-url, and top-url-filter-is-case-sensitive.
* contentextensions/ContentExtensionRule.h:
(WebCore::ContentExtensions::Trigger::~Trigger):
* contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
* contentextensions/DFABytecodeInterpreter.cpp:
(WebCore::ContentExtensions::DFABytecodeInterpreter::interpretAppendAction):
(WebCore::ContentExtensions::DFABytecodeInterpreter::interpretTestFlagsAndAppendAction):
(WebCore::ContentExtensions::DFABytecodeInterpreter::interpretWithConditions):
* contentextensions/DFABytecodeInterpreter.h:

Source/WebKit2:

Rename conditionedFilters to topURLFilters to reflect the fact that they are the filters
that are run on the top URL, and possibly just the domain of the top url.
I was a bit too aggressive when renaming domain* to condition* in r213533.

* Shared/WebCompiledContentExtension.cpp:
(WebKit::WebCompiledContentExtension::conditionsApplyOnlyToDomain):
(WebKit::WebCompiledContentExtension::topURLFiltersBytecode):
(WebKit::WebCompiledContentExtension::topURLFiltersBytecodeLength):
(WebKit::WebCompiledContentExtension::conditionedFiltersBytecode): Deleted.
(WebKit::WebCompiledContentExtension::conditionedFiltersBytecodeLength): Deleted.
* Shared/WebCompiledContentExtension.h:
* Shared/WebCompiledContentExtensionData.cpp:
(WebKit::WebCompiledContentExtensionData::encode):
(WebKit::WebCompiledContentExtensionData::decode):
* Shared/WebCompiledContentExtensionData.h:
(WebKit::WebCompiledContentExtensionData::WebCompiledContentExtensionData):
* UIProcess/API/APIUserContentExtensionStore.cpp:
(API::encodeContentExtensionMetaData):
(API::decodeContentExtensionMetaData):
(API::compiledToFile):
(API::createExtension):
(API::UserContentExtensionStore::invalidateContentExtensionVersion):
(API::userContentExtensionStoreErrorCategory):
* UIProcess/API/APIUserContentExtensionStore.h:
Increment CurrentContentExtensionFileVersion because we have changed the format of the binary on disk.
We only added 4 bytes, but that's binary incompatible and requires re-compiling any existing content extensions.

Tools:

* TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:
(TestWebKitAPI::TEST_F):
Add tests for new functionality and new failure types.

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