WebKit-https.git
4 years agoImport WPT service worker tests
commit-queue@webkit.org [Thu, 3 Aug 2017 20:21:29 +0000 (20:21 +0000)]
Import WPT service worker tests
https://bugs.webkit.org/show_bug.cgi?id=175053

Patch by Youenn Fablet <youenn@apple.com> on 2017-08-03
Reviewed by Brady Eidson.

LayoutTests/imported/w3c:

Importing service-worker tests up to cfdfb48329b20e19b6492a317ac5181a99506fd2.

* resources/resource-files.json:
* resources/import-expectations.json:
* web-platform-tests/service-workers/:

LayoutTests:

* TestExpectations: skipping service worker tests.

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

4 years agoWeb Automation: consider file extensions in the "accept" attribute when deciding...
bburg@apple.com [Thu, 3 Aug 2017 20:19:43 +0000 (20:19 +0000)]
Web Automation: consider file extensions in the "accept" attribute when deciding if a file can be uploaded
https://bugs.webkit.org/show_bug.cgi?id=175081

Reviewed by Joseph Pecoraro.

* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::fileCanBeAcceptedForUpload):
(WebKit::WebAutomationSession::handleRunOpenPanel):
In cases where a file has an extension, try to match it against the
accepted extensions list. Give up if there's no extension. Otherwise,
proceed as normal to infer a MIME type based on the extension.
In cases where extension-less files are inside hidden folders, the MIME
inference will fail as well.

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

4 years ago[GTK][WKE] Pass the --memory-limited option on the GTK and WPE buildbots for the...
clopez@igalia.com [Thu, 3 Aug 2017 19:37:13 +0000 (19:37 +0000)]
[GTK][WKE] Pass the --memory-limited option on the GTK and WPE buildbots for the JSC tests.
https://bugs.webkit.org/show_bug.cgi?id=175140

Reviewed by Alexey Proskuryakov.

We are having lately issues with JSC tests causing problems on
the GTK+ and WPE bots due to the high amount of memory some tests
need to run.

The best thing we can do now is to workaround this by disabling
all the tests marked as memoryLimited on the GTK and WPE bots.
We may revise this on the future.

* BuildSlaveSupport/build.webkit.org-config/master.cfg:
(RunJavaScriptCoreTests.start):

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

4 years agoAdd SW IDLs and stub out basic functionality.
beidson@apple.com [Thu, 3 Aug 2017 19:21:43 +0000 (19:21 +0000)]
Add SW IDLs and stub out basic functionality.
https://bugs.webkit.org/show_bug.cgi?id=175115

Reviewed by Chris Dumez.

.:

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

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

* runtime/CommonIdentifiers.h:

Source/WebCore:

No new tests (Currently no behavior change).

Overall note: This feature is EnabledAtRuntime as opposed to EnabledBySetting because
the Settings-based code generation is completely broken for non-Document contexts,
whereas the RuntimeEnabledFeatures-based generation is not.

* CMakeLists.txt:
* Configurations/FeatureDefines.xcconfig:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:

* bindings/scripts/preprocess-idls.pl: Handle the new global scope c'tor file.

* bindings/js/JSServiceWorkerContainerCustom.cpp: Added.
(WebCore::JSServiceWorkerContainer::ready const):

* bindings/js/JSWorkerGlobalScopeBase.cpp:
(WebCore::toJSWorkerGlobalScope): Refactor to handle both types of derived workers.
(WebCore::toJSServiceWorkerGlobalScope):
* bindings/js/JSWorkerGlobalScopeBase.h:

* dom/EventNames.h:
* dom/EventTargetFactory.in:

* features.json: Change status of feature.

* page/Navigator.idl:
* page/NavigatorBase.cpp:
(WebCore::NavigatorBase::serviceWorker):
* page/NavigatorBase.h:
* page/NavigatorServiceWorker.idl: Added.

* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::serviceWorkerEnabled const):
(WebCore::RuntimeEnabledFeatures::setServiceWorkerEnabled):

* workers/ServiceWorker.cpp: Added.
(WebCore::ServiceWorker::postMessage):
(WebCore::ServiceWorker::~ServiceWorker):
(WebCore::ServiceWorker::scriptURL const):
(WebCore::ServiceWorker::state const):
(WebCore::ServiceWorker::eventTargetInterface const):
(WebCore::ServiceWorker::scriptExecutionContext const):
* workers/ServiceWorker.h: Added.
* workers/ServiceWorker.idl: Added.

* workers/ServiceWorkerContainer.cpp: Added.
(WebCore::ServiceWorkerContainer::~ServiceWorkerContainer):
(WebCore::ServiceWorkerContainer::controller const):
(WebCore::ServiceWorkerContainer::ready):
(WebCore::ServiceWorkerContainer::addRegistration):
(WebCore::ServiceWorkerContainer::getRegistration):
(WebCore::ServiceWorkerContainer::getRegistrations):
(WebCore::ServiceWorkerContainer::startMessages):
(WebCore::ServiceWorkerContainer::eventTargetInterface const):
(WebCore::ServiceWorkerContainer::scriptExecutionContext const):
* workers/ServiceWorkerContainer.h: Added.
* workers/ServiceWorkerContainer.idl: Added.

* workers/ServiceWorkerGlobalScope.cpp: Added.
(WebCore::ServiceWorkerGlobalScope::registration):
(WebCore::ServiceWorkerGlobalScope::skipWaiting):
* workers/ServiceWorkerGlobalScope.h: Added.
* workers/ServiceWorkerGlobalScope.idl: Added.

* workers/ServiceWorkerRegistration.cpp: Added.
(WebCore::ServiceWorkerRegistration::~ServiceWorkerRegistration):
(WebCore::ServiceWorkerRegistration::installing):
(WebCore::ServiceWorkerRegistration::waiting):
(WebCore::ServiceWorkerRegistration::active):
(WebCore::ServiceWorkerRegistration::scope const):
(WebCore::ServiceWorkerRegistration::update):
(WebCore::ServiceWorkerRegistration::unregister):
(WebCore::ServiceWorkerRegistration::eventTargetInterface const):
(WebCore::ServiceWorkerRegistration::scriptExecutionContext const):
* workers/ServiceWorkerRegistration.h: Added.
* workers/ServiceWorkerRegistration.idl: Added.

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

* Configurations/FeatureDefines.xcconfig:

* Shared/WebPreferencesDefinitions.h:

* UIProcess/WebPreferences.cpp:
(WebKit::WebPreferences::enableAllExperimentalFeatures): Explicitly skip SW for now.
  The ramifications to layouttests are complicated, and we'd like to follow up in a
  separate patch.

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

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WTF:

* wtf/FeatureDefines.h:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

* Scripts/webkitpy/bindings/main.py:

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

4 years agoRename ScratchBuffer::activeLengthPtr to addressOfActiveLength.
mark.lam@apple.com [Thu, 3 Aug 2017 19:17:13 +0000 (19:17 +0000)]
Rename ScratchBuffer::activeLengthPtr to addressOfActiveLength.
https://bugs.webkit.org/show_bug.cgi?id=175142
<rdar://problem/33704528>

Reviewed by Filip Pizlo.

The convention in the rest of of JSC for such methods which return the address of
a field is to name them "addressOf<field name>".  We'll rename
ScratchBuffer::activeLengthPtr to be consistent with this convention.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileNewArrayWithSpread):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGThunks.cpp:
(JSC::DFG::osrExitGenerationThunkGenerator):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNewArray):
(JSC::FTL::DFG::LowerDFGToB3::compileNewArrayWithSpread):
* ftl/FTLThunks.cpp:
(JSC::FTL::genericGenerationThunkGenerator):
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::debugCall):
* jit/ScratchRegisterAllocator.cpp:
(JSC::ScratchRegisterAllocator::preserveUsedRegistersToScratchBufferForCall):
(JSC::ScratchRegisterAllocator::restoreUsedRegistersFromScratchBufferForCall):
* runtime/VM.h:
(JSC::ScratchBuffer::addressOfActiveLength):
(JSC::ScratchBuffer::activeLengthPtr): Deleted.
* wasm/WasmBinding.cpp:
(JSC::Wasm::wasmToJs):

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

4 years agoTest gardening.
commit-queue@webkit.org [Thu, 3 Aug 2017 19:13:43 +0000 (19:13 +0000)]
Test gardening.
https://bugs.webkit.org/show_bug.cgi?id=175137

Unreviewed test gardening.

Patch by Ms2ger <Ms2ger@igalia.com> on 2017-08-03

* platform/gtk/TestExpectations:
* platform/gtk/fast/images/async-image-multiple-clients-repaint-expected.txt: Added.
* platform/gtk/fast/text/atsui-pointtooffset-calls-cg-expected.txt:
* platform/win/TestExpectations:

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

4 years agoUnreviewed, build fix for Windows port
utatane.tea@gmail.com [Thu, 3 Aug 2017 18:59:44 +0000 (18:59 +0000)]
Unreviewed, build fix for Windows port
https://bugs.webkit.org/show_bug.cgi?id=175013

* wtf/Threading.h:

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

4 years agoMerge ThreadHolder to WTF::Thread itself
utatane.tea@gmail.com [Thu, 3 Aug 2017 18:29:16 +0000 (18:29 +0000)]
Merge ThreadHolder to WTF::Thread itself
https://bugs.webkit.org/show_bug.cgi?id=175013

Reviewed by Mark Lam.

Currently, we store ThreadHolder* to the TLS, and ThreadHolder* holds Ref<Thread>.
When we get Thread& from the current thread TLS, we need to dereference the ThreadHolder*.
However, ideally, we can store Thread* directly to the current thread TLS.
While the ThreadHolder design is beautiful, it's worth optimizing by storing Thread* directly
since Thread::current() is so frequently executed.

This patch merges ThreadHolder to Thread. And we now store Thread* directly in the TLS.
When storing it to TLS, we call leakRef() to keep Thread ref count incremented by the TLS.
And when destroying the TLS, we call `deref()` to ensure that Thread* is dereferenced from
the TLS.

* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/ThreadHolder.cpp: Removed.
* wtf/ThreadHolder.h: Removed.
* wtf/ThreadHolderPthreads.cpp: Removed.
* wtf/ThreadHolderWin.cpp: Removed.
* wtf/Threading.cpp:
(WTF::Thread::entryPoint):
(WTF::initializeThreading):
* wtf/Threading.h:
(WTF::Thread::currentMayBeNull):
(WTF::Thread::current):
* wtf/ThreadingPthreads.cpp:
(WTF::Thread::waitForCompletion):
(WTF::Thread::initializeCurrentTLS):
(WTF::Thread::initializeTLSKey):
(WTF::Thread::initializeTLS):
(WTF::Thread::destructTLS):
(WTF::Thread::createCurrentThread): Deleted.
* wtf/ThreadingWin.cpp:
(WTF::Thread::initializeCurrentTLS):
(WTF::threadMapMutex):
(WTF::Thread::initializeTLSKey):
(WTF::Thread::currentDying):
(WTF::Thread::get):
(WTF::Thread::initializeTLS):
(WTF::Thread::destructTLS):
(WTF::waitForThreadCompletion):
(WTF::Thread::createCurrentThread): Deleted.

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

4 years ago[WebKit] Sort Xcode project file
commit-queue@webkit.org [Thu, 3 Aug 2017 18:03:47 +0000 (18:03 +0000)]
[WebKit] Sort Xcode project file
https://bugs.webkit.org/show_bug.cgi?id=175122

Patch by Yoshiaki Jitsukawa <jitsu@rd.scei.sony.co.jp> on 2017-08-03
Reviewed by Antti Koivisto.

* WebKit.xcodeproj/project.pbxproj:

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

4 years ago[WebCore] Sort Xcode project files
commit-queue@webkit.org [Thu, 3 Aug 2017 18:03:16 +0000 (18:03 +0000)]
[WebCore] Sort Xcode project files
https://bugs.webkit.org/show_bug.cgi?id=175121

Patch by Yoshiaki Jitsukawa <jitsu@rd.scei.sony.co.jp> on 2017-08-03
Reviewed by Antti Koivisto.

Source/WebCore:

* WebCore.xcodeproj/project.pbxproj:

Source/WebCore/PAL:

* PAL.xcodeproj/project.pbxproj:

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

4 years agoSource/WebCore:
weinig@apple.com [Thu, 3 Aug 2017 17:51:22 +0000 (17:51 +0000)]
Source/WebCore:
[WebIDL] Convert MutationCallback to be a normal generated callback
https://bugs.webkit.org/show_bug.cgi?id=174140

Reviewed by Darin Adler.

To make this work more nicely, I:
- Added the ability to for non-nullable interfaces in sequences to be passed
  via a Ref<> rather than a RefPtr<> as a parameter to a callback function.
  (e.g. callback MyCallback = void (sequence<Foo> foos) will now have the
  signature, CallbackResult<void> handleEvent(const Vector<Ref<Foo>>&) rather
  than CallbackResult<void> handleEvent(const Vector<RefPtr<Foo>>&).
- Added a new extended attribute for callback functions called [CallbackThisObject=Type]
  which allows you to specify that the callback needs a this object in addition
  to its arguments. When specified, the first argument of the C++ implementation
  function will now correspond to the this object, with the remaining arguments
  shifted over one.
- Converted callback objects to all inherit directly from ActiveDOMCallback rather
  than having the generated JS callback derived class inherit from it. This allows
  us to have access to a callback's canInvokeCallback() function anywhere (needed
  for MutationCallback) as well as giving a place to put an optional virtual
  visitJSFunction to allow marking weak callbacks (while not an ideal layering,
  this matches what we do in EventListener). This change requires each callback to
  have a bit more code to import the ActiveDOMCallback's constructor and requires
  non-JS derived callbacks to pass a ScriptExecutionContext (e.g. the Document).

* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSMutationCallback.cpp: Removed.
* bindings/js/JSMutationCallback.h: Removed.
Remove custom JSMutationCallback.h/cpp

* Modules/geolocation/PositionCallback.h:
* Modules/geolocation/PositionErrorCallback.h:
* Modules/notifications/NotificationPermissionCallback.h:
* Modules/webaudio/AudioBufferCallback.h:
* Modules/webdatabase/DatabaseCallback.h:
* Modules/webdatabase/SQLStatementCallback.h:
* Modules/webdatabase/SQLStatementErrorCallback.h:
* Modules/webdatabase/SQLTransactionCallback.h:
* Modules/webdatabase/SQLTransactionErrorCallback.h:
* css/MediaQueryListListener.h:
* dom/NodeFilter.h:
* dom/RequestAnimationFrameCallback.h:
* dom/StringCallback.h:
* fileapi/BlobCallback.h:
* html/VoidCallback.h:
* page/IntersectionObserverCallback.h:
* page/PerformanceObserverCallback.h:
Add ActiveDOMCallback as a base class. Import the ActiveDOMCallback constructor.

* Modules/mediastream/MediaDevicesRequest.cpp:
(WebCore::MediaDevicesRequest::filterDeviceList):
(WebCore::MediaDevicesRequest::start):
* Modules/mediastream/MediaDevicesRequest.h:
Change filterDeviceList to take a Vector of Refs.

* bindings/IDLTypes.h:
Add InnerParameterType and NullableInnerParameterType type hooks
and specialize wrappers to use Ref for InnerParameterType, and RefPtr
for NullableInnerParameterType.

* bindings/js/JSCallbackData.cpp:
* bindings/js/JSCallbackData.h:
Add support for passing a this object and give JSCallbackDataWeak a visitJSFunction
to allow marking the underlying function.

* bindings/js/JSMutationObserverCustom.cpp:
(WebCore::JSMutationObserver::visitAdditionalChildren):
(WebCore::constructJSMutationObserver): Deleted.
Remove the custom constructor and replace it with a custom visitAdditionalChildren
that calls the new ActiveDOMObject's visitJSFunction.

* bindings/scripts/CodeGenerator.pm:
(ParseType):
Add helper to parse a type and cache the result.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateCallbackHeaderContent):
(GenerateCallbackImplementationContent):
(GetJSCallbackDataType): Deleted.
- Add support for [CallbackThisObject]. When [CallbackThisObject] is not specified, use jsUndefined()
  as the this object as specified by WebIDL.
- Stop inheriting from ActiveDOMCallback now that callbacks need to do this themselves.
- Add a visitJSFunction override for weak callback functions which calls into the callback data.

* bindings/scripts/IDLAttributes.json:
Add [CallbackThisObject].

* bindings/scripts/IDLParser.pm:
(ParseType):
Add entry point to parse a single type.

* css/FontFaceSet.h:
Use Ref rather than RefPtr for the faces sequence.

* dom/ActiveDOMCallback.h:
(WebCore::ActiveDOMCallback::visitJSFunction):
Add an optional visitJSFunction virtual function so that derived classes
have a way of marking underlying function objects.

* dom/MutationCallback.h:
Convert to support generation (return a CallbackResult, inherit from ActiveDOMObject).

* dom/MutationCallback.idl: Added.
Added to generate the callback. Uses the new [CallbackThisObject].

* dom/MutationObserver.cpp:
(WebCore::MutationObserver::deliver):
Switch to call idiomatic handleEvent, and pass *this as the first parameter
which will be translated into the this object.

* dom/MutationObserver.h:
(WebCore::MutationObserver::callback):
Expose the callback so it can marked during GC.

* dom/MutationObserver.idl:
Remove CustomConstructor and replace it with a custom mark function.

* dom/NativeNodeFilter.cpp:
* dom/NativeNodeFilter.h:
* inspector/InspectorDatabaseAgent.cpp:
Pass now needed ScriptExecutionContext to non-js based callbacks.

* bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
* bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.cpp:
* bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.cpp: Added.
* bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.h: Added.
* bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp:
* bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
* bindings/scripts/test/JS/JSTestCallbackInterface.h:
* bindings/scripts/test/JS/JSTestVoidCallbackFunction.cpp:
* bindings/scripts/test/TestCallbackFunctionWithThisObject.idl: Added.
* bindings/scripts/test/TestCallbackInterface.idl:
Add/update tests.

Source/WebKit:
[WebIDL] Convert MutationCallback to be a normal generated callback
https://bugs.webkit.org/show_bug.cgi?id=174140

Reviewed by Darin Adler.

* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeFilter.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeFilterPrivate.h:
Pass, now necessary, Document to NativeNodeFilter constructor.

Source/WebKitLegacy/mac:
[WebIDL] Convert MutationCallback to be a normal generated callback
https://bugs.webkit.org/show_bug.cgi?id=174140

Reviewed by Darin Adler.

* DOM/DOMDocument.mm:
(-[DOMDocument createNodeIterator:whatToShow:filter:expandEntityReferences:]):
(-[DOMDocument createTreeWalker:whatToShow:filter:expandEntityReferences:]):
Pass, now necessary, Document to NativeNodeFilter constructor.

LayoutTests:
[WebIDL] Convert MutationCallback to be a normal generate callback
https://bugs.webkit.org/show_bug.cgi?id=174140

Reviewed by Darin Adler.

* fast/dom/MutationObserver/mutation-observer-constructor-expected.txt:
Update results for standard error messages.

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

4 years agoUse MPAVRoutingController instead of deprecated versions.
commit-queue@webkit.org [Thu, 3 Aug 2017 17:37:42 +0000 (17:37 +0000)]
Use MPAVRoutingController instead of deprecated versions.
https://bugs.webkit.org/show_bug.cgi?id=175063
Source/WebCore:

Patch by Jeremy Jones <jeremyj@apple.com> on 2017-08-03
Reviewed by Tim Horton.

No new tests because no behavior change. This uses a different platform class to present
an interface.

Remove deprecated MPAudioVideoRoutingPopoverController and MPAVRoutingSheet
Add MPMediaControlsViewController.

* platform/spi/ios/MediaPlayerSPI.h:

Source/WebKit:

rdar://problem/33301230

Patch by Jeremy Jones <jeremyj@apple.com> on 2017-08-03
Reviewed by Tim Horton.

Remove dependence on deprecated classes MPAVRoutingSheet and MPAudioVideoRoutingPopoverController.

* UIProcess/ios/forms/WKAirPlayRoutePicker.h:
* UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
(-[WKAirPlayRoutePicker dealloc]):
(-[WKAirPlayRoutePicker show:fromRect:]):
(-[WKAirPlayRoutePicker popoverControllerDidDismissPopover:]): Deleted.
(-[WKAirPlayRoutePicker _presentAirPlayPopoverAnimated:fromRect:]): Deleted.
(-[WKAirPlayRoutePicker _windowWillRotate:]): Deleted.
(-[WKAirPlayRoutePicker _windowDidRotate:]): Deleted.
(-[WKAirPlayRoutePicker _dismissAirPlayRoutePickerIPad]): Deleted.
(-[WKAirPlayRoutePicker showAirPlayPickerIPad:fromRect:]): Deleted.
(-[WKAirPlayRoutePicker showAirPlayPickerIPhone:]): Deleted.

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

