WebKit-https.git
15 months ago[Cocoa] reduce unnecessary use of .mm source files in WTF, spruce up some implementat...
darin@apple.com [Sat, 30 Jun 2018 00:23:43 +0000 (00:23 +0000)]
[Cocoa] reduce unnecessary use of .mm source files in WTF, spruce up some implementation details
https://bugs.webkit.org/show_bug.cgi?id=186924

Reviewed by Anders Carlsson.

* WTF.xcodeproj/project.pbxproj: Update for file and directory renames, file type changes,
and deletions.

* wtf/MemoryPressureHandler.cpp:
(WTF::MemoryPressureHandler::holdOff): Deleted empty placeholder; this one is not needed.

* wtf/PlatformMac.cmake: Update for file and directory renames, file type changes,
and deletions.

* wtf/cocoa/CPUTimeCocoa.cpp: Renamed from Source/WTF/wtf/cocoa/CPUTimeCocoa.mm.

* wtf/text/cocoa/StringImplCocoa.mm: Renamed from Source/WTF/wtf/text/mac/StringImplMac.mm.
Also removed an unneeded include.

* wtf/text/cocoa/StringViewCocoa.mm: Renamed from Source/WTF/wtf/text/mac/StringViewObjC.mm.

* wtf/text/cocoa/TextBreakIteratorInternalICUCocoa.cpp: Renamed from
Source/WTF/wtf/text/mac/TextBreakIteratorInternalICUMac.mm.

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

15 months ago[macOS] Do not crash if there is an attempt to copy a file URL to the clipboard
commit-queue@webkit.org [Sat, 30 Jun 2018 00:06:25 +0000 (00:06 +0000)]
[macOS] Do not crash if there is an attempt to copy a file URL to the clipboard
https://bugs.webkit.org/show_bug.cgi?id=187183

Patch by Aditya Keerthi <akeerthi@apple.com> on 2018-06-29
Reviewed by Wenson Hsieh.

Source/WebKit:

r210683 introduced logic to prevent file URLs from being copied to the clipboard
in unexpected cases. The current logic always crashes the WebProcess if
webProcessProxy->checkURLReceivedFromWebProcess returns false. Instead of
crashing, we can fail silently and not copy anything to the clipboard.

* UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
(WebKit::WebPasteboardProxy::setPasteboardPathnamesForType): Removed call to markCurrentlyDispatchedMessageAsInvalid() which was causing the process to crash.

Tools:

Added a 'runSingly' option to the TestOptions struct. Setting this option to true
will force a new PlatformWebView to be created before running a test. This ensures
that any state set by previous tests are not preserved.

One example of the importance of having this ability is in the case where we want
to test functionality that deals with read access to files. If a test were to
load a valid file URL, universal read access will be granted in WebProcessProxy.
This prevents us from testing cases that rely on us not have universal read
access. Now, if we write the test using the 'runSingly' option, any state set
by previous tests is cleared. Consequently, our test will behave as expected.

* WebKitTestRunner/PlatformWebView.h:
(WTR::PlatformWebView::viewSupportsOptions const):
* WebKitTestRunner/TestController.cpp:
(WTR::updateTestOptionsFromTestHeader):
* WebKitTestRunner/TestOptions.h:
(WTR::TestOptions::hasSameInitializationOptions const):

LayoutTests:

Added a test to ensure that the WebProcess does not crash if we attempt to copy a
file URL to the clipboard. The test also ensures the clipboard content remains
unchanged.

* TestExpectations:
* http/tests/security/pasteboard-file-url-expected.txt: Added.
* http/tests/security/pasteboard-file-url.html: Added.
* platform/mac-wk2/TestExpectations:

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

15 months agoDon't use tracePoints in JS/Wasm entry
sbarati@apple.com [Sat, 30 Jun 2018 00:05:36 +0000 (00:05 +0000)]
Don't use tracePoints in JS/Wasm entry
https://bugs.webkit.org/show_bug.cgi?id=187196

Reviewed by Mark Lam.

This puts VM entry and Wasm entry tracePoints behind a runtime
option. This is a ~4x speedup on a soon to be released Wasm
benchmark. tracePoints should basically never run more than 50
times a second. Entering the VM and entering Wasm are user controlled,
and can happen hundreds of thousands of times in a second. Depending
on how the Wasm/JS code is structured, this can be disastrous for
performance.

* runtime/Options.h:
* runtime/VMEntryScope.cpp:
(JSC::VMEntryScope::VMEntryScope):
(JSC::VMEntryScope::~VMEntryScope):
* wasm/WasmBBQPlan.cpp:
(JSC::Wasm::BBQPlan::compileFunctions):
* wasm/js/WebAssemblyFunction.cpp:
(JSC::callWebAssemblyFunction):

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

15 months agoWe shouldn't recurse into the parser when gathering metadata about various function...
sbarati@apple.com [Fri, 29 Jun 2018 23:40:25 +0000 (23:40 +0000)]
We shouldn't recurse into the parser when gathering metadata about various function offsets
https://bugs.webkit.org/show_bug.cgi?id=184074
<rdar://problem/37165897>

Reviewed by Mark Lam.

JSTests:

* microbenchmarks/try-get-by-id-basic.js:
(const.bench.f.const.fooPlusBar.createBuiltin):
* microbenchmarks/try-get-by-id-polymorphic.js:
(fooPlusBar.createBuiltin):
* stress/array-push-with-force-exit.js:
* stress/dont-crash-on-stack-overflow-when-parsing-builtin.js: Added.
(f):
* stress/dont-crash-on-stack-overflow-when-parsing-default-constructor.js: Added.
(foo):
(prototype.runNearStackLimit):
* stress/is-constructor.js:
* stress/tailCallForwardArguments.js:
(putFuncToPrivateName.createBuiltin):

Source/JavaScriptCore:

Prior to this patch, when we made a builtin, we had to make an UnlinkedFunctionExecutable
for that builtin. This required calling into the parser. However, the parser
may throw a stack overflow. We were not able to recover from that. The only
reason we called into the parser here is that we were gathering text offsets
and various metadata for things in the builtin function. This patch writes a
mini parser that figures this information out without calling into the full
parser. (I've also added a debug assert that verifies the mini parser stays in
sync with the full parser.) The result of this is that BuiltinExecutbles::createExecutable
always succeeds.

* builtins/AsyncFromSyncIteratorPrototype.js:
(globalPrivate.createAsyncFromSyncIterator):
(globalPrivate.AsyncFromSyncIteratorConstructor):
* builtins/BuiltinExecutables.cpp:
(JSC::BuiltinExecutables::createExecutable):
* builtins/GlobalOperations.js:
(globalPrivate.getter.overriddenName.string_appeared_here.speciesGetter):
(globalPrivate.speciesConstructor):
(globalPrivate.copyDataProperties):
(globalPrivate.copyDataPropertiesNoExclusions):
* builtins/PromiseOperations.js:
(globalPrivate.newHandledRejectedPromise):
* builtins/RegExpPrototype.js:
(globalPrivate.hasObservableSideEffectsForRegExpMatch):
(globalPrivate.hasObservableSideEffectsForRegExpSplit):
* builtins/StringPrototype.js:
(globalPrivate.hasObservableSideEffectsForStringReplace):
(globalPrivate.getDefaultCollator):
* parser/Nodes.cpp:
(JSC::FunctionMetadataNode::FunctionMetadataNode):
(JSC::FunctionMetadataNode::operator== const):
(JSC::FunctionMetadataNode::dump const):
* parser/Nodes.h:
* parser/Parser.h:
(JSC::parse):
* parser/ParserError.h:
(JSC::ParserError::type const):
* parser/ParserTokens.h:
(JSC::JSTextPosition::operator== const):
(JSC::JSTextPosition::operator!= const):
* parser/SourceCode.h:
(JSC::SourceCode::operator== const):
(JSC::SourceCode::operator!= const):
(JSC::SourceCode::subExpression const):
(JSC::SourceCode::subExpression): Deleted.

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

15 months agoAX: [iOS] VoiceOver scroll position is jumpy in frames
n_wang@apple.com [Fri, 29 Jun 2018 23:33:30 +0000 (23:33 +0000)]
AX: [iOS] VoiceOver scroll position is jumpy in frames
https://bugs.webkit.org/show_bug.cgi?id=186956

Reviewed by Simon Fraser.

Source/WebCore:

iOS is using delegate scrolling and we should not take into account
the scroll offset when converting rects.

Also fixed a issue where we want to scroll the element into view even
if it's partially visible.

Test: fast/scrolling/ios/iframe-scroll-into-view.html

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::scrollToMakeVisible const):
* platform/ScrollView.cpp:
(WebCore::ScrollView::contentsToContainingViewContents const):

LayoutTests:

* fast/scrolling/ios/iframe-scroll-into-view-expected.html: Added.
* fast/scrolling/ios/iframe-scroll-into-view.html: Added.

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

15 months ago[lldb-webkit] Non-empty strings may be pretty-printed as empty
dbates@webkit.org [Fri, 29 Jun 2018 23:17:45 +0000 (23:17 +0000)]
[lldb-webkit] Non-empty strings may be pretty-printed as empty
https://bugs.webkit.org/show_bug.cgi?id=187185

Reviewed by Simon Fraser.

For some reason lldb(1) sometimes has an issue accessing members of WTF::StringImplShape
via a WTF::StringImpl pointer (why?). Explicitly casting a WTF::StringImpl* to a
WTF::StringImplShape* before accessing such members makes LLDB happy.

I tried writing a test for this both for the LLVM project and to add to our lldb_webkit unit
tests to no avail. I have only been able to reproduce this bug sporadically during my WebCore/WebKit
debugging sessions so far.

* lldb/lldb_webkit.py:
(WTFStringImplProvider.__init__): Explicitly cast the WTF::StringImpl* to WTF::StringImplShape*.
(WTFStringImplProvider.get_data8): Update code now that we are directly accessing WTF::StringImplShape*.
(WTFStringImplProvider.get_data16): Ditto.

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

15 months agoWebKitLegacy: Can trigger recursive loads triggering debug assertions
cdumez@apple.com [Fri, 29 Jun 2018 22:56:29 +0000 (22:56 +0000)]
WebKitLegacy: Can trigger recursive loads triggering debug assertions
https://bugs.webkit.org/show_bug.cgi?id=187121
<rdar://problem/41259430>

Reviewed by Brent Fulgham.

Source/WebCore:

In order to support asynchronous policy delegates, r229722 added a call to
FrameLoader::clearProvisionalLoadForPolicyCheck() when starting a navigation
policy decision in PolicyChecker::checkNavigationPolicy(). This calls
stopLoading() on the current provisional loader if there is one, and potentially
calls the didFailProvisionalLoadWithError cleint delegate. This delegate call
is synchronous on WebKit1, so the client may start a new load from this delegate
and re-enter Webcore. This happens in practive with Quickens 2017 / 2018 on Mac.

Before r229722, this was not an issue because pending loads were canceled after
the (asynchronous) navigation policy decision, via FrameLoader::stopAllLoaders().
FrameLoader::stopAllLoaders() sets a m_inStopAllLoaders flag and we return early
in FrameLoader::loadRequest() when this flag is set to prevent recursive loads.

To maintain shipping behavior as much as possible, this patch introduces a similar
inClearProvisionalLoadForPolicyCheck which gets set during
FrameLoader::clearProvisionalLoadForPolicyCheck() and we prevent new loads while
this flag is set.

I have verified that Quickens 2017 / 2018 works again after this change and I added
API test coverage for this behavior.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::load):
(WebCore::FrameLoader::clearProvisionalLoadForPolicyCheck):
* loader/FrameLoader.h:

Tools:

Add API test coverage.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/mac/StartLoadInDidFailProvisionalLoad.mm: Added.
(-[StartLoadInDidFailProvisionalLoadDelegate webView:didFailProvisionalLoadWithError:forFrame:]):
(-[StartLoadInDidFailProvisionalLoadDelegate webView:didFinishLoadForFrame:]):
(TestWebKitAPI::TEST):

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

15 months agoTeach bisect-builds to retrieve supported platforms from the rest api.
lforschler@apple.com [Fri, 29 Jun 2018 22:51:59 +0000 (22:51 +0000)]
Teach bisect-builds to retrieve supported platforms from the rest api.

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

15 months agorun-jsc should print when jsc exits with non-zero status
keith_miller@apple.com [Fri, 29 Jun 2018 21:17:35 +0000 (21:17 +0000)]
run-jsc should print when jsc exits with non-zero status
https://bugs.webkit.org/show_bug.cgi?id=187192

Reviewed by Saam Barati.

* Scripts/run-jsc:

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

15 months agoRegression(r233359): Caused ITP tests to be flaky
cdumez@apple.com [Fri, 29 Jun 2018 21:00:50 +0000 (21:00 +0000)]
Regression(r233359): Caused ITP tests to be flaky
https://bugs.webkit.org/show_bug.cgi?id=187189

Reviewed by Youenn Fablet.

r233359 started using m_resolvedConfiguration.resourceLoadStatisticsDirectory instead of
m_configuration.resourceLoadStatisticsDirectory for the ITP path. This is consistent
with what we do for other database paths so that things like '~' in paths get resolved.

This introduced flakiness because the resourceLoadStatisticsDirectory was never getting
resolved and m_resolvedConfiguration.resourceLoadStatisticsDirectory was not set.
Update the WebsiteDataStore so that m_resolvedConfiguration.resourceLoadStatisticsDirectory
properly gets set to the resolved version of m_configuration.resourceLoadStatisticsDirectory.

* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
(WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):

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

15 months agoLayout Test webrtc/datachannel/mdns-ice-candidates.html is flaky
ryanhaddad@apple.com [Fri, 29 Jun 2018 20:59:14 +0000 (20:59 +0000)]
Layout Test webrtc/datachannel/mdns-ice-candidates.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=187180

Unreviewed test gardening.

Patch by Truitt Savell <tsavell@apple.com> on 2018-06-29

* TestExpectations:

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

15 months agoLayout Test js/error-should-not-strong-reference-global-object.html is flaky on macOS
ryanhaddad@apple.com [Fri, 29 Jun 2018 20:47:45 +0000 (20:47 +0000)]
Layout Test js/error-should-not-strong-reference-global-object.html is flaky on macOS
https://bugs.webkit.org/show_bug.cgi?id=187103

Unreviewed test gardening

Patch by Truitt Savell <tsavell@apple.com> on 2018-06-29

