WebKit-https.git
8 months agoUpdate hover state in composed tree
antti@apple.com [Tue, 20 Nov 2018 16:17:44 +0000 (16:17 +0000)]
Update hover state in composed tree
https://bugs.webkit.org/show_bug.cgi?id=191860

Reviewed by Zalan Bujtas.

The code was already mostly switched over from render tree to composed tree.
This patch replaces the remaining common ancestor search code with a DOM based equivalent.

* dom/Document.cpp:
(WebCore::findNearestCommonComposedAncestor):
(WebCore::Document::updateHoverActiveState):
(WebCore::nearestCommonHoverAncestor): Deleted.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::hoverAncestor const): Deleted.
* rendering/RenderBlock.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::hoverAncestor const): Deleted.

No longer needed.

* rendering/RenderElement.h:

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

8 months ago[LFC][IFC] Measure run with non-breakable start/end.
zalan@apple.com [Tue, 20 Nov 2018 15:56:57 +0000 (15:56 +0000)]
[LFC][IFC] Measure run with non-breakable start/end.
https://bugs.webkit.org/show_bug.cgi?id=191850

Reviewed by Antti Koivisto.

Line breaking needs to know the complete width of the run including padding etc.

* layout/Verification.cpp:
(WebCore::Layout::collectFlowBoxSubtree):
(WebCore::Layout::collectInlineBoxes):
(WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
* layout/inlineformatting/InlineFormattingContext.h:
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::runWidth):
* layout/inlineformatting/InlineLineBreaker.cpp:
(WebCore::Layout::InlineLineBreaker::InlineLineBreaker):
(WebCore::Layout::InlineLineBreaker::runWidth const):
(WebCore::Layout::InlineLineBreaker::textWidth const):
* layout/inlineformatting/InlineLineBreaker.h:
* layout/inlineformatting/text/TextUtil.cpp:
(WebCore::Layout::TextUtil::hyphenPositionBefore):
(WebCore::Layout::TextUtil::width):
(WebCore::Layout::TextUtil::fixedPitchWidth):
(WebCore::Layout::TextUtil::TextUtil): Deleted.
(WebCore::Layout::TextUtil::width const): Deleted.
(WebCore::Layout::TextUtil::hyphenPositionBefore const): Deleted.
(WebCore::Layout::TextUtil::textWidth const): Deleted.
(WebCore::Layout::TextUtil::fixedPitchWidth const): Deleted.
* layout/inlineformatting/text/TextUtil.h:

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

8 months ago[LFC][IFC] InlineFormattingContext::Line should hold the list of runs for the current...
zalan@apple.com [Tue, 20 Nov 2018 15:53:53 +0000 (15:53 +0000)]
[LFC][IFC] InlineFormattingContext::Line should hold the list of runs for the current line.
https://bugs.webkit.org/show_bug.cgi?id=191845

Reviewed by Antti Koivisto.

Collect the runs in InlineFormattingContext::Line and transfer them to InlineFormattingState during line closing.
(In the most common cases, this is only one extra vector::append() call.)

* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
(WebCore::Layout::InlineFormattingContext::createFinalRuns const):
(WebCore::Layout::InlineFormattingContext::postProcessInlineRuns const):
(WebCore::Layout::InlineFormattingContext::closeLine const):
(WebCore::Layout::InlineFormattingContext::appendContentToLine const):
(WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
(WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const):
(WebCore::Layout::InlineFormattingContext::splitInlineRunsIfNeeded const): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:
(WebCore::Layout::InlineFormattingContext::Line::hasContent const):
(WebCore::Layout::InlineFormattingContext::Line::runs):
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns):
(WebCore::Layout::InlineFormattingContext::Geometry::computeExpansionOpportunities):
(WebCore::Layout::InlineFormattingContext::Geometry::alignRuns):
* layout/inlineformatting/Line.cpp:
(WebCore::Layout::InlineFormattingContext::Line::init):
(WebCore::Layout::InlineFormattingContext::Line::adjustLogicalLeft):
(WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight const):
(WebCore::Layout::InlineFormattingContext::Line::appendContent):
(WebCore::Layout::InlineFormattingContext::Line::close):
(WebCore::Layout::InlineFormattingContext::Line::Line): Deleted.

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

8 months ago[LFC][IFC] Introduce InlineItem::nonBreakableStart/End
zalan@apple.com [Tue, 20 Nov 2018 15:52:28 +0000 (15:52 +0000)]
[LFC][IFC] Introduce InlineItem::nonBreakableStart/End
https://bugs.webkit.org/show_bug.cgi?id=191839

Reviewed by Antti Koivisto.

Non-breakable start/end marks margin/padding/border space (even when it does not directly come from the associated layout box)

<span style="padding: 5px"><span>nested content with padding parent</span</span>
<nested content with padding parent> <- inline run has 5px non-breakable start/end.

<span style="border: 5px solid green"><span style="padding-right: 10px; margin-right: 1px">1</span>2</span><span>    3</span>
<1> <- inline run has 5px non-breakable start and 11px non-breakable end.
<2> <- inline run has 0px non-breakable start and 5px non-breakable end.
<3> <- no non-breakable values.

This is what the runs look like (input to line breaking)
<     1           2     >
< > (whitespace)
<3>
The line breaking treats the paddding/border etc space as part of the run and as non-breaking opportunity.
With the given runs the first position where we can break the line is at the whitespace.

* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
* layout/inlineformatting/InlineItem.h:
(WebCore::Layout::InlineItem::nonBreakableStart const):
(WebCore::Layout::InlineItem::nonBreakableEnd const):
(WebCore::Layout::InlineItem::addNonBreakableStart):
(WebCore::Layout::InlineItem::addNonBreakableEnd):

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

8 months ago[LFC][IFC] Move detaching rules from InlineFormattingState to InlineItem
zalan@apple.com [Tue, 20 Nov 2018 15:51:00 +0000 (15:51 +0000)]
[LFC][IFC] Move detaching rules from InlineFormattingState to InlineItem
https://bugs.webkit.org/show_bug.cgi?id=191838

Reviewed by Antti Koivisto.

This is in preparation for adding more context to InlineItem. In addition to
detaching rules it will also hold non-breakable start/end information.

* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
(WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
* layout/inlineformatting/InlineFormattingState.cpp:
(WebCore::Layout::InlineFormattingState::addDetachingRule): Deleted.
(WebCore::Layout::InlineFormattingState::detachingRules const): Deleted.
* layout/inlineformatting/InlineFormattingState.h:
(WebCore::Layout::InlineFormattingState::setDetachingRules): Deleted.
* layout/inlineformatting/InlineItem.h:
(WebCore::Layout::InlineItem::addDetachingRule):
(WebCore::Layout::InlineItem::detachingRules const):

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

8 months ago[LFC][IFC] InlineRunProvider::append() should just take const InlineItem&.
zalan@apple.com [Tue, 20 Nov 2018 15:48:14 +0000 (15:48 +0000)]
[LFC][IFC] InlineRunProvider::append() should just take const InlineItem&.
https://bugs.webkit.org/show_bug.cgi?id=191837

Reviewed by Antti Koivisto.

This allows us to remove the InlineFormattingState dependency as well.

* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
(WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
* layout/inlineformatting/InlineRunProvider.cpp:
(WebCore::Layout::InlineRunProvider::InlineRunProvider):
(WebCore::Layout::InlineRunProvider::append):
* layout/inlineformatting/InlineRunProvider.h:

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

8 months agoWebPasteboard should USE(LIBWPE)
don.olmstead@sony.com [Tue, 20 Nov 2018 15:35:12 +0000 (15:35 +0000)]
WebPasteboard should USE(LIBWPE)
https://bugs.webkit.org/show_bug.cgi?id=191846

Reviewed by Michael Catanzaro.

Add USE(LIBWPE) for Pasteboard related functionality within WebKit.

* UIProcess/WebPasteboardProxy.h:
* UIProcess/WebPasteboardProxy.messages.in:
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
* WebProcess/WebCoreSupport/WebPlatformStrategies.h:

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

8 months ago[WPE] Fix some feature guards in WebKit
don.olmstead@sony.com [Tue, 20 Nov 2018 15:32:32 +0000 (15:32 +0000)]
[WPE] Fix some feature guards in WebKit
https://bugs.webkit.org/show_bug.cgi?id=191847

Reviewed by Michael Catanzaro.

Some feature guards are not present in these files.

* UIProcess/API/wpe/PageClientImpl.cpp:
* UIProcess/API/wpe/PageClientImpl.h:
* UIProcess/wpe/WebProcessPoolWPE.cpp:
(WebKit::WebProcessPool::platformInitializeWebProcess):

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

8 months ago[GStreamer] Enhance debugging by making sure to print the pipeline in MediaPlayerPriv...
commit-queue@webkit.org [Tue, 20 Nov 2018 15:30:22 +0000 (15:30 +0000)]
[GStreamer] Enhance debugging by making sure to print the pipeline in MediaPlayerPrivateGStreamer
https://bugs.webkit.org/show_bug.cgi?id=191586

Patch by Thibault Saunier <tsaunier@igalia.com> on 2018-11-20
Reviewed by Xabier Rodriguez-Calvar.

This is minor changes that do not require tests.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::setAudioStreamProperties):
(WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
(WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL):
(WebCore::MediaPlayerPrivateGStreamer::loadFull):
(WebCore::MediaPlayerPrivateGStreamer::commitLoad):
(WebCore::MediaPlayerPrivateGStreamer::readyTimerFired):
(WebCore::MediaPlayerPrivateGStreamer::changePipelineState):
(WebCore::MediaPlayerPrivateGStreamer::prepareToPlay):
(WebCore::MediaPlayerPrivateGStreamer::play):
(WebCore::MediaPlayerPrivateGStreamer::pause):
(WebCore::MediaPlayerPrivateGStreamer::durationMediaTime const):
(WebCore::MediaPlayerPrivateGStreamer::seek):
(WebCore::MediaPlayerPrivateGStreamer::updatePlaybackRate):
(WebCore::MediaPlayerPrivateGStreamer::paused const):
(WebCore::MediaPlayerPrivateGStreamer::enableTrack):
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText):
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
(WebCore::MediaPlayerPrivateGStreamer::processBufferingStats):
(WebCore::MediaPlayerPrivateGStreamer::fillTimerFired):
(WebCore::MediaPlayerPrivateGStreamer::maxMediaTimeSeekable const):
(WebCore::MediaPlayerPrivateGStreamer::totalBytes const):
(WebCore::MediaPlayerPrivateGStreamer::uriDecodeBinElementAddedCallback):
(WebCore::MediaPlayerPrivateGStreamer::downloadBufferFileCreatedCallback):
(WebCore::MediaPlayerPrivateGStreamer::sourceSetup):
(WebCore::MediaPlayerPrivateGStreamer::asyncStateChangeDone):
(WebCore::MediaPlayerPrivateGStreamer::updateStates):
(WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
(WebCore::MediaPlayerPrivateGStreamer::didEnd):
(WebCore::MediaPlayerPrivateGStreamer::setDownloadBuffering):
(WebCore::MediaPlayerPrivateGStreamer::setPreload):
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):

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

9 months ago[css-grid] Consider scrollbars in populateGridPositionsForDirection()
rego@igalia.com [Tue, 20 Nov 2018 11:58:30 +0000 (11:58 +0000)]
[css-grid] Consider scrollbars in populateGridPositionsForDirection()
https://bugs.webkit.org/show_bug.cgi?id=191656

Reviewed by Javier Fernandez.

LayoutTests/imported/w3c:

Imported tests from WPT.

* web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-001-expected.html: Added.
* web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-001.html: Added.
* web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-lr-001-expected.html: Added.
* web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-lr-001.html: Added.
* web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-rl-001-expected.html: Added.
* web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-rl-001.html: Added.
* web-platform-tests/css/css-grid/grid-model/w3c-import.log:

Source/WebCore:

We never care about scrollbars in RenderGrid::populateGridPositionsForDirection(),
that's fine if the scrollbars are at the end (e.g. on the right in horizontal writing mode and LTR direction)
but it causes problems when they're at the beginning (e.g. on the left in horizontal writing mode and RTL direction).

The patch modifies the method so it takes into account scrollbar size
in order to compute the position of the columns/rows depending on the direction and the writing mode.

Tests: imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-001.html
       imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-lr-001.html
       imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-rl-001.html

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::populateGridPositionsForDirection):

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

9 months agoAvoid potential longer than expected layer flush delays
antti@apple.com [Tue, 20 Nov 2018 09:02:25 +0000 (09:02 +0000)]
Avoid potential longer than expected layer flush delays
https://bugs.webkit.org/show_bug.cgi?id=191833

Reviewed by Dean Jackson.

Layer flush throttling also stops style recalcs and layouts. Layouts schedule layer flushes. Especially
on a slow network we can in principle end up in situation where layer flush timer fires but there is no
flush scheduled and so nothing happens. However there is a pending style recalc or layout that would
actually schedule a flush (in practice various things force style recalcs and this doesn't occur
commonly).

To avoid this we should flush unconditionally when the flush timer fires. This performs any pending
style recalc and layout too. If there is nothing to do the flush will be cheap.

PLT doesn't appear to hit cases affected by this patch and there shouldn't be any impact.

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:

Remove now unnecessary m_hasPendingFlush bit, simplifying the logic.

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::setLayerTreeStateIsFrozen):

Schedule unconditionally when unfreezing.

(WebKit::TiledCoreAnimationDrawingArea::scheduleCompositingLayerFlush):

Remove branch that starts the flush timer. It is not needed as either it was already running
or immediate flush is already scheduled and will start the timer anyway.

(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::adjustLayerFlushThrottling):
(WebKit::TiledCoreAnimationDrawingArea::layerFlushThrottlingTimerFired):

Flush unconditionally.

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

9 months agoClick on node assigned to slot in button's shadow cause loss of button focus
rniwa@webkit.org [Tue, 20 Nov 2018 08:53:57 +0000 (08:53 +0000)]
Click on node assigned to slot in button's shadow cause loss of button focus
https://bugs.webkit.org/show_bug.cgi?id=191694
<rdar://problem/46107920>

Reviewed by Wenson Hsieh.

Source/WebCore:

Fixed the bug by traversing the parent in the composed tree when looking for an element to focus.

Test: fast/shadow-dom/focus-slot-parent.html

* page/EventHandler.cpp:
(WebCore::EventHandler::dispatchMouseEvent): Fixed the bug. Also use RefPtr instead of a raw pointer.

LayoutTests:

Added a regression test.

* fast/shadow-dom/focus-slot-parent-expected.txt: Added.
* fast/shadow-dom/focus-slot-parent.html: Added.

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

9 months agoREGRESSION(r238039) WebCore::JSDOMGlobalObject::createStructure is using JSC::Structu...
Hironori.Fujii@sony.com [Tue, 20 Nov 2018 08:15:41 +0000 (08:15 +0000)]
REGRESSION(r238039) WebCore::JSDOMGlobalObject::createStructure is using JSC::Structure::create without including StructureInlines.h
https://bugs.webkit.org/show_bug.cgi?id=191626
<rdar://problem/46161064>

Unreviewed adding comment for my change r238366.

* runtime/Structure.h: Added a comment for Structure::create.

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

9 months agoglobalFuncImportModule() should return a promise when it clears exceptions.
mark.lam@apple.com [Tue, 20 Nov 2018 07:09:53 +0000 (07:09 +0000)]
globalFuncImportModule() should return a promise when it clears exceptions.
https://bugs.webkit.org/show_bug.cgi?id=191792
<rdar://problem/46090763>

Reviewed by Michael Saboff.

JSTests:

* stress/global-import-function-should-return-a-promise-when-clearing-exceptions.js: Added.