4 years agoImprove our support for referrer policies
cdumez@apple.com [Thu, 3 Aug 2017 17:19:44 +0000 (17:19 +0000)]
Improve our support for referrer policies
https://bugs.webkit.org/show_bug.cgi?id=175069
<rdar://problem/33677313>

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline several WPT tests now that more checks are passing.

* web-platform-tests/beacon/headers/header-referrer-origin-when-cross-origin-expected.txt:
* web-platform-tests/beacon/headers/header-referrer-same-origin-expected.txt:
* web-platform-tests/beacon/headers/header-referrer-strict-origin-when-cross-origin.https-expected.txt:
* web-platform-tests/beacon/headers/header-referrer-strict-origin.https-expected.txt:
* web-platform-tests/beacon/headers/header-referrer-unsafe-url.https-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-referrer-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-referrer-worker-expected.txt:
* web-platform-tests/fetch/api/request/request-init-001.sub-expected.txt:

Source/WebCore:

Improve our support for referrer policies. In particular, we now support the
additional following ones: "same-origin", "origin-when-cross-origin" and
"strict-origin-when-cross-origin".

This is as per the following specification:
- https://www.w3.org/TR/referrer-policy/#referrer-policies

Also refactor the code a bit for clarity: I merged the ReferrerPolicy enum and the
FetchOptions::ReferrerPolicy one.

Tests: http/tests/referrer-policy/origin-when-cross-origin/cross-origin-http-http.html
       http/tests/referrer-policy/origin-when-cross-origin/cross-origin-http.https.html
       http/tests/referrer-policy/origin-when-cross-origin/same-origin.html
       http/tests/referrer-policy/same-origin/cross-origin-http-http.html
       http/tests/referrer-policy/same-origin/cross-origin-http.https.html
       http/tests/referrer-policy/same-origin/same-origin.html
       http/tests/referrer-policy/strict-origin-when-cross-origin/cross-origin-http-http.html
       http/tests/referrer-policy/strict-origin-when-cross-origin/cross-origin-http.https.html
       http/tests/referrer-policy/strict-origin-when-cross-origin/same-origin.html
       http/tests/referrer-policy/strict-origin/cross-origin-http-http.html
       http/tests/referrer-policy/strict-origin/cross-origin-http.https.html
       http/tests/referrer-policy/strict-origin/same-origin.html

* Modules/fetch/FetchLoader.cpp:
(WebCore::FetchLoader::start):
* Modules/fetch/FetchReferrerPolicy.h:
* Modules/fetch/FetchReferrerPolicy.idl:
* Modules/fetch/FetchRequest.h:
* Modules/fetch/FetchRequestInit.h:
* dom/Document.cpp:
(WebCore::Document::processReferrerPolicy):
(WebCore::Document::applyQuickLookSandbox):
(WebCore::Document::applyContentDispositionAttachmentSandbox):
* dom/Document.h:
* loader/FetchOptions.h:
* loader/FrameNetworkingContext.h:
* loader/PingLoader.cpp:
(WebCore::PingLoader::sendBeacon):
Drop explicit call to SecurityPolicy::shouldHideReferrer(). This is already called inside
SecurityPolicy::generateReferrerHeader() and used only when needed, depending on the
actual referrer policy.

* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::updateHTTPRequestHeaders):
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::updateReferrerOriginAndUserAgentHeaders):
* page/SecurityPolicy.cpp:
(WebCore::referrerToOriginString):
(WebCore::SecurityPolicy::generateReferrerHeader):
* page/SecurityPolicy.h:
* platform/ReferrerPolicy.h:

Source/WebKit:

* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::loadResource):
(WebKit::WebLoaderStrategy::schedulePluginStreamLoad):

LayoutTests:

* http/tests/referrer-policy/origin-when-cross-origin/cross-origin-http-http-expected.txt: Added.
* http/tests/referrer-policy/origin-when-cross-origin/cross-origin-http-http.html: Added.
* http/tests/referrer-policy/origin-when-cross-origin/cross-origin-http.https-expected.txt: Added.
* http/tests/referrer-policy/origin-when-cross-origin/cross-origin-http.https.html: Added.
* http/tests/referrer-policy/origin-when-cross-origin/same-origin-expected.txt: Added.
* http/tests/referrer-policy/origin-when-cross-origin/same-origin.html: Added.
* http/tests/referrer-policy/resources/document.html: Added.
* http/tests/referrer-policy/same-origin/cross-origin-http-http-expected.txt: Added.
* http/tests/referrer-policy/same-origin/cross-origin-http-http.html: Added.
* http/tests/referrer-policy/same-origin/cross-origin-http.https-expected.txt: Added.
* http/tests/referrer-policy/same-origin/cross-origin-http.https.html: Added.
* http/tests/referrer-policy/same-origin/same-origin-expected.txt: Added.
* http/tests/referrer-policy/same-origin/same-origin.html: Added.
* http/tests/referrer-policy/strict-origin-when-cross-origin/cross-origin-http-http-expected.txt: Added.
* http/tests/referrer-policy/strict-origin-when-cross-origin/cross-origin-http-http.html: Added.
* http/tests/referrer-policy/strict-origin-when-cross-origin/cross-origin-http.https-expected.txt: Added.
* http/tests/referrer-policy/strict-origin-when-cross-origin/cross-origin-http.https.html: Added.
* http/tests/referrer-policy/strict-origin-when-cross-origin/same-origin-expected.txt: Added.
* http/tests/referrer-policy/strict-origin-when-cross-origin/same-origin.html: Added.
* http/tests/referrer-policy/strict-origin/cross-origin-http-http-expected.txt: Added.
* http/tests/referrer-policy/strict-origin/cross-origin-http-http.html: Added.
* http/tests/referrer-policy/strict-origin/cross-origin-http.https-expected.txt: Added.
* http/tests/referrer-policy/strict-origin/cross-origin-http.https.html: Added.
* http/tests/referrer-policy/strict-origin/same-origin-expected.txt: Added.
* http/tests/referrer-policy/strict-origin/same-origin.html: Added.
Add layout test coverage.

* http/tests/security/referrer-policy-invalid-expected.txt:
Rebaseline test now that console message has changed.

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

4 years agoSupport ::marker pseudo-element
dbates@webkit.org [Thu, 3 Aug 2017 16:16:50 +0000 (16:16 +0000)]
Support ::marker pseudo-element
https://bugs.webkit.org/show_bug.cgi?id=141477

Reviewed by David Hyatt.

Source/WebCore:

Implements the ::marker pseudo element as per the CSS Pseudo-Element Module Level 4
spec., <https://drafts.csswg.org/css-pseudo-4> (Editor's Draft, 24 July 2017).

The ::marker pseudo element is a convenience pseudo element that allows a person to
style the appearance of a list item marker. For example, to render all list item
markers in bolded, blue text you would define a stylesheet with the following content:

li::marker {
    color: blue;
    font-weight: bold;
}

and this could be applied to a page that contains markup of the form:

<ol>
    <li>Item 1</li>
    <li>Item 2</li>
    ...
    <li>Item N-1</li>
    <li>Item N</li>
</ol>

Formerly to the achieve the same effect you would need to use a stylesheet of the form:

li {
    color: blue;
    font-weight: bold;
}

.list-item-content {
    all: initial;
}

and then write your markup to have the form:

<ol>
    <li><span class="list-item-content">Item 1</span></li>
    <li><span class="list-item-content">Item 2</span></li>
    ...
    <li><span class="list-item-content">Item N-1</span></li>
    <li><span class="list-item-content">Item N</span></li>
</ol>

The ::marker pseudo element only supports stylizing all font properties and the color property
of a list item marker.

Tests: fast/lists/list-marker-with-display.html
       http/wpt/css/css-pseudo-4/marker-and-other-pseudo-elements.html
       http/wpt/css/css-pseudo-4/marker-color.html
       http/wpt/css/css-pseudo-4/marker-font-properties.html
       http/wpt/css/css-pseudo-4/marker-inherit-values.html

* css/CSSSelector.cpp:
(WebCore::CSSSelector::pseudoId): Return the pseudo id for the ::marker pseudo element.
* css/CSSSelector.h: Add enumerator PseudoElementMarker to the pseudo element enum.
* css/RuleSet.cpp:
(WebCore::determinePropertyWhitelistType): Return whitelist type PropertyWhitelistMarker for ::marker
so that we match rules against the acceptable rules for ::marker.
* css/RuleSet.h: Add enumerator PropertyWhitelistMarker to the property whitelist type enum.
* css/SelectorPseudoElementTypeMap.in: Add "marker" to the list of pseudo element types.
* css/StyleResolver.cpp:
(WebCore::isValidMarkerStyleProperty): Determines if the specified CSS property is valid inside ::marker.
(WebCore::StyleResolver::CascadedProperties::addMatch): Only recognize CSS properties in the content block
of ::marker that match the ::marker whitelist policy.
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::computeMarkerStyle): Computes the style object for the list item marker. We
apply the user-agent style to the marker here as opposed to defining ::marker in the UA sheet as per
the spec. as an optimization to avoid having the style resolver apply the pseudo element to all elements.
For now, we always inherit style from the originating element (list item). Added FIXME to selectively
inherit styles.
(WebCore::RenderListItem::styleDidChange): Always apply the list marker style to the list marker renderer.
* rendering/RenderListItem.h:
* rendering/style/RenderStyleConstants.h: Add pseudo ID for the ::marker pseudo element.

LayoutTests:

Add tests that check we respect ::marker when rendering the list item marker. I will
submit all the tests in http/wpt/css/css-pseudo-4 to the Web Platform Tests repository
shortly and then import them into the WebKit repository in a subsequent commit.

* fast/lists/list-marker-with-display-expected.html: Added.
* fast/lists/list-marker-with-display.html: Added.
* http/wpt/css/css-pseudo-4/marker-and-other-pseudo-elements-expected.html: Added.
* http/wpt/css/css-pseudo-4/marker-and-other-pseudo-elements.html: Added.
* http/wpt/css/css-pseudo-4/marker-color-expected.html: Added.
* http/wpt/css/css-pseudo-4/marker-color.html: Added.
* http/wpt/css/css-pseudo-4/marker-font-properties-expected.html: Added.
* http/wpt/css/css-pseudo-4/marker-font-properties.html: Added.
* http/wpt/css/css-pseudo-4/marker-inherit-values-expected.html: Added.
* http/wpt/css/css-pseudo-4/marker-inherit-values.html: Added.

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

4 years ago[Win] The test http/tests/security/contentSecurityPolicy/upgrade-insecure-requests...
pvollan@apple.com [Thu, 3 Aug 2017 16:01:54 +0000 (16:01 +0000)]
[Win] The test http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/basic-upgrade.https.html is failing.
https://bugs.webkit.org/show_bug.cgi?id=159510

Reviewed by Daniel Bates.

Allow any https certificate when running tests.

* DumpRenderTree/win/DumpRenderTree.cpp:
(runTest):

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

4 years ago[Win] WebKit COM header file is not placed in the correct location.
pvollan@apple.com [Thu, 3 Aug 2017 14:47:48 +0000 (14:47 +0000)]
[Win] WebKit COM header file is not placed in the correct location.
https://bugs.webkit.org/show_bug.cgi?id=175101

Reviewed by Brent Fulgham.

After the transition to WebKitLegacy, the generated WebKit header files should still
be placed in the WebKit folder, so WebKit clients will find the header files in the
same place.

* WebKitLegacy.vcxproj/WebKitLegacy.proj:

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

4 years agoFactor common code in Style::*ChangeInvalidation into helper functions
antti@apple.com [Thu, 3 Aug 2017 14:45:29 +0000 (14:45 +0000)]
Factor common code in Style::*ChangeInvalidation into helper functions
https://bugs.webkit.org/show_bug.cgi?id=174312

Reviewed by Andreas Kling.

There is a lot of copy code here.

* Style/StyleInvalidationFunctions.h: Added.
(WebCore::Style::traverseRuleFeaturesInShadowTree):
(WebCore::Style::traverseRuleFeaturesForSlotted):
(WebCore::Style::traverseRuleFeatures):

    Add functions for traversing rule features that may affect style of an element.
    Use lambdas to implement client-specific behavior.

* WebCore.xcodeproj/project.pbxproj:
* style/AttributeChangeInvalidation.cpp:
(WebCore::Style::mayBeAffectedByAttributeChange):
(WebCore::Style::AttributeChangeInvalidation::invalidateStyle):
(WebCore::Style::mayBeAffectedByHostRules): Deleted.
(WebCore::Style::mayBeAffectedBySlottedRules): Deleted.
* style/ClassChangeInvalidation.cpp:
(WebCore::Style::ClassChangeInvalidation::invalidateStyle):
(WebCore::Style::mayBeAffectedByHostRules): Deleted.
(WebCore::Style::mayBeAffectedBySlottedRules): Deleted.
* style/IdChangeInvalidation.cpp:
(WebCore::Style::IdChangeInvalidation::invalidateStyle):
(WebCore::Style::mayBeAffectedByHostRules): Deleted.
(WebCore::Style::mayBeAffectedBySlottedRules): Deleted.

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

4 years ago[EME] CDM constructor assigns CDMPrivate member multiple times
zandobersek@gmail.com [Thu, 3 Aug 2017 14:40:47 +0000 (14:40 +0000)]
[EME] CDM constructor assigns CDMPrivate member multiple times
https://bugs.webkit.org/show_bug.cgi?id=175128

Reviewed by Xabier Rodriguez-Calvar.

In the CDM class constructor, iterate over the registered CDM
factories, finding one that supports the specified key system.
A CDMPrivate object is created through that factory, and the
iteration is now stopped at that point, while previously it
contined to potentially create CDMPrivate objects through
other factories.

Helper createCDMPrivateForKeySystem() function is removed.

* Modules/encryptedmedia/CDM.cpp:
(WebCore::CDM::CDM):
(WebCore::createCDMPrivateForKeySystem): Deleted.

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

4 years agoDon't always recalc the style of display: contents elements.
commit-queue@webkit.org [Thu, 3 Aug 2017 13:20:30 +0000 (13:20 +0000)]
Don't always recalc the style of display: contents elements.
https://bugs.webkit.org/show_bug.cgi?id=172753

Patch by Emilio Cobos Ãlvarez <ecobos@igalia.com> on 2017-08-03
Reviewed by Antti Koivisto.

No new tests (no functionality change). This only removes an
inefficiency.

* dom/Element.cpp:
(WebCore::Element::existingComputedStyle):
* dom/Element.h:
* style/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateRenderTree):
(WebCore::RenderTreeUpdater::updateElementRenderer):
* style/StyleTreeResolver.cpp:
(WebCore::Style::renderOrDisplayContentsStyle):
(WebCore::Style::TreeResolver::resolveElement):
(WebCore::Style::TreeResolver::createAnimatedElementUpdate):
(WebCore::Style::shouldResolveElement):
(WebCore::Style::TreeResolver::resolveComposedTree):

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

4 years ago[Linux][WTF] Use one global semaphore to notify thread suspend and resume completion
utatane.tea@gmail.com [Thu, 3 Aug 2017 11:17:44 +0000 (11:17 +0000)]
[Linux][WTF] Use one global semaphore to notify thread suspend and resume completion
https://bugs.webkit.org/show_bug.cgi?id=175124

Reviewed by Carlos Garcia Campos.

POSIX sem_t is used to notify thread suspend and resume completion in Linux ports
since sem_post is async-signal-safe function. Since we guard suspend() and resume()
with one global lock, this semaphore is also guarded by this lock. So we do not need
to have semaphore per WTF::Thread.

This patch introduces one global Semaphore. And drop per thread semaphore.

* wtf/Threading.h:
* wtf/ThreadingPthreads.cpp:
(WTF::Thread::~Thread):
(WTF::Semaphore::Semaphore):
(WTF::Semaphore::~Semaphore):
(WTF::Semaphore::wait):
(WTF::Semaphore::post):
(WTF::Thread::signalHandlerSuspendResume):
(WTF::Thread::initializePlatformThreading):
(WTF::Thread::suspend):
(WTF::Thread::resume):
(WTF::Thread::Thread): Deleted.
* wtf/ThreadingWin.cpp:
(WTF::Thread::Thread): Deleted.

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

4 years ago[GTK] Remove obsolete failure expectation for narrow-non-breaking-space.html.
commit-queue@webkit.org [Thu, 3 Aug 2017 10:03:24 +0000 (10:03 +0000)]
[GTK] Remove obsolete failure expectation for narrow-non-breaking-space.html.
https://bugs.webkit.org/show_bug.cgi?id=139493

Unreviewed test gardening.

It likely started passing in r205826 due to its change in Font.cpp.

Patch by Ms2ger <Ms2ger@igalia.com> on 2017-08-03

* platform/gtk/TestExpectations:

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

4 years ago[GTK] Skip timezone-dependent Sputnik tests.
commit-queue@webkit.org [Thu, 3 Aug 2017 09:33:31 +0000 (09:33 +0000)]
[GTK] Skip timezone-dependent Sputnik tests.
https://bugs.webkit.org/show_bug.cgi?id=175120

Unreviewed test gardening.

These tests are skipped in the platform-neutral TestExpectations file because
they only pass in Pacific Time (see bug 42625). There doesn't seem to be a
reason for gtk to run them, and they do pass on the buildbot.

Patch by Ms2ger <Ms2ger@igalia.com> on 2017-08-03

* platform/gtk/TestExpectations:

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

4 years ago[Linux][WTF] Reduce sizeof(WTF::Thread) by using a pointer to PlatformRegisters
utatane.tea@gmail.com [Thu, 3 Aug 2017 08:53:00 +0000 (08:53 +0000)]
[Linux][WTF] Reduce sizeof(WTF::Thread) by using a pointer to PlatformRegisters
https://bugs.webkit.org/show_bug.cgi?id=175119

Reviewed by Carlos Garcia Campos.

sizeof(PlatformRegisters) is so large. In my Linux box, it is 256. It enlarges the sizeof(WTF::Thread).
However, it is not necessary to hold it in WTF::Thread member. Thread's ucontext data and its stack is
effective while suspending the thread. So, we can just use the pointer to the PlatformRegister instead
of copying it to the member of the WTF::Thread.

* wtf/Threading.h:
* wtf/ThreadingPthreads.cpp:
(WTF::Thread::signalHandlerSuspendResume):
(WTF::Thread::getRegisters):

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

4 years agoWeb Inspector: add stack trace information for each RecordingAction
drousso@apple.com [Thu, 3 Aug 2017 06:18:08 +0000 (06:18 +0000)]
Web Inspector: add stack trace information for each RecordingAction
https://bugs.webkit.org/show_bug.cgi?id=174663

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/ScriptCallFrame.h:
Add `operator==` so that when a ScriptCallFrame object is held in a Vector, calling `find`
with an existing value doesn't need require a functor and can use existing code.

* interpreter/StackVisitor.h:
* interpreter/StackVisitor.cpp:
(JSC::StackVisitor::Frame::isWasmFrame const): Inlined in header.

Source/WebCore:

Tests: inspector/canvas/recording-2d.html
       inspector/model/recording.html

* inspector/InspectorCanvas.h:
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::indexForData):
(WebCore::InspectorCanvas::buildAction):

Source/WebInspectorUI:

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Main.html:

* UserInterface/Models/Recording.js:
(WI.Recording.prototype.swizzle):
Add Array type for swizzling array values.

* UserInterface/Models/RecordingAction.js:
(WI.RecordingAction):
(WI.RecordingAction.fromPayload):
(WI.RecordingAction.prototype.get trace):
(WI.RecordingAction.prototype.swizzle):
(WI.RecordingAction.prototype.toJSON):

* UserInterface/Views/RecordingTraceDetailsSidebarPanel.js: Added.
(WI.RecordingTraceDetailsSidebarPanel):
(WI.RecordingTraceDetailsSidebarPanel.disallowInstanceForClass):
(WI.RecordingTraceDetailsSidebarPanel.prototype.inspect):
(WI.RecordingTraceDetailsSidebarPanel.prototype.set recording):
(WI.RecordingTraceDetailsSidebarPanel.prototype.updateActionIndex):
* UserInterface/Views/RecordingTraceDetailsSidebarPanel.css: Added.
(.sidebar > .panel.details.recording-trace > .content > .call-frame):
(.sidebar > .details.recording-trace > .content > .no-trace-data):
(.sidebar > .details.recording-trace > .content > .no-trace-data > .message):