* platform/mac-wk2/TestExpectations:
* platform/mac/TestExpectations:

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

15 months ago[ews-build] Add timeout to webkitpy and webkitperl tests
aakash_jain@apple.com [Fri, 29 Jun 2018 20:25:44 +0000 (20:25 +0000)]
[ews-build] Add timeout to webkitpy and webkitperl tests
https://bugs.webkit.org/show_bug.cgi?id=187191

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/steps.py:
(RunWebKitPerlTests.__init__): Set timeout of 2 minutes.
(RunWebKitPyTests.__init__): Ditto.
* BuildSlaveSupport/ews-build/steps_unittest.py: Updated unit-tests.

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

15 months agoResource Load Statistics: Don't create a WebResourceLoadStatisticsStore for ephemeral...
wilander@apple.com [Fri, 29 Jun 2018 20:11:39 +0000 (20:11 +0000)]
Resource Load Statistics: Don't create a WebResourceLoadStatisticsStore for ephemeral sessions
https://bugs.webkit.org/show_bug.cgi?id=187154
<rdar://problem/41487250>

Reviewed by Brent Fulgham and Chris Dumez.

Most of the changes in this patch remove the boolean parameter for tracking
ephemeral sessions and the IsReadOnly enum.

* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _setResourceLoadStatisticsTestingCallback:]):
    Now returns early for ephemeral sessions.
* UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
(WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage):
(WebKit::ResourceLoadStatisticsPersistentStorage::writeMemoryStoreToDisk):
(WebKit::ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore):
* UIProcess/ResourceLoadStatisticsPersistentStorage.h:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
* UIProcess/WebResourceLoadStatisticsStore.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
    Now returns early for ephemeral sessions.
(WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):

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

15 months agoInfinite loop if a <use> element references its ancestor and the DOMNodeInserted...
said@apple.com [Fri, 29 Jun 2018 19:24:45 +0000 (19:24 +0000)]
Infinite loop if a <use> element references its ancestor and the DOMNodeInserted event handler of one its ancestor's descents updates the document style
https://bugs.webkit.org/show_bug.cgi?id=186925

Reviewed by Antti Koivisto.

Source/WebCore:

This patches fixes two issues:
-- SVGTRefTargetEventListener should not assume it has to be attached to
target when its handleEvent() is called.
Because SVGTRefTargetEventListener::handleEvent() references the target
element, we just return if the listener is detached.

-- The <use> element should not clone its shadow tree if it references one
of its ancestors. The DOMNodeInserted of any node in the target element
tree may issue a document command. This document command will cause the
shadow tree to be re-cloned so this will cause infinite loop to happen.

Test: svg/dom/svg-use-infinite-loop-cloning.html

* svg/SVGTRefElement.cpp:
(WebCore::SVGTRefTargetEventListener::handleEvent):
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::updateShadowTree):

LayoutTests:

* svg/dom/svg-use-infinite-loop-cloning-expected.txt: Added.
* svg/dom/svg-use-infinite-loop-cloning.html: Added.

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

15 months ago[WPE] Three CSS Grid Layout tests crash due to valueless std::optional access
rego@igalia.com [Fri, 29 Jun 2018 18:54:41 +0000 (18:54 +0000)]
[WPE] Three CSS Grid Layout tests crash due to valueless std::optional access
https://bugs.webkit.org/show_bug.cgi?id=186752

Reviewed by Frédéric Wang.

Source/WebCore:

This is a simple fix for the crash we're getting on WPE
in IndefiniteSizeStrategy::freeSpaceForStretchAutoTracksStep().

Covered by existent tests, just remove them from TestExpectations file.

* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::IndefiniteSizeStrategy::freeSpaceForStretchAutoTracksStep const):
Check if minSize is null before trying to access it's value.

LayoutTests:

* platform/wpe/TestExpectations: Remove tests from TestExpectations file
as they're passing now.

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

15 months ago[WPE]: Fix exception handling when flatpak is not installed
clopez@igalia.com [Fri, 29 Jun 2018 18:12:50 +0000 (18:12 +0000)]
[WPE]: Fix exception handling when flatpak is not installed
https://bugs.webkit.org/show_bug.cgi?id=186771

Unreviewed followup-fix after r233362

This was causing failures when flatpak is not installed.

* flatpak/flatpakutils.py:
(check_flatpak):

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

15 months ago[JSCOnly] Restore Windows build.
ross.kirsling@sony.com [Fri, 29 Jun 2018 17:55:24 +0000 (17:55 +0000)]
[JSCOnly] Restore Windows build.
https://bugs.webkit.org/show_bug.cgi?id=187127

Reviewed by Michael Catanzaro.

.:

* Source/cmake/OptionsJSCOnly.cmake:
Don't forget to set -DUCHAR_TYPE=wchar_t for ICU on Windows.
Use bin64/lib64 on Windows (for consistency with full WebKit build).

Tools:

* Scripts/build-jsc:
Fix condition for disabling FTL JIT on Windows.

* Scripts/webkitdirs.pm:
(executableProductDir):
JSCOnly should still use bin64 on Windows (for consistency with full WebKit build).
(determineIsWin64):
JSCOnly already defaults to 64-bit on Windows with Ninja -- ensure that this is true even with MSBuild.

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

15 months ago[GTK][WPE]: Add a way to setup our development environment inside flatpak
commit-queue@webkit.org [Fri, 29 Jun 2018 17:47:17 +0000 (17:47 +0000)]
[GTK][WPE]: Add a way to setup our development environment inside flatpak
https://bugs.webkit.org/show_bug.cgi?id=186771

Patch by Thibault Saunier <tsaunier@igalia.com> on 2018-06-29
Reviewed by Carlos Alberto Lopez Perez.

Tools:

This patch introduce a way to setup the development environment inside flatpak[0]
removing the need for jhbuild when doing so. Anything needed to build/run minibrowser/ run
layout tests is provided either but the org.gnome.Sdk runtime or built with flatpak-builder.

The workflow is very similar to the "jhbuild based" one except that you should use update-webkit$PORTNAME-flatpak instead
of update-webkit$PORTNAME-libs and that script requires to specify a build configuration (--release is default).

Our scripts have been updated to be able to run inside that new build environment.

Since everything runs inside a flatpak sandbox, gdb needs to be run from within the sandbox, the script exposes a way to do it
easily with the `--gdb` option:

  $ webkit-flatpak --gdb [-m COREDUMPCTL MATCHES]

The Layout test `GDBCrashLogGenerator` has been taugth how to use that and is able to retrieve stacktrace as with the jhbuild based workflow.

[0] http://flatpak.org

* Scripts/build-webkit:
* Scripts/generate-jsc-bundle:
(main):
* Scripts/run-gtk-tests:
* Scripts/run-minibrowser:
* Scripts/run-webdriver-tests:
* Scripts/run-webkit-tests:
* Scripts/run-wpe-tests:
* Scripts/update-webkitgtk-libs:
* Scripts/update-webkitwpe-libs:
* Scripts/webkit-flatpak: Added.
* Scripts/webkitdirs.pm:
(getJhbuildPath):
(getFlatpakPath):
(inFlatpakSandbox):
(runInFlatpak):
(runInFlatpakIfAvalaible):
(wrapperPrefixIfNeeded):
(shouldUseFlatpak):
* Scripts/webkitpy/port/base.py:
(Port._path_to_apache):
(Port._is_flatpak):
(Port._apache_config_file_name_for_platform):
(Port._should_use_flatpak):
(Port):
(Port._in_flatpak_sandbox):
(Port._should_use_jhbuild):
* Scripts/webkitpy/port/gtk.py:
(GtkPort.setup_environ_for_server):
* Scripts/webkitpy/port/linux_get_crash_log.py:
(GDBCrashLogGenerator._get_trace_from_systemd):
(GDBCrashLogGenerator.generate_crash_log):
* Scripts/webkitpy/port/wpe.py:
(WPEPort.setup_environ_for_server):
* Scripts/webkitpy/w3c/wpt_runner.py:
(main):
* flatpak/files/default.xkm: Added.
* flatpak/files/httpd-autogen.sh: Added.
* flatpak/flatpakutils.py: Added.
(Colors):
(Console):
(Console.message):
(remove_extension_points):
(remove_comments):
(remove_comments._replacer):
(load_manifest):
(expand_manifest):
(FlatpakObject):
(FlatpakObject.__init__):
(FlatpakObject.flatpak):
(FlatpakPackages):
(FlatpakPackages.__init__):
(FlatpakPackages.__detect_packages):
(FlatpakPackages.__detect_packages.in):
(FlatpakPackages.__detect_runtimes):
(FlatpakPackages.__detect_apps):
(FlatpakPackages.__iter__):
(FlatpakRepos):
(FlatpakRepos.__init__):
(FlatpakRepos.update):
(FlatpakRepos.add):
(FlatpakRepo):
(FlatpakRepo.__init__):
(FlatpakRepo.repo_file):
(FlatpakPackage):
(FlatpakPackage.__init__):
(FlatpakPackage.__str__):
(FlatpakPackage.is_installed):
(FlatpakPackage.install):
(FlatpakPackage.update):
(WebkitFlatpak):
(WebkitFlatpak.load_from_args):
(WebkitFlatpak.__init__):
(WebkitFlatpak.check_flatpak):
(WebkitFlatpak.check_flatpak.comparable_version):
(WebkitFlatpak.clean_args):
(WebkitFlatpak.run_in_sandbox):
(WebkitFlatpak.run):
(WebkitFlatpak.has_environment):
(WebkitFlatpak.setup_dev_env):
(WebkitFlatpak.install_all):
(WebkitFlatpak.run_gdb):
(WebkitFlatpak.update_all):
(is_sandboxed):
(run_in_sandbox_if_available):
* flatpak/org.webkit.GTK.yaml: Added.
* flatpak/org.webkit.WPE.yaml: Added.
* flatpak/org.webkit.WebKit.yaml: Added.
* flatpak/patches/httpd-0001-configure-use-pkg-config-for-PCRE-detection.patch: Added.
* flatpak/patches/xvfb-0001-HACK-Avoid-compiling-a-kbm-file.patch: Added.

LayoutTests:

* http/conf/flatpak-httpd.conf: Added. Apache configuration file to be used inside flaptak.

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

15 months agoUnreviewed, rolling out r233349.
david_fenton@apple.com [Fri, 29 Jun 2018 17:42:00 +0000 (17:42 +0000)]
Unreviewed, rolling out r233349.

caused 42 crashes on iOS GuardMalloc and iOS ASan tests

Reverted changeset:

"[Web Animations] Using a Web Animation leaks the Document"
https://bugs.webkit.org/show_bug.cgi?id=187088
https://trac.webkit.org/changeset/233349

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

15 months agoReturning PiP'd video to fullscreen while playing leaves video muted.
jer.noble@apple.com [Fri, 29 Jun 2018 17:15:08 +0000 (17:15 +0000)]
Returning PiP'd video to fullscreen while playing leaves video muted.
https://bugs.webkit.org/show_bug.cgi?id=187181
<rdar://problem/41408335>

Reviewed by Eric Carlson.

Source/WebCore:

Test: media/picture-in-picture-interruption.html

Don't reset the media session's state at the end of an interruption if it wasn't changed an the beginning of one.

* platform/audio/PlatformMediaSession.cpp:
(WebCore::PlatformMediaSession::endInterruption):
* testing/Internals.cpp:
(WebCore::Internals::mediaSessionState):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* media/picture-in-picture-interruption-expected.txt: Added.
* media/picture-in-picture-interruption.html: Added.

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

15 months agoStop using lambdas for WebResourceLoadStatisticsStore to interact with its WebsiteDat...
cdumez@apple.com [Fri, 29 Jun 2018 16:54:05 +0000 (16:54 +0000)]
Stop using lambdas for WebResourceLoadStatisticsStore to interact with its WebsiteDataStore
https://bugs.webkit.org/show_bug.cgi?id=187165

Reviewed by Brent Fulgham.

Stop using lambdas for WebResourceLoadStatisticsStore to interact with its WebsiteDataStore. Instead,
WebResourceLoadStatisticsStore now holds a weak pointer to its WebsiteDataStore and is able to call
methods on it directly. Reducing the indirection makes the code less complex and more understandable.

* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
(WebKit::WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler):
(WebKit::WebResourceLoadStatisticsStore::callGrantStorageAccessHandler):
(WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
(WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToPartitionOrBlockCookiesHandler):
(WebKit::WebResourceLoadStatisticsStore::callRemoveDomainsHandler):
* UIProcess/WebResourceLoadStatisticsStore.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):

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

15 months agoUnreviewed, rolling out r233347.
ryanhaddad@apple.com [Fri, 29 Jun 2018 15:24:59 +0000 (15:24 +0000)]
Unreviewed, rolling out r233347.

Causes crashes during WK1 tests.

Reverted changeset:

"Disable IsoHeaps when Gigacage is off"
https://bugs.webkit.org/show_bug.cgi?id=187160
https://trac.webkit.org/changeset/233347

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

15 months ago[LFC] When the formatting root is also a containing block for out-of-flow elements.
zalan@apple.com [Fri, 29 Jun 2018 15:20:47 +0000 (15:20 +0000)]
[LFC] When the formatting root is also a containing block for out-of-flow elements.
https://bugs.webkit.org/show_bug.cgi?id=187179

Reviewed by Antti Koivisto.

Out-of-flow descendants' layout requires their containing block height to be computed. This patch takes care of the case
when the containing block is also a formatting context root (e.g. relative positioned with overflow other than visible).

* layout/Verification.cpp:
(WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):

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

15 months ago[LFC] Do not skip the next inflow sibling after finishing a formatting context root...
zalan@apple.com [Fri, 29 Jun 2018 14:47:06 +0000 (14:47 +0000)]
[LFC] Do not skip the next inflow sibling after finishing a formatting context root layout.
https://bugs.webkit.org/show_bug.cgi?id=187178

Reviewed by Antti Koivisto.

Since the block formatting layout is based on pre-order traversal, after finishing a formatting
context layout (which takes care of its entire subtre), we need to visit the next (in-flow)sibling.

* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):

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

15 months agoLayout Test imported/mozilla/css-animations/test_animation-starttime.html is failing.
pvollan@apple.com [Fri, 29 Jun 2018 14:17:38 +0000 (14:17 +0000)]
Layout Test imported/mozilla/css-animations/test_animation-starttime.html is failing.
https://bugs.webkit.org/show_bug.cgi?id=186807

Unreviewed test gardening.

