WebKit-https.git
18 months agoEnsure that style is updated when the effective appearance changes
megan_gardner@apple.com [Fri, 16 Mar 2018 18:47:44 +0000 (18:47 +0000)]
Ensure that style is updated when the effective appearance changes
https://bugs.webkit.org/show_bug.cgi?id=183690
<rdar://problem/38385900>

Reviewed by Tim Horton and Wenson Hsieh.

Source/WebCore:

Only exposing a function to outside WebCore, no tests needed.

* page/Page.h:

Source/WebKit:

Respond to and respect the effective appearance changing.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView effectiveAppearanceDidChange]):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setDefaultAppearance):

Source/WebKitLegacy/mac:

Respond to and respect the effective appearance changing.

* WebView/WebView.mm:
(-[WebView _setUseSystemAppearance:]):
(-[WebView effectiveAppearanceDidChange]):

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

18 months agoWebKit.RestoreSessionStateContainingScrollRestorationDefault API test is failing...
cdumez@apple.com [Fri, 16 Mar 2018 18:33:48 +0000 (18:33 +0000)]
WebKit.RestoreSessionStateContainingScrollRestorationDefault API test is failing with async policy delegates
https://bugs.webkit.org/show_bug.cgi?id=183679

Reviewed by Alex Christensen.

Source/WebCore:

Update CachedRawResource::didAddClient() to not send data until we've received
the policy decision for the response.

No new tests, covered by new API test.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::handleSubstituteDataLoadNow):
(WebCore::DocumentLoader::responseReceived):
* loader/DocumentLoader.h:
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::responseReceived):
* loader/DocumentThreadableLoader.h:
* loader/MediaResourceLoader.cpp:
(WebCore::MediaResource::responseReceived):
* loader/MediaResourceLoader.h:
* loader/appcache/ApplicationCacheResourceLoader.cpp:
(WebCore::ApplicationCacheResourceLoader::responseReceived):
* loader/appcache/ApplicationCacheResourceLoader.h:
* loader/cache/CachedRawResource.cpp:
(WebCore::CachedRawResource::didAddClient):
(WebCore::CachedRawResource::responseReceived):
* loader/cache/CachedRawResourceClient.h:
(WebCore::CachedRawResourceClient::responseReceived):
* loader/cache/KeepaliveRequestTracker.cpp:
(WebCore::KeepaliveRequestTracker::responseReceived):
* loader/cache/KeepaliveRequestTracker.h:
* platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.h:
* platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
(WebCore::WebCoreAVFResourceLoader::responseReceived):

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKit/RestoreSessionState.cpp:
(TestWebKitAPI::decidePolicyForNavigationAction):
(TestWebKitAPI::decidePolicyForResponse):
(TestWebKitAPI::TEST):

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

18 months agoName Service Worker threads differently from regular Worker threads
youenn@apple.com [Fri, 16 Mar 2018 17:38:23 +0000 (17:38 +0000)]
Name Service Worker threads differently from regular Worker threads
https://bugs.webkit.org/show_bug.cgi?id=183698

Reviewed by Chris Dumez.

No observable change of behavior.
For debugging purposes, knowing that a thread is a service worker thread might help give context.
It might also identify on a crash log whether the process is a service worker process or a regular web process.

* workers/WorkerThread.cpp:
(WebCore::WorkerThread::start):
* workers/WorkerThread.h:
(WebCore::WorkerThread::isServiceWorkerThread const):
* workers/service/context/ServiceWorkerThread.h:

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

18 months agoIceCandidates leak on webrtc/datachannel/basic.html and other tests
youenn@apple.com [Fri, 16 Mar 2018 17:31:54 +0000 (17:31 +0000)]
IceCandidates leak on webrtc/datachannel/basic.html and other tests
https://bugs.webkit.org/show_bug.cgi?id=183676
<rdar://problem/36116228>

Reviewed by Eric Carlson.

Covered by manual testing using --leaks option on WK1.
WebKit should not release the candidates since libwebrtc is not taking ownership.

* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::doSetLocalDescription):
(WebCore::LibWebRTCPeerConnectionBackend::doSetRemoteDescription):

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

18 months ago[Nicosia] Add Cairo-specific GraphicsContext operation recorder
zandobersek@gmail.com [Fri, 16 Mar 2018 17:14:12 +0000 (17:14 +0000)]
[Nicosia] Add Cairo-specific GraphicsContext operation recorder
https://bugs.webkit.org/show_bug.cgi?id=183593

Reviewed by Carlos Garcia Campos.

Add Nicosia::CairoOperationRecorder, GraphicsContextImpl implementation
that records all GraphicsContext operations for deferred replay on a
different thread. Recording here mostly consists of storing all the
Cairo resources in a thread-safe manner, which is eased by the atomic
reference counting used in Cairo.

Nicosia::PaintingOperation derivatives are used for operations or state
updates that require recording. Instances of these classes are appended
to a Vector<> object that is then pushed into a thread pool in
Nicosia::PaintingEngineThreaded , replaying all the operations against
the Cairo context established from an associated target Nicosia::Buffer.

This GraphicsContextImpl implementation is now used in the
PaintingContextCairo::ForRecording constructor to construct the
GraphicsContext implementation that will be used for recording.

* platform/TextureMapper.cmake:
* platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp: Added.
(Nicosia::getContext):
(Nicosia::OperationData::arg const const):
(Nicosia::createCommand):
(Nicosia::CairoOperationRecorder::CairoOperationRecorder):
(Nicosia::m_commandList):
(Nicosia::CairoOperationRecorder::updateState):
(Nicosia::CairoOperationRecorder::clearShadow):
(Nicosia::CairoOperationRecorder::setLineCap):
(Nicosia::CairoOperationRecorder::setLineDash):
(Nicosia::CairoOperationRecorder::setLineJoin):
(Nicosia::CairoOperationRecorder::setMiterLimit):
(Nicosia::CairoOperationRecorder::fillRect):
(Nicosia::CairoOperationRecorder::fillRoundedRect):
(Nicosia::CairoOperationRecorder::fillRectWithRoundedHole):
(Nicosia::CairoOperationRecorder::fillPath):
(Nicosia::CairoOperationRecorder::fillEllipse):
(Nicosia::CairoOperationRecorder::strokeRect):
(Nicosia::CairoOperationRecorder::strokePath):
(Nicosia::CairoOperationRecorder::strokeEllipse):
(Nicosia::CairoOperationRecorder::clearRect):
(Nicosia::CairoOperationRecorder::drawGlyphs):
(Nicosia::CairoOperationRecorder::drawImage):
(Nicosia::CairoOperationRecorder::drawTiledImage):
(Nicosia::CairoOperationRecorder::drawNativeImage):
(Nicosia::CairoOperationRecorder::drawPattern):
(Nicosia::CairoOperationRecorder::drawRect):
(Nicosia::CairoOperationRecorder::drawLine):
(Nicosia::CairoOperationRecorder::drawLinesForText):
(Nicosia::CairoOperationRecorder::drawLineForDocumentMarker):
(Nicosia::CairoOperationRecorder::drawEllipse):
(Nicosia::CairoOperationRecorder::drawPath):
(Nicosia::CairoOperationRecorder::drawFocusRing):
(Nicosia::CairoOperationRecorder::save):
(Nicosia::CairoOperationRecorder::restore):
(Nicosia::CairoOperationRecorder::translate):
(Nicosia::CairoOperationRecorder::rotate):
(Nicosia::CairoOperationRecorder::scale):
(Nicosia::CairoOperationRecorder::concatCTM):
(Nicosia::CairoOperationRecorder::setCTM):
(Nicosia::CairoOperationRecorder::getCTM):
(Nicosia::CairoOperationRecorder::beginTransparencyLayer):
(Nicosia::CairoOperationRecorder::endTransparencyLayer):
(Nicosia::CairoOperationRecorder::clip):
(Nicosia::CairoOperationRecorder::clipOut):
(Nicosia::CairoOperationRecorder::clipPath):
(Nicosia::CairoOperationRecorder::clipBounds):
(Nicosia::CairoOperationRecorder::applyDeviceScaleFactor):
(Nicosia::CairoOperationRecorder::roundToDevicePixels):
(Nicosia::CairoOperationRecorder::append):
* platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h: Added.
* platform/graphics/nicosia/cairo/NicosiaPaintingContextCairo.cpp:
(Nicosia::PaintingContextCairo::ForRecording::ForRecording):

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

18 months ago[LayoutReloaded] Introduce Display.Box
zalan@apple.com [Fri, 16 Mar 2018 17:12:24 +0000 (17:12 +0000)]
[LayoutReloaded] Introduce Display.Box
https://bugs.webkit.org/show_bug.cgi?id=183700

Reviewed by Antti Koivisto.

Display.Box objects will end up in the display(box) tree. Currently
they are just hanging off of the Layout.Box objects.

* LayoutReloaded/DisplayTree/Box.js: Added.
(Display.Box):
(Display.Box.prototype.rect):
(Display.Box.prototype.top):
(Display.Box.prototype.left):
(Display.Box.prototype.bottom):
(Display.Box.prototype.right):
(Display.Box.prototype.topLeft):
(Display.Box.prototype.bottomRight):
(Display.Box.prototype.setTopLeft):
(Display.Box.prototype.setSize):
(Display.Box.prototype.setWidth):
(Display.Box.prototype.setHeight):
(Display.Box.prototype.borderBox):
(Display.Box.prototype.paddingBox):
(Display.Box.prototype.contentBox):
* LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js:
(BlockFormattingContext):
(BlockFormattingContext.prototype.layout):
(BlockFormattingContext.prototype._toAbsolutePosition):
(BlockFormattingContext.prototype._needsLayout):
(BlockFormattingContext.prototype._addToLayoutQueue):
(BlockFormattingContext.prototype._nextInLayoutQueue):
(BlockFormattingContext.prototype._removeFromLayoutQueue):
(BlockFormattingContext.prototype._createDisplayBox):
(BlockFormattingContext.prototype._toDisplayBox):
(BlockFormattingContext.prototype._toLayoutBox):
* LayoutReloaded/Layout.js:
(layout):
* LayoutReloaded/LayoutReloaded.xcworkspace/contents.xcworkspacedata:
* LayoutReloaded/LayoutTree/Box.js:
(Layout.Box):
(Layout.Box.prototype.setDisplayBox):
(Layout.Box.prototype.displayBox):
(Layout.Box.prototype.rect):
(Layout.Box.prototype.setTopLeft):
(Layout.Box.prototype.setSize):
(Layout.Box.prototype.setWidth):
(Layout.Box.prototype.setHeight):
(Layout.Box.prototype.borderBox):
(Layout.Box.prototype.paddingBox):
(Layout.Box.prototype.contentBox):
* LayoutReloaded/test/index.html:

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

18 months ago[TexMap] Clean up TextureMapperLayer constructor
zandobersek@gmail.com [Fri, 16 Mar 2018 17:07:26 +0000 (17:07 +0000)]
[TexMap] Clean up TextureMapperLayer constructor
https://bugs.webkit.org/show_bug.cgi?id=183634

Reviewed by Michael Catanzaro.

In the TextureMapperLayer header, only declare the constructor, and move
all the previous member initialization to the point of declaration of
these member variables.

In the TextureMapperLayer implementation file, the constructor and
destructor are moved into proper order at the top of the file. The
former is defaulted, and the latter remains unchanged.

No change in behavior.

* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::~TextureMapperLayer):
* platform/graphics/texmap/TextureMapperLayer.h:

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

18 months agoImprove error message when Gigacage cannot allocate virtual memory
mcatanzaro@igalia.com [Fri, 16 Mar 2018 17:06:03 +0000 (17:06 +0000)]
Improve error message when Gigacage cannot allocate virtual memory
https://bugs.webkit.org/show_bug.cgi?id=183329

Reviewed by Filip Pizlo.

We've discovered that Deja Dup monitor sets a virtual memory limit, breaking Gigacage. Since
it runs in the background on a fresh out-of-the-box install of Ubuntu, this is not good.
That will have to be fixed by Deja Dup, but there is concern that other applications might
try this, or that users will set a virtual memory limit for the entire desktop session. Of
particular concern is the possibility that users might have copypasted a ulimit line into
a session startup script without understanding it. Let's try to make it slightly easier to
understand what's going wrong.

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

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

18 months agoURLSchemeHandler.Basic API test fails with async policy delegates
cdumez@apple.com [Fri, 16 Mar 2018 16:11:54 +0000 (16:11 +0000)]
URLSchemeHandler.Basic API test fails with async policy delegates
https://bugs.webkit.org/show_bug.cgi?id=183678

Reviewed by Alex Christensen.

Source/WebKit:

The issue is that the client calls _didPerformRedirection / didReceiveResponse / didReceiveData / didFinish
on the URLScheme task one after the one, synchronously. However, redirects and responses can be processed
asynchronously. To address the issue, we now queue operations requested by the client if we're waiting
for an async policy delegate.

* WebProcess/WebPage/WebURLSchemeTaskProxy.cpp:
(WebKit::WebURLSchemeTaskProxy::didPerformRedirection):
(WebKit::WebURLSchemeTaskProxy::didReceiveResponse):
(WebKit::WebURLSchemeTaskProxy::didReceiveData):
(WebKit::WebURLSchemeTaskProxy::didComplete):
(WebKit::WebURLSchemeTaskProxy::processNextPendingTask):
* WebProcess/WebPage/WebURLSchemeTaskProxy.h:
(WebKit::WebURLSchemeTaskProxy::queueTask):

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/WKURLSchemeHandler-1.mm:
(-[URLSchemeHandlerAsyncNavigationDelegate webView:decidePolicyForNavigationAction:decisionHandler:]):
(-[URLSchemeHandlerAsyncNavigationDelegate webView:decidePolicyForNavigationResponse:decisionHandler:]):
(TEST):

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

18 months agoLayoutTests/imported/w3c:
csaavedra@igalia.com [Fri, 16 Mar 2018 15:12:25 +0000 (15:12 +0000)]
LayoutTests/imported/w3c:
Unreviewed rebaseline

These seem to have been forgotten, update baseline as it seemed needed.
* web-platform-tests/dom/events/EventListener-invoke-legacy-expected.txt:
* web-platform-tests/dom/nodes/Document-createElement-namespace-expected.txt:
* web-platform-tests/encrypted-media/idlharness-expected.txt:

LayoutTests:
[WPE] Rebaseline for web-platform-tests specific test

Unreviewed gardening.
* platform/wpe/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt:

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

18 months ago[LayoutReloaded] Utils.computed* functions should just take node instead of box.
zalan@apple.com [Fri, 16 Mar 2018 14:52:42 +0000 (14:52 +0000)]
[LayoutReloaded] Utils.computed* functions should just take node instead of box.
https://bugs.webkit.org/show_bug.cgi?id=183697

Reviewed by Antti Koivisto.

This is in preparation for introducing the display tree.

* LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js:
(BlockFormattingContext.prototype._computeOutOfFlowWidth):
(BlockFormattingContext.prototype._computeFloatingWidth):
(BlockFormattingContext.prototype._computeInFlowWidth):
(BlockFormattingContext.prototype._computeOutOfFlowHeight):
(BlockFormattingContext.prototype._computeFloatingHeight):
(BlockFormattingContext.prototype._computeInFlowHeight):
(BlockFormattingContext.prototype._shrinkToFitWidth):
* LayoutReloaded/FormattingContext/BlockFormatting/BlockMarginCollapse.js:
(BlockMarginCollapse._nonCollapsedMarginTop):
(BlockMarginCollapse._nonCollapsedMarginBottom):
(BlockMarginCollapse._collapsedMarginTopFromFirstChild):
(BlockMarginCollapse._collapsedMarginBottomFromLastChild):
* LayoutReloaded/FormattingContext/FormattingContext.js:
(FormattingContext.prototype.marginTop):
(FormattingContext.prototype.marginLeft):
(FormattingContext.prototype.marginBottom):
(FormattingContext.prototype.marginRight):
* LayoutReloaded/LayoutTree/Box.js:
(Layout.Box.prototype.paddingBox):
(Layout.Box.prototype.contentBox):
(Layout.Box):
* LayoutReloaded/Utils.js:
(Utils.computedMarginTop):
(Utils.computedMarginLeft):
(Utils.computedMarginBottom):
(Utils.computedMarginRight):
(Utils.computedBorderTopLeft):
(Utils.computedBorderBottomRight):
(Utils.computedPaddingTopLeft):
(Utils.computedPaddingBottomRight):
(Utils.computedBorderAndPaddingTop):
(Utils.computedBorderAndPaddingLeft):
(Utils.computedBorderAndPaddingBottom):
(Utils.computedBorderAndPaddingRight):
(Utils.computedHorizontalBorderAndPadding):
(Utils.computedVerticalBorderAndPadding):
(Utils.computedLineHeight):
(Utils.hasClearLeft):
(Utils.hasClearRight):
(Utils.hasClearBoth):

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

18 months ago[GTK] When using EGL, request an OpenGL core profile when possible
magomez@igalia.com [Fri, 16 Mar 2018 11:51:58 +0000 (11:51 +0000)]
[GTK] When using EGL, request an OpenGL core profile when possible
https://bugs.webkit.org/show_bug.cgi?id=178719

Reviewed by Carlos Garcia Campos.

When using EGL and OpenGL, try to request a context with version >= 3.2 with a core profile
whenever possible. In order to to this, we require EGL version 1.5 or version 1.4 with the
extension EGL_KHR_create_context. If EGL requirements are not met, or we cannot get a
context with version >= 3.2 then use whatever EGL gives us.

Covered by existent tests.