Source/JavaScriptCore:

If we're clearing the exceptions in a CatchScope, then it means that we've handled
the exception, and is able to proceed in a normal manner.  Hence, we should not
return the empty JSValue in this case: instead, we should return a Promise as
expected by import's API.

The only time when we can't return a promise is when we fail to create a Promise.
In that case, we should be propagating the exception.

Hence, globalFuncImportModule() contains a ThrowScope (for propagating the
exception that arises from failure to create the Promise) wrapping a CatchScope
(for catching any exception that arises from failure to execute the import).

Also fixed similar issues, and some exception check issues in JSModuleLoader and
the jsc shell.

* jsc.cpp:
(GlobalObject::moduleLoaderImportModule):
(GlobalObject::moduleLoaderFetch):
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::globalFuncImportModule):
* runtime/JSModuleLoader.cpp:
(JSC::JSModuleLoader::loadAndEvaluateModule):
(JSC::JSModuleLoader::loadModule):
(JSC::JSModuleLoader::requestImportModule):
(JSC::JSModuleLoader::importModule):
(JSC::JSModuleLoader::resolve):
(JSC::JSModuleLoader::fetch):
(JSC::moduleLoaderParseModule):
(JSC::moduleLoaderResolveSync):

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

9 months agoREGRESSION(r238350) [curl] CertificateInfo.h: error: template specialization requires...
Hironori.Fujii@sony.com [Tue, 20 Nov 2018 06:46:52 +0000 (06:46 +0000)]
REGRESSION(r238350) [curl] CertificateInfo.h: error: template specialization requires 'template<>'
https://bugs.webkit.org/show_bug.cgi?id=191849

Unreviewed build fix for clang-cl builds.

No new tests because there's no behaviour change.

* platform/network/curl/CertificateInfo.h:
(WTF::Persistence::Coder<WebCore::CertificateInfo>::encode):
(WTF::Persistence::Coder<WebCore::CertificateInfo>::decode):

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

9 months agoSimplify platform check in WebEditorClient
don.olmstead@sony.com [Tue, 20 Nov 2018 03:04:35 +0000 (03:04 +0000)]
Simplify platform check in WebEditorClient
https://bugs.webkit.org/show_bug.cgi?id=191848

Reviewed by Fujii Hironori.

!PLATFORM(GTK) && !PLATFORM(COCOA) && !PLATFORM(WPE) can be better
represented as PLATFORM(WIN).

* WebProcess/WebCoreSupport/WebEditorClient.cpp:

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

9 months agoAdd SPI to disable JIT in a WKWebView
achristensen@apple.com [Tue, 20 Nov 2018 02:16:31 +0000 (02:16 +0000)]
Add SPI to disable JIT in a WKWebView
https://bugs.webkit.org/show_bug.cgi?id=191822
<rdar://problem/28119360>

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

* jit/ExecutableAllocator.cpp:
(JSC::jitDisabled):
(JSC::allowJIT):
(JSC::ExecutableAllocator::setJITEnabled):
* jit/ExecutableAllocator.h:
(JSC::ExecutableAllocator::setJITEnabled):

Source/WebKit:

* Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
(WebKit::XPCServiceInitializer):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _canUseJIT:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration enableJIT]):
(-[_WKProcessPoolConfiguration setEnableJIT:]):
* UIProcess/Launcher/ProcessLauncher.h:
(WebKit::ProcessLauncher::Client::enableJIT const):
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::canUseJIT):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::enableJIT const):
* UIProcess/WebProcessProxy.h:
(WebKit::WebProcessProxy::processPool const):
(WebKit::WebProcessProxy::processPool): Deleted.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::canUseJIT):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/DisableJIT.mm: Added.
(TEST):

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

9 months ago[Curl] Add API for CertificateInfo.
basuke.suzuki@sony.com [Tue, 20 Nov 2018 02:02:36 +0000 (02:02 +0000)]
[Curl] Add API for CertificateInfo.
https://bugs.webkit.org/show_bug.cgi?id=191647

Reviewed by Alex Christensen.

Source/WebCore:

Minor changes for WebKit API.

Tests: TestWebKitAPI/Tests/WebKit/curl/Certificates.cpp

* platform/network/curl/CertificateInfo.h:
* platform/network/curl/CertificateInfoCurl.cpp:
(WebCore::CertificateInfo::CertificateInfo):
(WebCore::CertificateInfo::makeCertificate):
* platform/network/curl/CurlSSLVerifier.cpp:
(WebCore::BIOHolder::asCertificate):

Source/WebKit:

Added API for CertificateInfo to create, fetch contents.

Tests: TestWebKitAPI/Tests/WebKit/curl/Certificates.cpp

* PlatformWin.cmake:
* Shared/API/c/curl/WKCertificateInfoCurl.cpp: Added.
(WKCertificateInfoCreateWithCertficateChain):
(WKCertificateInfoGetVerificationError):
(WKCertificateInfoGetCertificateChainSize):
(WKCertificateInfoCopyCertificateAtIndex):
* Shared/API/c/curl/WKCertificateInfoCurl.h: Copied from Source/WebCore/platform/network/curl/CertificateInfoCurl.cpp.
* Shared/curl/WebCoreArgumentCodersCurl.cpp:
(IPC::ArgumentCoder<CertificateInfo>::encode):
(IPC::ArgumentCoder<CertificateInfo>::decode):

Tools:

Added test for new WKCertificateInfo API.

* TestWebKitAPI/PlatformWin.cmake:
* TestWebKitAPI/Tests/WebKit/curl/Certificates.cpp: Added.
(TestWebKitAPI::Curl::makeCertificateInfo):
(TestWebKitAPI::Curl::isSamePEM):
(TestWebKitAPI::Curl::TEST):

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

9 months ago[MSVC] X86Assembler.h(108): error C2666: 'WebCore::operator -': 7 overloads have...
Hironori.Fujii@sony.com [Tue, 20 Nov 2018 01:37:44 +0000 (01:37 +0000)]
[MSVC] X86Assembler.h(108): error C2666: 'WebCore::operator -': 7 overloads have similar conversions
https://bugs.webkit.org/show_bug.cgi?id=189467
<rdar://problem/44290945>

Reviewed by Mark Lam.

This issue has happened several times. And, it seems that it will
take more time for Microsoft to fix the MSVC bug. We need a
effective workaround not to repeat this issue until they fix MSVC.

Remove ": int8_t" of RegisterID only for COMPILER(MSVC).

* assembler/X86Assembler.h: Added JSC_X86_ASM_REGISTER_ID_ENUM_BASE_TYPE macro.

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

9 months agoWeb Inspector: Audit: removing and re-adding the tab will duplicate tests
drousso@apple.com [Tue, 20 Nov 2018 01:15:15 +0000 (01:15 +0000)]
Web Inspector: Audit: removing and re-adding the tab will duplicate tests
https://bugs.webkit.org/show_bug.cgi?id=191843

Reviewed by Matt Baker.

* UserInterface/Controllers/AuditManager.js:
(WI.AuditManager.prototype.loadStoredTests):
If we already have tests, don't attempt to load any stored tests.

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

9 months agoAdd USE(LIBWPE) for WebKit events
don.olmstead@sony.com [Tue, 20 Nov 2018 01:11:01 +0000 (01:11 +0000)]
Add USE(LIBWPE) for WebKit events
https://bugs.webkit.org/show_bug.cgi?id=191842

Reviewed by Michael Catanzaro.

Moves all WPE events to USE(LIBWPE) instead of PLATFORM(WPE). Updates
filenames to LibWPE.

* PlatformWPE.cmake:
* Shared/NativeWebKeyboardEvent.h:
* Shared/NativeWebMouseEvent.h:
* Shared/NativeWebTouchEvent.h:
* Shared/NativeWebWheelEvent.h:
* Shared/WebCoreArgumentCoders.cpp:
* Shared/WebCoreArgumentCoders.h:
* Shared/WebEvent.h:
* Shared/WebKeyboardEvent.cpp:
(WebKit::WebKeyboardEvent::WebKeyboardEvent):
* Shared/libwpe/NativeWebKeyboardEventLibWPE.cpp: Renamed from Source/WebKit/Shared/wpe/NativeWebKeyboardEventWPE.cpp.
* Shared/libwpe/NativeWebMouseEventLibWPE.cpp: Renamed from Source/WebKit/Shared/wpe/NativeWebMouseEventWPE.cpp.
* Shared/libwpe/NativeWebTouchEventLibWPE.cpp: Renamed from Source/WebKit/Shared/wpe/NativeWebTouchEventWPE.cpp.
* Shared/libwpe/NativeWebWheelEventLibWPE.cpp: Renamed from Source/WebKit/Shared/wpe/NativeWebWheelEventWPE.cpp.
* Shared/libwpe/WebEventFactory.cpp: Renamed from Source/WebKit/Shared/wpe/WebEventFactory.cpp.
* Shared/libwpe/WebEventFactory.h: Renamed from Source/WebKit/Shared/wpe/WebEventFactory.h.
* SourcesWPE.txt:

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

9 months agoUnreviewed, fix the internal iOS debug build after r238380
wenson_hsieh@apple.com [Tue, 20 Nov 2018 00:26:10 +0000 (00:26 +0000)]
Unreviewed, fix the internal iOS debug build after r238380

UICalloutBar should only be declared when the public (non-internal) SDK is used to build WebKit; otherwise, we
end up with duplicate declarations of UICalloutBar.

* TestWebKitAPI/ios/UIKitSPI.h:

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

9 months ago[WebGPU] Begin implementing WebGPUTexture, WebGPUTextureView, and WebGPUTextureFormat...
dino@apple.com [Mon, 19 Nov 2018 23:33:53 +0000 (23:33 +0000)]
[WebGPU] Begin implementing WebGPUTexture, WebGPUTextureView, and WebGPUTextureFormatEnum, and WebGPUSwapChain::configure upgrades
https://bugs.webkit.org/show_bug.cgi?id=191794

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

Source/WebCore:

Test: webgpu/textures-textureviews.html

Implement basic functionality for getting the next WebGPUTexture and TextureView from the WebGPURenderingContext
to use as a render destination for the next draw call. Also introduce WebGPUTextureFormatEnum and the ability to
configure the context with a chosen texture format.

* CMakeLists.txt:
* DerivedSources.make:
* Modules/webgpu/GPUSwapChain.h: Texture/Pixel format can now be set.
* Modules/webgpu/GPUTexture.h: Added. Interface to a MTLTexture.
* Modules/webgpu/GPUTextureFormatEnum.h: Added.
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createRenderPipeline const): Removed now-unnecessary enum class cast.
* Modules/webgpu/WebGPURenderPipelineDescriptor.h: Rather than duplicate GPURenderPipelineDescriptor::PrimitiveTopology, alias to it.
* Modules/webgpu/WebGPUSwapChain.cpp:
(WebCore::WebGPUSwapChain::configure): Can now specify a specific texture format for the underlying CAMetalLayer.
(WebCore::WebGPUSwapChain::getNextTexture): Added. Request the next drawable texture.
* Modules/webgpu/WebGPUSwapChain.h: Expose getNextTexture().
* Modules/webgpu/WebGPUSwapChain.idl:
* Modules/webgpu/WebGPUTexture.cpp: Added.
(WebCore::WebGPUTexture::create):
(WebCore::WebGPUTexture::WebGPUTexture):
(WebCore::WebGPUTexture::createDefaultTextureView):
* Modules/webgpu/WebGPUTexture.h: Added.
* Modules/webgpu/WebGPUTexture.idl: Added.
* Modules/webgpu/WebGPUTextureFormatEnum.h: Added. Type alias for GPUTextureFormatEnum.
* Modules/webgpu/WebGPUTextureFormatEnum.idl: Added. Used to represent any texture format used by WebGPU.
* Modules/webgpu/WebGPUTextureView.cpp: Added.
(WebCore::WebGPUTextureView::create):
(WebCore::WebGPUTextureView::WebGPUTextureView):
* Modules/webgpu/WebGPUTextureView.h: Added.
* Modules/webgpu/WebGPUTextureView.idl: Added.
* Modules/webgpu/cocoa/GPUSwapChainMetal.mm:
(WebCore::GPUSwapChain::create):
(WebCore::GPUSwapChain::setFormat): Called by WebGPUSwapChain::configure().
(WebCore::GPUSwapChain::getNextTexture):
* Modules/webgpu/cocoa/GPUTextureFormatEnumMetal.mm: Added.
(WebCore::convertAndValidate): Convert the WebGPUTextureFormatEnum to a MTLPixelFormat.
* Modules/webgpu/cocoa/GPUTextureMetal.mm: Added.
(WebCore::GPUTexture::create):
(WebCore::GPUTexture::GPUTexture):
(WebCore::GPUTexture::createDefaultTextureView): Uses the pixelFormat of the original texture.
* Sources.txt:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:

LayoutTests:

Did some refactoring to better share code among tests, and added basic functionality test for
WebGPUTextures and WebGPUTextureView, to be fleshed out when their descriptor objects are implemented.

* webgpu/command-buffers.html: Refactored to use basic-webgpu-functions.js.
* webgpu/js/basic-webgpu-functions.js: Added.
(vertex.Vertex.vertex_main): The basic MSL code has been moved into this file.
(fragment.float4.fragment_main):
(runWebGPUTests): Creates a WebGPURenderingContext on a default canvas and runs its provided functions.
(async.runWebGPUTestsOnCanvas):
(async.setUpContexts): Tests proper creation of a basic WebGPURenderingContext.
(setUpModule): Creates a basic WebGPUShaderModule.
(setUpPipelineDescriptor): Creates a basic WebGPURenderPipelineDescriptor.
(setUpPipeline): Creates a basic WebGPURenderPipeline.
(render):
* webgpu/js/set-up-webgpu-contexts.js: Moved into basic-webgpu-functions.js.
* webgpu/render-pipelines-expected.txt:
* webgpu/render-pipelines.html: Refactored to use basic-webgpu-functions.js.
* webgpu/shader-modules.html: Refactored to use basic-webgpu-functions.js.
* webgpu/textures-textureviews-expected.txt: Added.
* webgpu/textures-textureviews.html: Added.
* webgpu/webgpu-basics.html: Refactored to use basic-webgpu-functions.js.

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

9 months agoEXC_BAD_ACCESS when invoking a DownloadProxy's destination decision handler after...
david_quesada@apple.com [Mon, 19 Nov 2018 22:52:42 +0000 (22:52 +0000)]
EXC_BAD_ACCESS when invoking a DownloadProxy's destination decision handler after the download has been canceled
https://bugs.webkit.org/show_bug.cgi?id=191762
rdar://problem/46151509

Reviewed by Dean Jackson.

Source/WebKit:

When the DownloadClient calls the decision handler with a destination path, check if
m_processPool is null before trying to access its network process. This can happen
if a download is canceled before the client decides its destination.