* platform/win/TestExpectations:

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

15 months agoLayout Test fast/text/mark-matches-broken-line-rendering.html is failing
pvollan@apple.com [Fri, 29 Jun 2018 14:10:28 +0000 (14:10 +0000)]
Layout Test fast/text/mark-matches-broken-line-rendering.html is failing
https://bugs.webkit.org/show_bug.cgi?id=187177

Unreviewed test gardening.

* platform/win/TestExpectations:

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

15 months ago[WPE] Some frames are dropped when using rAF to animate an element
magomez@igalia.com [Fri, 29 Jun 2018 13:52:19 +0000 (13:52 +0000)]
[WPE] Some frames are dropped when using rAF to animate an element
https://bugs.webkit.org/show_bug.cgi?id=187175

Always call renderNextFrame in ThreadedCompositor::requestDisplayRefreshMonitorUpdate()
so we have to process any pending layer flush request.

Reviewed by Žan Doberšek.

* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::handleDisplayRefreshMonitorUpdate):

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

15 months agoLayout Test compositing/animation/layer-for-filling-animation.html is a flaky failure
graouts@webkit.org [Fri, 29 Jun 2018 12:35:51 +0000 (12:35 +0000)]
Layout Test compositing/animation/layer-for-filling-animation.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=187163

Unreviewed.

This test needed to be modified to account for the pending state being updated at a different time,
so we just wait a frame to ensure the animation is ended. See r233325.

* compositing/animation/layer-for-filling-animation.html:

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

15 months ago[mac][wk2] REGRESSION (Tiled Drawing): Some css3/ tests fail with fringing around...
graouts@webkit.org [Fri, 29 Jun 2018 12:34:04 +0000 (12:34 +0000)]
[mac][wk2] REGRESSION (Tiled Drawing): Some css3/ tests fail with fringing around tiled background-images that intersect tile boundaries
https://bugs.webkit.org/show_bug.cgi?id=122235

Unreviewed. This test has not been flaky on all ports by GTK for a long time.

* platform/ios-wk1/TestExpectations:
* platform/mac-wk2/TestExpectations:
* platform/wincairo/TestExpectations:

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

15 months ago[LFC] The static position for an out-of-flow box should include the previous sibling...
zalan@apple.com [Fri, 29 Jun 2018 07:55:53 +0000 (07:55 +0000)]
[LFC] The static position for an out-of-flow box should include the previous sibling's collapsed margin
https://bugs.webkit.org/show_bug.cgi?id=187169

Reviewed by Antti Koivisto.

When computing the static position of an absolutely positioned box, we need to look at the previous sibling's bottom margin.
If the previous sibling happens to collapse its bottom margin with the parent's bottom margin, we still need to account for it
and compute the static vertical position as if the bottom margin was not collapsed.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeFloatingHeightAndMargin const):
(WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned):
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::initializeRoot):
* layout/Verification.cpp:
(WebCore::Layout::outputMismatchingBoxInformationIfNeeded):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeInFlowHeightAndMargin const):
* layout/displaytree/DisplayBox.cpp:
(WebCore::Display::Box::nonCollapsedMarginBox const):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::setHasValidVerticalNonCollapsedMargin):
(WebCore::Display::Box::setVerticalMargin):
(WebCore::Display::Box::setVerticalNonCollapsedMargin):
(WebCore::Display::Box::nonCollapsedMarginTop const):
(WebCore::Display::Box::nonCollapsedMarginBottom const):

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

15 months ago[Web Animations] Using a Web Animation leaks the Document
graouts@webkit.org [Fri, 29 Jun 2018 05:45:34 +0000 (05:45 +0000)]
[Web Animations] Using a Web Animation leaks the Document
https://bugs.webkit.org/show_bug.cgi?id=187088
<rdar://problem/41392046>

Reviewed by Dean Jackson.

Source/WebCore:

Test: webanimations/leak-document-with-web-animation.html

We need to ensure that any remaining animation is cleared when the DocumentTimeline is detached from its Document.
We rename WebAnimation::prepareAnimationForRemoval() to WebAnimation::remove() since it really actively disassociates
the animation from its timeline.

* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::removeAnimationsForElement): We no longer need the call to removeAnimation()
since the new WebAnimation::remove() method will also set the timeline to null which will eventually call
removeAnimation() on the disassociated timeline.
* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::remove):
(WebCore::DeclarativeAnimation::prepareAnimationForRemoval): Deleted.
* animation/DeclarativeAnimation.h:
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::detachFromDocument): Call remove() on all known animations.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::remove): Set the timeline to null to fully disassociate this animation from its timeline.
(WebCore::WebAnimation::setTimeline): Factor the internal timeline-association code out of this JS API method so
that we can call this code without any JS-facing implications.
(WebCore::WebAnimation::setTimelineInternal):
(WebCore::WebAnimation::prepareAnimationForRemoval): Deleted.
* animation/WebAnimation.h:

LayoutTests:

Add a new test that creates an Animation object in JS within an iframe and checks that removing
the iframe clears its Document.

* webanimations/leak-document-with-web-animation-expected.txt: Added.
* webanimations/leak-document-with-web-animation.html: Added.
* webanimations/resources/web-animation-leak-iframe.html: Added.

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

15 months ago[LFC] Out-of-flow positioned height does not necessarily equal to "bottom - top".
zalan@apple.com [Fri, 29 Jun 2018 03:45:47 +0000 (03:45 +0000)]
[LFC] Out-of-flow positioned height does not necessarily equal to "bottom - top".
https://bugs.webkit.org/show_bug.cgi?id=187168

Reviewed by Antti Koivisto.

According to the spec "For absolutely positioned elements, the used values of the vertical dimensions must satisfy this constraint:
'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block"
With a non-auto "height" value, the bottom - top does not necessarily compute to the height of the element.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):

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

15 months agoDisable IsoHeaps when Gigacage is off
msaboff@apple.com [Fri, 29 Jun 2018 01:40:26 +0000 (01:40 +0000)]
Disable IsoHeaps when Gigacage is off
https://bugs.webkit.org/show_bug.cgi?id=187160

Reviewed by Saam Barati.

If Gigacage is disabled, it may be due to lack of address space.
Therefore we should also turn off IsoHeaps since it uses more virtual
address space as well.

* bmalloc/IsoTLS.cpp:
(bmalloc::IsoTLS::determineMallocFallbackState):

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

15 months agoIsoCellSet::sweepToFreeList() not safe when Full GC in process
msaboff@apple.com [Fri, 29 Jun 2018 01:37:38 +0000 (01:37 +0000)]
IsoCellSet::sweepToFreeList() not safe when Full GC in process
https://bugs.webkit.org/show_bug.cgi?id=187157

Reviewed by Mark Lam.

* heap/IsoCellSet.cpp:
(JSC::IsoCellSet::sweepToFreeList): Changed the "stale marks logic" to match what
is in MarkedBlock::Handle::specializedSweep where it takes into account whether
or not we are in the process of marking during a full GC.
* heap/MarkedBlock.h:
* heap/MarkedBlockInlines.h:
(JSC::MarkedBlock::Handle::areMarksStaleForSweep): New helper.

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

15 months agoFind in page for typographic quotes does not find low (German) quotes
commit-queue@webkit.org [Fri, 29 Jun 2018 01:19:51 +0000 (01:19 +0000)]
Find in page for typographic quotes does not find low (German) quotes
https://bugs.webkit.org/show_bug.cgi?id=187164
<rdar://problem/29612785>
Source/WebCore:

Patch by Olivia Barnett <obarnett@apple.com> on 2018-06-28
Reviewed by Tim Horton.

Added additional quote test to LayoutTests/fast/text/find-quotes.html.

Added functionality to replace German quotes when matching.

* editing/TextIterator.cpp:
(WebCore::foldQuoteMark):
(WebCore::foldQuoteMarks):

Source/WTF:

Patch by Olivia Barnett <obarnett@apple.com> on 2018-06-28
Reviewed by Tim Horton.

Added Unicode definitions for German quotation marks.

* wtf/unicode/CharacterNames.h:

LayoutTests:

Patch by Olivia Barnett <obarnett@apple.com> on 2018-06-28
Reviewed by Tim Horton.

Added additional test for German quotes.

* fast/text/find-quotes.html:

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

15 months ago[iOS] Unreviewed test gardening.
zalan@apple.com [Fri, 29 Jun 2018 01:00:40 +0000 (01:00 +0000)]
[iOS] Unreviewed test gardening.

* platform/ios/TestExpectations:

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

15 months ago[LFC] Add block formatting only test cases
zalan@apple.com [Fri, 29 Jun 2018 00:53:22 +0000 (00:53 +0000)]
[LFC] Add block formatting only test cases
https://bugs.webkit.org/show_bug.cgi?id=187162

Reviewed by Antti Koivisto.

These tests are expected to generate the same tree output on every platform (no text, strictly block only).

* fast/block/block-only/absolute-auto-with-sibling-margin-bottom-expected.txt: Added.
* fast/block/block-only/absolute-auto-with-sibling-margin-bottom.html: Added.
* fast/block/block-only/absolute-height-stretch-expected.txt: Added.
* fast/block/block-only/absolute-height-stretch.html: Added.
* fast/block/block-only/absolute-left-auto-expected.txt: Added.
* fast/block/block-only/absolute-left-auto.html: Added.
* fast/block/block-only/absolute-left-right-top-bottom-auto-expected.txt: Added.
* fast/block/block-only/absolute-left-right-top-bottom-auto.html: Added.
* fast/block/block-only/absolute-nested-expected.txt: Added.
* fast/block/block-only/absolute-nested.html: Added.
* fast/block/block-only/absolute-nested2-expected.txt: Added.
* fast/block/block-only/absolute-nested2.html: Added.
* fast/block/block-only/absolute-position-when-containing-block-is-not-in-the-formatting-context-expected.txt: Added.
* fast/block/block-only/absolute-position-when-containing-block-is-not-in-the-formatting-context.html: Added.
* fast/block/block-only/absolute-position-when-containing-block-is-not-in-the-formatting-context2-expected.txt: Added.
* fast/block/block-only/absolute-position-when-containing-block-is-not-in-the-formatting-context2.html: Added.
* fast/block/block-only/absolute-simple-expected.txt: Added.
* fast/block/block-only/absolute-simple.html: Added.
* fast/block/block-only/absolute-width-shrink-to-fit-expected.txt: Added.
* fast/block/block-only/absolute-width-shrink-to-fit.html: Added.
* fast/block/block-only/absolute-width-stretch-expected.txt: Added.
* fast/block/block-only/absolute-width-stretch.html: Added.
* fast/block/block-only/absolute-with-static-block-position-nested-expected.txt: Added.
* fast/block/block-only/absolute-with-static-block-position-nested.html: Added.
* fast/block/block-only/almost-intruding-left-float-simple-expected.txt: Added.
* fast/block/block-only/almost-intruding-left-float-simple.html: Added.
* fast/block/block-only/border-simple-expected.txt: Added.
* fast/block/block-only/border-simple.html: Added.
* fast/block/block-only/fixed-nested-expected.txt: Added.
* fast/block/block-only/fixed-nested.html: Added.
* fast/block/block-only/float-left-when-container-has-padding-margin-expected.txt: Added.
* fast/block/block-only/float-left-when-container-has-padding-margin.html: Added.
* fast/block/block-only/floating-box-clear-both-simple-expected.txt: Added.
* fast/block/block-only/floating-box-clear-both-simple.html: Added.
* fast/block/block-only/floating-box-clear-right-simple-expected.txt: Added.
* fast/block/block-only/floating-box-clear-right-simple.html: Added.
* fast/block/block-only/floating-box-left-and-right-multiple-expected.txt: Added.
* fast/block/block-only/floating-box-left-and-right-multiple-with-top-offset-expected.txt: Added.
* fast/block/block-only/floating-box-left-and-right-multiple-with-top-offset.html: Added.
* fast/block/block-only/floating-box-left-and-right-multiple.html: Added.
* fast/block/block-only/floating-box-right-simple-expected.txt: Added.
* fast/block/block-only/floating-box-right-simple.html: Added.
* fast/block/block-only/floating-box-with-clear-siblings-expected.txt: Added.
* fast/block/block-only/floating-box-with-clear-siblings.html: Added.
* fast/block/block-only/floating-box-with-clear-simple-expected.txt: Added.
* fast/block/block-only/floating-box-with-clear-simple.html: Added.
* fast/block/block-only/floating-box-with-new-formatting-context-expected.txt: Added.
* fast/block/block-only/floating-box-with-new-formatting-context.html: Added.
* fast/block/block-only/floating-box-with-relative-positioned-sibling-expected.txt: Added.
* fast/block/block-only/floating-box-with-relative-positioned-sibling.html: Added.
* fast/block/block-only/floating-left-right-simple-expected.txt: Added.
* fast/block/block-only/floating-left-right-simple.html: Added.
* fast/block/block-only/floating-left-right-with-all-margins-expected.txt: Added.
* fast/block/block-only/floating-left-right-with-all-margins.html: Added.
* fast/block/block-only/floating-lefts-and-rights-simple-expected.txt: Added.
* fast/block/block-only/floating-lefts-and-rights-simple.html: Added.
* fast/block/block-only/floating-multiple-lefts-expected.txt: Added.
* fast/block/block-only/floating-multiple-lefts-in-body-expected.txt: Added.
* fast/block/block-only/floating-multiple-lefts-in-body.html: Added.
* fast/block/block-only/floating-multiple-lefts-multiple-lines-expected.txt: Added.
* fast/block/block-only/floating-multiple-lefts-multiple-lines.html: Added.
* fast/block/block-only/floating-multiple-lefts.html: Added.
* fast/block/block-only/floating-with-new-block-formatting-context-expected.txt: Added.
* fast/block/block-only/floating-with-new-block-formatting-context.html: Added.
* fast/block/block-only/margin-collapse-bottom-bottom-expected.txt: Added.
* fast/block/block-only/margin-collapse-bottom-bottom.html: Added.
* fast/block/block-only/margin-collapse-bottom-nested-expected.txt: Added.
* fast/block/block-only/margin-collapse-bottom-nested.html: Added.
* fast/block/block-only/margin-collapse-first-last-are-floating-expected.txt: Added.
* fast/block/block-only/margin-collapse-first-last-are-floating.html: Added.
* fast/block/block-only/margin-collapse-simple-expected.txt: Added.
* fast/block/block-only/margin-collapse-simple.html: Added.
* fast/block/block-only/margin-collapse-top-nested-expected.txt: Added.
* fast/block/block-only/margin-collapse-top-nested.html: Added.
* fast/block/block-only/margin-collapse-when-child-has-padding-border-expected.txt: Added.
* fast/block/block-only/margin-collapse-when-child-has-padding-border.html: Added.
* fast/block/block-only/margin-collapse-with-block-formatting-context-expected.txt: Added.
* fast/block/block-only/margin-collapse-with-block-formatting-context.html: Added.
* fast/block/block-only/margin-collapse-with-block-formatting-context2-expected.txt: Added.
* fast/block/block-only/margin-collapse-with-block-formatting-context2.html: Added.
* fast/block/block-only/margin-left-right-sizing-expected.txt: Added.
* fast/block/block-only/margin-left-right-sizing-out-of-flow-expected.txt: Added.
* fast/block/block-only/margin-left-right-sizing-out-of-flow.html: Added.
* fast/block/block-only/margin-left-right-sizing.html: Added.
* fast/block/block-only/margin-propagation-simple-content-height-expected.txt: Added.
* fast/block/block-only/margin-propagation-simple-content-height.html: Added.
* fast/block/block-only/margin-sibling-collapse-propagated-expected.txt: Added.
* fast/block/block-only/margin-sibling-collapse-propagated.html: Added.
* fast/block/block-only/margin-simple-expected.txt: Added.
* fast/block/block-only/margin-simple.html: Added.
* fast/block/block-only/negative-margin-simple-expected.txt: Added.
* fast/block/block-only/negative-margin-simple.html: Added.
* fast/block/block-only/padding-nested-expected.txt: Added.
* fast/block/block-only/padding-nested.html: Added.
* fast/block/block-only/padding-simple-expected.txt: Added.
* fast/block/block-only/padding-simple.html: Added.
* fast/block/block-only/relative-auto-expected.txt: Added.
* fast/block/block-only/relative-auto-with-parent-offset-expected.txt: Added.
* fast/block/block-only/relative-auto-with-parent-offset.html: Added.
* fast/block/block-only/relative-auto.html: Added.
* fast/block/block-only/relative-bottom-expected.txt: Added.
* fast/block/block-only/relative-bottom.html: Added.
* fast/block/block-only/relative-position-when-containing-block-is-not-in-the-formatting-context-expected.txt: Added.
* fast/block/block-only/relative-position-when-containing-block-is-not-in-the-formatting-context.html: Added.
* fast/block/block-only/relative-right-expected.txt: Added.
* fast/block/block-only/relative-right.html: Added.
* fast/block/block-only/relative-siblings-expected.txt: Added.
* fast/block/block-only/relative-siblings.html: Added.
* fast/block/block-only/relative-simple-expected.txt: Added.
* fast/block/block-only/relative-simple.html: Added.

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