* platform/graphics/egl/GLContextEGL.cpp:
(WebCore::GLContextEGL::createWindowContext):
(WebCore::GLContextEGL::createPbufferContext):
(WebCore::GLContextEGL::createSurfacelessContext):
(WebCore::GLContextEGL::createContextForEGLVersion):
* platform/graphics/egl/GLContextEGL.h:
* platform/graphics/egl/GLContextEGLWPE.cpp:
(WebCore::GLContextEGL::createWPEContext):
* platform/graphics/egl/GLContextEGLWayland.cpp:
(WebCore::GLContextEGL::createWaylandContext):
* platform/graphics/egl/GLContextEGLX11.cpp:
(WebCore::GLContextEGL::createPixmapContext):

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

18 months ago[GTK][WPE] Remove baselines for FileAPI test.
csaavedra@igalia.com [Fri, 16 Mar 2018 10:05:03 +0000 (10:05 +0000)]
[GTK][WPE] Remove baselines for FileAPI test.

Unreviewed gardening. Now with service workers the results in both
WPE and GTK+ are the same as the default expectation.
* platform/gtk/imported/w3c/web-platform-tests/FileAPI/historical.https-expected.txt: Removed.
* platform/wpe/imported/w3c/web-platform-tests/FileAPI/historical.https-expected.txt: Removed.

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

18 months agoSuppress GCC warnings by using #include instead of #import
csaavedra@igalia.com [Fri, 16 Mar 2018 09:46:01 +0000 (09:46 +0000)]
Suppress GCC warnings by using #include instead of #import

Unreviewed.
* UIProcess/SystemPreviewController.cpp:

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

18 months ago[TexMap] Don't use the TextureMapperAnimation::Client interface to apply animation
zandobersek@gmail.com [Fri, 16 Mar 2018 08:43:26 +0000 (08:43 +0000)]
[TexMap] Don't use the TextureMapperAnimation::Client interface to apply animation
https://bugs.webkit.org/show_bug.cgi?id=183656

Reviewed by Carlos Garcia Campos.

Don't have the TextureMapperLayer class inherit from the
TextureMapperAnimation::Client interface just for the purposes of
synchronization of animation-affected attributes in syncAnimations().
For that purpose it's enough to provide a struct that is passed to that
method, and with the TextureMapperAnimation class filling out any of the
animated attributes that need to be updated.

TextureMapperAnimation::ApplicationResult struct is introducted for that
purpose. std::optional<> members in it are assigned values during the
application process, if an appropriate animation affects them. The
relevant member values in TextureMapperLayer are then updated, or value
from the default state is used.

TextureMapperAnimation::Client is removed.

No new tests -- no change in behavior.

* platform/graphics/texmap/TextureMapperAnimation.cpp:
(WebCore::TextureMapperAnimation::apply):
(WebCore::TextureMapperAnimation::applyInternal):
(WebCore::TextureMapperAnimations::apply):
* platform/graphics/texmap/TextureMapperAnimation.h:
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::syncAnimations):
(WebCore::TextureMapperLayer::setAnimatedTransform): Deleted.
(WebCore::TextureMapperLayer::setAnimatedOpacity): Deleted.
(WebCore::TextureMapperLayer::setAnimatedFilters): Deleted.
* platform/graphics/texmap/TextureMapperLayer.h:

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

18 months agoWeb Inspector: Canvas Tab: main WebGL canvas on acko.net has no reported size
webkit@devinrousso.com [Fri, 16 Mar 2018 07:01:01 +0000 (07:01 +0000)]
Web Inspector: Canvas Tab: main WebGL canvas on acko.net has no reported size
https://bugs.webkit.org/show_bug.cgi?id=178798
<rdar://problem/35175740>

Reviewed by Brian Burg.

When the main frame navigates, the DOMAgent would recieve two InspectorInstrumentation calls,
one when the frame begins its navigation and the other when the document for that frame has
loaded. Both of these would discard the DOMAgent's bindings, which included the map of
`nodeId`s. This was an issue for canvases, as the frontend would be notified whenever any
canvas is created, which would usually occur before the `DOMContentLoaded` event is fired.
As a result, the canvases would attempt to retrieve their associated node, only to have the
DOMAgent discard those bindings quickly thereafter.

This patch removes DOMAgent's and DOMDebuggerAgent's (parity) instrumentation hooks for the
latter event, ensuring that the bindings are only discarded once.

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

* inspector/agents/InspectorDOMDebuggerAgent.h:
* inspector/agents/InspectorDOMDebuggerAgent.cpp:
(WebCore::InspectorDOMDebuggerAgent::frameDocumentUpdated): Added.
(WebCore::InspectorDOMDebuggerAgent::mainFrameDOMContentLoaded): Deleted.

* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::domContentLoadedEventFiredImpl):
(WebCore::InspectorInstrumentation::frameDocumentUpdatedImpl):

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

18 months ago[LayoutReloaded] Should never need to go beyond the root container when asking for...
zalan@apple.com [Fri, 16 Mar 2018 04:13:26 +0000 (04:13 +0000)]
[LayoutReloaded] Should never need to go beyond the root container when asking for the containing block.
https://bugs.webkit.org/show_bug.cgi?id=183691

Reviewed by Antti Koivisto.

While laying out the boxes in a block formatting context, if we happen to need
to get to the containing block of a box to compute geometry, it should always be a
descendant of the root container (or the root container itself).
Nothing outside of the formatting context should be able to impact the boxes inside.

* LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js:
(BlockFormattingContext.prototype._computeOutOfFlowPosition):
(BlockFormattingContext.prototype._toAbsolutePosition):
(BlockFormattingContext):
* LayoutReloaded/FormattingContext/BlockFormatting/BlockMarginCollapse.js:
(BlockMarginCollapse._isMarginTopCollapsedWithParent):
(BlockMarginCollapse._isMarginBottomCollapsedWithParent):
* LayoutReloaded/LayoutTree/Box.js:
(Layout.Box.prototype.isRootBox):
(Layout.Box.prototype.isRootElement): Deleted.
* LayoutReloaded/Utils.js:
(Utils.isDescendantOf):
(Utils.mapStaticToAbsolute): Deleted.
* LayoutReloaded/misc/headers/Box.h:

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

19 months agoInclude CADisplayLink explicitly where needed, instead of all of CA
timothy_horton@apple.com [Fri, 16 Mar 2018 02:57:42 +0000 (02:57 +0000)]
Include CADisplayLink explicitly where needed, instead of all of CA
https://bugs.webkit.org/show_bug.cgi?id=183689
<rdar://problem/38528719>

Reviewed by Wenson Hsieh.

* platform/graphics/ios/DisplayRefreshMonitorIOS.mm:

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

19 months agoInclude MobileCoreServices in the WebCore prefix header
timothy_horton@apple.com [Fri, 16 Mar 2018 02:19:33 +0000 (02:19 +0000)]
Include MobileCoreServices in the WebCore prefix header
https://bugs.webkit.org/show_bug.cgi?id=183688
<rdar://problem/38527621>

Reviewed by Dan Bernstein.

* WebCorePrefix.h:

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

19 months agoAvoid defining commonly-named system macros on all Cocoa platforms
timothy_horton@apple.com [Fri, 16 Mar 2018 01:46:55 +0000 (01:46 +0000)]
Avoid defining commonly-named system macros on all Cocoa platforms
https://bugs.webkit.org/show_bug.cgi?id=183687

Reviewed by Dan Bernstein.

* wtf/Platform.h:

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

19 months agoCreate MediaQueryParserContext to provide additional context for the evaluation of...
megan_gardner@apple.com [Fri, 16 Mar 2018 01:12:39 +0000 (01:12 +0000)]
Create MediaQueryParserContext to provide additional context for the evaluation of media queries
https://bugs.webkit.org/show_bug.cgi?id=183677

Reviewed by Tim Horton.

We need additional context for parsing media queries to make sure they are parsed correctly and valid.

Source/WebCore:

Not currently testable, will add tests in a later patch.

* WebCore.xcodeproj/project.pbxproj:
* css/MediaList.cpp:
(WebCore::MediaQuerySet::create):
(WebCore::MediaQuerySet::set):
(WebCore::MediaQuerySet::add):
(WebCore::MediaQuerySet::remove):
* css/MediaList.h:
* css/MediaQueryEvaluator.cpp:
(WebCore::MediaQueryEvaluator::mediaAttributeMatches):
* css/MediaQueryExpression.cpp:
(WebCore::featureWithValidIdent):
(WebCore::featureWithValidDensity):
(WebCore::featureWithValidPositiveLength):
(WebCore::featureWithPositiveInteger):
(WebCore::featureWithPositiveNumber):
(WebCore::featureWithZeroOrOne):
(WebCore::isFeatureValidWithoutValue):
(WebCore::MediaQueryExpression::MediaQueryExpression):
* css/MediaQueryExpression.h:
* css/MediaQueryMatcher.cpp:
(WebCore::MediaQueryMatcher::matchMedia):
* css/MediaQueryParserContext.cpp: Added.
(WebCore::MediaQueryParserContext::MediaQueryParserContext):
* css/MediaQueryParserContext.h: Added.
(WebCore::MediaQueryParserContext::MediaQueryParserContext):
* css/StyleMedia.cpp:
(WebCore::StyleMedia::matchMedium const):
* css/StyleRuleImport.cpp:
(WebCore::StyleRuleImport::StyleRuleImport):
(WebCore::StyleRuleImport::setCSSStyleSheet):
* css/parser/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):
(WebCore::operator==):
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::consumeImportRule):
(WebCore::CSSParserImpl::consumeMediaRule):
* css/parser/MediaQueryParser.cpp:
(WebCore::MediaQueryParser::parseMediaQuerySet):
(WebCore::MediaQueryParser::parseMediaCondition):
(WebCore::MediaQueryParser::MediaQueryParser):
(WebCore::MediaQueryData::addExpression):
* css/parser/MediaQueryParser.h:
(WebCore::MediaQueryData::setMediaQueryParserContext):
* css/parser/SizesAttributeParser.cpp:
(WebCore::SizesAttributeParser::parse):
* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createCSSStyleSheet):
* dom/InlineStyleSheetOwner.cpp:
(WebCore::InlineStyleSheetOwner::createSheet):
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::setCSSStyleSheet):
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::process):
(WebCore::HTMLLinkElement::initializeStyleSheet):
(WebCore::HTMLLinkElement::setCSSStyleSheet):
* html/HTMLLinkElement.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::selectNextSourceChild):
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::parsedMediaAttribute const):
* html/HTMLSourceElement.h:
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::parseAttribute):
* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):

Source/WebKitLegacy/mac:

* DOM/DOM.mm:
(-[DOMHTMLLinkElement _mediaQueryMatches]):

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

19 months agoRebaselined test on macOS WK1 after r229642.
jlewis3@apple.com [Fri, 16 Mar 2018 00:16:27 +0000 (00:16 +0000)]
Rebaselined test on macOS WK1 after r229642.

Unreviewed test gardening.

* platform/mac-wk1/fast/forms/file/entries-api/webkitdirectory-open-panel-expected.txt:

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

19 months agoUnreviewed, mark location-protocol-setter-non-broken-async-delegate.html as flaky...
cdumez@apple.com [Thu, 15 Mar 2018 23:44:29 +0000 (23:44 +0000)]
Unreviewed, mark location-protocol-setter-non-broken-async-delegate.html as flaky on all platforms, not just WK1

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

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

19 months agoFix MSVC run-time check after r229391.
ross.kirsling@sony.com [Thu, 15 Mar 2018 23:07:04 +0000 (23:07 +0000)]
Fix MSVC run-time check after r229391.
https://bugs.webkit.org/show_bug.cgi?id=183673

Reviewed by Keith Miller.

Replaces attempted fix from r229424/r229432.
Apparently MSVC doesn't like it when a zero-length std::array is defined without explicit braces.

* jit/CCallHelpers.h:
(JSC::CCallHelpers::clampArrayToSize):

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

19 months agoUnreviewed, rolling out r229639.
commit-queue@webkit.org [Thu, 15 Mar 2018 23:00:58 +0000 (23:00 +0000)]
Unreviewed, rolling out r229639.
https://bugs.webkit.org/show_bug.cgi?id=183683

it is causing a crash in API tests (Requested by youenn on
#webkit).

Reverted changeset:

"ActiveDOMObject should assert that they are destroyed in the
thread they are created"
https://bugs.webkit.org/show_bug.cgi?id=183671
https://trac.webkit.org/changeset/229639

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

19 months agoAdd and adopt WK_ALTERNATE_FRAMEWORKS_DIR in ANGLE
timothy_horton@apple.com [Thu, 15 Mar 2018 22:43:02 +0000 (22:43 +0000)]
Add and adopt WK_ALTERNATE_FRAMEWORKS_DIR in ANGLE
https://bugs.webkit.org/show_bug.cgi?id=183675
<rdar://problem/38515281>

Reviewed by Dan Bernstein.

Source/JavaScriptCore:

* JavaScriptCore.xcodeproj/project.pbxproj:
Don't install the JSC alias if we're installing to an alternate location.
This should have been a part of r229637.

Source/ThirdParty/ANGLE:

* ANGLE.xcodeproj/project.pbxproj:
* Configurations/ANGLE.xcconfig:
* Configurations/Base.xcconfig:

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

19 months agoBad configuration parameters should make RTCPeerConnection constructor throw
youenn@apple.com [Thu, 15 Mar 2018 22:41:31 +0000 (22:41 +0000)]
Bad configuration parameters should make RTCPeerConnection constructor throw
https://bugs.webkit.org/show_bug.cgi?id=183615

Reviewed by Eric Carlson.

LayoutTests/imported/w3c:

* web-platform-tests/webrtc/RTCConfiguration-bundlePolicy-expected.txt:
* web-platform-tests/webrtc/RTCConfiguration-iceServers-expected.txt:
* web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-constructor-expected.txt:

Source/WebCore:

Implement more of https://w3c.github.io/webrtc-pc/#set-pc-configuration.
Throw an error whenever underlying libwebrtc set configuration fails.

Covered by rebased test.

* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::iceServersFromConfiguration):
(WebCore::RTCPeerConnection::initializeConfiguration):
(WebCore::RTCPeerConnection::setConfiguration):
* Modules/mediastream/RTCPeerConnection.js:
(initializeRTCPeerConnection):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:

LayoutTests:

Removed tests that are subsumed by WPT ones.

* fast/mediastream/RTCPeerConnection-expected.txt: Removed.
* fast/mediastream/RTCPeerConnection-getConfiguration-expected.txt: Removed.
* fast/mediastream/RTCPeerConnection-getConfiguration.html: Removed.
* fast/mediastream/RTCPeerConnection.html: Removed.
* platform/gtk/TestExpectations:
* platform/ios/TestExpectations:

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

19 months agoreplaceTrack triggers negotiationneeded
youenn@apple.com [Thu, 15 Mar 2018 22:36:42 +0000 (22:36 +0000)]
replaceTrack triggers negotiationneeded
https://bugs.webkit.org/show_bug.cgi?id=180342
<rdar://problem/35822426>

Reviewed by Eric Carlson.

Source/WebCore:

Covered by updated test.
Fix the case of replacing a track for which data is already flowing.
We should probably do the same for null tracks when fully implementing transceivers.

* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::enqueueReplaceTrackTask):

LayoutTests:

* webrtc/video-replace-track.html:

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

19 months agoTelemetry for stalled webpage loads
krollin@apple.com [Thu, 15 Mar 2018 22:27:25 +0000 (22:27 +0000)]
Telemetry for stalled webpage loads
https://bugs.webkit.org/show_bug.cgi?id=183221
<rdar://problem/36549013>

Reviewed by Chris Dumez.

Add telemetry for page loads, tracking the pages that succeed, fail,
or are canceled. This information will be used to track the overall
health of our page loading as time goes on.

Source/WebCore:

No new tests -- no new/changed user-level functionality.

* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::telemetryPageLoadKey):
(WebCore::DiagnosticLoggingKeys::timedOutKey):
(WebCore::DiagnosticLoggingKeys::canceledLessThan2SecondsKey):
(WebCore::DiagnosticLoggingKeys::canceledLessThan5SecondsKey):
(WebCore::DiagnosticLoggingKeys::canceledLessThan20SecondsKey):
(WebCore::DiagnosticLoggingKeys::canceledMoreThan20SecondsKey):
(WebCore::DiagnosticLoggingKeys::failedLessThan2SecondsKey):
(WebCore::DiagnosticLoggingKeys::failedLessThan5SecondsKey):
(WebCore::DiagnosticLoggingKeys::failedLessThan20SecondsKey):
(WebCore::DiagnosticLoggingKeys::failedMoreThan20SecondsKey):
(WebCore::DiagnosticLoggingKeys::occurredKey):
(WebCore::DiagnosticLoggingKeys::succeededLessThan2SecondsKey):
(WebCore::DiagnosticLoggingKeys::succeededLessThan5SecondsKey):
(WebCore::DiagnosticLoggingKeys::succeededLessThan20SecondsKey):
(WebCore::DiagnosticLoggingKeys::succeededMoreThan20SecondsKey):
* page/DiagnosticLoggingKeys.h:
* platform/network/cf/ResourceError.h:
(WebCore::ResourceError::ResourceError):
* platform/network/mac/ResourceErrorMac.mm:
(WebCore::ResourceError::ResourceError):
(WebCore::ResourceError::getNSURLErrorDomain const):
(WebCore::ResourceError::getCFErrorDomainCFNetwork const):
(WebCore::ResourceError::mapPlatformError):