* UIProcess/Downloads/DownloadProxy.cpp:
(WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/Download.mm:
    Enable the Download API test on iOS, since the platform supports downloads. All the
    tests pass already, except for one which was written using AppKit-specific code:
TEST(_WKDownload, RedirectedDownload):
    Use a more platform-agnostic approach to starting the download in this API test.
    Instead of manually triggering an NSMenu item to download a file from a link, the
    test will simulate a user-initiated click on the link, and the navigation delegate
    will direct the web view to start a download based on the link's navigation action.
    Additionally, remove the manual creation of a new NSWindow. TestWKWebView makes its
    own UI/NSWindow.
TEST(_WKDownload, DownloadCanceledWhileDecidingDestination):
    Add an API test _WKDownload.DownloadCanceledWhileDecidingDestination to simulate the
    conditions that would trigger this crash - handling a download's -decideDestination…
    delegate call by canceling the download, waiting for the UI process to be notified
    that the download has been canceled, and calling the decision handler. This should
    not crash.
(-[CancelDownloadWhileDecidingDestinationDelegate _downloadDidFinish:]):
(-[CancelDownloadWhileDecidingDestinationDelegate _download:didFailWithError:]):
(-[CancelDownloadWhileDecidingDestinationDelegate _downloadDidCancel:]):
(-[CancelDownloadWhileDecidingDestinationDelegate _download:decideDestinationWithSuggestedFilename:completionHandler:]):
(-[UIDownloadAsFileTestDelegate _webView:contextMenu:forElement:]): Deleted.
* TestWebKitAPI/cocoa/TestWKWebView.h:
* TestWebKitAPI/cocoa/TestWKWebView.mm:
(-[TestWKWebView objectByEvaluatingJavaScriptWithUserGesture:]):
    Add a user-initated version of -objectByEvaluatingJavaScript:. This is needed in
    order to maintain the behavior of the RedirectedDownload test, which verifies the
    state of the _WKDownload.wasUserInitiated property.

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

9 months ago[iOS Debug] Assertion failure in NSComparisonResult UIContentSizeCategoryCompareToCat...
wenson_hsieh@apple.com [Mon, 19 Nov 2018 21:37:00 +0000 (21:37 +0000)]
[iOS Debug] Assertion failure in NSComparisonResult UIContentSizeCategoryCompareToCategory()
https://bugs.webkit.org/show_bug.cgi?id=190401
<rdar://problem/45195285>

Reviewed by Dean Jackson.

Work around sporadic UIKit assertions when running API tests that may present a UICalloutBar. Currently, UIKit
asks for the `UIApp`’s `-preferredContentSizeCategory` when showing or laying out the callout bar. However,
TestWebKitAPI lacks a UIApp altogether, and forcing one to be initialized via `UIApplicationInstantiateSingleton`
causes numerous other UIKit and WebKit assertions to be hit.

In lieu of TestWebKitAPI becoming a real UI application (see https://webkit.org/b/175204), simply don't allow
the callout bar to be initialized in TestWKWebView-based API tests. This encompasses all API tests which
have some chance of causing the callout bar to be shown by making a ranged text selections during the test.

* TestWebKitAPI/cocoa/TestWKWebView.mm:
(suppressUICalloutBar):
(-[TestWKWebView initWithFrame:configuration:addToWindow:]):
* TestWebKitAPI/ios/UIKitSPI.h:

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

9 months ago[cairo] BackingStore::incorporateUpdate should use CompositeCopy to support drawsBack...
commit-queue@webkit.org [Mon, 19 Nov 2018 21:22:51 +0000 (21:22 +0000)]
[cairo] BackingStore::incorporateUpdate should use CompositeCopy to support drawsBackground=false in general Cairo ports
https://bugs.webkit.org/show_bug.cgi?id=191577

Patch by Tomoki Imai <Tomoki.Imai@sony.com> on 2018-11-19
Reviewed by Carlos Garcia Campos.

We should use CompositeCopy operator to update bitmap to overwrite existing bitmap even if source contains
transparent parts. It enables ports which uses Cairo to set drawsBackground to false.
GTK ports has custom background extension, and in such case, we need to use CompositeSourceOver to retain
custom background.

* UIProcess/cairo/BackingStoreCairo.cpp:
(WebKit::BackingStore::incorporateUpdate): Use CompositeCopy operator to update bitmap.

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

9 months agoWeb Inspector: "Reload Web Inspector" button no longer partially works
joepeck@webkit.org [Mon, 19 Nov 2018 20:51:40 +0000 (20:51 +0000)]
Web Inspector: "Reload Web Inspector" button no longer partially works
https://bugs.webkit.org/show_bug.cgi?id=191773
<rdar://problem/46139932>

Reviewed by Devin Rousso.

Source/WebCore:

* inspector/InspectorFrontendClient.h:
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::reopen):
* inspector/InspectorFrontendHost.h:
* inspector/InspectorFrontendHost.idl:
Provide a host call to reopen an inspector window to reload it.

* testing/Internals.cpp:
Stub implementation, this is not used in tests.

Source/WebInspectorUI:

* UserInterface/Base/Main.js:
* UserInterface/Debug/UncaughtExceptionReporter.js:
(sheetElement.innerHTML):
* UserInterface/Views/SettingsTabContentView.js:

Source/WebKit:

* UIProcess/RemoteWebInspectorProxy.cpp:
(WebKit::RemoteWebInspectorProxy::load):
(WebKit::RemoteWebInspectorProxy::reopen):
* UIProcess/RemoteWebInspectorProxy.h:
* UIProcess/RemoteWebInspectorProxy.messages.in:
* WebProcess/WebPage/RemoteWebInspectorUI.cpp:
(WebKit::RemoteWebInspectorUI::reopen):
* WebProcess/WebPage/RemoteWebInspectorUI.h:
* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::reopen):
* WebProcess/WebPage/WebInspector.h:
* WebProcess/WebPage/WebInspector.messages.in:
* WebProcess/WebPage/WebInspectorUI.cpp:
(WebKit::WebInspectorUI::reopen):
* WebProcess/WebPage/WebInspectorUI.h:

Source/WebKitLegacy/ios:

* WebCoreSupport/WebInspectorClientIOS.mm:
(WebInspectorFrontendClient::reopen):

Source/WebKitLegacy/mac:

* WebCoreSupport/WebInspectorClient.h:
* WebCoreSupport/WebInspectorClient.mm:
(WebInspectorFrontendClient::reopen):

Source/WebKitLegacy/win:

* WebCoreSupport/WebInspectorClient.cpp:
(WebInspectorFrontendClient::reopen):
* WebCoreSupport/WebInspectorClient.h:

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

9 months agoSetting document.title should have no effect for non SVG/HTML documents
commit-queue@webkit.org [Mon, 19 Nov 2018 20:42:53 +0000 (20:42 +0000)]
Setting document.title should have no effect for non SVG/HTML documents
https://bugs.webkit.org/show_bug.cgi?id=191643

Patch by Rob Buis <rbuis@igalia.com> on 2018-11-19
Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* web-platform-tests/html/dom/documents/dom-tree-accessors/document.title-not-in-html-svg-expected.txt: Added.
* web-platform-tests/html/dom/documents/dom-tree-accessors/document.title-not-in-html-svg.html: Added.

Source/WebCore:

Setting document.title should have no effect for non SVG/HTML documents,
see https://html.spec.whatwg.org/multipage/dom.html#document.title.

Behavior matches Firefox and Chrome.

Test: imported/w3c/web-platform-tests/html/dom/documents/dom-tree-accessors/document.title-not-in-html-svg.html

* dom/Document.cpp:
(WebCore::Document::setTitle):

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

9 months ago[WebAssembly] I64 arguments / return value check should be moved from callWebAssembly...
yusukesuzuki@slowstart.org [Mon, 19 Nov 2018 16:49:43 +0000 (16:49 +0000)]
[WebAssembly] I64 arguments / return value check should be moved from callWebAssemblyFunction to JSToWasm wrapper
https://bugs.webkit.org/show_bug.cgi?id=190512

Reviewed by Keith Miller.

This patch moves I64 arguments / return value check from callWebAssemblyFunction to JSToWasm wrapper. Since this
check can be done when compiling the function, we should encode the result into the generated wrapper instead of
checking every time we call callWebAssemblyFunction. This change is also one of the steps removing callWebAssemblyFunction
entirely.

* wasm/WasmExceptionType.h:
* wasm/js/JSToWasm.cpp:
(JSC::Wasm::createJSToWasmWrapper):
* wasm/js/WebAssemblyFunction.cpp:
(JSC::callWebAssemblyFunction):
* wasm/js/WebAssemblyWrapperFunction.cpp:
(JSC::callWebAssemblyWrapperFunction):

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

9 months agoDragging image with a border-image larger than the image element crashes
wenson_hsieh@apple.com [Mon, 19 Nov 2018 16:31:22 +0000 (16:31 +0000)]
Dragging image with a border-image larger than the image element crashes
https://bugs.webkit.org/show_bug.cgi?id=191817
<rdar://problem/46159222>

Reviewed by Ryosuke Niwa.

Source/WebCore:

When dragging an image element, if the image element has:

(1) box-sizing: border-box;
(2) a border-image
(3) a border-top-width that is at least as large as the height of the element and/or a border-left-width that is
    at least as large as the width of the element

...then upon drag, we will fail to create a suitable drag image using the bounding box of the image element
since the size is empty, thereby causing a crash. To fix this, we bail out of this bounding-rect-dependent
codepath for generating a drag image in the case where the bounding rect is empty, and instead fall back to an
icon representation for the drag image.

Test: fast/events/drag-image-with-border-image.html

* page/DragController.cpp:
(WebCore::DragController::doImageDrag):

LayoutTests:

Verifies that an image that meets the pathological criteria described in Source/WebCore/ChangeLog can still be
dragged and dropped into an editable area.

* fast/events/drag-image-with-border-image.html: Added.
* platform/gtk/TestExpectations:
* platform/ios/TestExpectations:
* platform/mac-wk2/TestExpectations:
* platform/wpe/TestExpectations:

Enable this test only in WebKit1.

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

9 months agoREGRESSION(r238016)[GTK][TestWebKitAPI][Ninja] TestJSC can't compile "Bytecodes.h...
Hironori.Fujii@sony.com [Mon, 19 Nov 2018 16:26:42 +0000 (16:26 +0000)]
REGRESSION(r238016)[GTK][TestWebKitAPI][Ninja] TestJSC can't compile "Bytecodes.h: No such file or directory"
https://bugs.webkit.org/show_bug.cgi?id=191692

Reviewed by Michael Catanzaro.

r238016 added a new #include, and requires JSC's derived headers
to be copied into the forwarding header directory.

WEBKIT_MAKE_FORWARDING_HEADERS is using POST_BUILD event to copy
derived headers to the forwarding header directory. This is done
after linking JSC library.

GTK port has TestJSC which has a dependency to JSC static library.
And, this dependency is a link time dependency which means
compiling source files of TestJSC starts before the POST_BUILD
event of JSC. Thus, required header can't be found.

Add an intermediate target between TestJSC and JavaScriptCore to
ensure derived headers are copied into the forwarding header
directory.

* TestWebKitAPI/PlatformGTK.cmake: Added a new custom target pre-TestJSC.
* TestWebKitAPI/PlatformWPE.cmake: Ditto.

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

9 months agoSkip new memory-hungry tests on memory limited devices
guijemont@igalia.com [Mon, 19 Nov 2018 14:00:06 +0000 (14:00 +0000)]
Skip new memory-hungry tests on memory limited devices

Unreviewed gardening.

* stress/big-wasm-memory-grow-no-max.js:
* stress/big-wasm-memory-grow.js:
* stress/big-wasm-memory.js:

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

9 months ago[GTK][WPE] Solve some issues in the enumerateDevices code
commit-queue@webkit.org [Mon, 19 Nov 2018 13:16:15 +0000 (13:16 +0000)]
[GTK][WPE] Solve some issues in the enumerateDevices code
https://bugs.webkit.org/show_bug.cgi?id=191832

Patch by Alejandro G. Castro <alex@igalia.com> on 2018-11-19
Reviewed by Carlos Garcia Campos.

Source/WebKit:

* UIProcess/API/glib/WebKitDeviceInfoPermissionRequest.cpp:
Increase the version to 2.24.
(webkitDeviceInfoPermissionRequestAllow):
(webkitDeviceInfoPermissionRequestDeny):
* UIProcess/API/glib/WebKitDeviceInfoPermissionRequestPrivate.h:
Replace the forward declaration with the include.
* UIProcess/API/gtk/WebKitDeviceInfoPermissionRequest.h: Typo.
* UIProcess/API/gtk/WebKitWebsiteData.h:
Increase the version to 2.24.
* UIProcess/API/wpe/WebKitDeviceInfoPermissionRequest.h: Typo.
* UIProcess/API/wpe/WebKitWebsiteData.h:
Increase the version to 2.24.

Tools:

* TestWebKitAPI/Tests/WebKitGLib/TestWebsiteData.cpp:
(serverCallback): Make all the Strings with HTML code static.
(testWebsiteDataDeviceIdHashSalt): Change the webView settings in
the test.
* TestWebKitAPI/glib/WebKitGLib/WebViewTest.cpp:
(WebViewTest::initializeWebView): Remove the initialization of the
webView settings, we now do it in the specific test.

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

9 months agoUnreviewed. Fix GTK+ build after r238318.
carlosgc@webkit.org [Mon, 19 Nov 2018 09:16:32 +0000 (09:16 +0000)]
Unreviewed. Fix GTK+ build after r238318.

Add new symbols to API documentation files. They should have been added in r237031, but r238318 revealed it.

* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
* UIProcess/API/gtk/docs/webkit2gtk-4.0.types:
* UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:

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

9 months agoRegression(r238330): A lot of WebInspector tests are crashing on the bots
commit-queue@webkit.org [Mon, 19 Nov 2018 09:13:49 +0000 (09:13 +0000)]
Regression(r238330): A lot of WebInspector tests are crashing on the bots
https://bugs.webkit.org/show_bug.cgi?id=191814

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2018-11-19
Reviewed by Ryosuke Niwa.

Expose the expected connection type from the UIProcess into the WebProcess.
When there is a local inspector connection to the UIProcess expose it as
a local frontend channel to the inspector controllers in the Page.

* UIProcess/WebPageInspectorTargetAgent.h:
* UIProcess/WebPageInspectorTargetAgent.cpp:
(WebKit::WebPageInspectorTargetAgent::frontendChannel):
An additional FrontendChannel class is not needed, just use self.

(WebKit::WebPageInspectorTargetAgent::WebPageInspectorTargetAgent):
(WebKit::WebPageInspectorTargetAgent::connectionType const):
(WebKit::WebPageInspectorTargetAgent::sendMessageToFrontend):
Expose the channel to targets as local if there is a local frontend
in the UIProcess.

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

9 months agoRegression(r238330) ProcessSwap.WebInspector API test is a flaky crash in debug
commit-queue@webkit.org [Mon, 19 Nov 2018 07:29:15 +0000 (07:29 +0000)]
Regression(r238330) ProcessSwap.WebInspector API test is a flaky crash in debug
https://bugs.webkit.org/show_bug.cgi?id=191812

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2018-11-18
Reviewed by Chris Dumez.

* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::setFrontendConnection):
It can be possible to receive a frontend connection multiple times
if another WebProcess opened the inspector and this WebProcess got
swapped in before the InspectorProcess notified the WebProcess of
a connection to use. It is always best to use the latest connection
we have received, since any others would have been invalidated.

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

9 months ago[PSON] Received an invalid message "WebPageProxy.DidPerformClientRedirect" from the...
cdumez@apple.com [Mon, 19 Nov 2018 07:14:51 +0000 (07:14 +0000)]
[PSON] Received an invalid message "WebPageProxy.DidPerformClientRedirect" from the web process
https://bugs.webkit.org/show_bug.cgi?id=191828

Reviewed by Antti Koivisto.

Source/WebKit:

WebPageProxy::didPerformClientRedirect() had a MESSAGE_CHECK_URL() for both the source
and the destination URL. The macro calls WebProcessProxy::checkURLReceivedFromWebProcess()
to make sure that both URLs were actually loaded by this WebContent process.

However, now that we're enabled process-swap on cross-site navigation, these checks are no
longer fully valid. If the client-side redirect is cross-site, then the source and destination
URLs get loaded by 2 different WebContent processes. Since didPerformClientRedirect() gets
called after the redirect and gets set by the new WebContent process, only the destination URL
is guaranteed to have been loaded by this process. The source URL may have been loaded in
another process so this patch drops the message check for the source URL.

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