15 months agoMake sure the WebResourceLoadStatisticsStore gets destroyed on the main thread
cdumez@apple.com [Fri, 29 Jun 2018 00:05:59 +0000 (00:05 +0000)]
Make sure the WebResourceLoadStatisticsStore gets destroyed on the main thread
https://bugs.webkit.org/show_bug.cgi?id=187143

Reviewed by Youenn Fablet.

Have WebResourceLoadStatisticsStore subclass ThreadSafeRefCounted<WebResourceLoadStatisticsStore, WTF::DestructionThread::Main>
instead of IPC::Connection::WorkQueueMessageReceiver. This makes sure that the WebResourceLoadStatisticsStore
objects get destroyed on the main thread, even if the last ref was held by a background thread.

Also, methods called by IPC are now called on the main thread instead of the background queue. I think it is clearer for all
of WebResourceLoadStatisticsStore usage to be on the main thread. Expensive work is still done on the background queue, inside
the persistent / memory store classes.

* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore):
(WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
(WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
(WebKit::WebResourceLoadStatisticsStore::processWillOpenConnection):
(WebKit::WebResourceLoadStatisticsStore::processDidCloseConnection):
* UIProcess/WebResourceLoadStatisticsStore.h:

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

15 months agoREGRESSION (233281): fast/dom/location-new-window-no-crash.html and some other tests...
antti@apple.com [Thu, 28 Jun 2018 23:57:57 +0000 (23:57 +0000)]
REGRESSION (233281): fast/dom/location-new-window-no-crash.html and some other tests are timing out
https://bugs.webkit.org/show_bug.cgi?id=187156

Reviewed by Zalan Bujtas.

We need still need to re-enable memory cache client calls even when not doing other post-resolution callbacks.

* style/StyleTreeResolver.cpp:
(WebCore::Style::memoryCacheClientCallsResumeQueue):

Add a separate queue for this.

(WebCore::Style::suspendMemoryCacheClientCalls):
(WebCore::Style::PostResolutionCallbackDisabler::~PostResolutionCallbackDisabler):

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

15 months agoAdd nullptr check for xpc_connection_t in AuthenticationManager::initializeConnection
jiewen_tan@apple.com [Thu, 28 Jun 2018 23:57:01 +0000 (23:57 +0000)]
Add nullptr check for xpc_connection_t in AuthenticationManager::initializeConnection
https://bugs.webkit.org/show_bug.cgi?id=187110
<rdar://problem/41536815>

Reviewed by Brent Fulgham.

In some rare cases as shown by crash tracers that the passed xpc_connection_t object could be nullptr,
and xpc_connection_set_event_handler won't do the nullptr check on its parameters. Therefore, we should
do it by ourselves.

* Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
(WebKit::AuthenticationManager::initializeConnection):
* UIProcess/Authentication/cocoa/AuthenticationChallengeProxyCocoa.mm:
(WebKit::AuthenticationChallengeProxy::sendClientCertificateCredentialOverXpc const):

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

15 months ago[iOS] DataTransfer.getData always returns the empty string when dropping text
wenson_hsieh@apple.com [Thu, 28 Jun 2018 23:52:57 +0000 (23:52 +0000)]
[iOS] DataTransfer.getData always returns the empty string when dropping text
https://bugs.webkit.org/show_bug.cgi?id=187130
<rdar://problem/41014117>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Currently, DataTransfer.getData() always returns the empty string on drop. This is because all data on drop is
backed by local files in the temporary directory, so the number of files is never 0; this, combined with the
fact that WebKit will suppress access to the DataTransfer object if there is one or more file in the pasteboard,
means that getData() never works for drag and drop on iOS at the moment. To fix this, we need to know whether a
dropped item provider is a file.

Ideally, we'd have a flag to tell us whether or not an NSItemProvider being dropped is a file, or instead just
inline data - in fact, this flag already exists in the form of UIPreferredPresentationStyle. Unfortunately, not
all apps that vend draggable files specify this, so we can't simply ask the item provider whether it's intended
to be a file. As a workaround, we can use several heuristics to determine the "file content state" of the drag
pasteboard on iOS (see below for more details).

This patch adds some plumbing through the client layers to grab a list of item information describing each
dropped item provider on iOS. Using this information, we tweak the logic in Pasteboard::fileContentState to make
an educated guess at whether or not the pasteboard really contains files; if we determine that the pasteboard
probably contains no files, we'll allow DataTransfer.getData() to retrieve information from the pasteboard.
Otherwise, if the pasteboard may contain files, we'll fall back to our current behavior of including the "Files"
type in DataTransfer.types and allowing the page to grab file data using DataTransfer.files or
DataTransfer.items.

Tests:  DataInteractionTests.DataTransferGetDataReadPlainAndRichText
        DataInteractionTests.DataTransferSuppressGetDataDueToPresenceOfTextFile

* dom/DataTransfer.cpp:
(WebCore::DataTransfer::filesFromPasteboardAndItemList const):

Check Pasteboard::fileContentState() to ensure that we don't expose files when DataTransfer.types does not
contain the "Files" type, and vice versa, and DataTranser.files is also empty in this case.

* dom/DataTransferItemList.cpp:
* platform/PasteboardItemInfo.h:

Add a couple of additional members to PasteboardItemInfo: suggestedFileName and hasDeclaredNonTextType, a flag
that indicates whether or not the pasteboard item has a type representation that is a declared type, but is not
a text type (i.e. does not conform to "public.text", "public.url", or rich text format with attachment types).

(WebCore::PasteboardItemInfo::encode const):
(WebCore::PasteboardItemInfo::decode):
* platform/PasteboardStrategy.h:
* platform/PlatformPasteboard.h:
* platform/cocoa/PasteboardCocoa.mm:
(WebCore::Pasteboard::fileContentState):

Instead of always considering a dropped item provider on iOS to represent a file, only do so if at least one of
the following conditions are met:
- The drop session contains multiple item providers (flocking text selections is a very rare use case).
- The item provider was explicitly marked as an attachment.
- The item provider has a suggested file name.
- The item provider has any other content that is not text.

In the case where none of the above conditions are met, the item provider (if it ends up being a file) is
essentially indistinguishable from inline data. An example of this is dropping a plain text file that is
unnamed, with no presentation style, and alongside no other items nor other known type representations. These
are cases in which whether the item is treated as a file or as inline data is (hopefully) irrelevant.

* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::allPasteboardItemInfo):
(WebCore::PlatformPasteboard::informationForItemAtIndex):

Source/WebKit:

Add plumbing to grab information for each item in the pasteboard. See WebCore ChangeLog for more detail.

* UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
(WebKit::WebPasteboardProxy::allPasteboardItemInfo):
* UIProcess/WebPasteboardProxy.h:
* UIProcess/WebPasteboardProxy.messages.in:
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::allPasteboardItemInfo):
* WebProcess/WebCoreSupport/WebPlatformStrategies.h:

Source/WebKitLegacy/mac:

Add plumbing to grab information for each item in the pasteboard. See WebCore ChangeLog for more detail.

* WebCoreSupport/WebPlatformStrategies.h:
* WebCoreSupport/WebPlatformStrategies.mm:
(WebPlatformStrategies::allPasteboardItemInfo):

Tools:

Add 2 new API tests to verify that:
-   When dropping an item with text, markup, and URL representations, the page is allowed to get "text/html",
    "text/plain" and "text/uri-list" data.
-   Adding a suggested name to a plain text item causes WebKit to treat it as a file, and suppress access to
    DataTransfer.getData().

Additionally tweaks a couple of existing API tests. Namely, in two API tests
(ExternalSourceOverrideDropFileUpload and ExternalSourceHTMLToUploadArea) only a markup string is dropped, and
we previously expected to handle the drop as a file. To allow this test to continue serving its purpose, tweak
them such that the registered items appear to be file-backed (i.e. by adding a suggested filename in one of the
tests, and specifying UIPreferredPresentationStyleAttachment in the other).

* TestWebKitAPI/Tests/ios/DataInteractionTests.mm:
(TestWebKitAPI::TEST):

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

15 months agoDon't force black text when TextIndicator draws backgrounds or all content.
timothy@apple.com [Thu, 28 Jun 2018 23:23:32 +0000 (23:23 +0000)]
Don't force black text when TextIndicator draws backgrounds or all content.
https://bugs.webkit.org/show_bug.cgi?id=187161
rdar://problem/40434644

Reviewed by Tim Horton.

* page/TextIndicator.cpp:
(WebCore::snapshotOptionsForTextIndicatorOptions):
Only set SnapshotOptionsForceBlackText when TextIndicatorOptionRespectTextColor and
TextIndicatorOptionPaintBackgrounds are not set.

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

15 months agoEarly return when handling fetch event in case service worker origin does not match...
youenn@apple.com [Thu, 28 Jun 2018 22:45:20 +0000 (22:45 +0000)]
Early return when handling fetch event in case service worker origin does not match origin of a subresource load
https://bugs.webkit.org/show_bug.cgi?id=187153
<rdar://problem/41329832>

Reviewed by Chris Dumez.

Stop crashing the service worker process in case a subresource load origin is not matching a service worker origin.
Instead, just return early so that the load will be handled by the network process.

Keep crashing in case a navigation load is not matching its service worker origin.
Add more logging to help with the debugging.

* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::logValidFetchError):
(WebKit::isValidFetch):
(WebKit::WebSWContextManagerConnection::startFetch):

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

15 months agoWeb Inspector: REGRESSION (r213000): copy from Search results content view broken
mattbaker@apple.com [Thu, 28 Jun 2018 22:38:41 +0000 (22:38 +0000)]
Web Inspector: REGRESSION (r213000): copy from Search results content view broken
https://bugs.webkit.org/show_bug.cgi?id=187020
<rdar://problem/40928766>

Reviewed by Timothy Hatcher.

Since WI._copy listens for a copy event from the document, it is called
after CodeMirror handles the event and sets clipboard data. If WI._copy
finds a custom copy handler to call, that handler can determine whether
to overwrite the current clipboard data, or leave it alone.

SearchTabContentView's handleCopyEvent method should return early if the
content tree outline doesn't have the focus. This prevents the selection
in the TextEditor from being overwritten, without any special knowledge of
the content browser's current view.

* UserInterface/Views/SearchTabContentView.js:
(WI.SearchTabContentView.prototype.handleCopyEvent):

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

15 months agoFix a bug ComponentBase that wrong content template may be used.
dewei_zhu@apple.com [Thu, 28 Jun 2018 22:14:39 +0000 (22:14 +0000)]
Fix a bug ComponentBase that wrong content template may be used.
https://bugs.webkit.org/show_bug.cgi?id=187159

Reviewed by Ryosuke Niwa.

ComponentBase uses '_parsed' to mark whether content and style templates of a class
is parsed. However, derived class parsing will be skipped as 'Derive._parsed' is available
via prototype chain whenever the base class is parsed.

* browser-tests/component-base-tests.js: Added unit tests.
* public/v3/components/base.js: Added 'hasOwnProperty' to make sure current class is parsed.
(ComponentBase.prototype._ensureShadowTree):

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

15 months agoUnreviewed, rolling out r226652.
Basuke.Suzuki@sony.com [Thu, 28 Jun 2018 22:13:04 +0000 (22:13 +0000)]
Unreviewed, rolling out r226652.
https://bugs.webkit.org/show_bug.cgi?id=180827

"PlatformInfo should never be instantiated in isolation. So, PlatformInfo should
not have default argument values. The preferred way to get a PlatformInfo object
is to instantiate a Host object." (Requested by dbates).

Reverted changeset:

"[webkitpy] PlatformInfo should have default argument for casual use"
https://bugs.webkit.org/show_bug.cgi?id=180827

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