Source/WebKit:

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::close):
(WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
(WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
(WebKit::WebPageProxy::didFinishLoadForFrame):
(WebKit::WebPageProxy::didFailLoadForFrame):
(WebKit::WebPageProxy::reportPageLoadResult):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::reportPageLoadResult):

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

19 months agowebkitdirectory-open-panel stumbles over unordered results
cdumez@apple.com [Thu, 15 Mar 2018 22:12:09 +0000 (22:12 +0000)]
webkitdirectory-open-panel stumbles over unordered results
https://bugs.webkit.org/show_bug.cgi?id=183643

Reviewed by Wenson Hsieh.

Update fast/forms/file/entries-api/webkitdirectory-open-panel.html to not rely on a
specific file ordering when checking input.files.

* fast/forms/file/entries-api/webkitdirectory-open-panel-expected.txt:
* fast/forms/file/entries-api/webkitdirectory-open-panel.html:

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

19 months ago[iOS WK2] Hit-testing fails when specifying a large top content inset
wenson_hsieh@apple.com [Thu, 15 Mar 2018 20:50:03 +0000 (20:50 +0000)]
[iOS WK2] Hit-testing fails when specifying a large top content inset
https://bugs.webkit.org/show_bug.cgi?id=183648
<rdar://problem/38421894>

Reviewed by Tim Horton.

Source/WebKit:

Currently, in the process of computing unobscured content rect in the UI process on iOS, we subtract away parts
of the view that are obscured by insets (e.g. MobileSafari's chrome). The helper method -[WKWebView
_computeContentInset] is intended to compute these obscuring insets around the view, but it takes scroll view
insets into account. This means that if WKWebView's inner scroll view has content insets, we'll end up shrinking
the unobscured content rect as if the insetted region obscures the viewport; this causes visible content on the
page to be uninteractible, since WKWebView erroneously thinks it's obscured.

To address this, we rename _computeContentInset to _computeObscuredInset, and make it _not_ affected by the
scroll view's content insets. From code inspection and testing, all but one of the former call sites of
_computeContentInset really need the obscured inset instead (see below). The one exception, -[WKWebView
_adjustedContentOffset:], takes a scroll position from the page and maps it to a content offset in the inner
UIScrollView (see below for more details).

Tests:  ScrollViewInsetTests.InnerHeightWithLargeTopContentInset
        ScrollViewInsetTests.InnerHeightWithLargeBottomContentInset
        ScrollViewInsetTests.RestoreInitialContentOffsetAfterCrash
        ScrollViewInsetTests.RestoreInitialContentOffsetAfterNavigation

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setHasCustomContentView:loadedMIMEType:]):
(-[WKWebView _initialContentOffsetForScrollView]):

See -_contentOffsetAdjustedForObscuredInset: below.

(-[WKWebView _contentOffsetAdjustedForObscuredInset:]):

Formerly -_adjustedContentOffset:. -_contentOffsetAdjustedForObscuredInset: no longer takes scroll view content
inset into account, and only cares about insets that obscure the view. This means that the scroll position
(0, 0) in the document now maps to the content offset in the inner UIScrollView, such that the top of the page
is aligned with the top of the viewport.

However, many call sites of -_adjustedContentOffset: were intended to compute the initial, top-left-most content
offset in the scroll view to scroll to when resetting the web view (i.e., they pass in CGPointZero for the
scroll position). An example of this is the scroll position to jump to after web content process termination, or
the scroll position after main frame navigation. In these cases, we actually want to jump to the top of the
scroll view, so we do want to use the version of the computed content insets that accounts for scroll view
insets.

Since these cases are limited to finding the top-left-most scroll position, we pull this out into a separate
helper method (-_initialContentOffsetForScrollView) and replace calls to
`-[self _adjustedContentOffset:CGPointZero]` with this instead.

(-[WKWebView _computedObscuredInset]):

A version of -_computeContentInset that doesn't care about scroll view insets. Used whereever we need to account
for obscured insets rather than the combination of content insets and unobscured insets (e.g.
-_initialContentOffsetForScrollView).

(-[WKWebView _processDidExit]):
(-[WKWebView _didCommitLayerTree:]):
(-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:nextValidLayerTreeTransactionID:]):
(-[WKWebView _scrollToContentScrollPosition:scrollOrigin:]):
(-[WKWebView scrollViewWillEndDragging:withVelocity:targetContentOffset:]):
(-[WKWebView _updateVisibleContentRects]):
(-[WKWebView _navigationGestureDidBegin]):

In all these places where we inset the view bounds to compute the unobscured region of the viewport, it doesn't
make sense to additionally inset by the scroll view's content insets, since (1) the scroll view's content insets
don't obscure the viewport, and (2) it's perfectly valid for the inner scroll view to have arbitrarily large
content insets.

(-[WKWebView _adjustedContentOffset:]): Deleted.

Renamed to -_contentOffsetAdjustedForObscuredInset:.

* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView _offsetForPageNumberIndicator]):

Similar to -_scrollToFragment: (see below).

(-[WKPDFView _scrollToFragment:]):

This helper figures out which content offset to scroll to, given the y-origin of a page in a PDF document. If
insets are added to the scroll view, we end up scrolling to the wrong content offset since we'll add the height
of the top content inset (imagine that the top content inset is enormous — then we'll scroll an amount equal to
the top content inset _past_ the point where the y-origin of the page is at the top of the viewport).

Tools:

Adds four new API tests to verify that adding top or bottom content insets to the WKWebView's scroll view does
not cause the DOMWindow's innerHeight to shrink. Currently, doing so would cause the innerHeight to be reported
as (viewHeight - inset.top) or (viewHeight - inset.bottom).

See WebKit ChangeLog for more details.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/ios/ScrollViewInsetTests.mm: Added.
(TestWebKitAPI::TEST):

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

19 months ago[WinCairo] Fix build errors when ENABLE_NETSCAPE_PLUGIN_API is turned off
commit-queue@webkit.org [Thu, 15 Mar 2018 20:41:40 +0000 (20:41 +0000)]
[WinCairo] Fix build errors when ENABLE_NETSCAPE_PLUGIN_API is turned off
https://bugs.webkit.org/show_bug.cgi?id=183335

Patch by Yousuke Kimoto <yousuke.kimoto@sony.com> on 2018-03-15
Reviewed by Alex Christensen.

* Plugins/PluginDatabaseWin.cpp:
* Plugins/PluginMessageThrottlerWin.cpp:
(WebCore::PluginMessageThrottlerWin::processQueuedMessage):
* Plugins/PluginPackageWin.cpp:
(WebCore::PluginPackage::load):
* Plugins/PluginView.h:
* Plugins/PluginViewWin.cpp:
* Plugins/npapi.cpp:
* WebCoreSupport/WebFrameLoaderClient.cpp:
(WebFrameLoaderClient::createPlugin):
(WebFrameLoaderClient::createJavaAppletWidget):
* WebView.cpp:
(WebView::WebViewWndProc):

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

19 months agoActiveDOMObject should assert that they are destroyed in the thread they are created
youenn@apple.com [Thu, 15 Mar 2018 20:23:58 +0000 (20:23 +0000)]
ActiveDOMObject should assert that they are destroyed in the thread they are created
https://bugs.webkit.org/show_bug.cgi?id=183671

Reviewed by Chris Dumez.

No change of behavior.
Moved MessagePort assertion to ActiveDOMObject.

* dom/ActiveDOMObject.cpp:
(WebCore::ActiveDOMObject::~ActiveDOMObject):
* dom/ActiveDOMObject.h:
* dom/MessagePort.cpp:
(WebCore::MessagePort::~MessagePort):
* dom/MessagePort.h:

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

19 months ago[macOS] Correct sandbox violations during Flash playback under ToT WebKit
bfulgham@apple.com [Thu, 15 Mar 2018 20:08:40 +0000 (20:08 +0000)]
[macOS] Correct sandbox violations during Flash playback under ToT WebKit
https://bugs.webkit.org/show_bug.cgi?id=183672
<rdar://problem/38510839>

Reviewed by Eric Carlson.

* PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
* WebProcess/com.apple.WebProcess.sb.in:

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

19 months agoAdd and adopt WK_ALTERNATE_FRAMEWORKS_DIR in JavaScriptCore
timothy_horton@apple.com [Thu, 15 Mar 2018 19:43:37 +0000 (19:43 +0000)]
Add and adopt WK_ALTERNATE_FRAMEWORKS_DIR in JavaScriptCore
https://bugs.webkit.org/show_bug.cgi?id=183649
<rdar://problem/38480526>

Reviewed by Dan Bernstein.

* Configurations/Base.xcconfig:
* JavaScriptCore.xcodeproj/project.pbxproj:

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

19 months agoLayout Test http/wpt/service-workers/update-service-worker.https.html is flaky
youenn@apple.com [Thu, 15 Mar 2018 19:21:57 +0000 (19:21 +0000)]
Layout Test http/wpt/service-workers/update-service-worker.https.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=181753
<rdar://problem/36605091>

Unreviewed.

* platform/mac-wk2/TestExpectations: Test is no longer flaky on High Sierra Release.

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

19 months agoAdd unit-test for NetworkTransaction URLError handling
aakash_jain@apple.com [Thu, 15 Mar 2018 18:39:43 +0000 (18:39 +0000)]
Add unit-test for NetworkTransaction URLError handling
https://bugs.webkit.org/show_bug.cgi?id=183664

Reviewed by Alexey Proskuryakov.

* Scripts/webkitpy/common/net/networktransaction_unittest.py:
(NetworkTransactionTest._raise_URLError): Method to raise URLError.
(NetworkTransactionTest.test_retry_on_HTTPError): Renamed from test_retry.
(NetworkTransactionTest.test_retry_on_URLError): unit-test for testing URLError handling.

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

19 months agoREGRESSION(r229484): Plugins often require CGS Connections to draw
bfulgham@apple.com [Thu, 15 Mar 2018 18:30:19 +0000 (18:30 +0000)]
REGRESSION(r229484): Plugins often require CGS Connections to draw
https://bugs.webkit.org/show_bug.cgi?id=183663
<rdar://problem/38439218>

Reviewed by Per Arne Vollan.

Flash requires an active CGSConnection to work properly. Since we don't want the WebContent
process to have on, create a new plugin process-specific layer host creation method that
gives this access.

* Platform/mac/LayerHostingContext.h:
* Platform/mac/LayerHostingContext.mm:
(WebKit::LayerHostingContext::createForExternalPluginHostingProcess): Added.
* PluginProcess/mac/PluginControllerProxyMac.mm:
(WebKit::PluginControllerProxy::updateLayerHostingContext): Use the new creation
method.

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

19 months agoMessagePort is not always destroyed on the right thread
youenn@apple.com [Thu, 15 Mar 2018 18:21:10 +0000 (18:21 +0000)]
MessagePort is not always destroyed on the right thread
https://bugs.webkit.org/show_bug.cgi?id=183619
<rdar://problem/38204711>

Reviewed by Chris Dumez.

Source/WebCore:

Add assertion to ensure MessagePort is destroyed in the right thread.
Modify methods taking a ref in a lambda to rely on weak pointers and refing the WorkerThread if in a worker context.
It is safe to ref the WorkerThread since it is thread safe ref counted and we are passing the ref to the main thread
where the WorkerThread is expected to be destroyed.

Test: http/tests/workers/worker-messageport-2.html

* dom/MessagePort.cpp:
(WebCore::MessagePort::~MessagePort):
(WebCore::MessagePort::dispatchMessages):
(WebCore::MessagePort::updateActivity):
(WebCore::MessagePort::hasPendingActivity const):
* dom/MessagePort.h:

LayoutTests:

* TestExpectations:
* http/tests/workers/worker-messageport-2-expected.txt: Added.
* http/tests/workers/worker-messageport-2.html: Added.

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

19 months agoEWS should print the URL in logs on URLError
aakash_jain@apple.com [Thu, 15 Mar 2018 17:35:29 +0000 (17:35 +0000)]
EWS should print the URL in logs on URLError
https://bugs.webkit.org/show_bug.cgi?id=183651

Reviewed by Alexey Proskuryakov.

* Scripts/webkitpy/common/net/bugzilla/bugzilla.py:
(Bugzilla.open_url): Pass the url.
* Scripts/webkitpy/common/net/networktransaction.py:
(NetworkTransaction.run): Accept optional url parameter and print it on URLError.

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

19 months agoAdopt new AVURLAssetUseClientURLLoadingExclusively AVURLAsset creation option.
jer.noble@apple.com [Thu, 15 Mar 2018 16:58:13 +0000 (16:58 +0000)]
Adopt new AVURLAssetUseClientURLLoadingExclusively AVURLAsset creation option.
https://bugs.webkit.org/show_bug.cgi?id=183660

Reviewed by Jon Lee.

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

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

19 months agoUnreviewed, fix tiny mistake in r229615 that caused API tests failures.
cdumez@apple.com [Thu, 15 Mar 2018 16:17:24 +0000 (16:17 +0000)]
Unreviewed, fix tiny mistake in r229615 that caused API tests failures.

* workers/service/server/SWServer.cpp:
(WebCore::SWServer::addRegistrationFromStore):

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

19 months ago[GTK][WPE] Enable service workers
Ms2ger@igalia.com [Thu, 15 Mar 2018 16:00:08 +0000 (16:00 +0000)]
[GTK][WPE] Enable service workers
https://bugs.webkit.org/show_bug.cgi?id=178576

Reviewed by Žan Doberšek.

.:

* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsWPE.cmake:

LayoutTests:

* platform/wpe/TestExpectations: update remaining expectations to point to another bug.

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

19 months ago[LayoutReloaded] Introduce Layout namespace
zalan@apple.com [Thu, 15 Mar 2018 15:59:46 +0000 (15:59 +0000)]
[LayoutReloaded] Introduce Layout namespace
https://bugs.webkit.org/show_bug.cgi?id=183659

Reviewed by Antti Koivisto.

This is in preparation for introducing the display tree.
Box -> Layout.Box

* LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js:
(BlockFormattingContext.prototype.layout):
(BlockFormattingContext.prototype.computeWidth):
(BlockFormattingContext.prototype.computeHeight):
(BlockFormattingContext.prototype.marginTop):
(BlockFormattingContext.prototype.marginBottom):
(BlockFormattingContext.prototype._computeStaticPosition):
(BlockFormattingContext.prototype._placeInFlowPositionedChildren):
(BlockFormattingContext.prototype._placeOutOfFlowDescendants):
(BlockFormattingContext.prototype._computeOutOfFlowWidth):
(BlockFormattingContext.prototype._computeFloatingWidth):
(BlockFormattingContext.prototype._computeInFlowWidth):
(BlockFormattingContext.prototype._computeOutOfFlowHeight):
(BlockFormattingContext.prototype._computeFloatingHeight):
(BlockFormattingContext.prototype._computeInFlowHeight):
(BlockFormattingContext.prototype._horizontalConstraint):
(BlockFormattingContext.prototype._contentHeight):
(BlockFormattingContext.prototype._adjustBottomWithFIXME):
(BlockFormattingContext.prototype._computeInFlowPositionedPosition):
(BlockFormattingContext.prototype._computeOutOfFlowPosition):
(BlockFormattingContext.prototype._shrinkToFitWidth):
(BlockFormattingContext):
(BlockFormattingContext.prototype._computeHorizontalConstraint): Deleted.
(BlockFormattingContext.prototype._computeContentHeight): Deleted.
* LayoutReloaded/FormattingContext/BlockFormatting/BlockMarginCollapse.js:
(BlockMarginCollapse.marginTop):
(BlockMarginCollapse.marginBottom):
(BlockMarginCollapse._isMarginTopCollapsedWithSibling):
(BlockMarginCollapse._isMarginBottomCollapsedWithSibling):
(BlockMarginCollapse._isMarginTopCollapsedWithParent):
(BlockMarginCollapse._isMarginBottomCollapsedWithParent):
(BlockMarginCollapse._nonCollapsedMarginTop):
(BlockMarginCollapse._nonCollapsedMarginBottom):
(BlockMarginCollapse._collapsedMarginTopFromFirstChild):
(BlockMarginCollapse._collapsedMarginBottomFromLastChild):
(BlockMarginCollapse._hasAdjoiningMarginTopAndBottom):
(BlockMarginCollapse):
* LayoutReloaded/FormattingContext/FloatingContext.js:
(FloatingContext.prototype.computePosition):
(FloatingContext.prototype._positionForClear):
(FloatingContext.prototype._computePositionToAvoidIntrudingFloats):
* LayoutReloaded/FormattingContext/FormattingContext.js:
(FormattingContext.prototype.computeWidth):
(FormattingContext.prototype.computeHeight):
(FormattingContext.prototype.marginTop):
(FormattingContext.prototype.marginLeft):
(FormattingContext.prototype.marginBottom):
(FormattingContext.prototype.marginRight):
(FormattingContext.prototype.absoluteMarginBox):
(FormattingContext.prototype.absoluteBorderBox):
(FormattingContext.prototype.absolutePaddingBox):
(FormattingContext.prototype.absoluteContentBox):
(FormattingContext):
* LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js:
(InlineFormattingContext.prototype.layout):
* LayoutReloaded/LayoutTree/BlockContainer.js:
(BlockContainer): Deleted.
(BlockContainer.prototype.establishesInlineFormattingContext): Deleted.
* LayoutReloaded/LayoutTree/Box.js:
(Box): Deleted.
(Box.prototype.id): Deleted.
(Box.prototype.setRendererName): Deleted.
(Box.prototype.name): Deleted.
(Box.prototype.node): Deleted.
(Box.prototype.parent): Deleted.
(Box.prototype.nextSibling): Deleted.
(Box.prototype.nextInFlowSibling): Deleted.
(Box.prototype.previousSibling): Deleted.
(Box.prototype.previousInFlowSibling): Deleted.
(Box.prototype.setParent): Deleted.
(Box.prototype.setNextSibling): Deleted.
(Box.prototype.setPreviousSibling): Deleted.
(Box.prototype.rect): Deleted.
(Box.prototype.topLeft): Deleted.
(Box.prototype.bottomRight): Deleted.
(Box.prototype.setTopLeft): Deleted.
(Box.prototype.setSize): Deleted.
(Box.prototype.setWidth): Deleted.
(Box.prototype.setHeight): Deleted.
(Box.prototype.isContainer): Deleted.
(Box.prototype.isBlockLevelBox): Deleted.
(Box.prototype.isBlockContainerBox): Deleted.
(Box.prototype.isInlineLevelBox): Deleted.
(Box.prototype.setIsAnonymous): Deleted.
(Box.prototype.isAnonymous): Deleted.
(Box.prototype.establishesFormattingContext): Deleted.
(Box.prototype.establishedFormattingContext): Deleted.
(Box.prototype.establishesBlockFormattingContext): Deleted.
(Box.prototype.establishesInlineFormattingContext): Deleted.
(Box.prototype.isPositioned): Deleted.
(Box.prototype.isRelativePositioned): Deleted.
(Box.prototype.isAbsolutePositioned): Deleted.
(Box.prototype.isFixedPositioned): Deleted.
(Box.prototype.isInFlow): Deleted.
(Box.prototype.isOutOfFlowPositioned): Deleted.
(Box.prototype.isInFlowPositioned): Deleted.
(Box.prototype.isFloatingPositioned): Deleted.
(Box.prototype.isFloatingOrOutOfFlowPositioned): Deleted.
(Box.prototype.isRootElement): Deleted.
(Box.prototype.containingBlock): Deleted.
(Box.prototype.borderBox): Deleted.
(Box.prototype.paddingBox): Deleted.
(Box.prototype.contentBox): Deleted.
* LayoutReloaded/LayoutTree/Container.js:
(Container): Deleted.
(Container.prototype.isContainer): Deleted.
(Container.prototype.setFirstChild): Deleted.
(Container.prototype.setLastChild): Deleted.
(Container.prototype.firstChild): Deleted.
(Container.prototype.firstInFlowChild): Deleted.
(Container.prototype.lastChild): Deleted.
(Container.prototype.lastInFlowChild): Deleted.
(Container.prototype.hasChild): Deleted.
(Container.prototype.hasInFlowChild): Deleted.
* LayoutReloaded/LayoutTree/InitialBlockContainer.js:
(InitialBlockContainer): Deleted.
(InitialBlockContainer.prototype.establishesBlockFormattingContext): Deleted.
(InitialBlockContainer.prototype.paddingBox): Deleted.
(InitialBlockContainer.prototype.contentBox): Deleted.
* LayoutReloaded/LayoutTree/InlineBox.js:
(InlineBox): Deleted.
(InlineBox.prototype.setText): Deleted.
(InlineBox.prototype.text): Deleted.
* LayoutReloaded/TreeBuilder.js:
(TreeBuilder.prototype.createTree):
(TreeBuilder.prototype._createAndAttachBox):
* LayoutReloaded/Utils.js:
(Utils._dumpBox):

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