* UserInterface/Views/RecordingTabContentView.js:
(WI.RecordingTabContentView):

* UserInterface/Views/RecordingActionTreeElement.js:
(WI.RecordingActionTreeElement.prototype.populateContextMenu):

* UserInterface/Views/CallFrameView.css:
(.call-frame):
(body[dir=ltr] .call-frame .icon):
(body[dir=rtl] .call-frame .icon):
Apply the same trailing margin for CallFrameView icons as TreeElement.

LayoutTests:

* inspector/canvas/recording-2d-expected.txt:
* inspector/canvas/recording-2d.html:
* inspector/model/recording-expected.txt:
* inspector/model/recording.html:

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

4 years agoUnreviewed, build fix for Windows port
utatane.tea@gmail.com [Thu, 3 Aug 2017 06:16:38 +0000 (06:16 +0000)]
Unreviewed, build fix for Windows port
https://bugs.webkit.org/show_bug.cgi?id=174716

This ugliness will be fixed in https://bugs.webkit.org/show_bug.cgi?id=175013.

* wtf/ThreadHolder.h:
* wtf/Threading.h:

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

4 years agoMerge WTFThreadData to Thread::current
utatane.tea@gmail.com [Thu, 3 Aug 2017 06:03:18 +0000 (06:03 +0000)]
Merge WTFThreadData to Thread::current
https://bugs.webkit.org/show_bug.cgi?id=174716

Reviewed by Mark Lam.

Source/JavaScriptCore:

Use Thread::current() instead.

* API/JSContext.mm:
(+[JSContext currentContext]):
(+[JSContext currentThis]):
(+[JSContext currentCallee]):
(+[JSContext currentArguments]):
(-[JSContext beginCallbackWithData:calleeValue:thisValue:argumentCount:arguments:]):
(-[JSContext endCallbackWithData:]):
* heap/Heap.cpp:
(JSC::Heap::requestCollection):
* runtime/Completion.cpp:
(JSC::checkSyntax):
(JSC::checkModuleSyntax):
(JSC::evaluate):
(JSC::loadAndEvaluateModule):
(JSC::loadModule):
(JSC::linkAndEvaluateModule):
(JSC::importModule):
* runtime/Identifier.cpp:
(JSC::Identifier::checkCurrentAtomicStringTable):
* runtime/InitializeThreading.cpp:
(JSC::initializeThreading):
* runtime/JSLock.cpp:
(JSC::JSLock::didAcquireLock):
(JSC::JSLock::willReleaseLock):
(JSC::JSLock::dropAllLocks):
(JSC::JSLock::grabAllLocks):
* runtime/JSLock.h:
* runtime/VM.cpp:
(JSC::VM::VM):
(JSC::VM::updateStackLimits):
(JSC::VM::committedStackByteCount):
* runtime/VM.h:
(JSC::VM::isSafeToRecurse const):
* runtime/VMEntryScope.cpp:
(JSC::VMEntryScope::VMEntryScope):
* runtime/VMInlines.h:
(JSC::VM::ensureStackCapacityFor):
* yarr/YarrPattern.cpp:
(JSC::Yarr::YarrPatternConstructor::isSafeToRecurse const):

Source/WebCore:

Use Thread::current() instead.

* fileapi/AsyncFileStream.cpp:
* platform/ThreadGlobalData.cpp:
(WebCore::ThreadGlobalData::ThreadGlobalData):
* platform/graphics/cocoa/WebCoreDecompressionSession.h:
* platform/ios/wak/WebCoreThread.mm:
(StartWebThread):
* workers/WorkerThread.cpp:
(WebCore::WorkerThread::workerThread):

Source/WTF:

We placed thread specific data in WTFThreadData previously. But now, we have a new good place
to put thread specific data: WTF::Thread. Before this patch, WTFThreadData and WTF::Thread
sometimes have the completely same fields (m_stack etc.) due to initialization order limitations.
This patch merges WTFThreadData to WTF::Thread. We apply WTFThreadData's initialization style
to WTF::Thread. So, WTF::Thread's holder now uses fast TLS for darwin environment. Thus,
Thread::current() access is now accelerated. And WTF::Thread::current() can be accessed even
before calling WTF::initializeThreading.

* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/LockAlgorithm.h:
* wtf/LockAlgorithmInlines.h:
* wtf/MainThread.h:
* wtf/ParkingLot.cpp:
* wtf/StackStats.cpp:
(WTF::StackStats::PerThreadStats::PerThreadStats):
(WTF::StackStats::CheckPoint::CheckPoint):
(WTF::StackStats::CheckPoint::~CheckPoint):
(WTF::StackStats::probe):
(WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint):
* wtf/ThreadHolder.cpp:
(WTF::ThreadHolder::initializeCurrent):
* wtf/ThreadHolder.h:
(WTF::ThreadHolder::ThreadHolder):
(WTF::ThreadHolder::currentMayBeNull):
(WTF::ThreadHolder::current):
* wtf/ThreadHolderPthreads.cpp:
(WTF::ThreadHolder::initializeKey):
(WTF::ThreadHolder::initialize):
(WTF::ThreadHolder::destruct):
(WTF::ThreadHolder::initializeOnce): Deleted.
(WTF::ThreadHolder::current): Deleted.
* wtf/ThreadHolderWin.cpp:
(WTF::ThreadHolder::initializeKey):
(WTF::ThreadHolder::currentDying):
(WTF::ThreadHolder::initialize):
(WTF::ThreadHolder::initializeOnce): Deleted.
(WTF::ThreadHolder::current): Deleted.
* wtf/Threading.cpp:
(WTF::Thread::initializeInThread):
(WTF::Thread::entryPoint):
(WTF::Thread::create):
(WTF::Thread::didExit):
(WTF::initializeThreading):
(WTF::Thread::currentMayBeNull): Deleted.
* wtf/Threading.h:
(WTF::Thread::current):
(WTF::Thread::atomicStringTable):
(WTF::Thread::setCurrentAtomicStringTable):
(WTF::Thread::stackStats):
(WTF::Thread::savedStackPointerAtVMEntry):
(WTF::Thread::setSavedStackPointerAtVMEntry):
(WTF::Thread::savedLastStackTop):
(WTF::Thread::setSavedLastStackTop):
* wtf/ThreadingPrimitives.h:
* wtf/ThreadingPthreads.cpp:
(WTF::Thread::createCurrentThread):
(WTF::Thread::current): Deleted.
* wtf/ThreadingWin.cpp:
(WTF::Thread::createCurrentThread):
(WTF::Thread::current): Deleted.
* wtf/WTFThreadData.cpp: Removed.
* wtf/WTFThreadData.h: Removed.
* wtf/text/AtomicString.cpp:
* wtf/text/AtomicStringImpl.cpp:
(WTF::stringTable):
* wtf/text/AtomicStringTable.cpp:
(WTF::AtomicStringTable::create):
* wtf/text/AtomicStringTable.h:

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

4 years agoNetworkResourceLoader::setDefersLoading() may cause start() to be called multiple...
cdumez@apple.com [Thu, 3 Aug 2017 05:57:45 +0000 (05:57 +0000)]
NetworkResourceLoader::setDefersLoading() may cause start() to be called multiple times
https://bugs.webkit.org/show_bug.cgi?id=175109
<rdar://problem/33363169>

Reviewed by Brady Eidson.

Source/WebKit:

If NetworkResourceLoader::setDefersLoading(false) is called by the client while m_networkLoad is null
then we call NetworkResourceLoader::start() to start the load. This is needed in the case where
a NetworkResourceLoader is constructed in deferred mode so that the load can later be started via
setDefersLoading(). However, it is possible for setDefersLoading(false) to be called when start()
has already been called, which causes start() to be called multiple times and leads to an assertion
hit in debug.

Normally, setDefersLoading(false) returns without calling start() if m_networkLoad is not null. It
relies on m_networkLoad being non-null to determine if start() should be called. This is bad because
start() checks the disk cache asynchronously *before* calling startNetworkLoad() and initializing
m_networkLoad. Therefore, if setDefersLoading(false) is called *while* we are checking the cache,
then we will call incorrectly call start() again.

In the case of the radar, this happens when we:
1. Call start() and check the disk cache
2. Retrieve a cached redirect from the cache, which causes a WillSendRequest IPC to be sent to the
   WebProcess
3. The WebProcess calls setDefersLoading(true), sends the ContinueWillSendRequest IPC back and
   then calls setDefersLoading(false)

The call to continueWillSendRequest() causes us to retrieve the redirected entry from the cache,
asynchronously, which will return no entry and start a load.
The later call to setDefersLoading(false) causes us to call start() again and we end up back to step 1.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::start):
(WebKit::NetworkResourceLoader::setDefersLoading):
* NetworkProcess/NetworkResourceLoader.h:

LayoutTests:

Extend test coverage to cover cacheable redirects to a resource that needs
revalidation, similarly to the case in the radar.

* http/tests/cache/disk-cache/disk-cache-redirect-expected.txt:
* http/tests/cache/disk-cache/disk-cache-redirect.html:

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

4 years agoLLInt should do pointer caging
fpizlo@apple.com [Thu, 3 Aug 2017 05:48:59 +0000 (05:48 +0000)]
LLInt should do pointer caging
https://bugs.webkit.org/show_bug.cgi?id=175036

Reviewed by Keith Miller.

Implementing this in the LLInt was challenging because offlineasm did not previously know
how to load from globals. This teaches it how to do that on Darwin/x86_64, which happens
to be where the Gigacage is enabled right now.

* llint/LLIntOfflineAsmConfig.h:
* llint/LowLevelInterpreter64.asm:
* offlineasm/ast.rb:
* offlineasm/x86.rb:

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

4 years agoNeverDestroyed related leaks seen on bots
commit-queue@webkit.org [Thu, 3 Aug 2017 04:46:46 +0000 (04:46 +0000)]
NeverDestroyed related leaks seen on bots
https://bugs.webkit.org/show_bug.cgi?id=175113

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-08-02
Reviewed by Yusuke Suzuki.

* wtf/NeverDestroyed.h:
(WTF::NeverDestroyed::NeverDestroyed):
Previously the result of makeNeverDestroyed was not always moving into
the `static NeverDestroyed` static local variable. In some cases it would
re-invoke the constructor, creating a new NeverDestroyed object. In the
case of a Vector it was causing leaks.

Adding a move constructor convinces the compiler to move the result
of makeNeverDestroyed into the NeverDestroyed static. It doesn't actually
invoke the move constructor here, which I believe means it is deciding
to perform optional copy elision optimization.
'http://en.cppreference.com/w/cpp/language/copy_elision

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

4 years agoWeb Inspector: add TreeElement virtualization for the Recording tab
drousso@apple.com [Thu, 3 Aug 2017 04:21:32 +0000 (04:21 +0000)]
Web Inspector: add TreeElement virtualization for the Recording tab
https://bugs.webkit.org/show_bug.cgi?id=174968

Reviewed by Joseph Pecoraro.

* UserInterface/Views/RecordingNavigationSidebarPanel.js:
(WI.RecordingNavigationSidebarPanel):

* UserInterface/Views/TreeOutline.js:
(WI.TreeOutline):
(WI.TreeOutline.prototype.get virtualized):
(WI.TreeOutline.prototype.registerScrollVirtualizer):
(WI.TreeOutline.prototype.updateVirtualizedElements.walk):
(WI.TreeOutline.prototype.updateVirtualizedElements):
Add spacer elements before and after the TreeOutline element that will size to ensure that
the TreeOutline node still takes up the same amount of space after some of the TreeElements
are removed. Whenever the scroll of the container view changes, recalculate the visible area
and add/remove TreeElements based on whether they would be in that. This is only possible if
every TreeElement has the same vertical height, which is given when setting up the scroll
listener on the container view.

* UserInterface/Views/TreeElement.js:
(WI.TreeElement.prototype.set hidden):
(WI.TreeElement.prototype._attach):
(WI.TreeElement.prototype.collapse):
(WI.TreeElement.prototype.expand):
(WI.TreeElement.prototype.reveal):
If the TreeOutline is being virtualized, don't add each TreeElement's node to the DOM. They
will be added at the end of the frame (via setTimeout) if they are within the visible + padding
area of the TreeOutline.

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

4 years agoHTTP tests with 'https' suffix are only run over HTTPS for WK2, not WK1
commit-queue@webkit.org [Thu, 3 Aug 2017 04:19:10 +0000 (04:19 +0000)]
HTTP tests with 'https' suffix are only run over HTTPS for WK2, not WK1
https://bugs.webkit.org/show_bug.cgi?id=175089

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

Tools:

* DumpRenderTree/TestOptions.mm:
(TestOptions::TestOptions): Using absolutePath if available.
* DumpRenderTree/mac/DumpRenderTree.mm:
(computeTestURL): Removing http/tests/ specific URL computation.
* Scripts/webkitpy/port/driver.py:
(Driver._command_from_driver_input): Making webkitpy passing HTTP urls for HTTP served tests to all test runners, including WK1.

LayoutTests:

Removing no longer needed expectations.

* platform/ios-wk1/http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/iframe-upgrade.https-expected.txt: Removed.
* platform/mac-wk1/http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/iframe-upgrade.https-expected.txt: Removed.

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

4 years agoNetworkRTCProvider::createResolver() leaks CFHost objects
akling@apple.com [Thu, 3 Aug 2017 03:53:05 +0000 (03:53 +0000)]
NetworkRTCProvider::createResolver() leaks CFHost objects
https://bugs.webkit.org/show_bug.cgi?id=175103
<rdar://problem/33690347>

Reviewed by Youenn Fablet.

Add a missing adoptCF() so we don't leak the CFHost.

* NetworkProcess/webrtc/NetworkRTCProvider.cpp:
(WebKit::NetworkRTCProvider::createResolver):

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

4 years agoFix crashes in GC creating a document fragment on a background thread
commit-queue@webkit.org [Thu, 3 Aug 2017 03:49:53 +0000 (03:49 +0000)]
Fix crashes in GC creating a document fragment on a background thread
https://bugs.webkit.org/show_bug.cgi?id=175111

Patch by Sam Weinig <sam@webkit.org> on 2017-08-02
Reviewed by Chris Dumez.