Tools:

Add API test coverage.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
* TestWebKitAPI/Tests/WebKitCocoa/client-side-redirect.html: Added.

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

9 months agoConsider removing double load for accessing the instructions from LLInt
yusukesuzuki@slowstart.org [Mon, 19 Nov 2018 06:51:54 +0000 (06:51 +0000)]
Consider removing double load for accessing the instructions from LLInt
https://bugs.webkit.org/show_bug.cgi?id=190932

Reviewed by Mark Lam.

Changing InstructionStream to RefCountedArray like structure involves so much changes
including BytecodeGraph, PreciseJumpTargets etc. Instead, CodeBlock simply hold a raw
pointer to the InstructionStream's data. Since InstructionStream is not changed
anymore, this pointer is valid while CodeBlock is live.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::CodeBlock):
* bytecode/CodeBlock.h:
* bytecode/InstructionStream.h:
(JSC::InstructionStream::rawPointer const):
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:

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

9 months agoREGRESSION(r238039) WebCore::JSDOMGlobalObject::createStructure is using JSC::Structu...
Hironori.Fujii@sony.com [Mon, 19 Nov 2018 05:23:50 +0000 (05:23 +0000)]
REGRESSION(r238039) WebCore::JSDOMGlobalObject::createStructure is using JSC::Structure::create without including StructureInlines.h
https://bugs.webkit.org/show_bug.cgi?id=191626

Reviewed by Yusuke Suzuki.

JSC::Structure::create is used everywhere. It should be defined in
Structure.h, not in StructureInlines.h.

* runtime/Structure.h:
(JSC::Structure::create): Moved.
* runtime/StructureInlines.h: Moved JSC::Structure::create.

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

9 months agoUnreviewed, rolling in the rest of r237254
yusukesuzuki@slowstart.org [Sun, 18 Nov 2018 19:10:08 +0000 (19:10 +0000)]
Unreviewed, rolling in the rest of r237254
https://bugs.webkit.org/show_bug.cgi?id=190340

JSTests:

* ChakraCore/test/Function/FuncBodyES5.baseline-jsc:
* stress/function-cache-with-parameters-end-position.js: Added.
(shouldBe):
(shouldThrow):
(i.anonymous):
* stress/function-constructor-name.js: Added.
(shouldBe):
(GeneratorFunction):
(AsyncFunction.async):
(AsyncGeneratorFunction.async):
(anonymous):
(async.anonymous):
* test262/expectations.yaml:

LayoutTests/imported/w3c:

* web-platform-tests/html/webappapis/scripting/events/inline-event-handler-ordering-expected.txt:
* web-platform-tests/html/webappapis/scripting/events/invalid-uncompiled-raw-handler-compiled-late-expected.txt:
* web-platform-tests/html/webappapis/scripting/processing-model-2/compile-error-in-attribute-expected.txt:
* web-platform-tests/html/webappapis/scripting/processing-model-2/compile-error-in-body-onerror-expected.txt:

Source/JavaScriptCore:

* parser/ParserModes.h:
* parser/ParserTokens.h:
(JSC::JSTextPosition::JSTextPosition):
(JSC::JSTokenLocation::JSTokenLocation): Deleted.
* runtime/CodeCache.cpp:
(JSC::CodeCache::getUnlinkedGlobalFunctionExecutable):
* runtime/FunctionConstructor.cpp:
(JSC::constructFunctionSkippingEvalEnabledCheck):

LayoutTests:

* fast/dom/attribute-event-listener-errors-expected.txt:
* fast/events/attribute-listener-deletion-crash-expected.txt:
* fast/events/window-onerror-syntax-error-in-attr-expected.txt:
* js/dom/invalid-syntax-for-function-expected.txt:
* js/dom/script-start-end-locations-expected.txt:

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

9 months agoHarfBuzzFace::CacheEntry should use 32-bit values in its HashMap
commit-queue@webkit.org [Sun, 18 Nov 2018 17:26:15 +0000 (17:26 +0000)]
HarfBuzzFace::CacheEntry should use 32-bit values in its HashMap
https://bugs.webkit.org/show_bug.cgi?id=191825

Patch by Zan Dobersek <zdobersek@igalia.com> on 2018-11-18
Reviewed by Michael Catanzaro.

The HashMap-based glyph cache contained in HarfBuzzFace::CacheEntry
objects is used to map given Unicode codepoints to corresponding
glyph indices (which occurs in the harfBuzzGetGlyph() function that's
invoked by HarfBuzz).

The 16-bit unsigned integer as the map's value type is not enough here
when the glyph index mapping is done through Freetype -- its API returns
32-bit glyph indices, and Cairo assigns this value to the 64-bit
unsigned index variable in the cairo_glyph_t struct. The value type is
thus bumped to 32 bits to match the unsigned type size of the index's
origin.

* platform/graphics/harfbuzz/HarfBuzzFace.h:
* platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:

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

9 months agoUse Box<BinarySemaphore> instead of dispatch_semaphore_t
yusukesuzuki@slowstart.org [Sun, 18 Nov 2018 12:50:21 +0000 (12:50 +0000)]
Use Box<BinarySemaphore> instead of dispatch_semaphore_t
https://bugs.webkit.org/show_bug.cgi?id=189691

Reviewed by Ryosuke Niwa.

Use Box<BinarySemaphore> instead, which utilizes our WTF::Lock mechanism.

* NetworkProcess/watchos/NetworkProximityManager.mm:
(WebKit::NetworkProximityManager::updateRecommendation):

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

9 months ago[iOS] Remove all usages of UIItemProvider, UIItemProviderReading, and related classes
wenson_hsieh@apple.com [Sun, 18 Nov 2018 06:17:44 +0000 (06:17 +0000)]
[iOS] Remove all usages of UIItemProvider, UIItemProviderReading, and related classes
https://bugs.webkit.org/show_bug.cgi?id=191819

Reviewed by Dan Bernstein.

Replace UIItemProvider (and related classes) with NSItemProvider.

Source/WebCore:

* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::registerItemToPasteboard):
* platform/ios/WebItemProviderPasteboard.h:
* platform/ios/WebItemProviderPasteboard.mm:
(-[WebItemProviderDataRegistrar registerItemProvider:]):
(-[WebItemProviderWritableObjectRegistrar initWithObject:]):
(-[WebItemProviderWritableObjectRegistrar representingObject]):
(-[WebItemProviderWritableObjectRegistrar registerItemProvider:]):
(-[WebItemProviderRegistrationInfoList addRepresentingObject:]):
(-[WebItemProviderRegistrationInfoList itemProvider]):
(-[WebItemProviderPasteboard pasteboardTypes]):
(-[WebItemProviderPasteboard _preLoadedDataConformingToType:forItemProviderAtIndex:]):
(-[WebItemProviderPasteboard dataForPasteboardType:inItemSet:]):
(allLoadableClasses):
(classForTypeIdentifier):
(-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]):
(-[WebItemProviderPasteboard numberOfFiles]):
(-[WebItemProviderPasteboard itemProviderAtIndex:]):
(-[WebItemProviderPasteboard enumerateItemProvidersWithBlock:]):
* platform/mac/DragDataMac.mm:
(WebCore::DragData::containsURL const):

Source/WebCore/PAL:

* pal/spi/ios/UIKitSPI.h:

Source/WebKit:

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _itemsForBeginningOrAddingToSessionWithRegistrationList:stagedDragSource:]):
(-[WKContentView dropInteraction:performDrop:]):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm:
(platformCopyPNG):
* TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm:
(-[NSItemProvider registerDataRepresentationForTypeIdentifier:withData:]):

Replace usages of this deprecated method with `-registerDataRepresentationForTypeIdentifier:visibility:loadHandler:`.

(checkEstimatedSize):
(checkSuggestedNameAndEstimatedSize):
(TestWebKitAPI::TEST):
(-[UIItemProvider registerDataRepresentationForTypeIdentifier:withData:]): Deleted.
* TestWebKitAPI/cocoa/DragAndDropSimulator.h:
* TestWebKitAPI/ios/DragAndDropSimulatorIOS.mm:
(-[MockDragDropSession canLoadObjectsOfClass:]):
(-[MockDragDropSession canLoadObjectsOfClasses:]):
(-[MockDropSession initWithProviders:location:window:allowMove:]):
(-[MockDropSession canCreateItemsOfClass:]):
(-[DragAndDropSimulator _advanceProgress]):
(-[DragAndDropSimulator _webView:dataInteractionOperationWasHandled:forSession:itemProviders:]):
(-[DragAndDropSimulator _webView:adjustedDataInteractionItemProvidersForItemProvider:representingObjects:additionalData:]):
* TestWebKitAPI/ios/UIKitSPI.h:

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

9 months agoRemove superfluous LayoutUnit initializations
ross.kirsling@sony.com [Sun, 18 Nov 2018 03:14:31 +0000 (03:14 +0000)]
Remove superfluous LayoutUnit initializations
https://bugs.webkit.org/show_bug.cgi?id=191791

Reviewed by Simon Fraser.

First step toward making LayoutUnit constructors explicit:
eliminate `= 0` when constructing LayoutUnit lvalues.

* editing/Editor.cpp:
(WebCore::Editor::firstRectForRange const):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::modify):
(WebCore::FrameSelection::lineDirectionPointForBlockDirectionNavigation):
* html/shadow/SliderThumbElement.cpp:
(WebCore::RenderSliderContainer::computeLogicalHeight const):
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns):
* page/FrameView.cpp:
(WebCore::FrameView::forceLayoutForPagination):
* page/SpatialNavigation.cpp:
(WebCore::scrollInDirection):
(WebCore::distanceDataForNode):
* rendering/AutoTableLayout.cpp:
(WebCore::AutoTableLayout::layout):
* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::marginIntrinsicLogicalWidthForChild):
(WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild const):
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::placeBoxesInBlockDirection):
(WebCore::InlineFlowBox::paintFillLayer):
(WebCore::InlineFlowBox::paintBoxDecorations):
(WebCore::InlineFlowBox::paintMask):
(WebCore::InlineFlowBox::computeOverAnnotationAdjustment const):
(WebCore::InlineFlowBox::computeUnderAnnotationAdjustment const):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::marginIntrinsicLogicalWidthForChild const):
(WebCore::RenderBlock::layoutPositionedObject):
(WebCore::RenderBlock::selectionGapRectsForRepaint):
(WebCore::RenderBlock::paintSelection):
(WebCore::RenderBlock::textIndentOffset const):
(WebCore::RenderBlock::computeBlockPreferredLogicalWidths const):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats):
(WebCore::RenderBlockFlow::layoutBlock):
(WebCore::RenderBlockFlow::layoutBlockChildren):
(WebCore::RenderBlockFlow::marginValuesForChild const):
(WebCore::RenderBlockFlow::estimateLogicalTopPosition):
(WebCore::RenderBlockFlow::applyBeforeBreak):
(WebCore::RenderBlockFlow::applyAfterBreak):
(WebCore::RenderBlockFlow::adjustBlockChildForPagination):
(WebCore::RenderBlockFlow::clearFloats):
(WebCore::RenderBlockFlow::lowestFloatLogicalBottom const):
(WebCore::RenderBlockFlow::lowestInitialLetterLogicalBottom const):
(WebCore::RenderBlockFlow::addOverhangingFloats):
(WebCore::RenderBlockFlow::getClearDelta):
(WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
* rendering/RenderBlockLineLayout.cpp:
(WebCore::setLogicalWidthForTextRun):
(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
(WebCore::RenderBlockFlow::determineStartPosition):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::fillAvailableMeasure const):
(WebCore::RenderBox::computeIntrinsicLogicalWidthUsing const):
(WebCore::RenderBox::computeLogicalWidthInFragmentUsing const):
(WebCore::RenderBox::computePercentageLogicalHeight const):
(WebCore::RenderBox::computeReplacedLogicalWidthUsing const):
(WebCore::RenderBox::computePositionedLogicalWidthUsing const):
(WebCore::RenderBox::computePositionedLogicalHeightUsing const):
(WebCore::RenderBox::computePositionedLogicalWidthReplaced const):
(WebCore::RenderBox::computePositionedLogicalHeightReplaced const):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::computedCSSPadding const):
(WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry const):
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::marginWidthForChild):
(WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
(WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox):
* rendering/RenderFileUploadControl.cpp:
(WebCore::RenderFileUploadControl::paintObject):
* rendering/RenderFragmentedFlow.cpp:
(WebCore::RenderFragmentedFlow::validateFragments):
(WebCore::RenderFragmentedFlow::adjustedPositionRelativeToOffsetParent const):
(WebCore::RenderFragmentedFlow::updateFragmentsFragmentedFlowPortionRect):
* rendering/RenderFrameSet.cpp:
(WebCore::RenderFrameSet::paint):
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::positionListMarker):
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::computePreferredLogicalWidths):
(WebCore::RenderListMarker::updateMargins):
* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::initialBlockOffsetForPainting const):
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::layoutBlock):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::convertStyleLogicalWidthToComputedWidth):
(WebCore::RenderTable::layout):
(WebCore::RenderTable::offsetWidthForColumn const):
(WebCore::RenderTable::offsetHeightForColumn const):
(WebCore::RenderTable::outerBorderBefore const):
(WebCore::RenderTable::outerBorderAfter const):
(WebCore::RenderTable::outerBorderStart const):
(WebCore::RenderTable::outerBorderEnd const):
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::logicalWidthFromColumns const):
(WebCore::RenderTableCell::computeIntrinsicPadding):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::calcRowLogicalHeight):
(WebCore::RenderTableSection::distributeExtraLogicalHeightToPercentRows):
(WebCore::RenderTableSection::distributeExtraLogicalHeightToAutoRows):
(WebCore::RenderTableSection::distributeRemainingExtraLogicalHeight):
(WebCore::RenderTableSection::layoutRows):
(WebCore::RenderTableSection::calcOuterBorderBefore const):
(WebCore::RenderTableSection::calcOuterBorderAfter const):
(WebCore::RenderTableSection::calcOuterBorderStart const):
(WebCore::RenderTableSection::calcOuterBorderEnd const):
* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::alignBoxesInBlockDirection):
(WebCore::RootInlineBox::beforeAnnotationsAdjustment const):
(WebCore::RootInlineBox::lineSnapAdjustment const):
(WebCore::RootInlineBox::verticalPositionForBox):
* rendering/line/BreakingContext.h:
(WebCore::inlineLogicalWidth):
* rendering/mathml/RenderMathMLBlock.cpp:
(WebCore::RenderMathMLBlock::layoutItems):
* rendering/mathml/RenderMathMLFraction.cpp:
(WebCore::RenderMathMLFraction::layoutBlock):
* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::computePreferredLogicalWidths):
* rendering/mathml/RenderMathMLRoot.cpp:
(WebCore::RenderMathMLRoot::computePreferredLogicalWidths):
(WebCore::RenderMathMLRoot::paint):
* rendering/mathml/RenderMathMLRow.cpp:
(WebCore::RenderMathMLRow::computePreferredLogicalWidths):
* rendering/mathml/RenderMathMLScripts.cpp:
(WebCore::RenderMathMLScripts::layoutBlock):
* rendering/mathml/RenderMathMLUnderOver.cpp:
(WebCore::RenderMathMLUnderOver::stretchHorizontalOperatorsAndLayoutChildren):
(WebCore::RenderMathMLUnderOver::layoutBlock):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::getShadowInsetExtent const):
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::layout):

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