19 months ago[TexMap] Remove TextureMapperLayer::texture()
zandobersek@gmail.com [Thu, 15 Mar 2018 07:34:16 +0000 (07:34 +0000)]
[TexMap] Remove TextureMapperLayer::texture()
https://bugs.webkit.org/show_bug.cgi?id=183635

Reviewed by Michael Catanzaro.

Source/WebCore:

Remove the unused TextureMapperLayer::texture() method. This enables
removing the virtual TextureMapperBackingStore::texture() method, as
well as the implementations of it in TextureMapperTiledBackingStore and
CoordinatedBackingStore classes.

No change in behavior.

* platform/graphics/texmap/TextureMapperBackingStore.h:
* platform/graphics/texmap/TextureMapperLayer.h:
* platform/graphics/texmap/TextureMapperTiledBackingStore.cpp:
(WebCore::TextureMapperTiledBackingStore::texture const): Deleted.
* platform/graphics/texmap/TextureMapperTiledBackingStore.h:

Source/WebKit:

Remove the CoordinatedBackingStore::texture() override since the virtual
method is also being removed.

* Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
(WebKit::CoordinatedBackingStore::texture const): Deleted.
* Shared/CoordinatedGraphics/CoordinatedBackingStore.h:

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

19 months ago[TexMap] Don't bother caching pattern transform matrix
zandobersek@gmail.com [Thu, 15 Mar 2018 07:14:28 +0000 (07:14 +0000)]
[TexMap] Don't bother caching pattern transform matrix
https://bugs.webkit.org/show_bug.cgi?id=183633

Reviewed by Michael Catanzaro.

Remove the m_patternTransform and m_patternTransformDirty member
variables from the TextureMapperLayer class. These unnecessarily
complicate the state update methods that need to compare the given
attribute against the current state, and only update it if it has
changed.

Instead, compute the pattern TransformationMatrix value on-the-fly in
the paintSelf() method, if at all necessary.

No change in functionality.

* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::paintSelf):
(WebCore::TextureMapperLayer::setContentsRect):
(WebCore::TextureMapperLayer::setContentsTileSize):
(WebCore::TextureMapperLayer::setContentsTilePhase):
(WebCore::TextureMapperLayer::computePatternTransformIfNeeded): Deleted.
* platform/graphics/texmap/TextureMapperLayer.h:

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

19 months agoWeb Inspector: Canvas: a recording initiated by the user should be shown immediately...
webkit@devinrousso.com [Thu, 15 Mar 2018 05:54:53 +0000 (05:54 +0000)]
Web Inspector: Canvas: a recording initiated by the user should be shown immediately on completion
https://bugs.webkit.org/show_bug.cgi?id=183647
<rdar://problem/38479187>

Reviewed by Matt Baker.

Source/WebInspectorUI:

When recordings are initiated via `console.record`, we don't want to automatically show the
recording after it's payload is sent to the frontend. We determine whether a recording came
from the console by comparing the recording's associated canvas with the current value of
`_recordingCanvas`. Previously, when stopping a recording, we would always null the value,
which meant that all non-single-frame recordings (single-frame recordings are stopped by
the agent after the first paint or tick after an action is performed) would be categorized
as coming from the console, since `_recordingCanvas` would be null by the time the frontend
recieved the payload.

This patch changes it so that the nulling of `_recordingCanvas` in `stopRecording` is only
done if the agent command errors. It was already the case that `_recordingCanvas` was nulled
in `stopRecording`, so this patch just prevents it from being nulled too early.

* UserInterface/Controllers/CanvasManager.js:
(WI.CanvasManager.prototype.stopRecording):

LayoutTests:

* inspector/canvas/recording-2d.html:
Reorder the agent calls so that the CanvasManager `_recordingCanvas` state variable has a
chance to properly update after a recording is stopped.

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

19 months agoResource Load Statistics: Add clearing of storage access to WebResourceLoadStatistics...
wilander@apple.com [Thu, 15 Mar 2018 05:05:36 +0000 (05:05 +0000)]
Resource Load Statistics: Add clearing of storage access to WebResourceLoadStatisticsStore::clearInMemory()
https://bugs.webkit.org/show_bug.cgi?id=183641
<rdar://problem/38469497>

Reviewed by Brent Fulgham and Chris Dumez.

Source/WebCore:

No new tests. This change is to stabilize existing layout tests.
See Ryan Haddad's comment in https://bugs.webkit.org/show_bug.cgi?id=183620.

* platform/network/NetworkStorageSession.h:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::removeAllStorageAccess):
    New function to clear out all storage access entries.

Source/WebKit:

This change is to stabilize existing layout tests by removing
all storage access entries on a call to
WebResourceLoadStatisticsStore::clearInMemory().
See Ryan Haddad's comment in https://bugs.webkit.org/show_bug.cgi?id=183620.

Almost all of the code changes are piping to get this
call from the WebResourceLoadStatisticsStore to
WebCore::NetworkStorageSession where entries reside.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::removeAllStorageAccess):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::removeAllStorageAccess):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
(WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
(WebKit::WebResourceLoadStatisticsStore::clearInMemory):
    Now also clears all storage access entries in the network process.
* UIProcess/WebResourceLoadStatisticsStore.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::removeAllStorageAccessHandler):
(WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
* UIProcess/WebsiteData/WebsiteDataStore.h:

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

19 months agoAdd support for boolean properties in BuildbotSyncer while submitting build request...
aakash_jain@apple.com [Thu, 15 Mar 2018 03:17:37 +0000 (03:17 +0000)]
Add support for boolean properties in BuildbotSyncer while submitting build request to Buildbot 0.9 server
https://bugs.webkit.org/show_bug.cgi?id=183638

Reviewed by Ryosuke Niwa.

* tools/js/buildbot-syncer.js:
(BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Allow boolean properties.
* server-tests/tools-sync-buildbot-integration-tests.js: Tests for boolean properties.
* unit-tests/buildbot-syncer-tests.js: Ditto.

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

19 months agoUnreviewed, rolling out r229613.
ryanhaddad@apple.com [Wed, 14 Mar 2018 22:58:29 +0000 (22:58 +0000)]
Unreviewed, rolling out r229613.

Caused API test failures

Reverted changeset:

"Make policy decisions asynchronous"
https://bugs.webkit.org/show_bug.cgi?id=180568
https://trac.webkit.org/changeset/229613

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

19 months agoimported/w3c/web-platform-tests/WebCryptoAPI/wrapKey_unwrapKey/wrapKey_unwrapKey...
youenn@apple.com [Wed, 14 Mar 2018 22:52:09 +0000 (22:52 +0000)]
imported/w3c/web-platform-tests/WebCryptoAPI/wrapKey_unwrapKey/wrapKey_unwrapKey.worker.html is crashing
https://bugs.webkit.org/show_bug.cgi?id=183602

Reviewed by Chris Dumez.

Introduce a map of ScriptExecutionContext that is read/write protected using a Lock.
This allows introducing postTaskTo taking a ScriptExecutionContext identifier and callable from any thread.
Use that method in Crypto instead of refing/unrefing  the context.
Lock only happens if context does some postTask activity. This is governed by calling or not the new contextIdentifier() getter.

Covered by crypto tests no longer failing m_workerGlobalScope->hasOneRef() assertion.

* crypto/CryptoAlgorithm.cpp:
(WebCore::dispatchAlgorithmOperation):
* crypto/algorithms/CryptoAlgorithmECDH.cpp:
(WebCore::CryptoAlgorithmECDH::deriveBits):
* crypto/algorithms/CryptoAlgorithmSHA1.cpp:
(WebCore::CryptoAlgorithmSHA1::digest):
* crypto/algorithms/CryptoAlgorithmSHA224.cpp:
(WebCore::CryptoAlgorithmSHA224::digest):
* crypto/algorithms/CryptoAlgorithmSHA256.cpp:
(WebCore::CryptoAlgorithmSHA256::digest):
* crypto/algorithms/CryptoAlgorithmSHA384.cpp:
(WebCore::CryptoAlgorithmSHA384::digest):
* crypto/algorithms/CryptoAlgorithmSHA512.cpp:
(WebCore::CryptoAlgorithmSHA512::digest):
* crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
(WebCore::CryptoKeyRSA::generatePair):
* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::CryptoKeyRSA::generatePair):
* dom/Document.cpp:
(WebCore::Document::~Document):
* dom/ScriptExecutionContext.cpp:
(WebCore::allScriptExecutionContextsMapLock):
(WebCore::ScriptExecutionContext::ScriptExecutionContext):
(WebCore::ScriptExecutionContext::removeFromContextsMap):
(WebCore::ScriptExecutionContext::checkConsistency const):
(WebCore::ScriptExecutionContext::postTaskTo):
* dom/ScriptExecutionContext.h:
(WebCore::ScriptExecutionContext::contextIdentifier const):
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::~WorkerGlobalScope):

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

19 months agoReduce use of SWServerToContextConnection::globalServerToContextConnection()
cdumez@apple.com [Wed, 14 Mar 2018 22:32:28 +0000 (22:32 +0000)]
Reduce use of SWServerToContextConnection::globalServerToContextConnection()
https://bugs.webkit.org/show_bug.cgi?id=183626

Reviewed by Youenn Fablet.

Source/WebCore:

Reduce use of SWServerToContextConnection::globalServerToContextConnection() as we are moving towards
having multiple context connections.

No new tests, no expected behavior change.

* workers/service/server/SWServer.cpp:
(WebCore::SWServer::matchAll):
(WebCore::SWServer::serverToContextConnectionCreated):
(WebCore::SWServer::runServiceWorkerIfNecessary):
(WebCore::SWServer::runServiceWorker):
(WebCore::SWServer::terminateWorkerInternal):
(WebCore::SWServer::markAllWorkersAsTerminated):
(WebCore::SWServer::workerContextTerminated):
(WebCore::SWServer::fireInstallEvent):
(WebCore::SWServer::fireActivateEvent):
* workers/service/server/SWServer.h:
* workers/service/server/SWServerToContextConnection.cpp:
(WebCore::SWServerToContextConnection::findClientByIdentifier):
(WebCore::SWServerToContextConnection::matchAll):
(WebCore::SWServerToContextConnection::claim):
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::contextConnection):
(WebCore::SWServerWorker::matchAll):
* workers/service/server/SWServerWorker.h:

Source/WebKit:

Reduce use of SWServerToContextConnection::globalServerToContextConnection() as we are moving
towards having multiple context connections.

* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::startFetch):
(WebKit::WebSWServerConnection::postMessageToServiceWorker):

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

19 months agoMessagePort should remove its listeners when being closed
youenn@apple.com [Wed, 14 Mar 2018 22:20:33 +0000 (22:20 +0000)]
MessagePort should remove its listeners when being closed
https://bugs.webkit.org/show_bug.cgi?id=183644

Reviewed by Chris Dumez.

Source/WebCore:

Test: http/tests/workers/worker-messageport.html

* dom/MessagePort.cpp:
(WebCore::MessagePort::close):
(WebCore::MessagePort::contextDestroyed):

LayoutTests:

* http/tests/workers/resources/messageport-echo-worker.js: Added.
* http/tests/workers/worker-messageport-expected.txt: Added.
* http/tests/workers/worker-messageport.html: Added.

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

19 months agoMake policy decisions asynchronous
cdumez@apple.com [Wed, 14 Mar 2018 21:47:14 +0000 (21:47 +0000)]
Make policy decisions asynchronous
https://bugs.webkit.org/show_bug.cgi?id=180568
<rdar://problem/37131297>

Reviewed by Alex Christensen.

Source/WebKit:

Get rid of synchronous IPC and synchronous code paths for policy delegates.
Policy decisions are now all made asynchronously and rely on asynchronous
IPC.

This code change is based on work by Alex Christensen.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedPolicyDecision):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForResponse):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):

LayoutTests:

Rebaseline tests for WebKit2. The issue is that some tests dump policy delegate calls
and things now happen in a slightly different order now that those delegates are
asynchronous.

