WebKit-https.git
9 months agoHave a CLI version of JetStream 2 to run on watchOS
sbarati@apple.com [Thu, 17 Oct 2019 22:53:44 +0000 (22:53 +0000)]
Have a CLI version of JetStream 2 to run on watchOS
https://bugs.webkit.org/show_bug.cgi?id=202998
<rdar://problem/56208554>

Reviewed by Tadeu Zagallo.

This patch adds a CLI version of JS2 to run on watchOS. We run most subtests
from the browser version of JS2, but skip a few tests that are particularly
long running, like WSL and some of WTB. We also don't run the Wasm tests
as we don't JIT on watchOS. Each test runs for fewer iterations in the watch
version. 15 is the default iteration count. This benchmark runs in 7 minutes on
a Series 4 watch.

* JetStream2/JetStreamDriver.js:
(getIterationCount):
(getWorstCaseCount):
(Driver.prototype.async.start):
(Driver.prototype.resultsJSON):
(Driver.prototype.dumpJSONResultsIfNeeded):
(Driver.prototype.async.reportScoreToRunBenchmarkRunner):
(DefaultBenchmark):
* JetStream2/RexBench/UniPoker/benchmark.js:
(Benchmark.prototype.validate):
(Benchmark):
* JetStream2/watch-cli.js: Added.

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

9 months agoHarden capacity checks in DFG::LocalCSEPhase::SmallMap.
mark.lam@apple.com [Thu, 17 Oct 2019 22:45:35 +0000 (22:45 +0000)]
Harden capacity checks in DFG::LocalCSEPhase::SmallMap.
https://bugs.webkit.org/show_bug.cgi?id=203123
<rdar://problem/56339943>

Change addPure() and addImpure() to use RELEASE_ASSERT in their capacity checks.

Reviewed by Keith Miller.

* dfg/DFGCSEPhase.cpp:

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

9 months agoUse constexpr in more places and remove some unnecessary external linkage.
mark.lam@apple.com [Thu, 17 Oct 2019 22:18:57 +0000 (22:18 +0000)]
Use constexpr in more places and remove some unnecessary external linkage.
https://bugs.webkit.org/show_bug.cgi?id=203115

Reviewed by Yusuke Suzuki.

Source/JavaScriptCore:

* API/JSWrapperMap.mm:
* heap/MarkedBlock.cpp:
* inspector/JSGlobalObjectInspectorController.cpp:
(Inspector::JSGlobalObjectInspectorController::appendAPIBacktrace):
* inspector/ScriptCallStack.h:
* interpreter/CLoopStack.h:
* interpreter/CallFrame.h:
* interpreter/ShadowChicken.h:
* jit/AssemblyHelpers.cpp:
(JSC::emitRandomThunkImpl):
* jit/GPRInfo.cpp:
* jit/GPRInfo.h:
* jit/JIT.h:
* jit/PCToCodeOriginMap.cpp:
* jit/SpecializedThunkJIT.h:
* jit/ThunkGenerators.cpp:
(JSC::roundThunkGenerator):
* jit/UnusedPointer.h:
* llint/LLIntData.h:
* llint/LLIntPCRanges.h:
* parser/Lexer.h:
* parser/Nodes.h:
* runtime/CodeCache.cpp:
* runtime/CodeCache.h:
* runtime/ErrorInstance.h:
* runtime/JSAsyncFunction.h:
* runtime/JSAsyncGeneratorFunction.h:
* runtime/JSBoundFunction.h:
* runtime/JSCallee.h:
* runtime/JSFunction.h:
* runtime/JSGeneratorFunction.h:
* runtime/JSNativeStdFunction.h:
* runtime/JSRunLoopTimer.cpp:
(): Deleted.
* runtime/JSRunLoopTimer.h:
* runtime/ProxyObject.h:
* runtime/Watchdog.cpp:
(): Deleted.
* runtime/Watchdog.h:
* wasm/js/WebAssemblyFunction.h:
* wasm/js/WebAssemblyFunctionBase.h:
* wasm/js/WebAssemblyWrapperFunction.h:

Source/WebCore:

No new tests because this patch adds no new functionality.

* html/track/TextTrackCueGeneric.cpp:
* html/track/VTTCue.cpp:
* page/EventHandler.cpp:
(WebCore::SyntheticTouchPoint::SyntheticTouchPoint):
* page/FrameTree.h:
* page/scrolling/ScrollingMomentumCalculator.cpp:
(WebCore::projectedInertialScrollDistance):
* platform/graphics/FontTaggedSettings.h:
* platform/graphics/Region.cpp:
* platform/graphics/filters/FELighting.cpp:
* rendering/TableLayout.h:
* rendering/svg/SVGRenderingContext.h:

Source/WebKit:

* UIProcess/API/APIContentRuleListStore.h:
* WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm:

Source/WTF:

Also removed unused lockSpinLimit in Threading.h.

* wtf/MD5.h:
* wtf/SHA1.h:
* wtf/StackBounds.h:
* wtf/Threading.h:

Tools:

* TestWebKitAPI/Tests/WTF/WeakPtr.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/mac/IsNavigationActionTrusted.mm:

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

9 months ago[ Mojave+ ] Layout Test compositing/fixed-with-main-thread-scrolling.html is a flaky...
simon.fraser@apple.com [Thu, 17 Oct 2019 22:15:09 +0000 (22:15 +0000)]
[ Mojave+ ] Layout Test compositing/fixed-with-main-thread-scrolling.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=198757

Reviewed by Tim Horton.

Source/WebCore:

WheelEventTestMonitor depends on "deferral reasons" getting added and removed, such that there is always
at least one reason active until scrolling quiesces.

WheelEventTestMonitor made the incorrect assumption that every call into ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent()
would result in a scroll change making it to the main thread, so it would defer "ScrollingThreadSyncNeeded" there,
and rely on AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll() to remove that deferral reason.
That assumption is wrong, because wheel events may coalesce, or have no impact on scroll position if already scrolled
to the max/min extent (e.g. when rubber banding).

Fix by adding a new "HandlingWheelEvent" deferral reason for the duration that the scrolling thread is processing an wheel event,
and then having ScrollingThreadSyncNeeded just represent the phase where any resulting scroll is being sent to the UI process.
These phases should always overlap.

This required moving isMonitoringWheelEvents() from the root scrolling node to the ScrollingTree.

* page/WheelEventTestMonitor.cpp:
(WebCore::operator<<):
* page/WheelEventTestMonitor.h:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::commitTreeState):
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::isMonitoringWheelEvents const):
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::deferWheelEventTestCompletionForReason const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::removeWheelEventTestCompletionDeferralForReason const):

LayoutTests:

Remove expectation for compositing/fixed-with-main-thread-scrolling.html.

* platform/mac-wk2/TestExpectations:

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

9 months agoUsing version 1 CFRunloopSource for faster task dispatch
sihui_liu@apple.com [Thu, 17 Oct 2019 22:05:24 +0000 (22:05 +0000)]
Using version 1 CFRunloopSource for faster task dispatch
https://bugs.webkit.org/show_bug.cgi?id=202874

Reviewed by Geoffrey Garen.

Source/WTF:

We used CFRunLoopWakeUp to wake up runloop to process source, which seems to be slow according to profiling. To
avoid calling CFRunLoopWakeUp, we should use version 1 CFRunloopSource instead of version 0. This patch brings
about 15% speedup for test PerformanceTests/IndexedDB/basic/objectstore-get.html.

* wtf/RunLoop.cpp:
(WTF::RunLoop::initializeWebRunLoop):
(WTF::RunLoop::web):
* wtf/RunLoop.h:
* wtf/cf/RunLoopCF.cpp:
(WTF::RunLoop::performWork):
(WTF::RunLoop::RunLoop):
(WTF::RunLoop::~RunLoop):
(WTF::RunLoop::wakeUp):
* wtf/cocoa/MainThreadCocoa.mm:
(WTF::initializeMainThreadPlatform):
(WTF::scheduleDispatchFunctionsOnMainThread):
(WTF::initializeWebThread):
(-[JSWTFMainThreadCaller call]): Deleted.

Tools:

Fix a flaky test.

* TestWebKitAPI/Tests/WebKit/getUserMedia.html:

LayoutTests:

Fix a flaky test.

* inspector/css/pseudo-creation-expected.txt:
* inspector/css/pseudo-creation.html:

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

9 months ago[Linux] Avoid usage of <sys/sysctl.h> in MallocBench
aperez@igalia.com [Thu, 17 Oct 2019 21:44:39 +0000 (21:44 +0000)]
[Linux] Avoid usage of <sys/sysctl.h> in MallocBench
https://bugs.webkit.org/show_bug.cgi?id=203109

Reviewed by Carlos Alberto Lopez Perez.

* MallocBench/MallocBench/CPUCount.cpp: Only include <sys/sysctl.h> if
the sysctl() function will be used.

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

9 months agoPython 3: Add support in webkitpy.common.net.buildbot
jbedard@apple.com [Thu, 17 Oct 2019 21:39:27 +0000 (21:39 +0000)]
Python 3: Add support in webkitpy.common.net.buildbot
https://bugs.webkit.org/show_bug.cgi?id=202466

Reviewed by Stephanie Lewis.

* Scripts/test-webkitpy-python3: Add webkitpy.common.net.buildbot to the test list.
* Scripts/webkitpy/common/net/buildbot/buildbot.py:
(Builder.url_encoded_name): Call compatible urllib quote.
(Builder.revision_build_pairs_with_results): Convert iterator to list before returning.
(Build.results_url): Call compatible urllib quote.
(BuildBot._parse_last_build_cell):renderContents needs to be decoded in Python 3.
(BuildBot._parse_current_build_cell): BeautifulSoup and bs4 render breaks differently.
(BuildBot._fetch_build_dictionary): Call compatible urllib quote.
* Scripts/webkitpy/common/net/regressionwindow.py:
(RegressionWindow.revisions): Convert range(...) to list.

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

9 months agoMake requestIdleCallback suspendable
rniwa@webkit.org [Thu, 17 Oct 2019 21:22:30 +0000 (21:22 +0000)]
Make requestIdleCallback suspendable
https://bugs.webkit.org/show_bug.cgi?id=203023

Reviewed by Chris Dumez.

Source/WebCore:

Make requestIdleCallback suspendable by making WindowEventLoop itself suspendable.
Because WindowEventLoop can be shared across documents, we don't want to make it an ActiveDOMObject.

Instead, we would make CachedFrameBase::restore and CachedFrame manually invoke suspend & resume.

Test: requestidlecallback/requestidlecallback-in-page-cache.html

* dom/Document.h:
(WebCore::Document::eventLoopIfExists): Added. This should probably go away once most of the event loop
is implemented since we're almost always going to have this object then.
* dom/WindowEventLoop.cpp:
(WebCore::WindowEventLoop::queueTask): Because m_tasks may contain tasks of suspended documents,
we check m_activeTaskCount, which is only positive when there is a task for non-suspended documents,
to decide whether we schedule a callback or not.
(WebCore::WindowEventLoop::suspend): Added. No-op for now.
(WebCore::WindowEventLoop::resume): Added. Schedule a callback if there is a task associated with
this document.
(WebCore::WindowEventLoop::run): Skip a task for a suspended document, and add it back to m_tasks along
with other tasks that got scheduled by running the current working set of tasks.
* dom/WindowEventLoop.h:
* history/CachedFrame.cpp:
(WebCore::CachedFrameBase::restore):
(WebCore::CachedFrame::CachedFrame):

LayoutTests:

* requestidlecallback/requestidlecallback-in-page-cache-expected.txt: Added.
* requestidlecallback/requestidlecallback-in-page-cache.html: Added.
* requestidlecallback/resources: Added.
* requestidlecallback/resources/page-cache-helper.html: Added.

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

9 months agoBuild fix for newer versions of MSVC.
bfulgham@apple.com [Thu, 17 Oct 2019 21:20:28 +0000 (21:20 +0000)]
Build fix for newer versions of MSVC.

Rubber stamped by Mark Lam.

Some versions of MSVC optimize the inline optimization of
index away, triggering an uninitialized variable error. This
change avoids this problem.

* runtime/Options.cpp:
(JSC::optionTypeSpecificIndex):

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

9 months ago[ews] status bubbles should show details from all the builds in case build is retried
aakash_jain@apple.com [Thu, 17 Oct 2019 21:02:45 +0000 (21:02 +0000)]
[ews] status bubbles should show details from all the builds in case build is retried
https://bugs.webkit.org/show_bug.cgi?id=203117

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-app/ews/views/statusbubble.py:
(StatusBubble._build_bubble): Display messages from all the builds (including retried builds) for a patch on a queue.
(StatusBubble._steps_messages_from_multiple_builds): Method to generate status using information from all the retried builds.
(StatusBubble.get_all_builds_for_queue): Method to get all the builds instead of just the latest one.
(StatusBubble.get_latest_build_for_queue): Modified to use the new get_all_builds_for_queue() method.

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

9 months agoDon't put pages that have not reached the non-visually empty layout milestone in...
cdumez@apple.com [Thu, 17 Oct 2019 20:31:36 +0000 (20:31 +0000)]
Don't put pages that have not reached the non-visually empty layout milestone in the back/forward cache
https://bugs.webkit.org/show_bug.cgi?id=203108

Reviewed by Geoffrey Garen.

We don't want to go back to a visually empty page on back/forward navigation.

* history/BackForwardCache.cpp:
(WebCore::canCacheFrame):
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::visuallyEmptyKey):
* page/DiagnosticLoggingKeys.h:

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

9 months agoWeb Inspector: Elements: selection shouldn't be dimmed by shadow trees
drousso@apple.com [Thu, 17 Oct 2019 20:21:19 +0000 (20:21 +0000)]
Web Inspector: Elements: selection shouldn't be dimmed by shadow trees
https://bugs.webkit.org/show_bug.cgi?id=203057

Reviewed by Joseph Pecoraro.

* UserInterface/Views/DOMTreeOutline.css:
(.tree-outline.dom li .selection-area):
(.tree-outline.dom li > span): Added.
Don't force the `.selection-area` to be behind (`z-index: -1;`) the rest of the content, as
that also puts it behind any `background-color`. Instead, we should make all the content in
every `WI.DOMTreeElement` be above (`z-index: 1;`) the rest of the content, including the
`.selection-area` and any parent's `background-color`.

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

9 months agoRemove duplicate MathML tests
commit-queue@webkit.org [Thu, 17 Oct 2019 19:23:22 +0000 (19:23 +0000)]
Remove duplicate MathML tests
https://bugs.webkit.org/show_bug.cgi?id=202979

Patch by Rob Buis <rbuis@igalia.com> on 2019-10-17
Reviewed by Frédéric Wang.

Commit r251187 removed operators/mo-form-fallback-expected.html by
accident, add it again.

* web-platform-tests/mathml/presentation-markup/operators/mo-form-fallback-expected.html: Added.

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

9 months agotransform-box: content-box, stroke-box missing
commit-queue@webkit.org [Thu, 17 Oct 2019 19:21:39 +0000 (19:21 +0000)]
transform-box: content-box, stroke-box missing
https://bugs.webkit.org/show_bug.cgi?id=201892

Patch by Dirk Schulze <krit@webkit.org> on 2019-10-17
Reviewed by Simon Fraser.

Source/WebCore:

Added the keywords content-box and stroke-box to the
transform-box CSS property.
Those keywords were added to the spec after the implementation
in WebKit.

Test: transforms/transform-box.html

* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator TransformBox const):
* css/CSSProperties.json:
* css/CSSValueKeywords.in:
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
* rendering/RenderLayer.cpp:
(WebCore::computeReferenceBox):
(WebCore::transformBoxToCSSBoxType):
(WebCore::RenderLayer::currentTransform const):
* rendering/style/RenderStyleConstants.h:
* svg/SVGGraphicsElement.cpp:
(WebCore::SVGGraphicsElement::animatedLocalTransform const):

LayoutTests:

* fast/css/transform-box-parsing.html:
* svg/transforms/svg-transform-box-expected.html:
* svg/transforms/svg-transform-box.html:
* transforms/transform-box-expected.html: Added.
* transforms/transform-box.html: Added.

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

9 months ago[iOS Sim] Layout Test scrollingcoordinator/ios/ui-scroll-fixed.html is a flaky failure
simon.fraser@apple.com [Thu, 17 Oct 2019 19:06:21 +0000 (19:06 +0000)]
[iOS Sim] Layout Test scrollingcoordinator/ios/ui-scroll-fixed.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=196612
rdar://problem/49612867

Reviewed by Antti Koivisto.

This test hit a really obscure bug where a combination of an immediate scroll, and
an ancestor reposition left the layer position of a position:fixed layer unchanged.
The position of this layer in the UI process had been previously modified by
the scrolling tree for the scroll, but because the WebContent-side mutations left
the actual position unchanged, we'd never apply a new position via a commit, so left
the layer in the wrong location.

Removing the m_wasScrolledByDelegatedScrollingSincePreviousCommit check in ScrollingTree::applyLayerPositionsAfterCommit()
fixes this, but has perf implications. Alternative fixes require complex state tracking.
Since this is so hard to hit with noisy user scrolling, just change the test to avoid
the perfect storm of scrolls and offsets.

* platform/ios-simulator-wk2/TestExpectations:
* scrollingcoordinator/ios/ui-scroll-fixed-expected.html:
* scrollingcoordinator/ios/ui-scroll-fixed.html:

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

9 months ago[GTK] Explicitly use Python 2 in jhbuild-wrapper
emilio@crisal.io [Thu, 17 Oct 2019 18:49:46 +0000 (18:49 +0000)]
[GTK] Explicitly use Python 2 in jhbuild-wrapper
https://bugs.webkit.org/show_bug.cgi?id=202790

Reviewed by Adrian Perez de Castro.

jhbuildutils.py requires Python 2 for the moment, so using just
`python` fails in distros where Python 3 is the default.

* jhbuild/jhbuild-wrapper:

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

9 months agoSincResampler does not need to create a new AudioBus for each consumeSource call
youenn@apple.com [Thu, 17 Oct 2019 18:19:03 +0000 (18:19 +0000)]
SincResampler does not need to create a new AudioBus for each consumeSource call
https://bugs.webkit.org/show_bug.cgi?id=202983

Reviewed by Eric Carlson.

Allocate an internal AudioBus once and for all.
No observable change of behavior.

* platform/audio/SincResampler.cpp:
(WebCore::SincResampler::consumeSource):
* platform/audio/SincResampler.h:

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

9 months agoAdd libwebrtc third-party pfft
youenn@apple.com [Thu, 17 Oct 2019 18:18:56 +0000 (18:18 +0000)]
Add libwebrtc third-party pfft
https://bugs.webkit.org/show_bug.cgi?id=202733

Reviewed by Eric Carlson.

Initial check-in of pfft which is now used in libwebrtc.

* Source/third_party/pffft: Added.

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

9 months agoUnreviewed, rolling out r251231.
tsavell@apple.com [Thu, 17 Oct 2019 18:15:01 +0000 (18:15 +0000)]
Unreviewed, rolling out r251231.

This test is still very flakey on all platforms.

Reverted changeset:

"[GStreamer] media/video-seek-after-end.html is no longer
flakey"
https://bugs.webkit.org/show_bug.cgi?id=203079
https://trac.webkit.org/changeset/251231

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

9 months agoUnreviewed, rolling out r251245.
tsavell@apple.com [Thu, 17 Oct 2019 18:13:12 +0000 (18:13 +0000)]
Unreviewed, rolling out r251245.

Addressing this issue differently

Reverted changeset:

"Marking media/video-seek-after-end.html as failing"
https://bugs.webkit.org/show_bug.cgi?id=203111
https://trac.webkit.org/changeset/251245

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

9 months agoMarking media/video-seek-after-end.html as failing
tsavell@apple.com [Thu, 17 Oct 2019 17:52:18 +0000 (17:52 +0000)]
Marking media/video-seek-after-end.html as failing
https://bugs.webkit.org/show_bug.cgi?id=203111

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

9 months agoDeprecate ActiveDOMObject::canSuspendForDocumentSuspension()
cdumez@apple.com [Thu, 17 Oct 2019 17:35:26 +0000 (17:35 +0000)]
Deprecate ActiveDOMObject::canSuspendForDocumentSuspension()
https://bugs.webkit.org/show_bug.cgi?id=203086

Reviewed by Geoffrey Garen.

Rename ActiveDOMObject::canSuspendForDocumentSuspension() to shouldPreventEnteringBackForwardCache_DEPRECATED()
to make it clear that no new overrides should be added and that it is no longer OK to prevent the page from
entering the back/forward cache. Also provide a default implementation that returns false so that well-behaved
classes no longer need to override this.

* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::ApplePaySession::canSuspendForDocumentSuspension const): Deleted.
* Modules/applepay/ApplePaySession.h:
* Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::canSuspendForDocumentSuspension const): Deleted.
* Modules/cache/DOMCache.h:
* Modules/cache/DOMCacheStorage.cpp:
(WebCore::DOMCacheStorage::canSuspendForDocumentSuspension const): Deleted.
* Modules/cache/DOMCacheStorage.h:
* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::MediaKeySession::canSuspendForDocumentSuspension const): Deleted.
* Modules/encryptedmedia/MediaKeySession.h:
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
(WebCore::WebKitMediaKeySession::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::WebKitMediaKeySession::canSuspendForDocumentSuspension const): Deleted.
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
* Modules/entriesapi/FileSystemDirectoryReader.cpp:
(WebCore::FileSystemDirectoryReader::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::FileSystemDirectoryReader::canSuspendForDocumentSuspension const): Deleted.
* Modules/entriesapi/FileSystemDirectoryReader.h:
* Modules/entriesapi/FileSystemEntry.cpp:
(WebCore::FileSystemEntry::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::FileSystemEntry::canSuspendForDocumentSuspension const): Deleted.
* Modules/entriesapi/FileSystemEntry.h:
* Modules/fetch/FetchRequest.cpp:
(WebCore::FetchRequest::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::FetchRequest::canSuspendForDocumentSuspension const): Deleted.
* Modules/fetch/FetchRequest.h:
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::FetchResponse::canSuspendForDocumentSuspension const): Deleted.
* Modules/fetch/FetchResponse.h:
* Modules/geolocation/Geolocation.cpp:
(WebCore::Geolocation::page const):
(WebCore::Geolocation::canSuspendForDocumentSuspension const): Deleted.
* Modules/geolocation/Geolocation.h:
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::canSuspendForDocumentSuspension const): Deleted.
* Modules/indexeddb/IDBDatabase.h:
* Modules/indexeddb/IDBIndex.cpp:
(WebCore::IDBIndex::canSuspendForDocumentSuspension const): Deleted.
* Modules/indexeddb/IDBIndex.h:
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::canSuspendForDocumentSuspension const): Deleted.
* Modules/indexeddb/IDBObjectStore.h:
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::canSuspendForDocumentSuspension const): Deleted.
* Modules/indexeddb/IDBRequest.h:
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::canSuspendForDocumentSuspension const): Deleted.
* Modules/indexeddb/IDBTransaction.h:
* Modules/mediarecorder/MediaRecorder.cpp:
(WebCore::MediaRecorder::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::MediaRecorder::canSuspendForDocumentSuspension const): Deleted.
* Modules/mediarecorder/MediaRecorder.h:
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::canSuspendForDocumentSuspension const): Deleted.
* Modules/mediasource/MediaSource.h:
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::canSuspendForDocumentSuspension const): Deleted.
* Modules/mediasource/SourceBuffer.h:
* Modules/mediasource/SourceBufferList.cpp:
(WebCore::SourceBufferList::canSuspendForDocumentSuspension const): Deleted.
* Modules/mediasource/SourceBufferList.h:
* Modules/mediastream/MediaDevices.cpp:
(WebCore::MediaDevices::canSuspendForDocumentSuspension const): Deleted.
* Modules/mediastream/MediaDevices.h:
* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::MediaStream::canSuspendForDocumentSuspension const): Deleted.
* Modules/mediastream/MediaStream.h:
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::MediaStreamTrack::canSuspendForDocumentSuspension const): Deleted.
* Modules/mediastream/MediaStreamTrack.h:
* Modules/mediastream/RTCDTMFSender.cpp:
(WebCore::RTCDTMFSender::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::RTCDTMFSender::canSuspendForDocumentSuspension const): Deleted.
* Modules/mediastream/RTCDTMFSender.h:
* Modules/mediastream/RTCDataChannel.h:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::RTCPeerConnection::canSuspendForDocumentSuspension const): Deleted.
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::UserMediaRequest::canSuspendForDocumentSuspension const): Deleted.
* Modules/mediastream/UserMediaRequest.h:
* Modules/notifications/Notification.cpp:
(WebCore::Notification::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::Notification::canSuspendForDocumentSuspension const): Deleted.
* Modules/notifications/Notification.h:
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::PaymentRequest::canSuspendForDocumentSuspension const): Deleted.
* Modules/paymentrequest/PaymentRequest.h:
* Modules/paymentrequest/PaymentResponse.cpp:
(WebCore::PaymentResponse::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::PaymentResponse::canSuspendForDocumentSuspension const): Deleted.
* Modules/paymentrequest/PaymentResponse.h:
* Modules/pictureinpicture/PictureInPictureWindow.cpp:
(WebCore::PictureInPictureWindow::canSuspendForDocumentSuspension const): Deleted.
* Modules/pictureinpicture/PictureInPictureWindow.h:
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::AudioContext::canSuspendForDocumentSuspension const): Deleted.
* Modules/webaudio/AudioContext.h:
* Modules/webdatabase/DatabaseContext.cpp:
(WebCore::DatabaseContext::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::DatabaseContext::canSuspendForDocumentSuspension const): Deleted.
* Modules/webdatabase/DatabaseContext.h:
* Modules/webgpu/GPUCanvasContext.h:
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::canSuspendForDocumentSuspension const): Deleted.
* Modules/websockets/WebSocket.h:
* Modules/webvr/VRDisplay.cpp:
(WebCore::VRDisplay::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::VRDisplay::canSuspendForDocumentSuspension const): Deleted.
* Modules/webvr/VRDisplay.h:
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::WebAnimation::canSuspendForDocumentSuspension const): Deleted.
* animation/WebAnimation.h:
* css/FontFaceSet.cpp:
(WebCore::FontFaceSet::canSuspendForDocumentSuspension const): Deleted.
* css/FontFaceSet.h:
* dom/ActiveDOMObject.h:
* dom/GenericEventQueue.cpp:
(WebCore::GenericEventQueueBase<T>::canSuspendForDocumentSuspension const): Deleted.
* dom/GenericEventQueue.h:
* dom/MessagePort.cpp:
(WebCore::MessagePort::canSuspendForDocumentSuspension const): Deleted.
* dom/MessagePort.h:
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForDocumentSuspension):
* fileapi/FileReader.cpp:
(WebCore::FileReader::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::FileReader::canSuspendForDocumentSuspension const): Deleted.
* fileapi/FileReader.h:
* html/HTMLMarqueeElement.cpp:
(WebCore::HTMLMarqueeElement::canSuspendForDocumentSuspension const): Deleted.
* html/HTMLMarqueeElement.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::canSuspendForDocumentSuspension const): Deleted.
* html/HTMLMediaElement.h:
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::canSuspendForDocumentSuspension const): Deleted.
* html/HTMLSourceElement.h:
* html/ImageBitmap.cpp:
* html/PublicURLManager.cpp:
(WebCore::PublicURLManager::canSuspendForDocumentSuspension const): Deleted.
* html/PublicURLManager.h:
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::canSuspendForDocumentSuspension const): Deleted.
* html/canvas/WebGLRenderingContextBase.h:
* html/track/TrackListBase.cpp:
(WebCore::TrackListBase::canSuspendForDocumentSuspension const): Deleted.
* html/track/TrackListBase.h:
* page/EventSource.cpp:
(WebCore::EventSource::canSuspendForDocumentSuspension const): Deleted.
* page/EventSource.h:
* page/IntersectionObserver.cpp:
(WebCore::IntersectionObserver::canSuspendForDocumentSuspension const): Deleted.
* page/IntersectionObserver.h:
* page/ResizeObserver.cpp:
(WebCore::ResizeObserver::canSuspendForDocumentSuspension const): Deleted.
* page/ResizeObserver.h:
* page/SuspendableTimer.cpp:
(WebCore::SuspendableTimerBase::canSuspendForDocumentSuspension const): Deleted.
* page/SuspendableTimer.h:
* platform/SuspendableTaskQueue.cpp:
(WebCore::SuspendableTaskQueue::canSuspendForDocumentSuspension const): Deleted.
* platform/SuspendableTaskQueue.h:
* testing/Internals.cpp:
* workers/Worker.cpp:
(WebCore::Worker::canSuspendForDocumentSuspension const): Deleted.
* workers/Worker.h:
* workers/service/ServiceWorker.cpp:
(WebCore::ServiceWorker::canSuspendForDocumentSuspension const): Deleted.
* workers/service/ServiceWorker.h:
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::canSuspendForDocumentSuspension const): Deleted.
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerRegistration.cpp:
(WebCore::ServiceWorkerRegistration::canSuspendForDocumentSuspension const): Deleted.
* workers/service/ServiceWorkerRegistration.h:
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::XMLHttpRequest::canSuspendForDocumentSuspension const): Deleted.
* xml/XMLHttpRequest.h:

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

9 months ago[LFC][TFC] Table formatting context accesses geometry information from parent BFC
zalan@apple.com [Thu, 17 Oct 2019 17:08:11 +0000 (17:08 +0000)]
[LFC][TFC] Table formatting context accesses geometry information from parent BFC
https://bugs.webkit.org/show_bug.cgi?id=203082
<rdar://problem/56370827>

Reviewed by Antti Koivisto.

Tables are wrapped in a 2 level formatting context structure. A <table> element initiates a block formatting context for its principal table box
where the caption and the table content live. It also initiates a table wrapper box which establishes the table formatting context.
In many cases the TFC needs access to the parent (generated) BFC.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::geometryForBox const):
* layout/FormattingContext.h:
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::computedTableWidth):

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

9 months agoTwo fast/scrolling/ios/touch-scroll* tests failing in iOS 13
simon.fraser@apple.com [Thu, 17 Oct 2019 17:02:41 +0000 (17:02 +0000)]
Two fast/scrolling/ios/touch-scroll* tests failing in iOS 13
https://bugs.webkit.org/show_bug.cgi?id=203070
rdar://problem/51756254

Reviewed by Wenson Hsieh.

For some reason the uiController.dragFromPointToPoint() in these tests was too long
to trigger scrolling (maybe an OS change). Fix them to use UIHelper and a shorter
duration, and also to not be sensitive to the exact distance scrolled.

* fast/scrolling/ios/touch-scroll-pointer-events-none-expected.txt:
* fast/scrolling/ios/touch-scroll-pointer-events-none.html:
* fast/scrolling/ios/touch-scroll-visibility-hidden-expected.txt:
* fast/scrolling/ios/touch-scroll-visibility-hidden.html:
* platform/ios-wk2/TestExpectations:
* resources/ui-helper.js:
(window.UIHelper.dragFromPointToPoint):

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

9 months agoREGRESSION (r245483) [iPad Simulator] 2 Layout tests fast/scrolling/ios/overflow...
simon.fraser@apple.com [Thu, 17 Oct 2019 16:52:26 +0000 (16:52 +0000)]
REGRESSION (r245483) [iPad Simulator] 2 Layout tests fast/scrolling/ios/overflow-scroll-inherited.html fast/scrolling/ios/overflow-scrolling-touch-enabled-stacking.html are failing
https://bugs.webkit.org/show_bug.cgi?id=203069
rdar://problem/51868813

Reviewed by Zalan Bujtas.

Add new result for overflow-scroll-inherited.html, since -webkit-overflow-scrolling:touch is a no-op
on iPad on iOS 13.

We can't have different image references for different devices, so keep overflow-scrolling-touch-enabled-stacking.html
as an image failure.

* platform/ipad-12/fast/scrolling/ios/overflow-scroll-inherited-expected.txt: Added.
* platform/ipad/TestExpectations:
* platform/ipad/fast/scrolling/ios/overflow-scroll-inherited-expected.txt: Added.

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

9 months agoMake fast/text/font-cursive-italic-cjk.html more robust
mmaxfield@apple.com [Thu, 17 Oct 2019 16:46:51 +0000 (16:46 +0000)]
Make fast/text/font-cursive-italic-cjk.html more robust
https://bugs.webkit.org/show_bug.cgi?id=203072

Reviewed by Alexey Proskuryakov.

Instead of naming STKaiti by name, we can just use an -expected-mismatch test.

* fast/text/font-cursive-italic-cjk-2-expected.html: Removed.
* fast/text/font-cursive-italic-cjk-2.html: Removed.
* fast/text/font-cursive-italic-cjk-expected-mismatch.html: Added.
* fast/text/font-cursive-italic-cjk-expected.html: Removed.
* fast/text/font-cursive-italic-cjk.html:
* platform/mac/TestExpectations:

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

9 months ago[LFC][Painting] Add support for image/background image painting
zalan@apple.com [Thu, 17 Oct 2019 16:38:57 +0000 (16:38 +0000)]
[LFC][Painting] Add support for image/background image painting
https://bugs.webkit.org/show_bug.cgi?id=203054
<rdar://problem/56347733>

Reviewed by Antti Koivisto.

In addition to image rendering, this patch also addresses various run/decoration painting issues.

* layout/displaytree/DisplayPainter.cpp:
(WebCore::Display::paintBoxDecoration):
(WebCore::Display::paintInlineContent):
(WebCore::Display::absoluteDisplayBox):
(WebCore::Display::paintBoxDecorationAndChildren):
(WebCore::Display::Painter::paint):
* layout/displaytree/DisplayRun.h:
(WebCore::Display::Run::setImage):
(WebCore::Display::Run::image const):
* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::appendNonReplacedInlineBox):
(WebCore::Layout::Line::appendReplacedInlineBox):
* layout/layouttree/LayoutReplaced.h:
(WebCore::Layout::Replaced::setCachedImage):
(WebCore::Layout::Replaced::cachedImage const):
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::TreeBuilder::createLayoutBox):

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

9 months ago[LFC][IFC] Add Display::Run/LineBox mapping
zalan@apple.com [Thu, 17 Oct 2019 16:28:43 +0000 (16:28 +0000)]
[LFC][IFC] Add Display::Run/LineBox mapping
https://bugs.webkit.org/show_bug.cgi?id=203051
<rdar://problem/56342487>

Reviewed by Antti Koivisto.

Mapping enables us to paint baseline aligned runs on the current line. This is temporary until after we figure out the final run/line structure.

* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const):
* layout/Verification.cpp:
(WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
(WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
* layout/displaytree/DisplayPainter.cpp:
(WebCore::Display::paintInlineContent):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::setDisplayBoxesForLine):
* layout/inlineformatting/InlineFormattingContextQuirks.cpp:
(WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
* layout/inlineformatting/InlineFormattingState.h:
(WebCore::Layout::InlineFormattingState::addLineBox):
(WebCore::Layout::InlineFormattingState::lineBoxForRun const):
(WebCore::Layout::InlineFormattingState::addInlineRun):
* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::Run::Run):
(WebCore::Layout::Line::alignContentVertically):
(WebCore::Layout::Line::adjustBaselineAndLineHeight):
* layout/inlineformatting/InlineLine.h:
(WebCore::Layout::Line::Run::displayRun const):
(WebCore::Layout::Line::Run::logicalRect const):
(WebCore::Layout::Line::Run::adjustLogicalTop):
(WebCore::Layout::Line::Run::moveVertically):
(WebCore::Layout::Line::Run::moveHorizontally):
(WebCore::Layout::Line::Run::expand):
* layout/inlineformatting/InlineLineBox.h:
* layout/inlineformatting/InlineLineLayout.h:
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::outputInlineRuns):

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

9 months ago[Web Animations] Enable the Web Animations JavaScript API by default
commit-queue@webkit.org [Thu, 17 Oct 2019 16:24:49 +0000 (16:24 +0000)]
[Web Animations] Enable the Web Animations JavaScript API by default
https://bugs.webkit.org/show_bug.cgi?id=203075

Patch by Antoine Quint <graouts@apple.com> on 2019-10-17
Reviewed by Antti Koivisto.

Source/WebCore:

* page/RuntimeEnabledFeatures.h:

Source/WebKit:

* Shared/WebPreferences.yaml:

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

9 months agoUnreviewed, fix watchOS and tvOS builds after r251224
wenson_hsieh@apple.com [Thu, 17 Oct 2019 16:04:54 +0000 (16:04 +0000)]
Unreviewed, fix watchOS and tvOS builds after r251224

* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::shouldTreatAtLeastOneTypeAsFile):

Move the `shouldTreatAtLeastOneTypeAsFile` helper function out of the `PASTEBOARD_SUPPORTS_ITEM_PROVIDERS`
section, and into generic iOS-family code so that it can be used in `pasteboardMayContainFilePaths`.

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

9 months ago[GTK] Perf test IndexedDB/basic/index-cursor-delete.html timeouts
clopez@igalia.com [Thu, 17 Oct 2019 15:47:43 +0000 (15:47 +0000)]
[GTK] Perf test IndexedDB/basic/index-cursor-delete.html timeouts
https://bugs.webkit.org/show_bug.cgi?id=203083

Unreviewed gardening.

* Skipped: Skip a test that is timing out on the GTK perf bot.

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

9 months agoCheck values of variables before extracting index in perl
commit-queue@webkit.org [Thu, 17 Oct 2019 15:14:58 +0000 (15:14 +0000)]
Check values of variables before extracting index in perl
https://bugs.webkit.org/show_bug.cgi?id=202333

Patch by Paulo Matos <pmatos@igalia.com> on 2019-10-17
Reviewed by Jonathan Bedard.

If compiler doesn't properly report the host and target it was
compiled for, lacking better information we just go ahead and assume
there is no cross compilation involved.

* Scripts/webkitdirs.pm:
(isCrossCompilation):

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

9 months agoAdd a driver for MiniBrowser running with WPE for
psaavedra@igalia.com [Thu, 17 Oct 2019 15:08:19 +0000 (15:08 +0000)]
Add a driver for MiniBrowser running with WPE for
benchmark_runner
https://bugs.webkit.org/show_bug.cgi?id=202994

Reviewed by Žan Doberšek.

* Scripts/webkitpy/benchmark_runner/browser_driver/linux_minibrowserwpe_driver.py: Added.
(WPEMiniBrowserDriver):
(WPEMiniBrowserDriver.launch_url):
(WPEMiniBrowserDriver.launch_driver):

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

9 months agorun-buildbot-test: sqlalchemy exception when upgrading the database
clopez@igalia.com [Thu, 17 Oct 2019 14:51:21 +0000 (14:51 +0000)]
run-buildbot-test: sqlalchemy exception when upgrading the database
https://bugs.webkit.org/show_bug.cgi?id=202927

Reviewed by Adrian Perez de Castro.

Update the version of sqlalchemy-migrate for pip used for the test.
That fixes the exception when upgrading the database.

* BuildSlaveSupport/build.webkit.org-config/run-buildbot-test.py:

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

9 months ago[GStreamer] media/video-seek-after-end.html is no longer flakey
cturner@igalia.com [Thu, 17 Oct 2019 11:28:01 +0000 (11:28 +0000)]
[GStreamer] media/video-seek-after-end.html is no longer flakey
https://bugs.webkit.org/show_bug.cgi?id=203079

Unreviewed test gardening

* TestExpectations:

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

9 months agoMultiChannelResampler does not need to recreate a ChannelProvider for every process...
youenn@apple.com [Thu, 17 Oct 2019 10:29:51 +0000 (10:29 +0000)]
MultiChannelResampler does not need to recreate a ChannelProvider for every process call
https://bugs.webkit.org/show_bug.cgi?id=202982

Reviewed by Eric Carlson.

We no longer allocate a new ChannelProvider for every process call.
No observable change of behavior.

* platform/audio/MultiChannelResampler.cpp:
(WebCore::MultiChannelResampler::ChannelProvider::ChannelProvider):
(WebCore::MultiChannelResampler::ChannelProvider::setProvider):
(WebCore::MultiChannelResampler::MultiChannelResampler):
(WebCore::MultiChannelResampler::process):
* platform/audio/MultiChannelResampler.h:

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

9 months agoWeb Inspector: Network: updates when toggling resource caching should be sent to...
drousso@apple.com [Thu, 17 Oct 2019 09:05:45 +0000 (09:05 +0000)]
Web Inspector: Network: updates when toggling resource caching should be sent to every connected target
https://bugs.webkit.org/show_bug.cgi?id=203025

Reviewed by Joseph Pecoraro.

* UserInterface/Base/Main.js:
(WI._resourceCachingDisabledSettingChanged):

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

9 months ago[GTK][WPE] File and Directory Entries API is not enabled
clopez@igalia.com [Thu, 17 Oct 2019 08:12:11 +0000 (08:12 +0000)]
[GTK][WPE] File and Directory Entries API is not enabled
https://bugs.webkit.org/show_bug.cgi?id=202796

Reviewed by Adrian Perez de Castro.

Enable by default the DirectoryUpload runtime setting that is
used to enable the APIs of the File and Directory Entries API.

Enable also the DataTransferItemsEnabled runtime setting that
exposes the DataTransferItem API. This makes the manual tests
available at https://w3c-test.org/entries-api mostly pass on
platform GTK (those tests need also the DataTransferItem API
to enable the drag-and-drop).

The bug <https://webkit.org/b/98940> for DataTransferItem API
remains open because the layout test editing/pasteboard/data-transfer-items.html
is still not passing completely. However other manual tests for
DataTransferItem pass after enabling it.

* Shared/WebPreferencesDefaultValues.h:

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