9 months agoUnreviewed WinCairo build fix for r238353.
ross.kirsling@sony.com [Sun, 18 Nov 2018 01:54:55 +0000 (01:54 +0000)]
Unreviewed WinCairo build fix for r238353.

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

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

9 months agoAvoid triggering compositing updates when only the root layer is composited
simon.fraser@apple.com [Sun, 18 Nov 2018 00:51:42 +0000 (00:51 +0000)]
Avoid triggering compositing updates when only the root layer is composited
https://bugs.webkit.org/show_bug.cgi?id=191813

Reviewed by Zalan Bujtas.

If we know that the only composited layer is the root, we can avoid triggering deep
compositing updates sometimes, for example when layout changes size or position,
or when z-order lists change.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::addChild):
(WebCore::RenderLayer::removeChild):
(WebCore::RenderLayer::updateLayerPosition):
(WebCore::RenderLayer::scrollTo):
(WebCore::RenderLayer::updateCompositingLayersAfterScroll):
(WebCore::outputPaintOrderTreeRecursive):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateBackingAndHierarchy): Consult the layer.hasCompositingDescendant()
flag to cut off descendants traversal when possible.
(WebCore::RenderLayerCompositor::layerStyleChanged):

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

9 months agoASSERTION FAILED: m_messageReceivers.contains(...) under ViewGestureController remove...
cdumez@apple.com [Sun, 18 Nov 2018 00:25:20 +0000 (00:25 +0000)]
ASSERTION FAILED: m_messageReceivers.contains(...) under ViewGestureController removeMessageReceiver
https://bugs.webkit.org/show_bug.cgi?id=191734
<rdar://problem/46151497>

Reviewed by Ryosuke Niwa.

Source/WebKit:

When a WebProcess crashes, we destroy the ViewGestureController and reconstruct it later
after we've relaunched a new WebProcess. The ViewGestureController controller takes care
of adding itself as an IPC message receiver to the WebProcessProxy, and the destructor
takes care of removing itself as an IPC message receiver.

However, when process-swapping on navigation, we do not destroy the ViewGestureController
because doing so would take down the swipe gesture snapshot on cross-site swipe navigation.
This led to hitting this assertion later on because the ViewGestureController is still
registered as an IPC message receiver with the old process after process swapping.

To address the issue, we now make sure the ViewGestureController unregisters itself from
the old process and registers itself with the new process on process-swap.

* UIProcess/Cocoa/ViewGestureController.cpp:
(WebKit::ViewGestureController::ViewGestureController):
(WebKit::ViewGestureController::~ViewGestureController):
(WebKit::ViewGestureController::disconnectFromProcess):
(WebKit::ViewGestureController::connectToProcess):
* UIProcess/Cocoa/ViewGestureController.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::processWillSwap):
(WebKit::WebViewImpl::didRelaunchProcess):

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

9 months agoFix an error in 238354 - !=, not ==.
simon.fraser@apple.com [Sat, 17 Nov 2018 23:27:24 +0000 (23:27 +0000)]
Fix an error in 238354 - !=, not ==.

Fixes test failures.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::layerBecameNonComposited):

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

9 months agoClarify RenderLayerCompositor::hasAnyAdditionalCompositedLayers() and related code.
simon.fraser@apple.com [Sat, 17 Nov 2018 22:12:30 +0000 (22:12 +0000)]
Clarify RenderLayerCompositor::hasAnyAdditionalCompositedLayers() and related code.
https://bugs.webkit.org/show_bug.cgi?id=191810

Reviewed by Zalan Bujtas.

Rename m_compositedLayerCount to m_contentLayersCount and have it track layers other
than the RenderView's layer.

hasAnyAdditionalCompositedLayers() is really about whether we can drop out of compositing
because no content layer is composited, and overlays don't require compositing, so
rename it.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingLayers):
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::needsCompositingForContentOrOverlays const):
(WebCore::RenderLayerCompositor::layerBecameComposited):
(WebCore::RenderLayerCompositor::layerBecameNonComposited):
(WebCore::RenderLayerCompositor::layerTreeAsText):
(WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers const): Deleted.
* rendering/RenderLayerCompositor.h:

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

9 months ago[PSON] ASSERTION FAILED: m_uncommittedState.state == State::Committed
cdumez@apple.com [Sat, 17 Nov 2018 22:06:56 +0000 (22:06 +0000)]
[PSON] ASSERTION FAILED: m_uncommittedState.state == State::Committed
https://bugs.webkit.org/show_bug.cgi?id=191781

Reviewed by Ryosuke Niwa.

The crash was happening when switching to a suspended page that is not yet done
suspending (e.g. in case of very fast back/forward navigation). The WebPageProxy
would reattach to the suspended process and get load notifications that it did
not expect since it did not schedule any load yet. Those notifications are for
the about:blank load we do for page suspension.

To address the issue, make swapToWebProcess() asynchronous and take a completion
handler. When we try to unsuspend a SuspendedPageProxy, we first make sure it
is actually done suspending. If it is not done suspending, we wait until it is
before telling in to unsuspend and proceeding with the new load.

* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::unsuspend):
(WebKit::SuspendedPageProxy::didFinishLoad):
* UIProcess/SuspendedPageProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::swapToWebProcess):
(WebKit::WebPageProxy::continueNavigationInNewProcess):
* UIProcess/WebPageProxy.h:

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

9 months agoRename RenderLayerCompositor::inCompositingMode() to usesCompositing()
simon.fraser@apple.com [Sat, 17 Nov 2018 22:01:15 +0000 (22:01 +0000)]
Rename RenderLayerCompositor::inCompositingMode() to usesCompositing()
https://bugs.webkit.org/show_bug.cgi?id=191808

Reviewed by Zalan Bujtas.

Other code uses "usesCompositing" so standardize on that (future changes will make
"compositing mode" more ambiguous). Also remove a FrameView function that only
had one caller.

* page/FrameView.cpp:
(WebCore::FrameView::clearBackingStores):
(WebCore::FrameView::handleDeferredScrollbarsUpdateAfterDirectionChange):
(WebCore::FrameView::delegatesScrollingDidChange):
(WebCore::FrameView::hasCompositedContent const): Deleted.
* page/FrameView.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::addChild):
(WebCore::RenderLayer::removeChild):
(WebCore::RenderLayer::rebuildZOrderLists):
(WebCore::RenderLayer::updateLayerPosition):
(WebCore::RenderLayer::scrollTo):
(WebCore::RenderLayer::updateCompositingLayersAfterScroll):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingPolicy):
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::layerStyleChanged):
(WebCore::RenderLayerCompositor::updateBacking):
(WebCore::RenderLayerCompositor::parentFrameContentLayers):
(WebCore::RenderLayerCompositor::setIsInWindow):
(WebCore::RenderLayerCompositor::needsToBeComposited const):
(WebCore::RenderLayerCompositor::reasonsForCompositing const):
(WebCore::RenderLayerCompositor::requiresCompositingForAnimation const):
(WebCore::RenderLayerCompositor::rootOrBodyStyleChanged):
(WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged):
* rendering/RenderLayerCompositor.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::repaintViewAndCompositedLayers):
(WebCore::RenderView::usesCompositing const):

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

9 months agoUnreviewed follow-up to r238343 to address debug assertions in 2 API tests.
cdumez@apple.com [Sat, 17 Nov 2018 20:04:40 +0000 (20:04 +0000)]
Unreviewed follow-up to r238343 to address debug assertions in 2 API tests.

* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::networkProcessCrashed):

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

9 months agoWeb Inspector: Network: add button to show system certificate dialog
drousso@apple.com [Sat, 17 Nov 2018 18:27:42 +0000 (18:27 +0000)]
Web Inspector: Network: add button to show system certificate dialog
https://bugs.webkit.org/show_bug.cgi?id=191458
<rdar://problem/45977019>

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/protocol/Network.json:
Add `getSerializedCertificate` command.

Source/WebCore:

Test: http/tests/inspector/network/getSerializedCertificate.html

* inspector/agents/InspectorNetworkAgent.h:
* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::getSerializedCertificate): Added.

* inspector/InspectorFrontendHost.idl:
* inspector/InspectorFrontendHost.h:
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::supportsShowCertificate): Added.
(WebCore::InspectorFrontendHost::showCertificate): Added.
* inspector/InspectorFrontendClient.h:
(InspectorFrontendClient::showCertificate): Added.
* testing/Internals.cpp:
(InspectorStubFrontend::showCertificate): Added.

* platform/network/cf/CertificateInfo.h:
(WTF::Persistence::encodeCFData): Added.
(WTF::Persistence::decodeCFData): Added.
(WTF::Persistence::encodeSecTrustRef): Added.
(WTF::Persistence::decodeSecTrustRef): Added.
(WTF::Persistence::encodeCertificateChain): Added.
(WTF::Persistence::decodeCertificateChain): Added.
(WTF::Persistence::Coder<WebCore::CertificateInfo>::encode): Added.
(WTF::Persistence::Coder<WebCore::CertificateInfo>::decode): Added.
* platform/network/cf/CertificateInfoCFNet.cpp:
* platform/network/cocoa/CertificateInfoCocoa.mm:

* platform/network/curl/CertificateInfo.h:
(WTF::Persistence::Coder<WebCore::CertificateInfo>::encode): Added.
(WTF::Persistence::Coder<WebCore::CertificateInfo>::decode): Added.

* platform/network/soup/CertificateInfo.h:
(WTF::Persistence::Coder<GRefPtr<GByteArray>>::encode): Added.
(WTF::Persistence::Coder<GRefPtr<GByteArray>>::decode): Added.
(WTF::Persistence::certificatesDataListFromCertificateInfo): Added.
(WTF::Persistence::certificateFromCertificatesDataList): Added.
(WTF::Persistence::Coder<WebCore::CertificateInfo>::encode): Added.
(WTF::Persistence::Coder<WebCore::CertificateInfo>::decode): Added.

Source/WebInspectorUI:

* UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager.supportsShowCertificate): Added.

* UserInterface/Models/Resource.js:
(WI.Resource.prototype.showCertificate): Added.

* UserInterface/Views/ResourceSecurityContentView.js:
(WI.ResourceSecurityContentView.prototype._refreshCetificateSection):
* UserInterface/Views/ResourceSecurityContentView.css:
(.resource-security .details > .show-certificate > .key): Added.
(.resource-security .details > .show-certificate > .key > .error): Added.

* Localizations/en.lproj/localizedStrings.js:

Source/WebKit:

* UIProcess/WebInspectorProxy.messages.in:
* UIProcess/WebInspectorProxy.h:
* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::showCertificate): Added.
(WebKit::WebInspectorProxy::platformShowCertificate): Added.
* UIProcess/mac/WebInspectorProxyGtk.cpp:
(WebKit::WebInspectorProxy::platformShowCertificate): Added.
* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::platformShowCertificate): Added.
* UIProcess/mac/WebInspectorProxyWPE.cpp:
(WebKit::WebInspectorProxy::platformShowCertificate): Added.
* UIProcess/mac/WebInspectorProxyWin.cpp:
(WebKit::WebInspectorProxy::platformShowCertificate): Added.
* WebProcess/WebPage/WebInspectorUI.h:
* WebProcess/WebPage/WebInspectorUI.cpp:
(WebKit::WebInspectorUI::showCertificate): Added.

* UIProcess/RemoteWebInspectorProxy.messages.in:
* UIProcess/RemoteWebInspectorProxy.h:
* UIProcess/RemoteWebInspectorProxy.cpp:
(WebKit::RemoteWebInspectorProxy::showCertificate): Added.
(WebKit::RemoteWebInspectorProxy::platformShowCertificate): Added.
* UIProcess/mac/RemoteWebInspectorProxyGtk.cpp:
(WebKit::RemoteWebInspectorProxy::platformShowCertificate): Added.
* UIProcess/mac/RemoteWebInspectorProxyMac.mm:
(WebKit::RemoteWebInspectorProxy::platformShowCertificate): Added.
* WebProcess/WebPage/RemoteWebInspectorUI.h:
* WebProcess/WebPage/RemoteWebInspectorUI.cpp:
(WebKit::RemoteWebInspectorUI::showCertificate): Added.

* NetworkProcess/cache/NetworkCacheCoders.h:
* NetworkProcess/cache/NetworkCacheCodersCocoa.cpp: Removed.
* NetworkProcess/cache/NetworkCacheCodersCurl.cpp: Removed.
* NetworkProcess/cache/NetworkCacheCodersSoup.cpp: Removed.
Moved `WebCore::CertificateInfo` code for `WTF::Encoder` and `WTF::Decoder` into their
respective platform's CertificateInfo.h file.

* UIProcess/Authentication/mac/WebCredentialMac.mm:

* Configurations/WebKit.xcconfig:
* PlatformMac.cmake:
* PlatformWin.cmake:
* SourcesCocoa.txt:
* SourcesGTK.txt:
* SourcesWPE.txt:
* WebKit.xcodeproj/project.pbxproj:

Source/WebKitLegacy:

* WebCoreSupport/WebInspectorClientIOS.mm:
(WebInspectorFrontendClient::showCertificate): Added.

Source/WebKitLegacy/mac:

* WebCoreSupport/WebInspectorClient.h:
* WebCoreSupport/WebInspectorClient.mm:
(WebInspectorFrontendClient::showCertificate): Added.

* Configurations/WebKitLegacy.xcconfig:

Source/WebKitLegacy/win:

* WebCoreSupport/WebInspectorClient.h:
* WebCoreSupport/WebInspectorClient.cpp:
(WebInspectorFrontendClient::showCertificate): Added.

LayoutTests:

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

* platform/gtk/TestExpectations:
* platform/wincairo/TestExpectations:
* platform/wpe/TestExpectations:

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

9 months ago[LFC][IFC] InlineFormattingState::addDetachingRule should accumulate rules.
zalan@apple.com [Sat, 17 Nov 2018 16:11:24 +0000 (16:11 +0000)]
[LFC][IFC] InlineFormattingState::addDetachingRule should accumulate rules.
https://bugs.webkit.org/show_bug.cgi?id=191801

Reviewed by Antti Koivisto.

Source/WebCore:

before<span style="position: relative">positioned</span>after
In the example above the <positioned> inline box has both the BreakAtStart and the BreakAtEnd rules.
While walking through the inline tree, we add BreakAtStart first and when we figure it's the last child too,
we add BreakAtEnd as well. BreakAtEnd should not clear the BreakAtStart rule.

Test: fast/inline/simple-inline-with-out-of-flow-descendant2.html

* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
* layout/inlineformatting/InlineFormattingState.cpp:
(WebCore::Layout::InlineFormattingState::addDetachingRule):
* layout/inlineformatting/InlineFormattingState.h:
(WebCore::Layout::InlineFormattingState::addDetachingRule): Deleted.

Tools:

* LayoutReloaded/misc/LFC-passing-tests.txt:

LayoutTests:

* fast/inline/simple-inline-with-out-of-flow-descendant2-expected.txt: Added.
* fast/inline/simple-inline-with-out-of-flow-descendant2.html: Added.

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

9 months agoRegression(r233865): Causes synchronous IPC in the middle of layout
jer.noble@apple.com [Sat, 17 Nov 2018 15:13:07 +0000 (15:13 +0000)]
Regression(r233865): Causes synchronous IPC in the middle of layout
https://bugs.webkit.org/show_bug.cgi?id=188307
<rdar://problem/42807306>

Reviewed by Eric Carlson.

Follow-up test fix for r238322:

In ExitFullscreenOnEnterPiP.ElementFullScreen, explicitly make the video
element in element fullscreen the "main content" by playing the video during
a user gesture; only "main content" videos will cause fullscreen mode to exit
when that element is taken into PiP.