* TestExpectations:
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-css-in-main-frame-expected.txt:
* platform/ios/http/tests/loading/simple-subframe-expected.txt:
* platform/mac-wk2/http/tests/loading/simple-subframe-expected.txt: Copied from LayoutTests/platform/ios/http/tests/loading/simple-subframe-expected.txt.
* platform/wk2/fast/loader/fragment-navigation-base-blank-expected.txt: Copied from LayoutTests/platform/mac/webarchive/loading/mainresource-null-mimetype-crash-expected.txt.
* platform/wk2/fast/loader/iframe-meta-refresh-base-blank-expected.txt: Copied from LayoutTests/platform/wk2/http/tests/loading/authentication-after-redirect-stores-wrong-credentials/authentication-after-redirect-stores-wrong-credentials-expected.txt.
* platform/wk2/fast/loader/iframe-set-location-base-blank-expected.txt: Copied from LayoutTests/platform/wk2/http/tests/loading/authentication-after-redirect-stores-wrong-credentials/authentication-after-redirect-stores-wrong-credentials-expected.txt.
* platform/wk2/fast/loader/main-document-url-for-non-http-loads-expected.txt: Added.
* platform/wk2/fast/loader/refresh-iframe-base-blank-expected.txt: Copied from LayoutTests/platform/wk2/http/tests/loading/authentication-after-redirect-stores-wrong-credentials/authentication-after-redirect-stores-wrong-credentials-expected.txt.
* platform/wk2/fast/loader/subframe-removes-itself-expected.txt: Copied from LayoutTests/platform/mac/webarchive/loading/mainresource-null-mimetype-crash-expected.txt.
* platform/wk2/http/tests/contentdispositionattachmentsandbox/cross-origin-frames-disabled-expected.txt: Added.
* platform/wk2/http/tests/contentextensions/block-everything-unless-domain-expected.txt: Added.
* platform/wk2/http/tests/loading/authentication-after-redirect-stores-wrong-credentials/authentication-after-redirect-stores-wrong-credentials-expected.txt:
* platform/wk2/http/tests/loading/bad-server-subframe-expected.txt: Added.
* platform/wk2/http/tests/loading/basic-auth-load-URL-with-consecutive-slashes-expected.txt:
* platform/wk2/http/tests/loading/redirect-with-no-location-crash-expected.txt: Copied from LayoutTests/platform/mac/webarchive/loading/mainresource-null-mimetype-crash-expected.txt.
* platform/wk2/http/tests/loading/server-redirect-for-provisional-load-caching-expected.txt: Added.
* platform/wk2/http/tests/loading/slow-parsing-subframe-expected.txt: Added.
* platform/wk2/http/tests/misc/will-send-request-returns-null-on-redirect-expected.txt: Added.
* platform/wk2/http/tests/misc/window-dot-stop-expected.txt: Added.
* platform/wk2/http/tests/navigation/redirect-preserves-fragment-expected.txt: Added.
* platform/wk2/http/tests/navigation/redirect-to-fragment-expected.txt: Added.
* platform/wk2/http/tests/navigation/redirect-to-invalid-url-expected.txt: Added.
* platform/wk2/http/tests/security/XFrameOptions/x-frame-options-allowall-expected.txt: Added.
* platform/wk2/http/tests/security/XFrameOptions/x-frame-options-deny-expected.txt: Added.
* platform/wk2/http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-expected.txt: Added.
* platform/wk2/http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-in-body-expected.txt: Added.
* platform/wk2/http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-parent-same-origin-allow-expected.txt: Added.
* platform/wk2/http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-parent-same-origin-deny-expected.txt: Added.
* platform/wk2/http/tests/security/XFrameOptions/x-frame-options-invalid-expected.txt: Added.
* platform/wk2/http/tests/security/XFrameOptions/x-frame-options-multiple-headers-conflict-expected.txt: Added.
* platform/wk2/http/tests/security/XFrameOptions/x-frame-options-multiple-headers-sameorigin-allow-expected.txt: Added.
* platform/wk2/http/tests/security/XFrameOptions/x-frame-options-multiple-headers-sameorigin-deny-expected.txt: Added.
* platform/wk2/http/tests/security/XFrameOptions/x-frame-options-parent-same-origin-allow-expected.txt: Added.
* platform/wk2/http/tests/security/XFrameOptions/x-frame-options-parent-same-origin-deny-expected.txt: Added.
* platform/wk2/http/tests/security/blocked-on-redirect-expected.txt: Added.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/data-url-iframe-in-main-frame-expected.txt: Copied from LayoutTests/platform/mac/webarchive/loading/mainresource-null-mimetype-crash-expected.txt.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-css-in-iframe-expected.txt: Added.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-css-in-iframe-report-only-expected.txt: Added.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-css-in-main-frame-expected.txt: Copied from LayoutTests/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-css-in-main-frame-expected.txt.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-iframe-in-iframe-expected.txt: Added.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-iframe-in-main-frame-expected.txt: Added.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-iframe-expected.txt: Added.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-iframe-with-enforced-and-report-policies-expected.txt: Added.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-iframe-with-inherited-policy-expected.txt: Added.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-javascript-url-iframe-in-iframe-expected.txt: Added.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-main-frame-expected.txt: Copied from LayoutTests/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-css-in-main-frame-expected.txt.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-xslt-document-in-iframe-with-inherited-policy-expected.txt: Added.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-plugin-in-iframe-expected.txt: Added.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-plugin-in-main-frame-expected.txt: Copied from LayoutTests/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-css-in-main-frame-expected.txt.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-script-in-iframe-expected.txt: Added.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-script-in-iframe-with-inherited-policy-expected.txt: Added.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-script-in-main-frame-expected.txt: Copied from LayoutTests/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-css-in-main-frame-expected.txt.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-xhr-asynchronous-in-iframe-expected.txt: Added.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-xhr-asynchronous-in-main-frame-expected.txt: Added.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-xhr-synchronous-in-iframe-expected.txt: Added.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-xhr-synchronous-in-main-frame-expected.txt: Added.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/secure-image-after-upgrade-in-iframe-expected.txt: Copied from LayoutTests/platform/mac/webarchive/loading/mainresource-null-mimetype-crash-expected.txt.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/secure-image-after-upgrade-redirect-in-iframe-expected.txt: Copied from LayoutTests/platform/mac/webarchive/loading/mainresource-null-mimetype-crash-expected.txt.
* platform/wk2/http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/iframe-upgrade.https-expected.txt: Added.
* platform/wk2/http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/proper-nested-upgrades-expected.txt: Added.
* platform/wk2/http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/upgrade-insecure-css-in-iframe-expected.txt: Copied from LayoutTests/platform/mac/webarchive/loading/mainresource-null-mimetype-crash-expected.txt.
* platform/wk2/http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/upgrade-redirect-http-to-https-script-in-iframe-expected.txt: Copied from LayoutTests/platform/mac/webarchive/loading/mainresource-null-mimetype-crash-expected.txt.
* platform/wk2/http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/upgrade-redirect-https-to-http-script-in-iframe-expected.txt: Copied from LayoutTests/platform/mac/webarchive/loading/mainresource-null-mimetype-crash-expected.txt.
* platform/wk2/http/tests/security/http-0.9/iframe-blocked-expected.txt: Added.
* platform/wk2/http/tests/security/mixedContent/about-blank-iframe-in-main-frame-expected.txt: Added.
* platform/wk2/http/tests/security/mixedContent/data-url-iframe-in-main-frame-expected.txt: Copied from LayoutTests/platform/mac/webarchive/loading/mainresource-null-mimetype-crash-expected.txt.
* platform/wk2/http/tests/security/mixedContent/data-url-script-in-iframe-expected.txt: Copied from LayoutTests/platform/mac/webarchive/loading/mainresource-null-mimetype-crash-expected.txt.
* platform/wk2/http/tests/security/mixedContent/empty-url-plugin-in-frame-expected.txt: Copied from LayoutTests/platform/mac/webarchive/loading/mainresource-null-mimetype-crash-expected.txt.
* platform/wk2/http/tests/security/mixedContent/insecure-css-in-iframe-expected.txt: Copied from LayoutTests/platform/mac/webarchive/loading/mainresource-null-mimetype-crash-expected.txt.
* platform/wk2/http/tests/security/mixedContent/insecure-css-in-main-frame-expected.txt: Added.
* platform/wk2/http/tests/security/mixedContent/insecure-css-with-secure-cookies-expected.txt: Added.
* platform/wk2/http/tests/security/mixedContent/insecure-executable-css-with-secure-cookies-expected.txt: Added.
* platform/wk2/http/tests/security/mixedContent/insecure-form-in-iframe-expected.txt: Copied from LayoutTests/platform/mac/webarchive/loading/mainresource-null-mimetype-crash-expected.txt.
* platform/wk2/http/tests/security/mixedContent/insecure-form-in-main-frame-expected.txt: Added.
* platform/wk2/http/tests/security/mixedContent/insecure-iframe-in-iframe-expected.txt: Added.
* platform/wk2/http/tests/security/mixedContent/insecure-iframe-in-main-frame-expected.txt: Added.
* platform/wk2/http/tests/security/mixedContent/insecure-image-in-iframe-expected.txt: Copied from LayoutTests/platform/mac/webarchive/loading/mainresource-null-mimetype-crash-expected.txt.
* platform/wk2/http/tests/security/mixedContent/javascript-url-form-in-main-frame-expected.txt: Added.
* platform/wk2/http/tests/security/mixedContent/redirect-http-to-https-iframe-in-main-frame-expected.txt: Added.
* platform/wk2/http/tests/security/mixedContent/redirect-http-to-https-script-in-iframe-expected.txt: Added.
* platform/wk2/http/tests/security/mixedContent/redirect-https-to-http-iframe-in-main-frame-expected.txt: Added.
* platform/wk2/http/tests/security/mixedContent/redirect-https-to-http-image-secure-cookies-block-expected.txt: Added.
* platform/wk2/http/tests/security/mixedContent/redirect-https-to-http-image-secure-cookies-expected.txt: Added.
* platform/wk2/http/tests/security/mixedContent/redirect-https-to-http-script-in-iframe-expected.txt: Copied from LayoutTests/platform/mac/webarchive/loading/mainresource-null-mimetype-crash-expected.txt.
* platform/wk2/http/tests/security/xssAuditor/script-tag-with-callbacks-expected.txt: Copied from LayoutTests/platform/mac/webarchive/loading/mainresource-null-mimetype-crash-expected.txt.
* platform/wk2/inspector/page/frameScheduledNavigation-expected.txt: Added.
* platform/wk2/loader/go-back-cached-main-resource-expected.txt: Added.
* platform/wk2/webarchive/loading/mainresource-null-mimetype-crash-expected.txt: Copied from LayoutTests/platform/mac/webarchive/loading/mainresource-null-mimetype-crash-expected.txt.
* platform/wk2/webarchive/loading/test-loading-archive-expected.txt: Copied from LayoutTests/platform/mac/webarchive/loading/mainresource-null-mimetype-crash-expected.txt.
* platform/wk2/webarchive/loading/video-in-webarchive-expected.txt: Renamed from LayoutTests/platform/mac/webarchive/loading/mainresource-null-mimetype-crash-expected.txt.

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

19 months agoDrop unnecessary StorageToWebProcessConnection::workerContextProcessConnectionCreated()
cdumez@apple.com [Wed, 14 Mar 2018 20:43:48 +0000 (20:43 +0000)]
Drop unnecessary StorageToWebProcessConnection::workerContextProcessConnectionCreated()
https://bugs.webkit.org/show_bug.cgi?id=183624

Reviewed by Youenn Fablet.

Source/WebCore:

Pass in context connection to SWServer::serverToContextConnectionCreated() to avoid
relying on the deprecated globalServerToContextConnection().

No new tests, no expected behavior change.

* workers/service/server/SWServer.cpp:
(WebCore::SWServer::serverToContextConnectionCreated):
* workers/service/server/SWServer.h:

Source/WebKit:

Drop unnecessary StorageToWebProcessConnection::workerContextProcessConnectionCreated()
since it was going through all SWServers. Calling workerContextProcessConnectionCreated()
on every StorageToWebProcessConnection was thus doing redundant work.

* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::createStorageToWebProcessConnection):
* StorageProcess/StorageToWebProcessConnection.cpp:
(WebKit::StorageToWebProcessConnection::establishSWServerConnection):
(WebKit::StorageToWebProcessConnection::workerContextProcessConnectionCreated): Deleted.
* StorageProcess/StorageToWebProcessConnection.h:

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

19 months agoFix the build after r229387
timothy_horton@apple.com [Wed, 14 Mar 2018 20:20:20 +0000 (20:20 +0000)]
Fix the build after r229387
https://bugs.webkit.org/show_bug.cgi?id=183639
<rdar://problem/38448568>

Reviewed by Dean Jackson.

* wtf/Platform.h:

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

19 months agoSkip three svg LayoutTests.
ryanhaddad@apple.com [Wed, 14 Mar 2018 20:07:11 +0000 (20:07 +0000)]
Skip three svg LayoutTests.
https://bugs.webkit.org/show_bug.cgi?id=183572

Unreviewed test gardening.

* TestExpectations:

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

19 months agoEnhance the MacroAssembler and LinkBuffer to support pointer profiling.
mark.lam@apple.com [Wed, 14 Mar 2018 20:05:37 +0000 (20:05 +0000)]
Enhance the MacroAssembler and LinkBuffer to support pointer profiling.
https://bugs.webkit.org/show_bug.cgi?id=183623
<rdar://problem/38443314>

Reviewed by Michael Saboff.

Source/JavaScriptCore:

1. Added a PtrTag argument to indirect call() and indirect jump() MacroAssembler
   emitters to support pointer profiling.

2. Also added tagPtr(), untagPtr(), and removePtrTag() placeholder methods.

3. Added a PtrTag to LinkBuffer finalizeCodeWithoutDisassembly() and clients.

4. Updated clients to pass a PtrTag.  For the most part, I just apply NoPtrTag as
   a placeholder until we have time to analyze what pointer profile each client
   site has later.

5. Apply PtrTags to the YarrJIT.

* assembler/ARM64Assembler.h:
(JSC::ARM64Assembler::linkJumpOrCall):
* assembler/AbstractMacroAssembler.h:
(JSC::AbstractMacroAssembler::getLinkerAddress):
(JSC::AbstractMacroAssembler::tagPtr):
(JSC::AbstractMacroAssembler::untagPtr):
(JSC::AbstractMacroAssembler::removePtrTag):
* assembler/LinkBuffer.cpp:
(JSC::LinkBuffer::finalizeCodeWithoutDisassembly):
(JSC::LinkBuffer::finalizeCodeWithDisassembly):
* assembler/LinkBuffer.h:
(JSC::LinkBuffer::link):
(JSC::LinkBuffer::locationOfNearCall):
(JSC::LinkBuffer::locationOf):
* assembler/MacroAssemblerARM.h:
(JSC::MacroAssemblerARM::jump):
(JSC::MacroAssemblerARM::call):
(JSC::MacroAssemblerARM::readCallTarget):
* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::call):
(JSC::MacroAssemblerARM64::jump):
(JSC::MacroAssemblerARM64::readCallTarget):
(JSC::MacroAssemblerARM64::linkCall):
* assembler/MacroAssemblerARMv7.h:
(JSC::MacroAssemblerARMv7::jump):
(JSC::MacroAssemblerARMv7::relativeTableJump):
(JSC::MacroAssemblerARMv7::call):
(JSC::MacroAssemblerARMv7::readCallTarget):
* assembler/MacroAssemblerCodeRef.cpp:
(JSC::MacroAssemblerCodePtr::createLLIntCodePtr):
(JSC::MacroAssemblerCodeRef::createLLIntCodeRef):
* assembler/MacroAssemblerCodeRef.h:
(JSC::FunctionPtr::FunctionPtr):
(JSC::FunctionPtr::value const):
(JSC::MacroAssemblerCodePtr:: const):
(JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef):
(JSC::MacroAssemblerCodeRef::retaggedCode const):
* assembler/MacroAssemblerMIPS.h:
(JSC::MacroAssemblerMIPS::jump):
(JSC::MacroAssemblerMIPS::call):
(JSC::MacroAssemblerMIPS::readCallTarget):
* assembler/MacroAssemblerX86.h:
(JSC::MacroAssemblerX86::call):
(JSC::MacroAssemblerX86::jump):
(JSC::MacroAssemblerX86::readCallTarget):
* assembler/MacroAssemblerX86Common.cpp:
(JSC::MacroAssembler::probe):
* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::jump):
(JSC::MacroAssemblerX86Common::call):
* assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::call):
(JSC::MacroAssemblerX86_64::jump):
(JSC::MacroAssemblerX86_64::readCallTarget):
* assembler/testmasm.cpp:
(JSC::compile):
(JSC::invoke):
* b3/B3Compile.cpp:
(JSC::B3::compile):
* b3/B3LowerMacros.cpp:
* b3/air/AirCCallSpecial.cpp:
(JSC::B3::Air::CCallSpecial::generate):
* b3/air/testair.cpp:
* b3/testb3.cpp:
(JSC::B3::invoke):
(JSC::B3::testInterpreter):
(JSC::B3::testEntrySwitchSimple):
(JSC::B3::testEntrySwitchNoEntrySwitch):
(JSC::B3::testEntrySwitchWithCommonPaths):
(JSC::B3::testEntrySwitchWithCommonPathsAndNonTrivialEntrypoint):
(JSC::B3::testEntrySwitchLoop):
* bytecode/AccessCase.cpp:
(JSC::AccessCase::generateImpl):
* bytecode/AccessCaseSnippetParams.cpp:
(JSC::SlowPathCallGeneratorWithArguments::generateImpl):
* bytecode/InlineAccess.cpp:
(JSC::linkCodeInline):
(JSC::InlineAccess::rewireStubAsJump):
* bytecode/PolymorphicAccess.cpp:
(JSC::AccessGenerationState::emitExplicitExceptionHandler):
(JSC::PolymorphicAccess::regenerate):
* dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::compileExceptionHandlers):
(JSC::DFG::JITCompiler::link):
(JSC::DFG::JITCompiler::compileFunction):
(JSC::DFG::JITCompiler::noticeCatchEntrypoint):
* dfg/DFGJITCompiler.h:
(JSC::DFG::JITCompiler::appendCall):
* dfg/DFGJITFinalizer.cpp:
(JSC::DFG::JITFinalizer::finalize):
(JSC::DFG::JITFinalizer::finalizeFunction):
* dfg/DFGOSRExit.cpp:
(JSC::DFG::OSRExit::emitRestoreArguments):
(JSC::DFG::OSRExit::compileOSRExit):
* dfg/DFGOSRExitCompilerCommon.cpp:
(JSC::DFG::handleExitCounts):
(JSC::DFG::osrWriteBarrier):
(JSC::DFG::adjustAndJumpToTarget):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::emitSwitchIntJump):
(JSC::DFG::SpeculativeJIT::emitSwitchImm):
(JSC::DFG::SpeculativeJIT::emitSwitchStringOnString):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGThunks.cpp:
(JSC::DFG::osrExitThunkGenerator):
(JSC::DFG::osrExitGenerationThunkGenerator):
(JSC::DFG::osrEntryThunkGenerator):
* ftl/FTLCompile.cpp:
(JSC::FTL::compile):
* ftl/FTLJITFinalizer.cpp:
(JSC::FTL::JITFinalizer::finalizeCommon):
* ftl/FTLLazySlowPath.cpp:
(JSC::FTL::LazySlowPath::generate):
* ftl/FTLLink.cpp:
(JSC::FTL::link):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::lower):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargsSpread):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargs):
(JSC::FTL::DFG::LowerDFGToB3::compileCallEval):
* ftl/FTLOSRExitCompiler.cpp:
(JSC::FTL::compileStub):
(JSC::FTL::compileFTLOSRExit):
* ftl/FTLSlowPathCall.cpp:
(JSC::FTL::SlowPathCallContext::makeCall):
* ftl/FTLThunks.cpp:
(JSC::FTL::genericGenerationThunkGenerator):
(JSC::FTL::osrExitGenerationThunkGenerator):
(JSC::FTL::lazySlowPathGenerationThunkGenerator):
(JSC::FTL::slowPathCallThunkGenerator):
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::callExceptionFuzz):
(JSC::AssemblyHelpers::debugCall):
* jit/CCallHelpers.cpp:
(JSC::CCallHelpers::ensureShadowChickenPacket):
* jit/CCallHelpers.h:
(JSC::CCallHelpers::jumpToExceptionHandler):
* jit/ExecutableAllocator.cpp:
(JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator):
* jit/JIT.cpp:
(JSC::JIT::emitEnterOptimizationCheck):
(JSC::JIT::link):
(JSC::JIT::privateCompileExceptionHandlers):
* jit/JIT.h:
(JSC::JIT::appendCall):
* jit/JITMathIC.h:
(JSC::isProfileEmpty):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_catch):
(JSC::JIT::emit_op_switch_imm):
(JSC::JIT::emit_op_switch_char):
(JSC::JIT::emit_op_switch_string):
(JSC::JIT::emitSlow_op_loop_hint):
(JSC::JIT::privateCompileHasIndexedProperty):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_catch):
(JSC::JIT::emit_op_switch_imm):
(JSC::JIT::emit_op_switch_char):
(JSC::JIT::emit_op_switch_string):
(JSC::JIT::privateCompileHasIndexedProperty):
* jit/JITPropertyAccess.cpp:
(JSC::JIT::stringGetByValStubGenerator):
(JSC::JIT::privateCompileGetByVal):
(JSC::JIT::privateCompileGetByValWithCachedId):
(JSC::JIT::privateCompilePutByVal):
(JSC::JIT::privateCompilePutByValWithCachedId):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::stringGetByValStubGenerator):
* jit/JITStubRoutine.h:
* jit/Repatch.cpp:
(JSC::readCallTarget):
(JSC::appropriateOptimizingPutByIdFunction):
(JSC::linkPolymorphicCall):
(JSC::resetPutByID):
* jit/SlowPathCall.h:
(JSC::JITSlowPathCall::call):
* jit/SpecializedThunkJIT.h:
(JSC::SpecializedThunkJIT::finalize):
(JSC::SpecializedThunkJIT::callDoubleToDouble):
* jit/ThunkGenerators.cpp:
(JSC::throwExceptionFromCallSlowPathGenerator):
(JSC::slowPathFor):
(JSC::linkCallThunkGenerator):
(JSC::linkPolymorphicCallThunkGenerator):
(JSC::virtualThunkFor):
(JSC::nativeForGenerator):
(JSC::arityFixupGenerator):
(JSC::unreachableGenerator):
(JSC::boundThisNoArgsFunctionCallGenerator):
* llint/LLIntThunks.cpp:
(JSC::LLInt::generateThunkWithJumpTo):
(JSC::LLInt::functionForCallEntryThunkGenerator):
(JSC::LLInt::functionForConstructEntryThunkGenerator):
(JSC::LLInt::functionForCallArityCheckThunkGenerator):
(JSC::LLInt::functionForConstructArityCheckThunkGenerator):
(JSC::LLInt::evalEntryThunkGenerator):
(JSC::LLInt::programEntryThunkGenerator):
(JSC::LLInt::moduleProgramEntryThunkGenerator):
* runtime/PtrTag.h:
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::addCall):
(JSC::Wasm::B3IRGenerator::addCallIndirect):
* wasm/WasmBBQPlan.cpp:
(JSC::Wasm::BBQPlan::complete):
* wasm/WasmBinding.cpp:
(JSC::Wasm::wasmToWasm):
* wasm/WasmOMGPlan.cpp:
(JSC::Wasm::OMGPlan::work):
* wasm/WasmThunks.cpp:
(JSC::Wasm::throwExceptionFromWasmThunkGenerator):
(JSC::Wasm::throwStackOverflowFromWasmThunkGenerator):
(JSC::Wasm::triggerOMGTierUpThunkGenerator):
* wasm/js/WasmToJS.cpp:
(JSC::Wasm::handleBadI64Use):
(JSC::Wasm::wasmToJS):
* yarr/YarrJIT.cpp:
(JSC::Yarr::YarrGenerator::loadFromFrameAndJump):
(JSC::Yarr::YarrGenerator::BacktrackingState::linkDataLabels):
(JSC::Yarr::YarrGenerator::generateTryReadUnicodeCharacterHelper):
(JSC::Yarr::YarrGenerator::generateEnter):
(JSC::Yarr::YarrGenerator::YarrGenerator):
(JSC::Yarr::YarrGenerator::compile):
(JSC::Yarr::jitCompile):
* yarr/YarrJIT.h:
(JSC::Yarr::YarrCodeBlock::execute):