9 months agoWeb Inspector: rework frontend agent construction to allow commands/events to be...
drousso@apple.com [Thu, 17 Oct 2019 08:00:46 +0000 (08:00 +0000)]
Web Inspector: rework frontend agent construction to allow commands/events to be controlled by the related target's type
https://bugs.webkit.org/show_bug.cgi?id=200384
<rdar://problem/53850352>

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/scripts/codegen/generate_js_backend_commands.py:
(JSBackendCommandsGenerator.generate_domain):
(JSBackendCommandsGenerator.generate_domain.generate_parameter_object):
* inspector/scripts/codegen/models.py:
(validate_target_types): Added.
(Protocol.parse_domain):
(Protocol.parse_command):
(Protocol.parse_event):
(Domain.__init__):
(Domains):
(Command.__init__):
(Event.__init__):
* inspector/protocol/ApplicationCache.json:
* inspector/protocol/Audit.json:
* inspector/protocol/CPUProfiler.json:
* inspector/protocol/CSS.json:
* inspector/protocol/Canvas.json:
* inspector/protocol/Console.json:
* inspector/protocol/DOM.json:
* inspector/protocol/DOMDebugger.json:
* inspector/protocol/DOMStorage.json:
* inspector/protocol/Database.json:
* inspector/protocol/Debugger.json:
* inspector/protocol/Heap.json:
* inspector/protocol/IndexedDB.json:
* inspector/protocol/Inspector.json:
* inspector/protocol/LayerTree.json:
* inspector/protocol/Memory.json:
* inspector/protocol/Network.json:
* inspector/protocol/Page.json:
* inspector/protocol/Recording.json:
* inspector/protocol/Runtime.json:
* inspector/protocol/ScriptProfiler.json:
* inspector/protocol/Security.json:
* inspector/protocol/ServiceWorker.json:
* inspector/protocol/Target.json:
* inspector/protocol/Timeline.json:
* inspector/protocol/Worker.json:
Add `debuggableTypes` and `targetTypes` arrays to domains/commands/events that are used when
generating InspectorBackendCommands.js for more accurate compatibility checks.

* inspector/InspectorTarget.h:
* inspector/agents/InspectorTargetAgent.h:
* inspector/agents/InspectorTargetAgent.cpp:
(Inspector::targetTypeToProtocolType):
(Inspector::InspectorTargetAgent::exists): Deleted.
Remove `Target.exists` now that the frontend can do proper feature checking.

* inspector/remote/RemoteControllableTarget.h:
* inspector/remote/RemoteInspectionTarget.h:
* inspector/remote/RemoteInspectorConstants.h:
* inspector/remote/cocoa/RemoteInspectorCocoa.mm:
(Inspector::RemoteInspector::listingForInspectionTarget const):
* inspector/remote/glib/RemoteInspectorGlib.cpp:
(Inspector::RemoteInspector::listingForInspectionTarget const):
* inspector/remote/socket/RemoteInspectorSocket.cpp:
(Inspector::RemoteInspector::listingForInspectionTarget const):
Split the `Web` debuggable type into `Page` (WebCore::Page) and `WebPage` (WebKit::WebPageProxy).

* inspector/scripts/tests/all/expected/definitions-with-mac-platform.json-result:
* inspector/scripts/tests/generic/command-targetType-matching-domain-debuggableType.json: Added.
* inspector/scripts/tests/generic/domain-availability.json: Removed.
* inspector/scripts/tests/generic/domain-debuggableTypes.json: Added.
* inspector/scripts/tests/generic/domain-targetType-matching-domain-debuggableType.json: Added.
* inspector/scripts/tests/generic/domain-targetTypes.json: Added.
* inspector/scripts/tests/generic/event-targetType-matching-domain-debuggableType.json: Added.
* inspector/scripts/tests/generic/expected/command-targetType-matching-domain-debuggableType.json-result: Added.
* inspector/scripts/tests/generic/expected/commands-with-async-attribute.json-result:
* inspector/scripts/tests/generic/expected/commands-with-optional-call-return-parameters.json-result:
* inspector/scripts/tests/generic/expected/domain-debuggableTypes.json-result: Added.
* inspector/scripts/tests/generic/expected/domain-targetType-matching-domain-debuggableType.json-result: Added.
* inspector/scripts/tests/generic/expected/domain-targetTypes.json-result: Added.
* inspector/scripts/tests/generic/expected/domains-with-varying-command-sizes.json-result:
* inspector/scripts/tests/generic/expected/enum-values.json-result:
* inspector/scripts/tests/generic/expected/event-targetType-matching-domain-debuggableType.json-result: Added.
* inspector/scripts/tests/generic/expected/events-with-optional-parameters.json-result:
* inspector/scripts/tests/generic/expected/fail-on-command-targetType-matching-domain-debuggableType.json-error: Added.
* inspector/scripts/tests/generic/expected/fail-on-command-targetTypes-type.json-error: Added.
* inspector/scripts/tests/generic/expected/fail-on-command-targetTypes-value.json-error: Added.
* inspector/scripts/tests/generic/expected/fail-on-domain-availability-type.json-error: Removed.
* inspector/scripts/tests/generic/expected/fail-on-domain-availability-value.json-error: Removed.
* inspector/scripts/tests/generic/expected/fail-on-domain-availability.json-error: Removed.
* inspector/scripts/tests/generic/expected/fail-on-domain-debuggableTypes-type.json-error: Added.
* inspector/scripts/tests/generic/expected/fail-on-domain-debuggableTypes-value.json-error: Added.
* inspector/scripts/tests/generic/expected/fail-on-domain-targetType-matching-domain-debuggableType.json-error: Added.
* inspector/scripts/tests/generic/expected/fail-on-domain-targetTypes-type.json-error: Added.
* inspector/scripts/tests/generic/expected/fail-on-domain-targetTypes-value.json-error: Added.
* inspector/scripts/tests/generic/expected/fail-on-event-targetType-matching-domain-debuggableType.json-error: Added.
* inspector/scripts/tests/generic/expected/fail-on-event-targetTypes-type.json-error: Added.
* inspector/scripts/tests/generic/expected/fail-on-event-targetTypes-value.json-error: Added.
* inspector/scripts/tests/generic/expected/generate-domains-with-feature-guards.json-result:
* inspector/scripts/tests/generic/expected/type-declaration-array-type.json-result:
* inspector/scripts/tests/generic/expected/type-declaration-enum-type.json-result:
* inspector/scripts/tests/generic/expected/type-declaration-object-type.json-result:
* inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result:
* inspector/scripts/tests/generic/expected/version.json-result:
* inspector/scripts/tests/generic/fail-on-command-targetType-matching-domain-debuggableType.json: Added.
* inspector/scripts/tests/generic/fail-on-command-targetTypes-type.json: Added.
* inspector/scripts/tests/generic/fail-on-command-targetTypes-value.json: Added.
* inspector/scripts/tests/generic/fail-on-domain-debuggableTypes-type.json: Added.
* inspector/scripts/tests/generic/fail-on-domain-debuggableTypes-value.json: Added.
* inspector/scripts/tests/generic/fail-on-domain-targetType-matching-domain-debuggableType.json: Added.
* inspector/scripts/tests/generic/fail-on-domain-targetTypes-type.json: Added.
* inspector/scripts/tests/generic/fail-on-domain-targetTypes-value.json: Added.
* inspector/scripts/tests/generic/fail-on-event-targetType-matching-domain-debuggableType.json: Added.
* inspector/scripts/tests/generic/fail-on-event-targetTypes-type.json: Added.
* inspector/scripts/tests/generic/fail-on-event-targetTypes-value.json: Added.
* inspector/scripts/tests/mac/expected/definitions-with-mac-platform.json-result:
Update test results, as well as added new tests for `debuggableTypes` and `targetTypes`.

Source/WebCore:

* inspector/InspectorFrontendClient.h:
(WebCore::InspectorFrontendClient::backendCommandsURL): Deleted.
(WebCore::InspectorFrontendClient::debuggableType): Deleted.
* inspector/InspectorFrontendClientLocal.h:
* page/PageDebuggable.h:
(WebCore::PageDebuggable::type const):
* testing/Internals.cpp:
(WebCore::InspectorStubFrontend::debuggableType const): Added.
Split the `Web` debuggable type into `Page` (WebCore::Page) and `WebPage` (WebKit::WebPageProxy).

Source/WebInspectorUI:

`InspectorBackend.domains.${domain}` isn't a truly valid way to feature check, as it
indicates what's supported by the WebKit framework underlying whatever's currently being
inspected, not what the current inspection target supports.

As an example, inspecting an iOS `JSContext` will still show `InspectorBackend.domains.DOM`
as the `DOMAgent` is supported by WebKit, even though `JSContext`s have no concept of the
DOM. In this example, however, `window.DOMAgent` would NOT exist, as the `availability`
check for the `DOM` domain wouldn't pass, meaning that the agent never gets connected.

In order to do proper feature checking, `InspectorBackend.domains` needs to be accurate
depending on the debuggable type. Furthermore, each target underneath that debuggable needs
to be able to "choose" what commands/events are supported based on that target's type.

This patch modifies how InspectorBackendCommands.js ties into `InspectorBackend`. Rather
than directly creating an `InspectorBackend.Agent` for each domain, we now create more of a
"blueprint" of the domain, and wait to actually create an `InspectorBackend.Agent` until we
have a `WI.Target` (and therefore an `InspectorBackend.Connection`). Each "concept" of the
protocol now directly maps to an object.
 - InspectorBackend.Domain
 - InspectorBackend.Command
 - InspectorBackend.Event
 - InspectorBackend.Dispatcher
When a `WI.Target` is created, it gets the list of `InspectorBackend.Domain` that support
that `WI.Target`'s type (specified in the protocol JSON files) and generates an
`InspectorBackend.Agent` for each, which in turn generates an `InspectorBackend.Callable`
for each supported `InspectorBackend.Command` and instantiates `InspectorBackend.Dispatcher`.

Activating a `InspectorBackend.Domain` means it's visible for `InspectorBackend` feature
checking. This must be done this way for older ITML backends that will still appear as
"JSContext" targets and therefore go through the "extra domains" path. Ideally, the process
of registering a domain should be enough to activate it. <https://webkit.org/b/201150>

Feature checking can now only be done via `hasDomain`, `hasCommand`, and `hasEvent` on
`InspectorBackend` or a specific `WI.Target`, and there are different implications for each:
 - `InspectorBackend.hasDomain(DOM)` asks whether the `DOM` domain is supported by the
   current debuggable, but says nothing about whether any `WI.Target` support `DOM`.
 - `target.hasDomain("DOM")` asks whether the given `target` supports `DOM`, which is
   limited by `InspectorBackend.hasDomain("DOM")`.

Now that `InspectorBackend.Agent` is only created by a `WI.Target`, it's no longer valid to
write `window.DOMAgent`, as there is no "global" agent. All protocol logic _must_ go through
a `WI.Target`. <https://webkit.org/b/201149>

Debuggable Types:
 - JavaScript (JSC::JSGlobalObject)
 - Page (WebCore::Page)
 - ServiceWorker (WebCore::ServiceWorkerThreadProxy)
 - WebPage (WebKit::WebPageProxy)

Target Types:
 - JavaScript (direct connection)
 - Page (multi-target connection to any Worker)
 - ServiceWorker (direct connection)
 - WebPage (multi-target connection to 1+ Page)
 - Worker (direct connection, only available for Page debuggables)

* UserInterface/Base/DebuggableType.js:
* UserInterface/Base/TargetType.js: Copied from Source/WebInspectorUI/UserInterface/Base/DebuggableType.js.
* UserInterface/Protocol/Connection.js:
* UserInterface/Protocol/InspectorBackend.js:

* UserInterface/Protocol/ApplicationCacheObserver.js:
* UserInterface/Protocol/CPUProfilerObserver.js:
* UserInterface/Protocol/CSSObserver.js:
* UserInterface/Protocol/CanvasObserver.js:
* UserInterface/Protocol/ConsoleObserver.js:
* UserInterface/Protocol/DOMObserver.js:
* UserInterface/Protocol/DOMStorageObserver.js:
* UserInterface/Protocol/DatabaseObserver.js:
* UserInterface/Protocol/DebuggerObserver.js:
* UserInterface/Protocol/HeapObserver.js:
* UserInterface/Protocol/InspectorObserver.js:
* UserInterface/Protocol/LayerTreeObserver.js:
* UserInterface/Protocol/MemoryObserver.js:
* UserInterface/Protocol/NetworkObserver.js:
* UserInterface/Protocol/PageObserver.js:
* UserInterface/Protocol/RuntimeObserver.js:
* UserInterface/Protocol/ScriptProfilerObserver.js:
* UserInterface/Protocol/TargetObserver.js:
* UserInterface/Protocol/TimelineObserver.js:
* UserInterface/Protocol/WorkerObserver.js:
All observers now extend from `InspectorBackend.Dispatcher` and have a separate instance for
each `InspectorBackend.Agent`, each having their own `_target`.

* UserInterface/Protocol/Target.js:
* UserInterface/Protocol/DirectBackendTarget.js:
* UserInterface/Protocol/JavaScriptContextTarget.js: Removed.
* UserInterface/Protocol/MultiplexingBackendTarget.js:
* UserInterface/Protocol/PageTarget.js:
* UserInterface/Protocol/WorkerTarget.js:
Agents are now created per-target instead of copied from the "global" list. This means that
agents can have a different set of commands/events depending on the associated target.

* UserInterface/Base/Main.js:
* UserInterface/Base/Utilities.js:
* UserInterface/Controllers/AppController.js:
* UserInterface/Controllers/AppControllerBase.js:
* UserInterface/Controllers/ApplicationCacheManager.js:
* UserInterface/Controllers/AuditManager.js:
* UserInterface/Controllers/BreakpointPopoverController.js:
* UserInterface/Controllers/CSSManager.js:
* UserInterface/Controllers/CanvasManager.js:
* UserInterface/Controllers/ConsoleManager.js:
* UserInterface/Controllers/DOMDebuggerManager.js:
* UserInterface/Controllers/DOMManager.js:
* UserInterface/Controllers/DOMStorageManager.js:
* UserInterface/Controllers/DatabaseManager.js:
* UserInterface/Controllers/DebuggerManager.js:
* UserInterface/Controllers/HeapManager.js:
* UserInterface/Controllers/IndexedDBManager.js:
* UserInterface/Controllers/JavaScriptLogViewController.js:
* UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
* UserInterface/Controllers/LayerTreeManager.js:
* UserInterface/Controllers/MemoryManager.js:
* UserInterface/Controllers/NetworkManager.js:
* UserInterface/Controllers/RuntimeManager.js:
* UserInterface/Controllers/TargetManager.js:
* UserInterface/Controllers/TimelineManager.js:
* UserInterface/Controllers/WorkerManager.js:
* UserInterface/Main.html:
* UserInterface/Models/AuditTestBase.js:
* UserInterface/Models/AuditTestCase.js:
* UserInterface/Models/AuditTestCaseResult.js:
* UserInterface/Models/CPUInstrument.js:
* UserInterface/Models/CPUTimelineRecord.js:
* UserInterface/Models/CSSCompletions.js:
* UserInterface/Models/CSSStyleSheet.js:
* UserInterface/Models/Canvas.js:
* UserInterface/Models/DOMNode.js:
* UserInterface/Models/DOMNodeStyles.js:
* UserInterface/Models/DOMStorageObject.js:
* UserInterface/Models/DOMTree.js:
* UserInterface/Models/DatabaseObject.js:
* UserInterface/Models/FPSInstrument.js:
* UserInterface/Models/GarbageCollection.js:
* UserInterface/Models/HeapAllocationsInstrument.js:
* UserInterface/Models/Instrument.js:
* UserInterface/Models/MediaInstrument.js:
* UserInterface/Models/MemoryInstrument.js:
* UserInterface/Models/MemoryPressureEvent.js:
* UserInterface/Models/MemoryTimelineRecord.js:
* UserInterface/Models/Recording.js:
* UserInterface/Models/Resource.js:
* UserInterface/Models/ScriptInstrument.js:
* UserInterface/Models/ScriptSyntaxTree.js:
* UserInterface/Models/ScriptTimelineRecord.js:
* UserInterface/Models/ShaderProgram.js:
* UserInterface/Models/SourceMapResource.js:
* UserInterface/Models/TimelineRecording.js:
* UserInterface/Protocol/RemoteObject.js:
* UserInterface/Test.html:
* UserInterface/Test/FrontendTestHarness.js:
* UserInterface/Test/Test.js:
* UserInterface/Test/TestAppController.js:
* UserInterface/Views/AuditNavigationSidebarPanel.js:
* UserInterface/Views/AuditTabContentView.js:
* UserInterface/Views/CanvasTabContentView.js:
* UserInterface/Views/ContextMenuUtilities.js:
* UserInterface/Views/CookieStorageContentView.js:
* UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
* UserInterface/Views/DOMTreeContentView.js:
* UserInterface/Views/ElementsTabContentView.js:
* UserInterface/Views/IndexedDatabaseDetailsSidebarPanel.js:
* UserInterface/Views/Layers3DContentView.js:
* UserInterface/Views/LayersTabContentView.js:
* UserInterface/Views/LayoutTimelineView.js:
* UserInterface/Views/LogContentView.js:
* UserInterface/Views/NetworkTabContentView.js:
* UserInterface/Views/NetworkTableContentView.js:
* UserInterface/Views/NetworkTimelineView.js:
* UserInterface/Views/ObjectTreeView.js:
* UserInterface/Views/QuickConsole.js:
* UserInterface/Views/ResourceDetailsSidebarPanel.js:
* UserInterface/Views/ScriptClusterTimelineView.js:
* UserInterface/Views/ScriptDetailsTimelineView.js:
* UserInterface/Views/ScriptTreeElement.js:
* UserInterface/Views/SearchSidebarPanel.js:
* UserInterface/Views/SearchTabContentView.js:
* UserInterface/Views/SettingsTabContentView.js:
* UserInterface/Views/SourceCodeTextEditor.js:
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
* UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js:
* UserInterface/Views/SpreadsheetStyleProperty.js:
* UserInterface/Views/StorageTabContentView.js:
* UserInterface/Views/TimelineRecordingContentView.js:
* UserInterface/Views/TimelineTabContentView.js:
* UserInterface/Views/Toolbar.js:
* UserInterface/Views/WebSocketContentView.js:
* UserInterface/Views/WorkerTreeElement.js:
Replace all instances of `window.DomainAgent` with `target.DomainAgent`, where `target` is
either derived from an associated model object or `WI.assumingMainTarget()`.
Split the `WI.DebuggableType.Web` debuggable type into `WI.DebuggableType.Page` (WebCore::Page)
and `WI.DebuggableType.WebPage` (WebKit::WebPageProxy).