r220095 (https://webkit.org/b/175006) change JSHTMLTemplateElement from using a
private name + property to manager the lifetime of the reference DocumentFragment
to using the idiomatic visitAdditionalChildren. Unfortunately, the function to access
the DocumentFragment lazily creates it. If this lazy creation happens on a GC thread,
badness ensues. This introduces an accessor that returns the DocumentFragment if it
has been created or null if it has not.

* bindings/js/JSHTMLTemplateElementCustom.cpp:
(WebCore::JSHTMLTemplateElement::visitAdditionalChildren):
* html/HTMLTemplateElement.cpp:
(WebCore::HTMLTemplateElement::contentIfAvailable):
* html/HTMLTemplateElement.h:

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

4 years ago[WebIDL] Simplify [EnabledBySettings] extended attribute code to not require passing...
commit-queue@webkit.org [Thu, 3 Aug 2017 03:25:30 +0000 (03:25 +0000)]
[WebIDL] Simplify [EnabledBySettings] extended attribute code to not require passing a global object to finishCreation
https://bugs.webkit.org/show_bug.cgi?id=175087

Patch by Sam Weinig <sam@webkit.org> on 2017-08-02
Reviewed by Chris Dumez.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
(GeneratePrototypeDeclaration):
Remove unnecessary passing of the global object to finishCreation for [EnabledBySettings].

* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
Update tests.

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

4 years agoSweeping should only scribble when sweeping to free list
fpizlo@apple.com [Thu, 3 Aug 2017 01:57:37 +0000 (01:57 +0000)]
Sweeping should only scribble when sweeping to free list
https://bugs.webkit.org/show_bug.cgi?id=175105

Reviewed by Saam Barati.

I just saw a crash on the bots where a destructor call attempt dereferenced scribbled memory. This
can happen because the bump path of specializedSweep will scribble in SweepOnly, which replaces the
zap word (i.e. 0) with the scribble word (i.e. 0xbadbeef0). This is a recent regression, since we
didn't used to do destruction on the bump path. No destruction, no zapping. Looking at the pop
path, we only scribble when we SweepToFreeList. This ensures that we only overwrite the zap word
when it doesn't matter anyway because we're building a free list.

This is a fix for those crashes on the bots because it means that we'll no longer scribble over the
zap.

* heap/MarkedBlockInlines.h:
(JSC::MarkedBlock::Handle::specializedSweep):

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

4 years agoMarked http/tests/appcache/deferred-events-delete-while-raising-timer.html as flaky.
jlewis3@apple.com [Thu, 3 Aug 2017 01:55:59 +0000 (01:55 +0000)]
Marked http/tests/appcache/deferred-events-delete-while-raising-timer.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=175107

Unreviewed test gardening.

* TestExpectations:

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

4 years ago[Linux] JSTests/wasm/stress/oom.js should not run on Linux
clopez@igalia.com [Thu, 3 Aug 2017 01:42:13 +0000 (01:42 +0000)]
[Linux] JSTests/wasm/stress/oom.js should not run on Linux
https://bugs.webkit.org/show_bug.cgi?id=175100

Reviewed by Mark Lam.

The JSC test JSTests/wasm/stress/oom.js tries to use all the
available memory until an out of memory exception happens.

The Linux kernel is more tuned for server workloads than for GUI
responsiveness. When a process tries to use a lot of memory, Linux
will do its best to serve the request. This usually translates to
free physical RAM by writing to disk dirty pages and/or moving out
less recently used pages to swap (disk storage).
Meanwhile it does this, the system will become unresponsive and this
leads to freezes that can last even some minutes on the worst cases.

Therefore, let's skip this test on Linux as it will cause more harm
than good on the Linux bots or on the machines of Linux developers.

* wasm/stress/oom.js:

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

4 years agogit-svn-id: https://svn.webkit.org/repository/webkit/trunk@220166 268f45cc-cd09-0410...
lforschler@apple.com [Thu, 3 Aug 2017 01:32:27 +0000 (01:32 +0000)]
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220166 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoAll C++ accesses to JSObject::m_butterfly should do caging
fpizlo@apple.com [Thu, 3 Aug 2017 01:32:07 +0000 (01:32 +0000)]
All C++ accesses to JSObject::m_butterfly should do caging
https://bugs.webkit.org/show_bug.cgi?id=175039

Reviewed by Keith Miller.

Source/JavaScriptCore:

Makes JSObject::m_butterfly a AuxiliaryBarrier<CagedPtr<Butterfly>> and adopts the CagedPtr<> API.
This ensures that you can't cause C++ code to access a butterfly that has been rewired to point
outside the gigacage.

* runtime/JSArray.cpp:
(JSC::JSArray::setLength):
(JSC::JSArray::pop):
(JSC::JSArray::push):
(JSC::JSArray::shiftCountWithAnyIndexingType):
(JSC::JSArray::unshiftCountWithAnyIndexingType):
(JSC::JSArray::fillArgList):
(JSC::JSArray::copyToArguments):
* runtime/JSObject.cpp:
(JSC::JSObject::heapSnapshot):
(JSC::JSObject::createInitialIndexedStorage):
(JSC::JSObject::createArrayStorage):
(JSC::JSObject::convertUndecidedToInt32):
(JSC::JSObject::convertUndecidedToDouble):
(JSC::JSObject::convertUndecidedToContiguous):
(JSC::JSObject::convertInt32ToDouble):
(JSC::JSObject::convertInt32ToArrayStorage):
(JSC::JSObject::convertDoubleToContiguous):
(JSC::JSObject::convertDoubleToArrayStorage):
(JSC::JSObject::convertContiguousToArrayStorage):
(JSC::JSObject::defineOwnIndexedProperty):
(JSC::JSObject::putByIndexBeyondVectorLengthWithoutAttributes):
(JSC::JSObject::ensureLengthSlow):
(JSC::JSObject::allocateMoreOutOfLineStorage):
* runtime/JSObject.h:
(JSC::JSObject::canGetIndexQuickly):
(JSC::JSObject::getIndexQuickly):
(JSC::JSObject::tryGetIndexQuickly const):
(JSC::JSObject::canSetIndexQuickly):
(JSC::JSObject::setIndexQuickly):
(JSC::JSObject::initializeIndex):
(JSC::JSObject::initializeIndexWithoutBarrier):
(JSC::JSObject::butterfly const):
(JSC::JSObject::butterfly):

Source/WTF:

Adds a smart pointer class that does various kinds of caging for you.

* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/CagedPtr.h: Added.
(WTF::CagedPtr::CagedPtr):
(WTF::CagedPtr::get const):
(WTF::CagedPtr::getMayBeNull const):
(WTF::CagedPtr::operator== const):
(WTF::CagedPtr::operator!= const):
(WTF::CagedPtr::operator bool const):
(WTF::CagedPtr::operator* const):
(WTF::CagedPtr::operator-> const):

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

4 years agoRemoved bad expectations and marked test as flaky.
jlewis3@apple.com [Thu, 3 Aug 2017 00:54:58 +0000 (00:54 +0000)]
Removed bad expectations and marked test as flaky.
https://bugs.webkit.org/show_bug.cgi?id=175061

Unreviewed test gardening.

* platform/mac-elcapitan-wk2/imported/w3c/web-platform-tests/fetch/api/basic/mode-no-cors-expected.txt: Removed.
* platform/mac-elcapitan-wk2/imported/w3c/web-platform-tests/fetch/api/basic/mode-no-cors-worker-expected.txt: Removed.
* platform/mac-elcapitan-wk2/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic.any-expected.txt: Removed.
* platform/mac-elcapitan-wk2/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic.any.worker-expected.txt: Removed.
* platform/mac-elcapitan-wk2/imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight.any-expected.txt: Removed.
* platform/mac-elcapitan-wk2/imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight.any.worker-expected.txt: Removed.
* platform/mac-elcapitan-wk2/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin.any-expected.txt: Removed.
* platform/mac-elcapitan-wk2/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin.any.worker-expected.txt: Removed.
* platform/mac/TestExpectations:

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

4 years agoREGRESSION (r207155): Unable to switch sheets when previewing Numbers '09 spreadsheets
aestes@apple.com [Thu, 3 Aug 2017 00:46:31 +0000 (00:46 +0000)]
REGRESSION (r207155): Unable to switch sheets when previewing Numbers '09 spreadsheets
https://bugs.webkit.org/show_bug.cgi?id=175098
<rdar://problem/31416763>

Reviewed by Daniel Bates.

Source/WebCore:

r207155 enabled sandboxing on the frame displaying a QuickLook preview. This restricted
frames within the sandbox from navigating their sandboxed siblings or ancestors, which
breaks the functionality of multi-sheet Numbers '09 spreadsheet previews. These previews
contain a frameset with a table of contents frame and a content frame, and the table of
contents frame needs to be able to navigate the content frame when the sheet selection
changes.

Fix this by disabling the SandboxNavigation flag in the QuickLook sandbox. Frames within the
sandbox will be able to navigate each other, but will not be able to navigate the top frame
(due to SandboxTopNavigation still being enabled), nor will they be able to navigate any
other ancestor frame outside the sandbox (due to QuickLook previews being in a different
origin than the hosting frame). These two cases are covered by existing tests.

Test: quicklook/multi-sheet-numbers-09.html

* dom/Document.cpp:
(WebCore::Document::applyQuickLookSandbox): Added a call to
disableSandboxFlags(SandboxNavigation) after applying the content security policy.
* dom/SecurityContext.h:
(WebCore::SecurityContext::disableSandboxFlags): Defined disableSandboxFlags().

LayoutTests:

* quicklook/multi-sheet-numbers-09-expected.txt: Added.
* quicklook/multi-sheet-numbers-09.html: Added.
* quicklook/resources/multi-sheet-numbers-09.numbers: Added.

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

4 years agoUnreviewed, skip newly imported WPT that is slow in Debug builds.
cdumez@apple.com [Wed, 2 Aug 2017 23:56:43 +0000 (23:56 +0000)]
Unreviewed, skip newly imported WPT that is slow in Debug builds.

* TestExpectations:

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

4 years agoinspector/runtime/CommandLineAPI-inspect.html is flaky.
commit-queue@webkit.org [Wed, 2 Aug 2017 22:46:27 +0000 (22:46 +0000)]
inspector/runtime/CommandLineAPI-inspect.html is flaky.
https://bugs.webkit.org/show_bug.cgi?id=175092

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-08-02
Reviewed by Brian Burg.

* inspector/runtime/CommandLineAPI-inspect-expected.txt:
* inspector/runtime/CommandLineAPI-inspect.html:

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

4 years agocheck-webkit-style: deleting lines in a file runs the linter on the whole file
jbedard@apple.com [Wed, 2 Aug 2017 22:35:44 +0000 (22:35 +0000)]
check-webkit-style: deleting lines in a file runs the linter on the whole file
https://bugs.webkit.org/show_bug.cgi?id=175078

Reviewed by David Kilzer.

Deleting lines in a file should not cause linter errors to be blamed on the patch.
<https://bugs.webkit.org/show_bug.cgi?id=86142> is an example of this happening.

* Scripts/webkitpy/style/checkers/test_expectations.py:
(TestExpectationsChecker._should_log_linter_warning): Do not log a linter error if the file it is associated with only has deleted lines
* Scripts/webkitpy/style/main_unittest.py:
(ExpectationLinterInStyleCheckerTest.test_linter_duplicate_line): Added files should have every line number in the file when processing.
(ExpectationLinterInStyleCheckerTest.test_linter_duplicate_line_only_deletes): Test case where the file with the linter errors only contained deletes.
(ExpectationLinterInStyleCheckerTest.test_linter_added_file_with_error): Added files should have every line number in the file when processing.

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

4 years agoVersioning.
jmarcell@apple.com [Wed, 2 Aug 2017 22:23:39 +0000 (22:23 +0000)]
Versioning.

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

4 years agoIf Gigacage is disabled, bmalloc should service large aligned memory allocation reque...
fpizlo@apple.com [Wed, 2 Aug 2017 21:50:33 +0000 (21:50 +0000)]
If Gigacage is disabled, bmalloc should service large aligned memory allocation requests through vmAllocate
https://bugs.webkit.org/show_bug.cgi?id=175085

Reviewed by Saam Barati.

This fixes a problem where if we used gmalloc, WebAssembly memory allocations would still use
bmalloc's large allocator.

We want to use the page allocator for those "large" allocations when the Gigacage is disabled.

* bmalloc/DebugHeap.cpp:
(bmalloc::DebugHeap::DebugHeap):
(bmalloc::DebugHeap::memalignLarge):
(bmalloc::DebugHeap::freeLarge):
* bmalloc/DebugHeap.h:
* bmalloc/Heap.cpp:
(bmalloc::Heap::tryAllocateLarge):
(bmalloc::Heap::deallocateLarge):

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

4 years ago[MSE] Removing samples when presentation order does not match decode order can cause...
jer.noble@apple.com [Wed, 2 Aug 2017 21:50:13 +0000 (21:50 +0000)]
[MSE] Removing samples when presentation order does not match decode order can cause bad behavior.
https://bugs.webkit.org/show_bug.cgi?id=175091

Reviewed by Eric Carlson.

Address follow-up comments to r219519.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::removeCodedFrames):

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

4 years agoRemove unused and obsolete setting mediaDocumentEntersFullscreenAutomatically
commit-queue@webkit.org [Wed, 2 Aug 2017 20:45:42 +0000 (20:45 +0000)]
Remove unused and obsolete setting mediaDocumentEntersFullscreenAutomatically
https://bugs.webkit.org/show_bug.cgi?id=175080

Patch by Jeremy Jones <jeremyj@apple.com> on 2017-08-02
Reviewed by Jon Lee.

Source/WebCore:

No new tests because this only removes unused code.

This is obsolete because of the alternate solution in
https://bugs.webkit.org/show_bug.cgi?id=174850

* page/Settings.in:

Source/WebKit:

This is obsolete because of the alternate solution in
https://bugs.webkit.org/show_bug.cgi?id=174850

* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _setMediaDocumentEntersFullscreenAutomatically:]): Deleted.
(-[WKPreferences _mediaDocumentEntersFullscreenAutomatically]): Deleted.
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

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

4 years agowebkitpy: Allow caller to specify response to unicode encode/decode error in filesystem
jbedard@apple.com [Wed, 2 Aug 2017 20:01:32 +0000 (20:01 +0000)]
webkitpy: Allow caller to specify response to unicode encode/decode error in filesystem
https://bugs.webkit.org/show_bug.cgi?id=175075

Reviewed by David Kilzer.

We have no way of handling text files with illegal unicode characters. Allow the callers of
filesystem.read_text_file to specify one of Python 2.7's supported responses ('strict', 'ignore', or
'replace'). See https://docs.python.org/2/howto/unicode.html for details on these responses.

* Scripts/webkitpy/common/system/filesystem.py:
(FileSystem.read_text_file): Allow caller to specify unicode error handling.
(FileSystem.write_text_file): Ditto.
* Scripts/webkitpy/common/system/filesystem_mock.py:
(MockFileSystem.read_text_file): Allow caller to specify unicode error handling.
(MockFileSystem.write_text_file): Ditto.
* Scripts/webkitpy/common/system/filesystem_unittest.py:
(RealFileSystemTest.test_read_text_file_unicode_decode_error): Test reading a file with illegal unicode content.
(RealFileSystemTest.test_write_text_file_unicode_encode_error): Test writing illegal unicode content to a file.

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

4 years agoUnreviewed, skip newly imported WPT HTTPS tests on WK2 only.
cdumez@apple.com [Wed, 2 Aug 2017 19:59:09 +0000 (19:59 +0000)]
Unreviewed, skip newly imported WPT HTTPS tests on WK2 only.

The tests seem to work fine on WK1.

* TestExpectations:
* platform/wk2/TestExpectations:

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

4 years agoWe should be OK with the gigacage being disabled on gmalloc
fpizlo@apple.com [Wed, 2 Aug 2017 19:57:50 +0000 (19:57 +0000)]
We should be OK with the gigacage being disabled on gmalloc
https://bugs.webkit.org/show_bug.cgi?id=175082

Reviewed by Michael Saboff.
Source/bmalloc:

This adds Gigacage::shouldBeEnabled(), which returns false when we're using gmalloc or other things
that enable DebugHeap.

* bmalloc/Environment.cpp:
(bmalloc::Environment::Environment):
* bmalloc/Environment.h:
* bmalloc/Gigacage.cpp:
(Gigacage::ensureGigacage):
(Gigacage::shouldBeEnabled):
* bmalloc/Gigacage.h:
* bmalloc/Heap.cpp:
(bmalloc::Heap::Heap):
* bmalloc/Heap.h:

Source/JavaScriptCore:

* jsc.cpp:
(jscmain):

Source/WebKit:

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

Source/WTF:

* wtf/Gigacage.h:
(Gigacage::shouldBeEnabled):

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

4 years agoWeb Automation: files selected for upload should be checked against values of the...
bburg@apple.com [Wed, 2 Aug 2017 18:35:22 +0000 (18:35 +0000)]
Web Automation: files selected for upload should be checked against values of the 'accept' attribute
https://bugs.webkit.org/show_bug.cgi?id=174803
<rdar://problem/33514190>

Reviewed by Carlos Garcia Campos.

Use the parsed values of the file input element's "accept" attribute to reject
files that don't match the specified values. This is normally done by Safari
using NSOpenPanel, but since a real open panel isn't shown during automation,
it needs to be done here.

Support for limiting accepted files by file extensions will be added when the
same is implemented in the normal code path for the C and Objective-C APIs.

This change is covered by internal WebDriver tests that will be rewritten for the
public Webdriver W3C test suite someday, when safaridriver runs those tests itself.

* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::handleRunOpenPanel):
Since we already have the proposed files, there's no need to compute a list of
supported extensions based on wildcard MIME types. First check the extension,
then the inferred MIME type for the extension, and then the wildcard MIME type
if the inferred type is not an exact match.

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

4 years agoUnmarked imported/w3c/IndexedDB-private-browsing/idbfactory_open.html as flaky.
jlewis3@apple.com [Wed, 2 Aug 2017 18:25:17 +0000 (18:25 +0000)]
Unmarked imported/w3c/IndexedDB-private-browsing/idbfactory_open.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=174949

Unreviewed test gardening.

* platform/ios-wk2/TestExpectations:

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

4 years agoGPUBuffer::length() should return the size of the array buffer backing the GPU buffer...
fpizlo@apple.com [Wed, 2 Aug 2017 18:24:19 +0000 (18:24 +0000)]
GPUBuffer::length() should return the size of the array buffer backing the GPU buffer, not the rounded-up GPU buffer length
https://bugs.webkit.org/show_bug.cgi?id=175079

Reviewed by Simon Fraser.

This fixes a failure in the GPU.BufferCreate unit test.

The problem is that in order to have a Metal buffer wrap memory we allocated, we have to tell Metal
that the memory is page-aligned. This means that the Metal buffer reports back a page-aligned size,
which is different than what the test expected.

It seems that it's most convenient for our GPUBuffer class to return the unaligned length, rather
than the aligned length. This is just a simple matter of returning the length from the ArrayBuffer
rather than the Metal buffer.

This fixes the unit test and is probably more sensible for actual users of this class, since the page
alignment of the length is a goofy implementation detail.

* platform/graphics/cocoa/GPUBufferMetal.mm:
(WebCore::GPUBuffer::length const):

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

4 years agoOn memory-constrained iOS devices, reduce the rate at which the JS heap grows before...
sbarati@apple.com [Wed, 2 Aug 2017 18:15:14 +0000 (18:15 +0000)]
On memory-constrained iOS devices, reduce the rate at which the JS heap grows before a GC to try to keep more memory available for the system
https://bugs.webkit.org/show_bug.cgi?id=175041
<rdar://problem/33659370>

Reviewed by Filip Pizlo.

The testing I have done shows that this new function is a ~10%
progression running JetStream on 1GB iOS devices. I've also tried
this on a few > 1GB iOS devices, and the testing shows this is either neutral
or a regression. Right now, we'll just enable this for <= 1GB devices
since it's a win. In the future, we might want to either look into
tweaking these parameters or coming up with a new function for > 1GB
devices.

* heap/Heap.cpp:
* runtime/Options.h:

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

4 years agoIntermittent exception in buildPageURLForIteration for Buildbot 0.9 dashboard
aakash_jain@apple.com [Wed, 2 Aug 2017 17:54:41 +0000 (17:54 +0000)]
Intermittent exception in buildPageURLForIteration for Buildbot 0.9 dashboard
https://bugs.webkit.org/show_bug.cgi?id=175072

Reviewed by Alexey Proskuryakov.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Buildbot.js:
(Buildbot): Make sure this._builderNameToIDMap is always defined for Buildbot 0.9.

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

4 years agoWKPDFView doesn't respect safe area insets
timothy_horton@apple.com [Wed, 2 Aug 2017 17:51:23 +0000 (17:51 +0000)]
WKPDFView doesn't respect safe area insets
https://bugs.webkit.org/show_bug.cgi?id=175046
<rdar://problem/33558386>

Reviewed by Wenson Hsieh.

* Platform/spi/ios/UIKitSPI.h:
Add some SPI.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setHasCustomContentView:loadedMIMEType:]):
Drive-by fix two small custom content view issues:

- Reset _scrollViewBackgroundColor; it is used to early-return from
updating the background color if it hasn't changed, but if you go from a
site with (for example) a white background, to a PDF, to another site
with a white background, we will early-return and not reset the background
color from the grey WKPDFView background.

- When installing a custom content view, scroll to the origin. We miss
the usual mechanism for scrolling to the origin when custom content views
are installed, so do it here.

(-[WKWebView _effectiveObscuredInsetEdgesAffectedBySafeArea]):
Ignore _obscuredInsetEdgesAffectedBySafeArea for custom content views.
This is fairly arbitrary, and we should find a different way to
express different edge sets for different kinds of content (perhaps
bake this into default viewports?), but for now this works.

(-[WKWebView _computedContentInset]):
Use _effectiveObscuredInsetEdgesAffectedBySafeArea instead of the ivar directly.

(-[WKWebView _safeAreaShouldAffectObscuredInsets]):
Force safe areas to not affect obscured insets for custom content views,
so that it's up to every custom content view to take safe areas into
account themselves.

* UIProcess/API/Cocoa/WKWebViewInternal.h:
Expose _computedUnobscuredSafeAreaInset for WKPDFView's use.

* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView web_setMinimumSize:]):
Avoid rebuilding the WKPDFView if the minimum size didn't change.

(-[WKPDFView _offsetForPageNumberIndicator]):
Take unobscured safe area insets into account when insetting
the page number indicator.

(-[WKPDFView web_computedContentInsetDidChange]):
Watch for unobscured safe area inset changes, and apply them to the
layout of the WKPDFView.

(-[WKPDFView _computePageAndDocumentFrames]):
Make it possible to only update the WKPDFView's size and position, without
rebuilding its subviews, if the width did not change. This prevents lots
of flashing of the child UIPDFPageViews when the unobscured safe area
insets change dynamically.

Take the safe area insets into account when determining what width
to lay out to.

(-[WKPDFView _updateDocumentFrame]):
Take the safe area insets into account when positioning the WKPDFView
inside the WKScrollView.

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

4 years agoUnreviewed, temporarily skip some HTTPS tests that time out on the bots.
cdumez@apple.com [Wed, 2 Aug 2017 17:46:06 +0000 (17:46 +0000)]
Unreviewed, temporarily skip some HTTPS tests that time out on the bots.

* TestExpectations:

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

4 years agoResourceLoadStatisticsClassifierCocoa::singletonPredictionModel() should check the...
wilander@apple.com [Wed, 2 Aug 2017 17:45:52 +0000 (17:45 +0000)]
ResourceLoadStatisticsClassifierCocoa::singletonPredictionModel() should check the return value of storagePath()
https://bugs.webkit.org/show_bug.cgi?id=175055
<rdar://problem/32671352>

Reviewed by David Kilzer.

* Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp:
(WebKit::ResourceLoadStatisticsClassifierCocoa::singletonPredictionModel):
    Now uses dispatch_once() instead of NeverDestroyed and checks the
    return value of storagePath() before using it to load the model.

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

4 years agoHTML file input elements do not support file extensions in the "accept" attribute
bburg@apple.com [Wed, 2 Aug 2017 17:38:57 +0000 (17:38 +0000)]
HTML file input elements do not support file extensions in the "accept" attribute
https://bugs.webkit.org/show_bug.cgi?id=95698
<rdar://problem/12231850>

Reviewed by Darin Adler.

Source/WebCore:

Serialize the accepted file extensions so they can be accessed in the UI process.

* platform/FileChooser.h:
* platform/FileChooser.cpp:
(WebCore::FileChooser::invalidate): Modernize.
(WebCore::FileChooserSettings::acceptTypes const): Deleted.
This is dead code, it was only used by Chromium.

Source/WebKit:

Plumb accepted file extensions out to the C API.
The Cocoa API will be improved in a later patch.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<FileChooserSettings>::encode):
(IPC::ArgumentCoder<FileChooserSettings>::decode):
* UIProcess/API/APIOpenPanelParameters.cpp:
(API::OpenPanelParameters::acceptFileExtensions const):
* UIProcess/API/APIOpenPanelParameters.h:
* UIProcess/API/C/WKOpenPanelParametersRef.cpp:
(WKOpenPanelParametersCopyAcceptedFileExtensions):
* UIProcess/API/C/WKOpenPanelParametersRef.h:

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

4 years agoAdded new expectations folders and moved expectations to correct folders.
jlewis3@apple.com [Wed, 2 Aug 2017 17:37:17 +0000 (17:37 +0000)]
Added new expectations folders and moved expectations to correct folders.
https://bugs.webkit.org/show_bug.cgi?id=175061