Source/WebCore:

No new tests.  Just adding PtrTags required by new MacroAssembler API.

* cssjit/FunctionCall.h:
(WebCore::FunctionCall::prepareAndCall):
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::compile):

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

19 months ago[JSC] fix order of evaluation for ClassDefinitionEvaluation
caitp@igalia.com [Wed, 14 Mar 2018 20:00:21 +0000 (20:00 +0000)]
[JSC] fix order of evaluation for ClassDefinitionEvaluation
https://bugs.webkit.org/show_bug.cgi?id=183523

Reviewed by Keith Miller.

Computed property names need to be evaluated in source order during class
definition evaluation, as it's observable (and specified to work this way).

This change improves compatibility with Chromium.

JSTests:

* stress/class_elements.js: Added.
(test):
(test.C.prototype.effect):
(test.C.effect):
(test.C.prototype.get effect):
(test.C.prototype.set effect):
(test.C):

Source/JavaScriptCore:

* bytecompiler/BytecodeGenerator.h:
(JSC::BytecodeGenerator::emitDefineClassElements):
* bytecompiler/NodesCodegen.cpp:
(JSC::PropertyListNode::emitBytecode):
(JSC::ClassExprNode::emitBytecode):
* parser/ASTBuilder.h:
(JSC::ASTBuilder::createClassExpr):
(JSC::ASTBuilder::createGetterOrSetterProperty):
(JSC::ASTBuilder::createProperty):
* parser/NodeConstructors.h:
(JSC::PropertyNode::PropertyNode):
(JSC::ClassExprNode::ClassExprNode):
* parser/Nodes.cpp:
(JSC::PropertyListNode::hasStaticallyNamedProperty):
* parser/Nodes.h:
(JSC::PropertyNode::isClassProperty const):
(JSC::PropertyNode::isStaticClassProperty const):
(JSC::PropertyNode::isInstanceClassProperty const):
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseClass):
(JSC::Parser<LexerType>::parseProperty):
(JSC::Parser<LexerType>::parseGetterSetter):
* parser/Parser.h:
* parser/SyntaxChecker.h:
(JSC::SyntaxChecker::createClassExpr):
(JSC::SyntaxChecker::createProperty):
(JSC::SyntaxChecker::createGetterOrSetterProperty):

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

19 months agoMove jsc CLI breakpoint function to $vm
keith_miller@apple.com [Wed, 14 Mar 2018 19:44:35 +0000 (19:44 +0000)]
Move jsc CLI breakpoint function to $vm
https://bugs.webkit.org/show_bug.cgi?id=183512

Reviewed by Yusuke Suzuki.

* jsc.cpp:
(GlobalObject::finishCreation):
(functionBreakpoint): Deleted.
* tools/JSDollarVM.cpp:
(JSC::functionBreakpoint):
(JSC::JSDollarVM::finishCreation):

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

19 months agoUnreviewed GTK test gardening.
aboya@igalia.com [Wed, 14 Mar 2018 17:56:19 +0000 (17:56 +0000)]
Unreviewed GTK test gardening.
https://bugs.webkit.org/show_bug.cgi?id=183636

* platform/gtk/TestExpectations:

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

19 months agoAX: Implement accessible dismiss action on iOS
cfleizach@apple.com [Wed, 14 Mar 2018 17:51:09 +0000 (17:51 +0000)]
AX: Implement accessible dismiss action on iOS
https://bugs.webkit.org/show_bug.cgi?id=183352
<rdar://problem/38161500>

Reviewed by Zalan Bujtas.

Source/WebCore:

Test: accessibility/ios-simulator/AOM-dismiss-event.html

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

Tools:

* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp:
(WTR::AccessibilityUIElement::dismiss const):
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
* WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
* WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
(WTR::AccessibilityUIElement::dismiss):

LayoutTests:

* accessibility/ios-simulator/AOM-dismiss-event-expected.txt: Added.
* accessibility/ios-simulator/AOM-dismiss-event.html: Added.
* platform/mac-wk1/TestExpectations:

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

19 months agoUpdate libwebrtc up to 36af4e9614f707f733eb2340fae66d6325aaac5b
youenn@apple.com [Wed, 14 Mar 2018 17:41:59 +0000 (17:41 +0000)]
Update libwebrtc up to 36af4e9614f707f733eb2340fae66d6325aaac5b
https://bugs.webkit.org/show_bug.cgi?id=183481

Reviewed by Eric Carlson.

Source/ThirdParty/libwebrtc:

* Configurations/libwebrtc.iOS.exp:
* Configurations/libwebrtc.iOSsim.exp:
* Configurations/libwebrtc.mac.exp:
* Source/webrtc/: refreshed
* libwebrtc.xcodeproj/project.pbxproj:

Source/WebCore:

Covered by existing tests.
Updated libwebrtc binding code.

* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::fillEncodingParameters):
* platform/mediastream/libwebrtc/LibWebRTCAudioModule.h:

Tools:

* Scripts/webkitpy/style/checker.py: Do not check style.

LayoutTests:

* webrtc/video-stats.html:

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

19 months agoFinish migration to MathML WPT tests
fred.wang@free.fr [Wed, 14 Mar 2018 16:18:01 +0000 (16:18 +0000)]
Finish migration to MathML WPT tests
https://bugs.webkit.org/show_bug.cgi?id=183628

Patch by Frederic Wang <fwang@igalia.com> on 2018-03-14
Reviewed by Manuel Rego Casasnovas.

In r225162, the MathML tests from the WPT repository were imported. They were intended to
replace the ones in imported/mathml-in-html5 but the migration was not fully possible. The
main issue was that many MathML tests use Web fonts to test the use of OpenType parameters
but document.fonts.ready is unreliable in WebKit (bug 174030). A workaround was implemented
in WPT ( https://github.com/w3c/web-platform-tests/pull/10025 ) so this commit finishes
the migration. We update the WPT MathML tests and now run them all, we remove
imported/mathml-in-html5 and the associated TestExpectations failures. Two cases unrelated to
font loading are still failing: One for the SuperscriptShiftUpCramped parameter (bug 156401)
and one for the RadicalDegreeBottomRaisePercent parameter (bug 183631).

LayoutTests/imported/w3c:

Reviewed by Manuel Rego Casasnovas.

* web-platform-tests/mathml/presentation-markup/fractions/frac-parameters-1-expected.txt: Renamed from LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/fractions/frac-parameters-1-expected.txt.
* web-platform-tests/mathml/presentation-markup/fractions/frac-parameters-1.html: Import font loading workaround.
* web-platform-tests/mathml/presentation-markup/fractions/frac-parameters-2-expected.txt: Renamed from LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/fractions/frac-parameters-2-expected.txt.
* web-platform-tests/mathml/presentation-markup/fractions/frac-parameters-2.html: Import font loading workaround.
* web-platform-tests/mathml/presentation-markup/operators/mo-axis-height-1.html: Import font loading workaround.
* web-platform-tests/mathml/presentation-markup/radicals/root-parameters-1-expected.txt: Renamed from LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/radicals/root-parameters-1-expected.txt.
Also add the failure with RadicalDegreeBottomRaisePercent.
* web-platform-tests/mathml/presentation-markup/radicals/root-parameters-1.html: Import font loading workaround.
* web-platform-tests/mathml/presentation-markup/scripts/subsup-parameters-1-expected.txt: Renamed from LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/scripts/subsup-parameters-1-expected.txt.
Also add the failure for SuperscriptShiftUpCramped.
* web-platform-tests/mathml/presentation-markup/scripts/subsup-parameters-1.html: Import font loading workaround.
* web-platform-tests/mathml/presentation-markup/scripts/underover-parameters-1-expected.txt: Renamed from LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/scripts/underover-parameters-1-expected.txt.
* web-platform-tests/mathml/presentation-markup/scripts/underover-parameters-1.html: Import font loading workaround.
* web-platform-tests/mathml/presentation-markup/scripts/underover-parameters-2-expected.txt: Renamed from LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/scripts/underover-parameters-2-expected.txt.
* web-platform-tests/mathml/presentation-markup/scripts/underover-parameters-2.html: Import font loading workaround.
* web-platform-tests/mathml/presentation-markup/scripts/underover-parameters-3-expected.txt: Renamed from LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/scripts/underover-parameters-3-expected.txt.
* web-platform-tests/mathml/presentation-markup/scripts/underover-parameters-3.html: Import font loading workaround.
* web-platform-tests/mathml/presentation-markup/scripts/underover-parameters-4-expected.txt: Renamed from LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/scripts/underover-parameters-4-expected.txt.
* web-platform-tests/mathml/presentation-markup/scripts/underover-parameters-4.html: Import font loading workaround.
* web-platform-tests/mathml/presentation-markup/tables/table-axis-height.html: Import font loading workaround.
* web-platform-tests/mathml/relations/css-styling/displaystyle-1.html: Import font loading workaround.
* web-platform-tests/mathml/relations/css-styling/lengths-3.html: Import font loading workaround.
* web-platform-tests/mathml/tools/utils/misc.py: Import update to Python 3.
(downloadWithProgressBar):

LayoutTests:

* TestExpectations: Unskip MathML WPT tests.
* imported/mathml-in-html5/LICENSE: Removed.
* imported/mathml-in-html5/README.md: Removed.
* imported/mathml-in-html5/mathml/presentation-markup/fractions/frac-parameters-1.html: Removed.
* imported/mathml-in-html5/mathml/presentation-markup/fractions/frac-parameters-2.html: Removed.
* imported/mathml-in-html5/mathml/presentation-markup/radicals/root-parameters-1.html: Removed.
* imported/mathml-in-html5/mathml/presentation-markup/scripts/subsup-parameters-1.html: Removed.
* imported/mathml-in-html5/mathml/presentation-markup/scripts/underover-parameters-1.html: Removed.
* imported/mathml-in-html5/mathml/presentation-markup/scripts/underover-parameters-2.html: Removed.
* imported/mathml-in-html5/mathml/presentation-markup/scripts/underover-parameters-3.html: Removed.
* imported/mathml-in-html5/mathml/presentation-markup/scripts/underover-parameters-4.html: Removed.
* platform/mac-wk2/TestExpectations: Remove the expectation.
* platform/win/TestExpectations: Remove the expectation.

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

19 months agoAdd label on github when exporting wpt tests to w3c/web-platform-test repo
commit-queue@webkit.org [Wed, 14 Mar 2018 16:11:03 +0000 (16:11 +0000)]
Add label on github when exporting wpt tests to w3c/web-platform-test repo
https://bugs.webkit.org/show_bug.cgi?id=183575

Patch by Brendan McLoughlin <brendan@bocoup.com> on 2018-03-14
Reviewed by Youenn Fablet.

* Scripts/webkitpy/w3c/test_exporter.py:
(TestExporter.make_pull_request):
(parse_args):
* Scripts/webkitpy/w3c/test_exporter_unittest.py:
(TestExporterTest.test_export):

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

19 months ago[LayoutReloaded] Add InlineBox dump
zalan@apple.com [Wed, 14 Mar 2018 14:48:39 +0000 (14:48 +0000)]
[LayoutReloaded] Add InlineBox dump
https://bugs.webkit.org/show_bug.cgi?id=183625

Reviewed by Antti Koivisto.

Right now line boxes live off of the inline formatting context but that's temporary and
they will be moved over to the BoxTree.

* LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js:
(BlockFormattingContext.prototype._computeContentHeight):
* LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js:
(InlineFormattingContext):
(InlineFormattingContext.prototype.lines):
(InlineFormattingContext.prototype.layout):
(InlineFormattingContext.prototype._handleText):
(InlineFormattingContext.prototype._commitLine):
(InlineFormattingContext.prototype._initializeLine):
* LayoutReloaded/FormattingContext/InlineFormatting/Line.js:
(Line):
(Line.prototype.isEmpty):
(Line.prototype.rect):
(Line.prototype.lineBoxes):
(Line.prototype.addLineBox):
(Line.prototype.appendFragment): Deleted.
* LayoutReloaded/README.md:
* LayoutReloaded/Utils.js:
(Utils.computedLineHeight):
(Utils.isBlockContainerElement):
(Utils.textHeight):
(Utils._dumpBox):
(Utils._dumpLines.):
(Utils._dumpLines):
(Utils._dumpTree):
(Utils.precisionRound):
(Utils):
* LayoutReloaded/misc/LayoutReloadedWebKit.patch:
* LayoutReloaded/test/index.html:

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

19 months agoFix the build after r229567
timothy_horton@apple.com [Wed, 14 Mar 2018 08:04:46 +0000 (08:04 +0000)]
Fix the build after r229567

* Configurations/FeatureDefines.xcconfig:

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

19 months agoResource Load Statistics: Immediately forward cookie access for domains with previous...
wilander@apple.com [Wed, 14 Mar 2018 05:17:57 +0000 (05:17 +0000)]
Resource Load Statistics: Immediately forward cookie access for domains with previous user interaction when there's an opener document
https://bugs.webkit.org/show_bug.cgi?id=183620
<rdar://problem/38431469>

Reviewed by Brent Fulgham.

Source/WebCore:

Tests: http/tests/storageAccess/deny-storage-access-under-opener.html
       http/tests/storageAccess/grant-storage-access-under-opener.html

It turns out the fix in https://bugs.webkit.org/show_bug.cgi?id=183577
wasn't enough to address the compatibility issues with popups. Some of
them just detect their unpartitioned cookies, auto-dismiss themselves,
and expect their unpartitioned cookies to be available under the opener
afterwards. We should grant them access if the popup's domain has had
user interaction _previously_.

Note that we still need https://bugs.webkit.org/show_bug.cgi?id=183577
because if the popup's domain has not received user interaction
previously, we will not grant it storage access on just the window open.

* dom/Document.cpp:
(WebCore::Document::hasRequestedPageSpecificStorageAccessWithUserInteraction):
(WebCore::Document::setHasRequestedPageSpecificStorageAccessWithUserInteraction):
(WebCore::Document::hasGrantedPageSpecificStorageAccess): Deleted.
(WebCore::Document::setHasGrantedPageSpecificStorageAccess): Deleted.
    Renamed from *Granted* to *Requested* since there is now a case
    where access will not be granted, i.e. when the popup domain has
    not had user interaction previously.
* dom/Document.h:
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::setRequestStorageAccessUnderOpenerCallback):
    Renamed *Grant* to *Request*.
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
(WebCore::ResourceLoadObserver::logWindowCreation):
    New function called from DOMWindow::createWindow().