In FullscreenZoomInitialFrame.WebKit, the WebView is not visible, so the Page
is considered hidden, and fullscreen is not allowed when the WebView is hidden.
Make the WebView visible by ordering the test window on-screen.

* TestWebKitAPI/Tests/WebKitCocoa/ExitFullscreenOnEnterPiP.html:
* TestWebKitAPI/Tests/WebKitCocoa/ExitFullscreenOnEnterPiP.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/mac/FullscreenZoomInitialFrame.mm:
(TestWebKitAPI::FullscreenZoomInitialFrame::runTest):

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

9 months agoFix build with disabled DFG/FTL
dinfuehr@igalia.com [Sat, 17 Nov 2018 10:33:14 +0000 (10:33 +0000)]
Fix build with disabled DFG/FTL
https://bugs.webkit.org/show_bug.cgi?id=191256

Reviewed by Yusuke Suzuki.

Fix compilation errors and warnings with both DFG and FTL
disabled at compile-time.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::getICStatusMap):
* bytecode/InByIdStatus.cpp:
(JSC::InByIdStatus::computeFor):
* bytecode/PutByIdStatus.cpp:
(JSC::PutByIdStatus::computeFor):
(JSC::PutByIdStatus::hasExitSite): Deleted.
* bytecode/PutByIdStatus.h:
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_catch):

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

9 months agoCaret stops blinking after context menu shown
commit-queue@webkit.org [Sat, 17 Nov 2018 10:04:51 +0000 (10:04 +0000)]
Caret stops blinking after context menu shown
https://bugs.webkit.org/show_bug.cgi?id=191715

Patch by Jonathan Hammer <jonathan@e3software.com> on 2018-11-17
Reviewed by Ryosuke Niwa.

Source/WebCore:

Changed EventHandler::sendContextMenuEvent to un-suspend caret blinking so that
the caret continues to blink even after the context menu is dismissed. The normal
way of un-suspendeding caret blinking (in EventHandler::handleMouseReleaseEvent) does
not apply in the case of context menus because handleMouseReleaseEvent is not
called once the context menu is up.

Test: fast/events/contextmenu-dismiss-blink-caret.html

* page/EventHandler.cpp:
(WebCore::EventHandler::sendContextMenuEvent):
* testing/Internals.cpp:
(WebCore::Internals::isCaretBlinkingSuspended):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* fast/events/contextmenu-dismiss-blink-caret-expected.txt: Added.
* fast/events/contextmenu-dismiss-blink-caret.html: Added.

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

9 months ago[Pointer Events] event.isPrimary doesn't always represent the oldest active touch
graouts@webkit.org [Sat, 17 Nov 2018 09:29:52 +0000 (09:29 +0000)]
[Pointer Events] event.isPrimary doesn't always represent the oldest active touch
https://bugs.webkit.org/show_bug.cgi?id=191752
<rdar://problem/46129270>

Reviewed by Dean Jackson.

Source/WebCore:

Provide isPrimary to the constructor so its value can be determined at the call site.

Test: pointerevents/ios/pointer-events-is-primary.html

* dom/PointerEvent.h:
* dom/ios/PointerEventIOS.cpp:
(WebCore::PointerEvent::create):
(WebCore::PointerEvent::PointerEvent):
(WebCore::m_isPrimary):

LayoutTests:

Add a new test that checks that adding a touch after another existing touch does not make it be
the primary touch, but that removing the first touch makes the second touch become the primary touch.

To do this we add a new ui.sequence() method that allows a series of touch actions to be performed
in a linear sequence. The test author can create a finger and call various actions on it, currently
begin(), move() and end().

When these actions are processed, we compute all "stationary" actions for each part of the sequence
so that we can provide this to the uiController.sendEventStream() function.

Finally, we add a way to track events received by the target and assert that the events that were
received match those that were expected.

* pointerevents/ios/pointer-events-is-primary-expected.txt: Added.
* pointerevents/ios/pointer-events-is-primary.html: Added.
* pointerevents/utils.js:
(prototype.handleEvent):
(prototype.assertMatchesEvents):
(const.ui.new.UIController):
(const.ui.new.UIController.prototype.finger):
(const.ui.new.UIController.prototype.pinchOut):
(const.ui.new.UIController.prototype.sequence):
(const.ui.new.UIController.prototype._runEvents):
(prototype.begin):
(prototype.move):
(prototype.end):
(prototype.stationary):
(prototype._action):

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

9 months agoRegression(ProcessPrewarming) Assertion hit in NetworkProcessProxy destructor
cdumez@apple.com [Sat, 17 Nov 2018 06:46:55 +0000 (06:46 +0000)]
Regression(ProcessPrewarming) Assertion hit in NetworkProcessProxy destructor
https://bugs.webkit.org/show_bug.cgi?id=191800

Reviewed by Ryosuke Niwa.

Make sure the NetworkProcessProxy destructor calls its remaining m_pendingConnectionReplies
completion handlers to avoid hitting an assertion in the CompletionHandler destructor.

Prewarmed WebProcess do not keep the ProcessPool alive and thus not the NetworkProcessProxy
either. As a result, it is possible for NetworkProcessProxy to have pending connection
requests from those prewarmed processes when it is destroyed. Similar story for the
suspended page processes when they are destroyed.

* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::~NetworkProcessProxy):

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

9 months agoTweak _showSafeBrowsingWarningWithTitle SPI
achristensen@apple.com [Sat, 17 Nov 2018 06:03:19 +0000 (06:03 +0000)]
Tweak _showSafeBrowsingWarningWithTitle SPI
https://bugs.webkit.org/show_bug.cgi?id=191799

Reviewed by Wenson Hsieh.

Source/WebCore:

It turns out I needed to expose both sentinel values used in safe browsing for my application of this SPI in Mac Safari.
Allowing the caller to make its own sentinel values is insufficient because the malware confirmation needs to be over the warning.
The completion handler parameter should just be a bool indicating whether the user has chosen to continue after all warnings.

Covered by updated API tests.

* en.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::formControlCancelButtonTitle):
Make "Cancel"'s description a little more generic.

Source/WebKit:

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _showSafeBrowsingWarningWithTitle:warning:details:completionHandler:]):
(+[WKWebView _visitUnsafeWebsiteSentinel]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
(-[WKSafeBrowsingWarning clickedOnLink:]):
I need to localize "Continue" and "Cancel" so they aren't always in English.

Tools:

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

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

9 months agoWKWebViewMacEditingTests.DoNotCrashWhenInterpretingKeyEventWhileDeallocatingView...
cdumez@apple.com [Sat, 17 Nov 2018 04:23:49 +0000 (04:23 +0000)]
WKWebViewMacEditingTests.DoNotCrashWhenInterpretingKeyEventWhileDeallocatingView API test is crashing in debug
https://bugs.webkit.org/show_bug.cgi?id=191797

Reviewed by Ryosuke Niwa.

We were hitting the assertion because the error handler was first getting called. It would
deallocate the send right, cancel/null out the XPC connection and call
didFinishLaunchingProcess(0, IPC::Connection::Identifier()).

Then the xpc_connection_send_message_with_reply() block would get called later and
would try to deallocate the send right again, and call
didFinishLaunchingProcess(0, IPC::Connection::Identifier()) again because the xpc
connection is null.

Handle this case by having the xpc_connection_send_message_with_reply() block check
that we're still launching (i.e. didFinishLaunchingProcess() has not been called
yet).

* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::ProcessLauncher::launchProcess):

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

9 months agoREGRESSION (r238294): TestWebKitAPI.WKNavigation.ProcessCrashDuringCallback failing...
rniwa@webkit.org [Sat, 17 Nov 2018 04:23:30 +0000 (04:23 +0000)]
REGRESSION (r238294): TestWebKitAPI.WKNavigation.ProcessCrashDuringCallback failing on iOS
https://bugs.webkit.org/show_bug.cgi?id=191783

Reviewed by Chris Dumez.

Allow either WKErrorWebContentProcessTerminated or WKErrorWebViewInvalidated since the test
is closing WebView, thereby invalidating the view, which is racing with the process termination.

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

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

9 months agoProcessSwap.DisableForInspector API test is failing
cdumez@apple.com [Sat, 17 Nov 2018 04:01:31 +0000 (04:01 +0000)]
ProcessSwap.DisableForInspector API test is failing
https://bugs.webkit.org/show_bug.cgi?id=191798

Reviewed by Joseph Pecoraro.

We support process swapping when Web Inspector is shown now so update the
API test accordingly.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

9 months agoUnreviewed follow-up to r238330.
joepeck@webkit.org [Sat, 17 Nov 2018 03:06:38 +0000 (03:06 +0000)]
Unreviewed follow-up to r238330.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::close):
Don't clear the pointer after invalidating since the pointer is
used later one. We don't mind it being used after invalidation
it will do the right thing, we'd rather have the WebInspectorProxy
lifetime match the WebPageProxy.

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

9 months agoOptimize composited iframe layer hookup
simon.fraser@apple.com [Sat, 17 Nov 2018 03:06:23 +0000 (03:06 +0000)]
Optimize composited iframe layer hookup
https://bugs.webkit.org/show_bug.cgi?id=191778

Reviewed by Zalan Bujtas.

The change made in r238229 can be more targeted; we only need to hook up iframe content
layers when the layer is already composited (otherwise the updateBacking() above would have triggered
the work), and when it's a RenderWidget layer.

Tested by existing tests.

* rendering/RenderLayer.cpp:
(WebCore::outputPaintOrderTreeRecursive):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::layerStyleChanged):

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

9 months agoProvide default implementation of Widget
ross.kirsling@sony.com [Sat, 17 Nov 2018 02:46:49 +0000 (02:46 +0000)]
Provide default implementation of Widget
https://bugs.webkit.org/show_bug.cgi?id=191784

Reviewed by Michael Catanzaro.

* SourcesWPE.txt:
* platform/Widget.cpp:
(WebCore::Widget::Widget):
(WebCore::Widget::frameRect const):
(WebCore::Widget::~Widget):
(WebCore::Widget::setFrameRect):
(WebCore::Widget::paint):
(WebCore::Widget::setFocus):
(WebCore::Widget::setCursor):
(WebCore::Widget::show):
(WebCore::Widget::hide):
(WebCore::Widget::setIsSelected):
* platform/gtk/WidgetGtk.cpp:
(WebCore::Widget::Widget): Deleted.
(WebCore::Widget::frameRect const): Deleted.
* platform/win/WidgetWin.cpp:
(WebCore::Widget::Widget): Deleted.
(WebCore::Widget::frameRect const): Deleted.
* platform/wpe/WidgetWPE.cpp: Removed.

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

9 months agoProcessSwap.NavigationWithLockedHistoryWithoutPSON API test is a flaky crash in debug
cdumez@apple.com [Sat, 17 Nov 2018 02:26:06 +0000 (02:26 +0000)]
ProcessSwap.NavigationWithLockedHistoryWithoutPSON API test is a flaky crash in debug
https://bugs.webkit.org/show_bug.cgi?id=191795

Reviewed by Alex Christensen.

If the WebProcessPool is getting destroyed while there is a prewarmed WebContent process
that is awaiting its connnection to the network process, then we'll hit the
process->hasOneRef() assertion in the WebProcessPool destructor. This is because
NetworkProcessProxy::m_pendingConnectionReplies keeps a RefPtr to the WebProcessProxy
that is awaiting the connection. The NetworkProcessProxy does not really need to keep
the WebProcessProxy alive in this case so this patch switches to using a WeakPtr instead.

* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::getNetworkProcessConnection):
(WebKit::NetworkProcessProxy::networkProcessCrashed):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebProcessProxy.h:

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

9 months agoWeb Inspector: Audit: add default tests
drousso@apple.com [Sat, 17 Nov 2018 02:14:44 +0000 (02:14 +0000)]
Web Inspector: Audit: add default tests
https://bugs.webkit.org/show_bug.cgi?id=191758

Reviewed by Matt Baker.

* UserInterface/Controllers/AuditManager.js:
(WI.AuditManager.prototype.loadStoredTests):
(WI.AuditManager.prototype.addDefaultTestsIfNeeded): Added.
If there are no previously saved tests in the database, automatically add the default set.

* UserInterface/Views/AuditNavigationSidebarPanel.js:
(WI.AuditNavigationSidebarPanel.prototype._addTest):
(WI.AuditNavigationSidebarPanel.prototype._addResult):
(WI.AuditNavigationSidebarPanel.prototype._handleAuditTestRemoved):
* UserInterface/Views/AuditNavigationSidebarPanel.css:
(.sidebar > .panel.navigation.audit.has-results:not(.has-tests) > .content > .message-text-view): Added.
(.sidebar > .panel.navigation.audit.has-results:not(.has-tests) > .content > .message-text-view > .message): Added.
(.sidebar > .panel.navigation.audit.has-results:not(.has-tests) > .content > .message-text-view > button): Added.
When the last test is removed, show a placeholder message that allows the user to re-add the
default set of tests.

* UserInterface/Views/NavigationSidebarPanel.js:
(WI.NavigationSidebarPanel.prototype.showEmptyContentPlaceholder):
(WI.NavigationSidebarPanel.prototype._createEmptyContentPlaceholderIfNeeded):

* Localizations/en.lproj/localizedStrings.js:

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

9 months agoWeb Inspector: Audit: minor style improvements
drousso@apple.com [Sat, 17 Nov 2018 02:10:43 +0000 (02:10 +0000)]
Web Inspector: Audit: minor style improvements
https://bugs.webkit.org/show_bug.cgi?id=191727

Reviewed by Joseph Pecoraro.

Source/WebInspectorUI:

* UserInterface/Controllers/AuditManager.js:
(WI.AuditManager):
(WI.AuditManager.prototype._handleFrameMainResourceDidChange): Added.
Clear test results when the main frame navigates, but don't clear the saved results.

* UserInterface/Models/AuditTestCase.js:
(WI.AuditTestCase.prototype.async run):
* UserInterface/Models/AuditTestCaseResult.js:
(WI.AuditTestCaseResult):
(WI.AuditTestCaseResult.async fromPayload):
(WI.AuditTestCaseResult.prototype.get resolvedDOMNodes): Added.
(WI.AuditTestCaseResult.prototype.toJSON):
Capture the full CSS path for any returned DOM nodes when the test finishes running, so that
if the node moves around the path isn't modified as well.

* UserInterface/Views/AuditTestCaseContentView.js:
(WI.AuditTestCaseContentView.prototype.layout):
Always show the URL for the test when viewing a saved result.

* UserInterface/Views/AuditTestContentView.css:
(.content-view-container > .content-view.audit-test > header p):
(.content-view.audit-test > header):
* UserInterface/Views/AuditTestCaseContentView.css:
(.content-view.audit-test-case > header): Added.
(.content-view.audit-test-case > header h1 > img):
(.content-view.audit-test-case > header > .metadata > .source): Added.
(.content-view.audit-test-case > header > .metadata > .duration):
(.content-view.audit-test-case > section table > tr > td:first-child):
* UserInterface/Views/AuditTestGroupContentView.css:
(.content-view.audit-test-group > header):
Horizontally align items in the header for visual consistency.

LayoutTests:

* inspector/audit/resources/audit-utilities.js:

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

9 months ago[macOS] Label "prewarmed" WebContent processes in Activity Monitor
cdumez@apple.com [Sat, 17 Nov 2018 01:34:04 +0000 (01:34 +0000)]
[macOS] Label "prewarmed" WebContent processes in Activity Monitor
https://bugs.webkit.org/show_bug.cgi?id=191765
<rdar://problem/45953463>

Reviewed by Geoffrey Garen.

Source/WebCore:

* en.lproj/Localizable.strings:

Source/WebKit:

Label "prewarmed" WebContent processes in Activity Monitor to facilitate debugging.

* Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
(WebKit::XPCServiceInitializerDelegate::getExtraInitializationData):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::getLaunchOptions):
(WebKit::WebProcessProxy::markIsNoLongerInPrewarmedPool):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::markIsNoLongerPrewarmed):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::initializeProcessName):
(WebKit::WebProcess::updateProcessName):
(WebKit::WebProcess::platformInitializeProcess):

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

9 months agoWeb Inspector: Include default filtering of InspectorBackend.dumpInspectorProtocolMes...
joepeck@webkit.org [Sat, 17 Nov 2018 01:28:44 +0000 (01:28 +0000)]
Web Inspector: Include default filtering of InspectorBackend.dumpInspectorProtocolMessages with multi target backend
https://bugs.webkit.org/show_bug.cgi?id=191785

Reviewed by Matt Baker.

* UserInterface/Debug/Bootstrap.js:
(dumpMessagesCurrentState):
(applyDumpMessagesState):
(WI.runBootstrapOperations):
Include tri-state for the logs button.

* UserInterface/Protocol/InspectorBackend.js:
(InspectorBackendClass.prototype.set filterMultiplexingBackendInspectorProtocolMessages):
(InspectorBackendClass.prototype.get filterMultiplexingBackendInspectorProtocolMessages):
(InspectorBackendClass.prototype._startOrStopAutomaticTracing):
Add new filtering state (the Setting already got added in the past).

* UserInterface/Protocol/LoggingProtocolTracer.js:
(WI.LoggingProtocolTracer):
(WI.LoggingProtocolTracer.prototype.set filterMultiplexingBackend):
(WI.LoggingProtocolTracer.prototype.get filterMultiplexingBackend):
(WI.LoggingProtocolTracer.prototype._processEntry):
Perform new filtering.

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

9 months agoWeb Inspector: Keep Web Inspector window alive across process swaps (PSON) (Local...
joepeck@webkit.org [Sat, 17 Nov 2018 01:28:41 +0000 (01:28 +0000)]
Web Inspector: Keep Web Inspector window alive across process swaps (PSON) (Local Inspector)
https://bugs.webkit.org/show_bug.cgi?id=191740
<rdar://problem/45470897>

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

* inspector/InspectorFrontendChannel.h:
Expose EnumTraits for ConnectionType for WebKit IPC messages.

Source/WebInspectorUI:

* UserInterface/Protocol/Connection.js:
(InspectorBackend.Connection.prototype._dispatchResponse):
Hide the TargetAgent does not exist message. This is necessary so that WebKitLegacy
tests don't include this line in output each test.

* UserInterface/Test.html:
* UserInterface/Test/Test.js:
(WI.loaded):
(WI.resetMainExecutionContext):
(WI.performOneTimeFrontendInitializationsUsingTarget):
Behave more like Main.js and initialize a MultiplexingBackendTarget when the
TargetAgent is available.

* UserInterface/Protocol/InspectorBackend.js:
(InspectorBackendClass.prototype.runAfterPendingDispatches):
Use the main target, a.k.a. the page connection. The backend target's
messages don't have any responses, so this was effectively not waiting
at all.

Source/WebKit:

When a web page asks to open a local Web Inspector, that inspector
will now connect in the UIProcess (WebPageProxy / WebPageInspectorController)
instead of the WebContentProcess (WebKit::WebInspector / InspectorController).

Previously a WebInspectorProxy was re-created every time the WebPageProxy's
WebPage / WebProcess was changed, effectively closing the Web Inspector
frontend when the WebPage was swapped or crashed.

This change keeps the WebInspectorProxy alive as long as the WebPageProxy
is alive. During process swaps, or process crashes, the WebInspectorProxy
is reset when the page is reset and updated when the page's WebProcess
changes. Since WebInspectorProxy owns the Web Inspector view / window
the Web Inspector window can be kept alive across (and attached state)
across WebPage / WebProcess changes.

Previously the WebContentProcess's WebKit::WebInspector was the Local
FrontendChannel for the WebCore::InspectorController. This can't
outlive the single WebContentProcess.

This change makes the UIProcesses' WebInspectorProxy the Local FrontendChannel
for the WebKit::WebPageInspectorController. Given the WebInspectorProxy
now stays alive alongside the WebPageProxy this will live across process changes.
This means that the WebInspectorUI process must send its backend messages to
the WebInspectorProxy -> WebPageInspectorController now instead of the
old path WebInspector -> WebCore::InspectorController.

A direct IPC connection is still maintained between the WebContentProcess's
WebKit::WebInspector and the InspectorProcess's WebInspectorUI. Previously
this connection was established by WebKit::WebInspector vending an
IPC::Attachment to the WebInspectorUI process. This patch inverts that
relationship, because the WebInspectorUI process now lives across multiple
WebContentProcess changes. The WebInspectorUI now vends the IPC::Attachment
to the WebContentProcess each time the process changes. This way they can both
still communicate through normal Messages::WebInspector/WebInspectorUI
messages and everything behaves as previously expected.

* Scripts/webkit/messages.py:
Header for Inspector::FrontendChannel::ConnectionType.

* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
(WebKit::WebInspectorClient::openLocalFrontend):
* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::openLocalInspectorFrontend):
(WebKit::WebInspector::setFrontendConnection):
(WebKit::WebInspector::closeFrontendConnection):
(WebKit::WebInspector::close):
(WebKit::WebInspector::openFrontendConnection): Deleted.
(WebKit::WebInspector::sendMessageToBackend): Deleted.
(WebKit::WebInspector::sendMessageToFrontend): Deleted.
On the WebProcess side we ask the UIProcess to open a local frontend and now
receive instead of vend an IPC connection to the WebInspectorUI process.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::finishAttachingToWebProcess):
(WebKit::WebPageProxy::close):
(WebKit::WebPageProxy::resetState):
Keep the WebInspectorProxy alive alongside the WebPageProxy.
Update it as processes / states change.

* UIProcess/WebInspectorProxy.h:
* UIProcess/WebInspectorProxy.messages.in:
* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::openLocalInspectorFrontend):
(WebKit::WebInspectorProxy::createInspectorPage): Deleted.
(WebKit::WebInspectorProxy::sendMessageToFrontend):
(WebKit::WebInspectorProxy::closeFrontendPageAndWindow):
Open and close a local frontend by being the FrontendChannel on the UIProcess side.

(WebKit::WebInspectorProxy::sendMessageToBackend):
Dispatch WebInspectorUI backend messages to the UIProcess's InspectorController
now that the InspectorController is here instead of in the WebProcess.

(WebKit::WebInspectorProxy::setFrontendConnection):
Transfer the WebProcess <-> InspectorProcess IPC connection through us
because we are the one link between them when processes change.

(WebKit::WebInspectorProxy::invalidate):
(WebKit::WebInspectorProxy::frontendLoaded):
Be safer and handle inspectedPage being potentially null.

* WebProcess/WebPage/WebPageInspectorTargetController.cpp:
(WebKit::WebPageInspectorTargetController::connectInspector):
* WebProcess/WebPage/WebPageInspectorTargetController.h:
* WebProcess/WebPage/WebPageInspectorTargetFrontendChannel.cpp:
(WebKit::WebPageInspectorTargetFrontendChannel::create):
(WebKit::WebPageInspectorTargetFrontendChannel::WebPageInspectorTargetFrontendChannel):
* WebProcess/WebPage/WebPageInspectorTargetFrontendChannel.h:
* UIProcess/InspectorTargetProxy.cpp:
(WebKit::InspectorTargetProxy::connect):
Proxy the ConnectionType received on the UIProcess side to the WebProcess side
when connecting to sub-targets.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::connectInspector):
(WebKit::WebPage::setHasLocalInspectorFrontend): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::hasLocalInspectorFrontend const): Deleted.
(WebKit::WebPageProxy::setHasLocalInspectorFrontend): Deleted.
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigationInternal):
Eliminate the hasLocalInspectorFrontend state that was only used
to disable PSON. PSON no longer needs to be disabled for this reason.

* WebProcess/WebPage/WebInspector.h:
* WebProcess/WebPage/WebInspector.messages.in:
* WebProcess/WebPage/WebInspectorUI.cpp:
(WebKit::WebInspectorUI::establishConnection):
(WebKit::WebInspectorUI::updateConnection):
(WebKit::WebInspectorUI::closeWindow):
(WebKit::WebInspectorUI::sendMessageToBackend):
* WebProcess/WebPage/WebInspectorUI.h:
* WebProcess/WebPage/WebInspectorUI.messages.in:
Vend an IPC connection on demand to the WebProcess side.

LayoutTests:

* inspector/unit-tests/target-manager-expected.txt:
* inspector/unit-tests/target-manager.html:
Update test to pass in both a MultiplexingBackendTarget and DirectBackendTarget world.

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

9 months agoManifest file can contain a test metric which references a non-existent test
rniwa@webkit.org [Sat, 17 Nov 2018 01:14:26 +0000 (01:14 +0000)]
Manifest file can contain a test metric which references a non-existent test
https://bugs.webkit.org/show_bug.cgi?id=191796

Reviewed by Dewei Zhu.

The bug was caused by a race condition between the manifest file fetching the list of tests and test metrics
and new tests and test metrics being added. Because we would fetch tests before test metrics, it was possible
for new test metrics which references a test not included in the fetched tests to be present in the test metrics.

Fixed the bug by changing the order of the queries so that test metrics are fetched before tests. This guarantees
that any test referenced by a test metric always exists and thefore included in the manifest file.

Unfortunately no new tests beucase this involes a race condition.

* public/include/manifest-generator.php:

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

9 months agoUpdate buildbot dashboard after Windows 7/10 updates
ryanhaddad@apple.com [Sat, 17 Nov 2018 01:10:48 +0000 (01:10 +0000)]
Update buildbot dashboard after Windows 7/10 updates
https://bugs.webkit.org/show_bug.cgi?id=191219

Reviewed by Alexey Proskuryakov.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BubbleQueueServer.js:
(BubbleQueueServer):
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Dashboard.js:
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/WebKitBuildbot.js:
(WebKitBuildbot):
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Styles/Main.css:
(table.queue-grid tr.platform td.logo::before):
(table.queue-grid tr.platform.windows-10 td.logo::before):
(table.queue-grid tr.platform.wincairo-windows-10 td.logo::before):
(table.queue-grid tr.platform.windows-7 td.logo::before):
(table.queue-grid tr.platform.wincairo-windows-10 img.logo):

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

9 months agoEnable external playback for video in element fullscreen.
commit-queue@webkit.org [Sat, 17 Nov 2018 00:49:50 +0000 (00:49 +0000)]
Enable external playback for video in element fullscreen.
https://bugs.webkit.org/show_bug.cgi?id=190359
rdar://problem/42560085

Patch by Jeremy Jones <jeremyj@apple.com> on 2018-11-16
Reviewed by Jer Noble.

No new tests because we don't have a good way to test external playback.

Any video that might be auto-pipped from element fullscreen should also enable external playback for video out.
PiP and external playback are mutually exclusive. Instead of preventing PiP when external playback is active,
allow PiP, but disable external playback while PiP is active.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setVideoFullscreenStandby):
* html/HTMLMediaElement.h:
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::setVideoFullscreenStandby):
(WebCore::MediaPlayer::videoFullscreenStandby const):
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerClient::mediaPlayerVideoFullscreenStandby const):
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::setVideoFullscreenStandby):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenStandby):
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateDisableExternalPlayback):

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

9 months agoAll users of ArrayBuffer should agree on the same max size
fpizlo@apple.com [Sat, 17 Nov 2018 00:42:44 +0000 (00:42 +0000)]
All users of ArrayBuffer should agree on the same max size
https://bugs.webkit.org/show_bug.cgi?id=191771

Reviewed by Mark Lam.

JSTests:

* stress/big-wasm-memory-grow-no-max.js: Added.
(foo):
(catch):
* stress/big-wasm-memory-grow.js: Added.
(foo):
(catch):
* stress/big-wasm-memory.js: Added.
(foo):
(catch):

Source/JavaScriptCore:

Array buffers cannot be larger than 0x7fffffff, because otherwise loading typedArray.length in the DFG/FTL would produce
a uint32 or would require a signedness check, neither of which sounds reasonable. It's better to just bound their max size
instead.

* runtime/ArrayBuffer.cpp:
(JSC::ArrayBufferContents::ArrayBufferContents):
(JSC::ArrayBufferContents::tryAllocate):
(JSC::ArrayBufferContents::transferTo):
(JSC::ArrayBufferContents::copyTo):
(JSC::ArrayBufferContents::shareWith):
* runtime/ArrayBuffer.h:
* wasm/WasmMemory.cpp:
(JSC::Wasm::Memory::tryCreate):
(JSC::Wasm::Memory::grow):
* wasm/WasmPageCount.h:

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

9 months agoUnreviewed, make some more tests not crash my computer by only running on instance...
fpizlo@apple.com [Sat, 17 Nov 2018 00:22:39 +0000 (00:22 +0000)]
Unreviewed, make some more tests not crash my computer by only running on instance of it. These tests do not need to
run for each JSC config since they're regression tests for runtime bugs.

* stress/json-stringified-overflow-2.js:
* stress/json-stringified-overflow.js:

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

9 months agoRegression(PSON) WebKit.GeolocationTransitionToHighAccuracy API test is timing out
cdumez@apple.com [Sat, 17 Nov 2018 00:17:32 +0000 (00:17 +0000)]
Regression(PSON) WebKit.GeolocationTransitionToHighAccuracy API test is timing out
https://bugs.webkit.org/show_bug.cgi?id=191789

Reviewed by Alex Christensen.

Relate the 2 test pages so they use the same process since WKContextSetMaximumNumberOfProcesses()
SPI no longer works with PSON / Process prewarming.

* TestWebKitAPI/Tests/WebKit/Geolocation.cpp:
(TestWebKitAPI::TEST):

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

9 months agoRegression(r233865): Causes synchronous IPC in the middle of layout
jer.noble@apple.com [Sat, 17 Nov 2018 00:15:55 +0000 (00:15 +0000)]
Regression(r233865): Causes synchronous IPC in the middle of layout
https://bugs.webkit.org/show_bug.cgi?id=188307
<rdar://problem/42807306>

Reviewed by Eric Carlson.

Revert the changes added in r233865. Rather than make a syncronous call to the UIProcess to
query whether the view has been backgrounded while (e.g.) JS has been spinning, perform the
steps of the requestFullscreen() method on the next run loop, allowing messages from the
UIProcess about page visibilty to be delivered first.

* dom/Document.cpp:
(WebCore::Document::requestFullScreenForElement):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::enterFullscreen):
* html/HTMLMediaElement.h:
* page/ChromeClient.h:

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

9 months agoProvide default implementation of Cursor
ross.kirsling@sony.com [Sat, 17 Nov 2018 00:15:16 +0000 (00:15 +0000)]
Provide default implementation of Cursor
https://bugs.webkit.org/show_bug.cgi?id=191772

Reviewed by Michael Catanzaro.

* SourcesWPE.txt:
* platform/Cursor.cpp:
(WebCore::Cursor::ensurePlatformCursor const):
* platform/wpe/CursorWPE.cpp: Removed.

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

9 months agowebkitpy: Retry app installation on watchOS simulators
jbedard@apple.com [Sat, 17 Nov 2018 00:02:14 +0000 (00:02 +0000)]
webkitpy: Retry app installation on watchOS simulators
https://bugs.webkit.org/show_bug.cgi?id=191769
<rdar://problem/46139850>

Reviewed by Aakash Jain.

* Scripts/webkitpy/xcode/simulated_device.py:
(SimulatedDevice.install_app): Retry app installations.

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