15 months agoFullscreen exits when placeholder is removed then added during a single runloop.
commit-queue@webkit.org [Thu, 28 Jun 2018 21:55:04 +0000 (21:55 +0000)]
Fullscreen exits when placeholder is removed then added during a single runloop.
https://bugs.webkit.org/show_bug.cgi?id=187079

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

Instead of closing fullscreen as soon as the placeholder is removed from the view hierarchy,
give the placeholder until the next runloop to be re-added to the view hierarchy.

* UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
(-[WKFullScreenWindowController placeholderWillMoveToSuperview:]):

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

15 months agoTry to address test failures on the bots.
simon.fraser@apple.com [Thu, 28 Jun 2018 21:54:26 +0000 (21:54 +0000)]
Try to address test failures on the bots.

Allow the test to distinguish between a failure to find the variable, and an error
reporting vector capacity.

* lldb/lldb_webkit_unittest.py:
(TestSummaryProviders.serial_test_WTFVectorProvider_empty_vector):
(TestSummaryProviders.serial_test_WTFVectorProvider_vector_size_and_capacity):

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

15 months agoFind on page selection color isn't adapted for dark mode.
timothy@apple.com [Thu, 28 Jun 2018 21:48:45 +0000 (21:48 +0000)]
Find on page selection color isn't adapted for dark mode.
https://bugs.webkit.org/show_bug.cgi?id=187072
Source/WebCore:

Unreviewed, revert part of r233280.

* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::platformActiveTextSearchHighlightColor const): Use pure yellow again.

LayoutTests:

rdar://problem/40354841

Unreviewed test gardening.

* fast/css/apple-system-control-colors-expected.txt: Use pure yellow for find.
* fast/text/mark-matches-broken-line-rendering-expected.html:
* fast/text/mark-matches-rendering-expected.html:
Use -apple-system-find-highlight-background to work on all macOS versions.
* platform/mac-sierra/fast/css/apple-system-control-colors-expected.txt: Use pure yellow for find.

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

15 months agoHandle the case of registerMDNSNameCallback called several times
youenn@apple.com [Thu, 28 Jun 2018 21:23:33 +0000 (21:23 +0000)]
Handle the case of registerMDNSNameCallback called several times
https://bugs.webkit.org/show_bug.cgi?id=187150
<rdar://problem/41329832>

Reviewed by Eric Carlson.

This is a speculative fix on the basis that registerMDNSNameCallback may be called several times.
In that case, we would have freed the context after the first call and would reuse it for the second call.

Instead, keep a map of pending requests and pass to registerMDNSNameCallback an identifier to that map.
If the map has no value for that identifier, return early.

* NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
(WebKit::NetworkMDNSRegister::~NetworkMDNSRegister):
(WebKit::pendingRegistrationRequests):
(WebKit::registerMDNSNameCallback):
(WebKit::NetworkMDNSRegister::clearPendingRequests):
(WebKit::NetworkMDNSRegister::registerMDNSName):
* NetworkProcess/webrtc/NetworkMDNSRegister.h:
(): Deleted.

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

15 months agoBuild fix (2) after r233266
jbedard@apple.com [Thu, 28 Jun 2018 21:21:41 +0000 (21:21 +0000)]
Build fix (2) after r233266
https://bugs.webkit.org/show_bug.cgi?id=187024
<rdar://problem/39759057>

Unreviewed build fix.

* pal/cf/CoreMediaSoftLink.cpp: Distinguish between IOS and MINIMAL_SIMULATOR.
* pal/cf/CoreMediaSoftLink.h: Ditto.
* pal/spi/cocoa/LaunchServicesSPI.h: LSApplicationProxy should be conditionalized on HAVE(APP_LINKS).

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

15 months agoMeasurementSetAnalyzer should check triggerable availability before creating confirmi...
dewei_zhu@apple.com [Thu, 28 Jun 2018 21:15:48 +0000 (21:15 +0000)]
MeasurementSetAnalyzer should check triggerable availability before creating confirming A/B tests.
https://bugs.webkit.org/show_bug.cgi?id=187028

Reviewed by Ryosuke Niwa.

If the triggerable is not available, MeasurmentSetAnalyzer should only create analysis task without
confirming A/B tests.

* tools/js/measurement-set-analyzer.js: Added logic to check triggerable availability.
(MeasurementSetAnalyzer.prototype.async._analyzeMeasurementSet):
(MeasurementSetAnalyzer):
* unit-tests/measurement-set-analyzer-tests.js: Updated unit tests and added a new unit test for this change.

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

15 months ago[Web Animations] Make imported/mozilla/css-animations/test_animation-starttime.html...
graouts@webkit.org [Thu, 28 Jun 2018 21:13:16 +0000 (21:13 +0000)]
[Web Animations] Make imported/mozilla/css-animations/test_animation-starttime.html pass reliably
https://bugs.webkit.org/show_bug.cgi?id=183834
<rdar://problem/40997932>

Reviewed by Dean Jackson.

LayoutTests/imported/mozilla:

Mark progressions in the Mozilla CSS Animations tests.

* css-animations/test_animation-starttime-expected.txt:

Source/WebCore:

We need to run pending tasks in the "update animations" procedure to ensure that the start time has been set
to a different time than the timeline time at the time the animation was asked to play(). This ensure the
timeline current time has progressed and can be queried to a different value in a requestAnimationFrame()
callback.

When invalidating events, we need to make sure we disregard instances when an animation has and is still pending
so that we wait until we change the pending state to work out which events to enqueue.

* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::invalidateDOMEvents):
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::updateAnimations):
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::updatePendingTasks):
(WebCore::WebAnimation::timeToNextRequiredTick const):
(WebCore::WebAnimation::runPendingTasks):
* animation/WebAnimation.h:

LayoutTests:

This test now passes reliably so we remove any specific expectation. Another test needed to be modified to account for
the pending state being updated at a different time, so we just wait a frame to ensure the animation is started.

* TestExpectations:
* compositing/visible-rect/animated.html:

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

15 months agoRelease assert in ScriptController::canExecuteScripts via WebCore::SVGUseElement...
rniwa@webkit.org [Thu, 28 Jun 2018 21:00:45 +0000 (21:00 +0000)]
Release assert in ScriptController::canExecuteScripts via WebCore::SVGUseElement::insertedIntoAncestor
https://bugs.webkit.org/show_bug.cgi?id=187137
<rdar://problem/41081885>

Reviewed by Zalan Bujtas.

The bug was caused by SVGUseElement::notifyFinished firing a DOM event via SVGUseElement::updateExternalDocument
inside SVGUseElement::insertedIntoAncestor. Ideally, we make every call to notifyFinished asynchronous
but simply delay the call to updateExternalDocument() until didFinishInsertingNode() for now.

No new tests since the failure is caught with the newly added assertion in notifyFinished by existing SVG tests
such as svg/batik/filters/filterRegions.svg and svg/batik/text/smallFonts.svg. Unfortunately, I could not
construct a test case which hits this release assertion since the real crash happens when the cached resource
had an error but in the all cases I could find, the resource response with an error results in a reload or
an asynchronous failure callback.

* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::didAddClient): Added a FIXME.
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::insertedIntoAncestor): Delay the call to updateExternalDocument.
(WebCore::SVGUseElement::didFinishInsertingNode): Invoke updateExternalDocument.
(WebCore::SVGUseElement::notifyFinished): Added an assertion.
* svg/SVGUseElement.h:

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

15 months agoUnreviewed attempt to fix Win Cairo build after r233310.
cdumez@apple.com [Thu, 28 Jun 2018 20:59:19 +0000 (20:59 +0000)]
Unreviewed attempt to fix Win Cairo build after r233310.

* UIProcess/WebResourceLoadStatisticsStore.h:

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

15 months agoTeach Windows EWS bots to use WEBKIT_API_KEY.
lforschler@apple.com [Thu, 28 Jun 2018 20:58:20 +0000 (20:58 +0000)]
Teach Windows EWS bots to use WEBKIT_API_KEY.

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

15 months agoUnreviewed attempt to fix Win Cairo build after r233310.
cdumez@apple.com [Thu, 28 Jun 2018 20:52:06 +0000 (20:52 +0000)]
Unreviewed attempt to fix Win Cairo build after r233310.

* UIProcess/WebResourceLoadStatisticsStore.h:

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

15 months agoUnreviewed, rolling out r233309.
cdumez@apple.com [Thu, 28 Jun 2018 20:17:34 +0000 (20:17 +0000)]
Unreviewed, rolling out r233309.

Invalidates previous database model without versioning

Reverted changeset:

"Fix encoding / decoding issues in ResourceLoadStatistics"
https://bugs.webkit.org/show_bug.cgi?id=186890
https://trac.webkit.org/changeset/233309

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

15 months agoSplit memory store logic out of WebResourceLoadStatisticsStore to clarify threading...
cdumez@apple.com [Thu, 28 Jun 2018 20:09:21 +0000 (20:09 +0000)]
Split memory store logic out of WebResourceLoadStatisticsStore to clarify threading model
https://bugs.webkit.org/show_bug.cgi?id=187055
<rdar://problem/41584026>

Unreviewed, temporarily disable main thread assertion added to flushAndDestroyPersistentStore()
in r233310, until Bug 187143 is fixed.

* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):

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

15 months ago[ews-build] Add support for WebKitPy-Tests-EWS
aakash_jain@apple.com [Thu, 28 Jun 2018 19:52:32 +0000 (19:52 +0000)]
[ews-build] Add support for WebKitPy-Tests-EWS
https://bugs.webkit.org/show_bug.cgi?id=187148

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/factories.py: Added WebKitPyFactory.
* BuildSlaveSupport/ews-build/steps.py: Added build step RunWebKitPyTests.
* BuildSlaveSupport/ews-build/steps_unittest.py: Added unit-tests.
* BuildSlaveSupport/ews-build/config.json: Updated to use CamelCase.

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

15 months agoAdd sandbox to microdone plugin
youenn@apple.com [Thu, 28 Jun 2018 19:42:24 +0000 (19:42 +0000)]
Add sandbox to microdone plugin
https://bugs.webkit.org/show_bug.cgi?id=187149
rdar://problem/41538057

Reviewed by Brent Fulgham.

* Resources/PlugInSandboxProfiles/cn.microdone.cmb.safari: Added.
* WebKit.xcodeproj/project.pbxproj:

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

15 months agoWeb Inspector: REGRESSION(r223770): "Open Link" context menu action on a linkified...
bburg@apple.com [Thu, 28 Jun 2018 19:14:47 +0000 (19:14 +0000)]
Web Inspector: REGRESSION(r223770): "Open Link" context menu action on a linkified URL doesn't work
https://bugs.webkit.org/show_bug.cgi?id=187146
<rdar://problem/41369591>

Reviewed by Joseph Pecoraro.

When Web Inspector's page receives a navigation request, it's supposed to redirect any
non-Inspector navigations to be loaded in the inspected page. When I refactored to use
modern a policy delegate, the one line that redirects the loads was left out.

No new tests, because inspector tests can't navigate the inspector or inspected pages.

* UIProcess/mac/WKInspectorViewController.mm:
(-[WKInspectorViewController webView:decidePolicyForNavigationAction:decisionHandler:]):

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

15 months agoFocus ring color does not honor dark mode or system accent color.
timothy@apple.com [Thu, 28 Jun 2018 18:51:07 +0000 (18:51 +0000)]
Focus ring color does not honor dark mode or system accent color.
https://bugs.webkit.org/show_bug.cgi?id=187144
rdar://problem/41105081

Reviewed by Tim Horton.

Pass the focus ring color through to the GraphicsContext methods that draw it.

* platform/graphics/GraphicsContext.h:
* platform/graphics/cocoa/GraphicsContextCocoa.mm:
(WebCore::drawFocusRingAtTime):
(WebCore::drawFocusRing):
(WebCore::drawFocusRingToContext):
(WebCore::drawFocusRingToContextAtTime):
(WebCore::GraphicsContext::drawFocusRing):
(WebCore::GraphicsContext::focusRingColor): Deleted.
* platform/mac/ThemeMac.mm:
(WebCore::drawCellFocusRingWithFrameAtTime):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::paintFocusRing):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintAreaElementFocusRing):

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

15 months agoCrash when _topConstraint is null in element fullscreen.
commit-queue@webkit.org [Thu, 28 Jun 2018 18:36:48 +0000 (18:36 +0000)]
Crash when _topConstraint is null in element fullscreen.
https://bugs.webkit.org/show_bug.cgi?id=187075

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

NSArray can't contain a null pointer, so check for null before creating an array from a pointer.
Use the recommended +deactivateConstraints: instead of -removeConstraints:.

* UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
(-[WKFullScreenViewController showUI]):
(-[WKFullScreenViewController hideUI]):

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

15 months agoFix the iOS build following r233299
dbates@webkit.org [Thu, 28 Jun 2018 17:35:34 +0000 (17:35 +0000)]
Fix the iOS build following r233299
(https://bugs.webkit.org/show_bug.cgi?id=183744)

Only build lldbWebKitTester on Mac as that is the only supported platform at the time of writing.

* Makefile:

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

15 months agoUnreviewed gardening; media/video-buffering-allowed.html is flakey due to not complet...
jer.noble@apple.com [Thu, 28 Jun 2018 17:24:01 +0000 (17:24 +0000)]
Unreviewed gardening; media/video-buffering-allowed.html is flakey due to not completing in time.

Remove the artificial early timeout (1s) in this test.

* media/video-buffering-allowed.html:

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

15 months agoREGRESSION (r232040): Cursor jumping in Safari text fields
commit-queue@webkit.org [Thu, 28 Jun 2018 17:12:05 +0000 (17:12 +0000)]
REGRESSION (r232040): Cursor jumping in Safari text fields
https://bugs.webkit.org/show_bug.cgi?id=187142
<rdar://problem/41397577>

Patch by Aditya Keerthi <akeerthi@apple.com> on 2018-06-28
Reviewed by Tim Horton.

Source/WebCore:

r232040 enabled click events to fire on nodes that are already being edited in
iOS. This resulted FrameSelection::setSelection being called twice. One call
originated from the UIWKTextInteractionAssistant, which snaps the caret to word
boundaries. The other call originates from handleMousePressEvent in EventHandler,
and uses character boundaries. Consequently, we see the caret jumping around.

To fix this issue, an early return was added in the handleMousePressEvent
codepath, which prevents FrameSelection::setSelection from being called when
clicking on a node that is already being edited. This ensures that the
UIWKTextInteractionAssistant codepath is the only influence on the caret position.

Test: fast/events/ios/click-selectionchange-once.html

* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEventSingleClick):