* UserInterface/Protocol/Legacy/*:
* Versions/*:
Update protocol files for older versions of iOS.

* .eslintrc:
* Localizations/en.lproj/localizedStrings.js:

Source/WebKit:

* WebProcess/WebPage/RemoteWebInspectorUI.h:
(WebKit::WebInspectorUI::backendCommandsURL const): Added.
(WebKit::WebInspectorUI::debuggableType const): Added.
(WebKit::WebInspectorUI::backendCommandsURL): Deleted.
(WebKit::WebInspectorUI::debuggableType): Deleted.
* WebProcess/WebPage/WebInspectorUI.h:
(WebKit::WebInspectorUI::backendCommandsURL const): Added.
(WebKit::WebInspectorUI::debuggableType const): Added.
* UIProcess/WebPageDebuggable.h:
(WebKit::WebPageDebuggable::type const):
* UIProcess/glib/RemoteInspectorClient.cpp:
(WebKit::RemoteInspectorClient::RemoteInspectorClient):
* UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.h:
* UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm:
(debuggableTypeString):
Split the `Web` debuggable type into `Page` (WebCore::Page) and `WebPage` (WebKit::WebPageProxy).

Source/WebKitLegacy/mac:

* WebCoreSupport/WebInspectorClient.h:
(WebInspectorFrontendClient::debuggableType const): Added.
Split the `Web` debuggable type into `Page` (WebCore::Page) and `WebPage` (WebKit::WebPageProxy).

Source/WebKitLegacy/win:

* WebCoreSupport/WebInspectorClient.h:
(WebInspectorFrontendClient::debuggableType const): Added.
Split the `Web` debuggable type into `Page` (WebCore::Page) and `WebPage` (WebKit::WebPageProxy).

LayoutTests:

* inspector/canvas/requestShaderSource-webgl.html:
* inspector/canvas/updateShader-webgl:
* inspector/page/overrideSetting.html:
* inspector/page/overrideSetting-ICECandidateFilteringEnabled.html:
* inspector/page/overrideSetting-MockCaptureDevicesEnabled.html:
* inspector/runtime/parse.html:
Replace all instances of `DomainAgent.Enum` with `InspectorBackend.domains.Domain.Enum`.

* inspector/audit/run.html:
* inspector/audit/version.html:
* inspector/recording/version.html:
Use new `InspectorBackend` methods.

* inspector/unit-tests/target-manager.html:
* inspector/unit-tests/target-manager-expected.txt:
* inspector/worker/console-basic.html:
* inspector/worker/debugger-pause.html:
* inspector/worker/debugger-scripts.html:
* inspector/worker/debugger-shared-breakpoint.html:
* inspector/worker/resources-in-worker.html:
* inspector/worker/resources/dom-debugger-utilities.js:
* inspector/worker/runtime-basic.html:
* http/tests/inspector/worker/blob-script-with-cross-domain-imported-scripts.html:
Replace `WI.Target.Type` with `WI.TargetType`.

* inspector/dom/inspect.html:
* inspector/dom/inspect-expected.txt:
Rewrite test since faking events from the backend now requires a target.

* inspector/unit-tests/set-utilities.html:
* inspector/unit-tests/set-utilities-expected.txt:
Add tests for `Set.prototype.addAll`.

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

9 months agoReduce the amount of memory needed to store Options.
mark.lam@apple.com [Thu, 17 Oct 2019 05:45:58 +0000 (05:45 +0000)]
Reduce the amount of memory needed to store Options.
https://bugs.webkit.org/show_bug.cgi?id=202105

Reviewed by Yusuke Suzuki.

The size of the JSC::Config needed to store the Options is now reduced to 4K
instead of 16K, enabled by constexpr template magic.

1. Instead of all options in a large array of OptionEntry (which is a union of
   all the option types), we now have separate arrays for each of the types of
   options.  For example,

        Removed g_jscConfig.options[].
        Added g_jscConfig.typeBoolOptions[].
        Added g_jscConfig.typeInt32Options[].
        Added g_jscConfig.typeDoubleOptions[].
        ...

   We used to find the storage for the option using g_jscConfig.options[Options::ID].
   We now find the storage for each type of option using
   g_jscConfig.options[optionTypeSpecificIndex<OptionTypeID, OptionID>()].  For
   example, Options::useJIT() used to be implemented as:

       inline bool& Options::useJIT()
       {
            return g_jscConfig.options[Options::useJITID];
       }

   ... which is now replaced with:

       inline bool& Options::useJIT()
       {
            return g_jscConfig.typeBoolOptions[optionTypeSpecificIndex<OptionTypeID::Bool, OptionID::useJIT>()];
       }

   MSVC has a bug where it cannot handle very large source files: see
   https://developercommunity.visualstudio.com/content/problem/653301/fatal-error-c1002-compiler-is-out-of-heap-space-in.html.
   This bug prevents this patch from building on MSVC.  To workaround this bug,
   we don't inline the Options accessors when COMPILER(MSVC).  This prevents MSVC
   from having to parse the large body of template code code to used to implement
   the inline accessors in every file that #include "Options.h".

   Also add the @no-unify attribute to Options.cpp (where we put the accessors)
   so that it doesn't trigger the MSVC bug also.

2. Introduce the optionTypeSpecificIndex() constexpr template function for
   computing the index of each option in their respective type specific options
   array.

3. Introduce OptionTypes, OptionTypeID, and OptionID.

   The OptionTypes namespace replaces OptionEntry as the container of option types.
   The OptionID enum class replaces Options::ID.
   The OptionTypeID enum class is new and is used together with OptionID in
       constexpr templates to compute the typeSpecificIndex of options.

4. Removed the OptionEntry struct and OptionEntry.h.  After (1), this struct is
   only used in the Option class.  We just moved the union of option types (that
   OptionEntry embeds) into the Option class.

   Moved class OptionRange into OptionsList.h.

5. Removed the large OptionEntry arrays from JSC::Config.
   Added type specific options arrays.
   Also ordered these arrays to maximize compactness and minimize internal fragmentation.

6. Changed scaleJITPolicy() to go directly to g_jscConfig.typeInt32Options[]
   instead of going through the Option wrapper object.  This allows us to simplify
   things and make the Option class a read only interface of options.

7. Changed Options::initialize() to only compute the option default value once.
   The default value specified in the OptionsList may not always be a constant.
   Sometimes, it is a function call.

8. The Option class now only gives read only access to the options.

   The Option class' role is to provide an interface for reading an option at any
   given OptionID without first knowing about the type of the specific option.
   It is useful for iterating options, and is currently only used by
   Options::dumpOption().

   Technically, we could merge all the Option class code into its single client.
   We opted not to do this because the amount of code is non-trivial, and the
   Option class does a good job of encapsulating this functionality.

* API/glib/JSCOptions.cpp:
(jscOptionsSetValue):
(jscOptionsGetValue):
(jsc_options_foreach):
(jsc_options_get_option_group):
* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* runtime/JSCConfig.h:
* runtime/OptionEntry.h: Removed.
* runtime/Options.cpp:
(JSC::Options::isAvailable):
(JSC::overrideOptionWithHeuristic):
(JSC::optionTypeSpecificIndex):
(JSC::scaleJITPolicy):
(JSC::recomputeDependentOptions):
(JSC::Options::initialize):
(JSC::Options::setOptionWithoutAlias):
(JSC::Options::dumpAllOptions):
(JSC::Options::dumpOption):
(JSC::Option::Option):
(JSC::Option::defaultOption const):
(JSC::Option::dump const):
(JSC::Option::operator== const):
* runtime/Options.h:
(JSC::Option::id const):
(JSC::Option::name const):
(JSC::Option::description const):
(JSC::Option::type const):
(JSC::Option::availability const):
(JSC::Option::isOverridden const):
(JSC::Option::Option):
(JSC::Option::idIndex const):
(JSC::optionTypeSpecificIndex):
(JSC::Option::defaultOption const): Deleted.
(JSC::Option::boolVal): Deleted.
(JSC::Option::unsignedVal): Deleted.
(JSC::Option::doubleVal): Deleted.
(JSC::Option::int32Val): Deleted.
(JSC::Option::optionRangeVal): Deleted.
(JSC::Option::optionStringVal): Deleted.
(JSC::Option::gcLogLevelVal): Deleted.
* runtime/OptionsList.h:
(JSC::OptionRange::operator= ):
(JSC::OptionRange::rangeString const):
(JSC::countNumberOfJSCOptionsOfType):

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

9 months agoUnreviewed, fix iOS Debug build after r251220.
cdumez@apple.com [Thu, 17 Oct 2019 03:03:59 +0000 (03:03 +0000)]
Unreviewed, fix iOS Debug build after r251220.

* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

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

9 months ago[Clipboard API] [iOS] Refactor logic for suppressing URL data when the pasteboard...
wenson_hsieh@apple.com [Thu, 17 Oct 2019 02:59:26 +0000 (02:59 +0000)]
[Clipboard API] [iOS] Refactor logic for suppressing URL data when the pasteboard may contain files
https://bugs.webkit.org/show_bug.cgi?id=203065

Reviewed by Tim Horton.

Platform-specific pasteboard refactoring before tackling webkit.org/b/203021. See below for details. No new
tests, as there is no change in behavior.

* platform/Pasteboard.h:
(WebCore::Pasteboard::changeCount const):

Add a stub for Pasteboard::changeCount() on non-Cocoa platforms.

* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::safeTypeForDOMToReadAndWriteForPlatformType):

Move this helper function farther up the file, so it can be used in more places.

(WebCore::webSafeTypes):

Add a separate helper to compute the list of web-safe MIME types (for instance, "text/plain") given a list of
platform types, and a function to determine whether to avoid exposing a given URL to the DOM.

(WebCore::shouldTreatAtLeastOneTypeAsFile):

Split this out into a separate helper function, so that it can be invoked when determining whether a given
NSItemProvider is suspected to contain file paths. In the case where we're getting the full list of types that
are safe for the DOM to read, we want to pass in the entire pasteboard object and iterate through all of the
available types in search for something that could feasibly accompany a file URL.

In the case of computing the web-safe types per item, we only have an item provider, in which case we only
iterate through the types in that NSItemProvider. See call sites below for examples.

(WebCore::PlatformPasteboard::informationForItemAtIndex):

Invoke the new `webSafeTypes` helper method.

(WebCore::pasteboardMayContainFilePaths):
(WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):

Invoke the new `webSafeTypes` helper method.

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

9 months ago[Quick Look] Test that legacy web views load previews before deciding content policy
aestes@apple.com [Thu, 17 Oct 2019 02:45:08 +0000 (02:45 +0000)]
[Quick Look] Test that legacy web views load previews before deciding content policy
https://bugs.webkit.org/show_bug.cgi?id=202971

Reviewed by Alex Christensen.

* TestWebKitAPI/Tests/WebKitCocoa/QuickLook.mm:
(-[QuickLookLegacyDelegate webView:decidePolicyForMIMEType:request:frame:decisionListener:]):
(TEST):
(-[QuickLookFrameLoadDelegate webView:didFinishLoadForFrame:]): Deleted.

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

9 months agoPass network cache directory in WebsiteDataStore::parameters() for non-Cocoa platforms.
emilio@crisal.io [Thu, 17 Oct 2019 02:42:29 +0000 (02:42 +0000)]
Pass network cache directory in WebsiteDataStore::parameters() for non-Cocoa platforms.
https://bugs.webkit.org/show_bug.cgi?id=203043

This was causing various errors in the network process that were
visible in debug builds.

Reviewed by Alex Christensen.

* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::parameters):

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

9 months ago[FTW] Correct radial gradient handling of various radius orderings
bfulgham@apple.com [Thu, 17 Oct 2019 01:53:17 +0000 (01:53 +0000)]
[FTW] Correct radial gradient handling of various radius orderings
https://bugs.webkit.org/show_bug.cgi?id=202815

Reviewed by Per Arne Vollan.

Revise the 'generateGradient' implementation to recognize that the
radius arguments might not be in increasing order. Direct2D's
implementation does expect this, so we need to swap order and
revise the gradient range to match.

Drive-by fix: Stop building unused image decoders if building with
the Apple stack.

* PlatformFTW.cmake: Stop building unused image decoders.
* platform/graphics/win/GradientDirect2D.cpp:
(WebCore::Gradient::generateGradient):

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

9 months agoRename PageCache to BackForwardCache
cdumez@apple.com [Thu, 17 Oct 2019 01:44:16 +0000 (01:44 +0000)]
Rename PageCache to BackForwardCache
https://bugs.webkit.org/show_bug.cgi?id=203048

Reviewed by Alex Christensen.

Rename PageCache to BackForwardCache for clarity and consistency with the UIProcess's WebBackForwardCache.

Source/WebCore:

* Modules/geolocation/Geolocation.cpp:
(WebCore::Geolocation::suspend):
* Modules/mediarecorder/MediaRecorder.cpp:
(WebCore::MediaRecorder::canSuspendForDocumentSuspension const):
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::suspend):
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::suspend):
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::canSuspendForDocumentSuspension const):
* bindings/js/WindowProxy.cpp:
(WebCore::WindowProxy::clearJSWindowProxiesNotMatchingDOMWindow):
* bindings/js/WindowProxy.h:
* dom/ActiveDOMObject.h:
* dom/Document.cpp:
(WebCore::Document::~Document):
(WebCore::Document::scheduleStyleRecalc):
(WebCore::Document::needsStyleRecalc const):
(WebCore::Document::invalidateMatchedPropertiesCacheAndForceStyleRecalc):
(WebCore::Document::createRenderTree):
(WebCore::Document::didBecomeCurrentDocumentInFrame):
(WebCore::Document::attachToCachedFrame):
(WebCore::Document::detachFromCachedFrame):
(WebCore::Document::prepareForDestruction):
(WebCore::Document::adjustFocusedNodeOnNodeRemoval):
(WebCore::Document::setFocusedElement):
(WebCore::Document::takeDOMWindowFrom):
(WebCore::Document::setBackForwardCacheState):
(WebCore::Document::suspend):
(WebCore::Document::resume):
(WebCore::Document::topDocument const):
* dom/Document.h:
(WebCore::Document::backForwardCacheState const):
* dom/FullscreenManager.cpp:
(WebCore::FullscreenManager::willEnterFullscreen):
(WebCore::FullscreenManager::didEnterFullscreen):
(WebCore::FullscreenManager::willExitFullscreen):
(WebCore::FullscreenManager::didExitFullscreen):
* dom/FullscreenManager.h:
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::suspendActiveDOMObjects):
(WebCore::ScriptExecutionContext::resumeActiveDOMObjects):
* history/BackForwardCache.cpp: Renamed from Source/WebCore/history/PageCache.cpp.
(WebCore::logBackForwardCacheFailureDiagnosticMessage):
(WebCore::canCacheFrame):
(WebCore::canCachePage):
(WebCore::BackForwardCache::singleton):
(WebCore::BackForwardCache::BackForwardCache):
(WebCore::BackForwardCache::dump const):
(WebCore::BackForwardCache::canCache const):
(WebCore::BackForwardCache::pruneToSizeNow):
(WebCore::BackForwardCache::setMaxSize):
(WebCore::BackForwardCache::frameCount const):
(WebCore::BackForwardCache::markPagesForDeviceOrPageScaleChanged):
(WebCore::BackForwardCache::markPagesForContentsSizeChanged):
(WebCore::BackForwardCache::markPagesForCaptionPreferencesChanged):
(WebCore::setBackForwardCacheState):
(WebCore::BackForwardCache::addIfCacheable):
(WebCore::BackForwardCache::take):
(WebCore::BackForwardCache::removeAllItemsForPage):
(WebCore::BackForwardCache::get):
(WebCore::BackForwardCache::remove):
(WebCore::BackForwardCache::prune):
* history/BackForwardCache.h: Renamed from Source/WebCore/history/PageCache.h.
* history/CachedFrame.cpp:
(WebCore::CachedFrameBase::restore):
(WebCore::CachedFrame::CachedFrame):
(WebCore::CachedFrame::clear):
(WebCore::CachedFrame::destroy):
* history/CachedFramePlatformData.h:
* history/HistoryItem.cpp:
(WebCore::HistoryItem::setCachedPage):
(WebCore::HistoryItem::setURL):
* history/HistoryItem.h:
(WebCore::HistoryItem::isInBackForwardCache const):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::suspend):
(WebCore::HTMLMediaElement::resume):
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::createElementRenderer):
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::suspend):
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::autoplayPermitted const):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::addSubresourceLoader):
* loader/DocumentLoader.h:
* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::closeURL):
(WebCore::FrameLoader::clear):
(WebCore::FrameLoader::stopAllLoaders):
(WebCore::FrameLoader::stopForBackForwardCache):
(WebCore::FrameLoader::commitProvisionalLoad):
(WebCore::FrameLoader::open):
(WebCore::FrameLoader::frameDetached):
(WebCore::FrameLoader::detachFromParent):
(WebCore::FrameLoader::receivedMainResourceError):
(WebCore::FrameLoader::shouldPerformFragmentNavigation):
(WebCore::FrameLoader::dispatchUnloadEvents):
(WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
(WebCore::FrameLoader::loadProvisionalItemFromCachedPage):
(WebCore::FrameLoader::loadDifferentDocumentItem):
* loader/FrameLoader.h:
* loader/FrameLoaderClient.h:
* loader/HistoryController.cpp:
(WebCore::HistoryController::saveScrollPositionAndViewStateToItem):
(WebCore::HistoryController::restoreScrollPositionAndViewState):
(WebCore::HistoryController::invalidateCurrentItemCachedPage):
(WebCore::HistoryController::updateForReload):
* loader/appcache/ApplicationCacheHost.cpp:
(WebCore::ApplicationCacheHost::canCacheInBackForwardCache):
* loader/appcache/ApplicationCacheHost.h:
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::load):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::suspendForBackForwardCache):
(WebCore::DOMWindow::resumeFromBackForwardCache):
(WebCore::DOMWindow::decrementScrollEventListenersCount):
* page/DOMWindow.h:
* page/DOMWindowExtension.cpp:
(WebCore::DOMWindowExtension::suspendForBackForwardCache):
(WebCore::DOMWindowExtension::resumeFromBackForwardCache):
* page/DOMWindowExtension.h:
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::backForwardCacheKey):
(WebCore::DiagnosticLoggingKeys::backForwardCacheFailureKey):
* page/DiagnosticLoggingKeys.h:
* page/EventSource.cpp:
(WebCore::EventSource::scheduleReconnect):
(WebCore::EventSource::didReceiveResponse):
(WebCore::EventSource::didReceiveData):
(WebCore::EventSource::didFinishLoading):
(WebCore::EventSource::didFail):
(WebCore::EventSource::abortConnectionAttempt):
(WebCore::EventSource::suspend):
(WebCore::EventSource::resume):
(WebCore::EventSource::dispatchMessageEvent):
* page/EventSource.h:
* page/Frame.cpp:
(WebCore::Frame::setView):
(WebCore::Frame::setDocument):
(WebCore::Frame::willDetachPage):
* page/FrameView.cpp:
(WebCore::FrameView::didRestoreFromBackForwardCache):
(WebCore::FrameView::setContentsSize):
* page/FrameView.h:
* page/FrameViewLayoutContext.cpp:
(WebCore::FrameViewLayoutContext::layout):
(WebCore::FrameViewLayoutContext::scheduleLayout):
* page/MemoryRelease.cpp:
(WebCore::releaseCriticalMemory):
(WebCore::releaseMemory):
* page/MemoryRelease.h:
* page/Page.cpp:
(WebCore::Page::~Page):
(WebCore::Page::setViewScaleFactor):
(WebCore::Page::setDeviceScaleFactor):
* page/Page.h:
* page/PageGroup.cpp:
(WebCore::PageGroup::captionPreferencesChanged):
* page/PerformanceLogging.cpp:
(WebCore::PerformanceLogging::memoryUsageStatistics):
* page/Settings.yaml:
* page/SettingsBase.cpp:
(WebCore::SettingsBase::usesBackForwardCacheChanged):
* page/SettingsBase.h:
* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::setNeedsStyleRecalc):
* page/animation/CSSAnimationController.cpp:
(WebCore::CSSAnimationControllerPrivate::updateAnimations):
(WebCore::CSSAnimationControllerPrivate::addElementChangeToDispatch):
(WebCore::CSSAnimationController::cancelAnimations):
(WebCore::CSSAnimationController::updateAnimations):
* page/animation/ImplicitAnimation.cpp:
(WebCore::ImplicitAnimation::sendTransitionEvent):
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::sendAnimationEvent):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimatorMac::notifyContentAreaScrolled):
(WebCore::ScrollAnimatorMac::updateScrollerStyle):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::paintIntoLayer):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingLayers):
(WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
(WebCore::RenderLayerCompositor::didAddScrollingLayer):
* rendering/RenderLayerCompositor.h:
* rendering/RenderObject.h:
* rendering/SimpleLineLayoutCoverage.cpp:
(WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlowsForCurrentPage):
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::createAnimatedElementUpdate):
* testing/Internals.cpp:
(WebCore::Internals::clearBackForwardCache):
(WebCore::Internals::backForwardCacheSize const):
(WebCore::Internals::preventDocumentForEnteringBackForwardCache):
* testing/Internals.h:
* testing/Internals.idl:
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::suspend):

Source/WebKit:

* Shared/CacheModel.cpp:
(WebKit::calculateMemoryCacheSizes):
* Shared/CacheModel.h:
* Shared/WebPreferences.yaml:
* UIProcess/API/APINavigationClient.h:
(API::NavigationClient::willGoToBackForwardListItem):
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetPageCacheEnabled):
(WKPreferencesGetPageCacheEnabled):
(WKPreferencesSetPageCacheSupportsPlugins):
(WKPreferencesGetPageCacheSupportsPlugins):
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _setUsesPageCache:]):
(-[WKPreferences _usesPageCache]):
(-[WKPreferences _setPageCacheSupportsPlugins:]):
(-[WKPreferences _pageCacheSupportsPlugins]):
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration pageCacheEnabled]):
(-[_WKProcessPoolConfiguration setPageCacheEnabled:]):
* UIProcess/API/glib/WebKitSettings.cpp:
(webkit_settings_get_enable_page_cache):
(webkit_settings_set_enable_page_cache):
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::setNavigationDelegate):
(WebKit::NavigationState::NavigationClient::willGoToBackForwardListItem):
(WebKit::NavigationState::NavigationClient::didStartProvisionalNavigation):
(WebKit::NavigationState::NavigationClient::didReceiveServerRedirectForProvisionalNavigation):
(WebKit::NavigationState::NavigationClient::didFailProvisionalNavigationWithError):
(WebKit::NavigationState::NavigationClient::didCommitNavigation):
(WebKit::NavigationState::NavigationClient::didFinishDocumentLoad):
(WebKit::NavigationState::NavigationClient::didFinishNavigation):
(WebKit::NavigationState::NavigationClient::didFailNavigationWithError):
(WebKit::NavigationState::NavigationClient::didSameDocumentNavigation):
* UIProcess/ViewGestureController.cpp:
(WebKit::ViewGestureController::didReachMainFrameLoadTerminalState):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::shouldUseBackForwardCache const):
(WebKit::WebPageProxy::willGoToBackForwardListItem):
(WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
(WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrameShared):
(WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
(WebKit::WebPageProxy::didFinishLoadForFrame):
(WebKit::WebPageProxy::didFailLoadForFrame):
(WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::updateBackForwardCacheCapacity):
* WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.cpp:
(WKBundleBackForwardListItemIsInBackForwardCache):
* WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.h:
* WebProcess/WebCoreSupport/SessionStateConversion.cpp:
(WebKit::toBackForwardListItemState):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::WebFrameLoaderClient):
(WebKit::WebFrameLoaderClient::shouldGoToHistoryItem const):
(WebKit::WebFrameLoaderClient::transitionToCommittedFromCachedFrame):
(WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
(WebKit::WebFrameLoaderClient::didRestoreFromBackForwardCache):
(WebKit::WebFrameLoaderClient::createPlugin):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
* WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm:
(WebKit::WebFrameLoaderClient::forceLayoutOnRestoreFromBackForwardCache):
* WebProcess/WebPage/VisitedLinkTableController.cpp:
* WebProcess/WebPage/WebBackForwardListProxy.cpp:
(WebKit::WebBackForwardListProxy::removeItem):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::suspendForProcessSwap):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
(WebKit::WebProcess::setCacheModel):
(WebKit::WebProcess::deleteWebsiteData):
(WebKit::WebProcess::setBackForwardCacheCapacity):
(WebKit::WebProcess::clearCachedPage):
* WebProcess/WebProcess.h:

Source/WebKitLegacy/ios:

* WebView/WebUIKitDelegate.h:

Source/WebKitLegacy/mac:

* History/BackForwardList.mm:
(BackForwardList::addItem):
(BackForwardList::setCapacity):
* History/WebBackForwardList.mm:
(-[WebBackForwardList pageCacheSize]):
* History/WebHistoryItem.mm:
* History/WebHistoryItemPrivate.h:
* Misc/WebCache.mm:
* Misc/WebCoreStatistics.mm:
(+[WebCoreStatistics cachedPageCount]):
(+[WebCoreStatistics cachedFrameCount]):
* WebCoreSupport/WebFrameLoaderClient.h:
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::forceLayoutOnRestoreFromBackForwardCache):
(WebFrameLoaderClient::didRestoreFromBackForwardCache):
* WebCoreSupport/WebVisitedLinkStore.mm:
* WebView/WebHTMLView.mm:
(-[WebHTMLView layoutToMinimumPageWidth:height:originalPageWidth:originalPageHeight:maximumShrinkRatio:adjustingViewSize:]):
(-[WebHTMLView setNeedsLayout:]):
(-[WebHTMLView setNeedsToApplyStyles:]):
* WebView/WebView.mm:
(-[WebView _close]):
(-[WebView _preferencesChanged:]):
(+[WebView _setCacheModel:]):

Source/WebKitLegacy/win:

* BackForwardList.cpp:
(BackForwardList::addItem):
(BackForwardList::setCapacity):
* WebCoreStatistics.cpp:
(WebCoreStatistics::cachedPageCount):
(WebCoreStatistics::cachedFrameCount):
* WebCoreSupport/WebFrameLoaderClient.cpp:
(WebFrameLoaderClient::didRestoreFromBackForwardCache):
* WebCoreSupport/WebFrameLoaderClient.h:
* WebCoreSupport/WebVisitedLinkStore.cpp:
* WebFrame.cpp:
(WebFrame::accessible const):
* WebView.cpp:
(WebView::setCacheModel):
(WebView::notifyPreferencesChanged):

Tools:

* DumpRenderTree/TestOptions.cpp:
(TestOptions::TestOptions):
* DumpRenderTree/TestOptions.h:
* DumpRenderTree/TestRunner.cpp:
(overridePreferenceCallback):
* DumpRenderTree/mac/DumpRenderTree.mm:
(setWebPreferencesForTestOptions):
* DumpRenderTree/win/DumpRenderTree.cpp:
(resetWebPreferencesToConsistentValues):
(setWebPreferencesForTestOptions):
* TestWebKitAPI/Tests/WebKit/DOMWindowExtensionBasic.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/DOMWindowExtensionNoCache.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/DOMWindowExtensionNoCache_Bundle.cpp:
(TestWebKitAPI::DOMWindowExtensionNoCache::willDisconnectDOMWindowExtensionFromGlobalObject):
(TestWebKitAPI::DOMWindowExtensionNoCache::didReconnectDOMWindowExtensionToGlobalObject):
* TestWebKitAPI/Tests/WebKit/DidRemoveFrameFromHiearchyInPageCache.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/DidRemoveFrameFromHiearchyInPageCache_Bundle.cpp:
(TestWebKitAPI::DidRemoveFrameFromHiearchyInBackForwardCacheTest::DidRemoveFrameFromHiearchyInBackForwardCacheTest):
(TestWebKitAPI::DidRemoveFrameFromHiearchyInBackForwardCacheTest::didCreatePage):
* TestWebKitAPI/Tests/WebKit/LayoutMilestonesWithAllContentInFrame.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
* TestWebKitAPI/Tests/WebKitGLib/TestWebKitSettings.cpp:
(testWebKitSettings):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::overridePreference):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):
(WTR::updateTestOptionsFromTestHeader):
* WebKitTestRunner/TestOptions.h:
(WTR::TestOptions::hasSameInitializationOptions const):
* lldb/lldb_webkit.py:
(WebCoreFrame_SummaryProvider):
(WebCoreDocument_SummaryProvider):
(WebCoreDocumentProvider.page_cache_state):

LayoutTests:

* animations/resume-after-page-cache.html:
* compositing/accelerated-layers-after-back.html:
* compositing/iframes/page-cache-layer-tree.html:
* compositing/page-cache-back-crash.html:
* compositing/show-composited-iframe-on-back-button.html:
* editing/mac/input/unconfirmed-text-navigation-with-page-cache.html:
* fast/canvas/webgl/canvas-webgl-page-cache.html:
* fast/css/fontloader-page-cache.html:
* fast/dom/DeviceMotion/no-page-cache.html:
* fast/dom/DeviceOrientation/event-after-navigation.html:
* fast/dom/DeviceOrientation/no-page-cache.html:
* fast/dom/Window/timer-resume-on-navigation-back.html:
* fast/events/onunload-back-to-page-cache.html:
* fast/events/pagehide-timeout.html:
* fast/events/pagehide-xhr-open.html:
* fast/events/pageshow-pagehide-on-back-cached-with-frames.html:
* fast/events/pageshow-pagehide-on-back-cached.html:
* fast/events/suspend-timers.html:
* fast/forms/autocomplete-off-with-default-value-does-not-clear.html:
* fast/frames/frame-crash-with-page-cache.html:
* fast/frames/frame-unload-navigate-and-setTimeout-assert-fail.html:
* fast/frames/page-hide-document-open.html:
* fast/frames/restoring-page-cache-should-not-run-scripts-via-style-update.html:
* fast/frames/restoring-page-cache-should-not-run-scripts.html:
* fast/harness/page-cache-crash-on-data-urls.html:
* fast/harness/use-page-cache.html:
* fast/history/back-from-page-with-focused-iframe.html:
* fast/history/go-back-to-iframe-with-plugin.html:
* fast/history/go-back-to-object-subframe.html:
* fast/history/history-back-while-pdf-in-pagecache.html:
* fast/history/page-cache-MessagePort-pending-message.html:
* fast/history/page-cache-after-window-open.html:
* fast/history/page-cache-back-navigation-crash.html:
* fast/history/page-cache-clearing-expected.txt:
* fast/history/page-cache-clearing.html:
* fast/history/page-cache-closed-audiocontext.html:
* fast/history/page-cache-createImageBitmap.html:
* fast/history/page-cache-createObjectURL-using-open-panel.html:
* fast/history/page-cache-createObjectURL.html:
* fast/history/page-cache-destroy-document.html:
* fast/history/page-cache-element-state-focused.html:
* fast/history/page-cache-execute-script-during-restore.html:
* fast/history/page-cache-geolocation-active-oneshot.html:
* fast/history/page-cache-geolocation-active-watcher.html:
* fast/history/page-cache-geolocation.html:
* fast/history/page-cache-iframe-js-url.html:
* fast/history/page-cache-indexed-closed-db.html:
* fast/history/page-cache-indexed-opened-db.html:
* fast/history/page-cache-media-source-closed-2.html:
* fast/history/page-cache-media-source-closed.html:
* fast/history/page-cache-media-source-opened.html:
* fast/history/page-cache-navigate-during-restore.html:
* fast/history/page-cache-notification-non-suspendable.html:
* fast/history/page-cache-notification-suspendable.html:
* fast/history/page-cache-removed-source-buffer.html:
* fast/history/page-cache-running-audiocontext.html:
* fast/history/page-cache-subframes-with-provisional-load.html:
* fast/history/page-cache-suspended-audiocontext.html:
* fast/history/page-cache-webdatabase-no-transaction-db.html:
* fast/history/page-cache-webdatabase-pending-transaction.html:
* fast/history/page-cache-with-opener.html:
* fast/history/pagehide-remove-iframe-crash.html:
* fast/history/resources/page-cache-window-with-iframe.html:
* fast/history/resources/page-cache-window-with-opener.html:
* fast/history/timed-refresh-in-cached-frame.html:
* fast/images/animated-gif-restored-from-bfcache.html:
* fast/loader/frames-with-unload-handlers-in-page-cache.html:
* fast/loader/image-in-page-cache.html:
* fast/loader/input-element-page-cache-crash.html:
* fast/loader/navigate-with-new-target-after-back-forward-navigation.html:
* fast/loader/navigate-with-post-to-new-target-after-back-forward-navigation.html:
* fast/loader/scroll-position-restored-on-back.html:
* fast/loader/stateobjects/no-popstate-when-back-to-stateless-entry-with-page-cache.html:
* fast/loader/stateobjects/popstate-fires-with-page-cache.html:
* fast/loader/unschedule-relayout-after-unload.html:
* fast/loader/window-properties-restored-from-page-cache.html:
* fast/mediastream/RTCPeerConnection-page-cache.html:
* fast/overflow/horizontal-scroll-after-back.html:
* fast/scrolling/iframe-scrollable-after-back.html:
* fast/scrolling/ios/scroll-events-back-forward-after-pageshow.html:
* fast/scrolling/ios/scroll-events-back-forward.html:
* fast/scrolling/ios/touch-scroll-back-forward.html:
* fast/scrolling/overflow-scrollable-after-back.html:
* fast/scrolling/page-cache-back-overflow-scroll-restore.html:
* fast/text-autosizing/ios/text-autosizing-after-back.html:
* fast/viewport/ios/viewport-shrink-to-fit-on-new-navigation.html:
* fast/viewport/viewport-128.html:
* fast/workers/worker-page-cache.html:
* http/tests/cache/display-image-unset-allows-cached-image-load.html:
* http/tests/eventsource/eventsource-page-cache-connected.html:
* http/tests/eventsource/eventsource-page-cache-connecting.html:
* http/tests/loading/main-resource-delegates-on-back-navigation.html:
* http/tests/loading/unfinished-load-back-to-cached-page-callbacks.html:
* http/tests/loading/unfinished-main-resource-back-to-cached-page-callbacks.html:
* http/tests/media/reload-after-dialog.html:
* http/tests/navigation/go-back-to-error-page.html:
* http/tests/navigation/https-in-page-cache.html:
* http/tests/navigation/https-no-store-subframe-in-page-cache.html:
* http/tests/navigation/image-load-in-pagehide-handler.html:
* http/tests/navigation/page-cache-domcache-pending-promise.html:
* http/tests/navigation/page-cache-domcachestorage-pending-promise.html:
* http/tests/navigation/page-cache-failed-xhr.html:
* http/tests/navigation/page-cache-fontfaceset.html:
* http/tests/navigation/page-cache-fragment-referrer.html:
* http/tests/navigation/page-cache-iframe-no-current-historyItem.html:
* http/tests/navigation/page-cache-iframe-provisional-load-async-delegates.html:
* http/tests/navigation/page-cache-iframe-provisional-load.html:
* http/tests/navigation/page-cache-pending-image-load-cache-partition.html:
* http/tests/navigation/page-cache-pending-image-load.html:
* http/tests/navigation/page-cache-pending-load.html:
* http/tests/navigation/page-cache-pending-ping-load-cross-origin.html:
* http/tests/navigation/page-cache-pending-ping-load-same-origin.html:
* http/tests/navigation/page-cache-requestAnimationFrame.html:
* http/tests/navigation/page-cache-xhr-in-pagehide.html:
* http/tests/navigation/page-cache-xhr.html:
* http/tests/navigation/resources/https-in-page-cache-3.html:
* http/tests/navigation/subframe-pagehide-handler-starts-load.html:
* http/tests/navigation/subframe-pagehide-handler-starts-load2.html:
* http/tests/security/cross-origin-window-open-insert-script.html:
* http/tests/security/cross-origin-window-open-javascript-url.html:
* http/tests/security/navigate-when-restoring-cached-page.html:
* http/tests/security/xss-DENIED-click-and-form-submission-from-inactive-domwindow.html:
* http/tests/security/xss-DENIED-script-inject-into-inactive-window.html:
* http/tests/security/xss-DENIED-script-inject-into-inactive-window2-pson.html:
* http/tests/security/xss-DENIED-script-inject-into-inactive-window2.html:
* http/tests/security/xss-DENIED-script-inject-into-inactive-window3.html:
* http/tests/websocket/tests/hybi/closed-when-entering-page-cache.html:
* http/tests/websocket/tests/hybi/stop-on-resume-in-error-handler.html:
* http/tests/workers/service/client-added-to-clients-when-restored-from-page-cache.html:
* http/tests/workers/service/client-removed-from-clients-while-in-page-cache.html:
* http/tests/workers/service/page-cache-service-worker-pending-promise.https.html:
* http/tests/workers/service/page-caching.html:
* http/wpt/beacon/support/sendBeacon-onpagehide-window.html:
* legacy-animation-engine/animations/resume-after-page-cache.html:
* loader/go-back-cached-main-resource.html:
* loader/go-back-to-different-window-size.html:
* media/crash-closing-page-with-media-as-plugin-fallback.html:
* media/media-source/media-source-page-cache.html:
* media/restore-from-page-cache.html:
* platform/ios/ios/fixed/fixed-back-forward.html:
* plugins/crash-restoring-plugin-page-from-page-cache.html:
* plugins/frameset-with-plugin-frame.html:
* plugins/netscape-plugin-page-cache-works.html:
* storage/indexeddb/IDBRequest-page-cache.html:
* storage/indexeddb/IDBTransaction-page-cache.html:
* swipe/basic-cached-back-swipe.html:
* swipe/main-frame-pinning-requirement.html:
* swipe/pushState-cached-back-swipe.html:
* swipe/pushState-programmatic-back-while-swiping-crash.html:
* swipe/pushstate-with-manual-scrollrestoration.html:
* tiled-drawing/scrolling/null-parent-back-crash.html:
* tiled-drawing/tiled-drawing-scroll-position-page-cache-restoration.html:
* webrtc/datachannel/datachannel-page-cache-send.html:
* webrtc/datachannel/datachannel-page-cache.html:

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

9 months ago[iOS] Remove ubiquity client rule from sandbox
pvollan@apple.com [Thu, 17 Oct 2019 00:36:52 +0000 (00:36 +0000)]
[iOS] Remove ubiquity client rule from sandbox
https://bugs.webkit.org/show_bug.cgi?id=201347

Reviewed by Brent Fulgham.

This rule is most likely not needed, since we have already blocked all of its associated mach services,
and no issues have been reported.

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

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

9 months agoiOS: inputmode=none is not respected with a hardware keyboard attached
timothy_horton@apple.com [Thu, 17 Oct 2019 00:15:28 +0000 (00:15 +0000)]
iOS: inputmode=none is not respected with a hardware keyboard attached
https://bugs.webkit.org/show_bug.cgi?id=203061

Reviewed by Daniel Bates.

Source/WebKit:

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView shouldShowAutomaticKeyboardUI]):
We can resolve this FIXME, as the underlying bug was fixed in <rdar://problem/52706523>.
This now means that we will respect inputmode=none even when a hardware
keyboard is attached, significantly improving the experience on sites that use it
by avoiding an intermittent input bar.

LayoutTests:

* fast/forms/ios/inputmode-none-with-hardware-keyboard.html: Added.
Clone inputmode-none.html to inputmode-none-with-hardware-keyboard.html
and remove the line to faux-detach the hardware keyboard.

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

9 months ago[iOS] Remove send-signal from mach-lookup rule
pvollan@apple.com [Wed, 16 Oct 2019 23:01:30 +0000 (23:01 +0000)]
[iOS] Remove send-signal from mach-lookup rule
https://bugs.webkit.org/show_bug.cgi?id=201203

Reviewed by Brent Fulgham.

The send-signal can be removed, since crashes have not been reported from this rule.

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

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

9 months agoAdd Swift modulemap for WebKit Private APIs
dino@apple.com [Wed, 16 Oct 2019 22:49:31 +0000 (22:49 +0000)]
Add Swift modulemap for WebKit Private APIs
https://bugs.webkit.org/show_bug.cgi?id=203059

Reviewed by Tim Horton.

Provide a Swift modulemap for WebKit_Private, and
ensure WKPreferencesPrivate.h is exposed.

Renamed OSX.modulemap to macOS.modulemap while here.

* Configurations/WebKit.xcconfig:
* Modules/iOS.private.modulemap: Added.
* Modules/macOS.modulemap: Renamed from Source/WebKit/Modules/OSX.modulemap.
* Modules/macOS.private.modulemap: Added.
* Shared/API/Cocoa/WebKitPrivate.h: Include WKPreferencesPrivate.h.

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

9 months agoPython 3: Add support in webkitpy.common.net.bugzilla
jbedard@apple.com [Wed, 16 Oct 2019 22:47:40 +0000 (22:47 +0000)]
Python 3: Add support in webkitpy.common.net.bugzilla
https://bugs.webkit.org/show_bug.cgi?id=202468

Reviewed by Stephanie Lewis.

Make the irc library we use Python 3 compatible.

* Scripts/test-webkitpy-python3: Add webkitpy.common.net.bugzilla to the test list.
* Scripts/webkitpy/thirdparty/irc/ircbot.py: Use full import paths.
* Scripts/webkitpy/thirdparty/irc/irclib.py: Fix exceptions, printing for Python 3.
(Connection._get_socket):
(ServerConnection.connect):
(ServerConnection.process_data):
(ServerConnection.disconnect):
(ServerConnection.send_raw):
(DCCConnection.connect):
(DCCConnection.listen):
(DCCConnection.disconnect):
(DCCConnection.process_data):
(DCCConnection.privmsg):

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

9 months agoResource Load Statistics (experimental): Block all third-party cookies on websites...
wilander@apple.com [Wed, 16 Oct 2019 22:38:55 +0000 (22:38 +0000)]
Resource Load Statistics (experimental): Block all third-party cookies on websites without prior user interaction
https://bugs.webkit.org/show_bug.cgi?id=203017
<rdar://problem/56262708>

Reviewed by Alex Christensen.

Source/WebCore:

NetworkStorageSession::shouldBlockCookies() now checks if the first-party website has
received user interaction and if not, blocks all third-party cookies, regardless of the
status of those third-party domains (prevalent or not).

Bundled cleanup task: Remove the two month old feature flag for NSURLSession switching.

Tests: http/tests/resourceLoadStatistics/third-party-cookie-blocking-on-sites-without-user-interaction-database.html
       http/tests/resourceLoadStatistics/third-party-cookie-blocking-on-sites-without-user-interaction.html

* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setIsITPSessionSwitchingEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::isITPSessionSwitchingEnabled const): Deleted.
* page/Settings.yaml:
* platform/network/NetworkStorageSession.cpp:
(WebCore::NetworkStorageSession::hasHadUserInteractionAsFirstParty const):
(WebCore::NetworkStorageSession::shouldBlockCookies const):
(WebCore::NetworkStorageSession::setDomainsWithUserInteractionAsFirstParty):
* platform/network/NetworkStorageSession.h:
(WebCore::NetworkStorageSession::setIsThirdPartyCookieBlockingOnSitesWithoutUserInteractionEnabled):

Source/WebKit:

This enhancement is off by default and controlled by an internal feature flag.

The functional change is in WebCore::NetworkStorageSession::shouldBlockCookies() which is
called from:
- NetworkDataTaskCocoa::NetworkDataTaskCocoa()
- NetworkDataTaskCocoa::willPerformHTTPRedirection

shouldBlockCookies() now checks if the first-party website has received user interaction
and if not, blocks all third-party cookies, regardless of the status of those third-party
domains (prevalent or not).

The changes to ResourceLoadStatisticsDatabaseStore and ResourceLoadStatisticsMemoryStore
are about communicating which domains have received user interaction (prevalent or not)
to the network storage session so that it can enforce the new restriction.

The C API change and piping through the WebsiteDataStore is test infrastructure.

Bundled cleanup task: Remove the two month old feature flag for NSURLSession switching.

* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
(WebKit::CompletionHandler<void):
* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::clear):
(WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlocking):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToBlockCookiesForHandler):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
(WebKit::RegistrableDomainsToBlockCookiesFor::isolatedCopy const):
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::NetworkProcess::setShouldBlockThirdPartyCookiesForTesting):
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::NetworkSession):
* NetworkProcess/NetworkSession.h:
(WebKit::NetworkSession::setResourceLoadStatisticsLogTestingEvent):
(WebKit::NetworkSession::shouldIsolateSessionsForPrevalentTopFrames const): Deleted.
* NetworkProcess/NetworkSessionCreationParameters.cpp:
(WebKit::NetworkSessionCreationParameters::encode const):
(WebKit::NetworkSessionCreationParameters::decode):
* NetworkProcess/NetworkSessionCreationParameters.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
* Shared/WebPreferences.yaml:
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetResourceLoadStatisticsShouldBlockThirdPartyCookiesForTesting):
(WKWebsiteDataStoreStatisticsResetToConsistentState):
* UIProcess/API/C/WKWebsiteDataStoreRef.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::setShouldBlockThirdPartyCookiesForTesting):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::setResourceLoadStatisticsShouldBlockThirdPartyCookiesForTesting):
* UIProcess/WebsiteData/WebsiteDataStore.h:

Tools:

These changes are test infrastructure to be able to toggle the function
through testRunner.setStatisticsShouldBlockThirdPartyCookies().

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::didReceiveMessageToPage):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setStatisticsShouldBlockThirdPartyCookies):
(WTR::TestRunner::statisticsCallDidSetShouldBlockThirdPartyCookiesCallback):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::setStatisticsShouldBlockThirdPartyCookies):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):
(WTR::TestInvocation::didSetShouldBlockThirdPartyCookies):
* WebKitTestRunner/TestInvocation.h:

LayoutTests:

* http/tests/resourceLoadStatistics/third-party-cookie-blocking-on-sites-without-user-interaction-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/third-party-cookie-blocking-on-sites-without-user-interaction-database.html: Added.
* http/tests/resourceLoadStatistics/third-party-cookie-blocking-on-sites-without-user-interaction-expected.txt: Added.
* http/tests/resourceLoadStatistics/third-party-cookie-blocking-on-sites-without-user-interaction.html: Added.

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

9 months agoWKWebsiteDataStoreStatisticsResetToConsistentState() should call store.setUseITPDatab...
commit-queue@webkit.org [Wed, 16 Oct 2019 22:16:29 +0000 (22:16 +0000)]
WKWebsiteDataStoreStatisticsResetToConsistentState() should call store.setUseITPDatabase(false)
https://bugs.webkit.org/show_bug.cgi?id=203020
<rdar://problem/56314484>

Patch by Kate Cheney <katherine_cheney@apple.com> on 2019-10-16
Reviewed by Chris Dumez.

Source/WebKit:

The resourceLoadStatisticsStore should be reset between tests to use
a memory store, and any test that needs to use the database store
can use the setUseITPDatabase function.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::setUseITPDatabase):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetUseITPDatabase):
(WKWebsiteDataStoreStatisticsResetToConsistentState):
* UIProcess/API/C/WKWebsiteDataStoreRef.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::setUseITPDatabase):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::setUseITPDatabase):
* UIProcess/WebsiteData/WebsiteDataStore.h:

Tools:

Added a completion handler to setUseITPDatabase() to avoid race
conditions.

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::setUseITPDatabase):

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

9 months ago[LFC][IFC] Add style and text content to Display::Run
zalan@apple.com [Wed, 16 Oct 2019 22:01:27 +0000 (22:01 +0000)]
[LFC][IFC] Add style and text content to Display::Run
https://bugs.webkit.org/show_bug.cgi?id=203045
<rdar://problem/56340105>

Reviewed by Antti Koivisto.

Painting Display::Runs requires style and text content. Currently there's no mapping structure to connect Display::Runs to Display::Boxes to access style and content.

* layout/displaytree/DisplayRun.h:
(WebCore::Display::Run::TextContext::content const):
(WebCore::Display::Run::style const):
(WebCore::Display::Run::Run):
(WebCore::Display::Run::TextContext::TextContext):
(WebCore::Display::Run::TextContext::expand):
* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::appendNonBreakableSpace):
(WebCore::Layout::Line::appendTextContent):
(WebCore::Layout::Line::appendNonReplacedInlineBox):
(WebCore::Layout::Line::appendHardLineBreak):
* layout/inlineformatting/InlineLine.h:
(WebCore::Layout::Line::Run::expand):

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

9 months agoMove assert in Wasm::Plan::fail.
keith_miller@apple.com [Wed, 16 Oct 2019 21:51:38 +0000 (21:51 +0000)]
Move assert in Wasm::Plan::fail.
https://bugs.webkit.org/show_bug.cgi?id=203052

Reviewed by Mark Lam.

JSTests:

* wasm/regress/wasm-plan-fail-bad-error-message-assert.js: Added.
(Binary):
(Binary.prototype.trunc_buffer):
(Binary.prototype.emit_leb_u):
(Binary.prototype.emit_u32v):
(Binary.prototype.emit_bytes):
(Binary.prototype.emit_header):
(__f_576):
(__f_587):

Source/JavaScriptCore:

Since we changed how Wasm::Plan interacts with the streaming
parser it's possible for the streaming parser to call fail with no
error message (because the corresponding Wasm::Plan already
failed). This patch moves an erroneous assert so it no longer
trips when this happens.

* wasm/WasmPlan.cpp:
(JSC::Wasm::Plan::fail):

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

9 months agocheckConsistency in Air O0 should only run when validation is enabled
keith_miller@apple.com [Wed, 16 Oct 2019 21:49:16 +0000 (21:49 +0000)]
checkConsistency in Air O0 should only run when validation is enabled
https://bugs.webkit.org/show_bug.cgi?id=203050

Reviewed by Saam Barati.

I resued the validateGraph and validateGraphAtEachPhase options
because adding a new option and threading it through all our
testing infrastructure didn't seem worthwhile for this.

* b3/air/AirAllocateRegistersAndStackAndGenerateCode.cpp:
(JSC::B3::Air::GenerateAndAllocateRegisters::checkConsistency):

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

9 months agoAdd dumping for BorderData and StyleBackgroundData
simon.fraser@apple.com [Wed, 16 Oct 2019 21:24:58 +0000 (21:24 +0000)]
Add dumping for BorderData and StyleBackgroundData
https://bugs.webkit.org/show_bug.cgi?id=203038

Reviewed by Zalan Bujtas.

As part of adding dumping for all RenderStyle data, add dumping support for
BorderData and StyleBackgroundData.

For large classes it's beneficial to avoid dumping default values; those classes
get a dump() function that can take an argument to say whether values which are default
should be printed.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/LengthSize.h:
(WebCore::LengthSize::isZero const):
* rendering/style/BorderData.cpp: Added.
(WebCore::operator<<):
(WebCore::BorderData::dump const):
* rendering/style/BorderData.h:
* rendering/style/RenderStyleConstants.h:
* rendering/style/StyleBackgroundData.cpp:
(WebCore::StyleBackgroundData::dump const):
(WebCore::operator<<):
* rendering/style/StyleBackgroundData.h:

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

9 months agoSource/WebCore:
cdumez@apple.com [Wed, 16 Oct 2019 20:54:23 +0000 (20:54 +0000)]
Source/WebCore:
[WK2] Handle back/forward cache entry expiration in the UIProcess instead of the WebProcess
https://bugs.webkit.org/show_bug.cgi?id=203034
<rdar://problem/56332453>

Reviewed by Antti Koivisto.

Use Seconds type for backForwardCacheExpirationInterval setting instead of
double, for clarity.

* history/CachedPage.cpp:
(WebCore::CachedPage::CachedPage):
(WebCore::CachedPage::hasExpired const):
* page/Settings.yaml:

Source/WebKit:
[WK2] Handle back/forward cache entry expiration in the UIProcess instead of the WebProcess
https://bugs.webkit.org/show_bug.cgi?id=203034
<rdar://problem/56332453>

Reviewed by Antti Koivisto.

Handle back/forward cache entry expiration in the UIProcess instead of the WebProcess,
now that back/forward cache management is done in the UIProcess.

* UIProcess/WebBackForwardCacheEntry.cpp:
(WebKit::WebBackForwardCacheEntry::WebBackForwardCacheEntry):
(WebKit::WebBackForwardCacheEntry::takeSuspendedPage):
(WebKit::WebBackForwardCacheEntry::expirationTimerFired):
* UIProcess/WebBackForwardCacheEntry.h:
Add a Timer to WebBackForwardCacheEntry to make the entry expire after 30 minutes, which is what used
to happen on WebContent process side. One difference in behavior is that when the entry expires we
now remove it from the cache right away to free-up memory, instead of simply refusing to use it later
on.

* WebProcess/WebPage/WebPage.cpp:
Disable back forward cache expiration in the WebContent process when using modern
WebKit.

Source/WebKitLegacy/mac:
[WK2] Move back/forward cache entry expiration from the WebProcess to the UIProcess
https://bugs.webkit.org/show_bug.cgi?id=203034
<rdar://problem/56332453>

Reviewed by Antti Koivisto.

* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

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

9 months ago[LFC][IFC] Fix various vertical alignment issues.
zalan@apple.com [Wed, 16 Oct 2019 20:32:55 +0000 (20:32 +0000)]
[LFC][IFC] Fix various vertical alignment issues.
https://bugs.webkit.org/show_bug.cgi?id=203041

Reviewed by Antti Koivisto.

This patch fixes both regular inline box and inline-block baseline aligment. It also addresses a few related vertical positioning issues.

* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::alignContentVertically):
(WebCore::Layout::Line::appendInlineContainerStart):
(WebCore::Layout::Line::appendInlineContainerEnd):
(WebCore::Layout::Line::appendTextContent):
(WebCore::Layout::Line::appendNonReplacedInlineBox):
(WebCore::Layout::Line::appendHardLineBreak):
(WebCore::Layout::Line::adjustBaselineAndLineHeight):
(WebCore::Layout::Line::inlineItemContentHeight const):
* layout/inlineformatting/InlineLine.h:
* layout/inlineformatting/InlineLineBox.h:
(WebCore::Layout::LineBox::resetDescent):
(WebCore::Layout::LineBox::setLogicalHeightIfGreater):
(WebCore::Layout::LineBox::setBaselineOffsetIfGreater):
(WebCore::Layout::LineBox::setAscentIfGreater):
(WebCore::Layout::LineBox::setDescentIfGreater):
(WebCore::Layout::LineBox::resetBaseline):
(WebCore::Layout::LineBox::setBaseline): Deleted.
(WebCore::Layout::LineBox::baseline): Deleted.
(WebCore::Layout::LineBox::setBaselineOffset): Deleted.
(WebCore::Layout::LineBox::Baseline::setAscentIfGreater): Deleted.
(WebCore::Layout::LineBox::Baseline::setDescentIfGreater): Deleted.

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

9 months agoInvalid instruction generated for ARM_THUMB2 in llint
ticaiolima@gmail.com [Wed, 16 Oct 2019 19:50:24 +0000 (19:50 +0000)]
Invalid instruction generated for ARM_THUMB2 in llint
https://bugs.webkit.org/show_bug.cgi?id=202844

Reviewed by Saam Barati.

Do not allow instruction execution to reach OSR return label on ARMv7.
Currently we are seeing the instruction execution hitting a .word directive in
the instruction stream and segfaulting. There are two words used to represent a
global label which was generated as part of the work on OSR Exit to LLInt work
(r250806). The double word generation only occurs in ARMv7 and therefore only here
the segfault manifests itself.

* llint/LowLevelInterpreter.asm:

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

9 months ago[iOS] Stop terminating the prewarmed process on application suspension
cdumez@apple.com [Wed, 16 Oct 2019 19:22:38 +0000 (19:22 +0000)]
[iOS] Stop terminating the prewarmed process on application suspension
https://bugs.webkit.org/show_bug.cgi?id=203033

Reviewed by Alex Christensen.

Stop terminating the prewarmed process on application suspension. Having no prewarmed process when the
application resumes means the next cross-site load will be significantly slower. If the system needs
memory, this process can be jetsammed.

* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::applicationIsAboutToSuspend):

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

9 months agoDrop unused WKPageSetResourceCachingDisabled() SPI
cdumez@apple.com [Wed, 16 Oct 2019 18:24:25 +0000 (18:24 +0000)]
Drop unused WKPageSetResourceCachingDisabled() SPI
https://bugs.webkit.org/show_bug.cgi?id=203035

Reviewed by Alex Christensen.

Source/WebCore:

* history/PageCache.cpp:
(WebCore::canCachePage):
(WebCore::PageCache::take):
(WebCore::PageCache::get):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerShouldUsePersistentCache const):
* inspector/agents/page/PageNetworkAgent.cpp:
(WebCore::PageNetworkAgent::setResourceCachingDisabled):
* inspector/agents/worker/WorkerNetworkAgent.cpp:
(WebCore::WorkerNetworkAgent::setResourceCachingDisabled):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::subresourceCachePolicy const):
(WebCore::FrameLoader::addExtraFieldsToRequest):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::cachePolicy const):
* page/Page.h:
(WebCore::Page::isResourceCachingDisabledByWebInspector const):
(WebCore::Page::setResourceCachingDisabledByWebInspector):
(WebCore::Page::isResourceCachingDisabled const): Deleted.
(WebCore::Page::setResourceCachingDisabled): Deleted.
(WebCore::Page::setResourceCachingDisabledOverride): Deleted.
* workers/WorkerDebuggerProxy.h:
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::setResourceCachingDisabledByWebInspector):
(WebCore::WorkerMessagingProxy::setResourceCachingDisabled): Deleted.
* workers/WorkerMessagingProxy.h:
* workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::ServiceWorkerThreadProxy::setResourceCachingDisabledByWebInspector):
(WebCore::ServiceWorkerThreadProxy::setResourceCachingDisabled): Deleted.
* workers/service/context/ServiceWorkerThreadProxy.h:

Source/WebKit:

* UIProcess/API/C/WKPage.cpp:
(WKPageGetResourceCachingDisabled): Deleted.
(WKPageSetResourceCachingDisabled): Deleted.
* UIProcess/API/C/WKPagePrivate.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setResourceCachingDisabled): Deleted.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::isResourceCachingDisabled const): Deleted.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setResourceCachingDisabled): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

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

9 months agoDumpRenderTree should clear WTFLogChannelState::OnWithAccumulation state set by testR...
Hironori.Fujii@sony.com [Wed, 16 Oct 2019 18:15:01 +0000 (18:15 +0000)]
DumpRenderTree should clear WTFLogChannelState::OnWithAccumulation state set by testRunner.accummulateLogsForChannel
https://bugs.webkit.org/show_bug.cgi?id=203024

Reviewed by Alex Christensen.

Source/WebCore:

* platform/LogInitialization.h:
* platform/Logging.cpp:
(WebCore::clearAllLogChannelsToAccumulate): Added.
* platform/Logging.h:
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::clearAllLogChannelsToAccumulate): Added.
* testing/js/WebCoreTestSupport.h:

Tools:

If a test case calls testRunner.accummulateLogsForChannel("IndexedDB"),
all subsequent IndexedDB tests also dump the log.
This is unnecessarily bloating DumpRenderTree log because
DumpRenderTree is run with --debug-rwt-logging switch on Buildbot.

Add a function to clear WTFLogChannelState::OnWithAccumulation
state, and call it for every test execution.

* DumpRenderTree/mac/DumpRenderTree.mm:
(resetWebViewToConsistentStateBeforeTesting):
* DumpRenderTree/win/DumpRenderTree.cpp:
(resetWebViewToConsistentStateBeforeTesting):
Call WebCoreTestSupport::clearAllLogChannelsToAccumulate.

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

9 months agoRemove an API test workaround that is no longer needed
wenson_hsieh@apple.com [Wed, 16 Oct 2019 17:37:06 +0000 (17:37 +0000)]
Remove an API test workaround that is no longer needed
https://bugs.webkit.org/show_bug.cgi?id=203037

Reviewed by Tim Horton.

This worked around <rdar://problem/51510554> by avoiding codepaths that resulted in failure to read dropped
content from NSItemProviders on iOS. <rdar://problem/51510554> is fixed in iOS 13, so we can remove this hack.

* TestWebKitAPI/cocoa/TestWKWebView.mm:
(-[TestWKWebView initWithFrame:configuration:addToWindow:]):
(applyWorkaroundToAllowWritingAttributedStringsToItemProviders): Deleted.

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

9 months ago[Tools] Add a driver for cog for benchmark_runner.py
psaavedra@igalia.com [Wed, 16 Oct 2019 17:26:10 +0000 (17:26 +0000)]
[Tools] Add a driver for cog for benchmark_runner.py
https://bugs.webkit.org/show_bug.cgi?id=202995

Reviewed by Žan Doberšek.

* Scripts/webkitpy/benchmark_runner/browser_driver/linux_cog_driver.py: Added.
(CogBrowserDriver):
(CogBrowserDriver.launch_url):
(CogBrowserDriver.launch_driver):
(CogFdoBrowserDriver):
(CogFdoBrowserDriver.launch_url):

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

9 months agoUnreviewed, fix the internal macOS 10.13 and 10.14 builds after r251171
wenson_hsieh@apple.com [Wed, 16 Oct 2019 17:12:05 +0000 (17:12 +0000)]
Unreviewed, fix the internal macOS 10.13 and 10.14 builds after r251171

Source/WebKit:

* Platform/spi/mac/ApplicationServicesSPI.h: Guard SPI declarations that use AXClientType with HAVE(AX_CLIENT_TYPE).

Source/WTF:

* wtf/Platform.h: Add a HAVE() macro for AXClientType, which is only available on macOS 10.15+ SDKs.

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

9 months agoCorrect TestExpectations from r251119.
russell_e@apple.com [Wed, 16 Oct 2019 17:07:38 +0000 (17:07 +0000)]
Correct TestExpectations from r251119.
https://bugs.webkit.org/show_bug.cgi?id=202826

Unreviewed Test Gardening.

* platform/ios/TestExpectations:

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

9 months agoWebAudioSourceProviderAVFObjC::provideInput should set its WebAudioBufferList paramet...
youenn@apple.com [Wed, 16 Oct 2019 16:48:48 +0000 (16:48 +0000)]
WebAudioSourceProviderAVFObjC::provideInput should set its WebAudioBufferList parameters correctly
https://bugs.webkit.org/show_bug.cgi?id=202930
<rdar://problem/56006776>

Reviewed by Eric Carlson.

Source/WebCore:

There is a time where the bus channel number and audio source channel numbers may be different.
In case the bus channel number is less than the audio source channel number, initialization of
the WebAudioBufferList might not be fully done.
In that case, output silence and return early.
Reduce the number of frames to process based on the number of frames the output audio bus plans to process.

Partially covered by new API test (this a race so we cannot reproduce the crash easily).

* Modules/webaudio/MediaStreamAudioSourceNode.cpp:
(WebCore::MediaStreamAudioSourceNode::process):
Make sure to process the number of frames the output bus expect.
* platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
(WebCore::WebAudioSourceProviderAVFObjC::provideInput):

Tools:

Add a test that has an audio track that goes from 1 to 2 channels while being piped to a WebAudio pipeline.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit/GetUserMedia.mm:
(-[GUMMessageHandler userContentController:didReceiveScriptMessage:]):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/getUserMedia-webaudio.html: Added.

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

9 months agoRemove duplicate MathML tests
commit-queue@webkit.org [Wed, 16 Oct 2019 14:43:41 +0000 (14:43 +0000)]
Remove duplicate MathML tests
https://bugs.webkit.org/show_bug.cgi?id=202979

Patch by Rob Buis <rbuis@igalia.com> on 2019-10-16
Reviewed by Frédéric Wang.

Remove mo-form-dynamic.html, this got imported
as presentation-markup/operators/mo-form-dynamic.html.

Remove mo-form-minus-plus.html, this got imported
as presentation-markup/operators/mo-form-minus-plus.html.

Remove mo-form-fallback.html, this got imported
as presentation-markup/operators/mo-form-fallback.html.

* mathml/presentation/mo-form-dynamic-expected.html: Removed.
* mathml/presentation/mo-form-dynamic-expected.html: Removed.
* mathml/presentation/mo-form-dynamic.html: Removed.
* mathml/presentation/mo-form-fallback-expected.html: Removed.
* mathml/presentation/mo-form-fallback.html: Removed.
* mathml/presentation/mo-form-minus-plus-expected.html: Removed.
* mathml/presentation/mo-form-minus-plus.html: Removed.

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

9 months ago[LFC][TFC] TableFormattingContext::distributeExtraHorizontalSpace should not ignore...
zalan@apple.com [Wed, 16 Oct 2019 13:27:19 +0000 (13:27 +0000)]
[LFC][TFC] TableFormattingContext::distributeExtraHorizontalSpace should not ignore fixed width columns
https://bugs.webkit.org/show_bug.cgi?id=203010

Reviewed by Antti Koivisto.

Fixed width columns (e.g. <col width=100px>) don't participate in the extra horizontal space distribution.

* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::computedTableWidth):
(WebCore::Layout::TableFormattingContext::distributeExtraHorizontalSpace):
(WebCore::Layout::TableFormattingContext::distributeAvailableWidth): Deleted.
* layout/tableformatting/TableFormattingContext.h:
* layout/tableformatting/TableGrid.cpp:
(WebCore::Layout::TableGrid::Column::hasFixedWidth const):
(WebCore::Layout::TableGrid::widthConstraints const):
* layout/tableformatting/TableGrid.h:
(WebCore::Layout::TableGrid::totalHorizontalSpacing const):
(WebCore::Layout::TableGrid::columnsContext const):

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

9 months ago[GTK][WPE] ASSERTION FAILED: blob in SQLiteStatement.cpp(163) : int WebCore::SQLiteSt...
carlosgc@webkit.org [Wed, 16 Oct 2019 10:57:25 +0000 (10:57 +0000)]
[GTK][WPE] ASSERTION FAILED: blob in SQLiteStatement.cpp(163) : int WebCore::SQLiteStatement::bindBlob()
https://bugs.webkit.org/show_bug.cgi?id=202976

Reviewed by Adrian Perez de Castro.

This is because IconDatabases passes a nullptr blob to store emtpty icons. sqlite3_bind_blob() allows nullptr as
blob, so we shouldn't assert.

* platform/sql/SQLiteStatement.cpp:
(WebCore::SQLiteStatement::bindBlob): Update the assert to only fail when blob is nullptr and size > 0.

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

9 months ago[CSS Shadow Parts] Import css/css-shadow-parts/simple-inline.html WPT
antti@apple.com [Wed, 16 Oct 2019 09:47:41 +0000 (09:47 +0000)]
[CSS Shadow Parts] Import css/css-shadow-parts/simple-inline.html WPT
https://bugs.webkit.org/show_bug.cgi?id=203029

Reviewed by Adrian Perez de Castro.

* web-platform-tests/css/css-shadow-parts/simple-inline-expected.txt: Added.
* web-platform-tests/css/css-shadow-parts/simple-inline.html: Added.
* web-platform-tests/css/css-shadow-parts/w3c-import.log:

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

9 months agoUnreviewed build fix for Windows ports
Hironori.Fujii@sony.com [Wed, 16 Oct 2019 09:11:15 +0000 (09:11 +0000)]
Unreviewed build fix for Windows ports
https://bugs.webkit.org/show_bug.cgi?id=203016
<rdar://problem/56317774>

* page/DOMTimer.h: Added WEBCORE_EXPORT to ~DOMTimer().

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

9 months agoimage/apng not recognized in source tag
clopez@igalia.com [Wed, 16 Oct 2019 09:00:55 +0000 (09:00 +0000)]
image/apng not recognized in source tag
https://bugs.webkit.org/show_bug.cgi?id=202785

Reviewed by Dean Jackson.

Source/WebCore:

Add image/apng as supported mime type for images on Mac/iOS and
on all the other platforms that enable apng support.

This fixes the test imported/w3c/web-platform-tests/apng/supported-in-source-type.html

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

LayoutTests:

* TestExpectations: Remove test imported/w3c/web-platform-tests/apng/supported-in-source-type.html
from the list of expected failures.

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

9 months ago[GTK][WPE] Add user messages API
carlosgc@webkit.org [Wed, 16 Oct 2019 07:36:24 +0000 (07:36 +0000)]
[GTK][WPE] Add user messages API
https://bugs.webkit.org/show_bug.cgi?id=202847

Reviewed by Adrian Perez de Castro.

Source/WebCore/platform/gtk/po:

* POTFILES.in: Add new files containing translatable strings.

Source/WebKit:

We have never exposed an API to send/receive messages to/from Web extensions, to allow applications use their own
IPC. Now, with PSON enabled, it's a lot more difficult to implement the custom IPC on the application side,
because applications need to keep track of all the web processes launched, and the changes of web process in the
web view to send the messages to the right extension. That's already done internally by WebKit, so it would be
easier to provide a simple API so that apps don't need to worry about the web process being used. This patch adds
WebKitUserMessage, a simple message API consisting on a message name, parameters and file descriptors. Messages
can be sent from a WebKitWebContext to all the WebKitWebExtensions, or from a WebKitWebExtension to its
WebKitWebContext, or from a WebKitWebView to its WebKitWebPage (and vice versa).

* PlatformGTK.cmake:
* PlatformWPE.cmake:
* Shared/API/glib/WebKitUserMessage.cpp: Added.
(webkitUserMessageDispose):
(webkitUserMessageGetProperty):
(webkitUserMessageSetProperty):
(webkit_user_message_class_init):
(webkitUserMessageCreate):
(webkitUserMessageGetMessage):
(webkit_user_message_new):
(webkit_user_message_new_with_fd_list):
(webkit_user_message_get_name):
(webkit_user_message_get_parameters):
(webkit_user_message_get_fd_list):
(webkit_user_message_send_reply):
* Shared/API/glib/WebKitUserMessagePrivate.h: Added.
* Shared/glib/ArgumentCodersGLib.cpp: Added.
(IPC::encode):
(IPC::decode):
* Shared/glib/ArgumentCodersGLib.h: Added.
* Shared/glib/UserMessage.cpp: Added.
(WebKit::UserMessage::encode const):
(WebKit::UserMessage::decode):
* Shared/glib/UserMessage.h: Added.
(WebKit::UserMessage::UserMessage):
* SourcesGTK.txt:
* SourcesWPE.txt:
* UIProcess/API/glib/WebKitWebContext.cpp:
(webkitWebContextConstructed):
(webkit_web_context_class_init):
(webkit_web_context_send_message_to_all_extensions):
* UIProcess/API/glib/WebKitWebView.cpp:
(webkit_web_view_class_init):
(webkitWebViewDidReceiveUserMessage):
(webkit_web_view_send_message_to_page):
(webkit_web_view_send_message_to_page_finish):
* UIProcess/API/glib/WebKitWebViewPrivate.h:
* UIProcess/API/gtk/WebKitUserMessage.h: Added.
* UIProcess/API/gtk/WebKitWebContext.h:
* UIProcess/API/gtk/WebKitWebView.h:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
* UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
* UIProcess/API/gtk/webkit2.h:
* UIProcess/API/wpe/APIViewClient.h:
(API::ViewClient::didReceiveUserMessage):
* UIProcess/API/wpe/PageClientImpl.cpp:
(WebKit::PageClientImpl::sendMessageToWebView):
* UIProcess/API/wpe/PageClientImpl.h:
* UIProcess/API/wpe/WPEView.cpp:
(WKWPE::View::didReceiveUserMessage):
* UIProcess/API/wpe/WPEView.h:
* UIProcess/API/wpe/WebKitUserMessage.h: Added.
* UIProcess/API/wpe/WebKitWebContext.h:
* UIProcess/API/wpe/WebKitWebView.h:
* UIProcess/API/wpe/docs/wpe-1.0-sections.txt:
* UIProcess/API/wpe/docs/wpe-docs.sgml:
* UIProcess/API/wpe/webkit.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.h:
* UIProcess/WebProcessProxy.messages.in:
* UIProcess/glib/WebProcessProxyGLib.cpp:
(WebKit::WebProcessProxy::sendMessageToWebContextWithReply):
(WebKit::WebProcessProxy::sendMessageToWebContext):
* UIProcess/gtk/WebPageProxyGtk.cpp:
(WebKit::WebPageProxy::sendMessageToWebViewWithReply):
(WebKit::WebPageProxy::sendMessageToWebView):
* UIProcess/wpe/WebPageProxyWPE.cpp:
(WebKit::WebPageProxy::sendMessageToWebViewWithReply):
(WebKit::WebPageProxy::sendMessageToWebView):
* WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.h:
(WebKit::WebKitExtensionManager::extension const):
* WebProcess/InjectedBundle/API/glib/WebKitWebExtension.cpp:
(webkitWebExtensionDidReceiveUserMessage):
(webkit_web_extension_send_message_to_context):
(webkit_web_extension_send_message_to_context_finish):
* WebProcess/InjectedBundle/API/glib/WebKitWebExtensionPrivate.h:
* WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
(webkit_web_page_class_init):
(webkitWebPageDidReceiveUserMessage):
(webkit_web_page_send_message_to_view):
(webkit_web_page_send_message_to_view_finish):
* WebProcess/InjectedBundle/API/glib/WebKitWebPagePrivate.h:
* WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.h:
* WebProcess/InjectedBundle/API/gtk/WebKitWebPage.h:
* WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h:
* WebProcess/InjectedBundle/API/wpe/WebKitWebExtension.h:
* WebProcess/InjectedBundle/API/wpe/WebKitWebPage.h:
* WebProcess/InjectedBundle/API/wpe/docs/wpe-webextensions-1.0-sections.txt:
* WebProcess/InjectedBundle/API/wpe/webkit-web-extension.h:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/glib/WebPageGLib.cpp: Added.
(WebKit::WebPage::sendMessageToWebExtensionWithReply):
(WebKit::WebPage::sendMessageToWebExtension):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
* WebProcess/glib/WebProcessGLib.cpp:
(WebKit::WebProcess::sendMessageToWebExtension):

Tools:

Add a test to check the new API.

* TestWebKitAPI/Tests/WebKitGLib/TestWebExtensions.cpp:
(UserMessageTest::webViewUserMessageReceivedCallback):
(UserMessageTest::webContextUserMessageReceivedCallback):
(UserMessageTest::UserMessageTest):
(UserMessageTest::~UserMessageTest):
(UserMessageTest::sendMessage):
(UserMessageTest::sendMedssageToAllExtensions):
(UserMessageTest::viewUserMessageReceived):
(UserMessageTest::contextUserMessageReceived):
(UserMessageTest::waitUntilViewMessageReceived):
(UserMessageTest::waitUntilContextMessageReceived):
(readFileDescritpor):
(testWebExtensionUserMessages):
(beforeAll):
* TestWebKitAPI/Tests/WebKitGLib/WebExtensionTest.cpp:
(documentLoadedCallback):
(pageMessageReceivedCallback):
(pageCreatedCallback):
(extensionMessageReceivedCallback):
(webkit_web_extension_initialize_with_user_data):

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

9 months agoFix GCC warning on MIPS about dead variable metadata
commit-queue@webkit.org [Wed, 16 Oct 2019 07:36:16 +0000 (07:36 +0000)]
Fix GCC warning on MIPS about dead variable metadata
https://bugs.webkit.org/show_bug.cgi?id=202987

Patch by Paulo Matos <pmatos@linki.tools> on 2019-10-16
Reviewed by Keith Miller.

* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emit_op_get_internal_field):

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

9 months agoFix the internal macOS build after r251171
wenson_hsieh@apple.com [Wed, 16 Oct 2019 05:39:13 +0000 (05:39 +0000)]
Fix the internal macOS build after r251171
https://bugs.webkit.org/show_bug.cgi?id=203022

Reviewed by Dan Bernstein.

Attempts to include <HIServices/AccessibilityPriv.h> in WebKit result in:

```
fatal error: 'HIServices/AccessibilityPriv.h' file not found
```

At least on macOS 10.15, it appears that HIServices.framework exists within the ApplicationServices framework.
To fix this build error, we can instead turn AccessibilityPrivSPI.h into an SPI header for ApplicationServices,
ApplicationServicesSPI.h, and use it in several places where we currently directly import <ApplicationServices/
ApplicationServicesPriv.h>.

* Platform/IPC/cocoa/ConnectionCocoa.mm:

Bring some more constants that were defined in the !USE(APPLE_INTERNAL_SDK) case into the ApplicationServices
SPI header.

* Platform/spi/mac/ApplicationServicesSPI.h: Renamed from Source/WebKit/Platform/spi/mac/AccessibilityPrivSPI.h.
* Shared/mac/AuxiliaryProcessMac.mm:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:

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

9 months agooperationSwitchCharWithUnknownKeyType failed to handle OOME when resolving rope string.
mark.lam@apple.com [Wed, 16 Oct 2019 04:01:18 +0000 (04:01 +0000)]
operationSwitchCharWithUnknownKeyType failed to handle OOME when resolving rope string.
https://bugs.webkit.org/show_bug.cgi?id=202312
<rdar://problem/55782280>

Reviewed by Yusuke Suzuki.

JSTests:

* stress/operationSwitchCharWithUnknownKeyType-should-avoid-resolving-rope-strings.js: Added.
* stress/operationSwitchCharWithUnknownKeyType-should-avoid-resolving-rope-strings2.js: Added.
* stress/switch-on-char-llint-rope.js:
- Changed this test to make a new rope string for each iterations.  Otherwise,
  the rope will get resolved, and subsequent tiers will not be testing with a rope.

Source/JavaScriptCore:

operationSwitchCharWithUnknownKeyType() can only dispatch to a case handler
if the key string is of length 1.  All other cases should dispatch to the default
handler.  This patch also adds the missing OOME check.

Also fixed a bug in SpeculativeJIT::emitSwitchCharStringJump() where the slow
path rope resolution was returning after the length check.  It needs to return to
the point before the length check.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::emitSwitchCharStringJump):
* jit/JITOperations.cpp:

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

9 months agoadoptRef DOMTimer in install instead of its constructor
rniwa@webkit.org [Wed, 16 Oct 2019 02:32:05 +0000 (02:32 +0000)]
adoptRef DOMTimer in install instead of its constructor
https://bugs.webkit.org/show_bug.cgi?id=203016

Reviewed by Simon Fraser.

Moved the code to add DOMTimer to ScriptExecutionContext's map to DOMTimer::install
instead of its constructor so that we can adoptRef there instead for clarity & simplicity.

* dom/ScriptExecutionContext.h:
(WebCore::ScriptExecutionContext::addTimeout):
* page/DOMTimer.cpp:
(WebCore::DOMTimer::DOMTimer):
(WebCore::DOMTimer::install):
(WebCore::DOMTimer::fired):

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

9 months agoREGRESSION (~244100) [Mac WK2 Debug] Layout Test http/tests/resourceLoadStatistics...
commit-queue@webkit.org [Wed, 16 Oct 2019 02:08:32 +0000 (02:08 +0000)]
REGRESSION (~244100) [Mac WK2 Debug] Layout Test http/tests/resourceLoadStatistics/prune-statistics.html is a flaky failure (197285)
https://bugs.webkit.org/show_bug.cgi?id=197285
<rdar://problem/50208370>

Patch by Kate Cheney <katherine_cheney@apple.com> on 2019-10-15
Reviewed by Chris Dumez.

Source/WebKit:

This patch fixes a flaky failure which was being caused by other
resourceLoadStatistics tests scheduling processing checks which
were called during execution of prune-statistics.html.
Now, any pending processing checks are cancelled between tests.

* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):

LayoutTests:

Remove a "skipped" expectation for a previously flaky test that should
be fixed by this patch.
* platform/mac-wk2/TestExpectations:

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

9 months agoediting/async-clipboard/clipboard-item-basic.html is a flaky failure on macOS and iOS
wenson_hsieh@apple.com [Wed, 16 Oct 2019 02:06:01 +0000 (02:06 +0000)]
editing/async-clipboard/clipboard-item-basic.html is a flaky failure on macOS and iOS
https://bugs.webkit.org/show_bug.cgi?id=203015

Reviewed by Tim Horton.

This test, for the most part, finishes and dumps its final output before a couple of (intentionally) rejected
promises finish and log their uncaught rejections to the console. In the case where we lose this race and the
console messages happen earlier, we end up with a text diff failure.

Avoid this issue by making sure that we catch these promise rejections.

* editing/async-clipboard/clipboard-item-basic.html:

Also give this test a tiny bit more variety, by making one of the promises reject immediately, while the other
still waits for a short delay (50 ms).

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

9 months ago[iOS] Maintain the last Back/Forward cache entry when the application gets suspended
cdumez@apple.com [Wed, 16 Oct 2019 01:49:53 +0000 (01:49 +0000)]
[iOS] Maintain the last Back/Forward cache entry when the application gets suspended
https://bugs.webkit.org/show_bug.cgi?id=203014

Reviewed by Geoffrey Garen.

Previously, we would clear all back/forward cache entries when the application is about to
be suspended. This means that we would lose fast-back when coming back to the application.
To be memory-friendly but maintain the fast-back when coming back to the application, we now
maintain the last back/forward cache entry when the application gets suspended.

* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::applicationIsAboutToSuspend):
(WebKit::WebProcessPool::notifyProcessPoolsApplicationIsAboutToSuspend):
* UIProcess/WebBackForwardCache.cpp:
(WebKit::WebBackForwardCache::pruneToSize):
* UIProcess/WebBackForwardCache.h:
* UIProcess/WebProcessPool.h:
* UIProcess/ios/ProcessAssertionIOS.mm:
(-[WKProcessAssertionBackgroundTaskManager init]):
(-[WKProcessAssertionBackgroundTaskManager _releaseBackgroundTask]):

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
A WebProcess no longer clears its PageCache on suspension on iOS. We let the UIProcess's
back/forward cache control when PageCache entries should get destroyed. The back/forward
cache will properly wake up a suspended process to clear one of its PageCache entries if
needed.

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

9 months agoScrollingTreeScrollingNodeDelegateMac::stretchAmount() should not have side effects
simon.fraser@apple.com [Wed, 16 Oct 2019 01:27:33 +0000 (01:27 +0000)]
ScrollingTreeScrollingNodeDelegateMac::stretchAmount() should not have side effects
https://bugs.webkit.org/show_bug.cgi?id=203009

Reviewed by Dean Jackson.

Calling ScrollingTreeScrollingNodeDelegateMac::stretchAmount() had the side effect of calling
setMainFrameIsRubberBanding() on the scrolling tree.

Remove this badness and replace it by modifying updateMainFramePinState() (which is called every time
the scroll position changes) to also compute if we're rubber-banding.

Also make a bunch of methods on ScrollControllerClient const, which makes it clear that
they don't have side effects.

* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
(WebCore::ScrollingTreeFrameScrollingNodeMac::currentScrollPositionChanged):
(WebCore::ScrollingTreeFrameScrollingNodeMac::updateMainFramePinAndRubberbandState):
(WebCore::ScrollingTreeFrameScrollingNodeMac::updateMainFramePinState): Deleted.
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h:
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::isAlreadyPinnedInDirectionOfGesture const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::allowsHorizontalStretching const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::allowsVerticalStretching const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::stretchAmount const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::pinnedInDirection const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::canScrollHorizontally const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::canScrollVertically const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::shouldRubberBandInDirection const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::isAlreadyPinnedInDirectionOfGesture): Deleted.
(WebCore::ScrollingTreeScrollingNodeDelegateMac::allowsHorizontalStretching): Deleted.
(WebCore::ScrollingTreeScrollingNodeDelegateMac::allowsVerticalStretching): Deleted.
(WebCore::ScrollingTreeScrollingNodeDelegateMac::stretchAmount): Deleted.
(WebCore::ScrollingTreeScrollingNodeDelegateMac::pinnedInDirection): Deleted.
(WebCore::ScrollingTreeScrollingNodeDelegateMac::canScrollHorizontally): Deleted.
(WebCore::ScrollingTreeScrollingNodeDelegateMac::canScrollVertically): Deleted.
(WebCore::ScrollingTreeScrollingNodeDelegateMac::shouldRubberBandInDirection): Deleted.
* platform/cocoa/ScrollController.h:
* platform/mac/ScrollAnimatorMac.h:
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimatorMac::shouldForwardWheelEventsToParent const):
(WebCore::ScrollAnimatorMac::pinnedInDirection const):
(WebCore::ScrollAnimatorMac::isAlreadyPinnedInDirectionOfGesture const):
(WebCore::ScrollAnimatorMac::allowsVerticalStretching const):
(WebCore::ScrollAnimatorMac::allowsHorizontalStretching const):
(WebCore::ScrollAnimatorMac::stretchAmount const):
(WebCore::ScrollAnimatorMac::canScrollHorizontally const):
(WebCore::ScrollAnimatorMac::canScrollVertically const):
(WebCore::ScrollAnimatorMac::shouldRubberBandInDirection const):
(WebCore::ScrollAnimatorMac::shouldForwardWheelEventsToParent): Deleted.
(WebCore::ScrollAnimatorMac::pinnedInDirection): Deleted.
(WebCore::ScrollAnimatorMac::isAlreadyPinnedInDirectionOfGesture): Deleted.
(WebCore::ScrollAnimatorMac::allowsVerticalStretching): Deleted.
(WebCore::ScrollAnimatorMac::allowsHorizontalStretching): Deleted.
(WebCore::ScrollAnimatorMac::stretchAmount): Deleted.
(WebCore::ScrollAnimatorMac::canScrollHorizontally): Deleted.
(WebCore::ScrollAnimatorMac::canScrollVertically): Deleted.
(WebCore::ScrollAnimatorMac::shouldRubberBandInDirection): Deleted.
* platform/mock/ScrollAnimatorMock.h:

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

9 months agoWheelEventTestMonitor doesn't need to be threadsafe
simon.fraser@apple.com [Wed, 16 Oct 2019 01:04:41 +0000 (01:04 +0000)]
WheelEventTestMonitor doesn't need to be threadsafe
https://bugs.webkit.org/show_bug.cgi?id=203012

Reviewed by Dean Jackson.

WheelEventTestMonitor is only called on the main thread, so doesn't need a lock to protect
m_deferCompletionReasons, and add main thread assertions.

* page/WheelEventTestMonitor.cpp:
(WebCore::WheelEventTestMonitor::clearAllTestDeferrals):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartNotificationTimer):
(WebCore::WheelEventTestMonitor::deferForReason):
(WebCore::WheelEventTestMonitor::removeDeferralForReason):
(WebCore::WheelEventTestMonitor::triggerTestTimerFired):
* page/WheelEventTestMonitor.h:

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

9 months agoAX: Make AXIsolatedTree compile again
commit-queue@webkit.org [Wed, 16 Oct 2019 00:27:22 +0000 (00:27 +0000)]
AX: Make AXIsolatedTree compile again
https://bugs.webkit.org/show_bug.cgi?id=202702
<rdar://problem/56084968>

Patch by Andres Gonzalez <andresg_22@apple.com> on 2019-10-15
Reviewed by Joanmarie Diggs.

Re-submitting r251045 with a fix for internal builds.

Source/WebCore:

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::remove):
(WebCore::AXObjectCache::createIsolatedAccessibilityTreeHierarchy):
* accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::treePageCache):
(WebCore::AXIsolatedTree::nodeForID const):
(WebCore::AXIsolatedTree::applyPendingChanges):
(WebCore::AXIsolatedTree::initializePageTreeForID): Deleted.
(WebCore::AXIsolatedTree::setInitialRequestInProgress): Deleted.
* accessibility/isolatedtree/AXIsolatedTree.h:
* accessibility/isolatedtree/AXIsolatedTreeNode.cpp:
(WebCore::AXIsolatedTreeNode::setTreeIdentifier):
(WebCore::AXIsolatedTreeNode::rectAttributeValue const):
* accessibility/isolatedtree/AXIsolatedTreeNode.h:
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(convertToNSArray):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper childrenVectorArray]):

Source/WebKit:

* Platform/spi/mac/AccessibilityPrivSPI.h:
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
(-[WKAccessibilityWebPageObjectBase isolatedTreeRootObject]):

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

9 months agoWeb Inspector: Debugger: prevent source mapped resources from being blackboxed
drousso@apple.com [Wed, 16 Oct 2019 00:01:35 +0000 (00:01 +0000)]
Web Inspector: Debugger: prevent source mapped resources from being blackboxed
https://bugs.webkit.org/show_bug.cgi?id=203007

Reviewed by Matt Baker.

Since source mapped resources are entirely a frontend concept, it doesn't make sense to
allow them to be blackboxed.

* UserInterface/Models/SourceMapResource.js:
(WI.SourceMapResource.prototype.get supportsScriptBlackboxing):

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

9 months agoUnreviewed build fix after r251018
bfulgham@apple.com [Tue, 15 Oct 2019 23:40:00 +0000 (23:40 +0000)]
Unreviewed build fix after r251018

* PlatformFTW.cmake: Add missing dxgi library.

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

9 months agoWeb Inspector: Convert CSSRule selectorText setter to setSelectorText method because...
nvasilyev@apple.com [Tue, 15 Oct 2019 23:39:06 +0000 (23:39 +0000)]
Web Inspector: Convert CSSRule selectorText setter to setSelectorText method because it's asynchronous
https://bugs.webkit.org/show_bug.cgi?id=202840

Reviewed by Matt Baker.

* UserInterface/Models/CSSRule.js:
(WI.CSSRule.prototype.setSelectorText):
(WI.CSSRule.prototype._selectorRejected):
(WI.CSSRule.prototype._selectorResolved):
Remove WI.CSSRule.Event.SelectorChanged event and since it wasn't used anywhere else.

(WI.CSSRule):
(WI.CSSRule.prototype.set selectorText): Deleted.
(WI.CSSRule.prototype.setSelectorText): Added.
(WI.CSSRule.prototype._selectorRejected): Deleted.
(WI.CSSRule.Event.SelectorChanged): Deleted.
Remove `{valid: ...}` object since it wasn't used.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.spreadsheetSelectorFieldDidCommit):

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

9 months agoImprove summary for WebKitPerl Tests build step
aakash_jain@apple.com [Tue, 15 Oct 2019 23:20:55 +0000 (23:20 +0000)]
Improve summary for WebKitPerl Tests build step
https://bugs.webkit.org/show_bug.cgi?id=203006

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/steps.py:
(RunWebKitPerlTests.getResultSummary): Override method to customize summary.
* BuildSlaveSupport/ews-build/steps_unittest.py: Updated unit-tests.

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

9 months agoWebview's drawing area may stay frozen on cross-site back/forward navigation
cdumez@apple.com [Tue, 15 Oct 2019 23:17:18 +0000 (23:17 +0000)]
Webview's drawing area may stay frozen on cross-site back/forward navigation
https://bugs.webkit.org/show_bug.cgi?id=203004

Reviewed by Tim Horton.

Whenever the UIScene becomes foreground / background, the WebPageProxy notifies its currently associated
WebPage in the committed WebProcess so that it can freeze / unfreeze its layer tree with the
BackgroundApplication reason. The issue is that if a WebPage gets suspended on cross-site navigation
(because the UIScene is in the background when the load commits), then the suspended WebPage kept its
a BackgroundApplication freeze. When the UIScene becomes foreground, the WebPage only notifies its
committed page so the suspended page keeps its BackgroundApplication freeze still. If the user now
navigates back, it will restore the suspended WebPage and the view will stay frozen.

To address the issue, we now have the WebPage drop its BackgroundApplication freeze reason, whenever
it transitions from committed to suspended.

* UIProcess/ios/WKApplicationStateTrackingView.mm:
(-[WKApplicationStateTrackingView didMoveToWindow]):
Fix logging, [self isBackground] needs to be called *after* _applicationStateTracker has been
initialized, or it will return YES unconditionally.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setIsSuspended):

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

9 months ago[iOS] Crash in WebCore::DOMWindow::incrementScrollEventListenersCount
rniwa@webkit.org [Tue, 15 Oct 2019 22:54:20 +0000 (22:54 +0000)]
[iOS] Crash in WebCore::DOMWindow::incrementScrollEventListenersCount
https://bugs.webkit.org/show_bug.cgi?id=202878

Unreviewed. Addressed Darin's post-commit review comment.

* dom/Node.cpp:
(WebCore::tryAddEventListener):

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

9 months ago[macOS] Simplify main thread initialization
cdumez@apple.com [Tue, 15 Oct 2019 22:43:55 +0000 (22:43 +0000)]
[macOS] Simplify main thread initialization
https://bugs.webkit.org/show_bug.cgi?id=203001

Reviewed by Geoff Garen.

Source/WebCore:

* bridge/objc/WebScriptObject.mm:
(+[WebScriptObject initialize]):
* platform/cocoa/SharedBufferCocoa.mm:
(+[WebCoreSharedBufferData initialize]):

Source/WebKitLegacy/mac:

* History/WebBackForwardList.mm:
(+[WebBackForwardList initialize]):
* History/WebHistoryItem.mm:
(+[WebHistoryItem initialize]):
* Misc/WebCache.mm:
(+[WebCache initialize]):
* Misc/WebElementDictionary.mm:
(+[WebElementDictionary initialize]):
* Misc/WebIconDatabase.mm:
* Misc/WebStringTruncator.mm:
(+[WebStringTruncator initialize]):
* Plugins/Hosted/WebHostedNetscapePluginView.mm:
(+[WebHostedNetscapePluginView initialize]):
* Plugins/WebBaseNetscapePluginView.mm:
* Plugins/WebBasePluginPackage.mm:
(+[WebBasePluginPackage initialize]):
* Plugins/WebNetscapePluginView.mm:
(+[WebNetscapePluginView initialize]):
* WebCoreSupport/WebEditorClient.mm:
(+[WebUndoStep initialize]):
* WebCoreSupport/WebFrameLoaderClient.mm:
(+[WebFramePolicyListener initialize]):
* WebView/WebArchive.mm:
(+[WebArchivePrivate initialize]):
* WebView/WebDataSource.mm:
(+[WebDataSource initialize]):
* WebView/WebHTMLView.mm:
(+[WebHTMLViewPrivate initialize]):
(+[WebHTMLView initialize]):
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
* WebView/WebResource.mm:
(+[WebResourcePrivate initialize]):
* WebView/WebTextIterator.mm:
(+[WebTextIteratorPrivate initialize]):
* WebView/WebView.mm:
(+[WebView initialize]):
* WebView/WebViewData.mm:
(+[WebViewPrivate initialize]):

Source/WTF:

Simplify main thread initialization on macOS by always using pthread main as main thread.
The complexity is now isolated to the USE(WEB_THREAD) code path.

This patch also adds a debug assertion in WTF::initializeWebThreadPlatform() to make sure
it gets called on the actual main thread. In release, it will log a fault message indicating
it was called on the wrong thread.

* wtf/MainThread.cpp:
* wtf/MainThread.h:
* wtf/RefCounted.h:
(WTF::RefCountedBase::RefCountedBase):
(WTF::RefCountedBase::applyRefDerefThreadingCheck const):
* wtf/cocoa/MainThreadCocoa.mm:
(WTF::initializeMainThreadPlatform):
(WTF::scheduleDispatchFunctionsOnMainThread):
(WTF::initializeWebThreadPlatform):
(WTF::canAccessThreadLocalDataForThread):
(WTF::isMainThread):
* wtf/generic/MainThreadGeneric.cpp:
* wtf/text/cf/StringImplCF.cpp:
(WTF::StringImpl::createCFString):
* wtf/win/MainThreadWin.cpp:

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

9 months agoImport apng testcases from WPT.
clopez@igalia.com [Tue, 15 Oct 2019 22:36:18 +0000 (22:36 +0000)]
Import apng testcases from WPT.
https://bugs.webkit.org/show_bug.cgi?id=202783

Reviewed by Simon Fraser.

LayoutTests/imported/w3c:

Import apng tests from WTP.

* resources/import-expectations.json:
* web-platform-tests/apng/META.yml: Added.
* web-platform-tests/apng/animated-png-timeout-expected.html: Added.
* web-platform-tests/apng/animated-png-timeout.html: Added.
* web-platform-tests/apng/supported-in-source-type-expected.txt: Added.
* web-platform-tests/apng/supported-in-source-type.html: Added.
* web-platform-tests/apng/w3c-import.log: Added.

LayoutTests:

Import apng tests from WTP

* TestExpectations: Mark the new imported test as failing. One already
has a fix and the other would pass once the support for reftest-wait
is implemented in the tooling.

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

9 months agoTool to mark jsc test skip/enable
zhifei_fang@apple.com [Tue, 15 Oct 2019 22:24:04 +0000 (22:24 +0000)]
Tool to mark jsc test skip/enable
https://bugs.webkit.org/show_bug.cgi?id=202063

Reviewed by Keith Miller.

* Scripts/run-javascriptcore-tests:
(runJSCStressTests):
* Scripts/run-jsc-stress-tests:

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

9 months ago[Picture-in-Picture Web API] Implement HTMLVideoElement.requestPictureInPicture(...
commit-queue@webkit.org [Tue, 15 Oct 2019 22:06:23 +0000 (22:06 +0000)]
[Picture-in-Picture Web API] Implement HTMLVideoElement.requestPictureInPicture() / Document.exitPictureInPicture()
https://bugs.webkit.org/show_bug.cgi?id=201024

Patch by Peng Liu <peng.liu6@apple.com> on 2019-10-15
Reviewed by Eric Carlson.

LayoutTests/imported/w3c:

Import wpt/picture-in-picture.

* resources/import-expectations.json:
* web-platform-tests/picture-in-picture/META.yml: Added.
* web-platform-tests/picture-in-picture/css-selector.html: Added.
* web-platform-tests/picture-in-picture/disable-picture-in-picture.html: Added.
* web-platform-tests/picture-in-picture/enter-picture-in-picture.html: Added.
* web-platform-tests/picture-in-picture/exit-picture-in-picture.html: Added.
* web-platform-tests/picture-in-picture/idlharness.window.html: Added.
* web-platform-tests/picture-in-picture/idlharness.window.js: Added.
* web-platform-tests/picture-in-picture/leave-picture-in-picture.html: Added.
* web-platform-tests/picture-in-picture/mediastream.html: Added.
* web-platform-tests/picture-in-picture/picture-in-picture-element.html: Added.
* web-platform-tests/picture-in-picture/picture-in-picture-window.html: Added.
* web-platform-tests/picture-in-picture/request-picture-in-picture-twice.html: Added.
* web-platform-tests/picture-in-picture/request-picture-in-picture.html: Added.
* web-platform-tests/picture-in-picture/resources/picture-in-picture-helpers.js: Added.
(loadVideo):
(async.requestPictureInPictureWithTrustedClick):
* web-platform-tests/picture-in-picture/resources/w3c-import.log: Added.
* web-platform-tests/picture-in-picture/shadow-dom.html: Added.
* web-platform-tests/picture-in-picture/w3c-import.log: Added.

Source/JavaScriptCore:

Add configurations for Picture-in-Picture API.

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

Implement the support to enter and exit PiP mode with the Picture-in-Picture API.
Majority work of this patch was done by Carlos Eduardo Ramalho <cadubentzen@gmail.com>.

Also, fix a build error of Modules/webaudio/OfflineAudioContext.cpp because of this patch (due to unified build).

Tests: imported/w3c/web-platform-tests/picture-in-picture/css-selector.html
       imported/w3c/web-platform-tests/picture-in-picture/disable-picture-in-picture.html
       imported/w3c/web-platform-tests/picture-in-picture/enter-picture-in-picture.html
       imported/w3c/web-platform-tests/picture-in-picture/exit-picture-in-picture.html
       imported/w3c/web-platform-tests/picture-in-picture/idlharness.window.html
       imported/w3c/web-platform-tests/picture-in-picture/leave-picture-in-picture.html
       imported/w3c/web-platform-tests/picture-in-picture/mediastream.html
       imported/w3c/web-platform-tests/picture-in-picture/picture-in-picture-element.html
       imported/w3c/web-platform-tests/picture-in-picture/picture-in-picture-window.html
       imported/w3c/web-platform-tests/picture-in-picture/request-picture-in-picture-twice.html
       imported/w3c/web-platform-tests/picture-in-picture/request-picture-in-picture.html
       imported/w3c/web-platform-tests/picture-in-picture/shadow-dom.html

* CMakeLists.txt:
* Configurations/FeatureDefines.xcconfig:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Modules/pictureinpicture/DocumentPictureInPicture.cpp: Added.
(WebCore::DocumentPictureInPicture::exitPictureInPicture):
(WebCore::DocumentPictureInPicture::from):
* Modules/pictureinpicture/DocumentPictureInPicture.h: Added.
(WebCore::DocumentPictureInPicture::pictureInPictureEnabled):
(WebCore::DocumentPictureInPicture::supplementName):
* Modules/pictureinpicture/DocumentPictureInPicture.idl: Added.
* Modules/pictureinpicture/EnterPictureInPictureEvent.cpp: Added.
(WebCore::EnterPictureInPictureEvent::create):
(WebCore::EnterPictureInPictureEvent::EnterPictureInPictureEvent):
* Modules/pictureinpicture/EnterPictureInPictureEvent.h: Added.
* Modules/pictureinpicture/EnterPictureInPictureEvent.idl: Added.
* Modules/pictureinpicture/HTMLVideoElementPictureInPicture.cpp: Added.
(WebCore::HTMLVideoElementPictureInPicture::HTMLVideoElementPictureInPicture):
(WebCore::HTMLVideoElementPictureInPicture::~HTMLVideoElementPictureInPicture):
(WebCore::HTMLVideoElementPictureInPicture::from):
(WebCore::HTMLVideoElementPictureInPicture::requestPictureInPicture):
(WebCore::HTMLVideoElementPictureInPicture::autoPictureInPicture):
(WebCore::HTMLVideoElementPictureInPicture::setAutoPictureInPicture):
(WebCore::HTMLVideoElementPictureInPicture::disablePictureInPicture):
(WebCore::HTMLVideoElementPictureInPicture::setDisablePictureInPicture):
(WebCore::HTMLVideoElementPictureInPicture::exitPictureInPicture):
(WebCore::HTMLVideoElementPictureInPicture::didEnterPictureInPicture):
(WebCore::HTMLVideoElementPictureInPicture::didExitPictureInPicture):
* Modules/pictureinpicture/HTMLVideoElementPictureInPicture.h: Added.
(WebCore::HTMLVideoElementPictureInPicture::supplementName):
* Modules/pictureinpicture/HTMLVideoElementPictureInPicture.idl: Added.
* Modules/pictureinpicture/PictureInPictureWindow.cpp: Added.
(WebCore::PictureInPictureWindow::create):
(WebCore::PictureInPictureWindow::PictureInPictureWindow):
(WebCore::PictureInPictureWindow::activeDOMObjectName const):
(WebCore::PictureInPictureWindow::canSuspendForDocumentSuspension const):
(WebCore::PictureInPictureWindow::eventTargetInterface const):
(WebCore::PictureInPictureWindow::scriptExecutionContext const):
* Modules/pictureinpicture/PictureInPictureWindow.h: Added.
* Modules/pictureinpicture/PictureInPictureWindow.idl: Added.
* Modules/webaudio/OfflineAudioContext.cpp:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* dom/Document.cpp:
(WebCore::Document::pictureInPictureElement const):
(WebCore::Document::setPictureInPictureElement):
* dom/Document.h:
* dom/DocumentOrShadowRoot.idl:
* dom/EventNames.h:
* dom/EventNames.in:
* dom/EventTargetFactory.in:
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::pictureInPictureElement const):
* dom/ShadowRoot.h:
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::fullscreenModeChanged):
(WebCore::HTMLVideoElement::setPictureInPictureObserver):
* html/HTMLVideoElement.h:
* page/Settings.yaml:
* platform/PictureInPictureObserver.h: Added.
(WebCore::PictureInPictureObserver::~PictureInPictureObserver):
* testing/InternalSettings.h:

Source/WebCore/PAL:

Add configurations for the Picture-in-Picture API.

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

Add configurations for Picture-in-Picture API and add a preference option for it.

* Configurations/FeatureDefines.xcconfig:
* Shared/WebPreferences.yaml:

Source/WebKitLegacy/mac:

Add configurations for Picture-in-Picture API and also a preference option for it.

* Configurations/FeatureDefines.xcconfig:
* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences pictureInPictureAPIEnabled]):
(-[WebPreferences setPictureInPictureAPIEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Tools:

Add configurations for Picture-in-Picture API and enable it in the test runner.

* Scripts/webkitperl/FeatureList.pm:
* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::beginTesting):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setPictureInPictureAPIEnabled):
* WebKitTestRunner/InjectedBundle/TestRunner.h:

LayoutTests:

Skip imported/w3c/web-platform-tests/picture-in-picture because of http://webkit.org/b/202617.

* TestExpectations:
* tests-options.json:

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

9 months agoAdd TextStream dumping for ThemeTypes enums
simon.fraser@apple.com [Tue, 15 Oct 2019 21:29:28 +0000 (21:29 +0000)]
Add TextStream dumping for ThemeTypes enums
https://bugs.webkit.org/show_bug.cgi?id=202972

Reviewed by Dean Jackson.

Make ControlPart, SelectionPart, ThemeFont and ThemeColor dumpable.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/ThemeTypes.cpp: Added.
(WebCore::operator<<):
* platform/ThemeTypes.h:

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

9 months agoAdd dumping for Animation and AnimationList
simon.fraser@apple.com [Tue, 15 Oct 2019 21:18:37 +0000 (21:18 +0000)]
Add dumping for Animation and AnimationList
https://bugs.webkit.org/show_bug.cgi?id=202973

Reviewed by Dean Jackson.

Make Animation, AnimationList and related enums dumpable.

* platform/animation/Animation.cpp:
(WebCore::operator<<):
* platform/animation/Animation.h:
* platform/animation/AnimationList.cpp:
(WebCore::operator<<):
* platform/animation/AnimationList.h:

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

9 months agoLayout test fast/events/touch/ios/passive-by-default-on-document-and-window.html...
dino@apple.com [Tue, 15 Oct 2019 21:16:16 +0000 (21:16 +0000)]
Layout test fast/events/touch/ios/passive-by-default-on-document-and-window.html is a flaky failure on Internal iOS Testers
https://bugs.webkit.org/show_bug.cgi?id=202858
<rdar://51829520>

Update expected results.

* fast/events/touch/ios/passive-by-default-on-document-and-window-expected.txt:

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

9 months agoDon't mutate a NinePieceImage to create a mask default image
simon.fraser@apple.com [Tue, 15 Oct 2019 21:06:30 +0000 (21:06 +0000)]
Don't mutate a NinePieceImage to create a mask default image
https://bugs.webkit.org/show_bug.cgi?id=202967

Reviewed by Dean Jackson.

For every StyleRareNonInheritedData, the maskBoxImage undergoes copy-on-write
via maskBoxImage.setMaskDefaults(). Fix by giving NinePieceImage a constructor
argument that cna make the mask flavor of image.

* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertBorderMask):
(WebCore::StyleBuilderConverter::convertReflection):
* rendering/style/NinePieceImage.cpp:
(WebCore::NinePieceImage::defaultMaskData):
(WebCore::NinePieceImage::NinePieceImage):
* rendering/style/NinePieceImage.h:
(WebCore::NinePieceImage::setMaskDefaults): Deleted.
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
* rendering/style/StyleReflection.h:
(WebCore::StyleReflection::StyleReflection):

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

9 months agoMove headers to keep from a HTTPHeaderNameSet to an OptionSet
youenn@apple.com [Tue, 15 Oct 2019 20:54:22 +0000 (20:54 +0000)]
Move headers to keep from a HTTPHeaderNameSet to an OptionSet
https://bugs.webkit.org/show_bug.cgi?id=202977

Reviewed by Anders Carlsson.

Source/WebCore:

Covered by existing tests.
New representation is smaller and more efficient to process.

* loader/CrossOriginAccessControl.cpp:
(WebCore::httpHeadersToKeepFromCleaning):
(WebCore::cleanHTTPRequestHeadersForAccessControl):
* loader/CrossOriginAccessControl.h:
(WebCore::cleanHTTPRequestHeadersForAccessControl): Deleted.
* loader/ResourceLoaderOptions.h:

Source/WebKit:

* NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::decode):
* NetworkProcess/NetworkResourceLoadParameters.h:

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