9 months ago[GTK][WPE] Add "WebKitDeviceInfoPermissionRequest.h" into webkit2.h
mcatanzaro@igalia.com [Fri, 16 Nov 2018 23:52:20 +0000 (23:52 +0000)]
[GTK][WPE] Add "WebKitDeviceInfoPermissionRequest.h" into webkit2.h
https://bugs.webkit.org/show_bug.cgi?id=191744
<rdar://problem/46125461>

Unreviewed, install the file.

* PlatformGTK.cmake:
* PlatformWPE.cmake:

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

9 months agoEditorWPE should be EditorLibWPE
don.olmstead@sony.com [Fri, 16 Nov 2018 23:27:06 +0000 (23:27 +0000)]
EditorWPE should be EditorLibWPE
https://bugs.webkit.org/show_bug.cgi?id=191774

Reviewed by Michael Catanzaro.

The platform specific implementations of Editor are all around the
platform's Pasteboard. Since the Pasteboard implementation is now based
around USE(LIBWPE) EditorWPE should be renamed to EditorLibWPE.

* SourcesWPE.txt:
* editing/libwpe/EditorLibWPE.cpp: Renamed from Source/WebCore/editing/wpe/EditorWPE.cpp.

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

9 months agoUnreviewed, make some tests not crash my computer by only running on instance of...
fpizlo@apple.com [Fri, 16 Nov 2018 23:17:10 +0000 (23:17 +0000)]
Unreviewed, make some tests not crash my computer by only running on instance of it. These tests do not need to run for each JSC
config since they're regression tests for runtime bugs.

* stress/large-unshift-splice.js:
* stress/regress-185888.js:

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

9 months agoInclude AirPlay destination name in AirPlay placard.
commit-queue@webkit.org [Fri, 16 Nov 2018 22:55:26 +0000 (22:55 +0000)]
Include AirPlay destination name in AirPlay placard.
https://bugs.webkit.org/show_bug.cgi?id=191574
rdar://problem/45536144

Patch by Jeremy Jones <jeremyj@apple.com> on 2018-11-16
Reviewed by Eric Carlson.

Source/WebCore:

Updated existing tests.

Include the name of the AirPlay destination in the video element's AirPlay placard.

* Modules/modern-media-controls/controls/airplay-placard.js:
(AirplayPlacard):
* Modules/modern-media-controls/controls/placard.js:
* Modules/modern-media-controls/media/placard-support.js:
(PlacardSupport.prototype._updatePlacard):
(PlacardSupport.prototype._updateAirPlayPlacard):
(PlacardSupport):
* en.lproj/modern-media-controls-localized-strings.js:

LayoutTests:

Updated tests for string changes.

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

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

9 months agoAdd DidFirstMeaningfulPaint milestone.
zalan@apple.com [Fri, 16 Nov 2018 22:54:21 +0000 (22:54 +0000)]
Add DidFirstMeaningfulPaint milestone.
https://bugs.webkit.org/show_bug.cgi?id=191754

Reviewed by Simon Fraser.

Source/WebCore:

This milestone fires sone after the paint triggered by the first visually non-empty layout.

* page/FrameView.cpp:
(WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
(WebCore::FrameView::firePaintRelatedMilestonesIfNeeded):
* page/LayoutMilestone.h:

Source/WebKit:

* Shared/API/c/WKPageLoadTypes.h:
* Shared/API/c/WKSharedAPICast.h:
(WebKit::toWKLayoutMilestones):
(WebKit::toLayoutMilestones):
* UIProcess/API/C/WKPageRenderingProgressEvents.h:
* UIProcess/API/C/WKPageRenderingProgressEventsInternal.h:
(pageRenderingProgressEvents):

Tools:

* TestWebKitAPI/CMakeLists.txt:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit/FirstMeaningfulPaintMilestone.cpp: Added.
(TestWebKitAPI::didReachMilestone):
(TestWebKitAPI::setPageLoaderClient):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/FirstMeaningfulPaintMilestone_Bundle.cpp: Copied from Source/WebKit/UIProcess/API/C/WKPageRenderingProgressEvents.h.
(TestWebKitAPI::FirstMeaningfulPaintMilestoneTest::FirstMeaningfulPaintMilestoneTest):
(TestWebKitAPI::FirstMeaningfulPaintMilestoneTest::didCreatePage):

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

9 months agoWeb Inspector: TreeOutline shouldn't select first child of an expanded element on...
mattbaker@apple.com [Fri, 16 Nov 2018 22:45:13 +0000 (22:45 +0000)]
Web Inspector: TreeOutline shouldn't select first child of an expanded element on right arrow key
https://bugs.webkit.org/show_bug.cgi?id=191766

Reviewed by Devin Rousso.

* UserInterface/Views/TreeOutline.js:
(WI.TreeOutline.prototype._treeKeyDown):

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

9 months agoProvide default implementations of Image and Icon
don.olmstead@sony.com [Fri, 16 Nov 2018 22:16:34 +0000 (22:16 +0000)]
Provide default implementations of Image and Icon
https://bugs.webkit.org/show_bug.cgi?id=191764

Reviewed by Michael Catanzaro.

Makes IconWPE and ImageWPE implementations the default.

* Sources.txt:
* SourcesWPE.txt:
* platform/graphics/Icon.cpp: Renamed from Source/WebCore/platform/graphics/wpe/IconWPE.cpp.
* platform/graphics/Image.cpp:
(WebCore::BitmapImage::invalidatePlatformData): Placed here for consistency with implementing ports.
(WebCore::Image::loadPlatformResource):
* platform/graphics/wpe/ImageWPE.cpp: Removed.

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

9 months agoREGRESSION (r232376): Layout Test inspector/console/webcore-logging.html is a flaky...
ryanhaddad@apple.com [Fri, 16 Nov 2018 21:46:40 +0000 (21:46 +0000)]
REGRESSION (r232376): Layout Test inspector/console/webcore-logging.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=186425

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations: Remove flaky expectation.

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

9 months ago[Win] Reduce the use of WKSI library calls: CFNetwork
bfulgham@apple.com [Fri, 16 Nov 2018 21:43:11 +0000 (21:43 +0000)]
[Win] Reduce the use of WKSI library calls: CFNetwork
https://bugs.webkit.org/show_bug.cgi?id=191718
<rdar://problem/46108732>

Reviewed by Alex Christensen.

Source/WebCore:

Remove custom WKSI CFNetwork calls, since the SPI is already documented in PAL. Just
make the same calls on Windows, like we did for iOS and macOS back in 2017.

Stop including WebKitSystemInterface.h for files that used to rely on it
for font-related features.

Tested by existing Windows regression tests. There should be no change in behavior.

* platform/graphics/win/FontCacheWin.cpp:
* platform/graphics/win/FontCustomPlatformData.cpp:
* platform/graphics/win/FontPlatformDataCGWin.cpp:
* platform/network/cf/CookieStorageCFNet.cpp:
* platform/network/cf/CredentialStorageCFNet.cpp:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::createPrivateStorageSession):
(WebCore::NetworkStorageSession::switchToNewTestingSession):
(WebCore::NetworkStorageSession::ensureSession):
* platform/network/cf/ResourceError.h:
* platform/network/cf/ResourceErrorCF.cpp:
(WebCore::getSSLPeerCertificateData):
(WebCore::setSSLPeerCertificateData):
(WebCore::ResourceError::getSSLPeerCertificateDataBytePtr):
(WebCore::ResourceError::platformLazyInit):
(WebCore::ResourceError::cfError const):
* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::setClientCertificateInSSLProperties):
(WebCore::ResourceHandle::createCFURLConnection):
* platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
* platform/network/cf/ResourceRequestCFNet.cpp:
* platform/network/cf/SocketStreamHandleImplCFNet.cpp:

Source/WebCore/PAL:

Add necessary declarations for CFNetwork SPI needed by the Apple Windows build.

* pal/PlatformAppleWin.cmake:
* pal/spi/cf/CFNetworkSPI.h:
* pal/spi/cf/CFNetworkSPIWin.cpp: Added.

Source/WebKitLegacy/win:

Remove custom WKSI CFNetwork calls, since the SPI is already documented in PAL. Just
make the same calls on Windows, like we did for iOS and macOS back in 2017.

* WebCache.cpp:
(WebCache::cacheFolder):
* WebCoreSupport/WebFrameNetworkingContext.cpp:
* WebCoreSupport/WebPlatformStrategies.cpp:
* WebError.cpp:
(WebError::localizedDescription):
(WebError::sslPeerCertificate):
* WebURLResponse.cpp:
(WebURLResponse::sslPeerCertificate):
(WebURLResponse::certificateDictionary const):
* WebView.cpp:
(WebView::setCacheModel):

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

9 months agoKnownCellUse should also have SpecCellCheck as its type filter
sbarati@apple.com [Fri, 16 Nov 2018 20:42:51 +0000 (20:42 +0000)]
KnownCellUse should also have SpecCellCheck as its type filter
https://bugs.webkit.org/show_bug.cgi?id=191729
<rdar://problem/45872852>

Reviewed by Filip Pizlo.

JSTests:

* stress/known-cell-type-check-should-allow-empty-value-to-flow-through.js: Added.
(C):

Source/JavaScriptCore:

We write transformations in the compiler like this where we emit edges with
KnownCellUse if we know we're inserting code at a point where we're dominated
by a Cell check:

a: SomeValue
b: Something(Cell:@a)
c: SomethingElse(@b)
d: CheckNotEmpty(@a)

=>

a: SomeValue
b: Something(Cell:@a)
e: RandomOtherThing(KnownCellUse:@a)
c: SomethingElse(@b)
d: CheckNotEmpty(@a)

However, doing this used to lead to subtly incorrect programs since KnownCellUse
did not allow the empty value to flow through it. We used to end up incorrectly
deleting @d in the above program. We fix this, we make KnownCellUse allow the empty
value to flow through.

* dfg/DFGUseKind.h:
(JSC::DFG::typeFilterFor):

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

9 months ago[WinCairo][WebKitTestRunner] Test contents window is displayed while testing.
commit-queue@webkit.org [Fri, 16 Nov 2018 20:18:47 +0000 (20:18 +0000)]
[WinCairo][WebKitTestRunner] Test contents window is displayed while testing.
https://bugs.webkit.org/show_bug.cgi?id=191593

Patch by Takashi Komori <Takashi.Komori@sony.com> on 2018-11-16
Reviewed by Alex Christensen.

Hide TestRunner window and taskbar button.

* WebKitTestRunner/win/PlatformWebViewWin.cpp:
(WTR::PlatformWebView::PlatformWebView):
(WTR::PlatformWebView::windowSnapshotImage):

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

9 months agoAdd html{color:text} to the simpleUserAgentStyleSheet on macOS.
timothy@apple.com [Fri, 16 Nov 2018 20:13:24 +0000 (20:13 +0000)]
Add html{color:text} to the simpleUserAgentStyleSheet on macOS.
https://bugs.webkit.org/show_bug.cgi?id=191760

Reviewed by Antti Koivisto.

* css/CSSDefaultStyleSheets.cpp: Added html{color:text} to simpleUserAgentStyleSheet inside
a PLATFORM(MAC) copy of the string.

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

9 months agoAutomatic process prewarming should be turned on if PSON is enabled via experimental...
cdumez@apple.com [Fri, 16 Nov 2018 20:11:48 +0000 (20:11 +0000)]
process prewarming should be turned on if PSON is enabled via experimental features
https://bugs.webkit.org/show_bug.cgi?id=191761

Reviewed by Ryosuke Niwa.

m_isAutomaticProcessWarmingEnabledByClient is a std::optional and should not be initialized to
true / false until the client calls API to toggle the feature. When m_isAutomaticProcessWarmingEnabledByClient
is std::nullopt then m_processSwapsOnNavigationFromExperimentalFeatures controls automatic
process prewarming.

* UIProcess/API/APIProcessPoolConfiguration.h:

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

9 months agoAdd API to disable safe browsing checks
achristensen@apple.com [Fri, 16 Nov 2018 19:59:45 +0000 (19:59 +0000)]
Add API to disable safe browsing checks
https://bugs.webkit.org/show_bug.cgi?id=191610

Reviewed by Dean Jackson.

Source/WebKit:

* UIProcess/API/Cocoa/WKPreferences.h:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences setSafeBrowsingEnabled:]):
(-[WKPreferences isSafeBrowsingEnabled]):
(-[WKPreferences _setSafeBrowsingEnabled:]): Deleted.
(-[WKPreferences _safeBrowsingEnabled]): Deleted.
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm:
(resourceURL):
(TEST):
(safeBrowsingView):
(simpleURL): Deleted.

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

9 months agoAn early return from updateSchedulingInfo can leave some variables uninitialized.
jer.noble@apple.com [Fri, 16 Nov 2018 19:06:35 +0000 (19:06 +0000)]
An early return from updateSchedulingInfo can leave some variables uninitialized.
https://bugs.webkit.org/show_bug.cgi?id=191755
<rdar://problem/39910089>

Reviewed by Brent Fulgham.

* Modules/webaudio/AudioBufferSourceNode.cpp:
(WebCore::AudioBufferSourceNode::process):
* Modules/webaudio/AudioScheduledSourceNode.cpp:
(WebCore::AudioScheduledSourceNode::updateSchedulingInfo):
* Modules/webaudio/OscillatorNode.cpp:
(WebCore::OscillatorNode::process):

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

9 months agoWebKit.UnavailablePlugIn API test is crashing in debug
cdumez@apple.com [Fri, 16 Nov 2018 19:00:50 +0000 (19:00 +0000)]
WebKit.UnavailablePlugIn API test is crashing in debug
https://bugs.webkit.org/show_bug.cgi?id=191753

Reviewed by Alex Christensen.

Add missing early returns. Those were mistakenly dropped in r235200.

* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::decidePolicyForPluginLoad):

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

9 months ago[Mac] Regression: WebContent process's display name is no longer set
cdumez@apple.com [Fri, 16 Nov 2018 18:52:59 +0000 (18:52 +0000)]
[Mac] Regression: WebContent process's display name is no longer set
https://bugs.webkit.org/show_bug.cgi?id=191722
<rdar://problem/45960550>

Reviewed by Per Arne Vollan.

Source/WebCore/PAL:

* pal/spi/cocoa/LaunchServicesSPI.h:

Source/WebKit:

Make sure The WebContent process calls _RegisterApplication() during initialization and
*before* trying to set its display name. Setting the display name fails otherwise.

* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::initializeProcessName):
(WebKit::WebProcess::platformInitializeProcess):

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

9 months agoEnable process swap on cross-site navigation by default on iOS
rniwa@webkit.org [Fri, 16 Nov 2018 18:20:18 +0000 (18:20 +0000)]
Enable process swap on cross-site navigation by default on iOS
https://bugs.webkit.org/show_bug.cgi?id=191735

Reviewed by Chris Dumez.

Enabled the feature.

* Shared/WebPreferencesDefaultValues.h:

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

9 months ago[MSE][GStreamer] Ignore caps notifications when tearing down the pipeline
aboya@igalia.com [Fri, 16 Nov 2018 18:14:43 +0000 (18:14 +0000)]
[MSE][GStreamer] Ignore caps notifications when tearing down the pipeline
https://bugs.webkit.org/show_bug.cgi?id=191578

Reviewed by Xabier Rodriguez-Calvar.

Changing the demuxer to READY state (which is done only in the main
thread) triggers the unlinking of its srcpads, which in turns emits a
caps change notification in the previously linked element since they
become unnegotiated again.

We are not interested in caps notifications in these cases, so let's
just ignore caps notifications emitted from the main thread.

This fixes an assertion failure in the debug builds.

* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::AppendPipeline):

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