LayoutTests:

Added test to ensure that the 'selectionchange' event is only fired once per
click in an editable node.

* fast/events/ios/click-selectionchange-once-expected.txt: Added.
* fast/events/ios/click-selectionchange-once.html: Added.

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

15 months agoSplit memory store logic out of WebResourceLoadStatisticsStore to clarify threading...
cdumez@apple.com [Thu, 28 Jun 2018 17:07:36 +0000 (17:07 +0000)]
Split memory store logic out of WebResourceLoadStatisticsStore to clarify threading model
https://bugs.webkit.org/show_bug.cgi?id=187055
<rdar://problem/41584026>

Reviewed by Brent Fulgham.

Split memory store logic out of WebResourceLoadStatisticsStore and into a ResourceLoadStatisticsMemoryStore class
to clarify the threading model. Previously, some of the methods of the WebResourceLoadStatisticsStore had to be
called on the main thread and some of them on the background queue, which was confusing and error prone. Now,
all WebResourceLoadStatisticsStore methods (except for IPC ones which will be addressed in a follow-up) are called
on the main thread. The ResourceLoadStatisticsMemoryStore objects is constructed / used and destroyed on the
background queue, similarly to the ResourceLoadStatisticsPersistentStore. The WebResourceLoadStatisticsStore
objects merely proxies calls from WebKit to those persistent / memory stores and takes care of hopping back and
forth between the background thread and the work queue.

While spliting code code, I found several instances where we were calling completion handlers on the wrong thread.
I fixed those in this patch now that the model is clearer.

We can likely clean up (organize the code a bit better) in a follow-up). This patch takes care of splitting the
code as it was. Code that was called on the background queue was moved to ResourceLoadStatisticsMemoryStore class
and code that was called on the main thread stays in WebResourceLoadStatisticsStore.