Unreviewed gardening.
* platform/mac-elcapitan-wk2/imported/w3c/web-platform-tests/fetch/api/basic/mode-no-cors-expected.txt: Renamed from LayoutTests/platform/mac-elcapitan/imported/w3c/web-platform-tests/fetch/api/basic/mode-no-cors-expected.txt.
* platform/mac-elcapitan-wk2/imported/w3c/web-platform-tests/fetch/api/basic/mode-no-cors-worker-expected.txt: Renamed from LayoutTests/platform/mac-elcapitan/imported/w3c/web-platform-tests/fetch/api/basic/mode-no-cors-worker-expected.txt.
* platform/mac-elcapitan-wk2/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic.any-expected.txt: Renamed from LayoutTests/platform/mac-elcapitan/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic.any-expected.txt.
* platform/mac-elcapitan-wk2/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic.any.worker-expected.txt: Renamed from LayoutTests/platform/mac-elcapitan/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic.any.worker-expected.txt.
* platform/mac-elcapitan-wk2/imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight.any-expected.txt: Renamed from LayoutTests/platform/mac-elcapitan/imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight.any-expected.txt.
* platform/mac-elcapitan-wk2/imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight.any.worker-expected.txt: Renamed from LayoutTests/platform/mac-elcapitan/imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight.any.worker-expected.txt.
* platform/mac-elcapitan-wk2/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin.any-expected.txt: Renamed from LayoutTests/platform/mac-elcapitan/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin.any-expected.txt.
* platform/mac-elcapitan-wk2/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin.any.worker-expected.txt: Renamed from LayoutTests/platform/mac-elcapitan/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin.any.worker-expected.txt.

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

4 years agoRemove obsolete expectations for syntax-021.xml.
commit-queue@webkit.org [Wed, 2 Aug 2017 17:03:48 +0000 (17:03 +0000)]
Remove obsolete expectations for syntax-021.xml.
https://bugs.webkit.org/show_bug.cgi?id=86142

Patch by Ms2ger <Ms2ger@igalia.com> on 2017-08-02
Reviewed by Sam Weinig.

It may have started passing in r209396.

* platform/gtk/TestExpectations:
* platform/ios-simulator/TestExpectations:
* platform/mac/TestExpectations:
* platform/win/TestExpectations:

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

4 years agoUse LazyNeverDestroyed instead of DEFINE_GLOBAL for QualifiedName
commit-queue@webkit.org [Wed, 2 Aug 2017 16:46:59 +0000 (16:46 +0000)]
Use LazyNeverDestroyed instead of DEFINE_GLOBAL for QualifiedName
https://bugs.webkit.org/show_bug.cgi?id=175010
<rdar://problem/33647818>

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-08-02
Reviewed by Alex Christensen.

Source/WebCore:

No new tests because no behavior change.

Stop using DEFINE_GLOBAL hack in favor of LazyNeverDestroyed.

* contentextensions/ContentExtensionParser.cpp:
(WebCore::ContentExtensions::isValidCSSSelector):
Call QualifiedName::init().
* dom/DOMAllInOne.cpp: Remove the warning. Include QualifiedName.cpp.
* dom/QualifiedName.cpp:
(WebCore::QualifiedName::init): Call LazyNeverDestroyed::construct
instead of placement new.
* dom/QualifiedName.h: Use LazyNeverDestroyed.

Source/WebKit:

* UIProcess/API/APIContentRuleListStore.cpp:
(API::ContentRuleListStore::compileContentRuleList):
Call QualifiedName::init().

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

4 years agoRemove overridden lines from win's TestExpectations.
commit-queue@webkit.org [Wed, 2 Aug 2017 15:36:24 +0000 (15:36 +0000)]
Remove overridden lines from win's TestExpectations.
https://bugs.webkit.org/show_bug.cgi?id=175068

Patch by Ms2ger <Ms2ger@igalia.com> on 2017-08-02
Reviewed by Darin Adler.

These lines cause lint errors and block any patch that touches the file from
landing.

* platform/win/TestExpectations:

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

4 years agoBuild-fix for Windows in Visual Studio after directory rename.
matthew_hanson@apple.com [Wed, 2 Aug 2017 13:53:35 +0000 (13:53 +0000)]
Build-fix for Windows in Visual Studio after directory rename.

Reviewed by Per Arne Vollan.

* WebKitLegacy.vcxproj/WebKitLegacy.proj:
We still build WebKit.dll, not WebKitLegacy.dll.

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

4 years ago[GTK] Layout test editing/pasteboard/copy-standalone-image.html failing
commit-queue@webkit.org [Wed, 2 Aug 2017 13:25:36 +0000 (13:25 +0000)]
[GTK] Layout test editing/pasteboard/copy-standalone-image.html failing
https://bugs.webkit.org/show_bug.cgi?id=163184

Unreviewed test gardening.

Remove obsolete failure expectation for copy-standalone-image.html.

The bug was fixed in r212428. (The test was also broken by both landings for
bug 170956, until r216174 fixed it again.)

Patch by Ms2ger <Ms2ger@igalia.com> on 2017-08-02

* platform/gtk/TestExpectations:

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

4 years ago[CMake] Remove obsolete code in TestWebKitAPI/CMakeLists.txt
mcatanzaro@igalia.com [Wed, 2 Aug 2017 08:45:15 +0000 (08:45 +0000)]
[CMake] Remove obsolete code in TestWebKitAPI/CMakeLists.txt
https://bugs.webkit.org/show_bug.cgi?id=175019

Reviewed by Darin Adler.

* TestWebKitAPI/CMakeLists.txt:

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

4 years agoEnabling uploading archives to S3
ossy@webkit.org [Wed, 2 Aug 2017 06:45:23 +0000 (06:45 +0000)]
Enabling uploading archives to S3
https://bugs.webkit.org/show_bug.cgi?id=174198

Unreviewed unit test fix after r219235.

* BuildSlaveSupport/build.webkit.org-config/mastercfg_unittest.py:

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

4 years agoCFString leak dragging an image - allocation under PlatformPasteboard::writeObjectRep...
commit-queue@webkit.org [Wed, 2 Aug 2017 06:40:39 +0000 (06:40 +0000)]
CFString leak dragging an image - allocation under PlatformPasteboard::writeObjectRepresentations
https://bugs.webkit.org/show_bug.cgi?id=175064

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-08-01
Reviewed by Tim Horton.

* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::writeObjectRepresentations):
Adopt a created string into the RetainPtr.

* platform/ios/WebItemProviderPasteboard.h:
* platform/ios/WebItemProviderPasteboard.mm:
(-[WebItemProviderRegistrationInfoList dealloc]):
Release suggestedName and switch from -strong to -copy.

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

4 years agoFix JSCOnly ARM buildbots after r220047
ossy@webkit.org [Wed, 2 Aug 2017 06:36:55 +0000 (06:36 +0000)]
Fix JSCOnly ARM buildbots after r220047
https://bugs.webkit.org/show_bug.cgi?id=174993

Unreviewed fix after r220087.

* BuildSlaveSupport/build.webkit.org-config/master.cfg:
(BuildAndRemoteJSCTestsFactory.__init__):

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

4 years agoUnreviewed, update Beacon API status to "In Development".
cdumez@apple.com [Wed, 2 Aug 2017 04:47:45 +0000 (04:47 +0000)]
Unreviewed, update Beacon API status to "In Development".

* features.json:

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

4 years agoAdd initial support for navigator.sendBeacon
cdumez@apple.com [Wed, 2 Aug 2017 04:44:23 +0000 (04:44 +0000)]
Add initial support for navigator.sendBeacon
https://bugs.webkit.org/show_bug.cgi?id=175007
<rdar://problem/33547728>

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

Import more beacon web-platform-tests and rebaseline the one we had
already imported now that navigator.sendBeacon is exposed.

* resources/import-expectations.json:
* resources/resource-files.json:
* web-platform-tests/beacon/beacon-basic-blob-expected.txt: Added.
* web-platform-tests/beacon/beacon-basic-blob.html: Added.
* web-platform-tests/beacon/beacon-basic-blobMax-expected.txt: Added.
* web-platform-tests/beacon/beacon-basic-blobMax.html: Added.
* web-platform-tests/beacon/beacon-basic-buffersource-expected.txt: Added.
* web-platform-tests/beacon/beacon-basic-buffersource.html: Added.
* web-platform-tests/beacon/beacon-basic-buffersourceMax-expected.txt: Added.
* web-platform-tests/beacon/beacon-basic-buffersourceMax.html: Added.
* web-platform-tests/beacon/beacon-basic-formdata-expected.txt: Added.
* web-platform-tests/beacon/beacon-basic-formdata.html: Added.
* web-platform-tests/beacon/beacon-basic-formdataMax-expected.txt: Added.
* web-platform-tests/beacon/beacon-basic-formdataMax.html: Added.
* web-platform-tests/beacon/beacon-basic-string-expected.txt: Added.
* web-platform-tests/beacon/beacon-basic-string.html: Added.
* web-platform-tests/beacon/beacon-basic-stringMax-expected.txt: Added.
* web-platform-tests/beacon/beacon-basic-stringMax.html: Added.
* web-platform-tests/beacon/beacon-common.js: Added.
(allTests.forEach):
(CreateArrayBufferFromPayload):
(CreateEmptyFormDataPayload):
(CreateFormDataFromPayload):
(initSession.return.add):
(initSession):
(runTests.):
(runTests):
(continueAfterSendingBeacon):
(waitForResults.):
(waitForResults):
(runSendInIframeAndNavigateTests.self.buildId):
(runSendInIframeAndNavigateTests.window.onmessage):
(runSendInIframeAndNavigateTests.self.sendFunc):
(runSendInIframeAndNavigateTests.iframe.onload):
* web-platform-tests/beacon/beacon-cors.window.js: Added.
(false.forEach.self.buildId):
(false.forEach.self.buildBaseUrl):
(false.forEach.self.buildTargetUrl):
(false.forEach):
* web-platform-tests/beacon/beacon-error.window.js: Added.
(test):
* web-platform-tests/beacon/beacon-redirect.window.js: Added.
(308.forEach.self.buildId):
(308.forEach.self.buildTargetUrl):
(308.forEach):
* web-platform-tests/beacon/fetch-keepalive-navigate.iFrame.html: Added.
* web-platform-tests/beacon/headers/header-content-type-expected.txt:
* web-platform-tests/beacon/headers/header-referrer-no-referrer-expected.txt:
* web-platform-tests/beacon/headers/header-referrer-no-referrer-when-downgrade.https-expected.txt:
* web-platform-tests/beacon/headers/header-referrer-origin-expected.txt:
* web-platform-tests/beacon/headers/header-referrer-origin-when-cross-origin-expected.txt:
* web-platform-tests/beacon/headers/header-referrer-same-origin-expected.txt:
* web-platform-tests/beacon/headers/header-referrer-strict-origin-when-cross-origin.https-expected.txt:
* web-platform-tests/beacon/headers/header-referrer-strict-origin.https-expected.txt:
* web-platform-tests/beacon/headers/header-referrer-unsafe-url.https-expected.txt:
* web-platform-tests/beacon/resources/beacon.py: Added.
(build_stash_key):
(main):
(main.wrap_key):
* web-platform-tests/beacon/resources/w3c-import.log:
* web-platform-tests/beacon/w3c-import.log: Added.
* web-platform-tests/url/failure-expected.txt:

Source/WebCore:

Add initial support for navigator.sendBeacon behind an experimental
feature runtime flag. The specification is available at:
- https://w3c.github.io/beacon/

The current implementation supports sending beacons with all types of
payloads except for ReadableStream. Some functionality is incomplete
and will be taken care of in follow-up patches:
- Support for CORS preflight for the cases where it is required. We currently
  return false and do not send the beacon in such cases.
- Better support for redirects.
- Use a more power-friendly network priority for beacon requests.

Tests: http/tests/blink/sendbeacon/*
       http/tests/security/mixedContent/beacon/insecure-beacon-in-iframe.html
       http/wpt/beacon/*
       imported/blink/fast/beacon/*
       imported/w3c/web-platform-tests/beacon/*

* CMakeLists.txt:
* DerivedSources.make:
* Modules/beacon/NavigatorBeacon.cpp: Added.
(WebCore::NavigatorBeacon::sendBeacon):
* Modules/beacon/NavigatorBeacon.h: Added.
* Modules/beacon/NavigatorBeacon.idl: Added.
* WebCore.xcodeproj/project.pbxproj:
* loader/PingLoader.cpp:
(WebCore::PingLoader::sendBeacon):
* loader/PingLoader.h:

Source/WebKit:

Add experimental feature flag for the Beacon API, disabled by default.

* Shared/WebPreferencesDefinitions.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

Source/WebKitLegacy/mac:

Add setting to toggle support for the Beacon API (it is disabled by default).

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences beaconAPIEnabled]):
(-[WebPreferences setBeaconAPIEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Tools:

Enable the Beacon API at runtime in the context of layout tests since the
feature is currently disabled by default.

* DumpRenderTree/mac/DumpRenderTree.mm:
(enableExperimentalFeatures):
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::beginTesting):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setModernMediaControlsEnabled):
(WTR::TestRunner::setBeaconAPIEnabled):
* WebKitTestRunner/InjectedBundle/TestRunner.h:

LayoutTests:

* fast/dom/navigator-detached-no-crash-expected.txt:
Rebaseline test now that sendBeacon is exposed on navigator.

* http/tests/blink/sendbeacon/beacon-cookie-expected.txt: Added.
* http/tests/blink/sendbeacon/beacon-cookie.html: Added.
* http/tests/blink/sendbeacon/beacon-cross-origin-expected.txt: Added.
* http/tests/blink/sendbeacon/beacon-cross-origin-redirect-blob-expected.txt: Added.
* http/tests/blink/sendbeacon/beacon-cross-origin-redirect-blob.html: Added.
* http/tests/blink/sendbeacon/beacon-cross-origin-redirect-expected.txt: Added.
* http/tests/blink/sendbeacon/beacon-cross-origin-redirect.html: Added.
* http/tests/blink/sendbeacon/beacon-cross-origin.html: Added.
* http/tests/blink/sendbeacon/beacon-cross-origin.https-expected.txt: Added.
* http/tests/blink/sendbeacon/beacon-cross-origin.https.html: Added.
* http/tests/blink/sendbeacon/beacon-detached-no-crash-expected.txt: Added.
* http/tests/blink/sendbeacon/beacon-detached-no-crash.html: Added.
* http/tests/blink/sendbeacon/beacon-same-origin-expected.txt: Added.
* http/tests/blink/sendbeacon/beacon-same-origin.html: Added.
* http/tests/blink/sendbeacon/connect-src-beacon-allowed-expected.txt: Added.
* http/tests/blink/sendbeacon/connect-src-beacon-allowed.html: Added.
* http/tests/blink/sendbeacon/resources/check-beacon.php: Added.
* http/tests/blink/sendbeacon/resources/save-beacon.php: Added.
Import more beacon test coverage from Blink.

* http/wpt/beacon/connect-src-beacon-blocked.sub-expected.txt: Added.
* http/wpt/beacon/connect-src-beacon-blocked.sub.html: Added.
Improve test coverage for sendBeacon and CSP.

* http/wpt/beacon/headers/header-content-type-same-origin-expected.txt: Added.
* http/wpt/beacon/headers/header-content-type-same-origin.html: Added.
Improve test coverage for sendBeacon with various types of payload. The test is done
using same origin as we do not currently support sending some of those payloads cross
origin yet.

* imported/blink/fast/beacon/beacon-basic-expected.txt: Added.
* imported/blink/fast/beacon/beacon-basic.html: Added.
Import basic Beacon test coverage from Blink.

* resources/window-postmessage-open-close.html: Added.
* tests-options.json:

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

4 years agoUpdate Bot Watcher's Dashboard for Buildbot 0.9
aakash_jain@apple.com [Wed, 2 Aug 2017 03:22:15 +0000 (03:22 +0000)]
Update Bot Watcher's Dashboard for Buildbot 0.9
https://bugs.webkit.org/show_bug.cgi?id=174777

Reviewed by Daniel Bates.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Buildbot.js:
(Buildbot): Check if USE_BUILDBOT_VERSION_LESS_THAN_09 is passed.
(Buildbot.prototype._computeBuilderNameToIDMap): Fetch the builder name to ID mapping from buidbot and store
in a dictionary.
(Buildbot.prototype.buildPageURLForIteration): Updated URL as per Buildbot 0.9 format. Buildbot 0.9 currently does not support
builder name in the build url. See <https://github.com/buildbot/buildbot/issues/3465>.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotIteration.js:
(isMultiCodebaseGotRevisionProperty): Adapting to new data format.
(parseRevisionProperty): Ditto.
(BuildbotIteration.prototype.failureLogURL): Return the URL to build page if precise failure url is not available. For
Buildbot 0.9, build page URL would be appropriate in most cases as per the new UI.
(BuildbotIteration.prototype._parseData): Parsing the data as per new data format. Many variable names and data types
have changed in Buildbot 0.9.
(BuildbotIteration.prototype._adjustBuildDataForBuildbot09): Adjust the Buildbot 0.8 data to new format.
(BuildbotIteration.prototype._updateIfDataAvailable): Update method for Buildbot 0.9 data. We are performing two API calls,
one for build information, another for step information of that build. We need to wait until data from both REST API calls are available.
(BuildbotIteration.prototype._deprecatedUpdateWithData): Renamed from _updateWithData, used for Buildbot 0.8 data.
(BuildbotIteration.prototype.get buildURL): URL to fetch build information from Buildbot. Also fetches got_revision property.
(BuildbotIteration.prototype.get buildStepsURL): URL to fetch the steps information from Buildbot.
(BuildbotIteration.prototype.urlFailedToLoad): Callback method to be used when URL fails to load. Made it a separate function now.
(BuildbotIteration.prototype.update): Modified to support both Buildbot 0.9 and 0.8 data format.
(BuildbotIteration.prototype.actualUpdate): Update method for Buildbot 0.9 data.
(BuildbotIteration.prototype.deprecatedUpdate): Update method for Buildbot 0.8 data.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotQueue.js:
(BuildbotQueue.prototype.get baseURL): Updated URL as per Buildbot 0.9 format.
(BuildbotQueue.prototype.get allIterationsURL): Ditto.
(BuildbotQueue.prototype.get overviewURL): Ditto.
(BuildbotQueue.prototype.get buildsURL): URL to fetch builds data in Buildbot 0.9.
(BuildbotQueue.prototype.get buildsInfoURL): Returns the appropriate URL to use to fetch builds information from
Buildbot 0.8 or 0.9.
(BuildbotQueue.prototype.getBuilds): Method compatible with both Buildbot 0.8 and 0.9 to get build information from data
fetched from Buildbot. Also, reversing the Buildbot 0.8 data to make it similar to 0.9 data format.
(BuildbotQueue.prototype.isBuildComplete): Method compatible with both Buildbot 0.8 and 0.9 to check if the build has completed.
(BuildbotQueue.prototype.getIterationID):  Method compatible with both Buildbot 0.8 and 0.9 to get the Iteration ID.
(BuildbotQueue.prototype.update): Supports both Buildbot 0.8 and 0.9. Buildbot 0.9 REST API doesn't have cachedBuilds and currentBuilds.
Therefore we are fetching information for fixed number of build.
Also iterating the loop incrementally since the build data is already reverse sorted.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotTestResults.js:
(BuildbotTestResults.prototype._parseResults): Updated as per Buildbot 0.9 format. Note that we do not
need to worry about 0.8 or 0.9 data format here, since the data is already converted to 0.9 format.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/WebKitBuildbot.js:
(WebKitBuildbot): Pass the USE_BUILDBOT_VERSION_LESS_THAN_09 flag.

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

4 years agoWeb Inspector: simplify WebInspector with WI
drousso@apple.com [Wed, 2 Aug 2017 03:09:57 +0000 (03:09 +0000)]
Web Inspector: simplify WebInspector with WI
https://bugs.webkit.org/show_bug.cgi?id=175058

Reviewed by Joseph Pecoraro.

Source/WebInspectorUI:

* .eslintrc:

* Tools/PrettyPrinting/FormatterDebug.js:
* Tools/PrettyPrinting/index.html:

* UserInterface/Main.html:
* UserInterface/Test.html:

* UserInterface/Base/*.js:
* UserInterface/Controllers/*.js:
* UserInterface/Debug/*.js:
* UserInterface/Models/*.js:
* UserInterface/Protocol/*.js:
* UserInterface/Proxies/*.js:
* UserInterface/Test/*.js:
* UserInterface/Views/*.js:

Tools:

* Scripts/check-inspector-strings:
(extract_ui_strings):
* Scripts/extract-localizable-js-strings:

LayoutTests:

* http/tests/inspector/**/*.html:
* http/tests/websocket/tests/hybi/inspector/**/*.html:
* inspector/**/*.html:

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

4 years agoBmalloc and GC should put auxiliaries (butterflies, typed array backing stores) in...
fpizlo@apple.com [Wed, 2 Aug 2017 01:50:16 +0000 (01:50 +0000)]
Bmalloc and GC should put auxiliaries (butterflies, typed array backing stores) in a gigacage (separate multi-GB VM region)
https://bugs.webkit.org/show_bug.cgi?id=174727