(WebCore::ResourceLoadObserver::requestStorageAccessUnderOpener):
    New convenience function.
(WebCore::ResourceLoadObserver::setGrantStorageAccessUnderOpenerCallback): Deleted.
    Renamed *Grant* to *Request*.
* loader/ResourceLoadObserver.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::createWindow):
    Now calls ResourceLoadObserver::logWindowCreation() if a window
    was created and the opener has a document and a page ID.

Source/WebKit:

It turns out the fix in https://bugs.webkit.org/show_bug.cgi?id=183577
wasn't enough to address the compatibility issues with popups. Some of
them just detect their unpartitioned cookies, auto-dismiss themselves,
and expect their unpartitioned cookies to be available under the opener
afterwards. We should grant them access if the popup's domain has had
user interaction _previously_.

Note that we still need https://bugs.webkit.org/show_bug.cgi?id=183577
because if the popup's domain has not received user interaction
previously, we will not grant it storage access on just the window open.

* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
(WebKit::WebResourceLoadStatisticsStore::grantStorageAccessUnderOpener): Deleted.
    Renamed WebResourceLoadStatisticsStore::grantStorageAccessUnderOpener()
    to WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener()
    since there is now a case where access will not be granted, i.e. when
    the popup domain has not had user interaction previously.
* UIProcess/WebResourceLoadStatisticsStore.h:
* UIProcess/WebResourceLoadStatisticsStore.messages.in:
     Similar renaming.
* WebProcess/WebProcess.cpp:
(WebProcess::WebProcess):
     Similar renaming.

LayoutTests:

* http/tests/storageAccess/deny-storage-access-under-opener-expected.txt: Added.
* http/tests/storageAccess/deny-storage-access-under-opener.html: Added.
* http/tests/storageAccess/grant-storage-access-under-opener-expected.txt: Added.
* http/tests/storageAccess/grant-storage-access-under-opener.html: Added.
* http/tests/storageAccess/resources/set-cookie-and-report-back.html: Added.
* platform/ios/TestExpectations:
    New tests marked as [ Pass ].
* platform/mac-wk2/TestExpectations:
    New tests marked as [ Pass ].

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

19 months agofast/loader/javascript-url-iframe-remove-on-navigate.html is a flaky crash on iOS...
cdumez@apple.com [Wed, 14 Mar 2018 01:02:21 +0000 (01:02 +0000)]
fast/loader/javascript-url-iframe-remove-on-navigate.html is a flaky crash on iOS with async delegates
https://bugs.webkit.org/show_bug.cgi?id=183610

Reviewed by Youenn Fablet.

The issue was that in DocumentLoader::loadMainResource(), the call to requestMainResource() which
return null due to the load getting cancelled synchronously. If this load is the parent frame's last
pending load, then the 'load' event gets fired in the parent frame. In the test, the parent frame's
load event handler does a document.write() call which blows away the iframe. As a result, when
we return from the requestMainResource(), m_frame is null and we crash later on dereferencing it.

No new tests, covered by fast/loader/javascript-url-iframe-remove-on-navigate-async-delegate.html
which was crashing flakily.

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

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

19 months agoAdd missing artwork for fullscreen mode.
jer.noble@apple.com [Tue, 13 Mar 2018 23:19:04 +0000 (23:19 +0000)]
Add missing artwork for fullscreen mode.
https://bugs.webkit.org/show_bug.cgi?id=183618

Reviewed by Jon Lee.

* Resources/ios/iOS.xcassets/Done.imageset/Contents.json: Added.
* Resources/ios/iOS.xcassets/Done.imageset/Done.pdf: Added.
* Resources/ios/iOS.xcassets/StartPictureInPictureButton.imageset/Contents.json: Added.
* Resources/ios/iOS.xcassets/StartPictureInPictureButton.imageset/StartPictureInPictureButton@1x.png: Added.
* Resources/ios/iOS.xcassets/StartPictureInPictureButton.imageset/StartPictureInPictureButton@2x.png: Added.
* Resources/ios/iOS.xcassets/StartPictureInPictureButton.imageset/StartPictureInPictureButton@3x.png: Added.
* Resources/ios/iOS.xcassets/StopPictureInPictureButton.imageset/Contents.json: Added.
* Resources/ios/iOS.xcassets/StopPictureInPictureButton.imageset/StopPictureInPictureButton@1x.png: Added.
* Resources/ios/iOS.xcassets/StopPictureInPictureButton.imageset/StopPictureInPictureButton@2x.png: Added.
* Resources/ios/iOS.xcassets/StopPictureInPictureButton.imageset/StopPictureInPictureButton@3x.png: Added.

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

19 months agoAdd and adopt WK_ALTERNATE_FRAMEWORKS_DIR in WTF and bmalloc
timothy_horton@apple.com [Tue, 13 Mar 2018 23:18:41 +0000 (23:18 +0000)]
Add and adopt WK_ALTERNATE_FRAMEWORKS_DIR in WTF and bmalloc
https://bugs.webkit.org/show_bug.cgi?id=183576
<rdar://problem/38396766>

Reviewed by Dan Bernstein.

* Configurations/Base.xcconfig:
Source/bmalloc:

* Configurations/bmalloc.xcconfig:
* Configurations/mbmalloc.xcconfig:

Source/WTF:

* Configurations/CopyWTFHeaders.xcconfig:
* Configurations/WTF.xcconfig:
* Configurations/mbmalloc.xcconfig:

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

19 months agoLayout Test imported/w3c/web-platform-tests/service-workers/service-worker/register...
youenn@apple.com [Tue, 13 Mar 2018 23:01:46 +0000 (23:01 +0000)]
Layout Test imported/w3c/web-platform-tests/service-workers/service-worker/register-closed-window.https.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=182853
<rdar://problem/37645429>

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

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

LayoutTests:

* TestExpectations:
* platform/ios/TestExpectations:

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

19 months ago[iOS] Muted media playback can interrupt out-of-process audio
jer.noble@apple.com [Tue, 13 Mar 2018 22:54:20 +0000 (22:54 +0000)]
[iOS] Muted media playback can interrupt out-of-process audio
https://bugs.webkit.org/show_bug.cgi?id=183606
<rdar://problem/37466253>

Reviewed by Eric Carlson.

Source/WebCore:

Test: Updated TestWebKitAPI test to verify the correct AVAudioSession category is set.

A non-playing, non-muted media element will cause the AVAudioSession category to be set to
"playing" when a muted media element begins playback. Ignore these non-playing elements for
the purposes of determining the AVAudioSession category.

* platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
(PlatformMediaSessionManager::updateSessionState):

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitLegacy/ios/AudioSessionCategoryIOS.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitLegacy/ios/video-with-paused-audio-and-playing-muted.html: Added.

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

19 months ago[WK2] Web Inspector: NavigationAction for opening a link in a new tab should have...
bburg@apple.com [Tue, 13 Mar 2018 21:42:08 +0000 (21:42 +0000)]
[WK2] Web Inspector: NavigationAction for opening a link in a new tab should have a UserGestureIndicator
https://bugs.webkit.org/show_bug.cgi?id=183612
<rdar://problem/38388641>

Reviewed by Timothy Hatcher.

The current gesture token will be attached to the NavigationAction at construction time,
so set up a UserGestureIndicator when creating the action and sending it out.

* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::openInNewTab):

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

19 months agoCalling removeTrack with RTCRtpSender does not set SenderTrack to null
youenn@apple.com [Tue, 13 Mar 2018 21:14:13 +0000 (21:14 +0000)]
Calling removeTrack with RTCRtpSender does not set SenderTrack to null
https://bugs.webkit.org/show_bug.cgi?id=183308

Reviewed by Eric Carlson.

LayoutTests/imported/w3c:

* web-platform-tests/webrtc/RTCPeerConnection-removeTrack.https-expected.txt:

Source/WebCore:

Covered by updated test.

* Modules/mediastream/RTCRtpSender.cpp:
(WebCore::RTCRtpSender::stop): Set track to null when being stopped i.e. removed.
* Modules/mediastream/RTCRtpSender.h:

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

19 months agoUnreviewed GTK expectations gardening
mcatanzaro@igalia.com [Tue, 13 Mar 2018 20:48:53 +0000 (20:48 +0000)]
Unreviewed GTK expectations gardening

* platform/gtk/TestExpectations:

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

19 months agoChanging link element rel attribute from preload to stylesheet should succeed loading...
youenn@apple.com [Tue, 13 Mar 2018 20:39:17 +0000 (20:39 +0000)]
Changing link element rel attribute from preload to stylesheet should succeed loading the stylesheet
https://bugs.webkit.org/show_bug.cgi?id=183601
<rdar://problem/38309441>

Reviewed by Antti Koivisto.

Source/WebCore:

Test: http/wpt/preload/change-link-rel-attribute.html

* loader/LinkPreloadResourceClients.h:
(WebCore::LinkPreloadResourceClient::clearResource): Remove the call to CachedResource::cancelLoad.
This call is expected to be called by ResourceLoader when cancelling the load from below CachedResource.
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::allClientsRemoved): In case of preload,
cancel the load if not finished when there is no more client attached to it.
* loader/cache/CachedResource.h:

LayoutTests:

* http/wpt/preload/change-link-rel-attribute-expected.txt: Added.
* http/wpt/preload/change-link-rel-attribute.html: Added.
* http/wpt/preload/resources/style.css: Added.
(body):

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

19 months agoUnreviewed, fix typo in a comment
mcatanzaro@igalia.com [Tue, 13 Mar 2018 20:14:14 +0000 (20:14 +0000)]
Unreviewed, fix typo in a comment

* wtf/Platform.h:

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

19 months agoWKSystemPreviewView needs to implement some of UIScrollViewDelegate
dino@apple.com [Tue, 13 Mar 2018 20:10:40 +0000 (20:10 +0000)]
WKSystemPreviewView needs to implement some of UIScrollViewDelegate
https://bugs.webkit.org/show_bug.cgi?id=183607
<rdar://problem/38427622>

Reviewed by Antoine Quint.

Add an empty implementation of scrollViewDidScroll.

* UIProcess/ios/WKSystemPreviewView.mm:
(-[WKSystemPreviewView scrollViewDidScroll:]):

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

19 months agoSkip mathml-in-dashboard-expected on Windows
fred.wang@free.fr [Tue, 13 Mar 2018 19:44:08 +0000 (19:44 +0000)]
Skip mathml-in-dashboard-expected on Windows
https://bugs.webkit.org/show_bug.cgi?id=183562

There is no dashboard compatibility mode on Windows so the test is not necessary.

Patch by Frederic Wang <fwang@igalia.com> on 2018-03-13
Reviewed by Alexey Proskuryakov.

* platform/win/TestExpectations: Skip test.
* platform/win/mathml/mathml-in-dashboard-expected.png: Removed.
* platform/win/mathml/mathml-in-dashboard-expected.txt: Removed.

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

19 months agoFix some build errors and cleanup QuickLookSPI.h
dino@apple.com [Tue, 13 Mar 2018 18:28:11 +0000 (18:28 +0000)]
Fix some build errors and cleanup QuickLookSPI.h
https://bugs.webkit.org/show_bug.cgi?id=183599

Reviewed by Ryan Haddad.

* pal/spi/ios/QuickLookSPI.h:

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

19 months agofast/loader/javascript-url-iframe-remove-on-navigate.html is flaky with async policy...
cdumez@apple.com [Tue, 13 Mar 2018 18:07:30 +0000 (18:07 +0000)]
fast/loader/javascript-url-iframe-remove-on-navigate.html is flaky with async policy delegates
https://bugs.webkit.org/show_bug.cgi?id=183588

Reviewed by Alex Christensen.

The test was setting the frame's src to a javascript URL in a setTimeout(0), expecting the
navigation policy delegate to have already completed. However, with asynchronous policy
delegates, this is not necessarily the case. Therefore, we now wait for the beforeunload
event to be fired at the window, since this indicates a policy decision has been made and
we are actually navigating.

I checked that this test was printing the "FAIL" alert in both Firefox and Chrome before
this change.

* fast/loader/javascript-url-iframe-remove-on-navigate-async-delegate-expected.txt: Added.
* fast/loader/javascript-url-iframe-remove-on-navigate-async-delegate.html: Added.
* fast/loader/javascript-url-iframe-remove-on-navigate.html:

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

19 months ago[Win] Layout Test fast/html/menuitem-element.html is failing.
ross.kirsling@sony.com [Tue, 13 Mar 2018 17:16:28 +0000 (17:16 +0000)]
[Win] Layout Test fast/html/menuitem-element.html is failing.
https://bugs.webkit.org/show_bug.cgi?id=179299

Reviewed by Per Arne Vollan.

Source/WebKitLegacy/win:

* Interfaces/IWebPreferencesPrivate.idl:
* WebPreferenceKeysPrivate.h:
* WebPreferences.cpp:
(WebPreferences::menuItemElementEnabled):
(WebPreferences::setMenuItemElementEnabled):
* WebPreferences.h:
* WebView.cpp:
(WebView::notifyPreferencesChanged):
Add private web preference "menuItemElementEnabled".

Tools:

* DumpRenderTree/win/DumpRenderTree.cpp:
(setWebPreferencesForTestOptions):
Recognize test option "enableMenuItemElement".

LayoutTests:

* platform/win/TestExpectations:
Remove "failure" line.

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

19 months agoLayoutTests/http/tests/navigation/page-cache-iframe-provisional-load.html fails with...
commit-queue@webkit.org [Tue, 13 Mar 2018 16:12:40 +0000 (16:12 +0000)]
LayoutTests/http/tests/navigation/page-cache-iframe-provisional-load.html fails with async policy delegate
https://bugs.webkit.org/show_bug.cgi?id=183386

Patch by Danyao Wang <danyao@chromium.org> on 2018-03-13
Reviewed by Chris Dumez.

This test relies on the happenstance that with sync poicy decision, the subframe transitions
to FrameLoadProvisional before main frame navigation is committed. With async delegate,
policy checks for the main frame and subframe are interleaved. When the main frame policy
decision is received, it cancels the subframe check. So the page ends up being cached when
navigating away. This is working as intended.

* http/tests/navigation/page-cache-iframe-provisional-load-async-delegates-expected.txt: Added.
* http/tests/navigation/page-cache-iframe-provisional-load-async-delegates.html: Copied from LayoutTests/http/tests/navigation/page-cache-iframe-provisional-load.html.
Add a new version of the test that forces async policy delegate.

* http/tests/navigation/page-cache-iframe-provisional-load.html:
Update test to sequence main frame navigation after start of provisional navigation in subframe.

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

19 months agoRewrite frameset-flattening-simple to make expectation clearer
fred.wang@free.fr [Tue, 13 Mar 2018 13:44:28 +0000 (13:44 +0000)]
Rewrite frameset-flattening-simple to make expectation clearer
https://bugs.webkit.org/show_bug.cgi?id=183129

The description of fast/frames/flattening/frameset-flattening-simple.html says that the
iframe should be 800px wide and should not have any scrollbars. However, it is a bit
difficult to know the size when checking the test visually. Moreover, the scrollbars of the
main frame are visible, which makes things a bit confusing and may be the cause of bug 71655
on GTK.

Patch by Frederic Wang <fwang@igalia.com> on 2018-03-13
Reviewed by Javier Fernandez.

* fast/frames/flattening/frameset-flattening-simple.html: Put the frame inside a 200x300
frameset cell and set its width to 300px. The frame should be a 300x300 square when it is
flattened (test passes) and a 200x300 rectangle when it is not (test fails). That's easier
to verify visually. That also avoids scrollbars on the main frame.
* platform/gtk/TestExpectations: Attempt to remove flacky expectation.
* platform/gtk/fast/frames/flattening/frameset-flattening-simple-expected.png: Update.
* platform/gtk/fast/frames/flattening/frameset-flattening-simple-expected.txt: Ditto.
* platform/ios/fast/frames/flattening/frameset-flattening-simple-expected.txt: Ditto.
* platform/mac-wk2/fast/frames/flattening/frameset-flattening-simple-expected.txt: Ditto.
* platform/mac/fast/frames/flattening/frameset-flattening-simple-expected.png: Ditto.
* platform/mac/fast/frames/flattening/frameset-flattening-simple-expected.txt: Ditto.
* platform/win/fast/frames/flattening/frameset-flattening-simple-expected.txt: Ditto.

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

19 months agoSoft-link LocalAuthentication.Framework
jiewen_tan@apple.com [Tue, 13 Mar 2018 08:56:09 +0000 (08:56 +0000)]
Soft-link LocalAuthentication.Framework
https://bugs.webkit.org/show_bug.cgi?id=183587
<rdar://problem/38219763>

Reviewed by Brian Burg.

* UIProcess/CredentialManagement/cocoa/WebCredentialsMessengerProxyCocoa.mm:
(WebKit::WebCredentialsMessengerProxy::platformIsUserVerifyingPlatformAuthenticatorAvailable):
* WebKit.xcodeproj/project.pbxproj:

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

19 months agoGardening: speculative build fix for WinCairo.
mark.lam@apple.com [Tue, 13 Mar 2018 06:10:14 +0000 (06:10 +0000)]
Gardening: speculative build fix for WinCairo.
https://bugs.webkit.org/show_bug.cgi?id=183573