* CMakeLists.txt:
* UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm: Renamed from Source/WebKit/UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm.
(WebKit::ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded):
* UIProcess/ResourceLoadStatisticsMemoryStore.cpp: Added.
(WebKit::appendWithDelimiter):
(WebKit::OperatingDate::fromWallTime):
(WebKit::OperatingDate::today):
(WebKit::OperatingDate::secondsSinceEpoch const):
(WebKit::OperatingDate::operator== const):
(WebKit::OperatingDate::operator< const):
(WebKit::OperatingDate::operator<= const):
(WebKit::OperatingDate::OperatingDate):
(WebKit::mergeOperatingDates):
(WebKit::pruneResources):
(WebKit::computeImportance):
(WebKit::ResourceLoadStatisticsMemoryStore::ResourceLoadStatisticsMemoryStore):
(WebKit::ResourceLoadStatisticsMemoryStore::~ResourceLoadStatisticsMemoryStore):
(WebKit::ResourceLoadStatisticsMemoryStore::setPersistentStorage):
(WebKit::ResourceLoadStatisticsMemoryStore::calculateAndSubmitTelemetry):
(WebKit::ResourceLoadStatisticsMemoryStore::setNotifyPagesWhenDataRecordsWereScanned):
(WebKit::ResourceLoadStatisticsMemoryStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
(WebKit::ResourceLoadStatisticsMemoryStore::setShouldSubmitTelemetry):
(WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords):
(WebKit::ResourceLoadStatisticsMemoryStore::recursivelyGetAllDomainsThatHaveRedirectedToThisDomain):
(WebKit::ResourceLoadStatisticsMemoryStore::markAsPrevalentIfHasRedirectedToPrevalent):
(WebKit::ResourceLoadStatisticsMemoryStore::processStatisticsAndDataRecords):
(WebKit::ResourceLoadStatisticsMemoryStore::hasStorageAccess):
(WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccess):
(WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccessUnderOpener):
(WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccess):
(WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccessInternal):
(WebKit::ResourceLoadStatisticsMemoryStore::grandfatherExistingWebsiteData):
(WebKit::ResourceLoadStatisticsMemoryStore::setResourceLoadStatisticsDebugMode):
(WebKit::ResourceLoadStatisticsMemoryStore::scheduleStatisticsProcessingRequestIfNecessary):
(WebKit::ResourceLoadStatisticsMemoryStore::cancelPendingStatisticsProcessingRequest):
(WebKit::ResourceLoadStatisticsMemoryStore::logFrameNavigation):
(WebKit::ResourceLoadStatisticsMemoryStore::logUserInteraction):
(WebKit::ResourceLoadStatisticsMemoryStore::logNonRecentUserInteraction):
(WebKit::ResourceLoadStatisticsMemoryStore::clearUserInteraction):
(WebKit::ResourceLoadStatisticsMemoryStore::hasHadUserInteraction):
(WebKit::ResourceLoadStatisticsMemoryStore::setPrevalentResource):
(WebKit::ResourceLoadStatisticsMemoryStore::isPrevalentResource const):
(WebKit::ResourceLoadStatisticsMemoryStore::isVeryPrevalentResource const):
(WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsSubFrameUnder):
(WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsRedirectingTo):
(WebKit::ResourceLoadStatisticsMemoryStore::clearPrevalentResource):
(WebKit::ResourceLoadStatisticsMemoryStore::setGrandfathered):
(WebKit::ResourceLoadStatisticsMemoryStore::isGrandfathered const):
(WebKit::ResourceLoadStatisticsMemoryStore::setSubframeUnderTopFrameOrigin):
(WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUnderTopFrameOrigin):
(WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectTo):
(WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectFrom):
(WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectTo):
(WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectFrom):
(WebKit::ResourceLoadStatisticsMemoryStore::setTimeToLiveUserInteraction):
(WebKit::ResourceLoadStatisticsMemoryStore::setTimeToLiveCookiePartitionFree):
(WebKit::ResourceLoadStatisticsMemoryStore::setMinimumTimeBetweenDataRecordsRemoval):
(WebKit::ResourceLoadStatisticsMemoryStore::setGrandfatheringTime):
(WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveDataRecords const):
(WebKit::ResourceLoadStatisticsMemoryStore::setDataRecordsBeingRemoved):
(WebKit::ResourceLoadStatisticsMemoryStore::ensureResourceStatisticsForPrimaryDomain):
(WebKit::ResourceLoadStatisticsMemoryStore::createEncoderFromData const):
(WebKit::ResourceLoadStatisticsMemoryStore::mergeWithDataFromDecoder):
(WebKit::ResourceLoadStatisticsMemoryStore::clear):
(WebKit::ResourceLoadStatisticsMemoryStore::wasAccessedAsFirstPartyDueToUserInteraction):
(WebKit::ResourceLoadStatisticsMemoryStore::mergeStatistics):
(WebKit::ResourceLoadStatisticsMemoryStore::shouldPartitionCookies):
(WebKit::ResourceLoadStatisticsMemoryStore::shouldBlockCookies):
(WebKit::ResourceLoadStatisticsMemoryStore::hasUserGrantedStorageAccessThroughPrompt):
(WebKit::ResourceLoadStatisticsMemoryStore::updateCookiePartitioning):
(WebKit::ResourceLoadStatisticsMemoryStore::updateCookiePartitioningForDomains):
(WebKit::ResourceLoadStatisticsMemoryStore::clearPartitioningStateForDomains):
(WebKit::ResourceLoadStatisticsMemoryStore::resetCookiePartitioningState):
(WebKit::ResourceLoadStatisticsMemoryStore::processStatistics const):
(WebKit::ResourceLoadStatisticsMemoryStore::hasHadUnexpiredRecentUserInteraction const):
(WebKit::ResourceLoadStatisticsMemoryStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor):
(WebKit::ResourceLoadStatisticsMemoryStore::includeTodayAsOperatingDateIfNecessary):
(WebKit::ResourceLoadStatisticsMemoryStore::hasStatisticsExpired const):
(WebKit::ResourceLoadStatisticsMemoryStore::setMaxStatisticsEntries):
(WebKit::ResourceLoadStatisticsMemoryStore::setPruneEntriesDownTo):
(WebKit::ResourceLoadStatisticsMemoryStore::pruneStatisticsIfNeeded):
(WebKit::ResourceLoadStatisticsMemoryStore::resetParametersToDefaultValues):
(WebKit::ResourceLoadStatisticsMemoryStore::logTestingEvent):
(WebKit::ResourceLoadStatisticsMemoryStore::setLastSeen):
(WebKit::ResourceLoadStatisticsMemoryStore::setVeryPrevalentResource):
(WebKit::ResourceLoadStatisticsMemoryStore::removeAllStorageAccess):
* UIProcess/ResourceLoadStatisticsMemoryStore.h: Added.
(WebKit::ResourceLoadStatisticsMemoryStore::isEmpty const):
(WebKit::ResourceLoadStatisticsMemoryStore::setStorageAccessPromptsEnabled):
(WebKit::ResourceLoadStatisticsMemoryStore::setDebugLogggingEnabled):
* UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
(WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage):
(WebKit::ResourceLoadStatisticsPersistentStorage::startMonitoringDisk):
(WebKit::ResourceLoadStatisticsPersistentStorage::monitorDirectoryForNewStatistics):
(WebKit::ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore):
* UIProcess/ResourceLoadStatisticsPersistentStorage.h:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::setNotifyPagesWhenDataRecordsWereScanned):
(WebKit::WebResourceLoadStatisticsStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
(WebKit::WebResourceLoadStatisticsStore::setShouldSubmitTelemetry):
(WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
(WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
(WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
(WebKit::WebResourceLoadStatisticsStore::scheduleStatisticsAndDataRecordsProcessing):
(WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
(WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
(WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
(WebKit::WebResourceLoadStatisticsStore::callGrantStorageAccessHandler):
(WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
(WebKit::WebResourceLoadStatisticsStore::performDailyTasks):
(WebKit::WebResourceLoadStatisticsStore::submitTelemetry):
(WebKit::WebResourceLoadStatisticsStore::logFrameNavigation):
(WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::logNonRecentUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::setLastSeen):
(WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder):
(WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo):
(WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
(WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
(WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
(WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
(WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
(WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom):
(WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo):
(WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom):
(WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdate):
(WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains):
(WebKit::WebResourceLoadStatisticsStore::scheduleClearPartitioningStateForDomains):
(WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningStateReset):
(WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemory):
(WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
(WebKit::WebResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::setTimeToLiveCookiePartitionFree):
(WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweenDataRecordsRemoval):
(WebKit::WebResourceLoadStatisticsStore::setGrandfatheringTime):
(WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToPartitionOrBlockCookiesHandler):
(WebKit::WebResourceLoadStatisticsStore::callRemoveDomainsHandler):
(WebKit::WebResourceLoadStatisticsStore::setMaxStatisticsEntries):
(WebKit::WebResourceLoadStatisticsStore::setPruneEntriesDownTo):
(WebKit::WebResourceLoadStatisticsStore::resetParametersToDefaultValues):
(WebKit::WebResourceLoadStatisticsStore::logTestingEvent):
* UIProcess/WebResourceLoadStatisticsStore.h:
* UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
(WebKit::sortedPrevalentResourceTelemetry):
(WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
* UIProcess/WebResourceLoadStatisticsTelemetry.h:
* WebKit.xcodeproj/project.pbxproj:

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

15 months agoFix encoding / decoding issues in ResourceLoadStatistics
cdumez@apple.com [Thu, 28 Jun 2018 17:07:31 +0000 (17:07 +0000)]
Fix encoding / decoding issues in ResourceLoadStatistics
https://bugs.webkit.org/show_bug.cgi?id=186890

Reviewed by Brent Fulgham.

* loader/ResourceLoadStatistics.cpp:
(WebCore::encodeHashCountedSet):
(WebCore::encodeHashSet):
Do not return early if the container we're trying to encode is empty. Instead,
have the encoder encode an empty array. This is important for encoding / decoding
to be fully symmetric. Otherwise, when trying to decode one of these empty containers,
the decoder would fail (silently since we were ignoring decoding errors). Worse, the
decoder might succeed but actually be decoding the *next* container in the file, since
we have several HashCountedSets / HashSets encoded one after another.

(WebCore::decodeHashCountedSet):
(WebCore::decodeHashSet):
Return a boolean to indicate if the decoding suceeded or not.

(WebCore::ResourceLoadStatistics::decode):
Check for container decoding errors and return false when decoding fails.
Otherwise, we would just silently keep going.

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

15 months agoCookie API: cookie creation time is wrong
sihui_liu@apple.com [Thu, 28 Jun 2018 17:03:24 +0000 (17:03 +0000)]
Cookie API: cookie creation time is wrong
https://bugs.webkit.org/show_bug.cgi?id=187101

Reviewed by Geoffrey Garen.

Source/WebCore:

Covered by API test: WebKit.WKHTTPCookieStoreCreationTime.

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

Tools:

Add test coverage: make sure the cookie creation time returned is the same as set.

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

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

15 months ago[LFC] Add Display::Box::nonCollapsedMarginBox for verification purposes.
zalan@apple.com [Thu, 28 Jun 2018 15:42:42 +0000 (15:42 +0000)]
[LFC] Add Display::Box::nonCollapsedMarginBox for verification purposes.
https://bugs.webkit.org/show_bug.cgi?id=187140

Reviewed by Antti Koivisto.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeFloatingHeightAndMargin const):
(WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
* layout/Verification.cpp:
(WebCore::Layout::outputMismatchingBoxInformationIfNeeded):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeInFlowHeightAndMargin const):
* layout/displaytree/DisplayBox.cpp:
(WebCore::Display::Box::nonCollapsedMarginBox const):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::setVerticalNonCollapsedMargin):

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

15 months agoThe lldb vector summary provider always shows zero capacity
simon.fraser@apple.com [Thu, 28 Jun 2018 15:37:04 +0000 (15:37 +0000)]
The lldb vector summary provider always shows zero capacity
https://bugs.webkit.org/show_bug.cgi?id=187132

Reviewed by Daniel Bates.

WTFVectorProvider in lldb_webkit.py was calling GetChildMemberWithName('m_capacity')
on the buffer instead of the valobj.

* lldb/lldbWebKitTester/main.cpp:
(testSummaryProviders):
* lldb/lldb_webkit.py:
(WTFVectorProvider.update):
* lldb/lldb_webkit_unittest.py:
(TestSummaryProviders.serial_test_WTFString_SummaryProvider_16bit_string):
(TestSummaryProviders):
(TestSummaryProviders.serial_test_WTFVectorProvider_empty_vector):
(TestSummaryProviders.serial_test_WTFVectorProvider_vector_size_and_capacity):

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

15 months ago[GTK] ASSERTION FAILED: !HashTranslator::equal(KeyTraits::emptyValue(), key) when...
mcatanzaro@igalia.com [Thu, 28 Jun 2018 15:35:42 +0000 (15:35 +0000)]
[GTK] ASSERTION FAILED: !HashTranslator::equal(KeyTraits::emptyValue(), key) when dragging file into webview
https://bugs.webkit.org/show_bug.cgi?id=175602

Reviewed by Carlos Garcia Campos.

We check using the GdkDragContext to ensure the DroppingContext is still alive (present in
m_droppingContexts), but access it via the pointer to the DroppingContext that could be
dangling. This happens on every drag. I can't actually reproduce the original assertion
since I'm currently working with an asan build, but I imagine it's probably the same issue
that I'm fixing here.

* UIProcess/gtk/DragAndDropHandler.cpp:
(WebKit::DragAndDropHandler::dragLeave):

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

15 months ago[LFC] The margin bottom of the document element does not collapse with its last inflo...
zalan@apple.com [Thu, 28 Jun 2018 14:35:13 +0000 (14:35 +0000)]
[LFC] The margin bottom of the document element does not collapse with its last inflow child's bottom margin.
https://bugs.webkit.org/show_bug.cgi?id=187135

Reviewed by Antti Koivisto.

* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBottom):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginBottomFromLastChild):

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

15 months agoSwitch OS(FUCHSIA) to using JSCOnly
abarth@webkit.org [Thu, 28 Jun 2018 08:02:29 +0000 (08:02 +0000)]
Switch OS(FUCHSIA) to using JSCOnly
https://bugs.webkit.org/show_bug.cgi?id=187133

Reviewed by Yusuke Suzuki.

.:

Rather than creating a Fuchsia port, OS(FUCHSIA) now uses the JSCOnly
port.

* CMakeLists.txt: Set the WTF_OS_FUCHSIA flag
* Source/cmake/OptionsFuchsia.cmake: Removed.
* Source/cmake/OptionsJSCOnly.cmake: Temporarily disable ICU for
OS(FUCHSIA). We'll get ICU wired in, but I'd like to work through the
other compile errors first.

Tools:

Switch Fuchsia from being a port to just being an OS. We now use a
CMAKE_TOOLCHAIN_FILE to configure the toolchain and the target triple.

* Scripts/webkitdirs.pm: Remove isFuchsia() and clients. Turns out we
can do everything we need using a CMAKE_TOOLCHAIN_FILE via the
--cmakeargs flag.

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

15 months ago[css-masking] Update clip-path box mapping to unified box
krit@webkit.org [Thu, 28 Jun 2018 07:37:28 +0000 (07:37 +0000)]
[css-masking] Update clip-path box mapping to unified box
https://bugs.webkit.org/show_bug.cgi?id=185797

Reviewed by Simon Fraser.

Source/WebCore:

The box mapping for fill-box, stroke-box, view-box on HTML elements
and content-box, padding-box, margin-box, border-box for SVG elements
was aligned with the transform-box CSS property.

Furthermore, the keywords fill changed to fill-box and stroke changed
to stroke-box.

https://drafts.fxtf.org/css-masking-1/#typedef-geometry-box

Update the -webkit-clip-path property.

Tests: svg/clip-path/clip-path-shape-border-box-expected.svg
       svg/clip-path/clip-path-shape-border-box.svg
       svg/clip-path/clip-path-shape-content-box-expected.svg
       svg/clip-path/clip-path-shape-content-box.svg
       svg/clip-path/clip-path-shape-margin-box-expected.svg
       svg/clip-path/clip-path-shape-margin-box.svg
       svg/clip-path/clip-path-shape-padding-box-expected.svg
       svg/clip-path/clip-path-shape-padding-box.svg

* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator CSSBoxType const):
* css/CSSValueKeywords.in:
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertClipPath):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeBasicShapeOrBox):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::nodeAtPoint):
* rendering/RenderLayer.cpp:
(WebCore::computeReferenceBox):
* rendering/shapes/BoxShape.cpp:
(WebCore::computeRoundedRectForBoxShape):
* rendering/shapes/ShapeOutsideInfo.cpp:
(WebCore::ShapeOutsideInfo::setReferenceBoxLogicalSize):
(WebCore::ShapeOutsideInfo::logicalTopOffset const):
(WebCore::ShapeOutsideInfo::logicalLeftOffset const):
* rendering/style/RenderStyleConstants.h:
* rendering/svg/SVGRenderingContext.cpp:
(WebCore::SVGRenderingContext::prepareToRenderSVGContent):

LayoutTests:

Update existing tests and add new tests to check the slightly different behavior.

* fast/masking/parsing-clip-path-shape-expected.txt:
* fast/masking/parsing-clip-path-shape.html:
* svg/clip-path/clip-path-shape-border-box-expected.svg: Added.
* svg/clip-path/clip-path-shape-border-box.svg: Copied from LayoutTests/svg/clip-path/clip-path-shape-stroke.svg.
* svg/clip-path/clip-path-shape-content-box-expected.svg: Copied from LayoutTests/svg/clip-path/clip-path-shape-fill.svg.
* svg/clip-path/clip-path-shape-content-box.svg: Copied from LayoutTests/svg/clip-path/clip-path-shape-fill.svg.
* svg/clip-path/clip-path-shape-fill.svg:
* svg/clip-path/clip-path-shape-margin-box-expected.svg: Added.
* svg/clip-path/clip-path-shape-margin-box.svg: Copied from LayoutTests/svg/clip-path/clip-path-shape-stroke.svg.
* svg/clip-path/clip-path-shape-padding-box-expected.svg: Copied from LayoutTests/svg/clip-path/clip-path-shape-fill.svg.
* svg/clip-path/clip-path-shape-padding-box.svg: Copied from LayoutTests/svg/clip-path/clip-path-shape-fill.svg.
* svg/clip-path/clip-path-shape-stroke.svg:

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

15 months agoMake MotionMark's plan file more robust against code changes
rniwa@webkit.org [Thu, 28 Jun 2018 07:27:52 +0000 (07:27 +0000)]
Make MotionMark's plan file more robust against code changes
https://bugs.webkit.org/show_bug.cgi?id=187116
<rdar://problem/41533956>

Reviewed by Saam Barati.

Moved the code to auto-start the test to the load event listener.

* Scripts/webkitpy/benchmark_runner/data/patches/webserver/MotionMark.patch:

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

15 months agoDon't expose new semantic -apple-system color keywords on iOS.
timothy@apple.com [Thu, 28 Jun 2018 04:25:05 +0000 (04:25 +0000)]
Don't expose new semantic -apple-system color keywords on iOS.
https://bugs.webkit.org/show_bug.cgi?id=187080
rdar://problem/41505699

Reviewed by Tim Horton.

* DerivedSources.make: Use gnu++14, since gnu++17 is giving errors on macOS 10.12.
Source/WebCore:

* css/CSSValueKeywords.in: Define new semantic colors only on macOS.

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

15 months agoAdd some tests for lldb_webkit.py
dbates@webkit.org [Thu, 28 Jun 2018 04:19:32 +0000 (04:19 +0000)]
Add some tests for lldb_webkit.py
https://bugs.webkit.org/show_bug.cgi?id=183744

Reviewed by Alexey Proskuryakov.

Adds some tests to ensure we do not regress LLDB pretty-printing of WTF::StringImpl
and WTF::String objects.

The tests make use of the LLDB Python API (lldb.py) and a simple debug-built test
program, lldbWebKitTester, to run. For now, we only support building lldbWebKitTester
on Mac.

* Makefile: Build the simple test tool lldbWebKitTester on Mac.
* Scripts/build-lldbwebkittester: Added.
(buildProjectOrDie):
* Scripts/dump-class-layout: Extract logic to compute the path to the LLDB Python module
from here to Scripts/webkitpy/common/system/systemhost.py so that it can used by both
this script and lldb/lldb_webkit_unittest.py. Also import the lldb module at the top of
the file and take advantage of Python's default error semantics to throw an exception
if the import fails instead of handling it ourself. This has the side effect that we
now always import the LLDB Python module even if this script is invoked with --help.
If this turns out to be a significant annoyance then we can look to dynamically import
the module as we did before this change.
(webkit_build_dir):
(main):
(developer_dir): Deleted.
(import_lldb): Deleted.
* Scripts/webkitpy/common/checkout/scm/scm_unittest.py: Update FIXME comment to reflect
that fact that test-webkitpy does not support class and module fixtures. This is because
test-webkitpy currently implements parallelism by breaking down existing test classes
into individual test methods itself and having each worker run exactly one test method (via
unittest.TestLoader.loadTestsFromName()) at a time. As a result of this reorganization,
setUpModule()/setUpClass() are called for each test method as opposed to once per test
class/test module.
(remove_dir): Ditto.
* Scripts/webkitpy/common/system/systemhost.py:
(SystemHost):
(SystemHost.path_to_lldb_python_directory): Added.
* Scripts/webkitpy/test/main.py:
(_find_lldb_webkit_tester): Returns whether there exists a Debug or Release-built lldbWebKitTester.
(_build_lldb_webkit_tester): Builds lldbWebKitTester. For now, we only support building
lldbWebKitTester on Mac.
(main): Add Tools/lldb to the test search path if the platform has lldb.py.
(Tester.run): Pass a boolean as to whether we will run the lldb_webkit unit tests.
(Tester._run_tests): Modified to take a boolean as to whether to run the lldb_webkit unit tests.
If we will run these tests then build lldbWebKitTester if it has not already been built as the
unit tests depend on this program.
* lldb/lldbWebKitTester/Configurations/Base.xcconfig: Added.
* lldb/lldbWebKitTester/Configurations/DebugRelease.xcconfig: Added.
* lldb/lldbWebKitTester/Configurations/lldbWebKitTester.xcconfig: Added.
* lldb/lldbWebKitTester/Makefile: Added.
* lldb/lldbWebKitTester/lldbWebKitTester.xcodeproj/project.pbxproj: Added.
* lldb/lldbWebKitTester/main.cpp: Added.
(breakForTestingSummaryProviders):
(utf16String):
(testSummaryProviders):
(main):
* lldb/lldb_webkit_unittest.py: Added.
(destroy_cached_debug_session):
(LLDBDebugSession):
(LLDBDebugSession.setup):
(LLDBDebugSession.tearDown):
(TestSummaryProviders):
(TestSummaryProviders.setUpClass):
(TestSummaryProviders._sbFrame):
(TestSummaryProviders.serial_test_WTFStringImpl_SummaryProvider_null_string):
(TestSummaryProviders.serial_test_WTFStringImpl_SummaryProvider_empty_string):
(TestSummaryProviders.serial_test_WTFStringImpl_SummaryProvider_8bit_string):
(TestSummaryProviders.serial_test_WTFStringImpl_SummaryProvider_16bit_string):
(TestSummaryProviders.serial_test_WTFString_SummaryProvider_null_string):
(TestSummaryProviders.serial_test_WTFString_SummaryProvider_empty_string):
(TestSummaryProviders.serial_test_WTFString_SummaryProvider_8bit_string):
(TestSummaryProviders.serial_test_WTFString_SummaryProvider_16bit_string):

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

15 months ago[LFC] Compute both the collapsed and the non-collapsed margin values.
zalan@apple.com [Thu, 28 Jun 2018 03:05:16 +0000 (03:05 +0000)]
[LFC] Compute both the collapsed and the non-collapsed margin values.
https://bugs.webkit.org/show_bug.cgi?id=187129

Reviewed by Antti Koivisto.

For validation purposes only at this point.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeFloatingHeightAndMargin const):
(WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeInFlowHeightAndMargin const):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::isMarginTopCollapsedWithParent):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginTopFromFirstChild):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginTop):

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

15 months ago[LFC] Align inFlowNonReplacedHeightAndMargin() style with the rest of the compute...
zalan@apple.com [Thu, 28 Jun 2018 01:57:15 +0000 (01:57 +0000)]
[LFC] Align inFlowNonReplacedHeightAndMargin() style with the rest of the compute functions.
https://bugs.webkit.org/show_bug.cgi?id=187126

Reviewed by Antti Koivisto.

* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):

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

15 months agoFix IBeam issues with iPad apps on Mac
megan_gardner@apple.com [Thu, 28 Jun 2018 01:29:44 +0000 (01:29 +0000)]
Fix IBeam issues with iPad apps on Mac
https://bugs.webkit.org/show_bug.cgi?id=186900

Reviewed by Wenson Hsieh.

* Shared/ios/InteractionInformationAtPosition.h:
* Shared/ios/InteractionInformationAtPosition.mm:
(WebKit::InteractionInformationAtPosition::encode const):
(WebKit::InteractionInformationAtPosition::decode):

Add functionality to determine what a caret rect should be, but as it is
expensive, it should only be done for this platform.

* Shared/ios/InteractionInformationRequest.cpp:
(WebKit::InteractionInformationRequest::isApproximateForRequest):
* Shared/ios/InteractionInformationRequest.h:

As there is no way to premptively request information on hover, we need to use
the last cached information, but only if it is close to the point we are about
to request information for. So having a way to determine if a point is very close
to a previous point is a good idea.

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

UIKit is using this function to determine if we should show an Ibeam or not.
So we need to implement it, at least for this platform.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getPositionInformation):

Pass up the calculated caret rect, but only for iPad apps on Mac.

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

15 months ago[GTK][WPE] Use LazyNeverDestroyed<XErrorTrapper> to remove static initializers
utatane.tea@gmail.com [Thu, 28 Jun 2018 01:10:37 +0000 (01:10 +0000)]
[GTK][WPE] Use LazyNeverDestroyed<XErrorTrapper> to remove static initializers
https://bugs.webkit.org/show_bug.cgi?id=187089

Reviewed by Michael Catanzaro.

Source/WebCore:

Do not allow copying since XErrorTrapper's logic relies on the address of XErrorTrapper.

* platform/graphics/x11/XErrorTrapper.h:

Source/WebKit:

Use LazyNeverDestroyed<XErrorTrapper> instead of global std::unique_ptr<XErrorTrapper>.
Since this variable's exit time destructor is not important in this code, using
LazyNeverDestroyed<XErrorTrapper> is fine. This removes the last static initializer
of libwebkit2gtk.so.

* PluginProcess/unix/PluginProcessMainUnix.cpp:

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

15 months agoAdd Fuchsia support to build-jsc
abarth@webkit.org [Thu, 28 Jun 2018 01:04:54 +0000 (01:04 +0000)]
Add Fuchsia support to build-jsc
https://bugs.webkit.org/show_bug.cgi?id=187086

Reviewed by Yusuke Suzuki.

.:

Add Fuchsia port to cmake build system. After this patch, the build
errors out due to a missing sysroot.

* CMakeLists.txt:
* Source/cmake/OptionsFuchsia.cmake: Added.

Tools:

Add Fuchsia port to webkitdirs.pm. This patch is sufficient to make
build-jsc kick off a cmake for Fuchsia.

* Scripts/webkitdirs.pm:
(determineSourceDir):
(argumentsForConfiguration):
(determineXcodeSDK):
(findMatchingArguments):
(determinePortName):
(isFuchsia):
(setupAppleWinEnv):
(wrapperPrefixIfNeeded):
(relaunchIOSSimulator):
(debugMiniBrowser):

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

15 months agoMark imported/blink/storage/indexeddb/blob-delete-objectstore-db.html as flaky.
ryanhaddad@apple.com [Thu, 28 Jun 2018 00:25:06 +0000 (00:25 +0000)]
Mark imported/blink/storage/indexeddb/blob-delete-objectstore-db.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=172864

Unreviewed test gardening.

* TestExpectations:

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

15 months agoAdd some more register state information when we crash in repatchPutById
sbarati@apple.com [Thu, 28 Jun 2018 00:18:50 +0000 (00:18 +0000)]
Add some more register state information when we crash in repatchPutById
https://bugs.webkit.org/show_bug.cgi?id=187112

Reviewed by Mark Lam.

This will help us gather info when we end up seeing a ObjectPropertyConditionSet
with an offset that is different than what the put tells us.

* jit/Repatch.cpp:
(JSC::tryCachePutByID):

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

15 months agoRebase LayoutTests/http/tests/contentextensions/subresource-redirect-blocked-expected...
youenn@apple.com [Thu, 28 Jun 2018 00:15:17 +0000 (00:15 +0000)]
Rebase LayoutTests/http/tests/contentextensions/subresource-redirect-blocked-expected.txt after r233269
https://bugs.webkit.org/show_bug.cgi?id=187125

Unreviewed.

* http/tests/contentextensions/subresource-redirect-blocked-expected.txt:

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

15 months ago[LFC] Align inFlowNonReplacedWidthAndMargin() style with the rest of the compute...
zalan@apple.com [Wed, 27 Jun 2018 23:46:54 +0000 (23:46 +0000)]
[LFC] Align inFlowNonReplacedWidthAndMargin() style with the rest of the compute functions.
https://bugs.webkit.org/show_bug.cgi?id=187124

Reviewed by Antti Koivisto.

* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):

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