Reviewed by Mark Lam.
Source/bmalloc:

This adds a mechanism for managing multiple isolated heaps in bmalloc. For now, these isoheaps
(isolated heaps) have a very simple relationship with each other and with the rest of bmalloc:

- You have to choose how many isoheaps you will have statically. See numHeaps in HeapKind.h.

- Because numHeaps is static, each isoheap gets fast thread-local allocation. Basically, we have a
  Cache for each heap kind.

- Each isoheap gets its own Heap.

- Each Heap gets a scavenger thread.

- Some things, like Zone/VMHeap/Scavenger, are per-process.

Most of the per-HeapKind functionality is handled by PerHeapKind<>.

This approach is ideal for supporting special per-HeapKind behaviors. For now we have two heaps:
the Primary heap for normal malloc and the Gigacage. The gigacage is a 64GB-aligned 64GB virtual
region that we now use for variable-length random-access allocations. No Primary allocations will
go into the Gigacage.

* CMakeLists.txt:
* bmalloc.xcodeproj/project.pbxproj:
* bmalloc/AllocationKind.h: Added.
* bmalloc/Allocator.cpp:
(bmalloc::Allocator::Allocator):
(bmalloc::Allocator::tryAllocate):
(bmalloc::Allocator::allocateImpl):
(bmalloc::Allocator::reallocate):
(bmalloc::Allocator::refillAllocatorSlowCase):
(bmalloc::Allocator::allocateLarge):
* bmalloc/Allocator.h:
* bmalloc/BExport.h: Added.
* bmalloc/Cache.cpp:
(bmalloc::Cache::scavenge):
(bmalloc::Cache::Cache):
(bmalloc::Cache::tryAllocateSlowCaseNullCache):
(bmalloc::Cache::allocateSlowCaseNullCache):
(bmalloc::Cache::deallocateSlowCaseNullCache):
(bmalloc::Cache::reallocateSlowCaseNullCache):
(bmalloc::Cache::operator new): Deleted.
(bmalloc::Cache::operator delete): Deleted.
* bmalloc/Cache.h:
(bmalloc::Cache::tryAllocate):
(bmalloc::Cache::allocate):
(bmalloc::Cache::deallocate):
(bmalloc::Cache::reallocate):
* bmalloc/Deallocator.cpp:
(bmalloc::Deallocator::Deallocator):
(bmalloc::Deallocator::scavenge):
(bmalloc::Deallocator::processObjectLog):
(bmalloc::Deallocator::deallocateSlowCase):
* bmalloc/Deallocator.h:
* bmalloc/Gigacage.cpp: Added.
(Gigacage::Callback::Callback):
(Gigacage::Callback::function):
(Gigacage::Callbacks::Callbacks):
(Gigacage::ensureGigacage):
(Gigacage::disableGigacage):
(Gigacage::addDisableCallback):
(Gigacage::removeDisableCallback):
* bmalloc/Gigacage.h: Added.
(Gigacage::caged):
(Gigacage::isCaged):
* bmalloc/Heap.cpp:
(bmalloc::Heap::Heap):
(bmalloc::Heap::usingGigacage):
(bmalloc::Heap::concurrentScavenge):
(bmalloc::Heap::splitAndAllocate):
(bmalloc::Heap::tryAllocateLarge):
(bmalloc::Heap::allocateLarge):
(bmalloc::Heap::shrinkLarge):
(bmalloc::Heap::deallocateLarge):
* bmalloc/Heap.h:
(bmalloc::Heap::mutex):
(bmalloc::Heap::kind const):
(bmalloc::Heap::setScavengerThreadQOSClass): Deleted.
* bmalloc/HeapKind.h: Added.
* bmalloc/ObjectType.cpp:
(bmalloc::objectType):
* bmalloc/ObjectType.h:
* bmalloc/PerHeapKind.h: Added.
(bmalloc::PerHeapKindBase::PerHeapKindBase):
(bmalloc::PerHeapKindBase::size):
(bmalloc::PerHeapKindBase::at):
(bmalloc::PerHeapKindBase::at const):
(bmalloc::PerHeapKindBase::operator[]):
(bmalloc::PerHeapKindBase::operator[] const):
(bmalloc::StaticPerHeapKind::StaticPerHeapKind):
(bmalloc::PerHeapKind::PerHeapKind):
(bmalloc::PerHeapKind::~PerHeapKind):
* bmalloc/PerThread.h:
(bmalloc::PerThread<T>::destructor):
(bmalloc::PerThread<T>::getSlowCase):
(bmalloc::PerThreadStorage<Cache>::get): Deleted.
(bmalloc::PerThreadStorage<Cache>::init): Deleted.
* bmalloc/Scavenger.cpp: Added.
(bmalloc::Scavenger::Scavenger):
(bmalloc::Scavenger::scavenge):
* bmalloc/Scavenger.h: Added.
(bmalloc::Scavenger::setScavengerThreadQOSClass):
(bmalloc::Scavenger::requestedScavengerThreadQOSClass const):
* bmalloc/VMHeap.cpp:
(bmalloc::VMHeap::VMHeap):
(bmalloc::VMHeap::tryAllocateLargeChunk):
* bmalloc/VMHeap.h:
* bmalloc/Zone.cpp:
(bmalloc::Zone::Zone):
* bmalloc/Zone.h:
* bmalloc/bmalloc.h:
(bmalloc::api::tryMalloc):
(bmalloc::api::malloc):
(bmalloc::api::tryMemalign):
(bmalloc::api::memalign):
(bmalloc::api::realloc):
(bmalloc::api::tryLargeMemalignVirtual):
(bmalloc::api::free):
(bmalloc::api::freeLargeVirtual):
(bmalloc::api::scavengeThisThread):
(bmalloc::api::scavenge):
(bmalloc::api::isEnabled):
(bmalloc::api::setScavengerThreadQOSClass):
* bmalloc/mbmalloc.cpp:

Source/JavaScriptCore:

This adopts the Gigacage for the GigacageSubspace, which we use for Auxiliary allocations. Also, in
one place in the code - the FTL codegen for butterfly and typed array access - we "cage" the accesses
themselves. Basically, we do masking to ensure that the pointer points into the gigacage.

This is neutral on JetStream.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* b3/B3InsertionSet.cpp:
(JSC::B3::InsertionSet::execute):
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGArgumentsEliminationPhase.cpp:
* dfg/DFGClobberize.cpp:
(JSC::DFG::readsOverlap):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixedButterflyAccessUncagingPhase.cpp: Added.
(JSC::DFG::performFixedButterflyAccessUncaging):
* dfg/DFGFixedButterflyAccessUncagingPhase.h: Added.
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGHeapLocation.cpp:
(WTF::printInternal):
* dfg/DFGHeapLocation.h:
* dfg/DFGNodeType.h:
* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::compileInThreadImpl):
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileGetButterfly):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGTypeCheckHoistingPhase.cpp:
(JSC::DFG::TypeCheckHoistingPhase::identifyRedundantStructureChecks):
(JSC::DFG::TypeCheckHoistingPhase::identifyRedundantArrayChecks):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileGetButterfly):
(JSC::FTL::DFG::LowerDFGToB3::compileGetIndexedPropertyStorage):
(JSC::FTL::DFG::LowerDFGToB3::compileGetByVal):
(JSC::FTL::DFG::LowerDFGToB3::compileStringCharAt):
(JSC::FTL::DFG::LowerDFGToB3::compileStringCharCodeAt):
(JSC::FTL::DFG::LowerDFGToB3::compileGetMapBucket):
(JSC::FTL::DFG::LowerDFGToB3::compileGetDirectPname):
(JSC::FTL::DFG::LowerDFGToB3::compileToLowerCase):
(JSC::FTL::DFG::LowerDFGToB3::caged):
* heap/GigacageSubspace.cpp: Added.
(JSC::GigacageSubspace::GigacageSubspace):
(JSC::GigacageSubspace::~GigacageSubspace):
(JSC::GigacageSubspace::tryAllocateAlignedMemory):
(JSC::GigacageSubspace::freeAlignedMemory):
(JSC::GigacageSubspace::canTradeBlocksWith):
* heap/GigacageSubspace.h: Added.
* heap/Heap.cpp:
(JSC::Heap::Heap):
(JSC::Heap::lastChanceToFinalize):
(JSC::Heap::finalize):
(JSC::Heap::sweepInFinalize):
(JSC::Heap::updateAllocationLimits):
(JSC::Heap::shouldDoFullCollection):
(JSC::Heap::collectIfNecessaryOrDefer):
(JSC::Heap::reportWebAssemblyFastMemoriesAllocated): Deleted.
(JSC::Heap::webAssemblyFastMemoriesThisCycleAtThreshold const): Deleted.
(JSC::Heap::sweepLargeAllocations): Deleted.
(JSC::Heap::didAllocateWebAssemblyFastMemories): Deleted.
* heap/Heap.h:
* heap/LargeAllocation.cpp:
(JSC::LargeAllocation::tryCreate):
(JSC::LargeAllocation::destroy):
* heap/MarkedAllocator.cpp:
(JSC::MarkedAllocator::tryAllocateWithoutCollecting):
(JSC::MarkedAllocator::tryAllocateBlock):
* heap/MarkedBlock.cpp:
(JSC::MarkedBlock::tryCreate):
(JSC::MarkedBlock::Handle::Handle):
(JSC::MarkedBlock::Handle::~Handle):
(JSC::MarkedBlock::Handle::didAddToAllocator):
(JSC::MarkedBlock::Handle::subspace const): Deleted.
* heap/MarkedBlock.h:
(JSC::MarkedBlock::Handle::subspace const):
* heap/MarkedSpace.cpp:
(JSC::MarkedSpace::~MarkedSpace):
(JSC::MarkedSpace::freeMemory):
(JSC::MarkedSpace::prepareForAllocation):
(JSC::MarkedSpace::addMarkedAllocator):
(JSC::MarkedSpace::findEmptyBlockToSteal): Deleted.
* heap/MarkedSpace.h:
(JSC::MarkedSpace::firstAllocator const):
(JSC::MarkedSpace::allocatorForEmptyAllocation const): Deleted.
* heap/Subspace.cpp:
(JSC::Subspace::Subspace):
(JSC::Subspace::canTradeBlocksWith):
(JSC::Subspace::tryAllocateAlignedMemory):
(JSC::Subspace::freeAlignedMemory):
(JSC::Subspace::prepareForAllocation):
(JSC::Subspace::findEmptyBlockToSteal):
* heap/Subspace.h:
(JSC::Subspace::didCreateFirstAllocator):
* heap/SubspaceInlines.h:
(JSC::Subspace::forEachAllocator):
(JSC::Subspace::forEachMarkedBlock):
(JSC::Subspace::forEachNotEmptyMarkedBlock):
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emitDoubleLoad):
(JSC::JIT::emitContiguousLoad):
(JSC::JIT::emitArrayStorageLoad):
(JSC::JIT::emitGenericContiguousPutByVal):
(JSC::JIT::emitArrayStoragePutByVal):
(JSC::JIT::emit_op_get_from_scope):
(JSC::JIT::emit_op_put_to_scope):
(JSC::JIT::emitIntTypedArrayGetByVal):
(JSC::JIT::emitFloatTypedArrayGetByVal):
(JSC::JIT::emitIntTypedArrayPutByVal):
(JSC::JIT::emitFloatTypedArrayPutByVal):
* jsc.cpp:
(fillBufferWithContentsOfFile):
(functionReadFile):
(gigacageDisabled):
(jscmain):
* llint/LowLevelInterpreter64.asm:
* runtime/ArrayBuffer.cpp:
(JSC::ArrayBufferContents::tryAllocate):
(JSC::ArrayBuffer::createAdopted):
(JSC::ArrayBuffer::createFromBytes):
(JSC::ArrayBuffer::tryCreate):
* runtime/IndexingHeader.h:
* runtime/InitializeThreading.cpp:
(JSC::initializeThreading):
* runtime/JSArrayBuffer.cpp:
* runtime/JSArrayBufferView.cpp:
(JSC::JSArrayBufferView::ConstructionContext::ConstructionContext):
(JSC::JSArrayBufferView::finalize):
* runtime/JSLock.cpp:
(JSC::JSLock::didAcquireLock):
* runtime/JSObject.h:
* runtime/Options.cpp:
(JSC::recomputeDependentOptions):
* runtime/Options.h:
* runtime/ScopedArgumentsTable.h:
* runtime/VM.cpp:
(JSC::VM::VM):
(JSC::VM::~VM):
(JSC::VM::gigacageDisabledCallback):
(JSC::VM::gigacageDisabled):
* runtime/VM.h:
(JSC::VM::fireGigacageEnabledIfNecessary):
(JSC::VM::gigacageEnabled):
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::B3IRGenerator):
(JSC::Wasm::B3IRGenerator::emitCheckAndPreparePointer):
* wasm/WasmCodeBlock.cpp:
(JSC::Wasm::CodeBlock::isSafeToRun):
* wasm/WasmMemory.cpp:
(JSC::Wasm::makeString):
(JSC::Wasm::Memory::create):
(JSC::Wasm::Memory::~Memory):
(JSC::Wasm::Memory::addressIsInActiveFastMemory):
(JSC::Wasm::Memory::grow):
(JSC::Wasm::Memory::initializePreallocations): Deleted.
(JSC::Wasm::Memory::maxFastMemoryCount): Deleted.
* wasm/WasmMemory.h:
* wasm/js/JSWebAssemblyInstance.cpp:
(JSC::JSWebAssemblyInstance::create):
* wasm/js/JSWebAssemblyMemory.cpp:
(JSC::JSWebAssemblyMemory::grow):
(JSC::JSWebAssemblyMemory::finishCreation):
* wasm/js/JSWebAssemblyMemory.h:
(JSC::JSWebAssemblyMemory::subspaceFor):

Source/WebCore:

No new tests because no change in behavior.

Needed to teach Metal how to allocate in the Gigacage.

* platform/graphics/cocoa/GPUBufferMetal.mm:
(WebCore::GPUBuffer::GPUBuffer):
(WebCore::GPUBuffer::contents):

Source/WebKit:

The WebProcess should never disable the Gigacage by allocating typed arrays outside the Gigacage. So,
we add a callback that crashes the process.

* WebProcess/WebProcess.cpp:
(WebKit::gigacageDisabled):
(WebKit::m_webSQLiteDatabaseTracker):

Source/WTF:

For the Gigacage project to have minimal impact, we need to have some abstraction that allows code to
avoid having to guard itself with #if's. This adds a Gigacage abstraction that overlays the Gigacage
namespace from bmalloc, which always lets you call things like Gigacage::caged and Gigacage::tryMalloc.

Because of how many places need to possibly allocate in a gigacage, or possibly perform caged accesses,
it's better to hide the question of whether or not it's enabled inside this API.

* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/FastMalloc.cpp:
* wtf/Gigacage.cpp: Added.
(Gigacage::tryMalloc):
(Gigacage::tryAllocateVirtualPages):
(Gigacage::freeVirtualPages):
(Gigacage::tryAlignedMalloc):
(Gigacage::alignedFree):
(Gigacage::free):
* wtf/Gigacage.h: Added.
(Gigacage::ensureGigacage):
(Gigacage::disableGigacage):
(Gigacage::addDisableCallback):
(Gigacage::removeDisableCallback):
(Gigacage::caged):
(Gigacage::isCaged):
(Gigacage::tryAlignedMalloc):
(Gigacage::alignedFree):
(Gigacage::free):

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

4 years ago[WinCairo] Implement Font::platformBoundsForGlyph
commit-queue@webkit.org [Wed, 2 Aug 2017 01:08:48 +0000 (01:08 +0000)]
[WinCairo] Implement Font::platformBoundsForGlyph
https://bugs.webkit.org/show_bug.cgi?id=174813

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-08-01
Reviewed by Alex Christensen.

Test: fast/text/emphasis.html

* platform/graphics/win/SimpleFontDataCairoWin.cpp:
(WebCore::Font::platformBoundsForGlyph): Implemented by copying
the code from Font::boundsForGDIGlyph().

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

4 years agoAdded expectations files for El Capitan.
jlewis3@apple.com [Wed, 2 Aug 2017 00:36:05 +0000 (00:36 +0000)]
Added expectations files for El Capitan.
https://bugs.webkit.org/show_bug.cgi?id=175061

Unreviewed test gardening.

* platform/mac-elcapitan/imported/w3c/web-platform-tests/fetch/api/basic/mode-no-cors-expected.txt: Added.
* platform/mac-elcapitan/imported/w3c/web-platform-tests/fetch/api/basic/mode-no-cors-worker-expected.txt: Added.
* platform/mac-elcapitan/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic.any-expected.txt: Added.
* platform/mac-elcapitan/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic.any.worker-expected.txt: Added.
* platform/mac-elcapitan/imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight.any-expected.txt: Added.
* platform/mac-elcapitan/imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight.any.worker-expected.txt: Added.
* platform/mac-elcapitan/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin.any-expected.txt: Added.
* platform/mac-elcapitan/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin.any.worker-expected.txt: Added.

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

4 years agoWeb Automation: add event to notify service when a page's main frame window object...
bburg@apple.com [Tue, 1 Aug 2017 23:31:47 +0000 (23:31 +0000)]
Web Automation: add event to notify service when a page's main frame window object has cleared
https://bugs.webkit.org/show_bug.cgi?id=174987
<rdar://problem/36602634>

Reviewed by Carlos Garcia Campos.

* UIProcess/Automation/Automation.json: Add new event.

* UIProcess/Automation/WebAutomationSession.h:
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::navigationOccurredForFrame):
(WebKit::WebAutomationSession::willClosePage):
When a WebPage navigates or closes, send the browsingContextCleared event.
Any element handles for elements in the browsing context are no longer valid.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::close):
Add a new hook into the active automation session so it is notified when a page closes.

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

4 years agoWeb Inspector: create Recording tab for displaying recordings
drousso@apple.com [Tue, 1 Aug 2017 23:00:46 +0000 (23:00 +0000)]
Web Inspector: create Recording tab for displaying recordings
https://bugs.webkit.org/show_bug.cgi?id=174484

Reviewed by Joseph Pecoraro.

Source/WebInspectorUI:

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Main.html:
* UserInterface/Test.html:

* UserInterface/Controllers/CanvasManager.js:
(WebInspector.CanvasManager.prototype.recordingFinished):
* UserInterface/Models/Canvas.js:
(WebInspector.Canvas.prototype.toggleRecording):

* UserInterface/Models/Recording.js:
(WebInspector.Recording):
(WebInspector.Recording.synthesizeError):
(WebInspector.Recording.prototype.get actions):
(WebInspector.Recording.prototype.get source):
(WebInspector.Recording.prototype.set source):
(WebInspector.Recording.prototype.swizzle):

* UserInterface/Models/RecordingAction.js:
(WebInspector.RecordingAction):
(WebInspector.RecordingAction.isFunctionForType):
(WebInspector.RecordingAction.get name):
(WebInspector.RecordingAction.get parameters):
(WebInspector.RecordingAction.prototype.get valid):
(WebInspector.RecordingAction.prototype.set valid):
(WebInspector.RecordingAction.get isFunction):
(WebInspector.RecordingAction.get isGetter):
(WebInspector.RecordingAction.get isVisual):
(WebInspector.RecordingAction.get stateModifiers):
(WebInspector.RecordingAction.prototype.swizzle):
(WebInspector.RecordingAction.prototype.parameterSwizzleTypeForTypeAtIndex):

* UserInterface/Models/RecordingInitialStateAction.js: Added.
(WebInspector.RecordingInitialStateAction):

* UserInterface/Views/RecordingTabContentView.js: Added.
(WebInspector.RecordingTabContentView):
(WebInspector.RecordingTabContentView.tabInfo):
(WebInspector.RecordingTabContentView.prototype.get type):
(WebInspector.RecordingTabContentView.prototype.canShowRepresentedObject):
(WebInspector.RecordingTabContentView.prototype.showRepresentedObject):
(WebInspector.RecordingTabContentView.prototype.restoreStateFromCookie):
(WebInspector.RecordingTabContentView.prototype.saveStateToCookie):
(WebInspector.RecordingTabContentView.prototype.closed):
(WebInspector.RecordingTabContentView.prototype._updateActionIndex):
(WebInspector.RecordingTabContentView.prototype._scrubberNavigationItemValueChanged):
(WebInspector.RecordingTabContentView.prototype._navigationSidebarImport):
(WebInspector.RecordingTabContentView.prototype._navigationSidebarTreeOutlineSelectionChanged):