Not reviewed.

* runtime/NativeFunction.h:
(JSC::TaggedNativeFunction::TaggedNativeFunction):

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

19 months agoAdd a WKWebViewContentProvider for system previews
dino@apple.com [Tue, 13 Mar 2018 04:11:06 +0000 (04:11 +0000)]
Add a WKWebViewContentProvider for system previews
https://bugs.webkit.org/show_bug.cgi?id=183582
<rdar://problem/38393569>

Reviewed by Tim Horton.

Source/WebCore/PAL:

Add some QuickLook SPI.

* pal/spi/ios/QuickLookSPI.h:

Source/WebKit:

Implement WKSystemPreviewView, which conforms to WKWebViewContentProvider, in
order to view content as a "system preview". This effectively replaces the
SystemPreviewController, which will be removed soon.

Some of the required methods of WKWebViewContentProvider are not necessary on
this instance, so a follow-up patch will clean the protocol up a bit.

* UIProcess/Cocoa/NavigationState.mm: Don't trigger a SystemPreview when downloading.
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):

* UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
(-[WKWebViewContentProviderRegistry init]): Register the WKSystemPreviewView for
MIME types retrieved from WebKitAdditions.

* UIProcess/ios/WKSystemPreviewView.h: Added.
* UIProcess/ios/WKSystemPreviewView.mm: Added.

(-[WKSystemPreviewView web_initWithFrame:webView:]):
(-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]): This is the
method that actually creates a QuickLook preview and provides the data.
(-[WKSystemPreviewView web_setMinimumSize:]):
(-[WKSystemPreviewView web_setOverlaidAccessoryViewsInset:]):
(-[WKSystemPreviewView web_computedContentInsetDidChange]):
(-[WKSystemPreviewView web_setFixedOverlayView:]):
(-[WKSystemPreviewView web_didSameDocumentNavigation:]):
(-[WKSystemPreviewView web_countStringMatches:options:maxCount:]):
(-[WKSystemPreviewView web_findString:options:maxCount:]):
(-[WKSystemPreviewView web_hideFindUI]):

(-[WKSystemPreviewView numberOfPreviewItemsInPreviewController:]): QuickLook delegates.
(-[WKSystemPreviewView previewController:previewItemAtIndex:]):
(-[WKSystemPreviewView provideDataForItem:]):
(-[WKSystemPreviewView previewControllerWillDismiss:]):

* WebKit.xcodeproj/project.pbxproj: Add new files.

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

19 months ago[CMake][Win] Forwarding headers of WTF and PAL are copied twice in Visual Studio...
don.olmstead@sony.com [Tue, 13 Mar 2018 03:19:21 +0000 (03:19 +0000)]
[CMake][Win] Forwarding headers of WTF and PAL are copied twice in Visual Studio builds
https://bugs.webkit.org/show_bug.cgi?id=183240

Reviewed by Alex Christensen.

Source/WebCore/PAL:

* pal/CMakeLists.txt:
* pal/PlatformAppleWin.cmake:
* pal/PlatformGTK.cmake:
* pal/PlatformMac.cmake:
* pal/PlatformWPE.cmake:
* pal/PlatformWinCairo.cmake:

Source/WTF:

* wtf/CMakeLists.txt:
* wtf/PlatformGTK.cmake:
* wtf/PlatformJSCOnly.cmake:
* wtf/PlatformMac.cmake:
* wtf/PlatformWPE.cmake:
* wtf/PlatformWin.cmake:

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

19 months agoUnreviewed, include time.h
utatane.tea@gmail.com [Tue, 13 Mar 2018 03:10:44 +0000 (03:10 +0000)]
Unreviewed, include time.h
https://bugs.webkit.org/show_bug.cgi?id=183312

Attempt to fix oss-fuzz build.

* wtf/CurrentTime.cpp:
* wtf/unix/CPUTimeUnix.cpp:

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

19 months agoUnreviewed, fix obsolete ASSERT
utatane.tea@gmail.com [Tue, 13 Mar 2018 03:04:25 +0000 (03:04 +0000)]
Unreviewed, fix obsolete ASSERT
https://bugs.webkit.org/show_bug.cgi?id=183310

Now NewObject can be conereted from CallObjectConstructor and CreateThis.

* dfg/DFGNode.h:
(JSC::DFG::Node::convertToNewObject):

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

19 months agoResource Load Statistics: Immediately forward cookie access at user interaction when...
wilander@apple.com [Tue, 13 Mar 2018 02:05:56 +0000 (02:05 +0000)]
Resource Load Statistics: Immediately forward cookie access at user interaction when there's an opener document
https://bugs.webkit.org/show_bug.cgi?id=183577
<rdar://problem/38266987>

Reviewed by Brent Fulgham.

Source/WebCore:

Tested manually on live websites.
No new automated tests because of a bug in WebKitTestRunner:
https://bugs.webkit.org/show_bug.cgi?id=183578
The event sender triggers gestures in the opener rather than
in the popup.

* dom/Document.cpp:
(WebCore::Document::removedLastRef):
    Clears the new m_primaryDomainsGrantedPageSpecificStorageAccess.
(WebCore::Document::hasGrantedPageSpecificStorageAccess):
(WebCore::Document::setHasGrantedPageSpecificStorageAccess):
* dom/Document.h:
    Added member m_primaryDomainsGrantedPageSpecificStorageAccess
    where we store domains that have been granted access.
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::setGrantStorageAccessUnderOpenerCallback):
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
    Now checks if there is a cross-origin opener and if so, immediately
    grants cookie access to the popup's domain if it is partitioned or
    blocked.
* loader/ResourceLoadObserver.h:
* platform/network/NetworkStorageSession.h:
    Added member m_pagesGrantedStorageAccess.
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::cookieStoragePartition const):
(WebCore::NetworkStorageSession::hasStorageAccess const):
    Renamed from hasStorageAccessForFrame since the frameID now is optional.
(WebCore::NetworkStorageSession::grantStorageAccess):
    Renamed from grantStorageAccessForFrame since the frameID now is optional.
(WebCore::NetworkStorageSession::removeStorageAccessForAllFramesOnPage):
    Now removes the pageID entry in m_pagesGrantedStorageAccess.
(WebCore::NetworkStorageSession::hasStorageAccessForFrame const): Deleted.
    Renamed since the frameID now is optional.
(WebCore::NetworkStorageSession::grantStorageAccessForFrame): Deleted.
    Renamed since the frameID now is optional.

Source/WebKit:

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::hasStorageAccessForFrame):
    Now also checks for general page access.
(WebKit::NetworkProcess::grantStorageAccess):
    Renamed from grantStorageAccessForFrame since the frameID now is optional.
(WebKit::NetworkProcess::grantStorageAccessForFrame): Deleted.
    Renamed since the frameID now is optional.
* NetworkProcess/NetworkProcess.h:
    Renaming since the frameID now is optional.
* NetworkProcess/NetworkProcess.messages.in:
    Renaming since the frameID now is optional.
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::logCookieInformation):
    Consequence of function renaming.
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::grantStorageAccess):
(WebKit::NetworkProcessProxy::grantStorageAccessForFrame): Deleted.
    Renaming since the frameID now is optional.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
    Renaming since the frameID now is optional.
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
    Handler renaming since the frameID now is optional.
(WebKit::WebResourceLoadStatisticsStore::grantStorageAccessUnderOpener):
    New function for that grants cookie access under a whole page.
* UIProcess/WebResourceLoadStatisticsStore.h:
    Member renaming since the frameID now is optional.
* UIProcess/WebResourceLoadStatisticsStore.messages.in:
    New message received straight from WebCore::ResourceLoadObserver.
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::grantStorageAccessHandler):
    Renamed and made frameID optional.
(WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
    Consequence of renaming and making frameID optional.
(WebKit::WebsiteDataStore::grantStorageAccessForFrameHandler): Deleted.
    Renamed and made frameID optional.
* UIProcess/WebsiteData/WebsiteDataStore.h:
* WebProcess/WebProcess.cpp:
(WebProcess::WebProcess):
    Now calls setGrantStorageAccessUnderOpenerCallback() on the shared
    WebCore::ResourceLoadObserver.

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

19 months agoStop using SDK conditionals to control feature definitions
timothy_horton@apple.com [Tue, 13 Mar 2018 01:38:34 +0000 (01:38 +0000)]
Stop using SDK conditionals to control feature definitions
https://bugs.webkit.org/show_bug.cgi?id=183430
<rdar://problem/38251619>

Reviewed by Dan Bernstein.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:
* Configurations/WebKitTargetConditionals.xcconfig: Renamed.

Source/ThirdParty/libwebrtc:

* Configurations/WebKitTargetConditionals.xcconfig: Renamed.
* Configurations/opus.xcconfig:

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:
* Configurations/WebKitTargetConditionals.xcconfig: Renamed.

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:
* Configurations/WebKitTargetConditionals.xcconfig: Renamed.

Source/WebKit:

* Configurations/FeatureDefines.xcconfig:
* Configurations/WebKitTargetConditionals.xcconfig: Renamed.

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:
* Configurations/WebKitTargetConditionals.xcconfig: Renamed.

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:
* TestWebKitAPI/Configurations/WebKitTargetConditionals.xcconfig: Renamed.

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

19 months agoReturn boolean from DOMTokenList's replace() method
cdumez@apple.com [Tue, 13 Mar 2018 01:37:23 +0000 (01:37 +0000)]
Return boolean from DOMTokenList's replace() method
https://bugs.webkit.org/show_bug.cgi?id=183567

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Rebaseline web platform test now that all checks are passing.

* web-platform-tests/dom/nodes/Element-classlist-expected.txt:

Source/WebCore:

Have DOMTokenList's replace() method return a boolean indicating if the
token was replaced, as per:
- https://dom.spec.whatwg.org/#dom-domtokenlist-replace

This is a recent addition to the DOM specification:
- https://github.com/whatwg/dom/pull/582

No new tests, rebaselined existing test.

* html/DOMTokenList.cpp:
(WebCore::replaceInOrderedSet):
(WebCore::DOMTokenList::replace):
* html/DOMTokenList.h:
* html/DOMTokenList.idl:

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

19 months ago[DRT] TestOptions should not be ObjC.
ross.kirsling@sony.com [Tue, 13 Mar 2018 01:29:46 +0000 (01:29 +0000)]
[DRT] TestOptions should not be ObjC.
https://bugs.webkit.org/show_bug.cgi?id=183487

Reviewed by Per Arne Vollan.

* DumpRenderTree/CMakeLists.txt:
* DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
* DumpRenderTree/PlatformMac.cmake:
Move TestOptions to platform-agnostic sources.

* DumpRenderTree/TestOptions.h:
* DumpRenderTree/TestOptions.cpp: Renamed from Tools/DumpRenderTree/TestOptions.mm.
* DumpRenderTree/mac/DumpRenderTree.mm:
Remove NSURL dependency and align with WTR as much as possible.

* DumpRenderTree/win/DumpRenderTree.cpp:
Consume TestOptions (recognizing just the ones that have WebPreferences defined for now).

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

19 months agoIgnore some deprecation warnings encountered when compiling with newer versions of ICU
bburg@apple.com [Mon, 12 Mar 2018 23:46:06 +0000 (23:46 +0000)]
Ignore some deprecation warnings encountered when compiling with newer versions of ICU
https://bugs.webkit.org/show_bug.cgi?id=183584
<rdar://problem/38395317>

Reviewed by Daniel Bates.

Ignore new deprecation warnings. Where a function has more than one
deprecation warning, mark out the entire function so it remains readable.

* editing/TextIterator.cpp:
* platform/graphics/SurrogatePairAwareTextIterator.cpp:
(WebCore::SurrogatePairAwareTextIterator::normalizeVoicingMarks):
* platform/text/TextEncoding.cpp:

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

19 months agoRuntime flag for link prefetch and remove link subresource.
yoav@yoav.ws [Mon, 12 Mar 2018 23:28:45 +0000 (23:28 +0000)]
Runtime flag for link prefetch and remove link subresource.
https://bugs.webkit.org/show_bug.cgi?id=183540

Reviewed by Chris Dumez.

.:

Remove the LINK_PREFETCH build time flag.

* Source/cmake/OptionsWin.cmake:
* Source/cmake/WebKitFeatures.cmake:
* Source/cmake/tools/vsprops/FeatureDefines.props:
* Source/cmake/tools/vsprops/FeatureDefinesCairo.props:

Source/JavaScriptCore:

Remove the LINK_PREFETCH build time flag.

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

This patch removes the LINK_PREFETCH build time flag, removes
link subresource, adds an off-by-default runtime flag for link
prefetch and makes sure link prefetch only works when this flag is on.

Subresource is removed as it's not a part of any spec, nor supported by any
other browser. It was replaced by link preload.

No new tests as this is not adding any new functionality.

* Configurations/FeatureDefines.xcconfig: Remove the LINK_PREFETCH flag.
* html/LinkRelAttribute.cpp:
(WebCore::LinkRelAttribute::LinkRelAttribute): Put prefetch support behind the runtime flag.
(WebCore::LinkRelAttribute::isSupported): Add prefetch.
* html/LinkRelAttribute.h: Remove the LINK_PREFETCH flag.
* loader/LinkLoader.cpp:
(WebCore::createLinkPreloadResourceClient): Remove the LINK_PREFETCH flag.
(WebCore::LinkLoader::prefetchIfNeeded): Move the prefetch code to `prefetchIfNeeded()`. Remove subresource bits.
(WebCore::LinkLoader::loadLink): Call `prefetchIfNeeded()`.
* loader/LinkLoader.h:
* loader/ResourceLoadInfo.cpp:
(WebCore::toResourceType): Remove the LINK_PREFETCH flag as well as subresource.
* loader/SubresourceLoader.cpp:
(WebCore::logResourceLoaded): Remove the LINK_PREFETCH flag as well as subresource.
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::defaultPriorityForResourceType): Remove the LINK_PREFETCH flag as well as subresource.
(WebCore::CachedResource::load): Remove the LINK_PREFETCH flag.
* loader/cache/CachedResource.h:
(WebCore::CachedResource::ignoreForRequestCount const): Remove the LINK_PREFETCH flag as well as subresource.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::createResource): Remove the LINK_PREFETCH flag as well as subresource.
(WebCore::CachedResourceLoader::requestLinkResource): Remove subresource.
(WebCore::contentTypeFromResourceType): Remove the LINK_PREFETCH flag as well as subresource.
(WebCore::CachedResourceLoader::checkInsecureContent const): Remove the LINK_PREFETCH flag as well as subresource.
(WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest): Remove the LINK_PREFETCH flag as well as subresource.
* loader/cache/CachedResourceLoader.h:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setLinkPrefetchEnabled): Set the prefetch flag.
(WebCore::RuntimeEnabledFeatures::linkPrefetchEnabled const): Get the prefetch flag.

Source/WebCore/PAL:

Remove the LINK_PREFETCH build time flag.

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

Remove the LINK_PREFETCH build time flag.

* Configurations/FeatureDefines.xcconfig:
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::maximumBufferingTime):

Source/WebKitLegacy/mac:

Remove the LINK_PREFETCH build time flag.

* Configurations/FeatureDefines.xcconfig:

Source/WTF:

Remove the LINK_PREFETCH build time flag.

* wtf/FeatureDefines.h:

Tools:

Remove the LINK_PREFETCH build time flag.

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

19 months agoVersioning.
jmarcell@apple.com [Mon, 12 Mar 2018 23:21:32 +0000 (23:21 +0000)]
Versioning.

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

19 months agoLoad may get committed before receiving policy for the resource response
cdumez@apple.com [Mon, 12 Mar 2018 23:06:51 +0000 (23:06 +0000)]
Load may get committed before receiving policy for the resource response
https://bugs.webkit.org/show_bug.cgi?id=183579
<rdar://problem/38268780>

Reviewed by Youenn Fablet.

Source/WebKit:

r228852 updated WebResourceLoader::didReceiveResponse to only send the
ContinueDidReceiveResponse IPC back to the Networkprocess *after* the
policy decision for the resource response has been made. This is necessary
now that policy decisions can be made asynchronously.

However, one of the 2 code paths in NetworkProcess side (code path when
the resource is already in the HTTP disk cache) failed to wait for the
ContinueDidReceiveResponse IPC before sending over the data to the WebProcess.
As a result, the WebProcess could commit the load before even receiving the
policy response from the client.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::continueDidReceiveResponse):
(WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
(WebKit::NetworkResourceLoader::continueProcessingCachedEntryAfterDidReceiveResponse):
* NetworkProcess/NetworkResourceLoader.h:
Make sure NetworkResourceLoader::didRetrieveCacheEntry() does not start sending the data
until the network process gets the ContinueDidReceiveResponse IPC back from the WebProcess.

* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::didReceiveResponse):
(WebKit::WebResourceLoader::didReceiveData):
* WebProcess/Network/WebResourceLoader.h:
Add assertion to make sure didReceiveData() never gets called before didReceiveResponse's
completion handler has been called. If this hits, then the load may get committed even
though the client did not reply to the policy for the resource response yet.

LayoutTests:

Add layout test coverage.

* http/tests/cache/cachedEntry-waits-for-response-policy-expected.txt: Added.
* http/tests/cache/cachedEntry-waits-for-response-policy.html: Added.

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

19 months agoUnreviewed, rebaseline two cssom tests after r229544.
ryanhaddad@apple.com [Mon, 12 Mar 2018 23:01:26 +0000 (23:01 +0000)]
Unreviewed, rebaseline two cssom tests after r229544.

* web-platform-tests/cssom-view/interfaces-expected.txt:
* web-platform-tests/cssom/interfaces-expected.txt:

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