15 months agostyle-queue "AttributeError: 'NoneType' object has no attribute 'is_obsolete'" when...
dbates@webkit.org [Wed, 27 Jun 2018 23:43:13 +0000 (23:43 +0000)]
style-queue "AttributeError: 'NoneType' object has no attribute 'is_obsolete'" when processing security patch
https://bugs.webkit.org/show_bug.cgi?id=187120

Reviewed by David Kilzer.

Teach the style queue how to refetch a patch from the status server as we did for non-Style
EWS queues.

* Scripts/webkitpy/tool/bot/stylequeuetask.py:
(StyleQueueTask.validate): Similar to change made to EarlyWarningSystemTask.validate() in r233107,
only check if the bug associated with the patch we are processing is closed if the attachment has a
non-None Bug object.
* Scripts/webkitpy/tool/commands/earlywarningsystem.py:
(AbstractEarlyWarningSystem.refetch_patch): Extract logic to refetch a patch from here...
* Scripts/webkitpy/tool/commands/queues.py:
(PatchProcessingQueue._refetch_patch): ... to here.
(StyleQueue.refetch_patch): Turn around and call PatchProcessingQueue._refetch_patch().

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

15 months ago-webkit-clip-path wrong offset for clipPath references
krit@webkit.org [Wed, 27 Jun 2018 23:28:19 +0000 (23:28 +0000)]
-webkit-clip-path wrong offset for clipPath references
https://bugs.webkit.org/show_bug.cgi?id=129246

Reviewed by Simon Fraser.

Source/WebCore:

Compute the correct offset for reference clip-paths by reusing
some of the logic from basic shapes.
Makes reference based clip-path interoperable and follows the
spec.

Test: css3/masking/clip-path-reference-2.html

* rendering/RenderLayer.cpp:
(WebCore::computeReferenceBox):
(WebCore::RenderLayer::computeClipPath const):
(WebCore::RenderLayer::setupClipPath):

LayoutTests:

Add test for reference clip-path offset. Correct a broken test.
All tests in the repo for references are interoperable between Gecko, Blink
and WebKit now.

* css3/masking/clip-path-reference-2-expected.html: Added.
* css3/masking/clip-path-reference-2.html: Added.
* css3/masking/clip-path-reference-userSpaceOnUse-expected.html:
* css3/masking/clip-path-reference-userSpaceOnUse.html:

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

15 months agoUnreviewed, add myself as a WebKit committer.
tzagallo@apple.com [Wed, 27 Jun 2018 23:22:48 +0000 (23:22 +0000)]
Unreviewed, add myself as a WebKit committer.

* Scripts/webkitpy/common/config/contributors.json:

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

15 months agoFix a bug in $vm.callFrame() and apply previously requested renaming of $vm.println...
mark.lam@apple.com [Wed, 27 Jun 2018 23:13:53 +0000 (23:13 +0000)]
Fix a bug in $vm.callFrame() and apply previously requested renaming of $vm.println to print.
https://bugs.webkit.org/show_bug.cgi?id=187119

Reviewed by Keith Miller.

$vm.callFrame()'s JSDollarVMCallFrame::finishCreation()
should be checking for codeBlock instead of !codeBlock
before using the codeBlock.

I also renamed some other "print" functions to use "dump" instead
to match their underlying C++ code that they will call e.g.
CodeBlock::dumpSource().

* tools/JSDollarVM.cpp:
(WTF::JSDollarVMCallFrame::finishCreation):
(JSC::functionDumpSourceFor):
(JSC::functionDumpBytecodeFor):
(JSC::doPrint):
(JSC::functionDataLog):
(JSC::functionPrint):
(JSC::functionDumpCallFrame):
(JSC::functionDumpStack):
(JSC::JSDollarVM::finishCreation):
(JSC::functionPrintSourceFor): Deleted.
(JSC::functionPrintBytecodeFor): Deleted.
(JSC::doPrintln): Deleted.
(JSC::functionPrintln): Deleted.
(JSC::functionPrintCallFrame): Deleted.
(JSC::functionPrintStack): Deleted.
* tools/VMInspector.cpp:
(JSC::DumpFrameFunctor::DumpFrameFunctor):
(JSC::DumpFrameFunctor::operator() const):
(JSC::VMInspector::dumpCallFrame):
(JSC::VMInspector::dumpStack):
(JSC::VMInspector::dumpValue):
(JSC::PrintFrameFunctor::PrintFrameFunctor): Deleted.
(JSC::PrintFrameFunctor::operator() const): Deleted.
(JSC::VMInspector::printCallFrame): Deleted.
(JSC::VMInspector::printStack): Deleted.
(JSC::VMInspector::printValue): Deleted.
* tools/VMInspector.h:

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

15 months agoAdd a sandbox profile for some additional bank plugins
youenn@apple.com [Wed, 27 Jun 2018 22:53:17 +0000 (22:53 +0000)]
Add a sandbox profile for some additional bank plugins
https://bugs.webkit.org/show_bug.cgi?id=187105

Reviewed by Brent Fulgham.

* Resources/PlugInSandboxProfiles/cfca.com.npCryptoKit.CGB.MAC.sb: Added.
* Resources/PlugInSandboxProfiles/cfca.com.npP11CertEnroll.MAC.CGB.sb: Added.
* Resources/PlugInSandboxProfiles/com.apple.BocomSubmitCtrl.sb: Added.
* Resources/PlugInSandboxProfiles/com.apple.NPSafeInput.sb: Added.
* Resources/PlugInSandboxProfiles/com.apple.NPSafeSubmit.sb: Added.
* Resources/PlugInSandboxProfiles/com.cfca.npSecEditCtl.MAC.BOC.plugin.sb: Added.
* Resources/PlugInSandboxProfiles/com.cmbchina.CMBSecurity.sb: Added.
* Resources/PlugInSandboxProfiles/com.ftsafe.NPAPI-Core-Safe-SoftKeybaord.plugin.rfc1034identifier.sb: Added.
* WebKit.xcodeproj/project.pbxproj:

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

15 months agoBuild fix after r233266
jbedard@apple.com [Wed, 27 Jun 2018 22:49:20 +0000 (22:49 +0000)]
Build fix after r233266
https://bugs.webkit.org/show_bug.cgi?id=187024
<rdar://problem/39759057>

Unreviewed build fix.

* pal/cf/CoreMediaSoftLink.cpp: Do not soft-link CMSampleBufferCallForEachSample for
iOS 12 and up on iPhone device and simulator.
* pal/cf/CoreMediaSoftLink.h: Ditto.

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

15 months agoVersioning.
bshafiei@apple.com [Wed, 27 Jun 2018 22:43:33 +0000 (22:43 +0000)]
Versioning.

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

15 months agoDon't invoke post resolution callbacks when resolving computed style
antti@apple.com [Wed, 27 Jun 2018 22:25:30 +0000 (22:25 +0000)]
Don't invoke post resolution callbacks when resolving computed style
https://bugs.webkit.org/show_bug.cgi?id=187113
<rdar://problem/41365766>

Reviewed by Geoff Garen.

Source/WebCore:

Post-resolution callbacks should only be invoked when we resolve the full document style,
not when resolving computed style for a single element.

Tests: fast/dom/object-computed-style-event.html

* dom/Document.cpp:
(WebCore::Document::styleForElementIgnoringPendingStylesheets):
* dom/Element.cpp:
(WebCore::Element::resolveComputedStyle):

Also ref the ancestor stack to be safe.

* style/StyleTreeResolver.cpp:
(WebCore::Style::PostResolutionCallbackDisabler::PostResolutionCallbackDisabler):
(WebCore::Style::PostResolutionCallbackDisabler::~PostResolutionCallbackDisabler):

Add an option to not drain the callback queue on destruction. In this mode we
just block network loads.

* style/StyleTreeResolver.h:

LayoutTests:

* fast/dom/object-computed-style-event-expected.txt: Added.
* fast/dom/object-computed-style-event.html: Added.

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

15 months agoFind on page selection color isn't adapted for dark mode.
timothy@apple.com [Wed, 27 Jun 2018 22:14:53 +0000 (22:14 +0000)]
Find on page selection color isn't adapted for dark mode.
https://bugs.webkit.org/show_bug.cgi?id=187072
rdar://problem/40354841

Reviewed by Tim Horton.

Source/WebCore:

* page/mac/TextIndicatorWindow.mm:
(-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]): Use [NSColor findHighlightColor].
* platform/mac/LocalDefaultSystemAppearance.h:
(WebCore::LocalDefaultSystemAppearance::usingDarkAppearance const): Added.
* platform/mac/LocalDefaultSystemAppearance.mm:
(WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance): Set m_usingDarkAppearance.
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintPlatformDocumentMarkers): Use TextPaintPhase::Decoration since this
matches step three of InlineTextBox::paint ("Paint fancy decorations"). This allows TextMatch to
paint a forground and not end up painting during this "fancy decorations" phase.
(WebCore::InlineTextBox::resolveStyleForMarkedText): Set the fillColor for TextMarker to force a
dark text color which will draw over the yellow highlight.
(WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers): Added support for TextPaintPhase::Decoration.
Seperate DocumentMarker::TelephoneNumber and DocumentMarker::TextMatch. Have DocumentMarker::TextMatch
support Forground and Background phases.
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::platformColorsDidChange):
(WebCore::RenderTheme::activeTextSearchHighlightColor const): Added. Call the platfrom version.
(WebCore::RenderTheme::inactiveTextSearchHighlightColor const): Added. Ditto.
(WebCore::RenderTheme::platformActiveTextSearchHighlightColor const): Added StyleColor::Options.
(WebCore::RenderTheme::platformInactiveTextSearchHighlightColor const): Ditto.
* rendering/RenderTheme.h:
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::platformActiveTextSearchHighlightColor const): Added.
(WebCore::RenderThemeMac::platformInactiveTextSearchHighlightColor const): Added.
(WebCore::RenderThemeMac::platformColorsDidChange): Clear new color caches.
(WebCore::RenderThemeMac::systemColor const): Cache system colors by light and dark mode.

LayoutTests:

* fast/css/apple-system-control-colors-expected.txt: Updated.
* fast/text/mark-matches-broken-line-rendering-expected.html: Ditto.
* fast/text/mark-matches-rendering-expected.html: Ditto.

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

15 months agoCrash under SWServer::unregisterServiceWorkerClient()
cdumez@apple.com [Wed, 27 Jun 2018 21:43:41 +0000 (21:43 +0000)]
Crash under SWServer::unregisterServiceWorkerClient()
https://bugs.webkit.org/show_bug.cgi?id=187115
<rdar://problem/41539197>

Reviewed by Youenn Fablet.

Connections are usually destroyed before their SWServer. However, as per crash traces, it is possible
for SWServers to get destroyed while they still have connections. When this happens, the connections
(which are owned by the SWServer) get destroyed with other SWServer data members. In turn, the
connection destructor tries to unregister its clients from the server that is currently being destroyed.

To address the issue, the SWServer destructor now destroys remaining connections early, before SWServer's
other data members get destroyed.

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

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

15 months agoAdd logging to try to diagnose where we get a null structure.
keith_miller@apple.com [Wed, 27 Jun 2018 21:26:46 +0000 (21:26 +0000)]
Add logging to try to diagnose where we get a null structure.
https://bugs.webkit.org/show_bug.cgi?id=187106

Reviewed by Mark Lam.

Add a logging to JSObject::toPrimitive to help diagnose a nullptr
structure crash.

This code should be removed when we fix <rdar://problem/33451840>

* runtime/JSObject.cpp:
(JSC::callToPrimitiveFunction):
* runtime/JSObject.h:
(JSC::JSObject::getPropertySlot):

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