* UserInterface/Views/RecordingContentView.js: Added.
(WebInspector.RecordingContentView):
(WebInspector.RecordingContentView.prototype.get navigationItems):
(WebInspector.RecordingContentView.prototype.updateActionIndex):
(WebInspector.RecordingContentView.prototype.shown):
(WebInspector.RecordingContentView.prototype.get supplementalRepresentedObjects):
(WebInspector.RecordingContentView.prototype._generateContentCanvas2D):
(WebInspector.RecordingContentView.prototype._applyAction):
(WebInspector.RecordingContentView.prototype._updateImageGrid):
(WebInspector.RecordingContentView.prototype._showGridButtonClicked):
* UserInterface/Views/RecordingContentView.css: Copied from Source/WebInspectorUI/UserInterface/Views/CanvasContentView.css.
(.content-view:not(.tab).recording):
(.content-view:not(.tab).recording > .preview-container):
(.content-view:not(.tab).recording canvas):

* UserInterface/Views/RecordingNavigationSidebarPanel.js: Added.
(WebInspector.RecordingNavigationSidebarPanel):
(WebInspector.RecordingNavigationSidebarPanel.disallowInstanceForClass):
(WebInspector.RecordingNavigationSidebarPanel.prototype.set recording):
(WebInspector.RecordingNavigationSidebarPanel.prototype.updateActionIndex):
(WebInspector.RecordingNavigationSidebarPanel.prototype.initialLayout):
(WebInspector.RecordingNavigationSidebarPanel.prototype._importNavigationItemClicked):
(WebInspector.RecordingNavigationSidebarPanel.prototype._exportNavigationItemClicked):
* UserInterface/Views/RecordingNavigationSidebarPanel.css: Added.
(.sidebar > .panel.navigation.recording > :matches(.content, .empty-content-placeholder)):
(.sidebar > .panel.navigation.recording > .content > .tree-outline):
(.sidebar > .panel.navigation.recording > .content > .tree-outline > .item.parent:not(.action, .selected).expanded):
(.sidebar > .panel.navigation.recording > .content > .tree-outline .item.action:not(.initial-state)::before):
(body[dir=ltr] .sidebar > .panel.navigation.recording > .content > .tree-outline .item.action:not(.initial-state)::before):
(body[dir=rtl] .sidebar > .panel.navigation.recording > .content > .tree-outline .item.action:not(.initial-state)::before):
(.sidebar > .panel.navigation.recording > .content > .tree-outline[data-indent="2"] .item.action:not(.initial-state)::before):
(.sidebar > .panel.navigation.recording > .content > .tree-outline[data-indent="3"] .item.action:not(.initial-state)::before):
(.sidebar > .panel.navigation.recording > .content > .tree-outline[data-indent="4"] .item.action:not(.initial-state)::before):
(.sidebar > .panel.navigation.recording > .content > .tree-outline[data-indent="5"] .item.action:not(.initial-state)::before):
(.sidebar > .panel.navigation.recording > .content > .tree-outline[data-indent="6"] .item.action:not(.initial-state)::before):
(.sidebar > .panel.navigation.recording > .content > .tree-outline[data-indent="7"] .item.action:not(.initial-state)::before):
(.sidebar > .panel.navigation.recording > .content .action > .icon):
(.sidebar > .panel.navigation.recording > .content .action.function > .icon):
(.sidebar > .panel.navigation.recording > .content .action.attribute.getter > .icon):
(.sidebar > .panel.navigation.recording > .content .tree-outline:matches(:focus, .force-focus) .action.attribute.getter.selected > .icon):
(.sidebar > .panel.navigation.recording > .content .action.attribute.boolean > .icon):
(.sidebar > .panel.navigation.recording > .content .action.attribute.number > .icon):
(.sidebar > .panel.navigation.recording > .content .action.attribute.object > .icon):
(.sidebar > .panel.navigation.recording > .content .action.attribute.string > .icon):
(.sidebar > .panel.navigation.recording > .content > .tree-outline > .item.parent:not(.action) > .icon):
(.sidebar > .panel.navigation.recording > .content .action:matches(.invalid, .missing) > .icon):
(body[dir=ltr] .sidebar > .panel.navigation.recording > .content .action:not(.initial-state) > .icon):
(body[dir=rtl] .sidebar > .panel.navigation.recording > .content .action:not(.initial-state) > .icon):
(.sidebar > .panel.navigation.recording > .content .action.visual:not(.selected, .invalid)):
(.sidebar > .panel.navigation.recording > .content .action:not(.selected, .initial-state) > .titles .parameter.swizzled):
(.sidebar > .panel.navigation.recording > .content .action.invalid:not(.selected, .initial-state) > .titles .name,):

* UserInterface/Views/RecordingStateDetailsSidebarPanel.js: Added.
(WebInspector.RecordingStateDetailsSidebarPanel):
(WebInspector.RecordingStateDetailsSidebarPanel.disallowInstanceForClass):
(WebInspector.RecordingStateDetailsSidebarPanel.prototype.inspect):
(WebInspector.RecordingStateDetailsSidebarPanel.prototype.set recording):
(WebInspector.RecordingStateDetailsSidebarPanel.prototype.updateActionIndex):
(WebInspector.RecordingStateDetailsSidebarPanel.prototype._generateDetailsCanvas2D):
* UserInterface/Views/RecordingStateDetailsSidebarPanel.css: Added.
(.sidebar > .panel.details.recording-state > .content > .data-grid):
(.sidebar > .panel.details.recording-state > .content > .data-grid tr.modified):
(.sidebar > .panel.details.recording-state > .content > .data-grid tr:not(.selected).non-standard):
(.sidebar > .panel.details.recording-state > .content > .data-grid tr:not(.selected) .unavailable):

* UserInterface/Views/RecordingActionTreeElement.js: Added.
(WebInspector.RecordingActionTreeElement):
(WebInspector.RecordingActionTreeElement._generateDOM):
(WebInspector.RecordingActionTreeElement.prototype.get index):
(WebInspector.RecordingActionTreeElement.get filterableData):
(WebInspector.RecordingActionTreeElement.prototype.get filterableData):
(WebInspector.RecordingActionTreeElement.prototype.onattach):
(WebInspector.RecordingActionTreeElement.prototype.populateContextMenu):

* UserInterface/Base/Main.js:
(WebInspector.contentLoaded):
(WebInspector.instanceForClass):

* UserInterface/Base/FileUtilites.js: Added.
(WebInspector.saveDataToFile): Moved from UserInterface/Base/Main.js
(WebInspector.loadDataFromFile):

* UserInterface/Views/ButtonNavigationItem.js:
(WebInspector.ButtonNavigationItem.prototype._mouseClicked):
Send the native event as part of the data.

* UserInterface/Views/CanvasContentView.js:
(WebInspector.CanvasContentView):
(WebInspector.CanvasContentView.prototype.get navigationItems):
(WebInspector.CanvasContentView.prototype.initialLayout):
(WebInspector.CanvasContentView.prototype.closed):
(WebInspector.CanvasContentView.prototype._toggleRecording):
(WebInspector.CanvasContentView.prototype._recordingFinished):
* UserInterface/Views/CanvasContentView.css:
(.content-view.canvas):

* UserInterface/Views/CanvasDetailsSidebarPanel.js:
(WebInspector.CanvasDetailsSidebarPanel.prototype.inspect):

* UserInterface/Views/ContentBrowser.js:
(WebInspector.ContentBrowser):
(WebInspector.ContentBrowser.prototype._updateContentViewNavigationItems):
* UserInterface/Views/ContentBrowserTabContentView.js:
(WebInspector.ContentBrowserTabContentView):
* UserInterface/Views/ContentView.js:
(WebInspector.ContentView.createFromRepresentedObject):
(WebInspector.ContentView.isViewable):
* UserInterface/Views/ScrubberNavigationItem.js: Added.
(WebInspector.ScrubberNavigationItem):
(WebInspector.ScrubberNavigationItem.prototype.get value):
(WebInspector.ScrubberNavigationItem.prototype.set value):
(WebInspector.ScrubberNavigationItem.prototype.get min):
(WebInspector.ScrubberNavigationItem.prototype.set min):
(WebInspector.ScrubberNavigationItem.prototype.get max):
(WebInspector.ScrubberNavigationItem.prototype.set max):
(WebInspector.ScrubberNavigationItem.prototype.set disabled):
(WebInspector.ScrubberNavigationItem.prototype.get additionalClassNames):
(WebInspector.ScrubberNavigationItem.prototype._sliderChanged):
* UserInterface/Views/ScrubberNavigationItem.css: Added.
(.navigation-bar .item.scrubber):
(.navigation-bar .item.scrubber > input):
(.navigation-bar .item.scrubber > input[disabled]):
Allow the flexible space to be replaced with a navigation item at construction.

* UserInterface/Views/DataGridNode.js:
(WebInspector.DataGridNode):
(WebInspector.DataGridNode.prototype.get element):
Allow a list of CSS classes to be added to the node's element.

* UserInterface/Views/SettingsTabContentView.js:
(WebInspector.SettingsTabContentView.prototype.initialLayout):
(WebInspector.SettingsTabContentView.prototype._createExperimentalSettingsView.listenForChange):
(WebInspector.SettingsTabContentView.prototype._createExperimentalSettingsView):
(WebInspector.SettingsTabContentView.prototype._createDebugSettingsView):
Move experimental settings to their own panel.

* UserInterface/Views/TabContentView.js:
(WebInspector.TabContentView.prototype.get navigationSidebarPanel):
Save the NavigationSidebarPanel after it's constructed.

* UserInterface/Base/Utilities.js:
(Number.countDigits):

* UserInterface/Images/Recording.svg: Added.
* UserInterface/Images/RenderingFrame.svg: Renamed from Source/WebInspectorUI/UserInterface/Images/TimelineRecordRenderingFrame.svg.
* UserInterface/Images/gtk/RenderingFrame.svg: Renamed from Source/WebInspectorUI/UserInterface/Images/gtk/TimelineRecordRenderingFrame.svg.
* UserInterface/Views/TimelineIcons.css:
(.rendering-frame-record .icon):

* UserInterface/Views/DOMTreeOutline.css:
(@keyframes node-state-changed):
* UserInterface/Views/Main.css:
(:matches(img, canvas).show-grid):
(img.show-grid): Deleted.
* UserInterface/Views/NavigationBar.css:
(.navigation-bar):
* UserInterface/Views/NetworkSidebarPanel.css:
(.sidebar > .panel.navigation.network.network-grid-content-view-showing > .content > .tree-outline):
* UserInterface/Views/TimelineTabContentView.css:
(.timeline.tab.content-view .navigation-bar > .item.radio):
* UserInterface/Views/TimelineView.css:
(.panel.navigation.timeline.timeline-recording-content-view-showing > .content > .tree-outline):
* UserInterface/Views/Variables.css:
(:root):
Create CSS variables for the DOM modification flash color and the color striping.

LayoutTests:

* inspector/unit-tests/number-utilities-expected.txt:
* inspector/unit-tests/number-utilities.html:

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

4 years ago[PAL][Win] Copy forwarding headers
commit-queue@webkit.org [Tue, 1 Aug 2017 22:33:18 +0000 (22:33 +0000)]
[PAL][Win] Copy forwarding headers
https://bugs.webkit.org/show_bug.cgi?id=175012

Patch by Yoshiaki Jitsukawa <jitsu@rd.scei.sony.co.jp> on 2017-08-01
Reviewed by Myles C. Maxfield.

* pal/PlatformAppleWin.cmake: Added.
* pal/PlatformWin.cmake:
* pal/PlatformWinCairo.cmake: Added.

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

4 years agoREGRESSION (r217197): New Yorker website hangs for a long time on load, lots of blank...
zalan@apple.com [Tue, 1 Aug 2017 21:42:28 +0000 (21:42 +0000)]
REGRESSION (r217197): New Yorker website hangs for a long time on load, lots of blank tiles
https://bugs.webkit.org/show_bug.cgi?id=175009
<rdar://problem/33505791>

Reviewed by Simon Fraser.

Source/WebCore:

This patch ensures that we report the desktop, non-frame-flattened frame size for media queries in subframes.
Some websites don't expect the iframes to be expanded to the size of the content and when the media query
callback mutates the content (triggering frame resize), they might end up getting into a never ending layout.

Test: fast/frames/flattening/media-query-growing-content.html

* css/MediaQueryEvaluator.cpp:
(WebCore::orientationEvaluate):
(WebCore::aspectRatioEvaluate):
(WebCore::heightEvaluate):
(WebCore::widthEvaluate):
* page/FrameView.cpp:
(WebCore::FrameView::layout):
(WebCore::FrameView::layoutSizeForMediaQuery const):
(WebCore::FrameView::evaluateMediaQueryList):
* page/FrameView.h:

LayoutTests:

* fast/frames/flattening/media-query-growing-content-expected.txt: Added.
* fast/frames/flattening/media-query-growing-content.html: Added.
* fast/frames/flattening/resources/media-query-min-height-with-flattening.html: Added.

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

4 years agoLayout tests with 'https' suffix should be run over HTTPS
commit-queue@webkit.org [Tue, 1 Aug 2017 21:02:37 +0000 (21:02 +0000)]
Layout tests with 'https' suffix should be run over HTTPS
https://bugs.webkit.org/show_bug.cgi?id=174992

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

Tools:

Updating the test-name <-> uri conversion routines to use https when test names contain ".https." in them.
This covers WPT tests, WPT WebKit tests and HTTP layout tests.
Covered by corresponding unit tests.

* Scripts/webkitpy/layout_tests/servers/run_webkit_httpd.py:
(run_server):
* Scripts/webkitpy/layout_tests/servers/web_platform_test_server.py:
(base_http_url):
(base_https_url):
(base_url): Deleted.
* Scripts/webkitpy/port/base.py:
(Port.to.web_platform_test_server_base_http_url):
(Port.to):
(Port.to.web_platform_test_server_base_https_url):
(Port.to.web_platform_test_server_base_url): Deleted.
* Scripts/webkitpy/port/driver.py:
(Driver.__init__):
(Driver.wpt_test_path_to_uri):
(Driver):
(Driver.http_test_path_to_uri):
(Driver.test_to_uri):
(Driver.uri_to_test):
* Scripts/webkitpy/port/driver_unittest.py:
(DriverTest.test_test_to_uri):
(DriverTest.test_uri_to_test):

LayoutTests:

Updating test to allow display insecure content as otherwise the test would not complete now that it is run over HTTPS.
Adding WK1 expected files as the warning message is not printed.

* http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/iframe-upgrade.https-expected.txt:
* http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/iframe-upgrade.https.html:
* platform/ios-wk1/http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/iframe-upgrade.https-expected.txt: Added.
* platform/mac-wk1/http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/iframe-upgrade.https-expected.txt: Added.

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

4 years agoMarked imported/w3c/IndexedDB-private-browsing/idbfactory_open.html as flaky.
jlewis3@apple.com [Tue, 1 Aug 2017 20:47:21 +0000 (20:47 +0000)]
Marked imported/w3c/IndexedDB-private-browsing/idbfactory_open.html as flaky.
<rdar://problem/33555052>

Unreviewed test gardening.

* platform/ios-wk2/TestExpectations:

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

4 years agoAdd tests to detect mistakes in backward compatibility when the structured clone...
jiewen_tan@apple.com [Tue, 1 Aug 2017 20:00:49 +0000 (20:00 +0000)]
Add tests to detect mistakes in backward compatibility when the structured clone algorithm is changed in the future
https://bugs.webkit.org/show_bug.cgi?id=173998

Reviewed by Darin Adler.

Source/WebCore:

* bindings/js/SerializedScriptValue.cpp:
Add a comment.

Tools:

Since the structured clone algorithm is used for data stored in persistent databases, we need tests to help us
detect mistakes in backward compatibility in the future when we change it.

The way it works is to read from a pre-baked database and see if all the values are matched with the expectations.
Surprisedly, some of structured clonable objects cannot be stored into the indexedDB. Those are FileList,
ObjectReference, MessagePortReference, ArrayBufferView, ArrayBufferTransfer, NonMapProperties, NonSetProperties,
SharedArrayBuffer, WasmModule, DOMPointReadOnly, DOMPoint, DOMRectReadOnly, DOMRect, DOMMatrixReadOnly, DOMMatrix,
DOMQuad and Error. CryptoKey objects are not included as well as they need new API for encrypting/decrypting the
internal key data slot.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBStructuredCloneBackwardCompatibility.mm: Added.
(-[IndexedDBStructuredCloneBackwardCompatibilityMessageHandler userContentController:didReceiveScriptMessage:]):
(getNextMessage):
(TEST):
Here is the API test that moves the pre-baked database to the location where TestWebKitAPI can read from.
* TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBStructuredCloneBackwardCompatibility.sqlite3: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBStructuredCloneBackwardCompatibility.sqlite3-shm: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBStructuredCloneBackwardCompatibility.sqlite3-wal: Added.
These are the pre-baked databases.
* TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBStructuredCloneBackwardCompatibilityRead.html: Added.
This is the actual test that do all the reads and comparisons.
* TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBStructuredCloneBackwardCompatibilityWrite.html: Added.
This is the page that bakes the database. It never runs automatically. It is for someone who needs to teach
IndexedDB new stuffs. Then it can be used to bake the database again.

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

4 years ago[WebCrypto] Add PKCS#8 import test that covers `parameters` and `publicKey` values...
zandobersek@gmail.com [Tue, 1 Aug 2017 19:18:11 +0000 (19:18 +0000)]
[WebCrypto] Add PKCS#8 import test that covers `parameters` and `publicKey` values in ECPrivateKey
https://bugs.webkit.org/show_bug.cgi?id=174420

Reviewed by Darin Adler.

Add test cases that cover testing of the optional ECParameters and publicKey bit string
attributes in the ECPrivateKey ASN.1 structure that's embedded in the PKCS#8 PrivateKeyInfo
ASN.1 structure.

Per the spec, if the ECParameters attribute in the ECPrivateKey structure is present, the
relevant curve object identifier should match the same curve identifier that's used in the
ECParameters attribute of the AlgorithmIdentifier structure in PrivateKeyInfo. Both of these
should of course match the curve that was specified for the import operation.

For the publicKey bit string, the data contained there should be properly formatted for
the specific curve, meaning it should be of proper curve-specific size and that it should
use 0x04 as the leading byte, signalling an uncompressed EC point. On top of that the public
key should have a valid value that positions it on the specified elliptic curve.

These cases are covered for PKCS#8 key imports for P-256 and P-384 curves and for both ECDH
and ECDSA algorithms in the newly-introduced tests. They are skipped on all platforms since
no implementation in WebKit can pass them yet.

* TestExpectations:
* crypto/subtle/ecdh-import-pkcs8-key-p256-validate-ecprivatekey-parameters-publickey-expected.txt: Added.
* crypto/subtle/ecdh-import-pkcs8-key-p256-validate-ecprivatekey-parameters-publickey.html: Added.
* crypto/subtle/ecdh-import-pkcs8-key-p384-validate-ecprivatekey-parameters-publickey-expected.txt: Added.
* crypto/subtle/ecdh-import-pkcs8-key-p384-validate-ecprivatekey-parameters-publickey.html: Added.
* crypto/subtle/ecdsa-import-pkcs8-key-p256-validate-ecprivatekey-parameters-publickey-expected.txt: Added.
* crypto/subtle/ecdsa-import-pkcs8-key-p256-validate-ecprivatekey-parameters-publickey.html: Added.
* crypto/subtle/ecdsa-import-pkcs8-key-p384-validate-ecprivatekey-parameters-publickey-expected.txt: Added.
* crypto/subtle/ecdsa-import-pkcs8-key-p384-validate-ecprivatekey-parameters-publickey.html: Added.

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

4 years agoAPI test URLSchemeHandler.Exceptions is Exiting out early on macOS Debug..
beidson@apple.com [Tue, 1 Aug 2017 19:03:59 +0000 (19:03 +0000)]
API test URLSchemeHandler.Exceptions is Exiting out early on macOS Debug..
https://bugs.webkit.org/show_bug.cgi?id=175030

Reviewed by Andy Estes.

Source/WebKit:

* UIProcess/Cocoa/WebURLSchemeHandlerCocoa.mm:
(WebKit::WebURLSchemeHandlerCocoa::platformTaskCompleted): Release the API wrapped on the next
  spin of the runloop.

Tools:

* TestWebKitAPI/Tests/WebKit2Cocoa/WKURLSchemeHandler-1.mm:
(-[TaskSchemeHandler webView:startURLSchemeTask:]): Stop calling an invalid NSError constructor.

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

4 years agoUnreviewed, rolling out r220089.
jlewis3@apple.com [Tue, 1 Aug 2017 18:50:45 +0000 (18:50 +0000)]
Unreviewed, rolling out r220089.

This caused multiple crashes on macOS Debug testers.

Reverted changeset:

"Use LazyNeverDestroyed instead of DEFINE_GLOBAL for
QualifiedName"
https://bugs.webkit.org/show_bug.cgi?id=175010
http://trac.webkit.org/changeset/220089

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

4 years agoPart 2 of: Rename DatabaseProcess to StorageProcess.
beidson@apple.com [Tue, 1 Aug 2017 18:18:03 +0000 (18:18 +0000)]
Part 2 of: Rename DatabaseProcess to StorageProcess.
https://bugs.webkit.org/show_bug.cgi?id=174880

Reviewed by Andy Estes.

Source/WebKit:

Rename some more variables, classes, etc. to reflect the change.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::grantSandboxExtensionsToStorageProcessForBlobs):
(WebKit::NetworkProcess::didGrantSandboxExtensionsToStorageProcessForBlobs):
(WebKit::NetworkProcess::grantSandboxExtensionsToDatabaseProcessForBlobs): Deleted.
(WebKit::NetworkProcess::didGrantSandboxExtensionsToDatabaseProcessForBlobs): Deleted.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:

* Shared/ProcessExecutablePath.h:
* Shared/gtk/ProcessExecutablePathGtk.cpp:
(WebKit::executablePathOfStorageProcess):
(WebKit::executablePathOfDatabaseProcess): Deleted.
* Shared/wpe/ProcessExecutablePathWPE.cpp:
(WebKit::executablePathOfStorageProcess):
(WebKit::executablePathOfDatabaseProcess): Deleted.

* StorageProcess/IndexedDB/WebIDBConnectionToClient.cpp:
(WebKit::WebIDBConnectionToClient::putOrAdd):

* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::initializeWebsiteDataStore):
(WebKit::StorageProcess::postStorageTask):
(WebKit::StorageProcess::performNextStorageTask):
(WebKit::StorageProcess::createStorageToWebProcessConnection):
(WebKit::StorageProcess::fetchWebsiteData):
(WebKit::StorageProcess::postDatabaseTask): Deleted.
(WebKit::StorageProcess::performNextDatabaseTask): Deleted.
(WebKit::StorageProcess::createDatabaseToWebProcessConnection): Deleted.
* StorageProcess/StorageProcess.h:
* StorageProcess/StorageProcess.messages.in:
* StorageProcess/mac/StorageProcessMac.mm:
(WebKit::StorageProcess::initializeProcessName):

* UIProcess/API/C/WKContext.cpp:
(WKContextGetDatabaseProcessIdentifier):

* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _terminateStorageProcess]):
(-[WKProcessPool _storageProcessIdentifier]):
(-[WKProcessPool _terminateDatabaseProcess]): Deleted.
(-[WKProcessPool _databaseProcessIdentifier]): Deleted.
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:

* UIProcess/ChildProcessProxy.cpp:
(WebKit::ChildProcessProxy::getLaunchOptions):

* UIProcess/Launcher/ProcessLauncher.h:
* UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::serviceName):
* UIProcess/Launcher/wpe/ProcessLauncherWPE.cpp:
(WebKit::ProcessLauncher::launchProcess):

* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::grantSandboxExtensionsToStorageProcessForBlobs):
(WebKit::NetworkProcessProxy::grantSandboxExtensionsToDatabaseProcessForBlobs): Deleted.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:

* UIProcess/Storage/StorageProcessProxy.cpp:
(WebKit::StorageProcessProxy::getLaunchOptions):
(WebKit::StorageProcessProxy::getStorageProcessConnection):
(WebKit::StorageProcessProxy::didClose):
(WebKit::StorageProcessProxy::didCreateStorageToWebProcessConnection):
(WebKit::StorageProcessProxy::didFinishLaunching):
(WebKit::StorageProcessProxy::getDatabaseProcessConnection): Deleted.
(WebKit::StorageProcessProxy::didCreateDatabaseToWebProcessConnection): Deleted.
* UIProcess/Storage/StorageProcessProxy.h:
* UIProcess/Storage/StorageProcessProxy.messages.in:

* UIProcess/WebContextClient.cpp:
(WebKit::WebContextClient::storageProcessDidCrash):
(WebKit::WebContextClient::databaseProcessDidCrash): Deleted.
* UIProcess/WebContextClient.h:

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
(WebKit::WebProcessPool::getStorageProcessConnection):
(WebKit::WebProcessPool::storageProcessCrashed):
(WebKit::WebProcessPool::pageAddedToProcess):
(WebKit::WebProcessPool::storageProcessIdentifier):
(WebKit::WebProcessPool::terminateStorageProcess):
(WebKit::WebProcessPool::ensureDatabaseProcessAndWebsiteDataStore): Deleted.
(WebKit::WebProcessPool::getDatabaseProcessConnection): Deleted.
(WebKit::WebProcessPool::databaseProcessCrashed): Deleted.
(WebKit::WebProcessPool::databaseProcessIdentifier): Deleted.
(WebKit::WebProcessPool::terminateDatabaseProcess): Deleted.
* UIProcess/WebProcessPool.h:
(WebKit::WebProcessPool::sendToStorageProcessRelaunchingIfNecessary):
(WebKit::WebProcessPool::sendToDatabaseProcessRelaunchingIfNecessary): Deleted.

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::getStorageProcessConnection):
(WebKit::WebProcessProxy::getDatabaseProcessConnection): Deleted.
* UIProcess/WebProcessProxy.h:
* UIProcess/WebProcessProxy.messages.in:

* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::fetchDataAndApply):
(WebKit::WebsiteDataStore::removeData):
(WebKit::WebsiteDataStore::storageProcessParameters):
(WebKit::WebsiteDataStore::databaseProcessParameters): Deleted.
* UIProcess/WebsiteData/WebsiteDataStore.h:

* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::messageSenderConnection):
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:

* WebProcess/Databases/WebDatabaseProvider.cpp:
(WebKit::WebDatabaseProvider::idbConnectionToServerForSession):

* WebProcess/Storage/WebToStorageProcessConnection.cpp:
(WebKit::WebToStorageProcessConnection::WebToStorageProcessConnection):
(WebKit::WebToStorageProcessConnection::~WebToStorageProcessConnection):
(WebKit::WebToStorageProcessConnection::didReceiveMessage):
(WebKit::WebToStorageProcessConnection::didClose):
(WebKit::WebToStorageProcessConnection::didReceiveInvalidMessage):
(WebKit::WebToStorageProcessConnection::idbConnectionToServerForSession):
(WebKit::WebToDatabaseProcessConnection::WebToDatabaseProcessConnection): Deleted.
(WebKit::WebToDatabaseProcessConnection::~WebToDatabaseProcessConnection): Deleted.
(WebKit::WebToDatabaseProcessConnection::didReceiveMessage): Deleted.
(WebKit::WebToDatabaseProcessConnection::didClose): Deleted.
(WebKit::WebToDatabaseProcessConnection::didReceiveInvalidMessage): Deleted.
(WebKit::WebToDatabaseProcessConnection::idbConnectionToServerForSession): Deleted.
* WebProcess/Storage/WebToStorageProcessConnection.h:
(WebKit::WebToStorageProcessConnection::create):
(WebKit::WebToDatabaseProcessConnection::create): Deleted.
(WebKit::WebToDatabaseProcessConnection::connection): Deleted.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::webToStorageProcessConnectionClosed):
(WebKit::WebProcess::webToStorageProcessConnection):
(WebKit::WebProcess::ensureWebToStorageProcessConnection):
(WebKit::WebProcess::webToDatabaseProcessConnectionClosed): Deleted.
(WebKit::WebProcess::webToDatabaseProcessConnection): Deleted.
(WebKit::WebProcess::ensureWebToDatabaseProcessConnection): Deleted.
* WebProcess/WebProcess.h:

Tools:

* TestWebKitAPI/Tests/WebKit2Cocoa/IDBDeleteRecovery.mm:
* TestWebKitAPI/Tests/WebKit2Cocoa/IDBIndexUpgradeToV2.mm:
* TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBDatabaseProcessKill.mm:
* TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBMultiProcess.mm:
* TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBPersistence.mm:
* TestWebKitAPI/Tests/WebKit2Cocoa/ResourceLoadStatistics.mm:
* TestWebKitAPI/Tests/WebKit2Cocoa/WebProcessKillIDBCleanup.mm:
* TestWebKitAPI/Tests/WebKit2Cocoa/WebsiteDataStoreCustomPaths.mm:

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

4 years ago[GTK] Layout test fast/forms/content-with-margins-inside-button.html is failing
commit-queue@webkit.org [Tue, 1 Aug 2017 16:42:18 +0000 (16:42 +0000)]
[GTK] Layout test fast/forms/content-with-margins-inside-button.html is failing
https://bugs.webkit.org/show_bug.cgi?id=174610

Patch by Ms2ger <Ms2ger@igalia.com> on 2017-08-01
Reviewed by Darin Adler.

Use an explicit text color for content-with-margins-inside-button.html.

This makes the test pass in the GTK port.

I also changed the formatting of the CSS to make it more readable.

* fast/forms/content-with-margins-inside-button-expected.html:
* fast/forms/content-with-margins-inside-button.html:
* platform/gtk/TestExpectations:

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

4 years agoRemove obsolete failure expectations for wpt XHR tests.
commit-queue@webkit.org [Tue, 1 Aug 2017 16:24:20 +0000 (16:24 +0000)]
Remove obsolete failure expectations for wpt XHR tests.
https://bugs.webkit.org/show_bug.cgi?id=175024

Patch by Ms2ger <Ms2ger@igalia.com> on 2017-08-01
Reviewed by Darin Adler.

* TestExpectations:
* platform/gtk/TestExpectations:

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

4 years agoRemove obsolete failure expectations for style-01.html.
commit-queue@webkit.org [Tue, 1 Aug 2017 16:22:25 +0000 (16:22 +0000)]
Remove obsolete failure expectations for style-01.html.
https://bugs.webkit.org/show_bug.cgi?id=175026

Patch by Ms2ger <Ms2ger@igalia.com> on 2017-08-01
Reviewed by Darin Adler.

* TestExpectations:

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

4 years agoRemove obsolete failure expectation for Document-characterSet-normalization.html.
commit-queue@webkit.org [Tue, 1 Aug 2017 16:20:34 +0000 (16:20 +0000)]
Remove obsolete failure expectation for Document-characterSet-normalization.html.
https://bugs.webkit.org/show_bug.cgi?id=175022

Patch by Ms2ger <Ms2ger@igalia.com> on 2017-08-01
Reviewed by Sam Weinig.

The expectations were updated in r204605.

* platform/gtk/TestExpectations:

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

4 years agoRemove obsolete failure expectation for regional-indicators.html.
commit-queue@webkit.org [Tue, 1 Aug 2017 16:18:43 +0000 (16:18 +0000)]
Remove obsolete failure expectation for regional-indicators.html.
https://bugs.webkit.org/show_bug.cgi?id=175021

Patch by Ms2ger <Ms2ger@igalia.com> on 2017-08-01
Reviewed by Sam Weinig.

* platform/gtk/TestExpectations:

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

4 years agoREGRESSION(r205909): Layout test editing/pasteboard/image-in-iframe.html is failing
commit-queue@webkit.org [Tue, 1 Aug 2017 16:16:26 +0000 (16:16 +0000)]
REGRESSION(r205909): Layout test editing/pasteboard/image-in-iframe.html is failing
https://bugs.webkit.org/show_bug.cgi?id=163185

Patch by Ms2ger <Ms2ger@igalia.com> on 2017-08-01
Reviewed by Sam Weinig.

Remove obsolete failure expectation for image-in-iframe.html.

The bug was fixed in r212428. (The test was also broken by both landings for
bug 170956, until r216174 fixed it again.)

* platform/gtk/TestExpectations:

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

4 years agoREGRESSION (r220052): http/tests/media/video-play-stall.html times out
darin@apple.com [Tue, 1 Aug 2017 16:13:55 +0000 (16:13 +0000)]
REGRESSION (r220052): http/tests/media/video-play-stall.html times out
https://bugs.webkit.org/show_bug.cgi?id=174988

Reviewed by Sam Weinig.

* TestExpectations: Stop skipping this test.

* http/tests/media/video-play-stall.html: Use a 0-duration timeout to sidestep an
issue where the test runner never thinks the test is done because of the stalled
media loading, and times out. The behaviors here aren't great, but there is no
reason to think that this confused state has any effect on web browsing; just on
our test runners in a test that intentionally has a still loading video in it.

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

4 years agoImplement __builtin_clzl for MSVC
commit-queue@webkit.org [Tue, 1 Aug 2017 15:56:20 +0000 (15:56 +0000)]
Implement __builtin_clzl for MSVC
https://bugs.webkit.org/show_bug.cgi?id=174232

Patch by Daewoong Jang <daewoong.jang@navercorp.com> on 2017-08-01
Reviewed by Geoffrey Garen.

* bmalloc/Algorithm.h:
(bmalloc::clzl):
(bmalloc::clzl<1>):
(bmalloc::__builtin_clzl):
* bmalloc/BPlatform.h:

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

4 years ago[JSC] Remove unnecessary print from stress\promise-finally.js test
gskachkov@gmail.com [Tue, 1 Aug 2017 14:32:36 +0000 (14:32 +0000)]
[JSC] Remove unnecessary print from stress\promise-finally.js test
https://bugs.webkit.org/show_bug.cgi?id=175015

Reviewed by Yusuke Suzuki.

* stress/promise-finally.js:
(p.finally):
(then):

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

4 years ago[WebIDL] Swap a custom attribute for a custom mark function for HTMLTemplateElement
commit-queue@webkit.org [Tue, 1 Aug 2017 14:23:29 +0000 (14:23 +0000)]
[WebIDL] Swap a custom attribute for a custom mark function for HTMLTemplateElement
https://bugs.webkit.org/show_bug.cgi?id=175006

Patch by Sam Weinig <sam@webkit.org> on 2017-08-01
Reviewed by Chris Dumez.

Use the standard way of augmenting GC, visitAdditionalChildren, rather
than using a private name to create ownership.

* bindings/js/JSHTMLTemplateElementCustom.cpp:
(WebCore::JSHTMLTemplateElement::visitAdditionalChildren):
(WebCore::JSHTMLTemplateElement::content const): Deleted.
* html/HTMLTemplateElement.idl:

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

4 years agoPart 1 of: Rename DatabaseProcess to StorageProcess.
beidson@apple.com [Tue, 1 Aug 2017 14:19:31 +0000 (14:19 +0000)]
Part 1 of: Rename DatabaseProcess to StorageProcess.
https://bugs.webkit.org/show_bug.cgi?id=174879

Reviewed by Andy Estes.

.:

* Source/cmake/OptionsWPE.cmake:
* Source/cmake/gtksymbols.filter:

Source/WebKit:

This patch is all about renaming source files and renaming the process itself (touching build system files, etc etc).

Some renaming in actual code did result (Some class/struct names, method names, etc)

Part 2 (174880) will go through and update all references in code itself from "Database" to "Storage"

* CMakeLists.txt:
* DerivedSources.make:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* PlatformWPE.cmake:
* WebKit.xcodeproj/project.pbxproj:

* Configurations/StorageService.xcconfig: Renamed from Source/WebKit/Configurations/DatabaseService.xcconfig.
* StorageProcess/EntryPoint/mac/XPCService/StorageService/Info.plist: Renamed from Source/WebKit/DatabaseProcess/EntryPoint/mac/XPCService/DatabaseService/Info.plist.
* StorageProcess/mac/com.apple.WebKit.Databases.sb.in: Renamed from Source/WebKit/DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in.

* Shared/Storage/StorageProcessCreationParameters.cpp: Renamed from Source/WebKit/Shared/Databases/DatabaseProcessCreationParameters.cpp.
* Shared/Storage/StorageProcessCreationParameters.h: Renamed from Source/WebKit/Shared/Databases/DatabaseProcessCreationParameters.h.

* StorageProcess/EntryPoint/mac/XPCService/StorageServiceEntryPoint.mm: Renamed from Source/WebKit/DatabaseProcess/EntryPoint/mac/XPCService/DatabaseServiceEntryPoint.mm.
* StorageProcess/EntryPoint/unix/StorageProcessMain.cpp: Renamed from Source/WebKit/DatabaseProcess/EntryPoint/unix/DatabaseProcessMain.cpp.

* StorageProcess/IndexedDB/WebIDBConnectionToClient.cpp: Renamed from Source/WebKit/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp.
* StorageProcess/IndexedDB/WebIDBConnectionToClient.h: Renamed from Source/WebKit/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h.
* StorageProcess/IndexedDB/WebIDBConnectionToClient.messages.in: Renamed from Source/WebKit/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in.

* StorageProcess/StorageProcess.cpp: Renamed from Source/WebKit/DatabaseProcess/DatabaseProcess.cpp.
* StorageProcess/StorageProcess.h: Renamed from Source/WebKit/DatabaseProcess/DatabaseProcess.h.
* StorageProcess/StorageProcess.messages.in: Renamed from Source/WebKit/DatabaseProcess/DatabaseProcess.messages.in.

* StorageProcess/StorageToWebProcessConnection.cpp: Renamed from Source/WebKit/DatabaseProcess/DatabaseToWebProcessConnection.cpp.
* StorageProcess/StorageToWebProcessConnection.h: Renamed from Source/WebKit/DatabaseProcess/DatabaseToWebProcessConnection.h.
* StorageProcess/StorageToWebProcessConnection.messages.in: Renamed from Source/WebKit/DatabaseProcess/DatabaseToWebProcessConnection.messages.in.

* StorageProcess/gtk/StorageProcessMainGtk.cpp: Renamed from Source/WebKit/DatabaseProcess/gtk/DatabaseProcessMainGtk.cpp.
* StorageProcess/ios/StorageProcessIOS.mm: Renamed from Source/WebKit/DatabaseProcess/ios/DatabaseProcessIOS.mm.
* StorageProcess/mac/StorageProcessMac.mm: Renamed from Source/WebKit/DatabaseProcess/mac/DatabaseProcessMac.mm.
* StorageProcess/unix/StorageProcessMainUnix.h: Renamed from Source/WebKit/DatabaseProcess/unix/DatabaseProcessMainUnix.h.
* UIProcess/Network/NetworkProcessProxy.cpp:

* UIProcess/Storage/StorageProcessProxy.cpp: Renamed from Source/WebKit/UIProcess/Databases/DatabaseProcessProxy.cpp.
* UIProcess/Storage/StorageProcessProxy.h: Renamed from Source/WebKit/UIProcess/Databases/DatabaseProcessProxy.h.
* UIProcess/Storage/StorageProcessProxy.messages.in: Renamed from Source/WebKit/UIProcess/Databases/DatabaseProcessProxy.messages.in.

* UIProcess/WebContextSupplement.h:
* UIProcess/WebProcessPool.cpp:
* UIProcess/WebProcessPool.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
* UIProcess/WebsiteData/WebsiteDataStore.h:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
* WebProcess/Databases/WebDatabaseProvider.cpp:

* WebProcess/Storage/WebToStorageProcessConnection.cpp: Renamed from Source/WebKit/WebProcess/Databases/WebToDatabaseProcessConnection.cpp.
* WebProcess/Storage/WebToStorageProcessConnection.h: Renamed from Source/WebKit/WebProcess/Databases/WebToDatabaseProcessConnection.h.

* WebProcess/WebProcess.cpp:

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

4 years agoCorrect the line numbers in GTK's scheme-about.any-expected.txt.
commit-queue@webkit.org [Tue, 1 Aug 2017 13:13:43 +0000 (13:13 +0000)]
Correct the line numbers in GTK's scheme-about.any-expected.txt.
https://bugs.webkit.org/show_bug.cgi?id=175017

Patch by Ms2ger <Ms2ger@igalia.com> on 2017-08-01
Reviewed by Sam Weinig.

The code fix landed in r220050.

* platform/gtk/imported/w3c/web-platform-tests/fetch/api/basic/scheme-about.any-expected.txt:

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