WebKit-https.git
3 years ago[Extra zoom mode] Add an SPI hook for clients to opt in to focus overlay UI
wenson_hsieh@apple.com [Mon, 9 Apr 2018 15:50:47 +0000 (15:50 +0000)]
[Extra zoom mode] Add an SPI hook for clients to opt in to focus overlay UI
https://bugs.webkit.org/show_bug.cgi?id=184370
<rdar://problem/39250494>

Reviewed by Timothy Hatcher and Andy Estes.

Add a new SPI hook for internal clients to opt in to showing the focused form control overlay. By default, the
overlay is not shown.

* UIProcess/API/Cocoa/_WKInputDelegate.h:

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

3 years ago[WPE] Use GNU install directories
mcatanzaro@igalia.com [Mon, 9 Apr 2018 15:45:48 +0000 (15:45 +0000)]
[WPE] Use GNU install directories
https://bugs.webkit.org/show_bug.cgi?id=184377

Reviewed by Carlos Garcia Campos.

.:

Notably, this means all the CMake arguments that distributors use to customize install
directories (-DCMAKE_INSTALL_*DIR) will no longer be ignored.

* Source/cmake/OptionsCommon.cmake:
* Source/cmake/OptionsWPE.cmake:

Source/WebKit:

Merge ProcessExecutablePathGtk and ProcessExecutablePathWPE into ProcessExecutablePathGLib.
WPE will now load its secondary processes from PKGLIBEXECDIR, like WebKitGTK+.

* PlatformWPE.cmake:
* Shared/glib/ProcessExecutablePathGLib.cpp: Renamed from Source/WebKit/Shared/gtk/ProcessExecutablePathGtk.cpp.
(WebKit::getExecutablePath):
(WebKit::findWebKitProcess):
(WebKit::executablePathOfWebProcess):
(WebKit::executablePathOfPluginProcess):
(WebKit::executablePathOfNetworkProcess):
(WebKit::executablePathOfStorageProcess):
* Shared/wpe/ProcessExecutablePathWPE.cpp: Removed.
* SourcesGTK.txt:
* SourcesWPE.txt:

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

3 years ago[OpenVR][WebVR] Retrieve FrameData in WebVR's rAF
svillar@igalia.com [Mon, 9 Apr 2018 14:40:51 +0000 (14:40 +0000)]
[OpenVR][WebVR] Retrieve FrameData in WebVR's rAF
https://bugs.webkit.org/show_bug.cgi?id=184265

Reviewed by Žan Doberšek.

VRFrameData contains all the required information to properly render a VR scene like view
and projection matrices, pose data (position & orientation) and linear & angular velocity
among others. The getFrameData() call must be issued inside a WebVR's own
requestAnimationFrame.

* Modules/webvr/VRDisplay.cpp:
(WebCore::VRDisplay::getFrameData const):
(WebCore::VRDisplay::getPose const):
(WebCore::VRDisplay::requestAnimationFrame):
(WebCore::VRDisplay::cancelAnimationFrame):
* Modules/webvr/VRDisplay.h:
* Modules/webvr/VREyeParameters.h:
(WebCore::VREyeParameters::rawOffset const): Required to compute view matrices.
* Modules/webvr/VRFrameData.cpp:
(WebCore::matrixToArray):
(WebCore::VRFrameData::leftProjectionMatrix const):
(WebCore::VRFrameData::leftViewMatrix const):
(WebCore::VRFrameData::rightProjectionMatrix const):
(WebCore::VRFrameData::rightViewMatrix const):
(WebCore::projectionMatrixFromFieldOfView):
(WebCore::rotationMatrixFromQuaternion):
(WebCore::applyHeadToEyeTransform):
(WebCore::VRFrameData::update):
(WebCore::VRFrameData::timestamp const): Deleted.
* Modules/webvr/VRFrameData.h:
(WebCore::VRFrameData::timestamp const):
* Modules/webvr/VRPose.cpp:
(WebCore::optionalFloat3ToJSCArray):
(WebCore::VRPose::position const):
(WebCore::VRPose::linearVelocity const):
(WebCore::VRPose::linearAcceleration const):
(WebCore::VRPose::orientation const):
(WebCore::VRPose::angularVelocity const):
(WebCore::VRPose::angularAcceleration const):
* Modules/webvr/VRPose.h:
(WebCore::VRPose::create):
(WebCore::VRPose::update):
(WebCore::VRPose::VRPose):
* platform/vr/VRPlatformDisplay.h:
(WebCore::VRPlatformTrackingInfo::Quaternion::Quaternion):
(WebCore::VRPlatformTrackingInfo::Quaternion::conjugate):
(WebCore::VRPlatformTrackingInfo::Quaternion::operator*):
(WebCore::VRPlatformTrackingInfo::Float3::Float3): Just a group of 3 floats used to store
both velocity and acceleration in a format which is very convenient to later generate JSC
arrays.
(WebCore::VRPlatformTrackingInfo::clear):
* platform/vr/openvr/VRPlatformDisplayOpenVR.cpp:
(WebCore::VRPlatformDisplayOpenVR::VRPlatformDisplayOpenVR):
(WebCore::rotationMatrixToQuaternion):
(WebCore::VRPlatformDisplayOpenVR::getTrackingInfo):
* platform/vr/openvr/VRPlatformDisplayOpenVR.h:

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

3 years agoUnreviewed, attempt to fix Windows build
utatane.tea@gmail.com [Mon, 9 Apr 2018 11:28:02 +0000 (11:28 +0000)]
Unreviewed, attempt to fix Windows build
https://bugs.webkit.org/show_bug.cgi?id=183508

* jit/JIT.h:

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

3 years agoUnreviewed follow-up to r230389.
zandobersek@gmail.com [Mon, 9 Apr 2018 08:08:50 +0000 (08:08 +0000)]
Unreviewed follow-up to r230389.

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::platformAdjustContext): Use the 'ServiceWorkers'
subdirectory for the temporary testing-purpose SW registration directory
like it's used in Cocoa's TestController, addressing the review comment
that I forgot about.

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

3 years ago[GTK] WaylandCompositorDisplay leaks its wl_display
mcatanzaro@igalia.com [Mon, 9 Apr 2018 07:14:15 +0000 (07:14 +0000)]
[GTK] WaylandCompositorDisplay leaks its wl_display
https://bugs.webkit.org/show_bug.cgi?id=184406

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Remove the protected default constructor, for good measure.

* platform/graphics/wayland/PlatformDisplayWayland.h:

Source/WebKit:

* WebProcess/gtk/WaylandCompositorDisplay.cpp:
(WebKit::WaylandCompositorDisplay::create): Fix a log message (drive-by).
(WebKit::WaylandCompositorDisplay::WaylandCompositorDisplay): Fix the leak.

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

3 years agoNon-Cocoa ports use default directory for ServiceWorker data during testing
zandobersek@gmail.com [Mon, 9 Apr 2018 06:31:05 +0000 (06:31 +0000)]
Non-Cocoa ports use default directory for ServiceWorker data during testing
https://bugs.webkit.org/show_bug.cgi?id=183784

Reviewed by Youenn Fablet.

Source/WebKit:

Add API to WKWebsiteDataStore that enables setting and retrieving the
service worker registration directory for a given data store object.
This enables setting the temporary directory for testing purposes in
WebKitTestRunner.

* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreCopyServiceWorkerRegistrationDirectory):
(WKWebsiteDataStoreSetServiceWorkerRegistrationDirectory):
* UIProcess/API/C/WKWebsiteDataStoreRef.h:

Tools:

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::platformAdjustContext): Set the service worker registration
directory through the new WKWebsiteDataStore API for non-Cocoa ports.

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

3 years agoUnreviewed, build fix for Windows by suppressing padding warning for JIT
utatane.tea@gmail.com [Mon, 9 Apr 2018 04:55:23 +0000 (04:55 +0000)]
Unreviewed, build fix for Windows by suppressing padding warning for JIT
https://bugs.webkit.org/show_bug.cgi?id=183508

* jit/JIT.h:

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

3 years agoUnreviewed, remove incorrect entry in test262.yaml
utatane.tea@gmail.com [Mon, 9 Apr 2018 04:41:17 +0000 (04:41 +0000)]
Unreviewed, remove incorrect entry in test262.yaml
https://bugs.webkit.org/show_bug.cgi?id=184266

* test262.yaml:

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

3 years ago[LayoutReloaded] Adjust line with inline container's margin border and padding
zalan@apple.com [Mon, 9 Apr 2018 03:59:10 +0000 (03:59 +0000)]
[LayoutReloaded] Adjust line with inline container's margin border and padding
https://bugs.webkit.org/show_bug.cgi?id=184409

Reviewed by Antti Koivisto.

* LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js:
(InlineFormattingContext.prototype.layout):
(InlineFormattingContext.prototype._handleFloatingBox):
(InlineFormattingContext.prototype._adjustLineForInlineContainerStart):
(InlineFormattingContext.prototype._adjustLineForInlineContainerEnd):
* LayoutReloaded/FormattingContext/InlineFormatting/Line.js:
(Line.prototype.shrink):
(Line.prototype.adjustWithOffset):
(Line.prototype.moveContentHorizontally):
(Line.prototype.addTextLineBox):
(Line):
(Line.prototype.addFloatingBox): Deleted.
* LayoutReloaded/misc/LayoutReloadedWebKit.patch:
* LayoutReloaded/test/index.html:
* LayoutReloaded/test/inline-with-padding-border-margin-offsets.html: Added.

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

3 years ago[CMake] WebKit should link to WebCore as a PRIVATE library if WebCore is a static...
Hironori.Fujii@sony.com [Mon, 9 Apr 2018 02:58:40 +0000 (02:58 +0000)]
[CMake] WebKit should link to WebCore as a PRIVATE library if WebCore is a static library
https://bugs.webkit.org/show_bug.cgi?id=184127

Reviewed by Konstantin Tokarev.

.:

Building TestWebKitLib on Windows causes a linkage error of
multiply defined symbols because TestWebKitLib links to
both WebCore and WebKit. TestWebKitLib explicitly links only with
WebKit, But, WebCore is propagated because WebKit links WebCore as
public.

* Source/cmake/OptionsGTK.cmake (ADD_WHOLE_ARCHIVE_TO_LIBRARIES):
Do not wrap PRIVATE and PUBLIC keywords with -Wl,--whole-archive.

Source/WebCore:

No new tests (No behaviour changes).

* CMakeLists.txt: Added a interface library WebCoreHeaderInterface.

Source/WebKit:

* CMakeLists.txt: Link with WebCore as private,
WebCoreHeaderInterface as public to WebKit if WebCore is a static
library.
* CMakeLists.txt:
* PlatformGTK.cmake: Added PRIVATE keyword for WebKit_LIBRARIES.
* PlatformWPE.cmake: Ditto.
* PlatformWin.cmake: Ditto.

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

3 years agoUpdated Czech translation
mcatanzaro@igalia.com [Mon, 9 Apr 2018 02:10:01 +0000 (02:10 +0000)]
Updated Czech translation
https://bugs.webkit.org/show_bug.cgi?id=184403

Patch by Daniel Rusek <mail@asciiwolf.com> on 2018-04-08
Rubber-stamped by Michael Catanzaro.

* cs.po:

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

3 years ago[iOS] WKContentView and WKLegacyPDFView should share application state tracking logic
aestes@apple.com [Mon, 9 Apr 2018 01:48:31 +0000 (01:48 +0000)]
[iOS] WKContentView and WKLegacyPDFView should share application state tracking logic
https://bugs.webkit.org/show_bug.cgi?id=184402

Reviewed by Dan Bernstein.

WKContentView and WKLegacyPDFView have nearly identical logic for tracking
application foreground state. Let's share it so we can more easily create new
content views with proper application state tracking.

* UIProcess/ios/WKApplicationStateTrackingView.h: Added.
* UIProcess/ios/WKApplicationStateTrackingView.mm: Added.
(-[WKApplicationStateTrackingView initWithFrame:webView:]):
(-[WKApplicationStateTrackingView willMoveToWindow:]):
(-[WKApplicationStateTrackingView didMoveToWindow]):
(-[WKApplicationStateTrackingView _applicationDidEnterBackground]):
(-[WKApplicationStateTrackingView _applicationDidCreateWindowContext]):
(-[WKApplicationStateTrackingView _applicationDidFinishSnapshottingAfterEnteringBackground]):
(-[WKApplicationStateTrackingView _applicationWillEnterForeground]):
(-[WKApplicationStateTrackingView isBackground]):

Moved common logic from WKContentView and WKLegacyPDFView into
WKApplicationStateTrackingView.

* UIProcess/ios/WKContentView.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView initWithFrame:processPool:configuration:webView:]):
(-[WKContentView willMoveToWindow:]):
(-[WKContentView _applicationDidCreateWindowContext]):
(-[WKContentView didMoveToWindow]): Deleted.
(-[WKContentView isBackground]): Deleted.
(-[WKContentView _applicationDidEnterBackground]): Deleted.
(-[WKContentView _applicationDidFinishSnapshottingAfterEnteringBackground]): Deleted.
(-[WKContentView _applicationWillEnterForeground]): Deleted.

Made WKContentView a subclass of WKApplicationStateTrackingView.

* UIProcess/ios/WKLegacyPDFView.h:
* UIProcess/ios/WKLegacyPDFView.mm:
(-[WKLegacyPDFView web_initWithFrame:webView:]):
(-[WKLegacyPDFView web_isBackground]):
(-[WKLegacyPDFView _applicationWillEnterForeground]):
(-[WKLegacyPDFView willMoveToWindow:]): Deleted.
(-[WKLegacyPDFView didMoveToWindow]): Deleted.
(-[WKLegacyPDFView _applicationDidEnterBackground]): Deleted.
(-[WKLegacyPDFView _applicationDidCreateWindowContext]): Deleted.
(-[WKLegacyPDFView _applicationDidFinishSnapshottingAfterEnteringBackground]): Deleted.

Made WKLegacyPDFView a subclass of WKApplicationStateTrackingView.

* WebKit.xcodeproj/project.pbxproj:

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

3 years ago[JSC] Update Test262 to April 6 version
commit-queue@webkit.org [Sun, 8 Apr 2018 22:52:21 +0000 (22:52 +0000)]
[JSC] Update Test262 to April 6 version
https://bugs.webkit.org/show_bug.cgi?id=184266

Patch by Valerie Young <valerie@bocoup.com> on 2018-04-08
Rubber stamped by Yusuke Suzuki.

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

3 years agoUnreviewed, use alignas(void*)
utatane.tea@gmail.com [Sun, 8 Apr 2018 21:38:24 +0000 (21:38 +0000)]
Unreviewed, use alignas(void*)
https://bugs.webkit.org/show_bug.cgi?id=183508

Very large alignment is not supported in MSVC.

* wtf/Gigacage.cpp:
* wtf/Gigacage.h:

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

3 years agoUse alignas instead of compiler-specific attributes
utatane.tea@gmail.com [Sun, 8 Apr 2018 21:30:03 +0000 (21:30 +0000)]
Use alignas instead of compiler-specific attributes
https://bugs.webkit.org/show_bug.cgi?id=183508

Reviewed by Mark Lam.

Source/bmalloc:

Use alignas for g_gigacageBasePtr. We also add reinterpret_cast to fix
compile errors in ARMv7 and MIPS JSCOnly ports.

* bmalloc/Gigacage.cpp:
* bmalloc/Gigacage.h:
(Gigacage::basePtrs):

Source/JavaScriptCore:

Use C++11 alignas specifier. It is portable compared to compiler-specific aligned attributes.

* heap/RegisterState.h:
* jit/JIT.h:
(JSC::JIT::compile): Deleted.
(JSC::JIT::compileGetByVal): Deleted.
(JSC::JIT::compileGetByValWithCachedId): Deleted.
(JSC::JIT::compilePutByVal): Deleted.
(JSC::JIT::compileDirectPutByVal): Deleted.
(JSC::JIT::compilePutByValWithCachedId): Deleted.
(JSC::JIT::compileHasIndexedProperty): Deleted.
(JSC::JIT::appendCall): Deleted.
(JSC::JIT::appendCallWithSlowPathReturnType): Deleted.
(JSC::JIT::exceptionCheck): Deleted.
(JSC::JIT::exceptionCheckWithCallFrameRollback): Deleted.
(JSC::JIT::emitInt32Load): Deleted.
(JSC::JIT::emitInt32GetByVal): Deleted.
(JSC::JIT::emitInt32PutByVal): Deleted.
(JSC::JIT::emitDoublePutByVal): Deleted.
(JSC::JIT::emitContiguousPutByVal): Deleted.
(JSC::JIT::emitStoreCell): Deleted.
(JSC::JIT::getSlowCase): Deleted.
(JSC::JIT::linkSlowCase): Deleted.
(JSC::JIT::linkDummySlowCase): Deleted.
(JSC::JIT::linkAllSlowCases): Deleted.
(JSC::JIT::callOperation): Deleted.
(JSC::JIT::callOperationWithProfile): Deleted.
(JSC::JIT::callOperationWithResult): Deleted.
(JSC::JIT::callOperationNoExceptionCheck): Deleted.
(JSC::JIT::callOperationWithCallFrameRollbackOnException): Deleted.
(JSC::JIT::emitEnterOptimizationCheck): Deleted.
(JSC::JIT::sampleCodeBlock): Deleted.
(JSC::JIT::canBeOptimized): Deleted.
(JSC::JIT::canBeOptimizedOrInlined): Deleted.
(JSC::JIT::shouldEmitProfiling): Deleted.
* runtime/VM.h:

Source/WebCore:

Use alignas instead of aligned.

* platform/graphics/cpu/arm/filters/FELightingNEON.cpp:
* platform/graphics/cpu/arm/filters/FELightingNEON.h:
(WebCore::FELighting::platformApplyNeon):

Source/WTF:

Use alignas for g_gigacageBasePtr. We also add reinterpret_cast to fix
compile errors in ARMv7 and MIPS JSCOnly ports.

* wtf/Gigacage.cpp:
* wtf/Gigacage.h:
(Gigacage::basePtrs):

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

3 years agoUnreviewed, follow-up patch for DFG 32bit
utatane.tea@gmail.com [Sun, 8 Apr 2018 19:59:53 +0000 (19:59 +0000)]
Unreviewed, follow-up patch for DFG 32bit
https://bugs.webkit.org/show_bug.cgi?id=183970

* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::cachedGetById):

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

3 years ago[Cocoa] Keep library validation disabled for WebContent.Development
mitz@apple.com [Sun, 8 Apr 2018 18:07:09 +0000 (18:07 +0000)]
[Cocoa] Keep library validation disabled for WebContent.Development
https://bugs.webkit.org/show_bug.cgi?id=184393

Reviewed by Anders Carlsson.

* Configurations/WebContent.Development.entitlements: Added. Includes the
  com.apple.security.cs.disable-library-validation entitlement set to true.
* Configurations/WebContentService.Development.xcconfig: Set CODE_SIGN_ENTITLEMENTS to the
  above.
* WebKit.xcodeproj/project.pbxproj: Added reference to new file.

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

3 years ago[JSC] Fix incorrect assertion for VM's regexp buffer lock
utatane.tea@gmail.com [Sun, 8 Apr 2018 16:47:21 +0000 (16:47 +0000)]
[JSC] Fix incorrect assertion for VM's regexp buffer lock
https://bugs.webkit.org/show_bug.cgi?id=184398

Reviewed by Mark Lam.

isLocked check before taking a lock is incorrect.

* runtime/VM.cpp:
(JSC::VM::acquireRegExpPatternContexBuffer):

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

3 years ago[JSC] Introduce op_get_by_id_direct
utatane.tea@gmail.com [Sun, 8 Apr 2018 16:21:38 +0000 (16:21 +0000)]
[JSC] Introduce op_get_by_id_direct
https://bugs.webkit.org/show_bug.cgi?id=183970

Reviewed by Filip Pizlo.

JSTests:

* stress/generator-prototype-copy.js: Added.
(gen):
(catch):
Adopted JF's tests.

* stress/generator-type-check.js: Added.
(shouldThrow):
(foo2):
(i.shouldThrow):
* stress/get-by-id-direct-getter.js: Added.
(shouldBe):
(shouldThrow):
(obj.get hello):
(builtin.createBuiltin):
(obj2.get length):
* stress/get-by-id-direct.js: Added.
(shouldBe):
(shouldThrow):
(builtin.createBuiltin):
* test262.yaml:
We fixed long-standing spec compatibility issue.
As a result, this patch makes several test262 tests passed!

Source/JavaScriptCore:

This patch introduces op_get_by_id_direct bytecode. This is super similar to op_get_by_id.
But it just performs [[GetOwnProperty]] operation instead of [[Get]]. We support this
in all the tiers, so using this opcode does not lead to inefficiency.

Main purpose of this op_get_by_id_direct is using it for private properties. We are using
properties indexed with private symbols to implement ECMAScript internal fields. Before this
patch, we just use get and put operations. However, it is not the correct semantics: accessing
to the internal fields should not traverse prototype chain, which is specified in the spec.
We use op_get_by_id_direct to access to properties which are used internal fields, so that
prototype chains are not traversed.

To emit op_get_by_id_direct, we introduce a new bytecode intrinsic @getByIdDirectPrivate().
When you write `@getByIdDirectPrivate(object, "name")`, the bytecode generator emits the
bytecode `op_get_by_id_direct, object, @name`.

* builtins/ArrayIteratorPrototype.js:
(next):
(globalPrivate.arrayIteratorValueNext):
(globalPrivate.arrayIteratorKeyNext):
(globalPrivate.arrayIteratorKeyValueNext):
* builtins/AsyncFromSyncIteratorPrototype.js:
* builtins/AsyncFunctionPrototype.js:
(globalPrivate.asyncFunctionResume):
* builtins/AsyncGeneratorPrototype.js:
(globalPrivate.asyncGeneratorQueueIsEmpty):
(globalPrivate.asyncGeneratorQueueEnqueue):
(globalPrivate.asyncGeneratorQueueDequeue):
(globalPrivate.asyncGeneratorDequeue):
(globalPrivate.isExecutionState):
(globalPrivate.isSuspendYieldState):
(globalPrivate.asyncGeneratorReject):
(globalPrivate.asyncGeneratorResolve):
(globalPrivate.doAsyncGeneratorBodyCall):
(globalPrivate.asyncGeneratorEnqueue):
* builtins/GeneratorPrototype.js:
(globalPrivate.generatorResume):
(next):
(return):
(throw):
* builtins/MapIteratorPrototype.js:
(next):
* builtins/PromiseOperations.js:
(globalPrivate.isPromise):
(globalPrivate.rejectPromise):
(globalPrivate.fulfillPromise):
* builtins/PromisePrototype.js:
(then):
* builtins/SetIteratorPrototype.js:
(next):
* builtins/StringIteratorPrototype.js:
(next):
* builtins/TypedArrayConstructor.js:
(of):
(from):
* bytecode/BytecodeDumper.cpp:
(JSC::BytecodeDumper<Block>::dumpBytecode):
* bytecode/BytecodeIntrinsicRegistry.h:
* bytecode/BytecodeList.json:
* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::finishCreation):
(JSC::CodeBlock::finalizeLLIntInlineCaches):
* bytecode/GetByIdStatus.cpp:
(JSC::GetByIdStatus::computeFromLLInt):
(JSC::GetByIdStatus::computeFor):
* bytecode/StructureStubInfo.cpp:
(JSC::StructureStubInfo::reset):
* bytecode/StructureStubInfo.h:
(JSC::appropriateOptimizingGetByIdFunction):
(JSC::appropriateGenericGetByIdFunction):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitDirectGetById):
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::BytecodeIntrinsicNode::emit_intrinsic_getByIdDirect):
(JSC::BytecodeIntrinsicNode::emit_intrinsic_getByIdDirectPrivate):
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleGetById):
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGCapabilities.cpp:
(JSC::DFG::capabilityLevel):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::foldConstants):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNode.h:
(JSC::DFG::Node::convertToGetByOffset):
(JSC::DFG::Node::convertToMultiGetByOffset):
(JSC::DFG::Node::hasIdentifier):
(JSC::DFG::Node::hasHeapPrediction):
* dfg/DFGNodeType.h:
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileGetById):
(JSC::DFG::SpeculativeJIT::compileGetByIdFlush):
(JSC::DFG::SpeculativeJIT::compileTryGetById): Deleted.
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::cachedGetById):
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::cachedGetById):
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileGetById):
(JSC::FTL::DFG::LowerDFGToB3::compileGetByIdWithThis):
(JSC::FTL::DFG::LowerDFGToB3::getById):
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
(JSC::JIT::privateCompileSlowCases):
* jit/JIT.h:
* jit/JITOperations.cpp:
* jit/JITOperations.h:
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emit_op_get_by_id_direct):
(JSC::JIT::emitSlow_op_get_by_id_direct):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emit_op_get_by_id_direct):
(JSC::JIT::emitSlow_op_get_by_id_direct):
* jit/Repatch.cpp:
(JSC::appropriateOptimizingGetByIdFunction):
(JSC::appropriateGetByIdFunction):
(JSC::tryCacheGetByID):
(JSC::repatchGetByID):
(JSC::appropriateGenericGetByIdFunction): Deleted.
* jit/Repatch.h:
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* llint/LLIntSlowPaths.h:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/JSCJSValue.h:
* runtime/JSCJSValueInlines.h:
(JSC::JSValue::getOwnPropertySlot const):
* runtime/JSObject.h:
* runtime/JSObjectInlines.h:
(JSC::JSObject::getOwnPropertySlotInline):

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

3 years ago[WPE][GTK] Remove applicationDirectoryPath() and sharedResourcePath()
mcatanzaro@igalia.com [Sun, 8 Apr 2018 15:55:56 +0000 (15:55 +0000)]
[WPE][GTK] Remove applicationDirectoryPath() and sharedResourcePath()
https://bugs.webkit.org/show_bug.cgi?id=184381

Reviewed by Carlos Garcia Campos.

.:

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

Source/WebCore:

These are unused.

* platform/FileSystem.h:
* platform/glib/FileSystemGlib.cpp:
(WebCore::FileSystem::applicationDirectoryPath): Deleted.
(WebCore::FileSystem::sharedResourcesPath): Deleted.

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

3 years agoHave WorkerScriptLoader::loadAsynchronously() take a FetchOptions
dbates@webkit.org [Sun, 8 Apr 2018 06:43:24 +0000 (06:43 +0000)]
Have WorkerScriptLoader::loadAsynchronously() take a FetchOptions
https://bugs.webkit.org/show_bug.cgi?id=184385

Reviewed by Youenn Fablet.

Currently we pass various FetchOptions to WorkerScriptLoader::loadAsynchronously()
so that it can build up a ThreadableLoaderOptions structure to pass to the loader.
Each time we want to set another FetchOptions option we need to add a new parameter.
Instead we should have WorkerScriptLoader::loadAsynchronously() take a FetchOptions.
This will make it straightforward for a caller to set new loader options as needed.
In particular, this will make it straightforward to support setting the request's
destination flag (i.e. FetchOptions::destination) to support blocking scripts with
a non-JavaScript MIME type in a subsequent commit.

No functionality changed. So, no new tests.

* loader/ResourceLoaderOptions.h:
(WebCore::ResourceLoaderOptions::ResourceLoaderOptions): Modified to take a FetchOptions
by value so as to support both move and copy semantics.
* loader/ThreadableLoader.cpp:
(WebCore::ThreadableLoaderOptions::ThreadableLoaderOptions):  Added helper constructor
that takes a FetchOptions.
* loader/ThreadableLoader.h:
* workers/Worker.cpp:
(WebCore::Worker::create): Instantiate and pass a FetchOptions to the loader for the mode,
cache policy, and redirect policy.
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::loadAsynchronously): Modified to take a FetchOptions and
instantiate a ThreadableLoaderOptions from it.
* workers/WorkerScriptLoader.h:
* workers/WorkerScriptLoaderClient.h:
(WebCore::WorkerScriptLoaderClient::isServiceWorkerClient const): Deleted. This function
is no longer needed because the Service Worker client now passes the service worker mode
directly to the loader.
* workers/service/ServiceWorkerJob.cpp:
(WebCore::ServiceWorkerJob::fetchScriptWithContext): Instantiate and pass a FetchOptions
to the loader.
* workers/service/ServiceWorkerJob.h:

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

3 years ago[LayoutReloaded] Add support for InlineContainer
zalan@apple.com [Sun, 8 Apr 2018 05:27:36 +0000 (05:27 +0000)]
[LayoutReloaded] Add support for InlineContainer
https://bugs.webkit.org/show_bug.cgi?id=184394

Reviewed by Antti Koivisto.

* LayoutReloaded/FormattingContext/FormattingContext.js:
(FormattingContext.prototype._addToLayoutQueue):
* LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js:
(InlineFormattingContext.prototype.layout):
(InlineFormattingContext.prototype._handleInlineContent):
(InlineFormattingContext.prototype._handleFloatingBox):
(InlineFormattingContext.prototype._adjustLineForInlineContainerStart):
(InlineFormattingContext.prototype._adjustLineForInlineContainerEnd):
(InlineFormattingContext.prototype._placeInFlowPositionedChildren):
(InlineFormattingContext.prototype._placeOutOfFlowDescendants):
(InlineFormattingContext.prototype._createNewLine):
(InlineFormattingContext.prototype._handleContent): Deleted.
* LayoutReloaded/LayoutState.js:
(LayoutState.prototype._createFormattingState):
* LayoutReloaded/LayoutTree/Box.js:
(Layout.Box.prototype.isContainer):
(Layout.Box.prototype.isInlineContainer):
(Layout.Box.prototype.isInlineBox):
* LayoutReloaded/LayoutTree/Container.js:
(Layout.Container.prototype.isContainer): Deleted.
* LayoutReloaded/LayoutTree/InlineContainer.js: Added.
(Layout.InlineContainer):
* LayoutReloaded/TreeBuilder.js:
(TreeBuilder.prototype._createAndAttachBox):
* LayoutReloaded/Utils.js:
(Utils._dumpBox):
(Utils.precisionRound):
(Utils):
* LayoutReloaded/test/index.html:
* LayoutReloaded/test/inline-content-simple2.html: Added.
* LayoutReloaded/test/inline-floating1.html: Added.
* LayoutReloaded/test/inline-formatting-context-floats1.html: Added.
* LayoutReloaded/test/inline-formatting-context-floats2.html: Added.

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

3 years agoWeb Inspector: Errors glyph doesn't fully change to blue when active
nvasilyev@apple.com [Sun, 8 Apr 2018 01:33:03 +0000 (01:33 +0000)]
Web Inspector: Errors glyph doesn't fully change to blue when active
https://bugs.webkit.org/show_bug.cgi?id=184389

Reviewed by Joseph Pecoraro.

The dot of the exclamation mark was always black.

* UserInterface/Images/Errors.svg:

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

3 years agoUnreviewed, annotate test with @skip if $memoryLimited
utatane.tea@gmail.com [Sat, 7 Apr 2018 20:31:35 +0000 (20:31 +0000)]
Unreviewed, annotate test with @skip if $memoryLimited
https://bugs.webkit.org/show_bug.cgi?id=183894

* stress/json-stringified-overflow.js:

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

3 years agoResponse headers should be filtered when sent from NetworkProcess to WebProcess
youenn@apple.com [Sat, 7 Apr 2018 18:22:53 +0000 (18:22 +0000)]
Response headers should be filtered when sent from NetworkProcess to WebProcess
https://bugs.webkit.org/show_bug.cgi?id=184310

Unreviewed.
Fixed bogus const declaration.
Improved sub test titles.

* http/wpt/service-workers/header-filtering.https-expected.txt:
* http/wpt/service-workers/header-filtering.https.html:

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

3 years ago[JSC] Remove several asXXX functions
utatane.tea@gmail.com [Sat, 7 Apr 2018 18:15:03 +0000 (18:15 +0000)]
[JSC] Remove several asXXX functions
https://bugs.webkit.org/show_bug.cgi?id=184355

Reviewed by JF Bastien.

Remove asActivation, asInternalFunction, and asGetterSetter.
Use jsCast<> / jsDynamicCast<> consistently.

* runtime/ArrayConstructor.cpp:
(JSC::constructArrayWithSizeQuirk):
* runtime/AsyncFunctionConstructor.cpp:
(JSC::callAsyncFunctionConstructor):
(JSC::constructAsyncFunctionConstructor):
* runtime/AsyncGeneratorFunctionConstructor.cpp:
(JSC::callAsyncGeneratorFunctionConstructor):
(JSC::constructAsyncGeneratorFunctionConstructor):
* runtime/BooleanConstructor.cpp:
(JSC::constructWithBooleanConstructor):
* runtime/DateConstructor.cpp:
(JSC::constructWithDateConstructor):
* runtime/ErrorConstructor.cpp:
(JSC::Interpreter::constructWithErrorConstructor):
(JSC::Interpreter::callErrorConstructor):
* runtime/FunctionConstructor.cpp:
(JSC::constructWithFunctionConstructor):
(JSC::callFunctionConstructor):
* runtime/FunctionPrototype.cpp:
(JSC::functionProtoFuncToString):
* runtime/GeneratorFunctionConstructor.cpp:
(JSC::callGeneratorFunctionConstructor):
(JSC::constructGeneratorFunctionConstructor):
* runtime/GetterSetter.h:
(JSC::asGetterSetter): Deleted.
* runtime/InternalFunction.h:
(JSC::asInternalFunction): Deleted.
* runtime/JSGenericTypedArrayViewConstructorInlines.h:
(JSC::constructGenericTypedArrayView):
* runtime/JSLexicalEnvironment.h:
(JSC::asActivation): Deleted.
* runtime/JSObject.cpp:
(JSC::validateAndApplyPropertyDescriptor):
* runtime/MapConstructor.cpp:
(JSC::constructMap):
* runtime/PropertyDescriptor.cpp:
(JSC::PropertyDescriptor::setDescriptor):
* runtime/RegExpConstructor.cpp:
(JSC::constructWithRegExpConstructor):
(JSC::callRegExpConstructor):
* runtime/SetConstructor.cpp:
(JSC::constructSet):
* runtime/StringConstructor.cpp:
(JSC::constructWithStringConstructor):
* runtime/WeakMapConstructor.cpp:
(JSC::constructWeakMap):
* runtime/WeakSetConstructor.cpp:
(JSC::constructWeakSet):
* wasm/js/WebAssemblyCompileErrorConstructor.cpp:
(JSC::constructJSWebAssemblyCompileError):
(JSC::callJSWebAssemblyCompileError):
* wasm/js/WebAssemblyLinkErrorConstructor.cpp:
(JSC::constructJSWebAssemblyLinkError):
(JSC::callJSWebAssemblyLinkError):
* wasm/js/WebAssemblyRuntimeErrorConstructor.cpp:
(JSC::constructJSWebAssemblyRuntimeError):
(JSC::callJSWebAssemblyRuntimeError):

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

3 years agoUse the system's link color when system appearance is desired for a WebView.
timothy@apple.com [Sat, 7 Apr 2018 08:35:00 +0000 (08:35 +0000)]
Use the system's link color when system appearance is desired for a WebView.

https://bugs.webkit.org/show_bug.cgi?id=184353
rdar://problem/9420053

Reviewed by Wenson Hsieh.

Source/WebCore:

Have Document consult RenderTheme via StyleColor for the various link colors.
This allows the system to have different colors than the standard hardcoded ones.
This adds StyleColor::Options, to avoid multiple booleans being passed around,
since the "for visited link" state is now needed in RenderTheme.

* WebCore.xcodeproj/project.pbxproj: Made StyleColor.h private, since RenderTheme.h includes it.
* css/StyleColor.cpp:
(WebCore::StyleColor::colorFromKeyword): Use options instead of a bool.
(WebCore::StyleColor::isSystemColor): Consider CSSValueWebkitLink the start of system colors.
* css/StyleColor.h:
* css/StyleResolver.cpp:
(WebCore::StyleResolver::colorFromPrimitiveValue const): Use StyleColor::Options.
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseSystemColor): Use StyleColor::Options.
* dom/Document.cpp:
(WebCore::Document::resetLinkColor): Ask StyleColor for the link color instead of hardcoding it.
(WebCore::Document::resetVisitedLinkColor): Ditto.
(WebCore::Document::resetActiveLinkColor): Ditto.
(WebCore::Document::styleColorOptions const): Added. Helper to get the options used.
* dom/Document.h:
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal): Use StyleColor::Options.
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::systemColor const): Add default values here, moved from Document.
(WebCore::RenderTheme::focusRingColor): Use StyleColor::Options.
* rendering/RenderTheme.h:
(WebCore::RenderTheme::platformFocusRingColor const): Use StyleColor::Options.
* rendering/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::systemColor const): Use StyleColor::Options.
* rendering/RenderThemeGtk.h:
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::systemColor const): Use StyleColor::Options.
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::platformFocusRingColor const): Use StyleColor::Options.
(WebCore::RenderThemeMac::platformColorsDidChange): Clear m_systemVisitedLinkColor.
(WebCore::RenderThemeMac::systemColor const): Use StyleColor::Options.
(WebCore::RenderThemeMac::adjustMenuListStyle const): Ditto.
* rendering/RenderThemeWin.cpp:
(WebCore::RenderThemeWin::systemColor const): Use StyleColor::Options.
* rendering/RenderThemeWin.h:
* rendering/TextPaintStyle.cpp:
(WebCore::computeTextPaintStyle): Use StyleColor::Options.

Source/WebCore/PAL:

* pal/spi/cocoa/NSColorSPI.h: Added linkColor.

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/SystemColors.mm: Added.
(TestWebKitAPI::WebKit::LinkColor):
(TestWebKitAPI::WebKit::LinkColorWithSystemAppearance):

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

3 years agoREGRESSION(r228371): WebAutomationSession::deleteAllCookies doesn't delete some cookies
bburg@apple.com [Sat, 7 Apr 2018 04:08:50 +0000 (04:08 +0000)]
REGRESSION(r228371): WebAutomationSession::deleteAllCookies doesn't delete some cookies
https://bugs.webkit.org/show_bug.cgi?id=184334
<rdar://problem/39212863>

Reviewed by Timothy Hatcher.

When WebDriver adds a cookie for 'localhost', it actually uses the domain '.localhost' per RFC.
When deleting cookies, we first fetch all cookies matching the document's hostname, and
then delete them one by one. However, this code path does not add the dot prefix. This causes
no cookies to match the requested domain, and thus none of them are deleted.

* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::domainByAddingDotPrefixIfNeeded): Extract this helper method.
(WebKit::WebAutomationSession::addSingleCookie): Use helper method.
(WebKit::WebAutomationSession::deleteAllCookies): Add a dot prefix when
requesting to delete all cookies for a hostname.

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

3 years agoRebaseline LayoutReloaded patch file.
zalan@apple.com [Sat, 7 Apr 2018 03:56:21 +0000 (03:56 +0000)]
Rebaseline LayoutReloaded patch file.

* LayoutReloaded/misc/LayoutReloadedWebKit.patch:

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

3 years agoResponse headers should be filtered when sent from NetworkProcess to WebProcess
youenn@apple.com [Sat, 7 Apr 2018 03:48:55 +0000 (03:48 +0000)]
Response headers should be filtered when sent from NetworkProcess to WebProcess
https://bugs.webkit.org/show_bug.cgi?id=184310

Reviewed by Ryosuke Niwa.

Source/WebCore:

Did some refactoring to allow ResourceResponse to use header value parsing routines.
We add sanitization levels for regular responses in case responses might be exposed to scripts or not.
If not exposed to scripts, additional filtering is done.

Add internal API to get unfiltered response headers from a fetch response.
Test: http/wpt/service-workers/header-filtering.https.html

* Modules/fetch/FetchResponse.h:
* loader/CrossOriginPreflightResultCache.cpp:
(WebCore::CrossOriginPreflightResultCacheItem::parse):
* platform/network/HTTPParsers.h:
(WebCore::addToAccessControlAllowList):
(WebCore::parseAccessControlAllowList):
* platform/network/ResourceResponseBase.cpp:
(WebCore::isSafeToKeepRedirectionResponseHeader):
(WebCore::isCrossOriginSafeToKeepResponseHeader):
(WebCore::ResourceResponseBase::sanitizeHTTPHeaderFields):
* platform/network/ResourceResponseBase.h:
* testing/ServiceWorkerInternals.cpp:
(WebCore::ServiceWorkerInternals::fetchResponseHeaderList):
* testing/ServiceWorkerInternals.h:
* testing/ServiceWorkerInternals.idl:

Source/WebKit:

Pass destination parameter to NetworkResourceLoader.
Use new sanitization routine to filter response headers as needed:
- Cross-origin routines are filtered by removing any non CORS allowed headers.
- Same-origin responses are filtered by removing non used headers, except when filtering would be visible by JS (XHR, fetch).
In all cases, Set-Cookie/Set-Cookie2 headers are filtered out.

* NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::encode const):
(WebKit::NetworkResourceLoadParameters::decode):
* NetworkProcess/NetworkResourceLoadParameters.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::didReceiveResponse):
(WebKit::NetworkResourceLoader::willSendRedirectedRequest):
(WebKit::NetworkResourceLoader::sanitizeResponseIfPossible):
(WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
(WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry):
* NetworkProcess/NetworkResourceLoader.h:
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::updatePreferencesStore):

LayoutTests:

Rebased tests for WK2 as Server response header is now filtered out for cross-origin and not fetch/XHR loads.

* http/wpt/service-workers/header-filtering-worker.js: Added.
* http/wpt/service-workers/header-filtering.https-expected.txt: Added.
Some tests are failing as navigation loads are not yet filtered and we
have no good way yet to detect cross origin loads.
* http/wpt/service-workers/header-filtering.https.html: Added.
* http/wpt/service-workers/resources/header-filtering-iframe.html: Added.
* http/wpt/service-workers/resources/response-full-of-headers.py: Added.
* http/tests/webarchive/cross-origin-stylesheet-crash-expected.txt: Added.
* http/tests/webarchive/test-preload-resources-expected.txt: Added.
* platform/mac-wk1/http/tests/webarchive/cross-origin-stylesheet-crash-expected.txt: Added.
* platform/mac-wk1/http/tests/webarchive/test-preload-resources-expected.txt: Added.
* platform/win/http/tests/webarchive/cross-origin-stylesheet-crash-expected.txt: Added.
* platform/win/http/tests/webarchive/test-preload-resources-expected.txt: Added.

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

3 years agoMark fast/loader/submit-form-while-parsing-2.html as flaky.
ryanhaddad@apple.com [Sat, 7 Apr 2018 00:33:00 +0000 (00:33 +0000)]
Mark fast/loader/submit-form-while-parsing-2.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=184051

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

3 years agoRebaseline imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap...
ryanhaddad@apple.com [Sat, 7 Apr 2018 00:20:35 +0000 (00:20 +0000)]
Rebaseline imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-transfer.html after r230350.

Unreviewed test gardening.

* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-transfer-expected.txt:

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

3 years agoSource/bmalloc:
sbarati@apple.com [Sat, 7 Apr 2018 00:00:34 +0000 (00:00 +0000)]
Source/bmalloc:
bmalloc virtual allocation API should not treat memory it vends as dirty with respect to how it drives the scavenger
https://bugs.webkit.org/show_bug.cgi?id=184342

Reviewed by Mark Lam.

Currently, the only user of this API is Wasm. Ideally, Wasm would tell
us exactly which page is dirtied. We should really do that at some point:
https://bugs.webkit.org/show_bug.cgi?id=184207

However, until we do that, it's better to treat none of the virtual memory
we vend as dirty, versus what we do now, which is treat it all as dirty.
This dirty memory tracking helps drive the scavenger, so on iOS, having the
scavenger think its under memory pressure because of memory it can't free isn't
useful.

* bmalloc/bmalloc.cpp:
(bmalloc::api::tryLargeZeroedMemalignVirtual):
(bmalloc::api::freeLargeVirtual):
* bmalloc/bmalloc.h:

Source/WTF:
bmalloc's tryLargeZeroedMemalignVirtual shouldn't treat the entire virtual size as dirty towards its footprint
https://bugs.webkit.org/show_bug.cgi?id=184207

Reviewed by Mark Lam.

* wtf/Gigacage.cpp:
(Gigacage::freeVirtualPages):

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

3 years agoMake all sync IPCs during ScriptDisallowedScope set DoNotProcessIncomingMessagesWhenW...
rniwa@webkit.org [Fri, 6 Apr 2018 23:53:30 +0000 (23:53 +0000)]
Make all sync IPCs during ScriptDisallowedScope set DoNotProcessIncomingMessagesWhenWaitingForSyncReply
https://bugs.webkit.org/show_bug.cgi?id=182449
<rdar://problem/39222541>

Reviewed by Chris Dumez.

Release assert that a sync IPC inside ScriptDisallowedScope sets DoNotProcessIncomingMessagesWhenWaitingForSyncReply
to avoid executing arbitrary scripts as a result of processing incoming sync IPCs.

* Platform/IPC/Connection.h:
(IPC::Connection::sendSync): Added the release assertion.

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

3 years agoUnreviewed, fix unused parameter warning when credential storage is disabled
mcatanzaro@igalia.com [Fri, 6 Apr 2018 23:26:34 +0000 (23:26 +0000)]
Unreviewed, fix unused parameter warning when credential storage is disabled

* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::NetworkStorageSession::getCredentialFromPersistentStorage):

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

3 years ago[Extra zoom mode] Block playback until fullscreen begins
eric.carlson@apple.com [Fri, 6 Apr 2018 23:26:03 +0000 (23:26 +0000)]
[Extra zoom mode] Block playback until fullscreen begins
https://bugs.webkit.org/show_bug.cgi?id=184371
<rdar://problem/39250891>

Reviewed by Youenn Fablet.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updatePlayState): Return early when waiting to enter fullscreen.
(WebCore::HTMLMediaElement::enterFullscreen): Set m_waitingToEnterFullscreen.
(WebCore::HTMLMediaElement::exitFullscreen): Clear m_waitingToEnterFullscreen.
(WebCore::HTMLMediaElement::didBecomeFullscreenElement): Ditto.
* html/HTMLMediaElement.h:

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

3 years agoWebCore::screenSupportsExtendedColor improperly calls NSScreen functions in the WebCo...
bfulgham@apple.com [Fri, 6 Apr 2018 22:54:37 +0000 (22:54 +0000)]
WebCore::screenSupportsExtendedColor improperly calls NSScreen functions in the WebContent process
https://bugs.webkit.org/show_bug.cgi?id=184364
<rdar://problem/39246314>

Reviewed by Per Arne Vollan.

The WebContent process is interacting directly with NSScreen to determine if the current screen
has extended color support. This should be brokered from the UIProcess.

Tested by fast/media/mq-color-gamut.html.

* platform/ScreenProperties.h:
(WebCore::ScreenProperties::encode const): Add screenSupportsExtendedColor.
(WebCore::ScreenProperties::decode): Ditto.
* platform/mac/PlatformScreenMac.mm:
(WebCore::getScreenProperties): Retrieve extended color support.
(WebCore::screenSupportsExtendedColor): Retrieve cached version when in the WebContent
process. Assert that NSScreen is not accessed in the WebContent process.

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

3 years ago[Win][WebCore] Expose a constant for scrollbar pixels per line (cScrollbarPixelsPerLine)
Hironori.Fujii@sony.com [Fri, 6 Apr 2018 20:30:15 +0000 (20:30 +0000)]
[Win][WebCore] Expose a constant for scrollbar pixels per line (cScrollbarPixelsPerLine)
https://bugs.webkit.org/show_bug.cgi?id=184296

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (No behavior changes).

* platform/PlatformWheelEvent.h: Placed cScrollbarPixelsPerLine definition.
* platform/win/WheelEventWin.cpp:
(WebCore::PlatformWheelEvent::PlatformWheelEvent): Removed cScrollbarPixelsPerLine definition.

Tools:

* DumpRenderTree/win/EventSender.cpp:
(mouseScrollBy): Removed the duplicated cScrollbarPixelsPerLine
definition. Use WebCore::cScrollbarPixelsPerLine.

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

3 years agoMark three wpt LayoutTests as slow on iOS
ryanhaddad@apple.com [Fri, 6 Apr 2018 20:21:07 +0000 (20:21 +0000)]
Mark three wpt LayoutTests as slow on iOS
https://bugs.webkit.org/show_bug.cgi?id=184278

Unreviewed test gardening.

These tests were marked as slow for macOS debug, but not for iOS.

* platform/ios/TestExpectations:

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

3 years agoImport wpt webaudio tests
youenn@apple.com [Fri, 6 Apr 2018 20:05:46 +0000 (20:05 +0000)]
Import wpt webaudio tests
https://bugs.webkit.org/show_bug.cgi?id=184348

Reviewed by Eric Carlson.

LayoutTests/imported/w3c:

* resources/import-expectations.json:
* web-platform-tests/webaudio/: Added.

LayoutTests:

* TestExpectations:
* resources/testharnessreport.js: Mock AudioContext with webkitAudioContext for wpt tests only.

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

3 years agoUnreviewed test fix after r230323
bfulgham@apple.com [Fri, 6 Apr 2018 19:43:34 +0000 (19:43 +0000)]
Unreviewed test fix after r230323

* platform/mac/PlatformScreenMac.mm:
(WebCore::screenSupportsExtendedColor): Remove assertion hit during test runs.

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

3 years agoWebCore::screenColorSpace is retrieving CGColorSpace from NSScreen directly
bfulgham@apple.com [Fri, 6 Apr 2018 19:37:17 +0000 (19:37 +0000)]
WebCore::screenColorSpace is retrieving CGColorSpace from NSScreen directly
https://bugs.webkit.org/show_bug.cgi?id=184343
<rdar://problem/39224881>

Reviewed by Per Arne Vollan.

Revise ScreenProperties to serialize the screen's color space, and later
retrieve that in the WebContent process. This allows us to close off
the CGSWindowServer connection.

* platform/ScreenProperties.h:
(WebCore::ScreenProperties::encode const): Add CGColorSpaceRef support.
(WebCore::ScreenProperties::decode): Ditto.
* platform/mac/PlatformScreenMac.mm:
(WebCore::displayID): Add assertion to prevent use in WebContent process.
(WebCore::firstScreen): Ditto.
(WebCore::getScreenProperties): Add support for CGColorSpaceRef.
(WebCore::screenColorSpace): Retrieve cached version when in WebContent process.
Assert that NSScreen is not accessed in WebContent process.

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

3 years agoImplement createImageBitmap(Blob)
Ms2ger@igalia.com [Fri, 6 Apr 2018 19:33:32 +0000 (19:33 +0000)]
Implement createImageBitmap(Blob)
https://bugs.webkit.org/show_bug.cgi?id=183247

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Update expectations.

* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt:
* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt:

Source/WebCore:

Tests:
    - imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage.html
    - imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args.html

* fileapi/FileReaderLoader.h:
(WebCore::FileReaderLoader::url): expose the Blob's URL.
* html/ImageBitmap.cpp: implement createImageBitmap(Blob).
* html/ImageBitmap.h: allow the BlobImageObserver class access to the creation function.
* loader/cache/CachedImage.cpp: reuse extracted code.
(WebCore::CachedImage::isPDFResource const):
(WebCore::CachedImage::isPostScriptResource const):
(WebCore::CachedImage::createImage):
* platform/graphics/Image.cpp: extract some code from CachedImage to reuse.
(WebCore::Image::create):
(WebCore::Image::isPDFResource):
(WebCore::Image::isPostScriptResource):
* platform/graphics/Image.h: add declarations.

LayoutTests:

Update expectations.

* platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt:

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

3 years agoFlex child does not get repainted when it is inserted back to the render tree.
zalan@apple.com [Fri, 6 Apr 2018 19:31:15 +0000 (19:31 +0000)]
Flex child does not get repainted when it is inserted back to the render tree.
https://bugs.webkit.org/show_bug.cgi?id=184361
<rdar://problem/34528716>

Reviewed by Antti Koivisto.

Source/WebCore:

As with any regular block children, we should issue full repaint for flexbox items on their
first layout (see RenderBlockFlow::layoutBlockChild()).

Test: fast/flexbox/missing-repaint-when-flext-item-never-had-layout.html

* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::layoutAndPlaceChildren):

LayoutTests:

* fast/flexbox/missing-repaint-when-flext-item-never-had-layout-expected.txt: Added.
* fast/flexbox/missing-repaint-when-flext-item-never-had-layout.html: Added.

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

3 years agoSupport transferring ImageBitmap objects
Ms2ger@igalia.com [Fri, 6 Apr 2018 19:20:35 +0000 (19:20 +0000)]
Support transferring ImageBitmap objects
https://bugs.webkit.org/show_bug.cgi?id=183131

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-transfer-expected.txt: Added.
* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-transfer.html: Added.
* web-platform-tests/2dcontext/imagebitmap/transfer-worker.js: Added.

Source/WebCore:

Test: imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-transfer.html

* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::serialize): thread through ImageBitmaps.
(WebCore::CloneSerializer::CloneSerializer): thread through ImageBitmaps.
(WebCore::CloneSerializer::fillTransferMap): don't require a mutable reference.
(WebCore::CloneSerializer::dumpImageBitmap): add.
(WebCore::CloneSerializer::dumpIfTerminal): check for ImageBitmap.
(WebCore::CloneDeserializer::deserialize): thread through ImageBitmaps.
(WebCore::CloneDeserializer::CloneDeserializer): thread through ImageBitmaps.
(WebCore::CloneDeserializer::readImageBitmap): add.
(WebCore::CloneDeserializer::readTerminal): check for ImageBitmap.
(WebCore::SerializedScriptValue::SerializedScriptValue): thread through ImageBitmaps.
(WebCore::SerializedScriptValue::create): thread through ImageBitmaps.
(WebCore::containsDuplicates): add.
(WebCore::SerializedScriptValue::deserialize): handle ImageBitmap arguments.
* bindings/js/SerializedScriptValue.h: update signatures, add member.
* html/ImageBitmap.cpp:
(WebCore::ImageBitmap::create): add.
(WebCore::ImageBitmap::detachBitmaps): add.
* html/ImageBitmap.h: add signatures.

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

3 years agoWhen recording the drawing, the DisplayList should be initialized with the GraphicsCo...
commit-queue@webkit.org [Fri, 6 Apr 2018 19:19:41 +0000 (19:19 +0000)]
When recording the drawing, the DisplayList should be initialized with the GraphicsContextState of the underlying GraphicsContext
https://bugs.webkit.org/show_bug.cgi?id=184336

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2018-04-06
Reviewed by Antti Koivisto.

The state of the drawing context has to be transfered to the recording
DisplayList before recording. Many recording GraphicsContext functions
will behave wrongly if it gets the default state.

* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::DisplayListDrawingContext::DisplayListDrawingContext):
(WebCore::CanvasRenderingContext2DBase::drawingContext const):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::recursiveCommitChanges):
* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::Recorder):
* platform/graphics/displaylists/DisplayListRecorder.h:
(WebCore::DisplayList::Recorder::ContextState::ContextState):
(WebCore::DisplayList::Recorder::ContextState::cloneForSave const):
* platform/graphics/displaylists/DisplayListReplayer.cpp:
(WebCore::DisplayList::Replayer::replay):
* platform/graphics/displaylists/DisplayListReplayer.h:
(WebCore::DisplayList::Replayer::replay): If we do not have a clipping
rectangle and we want to record all the drawing, we need a default value
for the clipping rectangle and we want no clipping to happen.

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

3 years agoEmit a more informative message when a script is blocked due to "X-Content-Type:...
dbates@webkit.org [Fri, 6 Apr 2018 19:15:34 +0000 (19:15 +0000)]
Emit a more informative message when a script is blocked due to "X-Content-Type: nosniff"
https://bugs.webkit.org/show_bug.cgi?id=184359

Reviewed by Per Arne Vollan.

Source/WebCore:

Emphasize in the message that the script was blocked from executing.

Test: http/tests/security/contentTypeOptions/nosniff-importScript-blocked.html

* dom/LoadableClassicScript.cpp:
(WebCore::LoadableClassicScript::notifyFinished):
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::didReceiveResponse):

LayoutTests:

Adds a test to ensure we block importing scripts into a Web Worker whose HTTP responses
include "X-Content-Type: nosniff" and have a non script MIME type.

Also update existing expected results.

* http/tests/security/contentTypeOptions/invalid-content-type-options-allowed-expected.txt:
* http/tests/security/contentTypeOptions/nosniff-dynamic-script-blocked-expected.txt:
* http/tests/security/contentTypeOptions/nosniff-importScript-blocked-expected.txt: Added.
* http/tests/security/contentTypeOptions/nosniff-importScript-blocked.html: Added.
* http/tests/security/contentTypeOptions/nosniff-script-allowed-expected.txt:
* http/tests/security/contentTypeOptions/nosniff-script-blocked-expected.txt:
* http/tests/security/contentTypeOptions/nosniff-script-without-content-type-blocked-expected.txt:
* http/tests/security/contentTypeOptions/resources/nosniff-importScript-blocked.js: Added.
(let.mimeType.of.unscriptyMIMETypes.catch):
* http/tests/security/contentTypeOptions/resources/script-with-header.pl:
* http/tests/security/module-correct-mime-types-expected.txt:

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

3 years agoimportScripts() should throw exception with a reason when it fails to load a script...
dbates@webkit.org [Fri, 6 Apr 2018 19:12:28 +0000 (19:12 +0000)]
importScripts() should throw exception with a reason when it fails to load a script from the network
https://bugs.webkit.org/show_bug.cgi?id=184345

Reviewed by Alexey Proskuryakov.

Source/WebCore:

Currently importScripts() throws a NetworkError exception without a reason when
it fails to load a script from the network. It is ambiguous whether the load failed
due to an access control failure or some other error. Instead we should include
the reason the load failed in the thrown exception.

* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::importScripts):

LayoutTests:

Update expected results.

* http/tests/security/contentSecurityPolicy/worker-blob-inherits-csp-importScripts-redirect-cross-origin-blocked-expected.txt:
* http/tests/security/contentSecurityPolicy/worker-csp-importScripts-redirect-cross-origin-blocked-expected.txt:
* http/tests/workers/worker-importScripts-expected.txt:

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

3 years agoRebaseline LayoutReloaded patch file.
zalan@apple.com [Fri, 6 Apr 2018 19:08:25 +0000 (19:08 +0000)]
Rebaseline LayoutReloaded patch file.

* LayoutReloaded/misc/LayoutReloadedWebKit.patch:

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

3 years agoRemove pass expectation for LayoutTest imported/w3c/web-platform-tests/FileAPI/url...
ryanhaddad@apple.com [Fri, 6 Apr 2018 19:07:06 +0000 (19:07 +0000)]
Remove pass expectation for LayoutTest imported/w3c/web-platform-tests/FileAPI/url/sandboxed-iframe.html
https://bugs.webkit.org/show_bug.cgi?id=184362

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

3 years agoAttempt to fix the build after <https://trac.webkit.org/changeset/230338>
dbates@webkit.org [Fri, 6 Apr 2018 18:26:07 +0000 (18:26 +0000)]
Attempt to fix the build after <https://trac.webkit.org/changeset/230338>
(https://bugs.webkit.org/show_bug.cgi?id=184360)

Make lambdas mutable so that we can WTFMove() their captured arguments.

* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionFailed):
(WebCore::LibWebRTCMediaEndpoint::setLocalSessionDescriptionFailed):
(WebCore::LibWebRTCMediaEndpoint::setRemoteSessionDescriptionFailed):

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

3 years agoHave class Exception take String by value instead of a String&&
dbates@webkit.org [Fri, 6 Apr 2018 17:45:57 +0000 (17:45 +0000)]
Have class Exception take String by value instead of a String&&
https://bugs.webkit.org/show_bug.cgi?id=184360

Reviewed by Alexey Proskuryakov.

For convenience support instantiating an Exception with either an lvalue String or
rvalue String.

Although it can be argued that having Exception take a String by value instead of String&&
can lead to missed opportunities to WTFMove() a String object into Exception such mistakes
are just that, missed opportunities. That is, correctness is not affected and we may perform
an unnecessary ref/deref of the underlying StringImpl when instantiating an Exception. If
such missed opportunities show up in profiles and such mistakes happen often then we can
re-evaluate the decision to have Exception take a String by value.

* Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::put): Simplify code now that Exception takes a String by value.
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::BodyLoader::didFail): Ditto.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionFailed): Move String into Exception to avoid an
unnecessary ref/de-ref.
(WebCore::LibWebRTCMediaEndpoint::setLocalSessionDescriptionFailed): Ditto.
(WebCore::LibWebRTCMediaEndpoint::setRemoteSessionDescriptionFailed): Ditto.
* dom/Exception.h:
(WebCore::Exception::Exception): Take String by value. Also use uniform initializer syntax.

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

3 years agoTighten ImageSource to have BitmapImage pointer instead of Image
antti@apple.com [Fri, 6 Apr 2018 16:29:52 +0000 (16:29 +0000)]
Tighten ImageSource to have BitmapImage pointer instead of Image
https://bugs.webkit.org/show_bug.cgi?id=184356

Reviewed by Said Abou-Hallawa.

ImageSource is an implementation detail of BitmapImage, not a generic type.

* loader/ImageLoader.cpp:
(WebCore::ImageLoader::decode):
* platform/graphics/BitmapImage.h:
* platform/graphics/Image.h:
(WebCore::Image::decode): Deleted.
(WebCore::Image::imageFrameAvailableAtIndex): Deleted.

Also make some BitmapImage specific functions non-virtual and remove them from Image.

* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::ImageSource):
* platform/graphics/ImageSource.h:
(WebCore::ImageSource::create):

Make constructors private.

* platform/graphics/cg/GraphicsContext3DCG.cpp:
(WebCore::GraphicsContext3D::ImageExtractor::extractImage):

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

3 years agoAdd svn:eol-style to line-terminator-normalisation-CR.js
ap@apple.com [Fri, 6 Apr 2018 16:26:04 +0000 (16:26 +0000)]
Add svn:eol-style to line-terminator-normalisation-CR.js
https://bugs.webkit.org/show_bug.cgi?id=184341

* test262/test/built-ins/Function/prototype/toString/line-terminator-normalisation-CR.js: Added property svn:eol-style.

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

3 years agoUnreviewed, remove errant LF from existing test262 test for CR line endings.
ross.kirsling@sony.com [Fri, 6 Apr 2018 16:16:34 +0000 (16:16 +0000)]
Unreviewed, remove errant LF from existing test262 test for CR line endings.

* test262/test/built-ins/Function/prototype/toString/line-terminator-normalisation-CR.js:

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

3 years agoUnreviewed test fix after r230323
bfulgham@apple.com [Fri, 6 Apr 2018 16:07:05 +0000 (16:07 +0000)]
Unreviewed test fix after r230323

* platform/mac/PlatformScreenMac.mm:
(WebCore::screen): Remove assertion we still hit due to event handling code.

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

3 years agoSync 2dcontext, FileAPI, IndexedDB, background-fetch, credential-management, custom...
commit-queue@webkit.org [Fri, 6 Apr 2018 15:53:16 +0000 (15:53 +0000)]
Sync 2dcontext, FileAPI, IndexedDB, background-fetch, credential-management, custom-elements, dom, encoding, and fetch web-platform-tests to 94b33b573a069ae5170104ca581a354a35762536
https://bugs.webkit.org/show_bug.cgi?id=184299

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

LayoutTests/imported/w3c:

* web-platform-tests/2dcontext/imagebitmap/common.sub.js:
(makeMakeHTMLImage.return.new.Promise): Deleted.
* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-origin.sub.html:
* web-platform-tests/FileAPI/BlobURL/support/file_test1.js: Removed.
* web-platform-tests/FileAPI/BlobURL/support/file_test3.html: Removed.
* web-platform-tests/FileAPI/FileReader/w3c-import.log:
* web-platform-tests/FileAPI/blob/Blob-XHR-revoke-expected.txt: Removed.
* web-platform-tests/FileAPI/blob/Blob-XHR-revoke.html: Removed.
* web-platform-tests/FileAPI/blob/Blob-constructor-expected.txt:
* web-platform-tests/FileAPI/blob/Blob-constructor.html:
* web-platform-tests/FileAPI/blob/Blob-slice-overflow.html:
* web-platform-tests/FileAPI/blob/w3c-import.log:
* web-platform-tests/FileAPI/file/File-constructor-expected.txt:
* web-platform-tests/FileAPI/file/File-constructor.html:
* web-platform-tests/FileAPI/file/w3c-import.log:
* web-platform-tests/FileAPI/url/blob-url-in-sandboxed-iframe-expected.txt: Removed.
* web-platform-tests/FileAPI/url/blob-url-in-sandboxed-iframe.html: Removed.
* web-platform-tests/FileAPI/url/cross-global-revoke.sub-expected.txt: Added.
* web-platform-tests/FileAPI/url/cross-global-revoke.sub.html: Added.
* web-platform-tests/FileAPI/url/resources/create-helper.html: Added.
* web-platform-tests/FileAPI/url/resources/create-helper.js: Added.
* web-platform-tests/FileAPI/url/resources/fetch-tests.js: Added.
(fetch_tests):
* web-platform-tests/FileAPI/url/resources/revoke-helper.html: Added.
* web-platform-tests/FileAPI/url/resources/revoke-helper.js: Added.
* web-platform-tests/FileAPI/url/sandboxed-iframe-expected.txt: Added.
* web-platform-tests/FileAPI/url/sandboxed-iframe.html: Added.
* web-platform-tests/FileAPI/url/unicode-origin.sub-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/origin.sub-expected.txt.
* web-platform-tests/FileAPI/url/unicode-origin.sub.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/origin.sub.html.
* web-platform-tests/FileAPI/url/url-format.any-expected.txt: Added.
* web-platform-tests/FileAPI/url/url-format.any.html: Added.
* web-platform-tests/FileAPI/url/url-format.any.js: Added.
(test):
* web-platform-tests/FileAPI/url/url-format.any.worker-expected.txt: Added.
* web-platform-tests/FileAPI/url/url-format.any.worker.html: Added.
* web-platform-tests/FileAPI/url/url-in-tags.window.js: Added.
(async_test.t.e.onload.t.step_func_done):
(async_test.t.frame.onload.t.step_func_done):
* web-platform-tests/FileAPI/url/url-lifetime-expected.txt: Added.
* web-platform-tests/FileAPI/url/url-lifetime.html: Added.
* web-platform-tests/FileAPI/url/url-with-fetch.any-expected.txt: Added.
* web-platform-tests/FileAPI/url/url-with-fetch.any.html: Added.
* web-platform-tests/FileAPI/url/url-with-fetch.any.js: Added.
(fetch_should_succeed):
(promise_test):
* web-platform-tests/FileAPI/url/url-with-fetch.any.worker-expected.txt: Added.
* web-platform-tests/FileAPI/url/url-with-fetch.any.worker.html: Added.
* web-platform-tests/FileAPI/url/url-with-xhr.any-expected.txt: Added.
* web-platform-tests/FileAPI/url/url-with-xhr.any.html: Added.
* web-platform-tests/FileAPI/url/url-with-xhr.any.js: Added.
(xhr_should_succeed):
(async_test.t.xhr.onloadend.t.step_func_done):
(async_test.t.xhr.onload.t.step_func_done):
* web-platform-tests/FileAPI/url/url-with-xhr.any.worker-expected.txt: Added.
* web-platform-tests/FileAPI/url/url-with-xhr.any.worker.html: Added.
* web-platform-tests/FileAPI/url/url_createobjecturl_blob-expected.txt: Removed.
* web-platform-tests/FileAPI/url/url_createobjecturl_blob.html: Removed.
* web-platform-tests/FileAPI/url/url_xmlhttprequest.html: Removed.
* web-platform-tests/FileAPI/url/url_xmlhttprequest_img.html:
* web-platform-tests/FileAPI/url/w3c-import.log:
* web-platform-tests/FileAPI/w3c-import.log:
* web-platform-tests/IndexedDB/README.md:
* web-platform-tests/IndexedDB/interleaved-cursors.html: Removed.
* web-platform-tests/IndexedDB/w3c-import.log:
* web-platform-tests/background-fetch/mixed-content-and-allowed-schemes.https.window.js:
(backgroundFetchTest):
* web-platform-tests/background-fetch/w3c-import.log:
* web-platform-tests/credential-management/credentialscontainer-create-basics.https-expected.txt:
* web-platform-tests/credential-management/credentialscontainer-create-basics.https.html:
* web-platform-tests/custom-elements/Document-createElement-expected.txt:
* web-platform-tests/custom-elements/Document-createElement.html:
* web-platform-tests/custom-elements/OWNERS:
* web-platform-tests/custom-elements/attribute-changed-callback-expected.txt:
* web-platform-tests/custom-elements/attribute-changed-callback.html:
* web-platform-tests/custom-elements/custom-element-registry/w3c-import.log:
* web-platform-tests/custom-elements/parser/parser-sets-attributes-and-children-expected.txt:
* web-platform-tests/custom-elements/parser/parser-sets-attributes-and-children.html:
* web-platform-tests/custom-elements/parser/parser-uses-registry-of-owner-document-expected.txt:
* web-platform-tests/custom-elements/parser/parser-uses-registry-of-owner-document.html:
* web-platform-tests/custom-elements/parser/w3c-import.log:
* web-platform-tests/custom-elements/reactions/CSSStyleDeclaration-expected.txt:
* web-platform-tests/custom-elements/reactions/CSSStyleDeclaration.html:
* web-platform-tests/custom-elements/reactions/Document.html:
* web-platform-tests/custom-elements/reactions/HTMLElement-expected.txt:
* web-platform-tests/custom-elements/reactions/HTMLElement.html:
* web-platform-tests/custom-elements/reactions/w3c-import.log:
* web-platform-tests/custom-elements/resources/custom-elements-helpers.js:
(CustomElement):
(CustomElement.prototype.attributeChangedCallback):
(CustomElement.prototype.connectedCallback):
(CustomElement.prototype.disconnectedCallback):
(CustomElement.prototype.adoptedCallback):
(document_types.return.create): Deleted.
(document_types.create): Deleted.
(document_types.): Deleted.
(document_types): Deleted.
* web-platform-tests/custom-elements/resources/w3c-import.log:
* web-platform-tests/custom-elements/upgrading/Node-cloneNode-expected.txt:
* web-platform-tests/custom-elements/upgrading/Node-cloneNode.html:
* web-platform-tests/custom-elements/upgrading/w3c-import.log:
* web-platform-tests/custom-elements/w3c-import.log:
* web-platform-tests/dom/nodes/Element-classlist.html:
* web-platform-tests/dom/nodes/w3c-import.log:
* web-platform-tests/encoding/big5-encoder-expected.txt:
* web-platform-tests/encoding/big5-encoder.html:
* web-platform-tests/encoding/gbk-encoder-expected.txt:
* web-platform-tests/encoding/gbk-encoder.html:
* web-platform-tests/fetch/README.md:
* web-platform-tests/fetch/api/abort/general.any.js:
* web-platform-tests/fetch/api/basic/integrity.js:
* web-platform-tests/fetch/api/cors/cors-expose-star.js:
(string_appeared_here.promise_test):
* web-platform-tests/fetch/api/cors/cors-filtering.js:
* web-platform-tests/fetch/api/cors/cors-preflight-star.any-expected.txt:
* web-platform-tests/fetch/api/cors/cors-preflight-star.any.js:
* web-platform-tests/fetch/api/cors/cors-preflight-star.any.worker-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-location.js:
* web-platform-tests/fetch/api/redirect/redirect-method-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-method-worker-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-method.js:
(redirectMethod):
* web-platform-tests/fetch/api/redirect/redirect-mode-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-mode-worker-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-mode.js:
(redirectMode):
* web-platform-tests/fetch/api/request/request-disturbed-expected.txt:
* web-platform-tests/fetch/api/request/request-disturbed.html:
* web-platform-tests/fetch/api/request/request-keepalive-expected.txt:
* web-platform-tests/fetch/api/request/request-keepalive-quota-expected.txt:
* web-platform-tests/fetch/api/request/request-keepalive-quota.html:
* web-platform-tests/fetch/api/request/request-keepalive.html:
* web-platform-tests/fetch/api/resources/redirect.py:
(main):
* web-platform-tests/fetch/api/resources/trickle.py:
(main):
* web-platform-tests/fetch/api/response/response-consume.html:
* web-platform-tests/fetch/api/response/response-init-002-expected.txt:
* web-platform-tests/fetch/api/response/response-init-002.html:
* web-platform-tests/fetch/api/response/response-trailer-expected.txt:
* web-platform-tests/fetch/api/response/response-trailer.html:
* web-platform-tests/fetch/data-urls/resources/base64.json: Added.
* web-platform-tests/fetch/http-cache/cc-request.html:
* web-platform-tests/fetch/http-cache/heuristic.html:
* web-platform-tests/fetch/http-cache/partial.html:
* web-platform-tests/fetch/http-cache/vary-expected.txt:
* web-platform-tests/fetch/http-cache/vary.html:
* web-platform-tests/fetch/nosniff/importscripts.js:
(string_appeared_here.forEach):
* web-platform-tests/fetch/nosniff/resources/css.py:
(main):
* web-platform-tests/fetch/nosniff/script-expected.txt:
* web-platform-tests/fetch/nosniff/script.html:
* web-platform-tests/fetch/nosniff/stylesheet-expected.txt:
* web-platform-tests/fetch/nosniff/stylesheet.html:
* web-platform-tests/fetch/nosniff/worker-expected.txt:
* web-platform-tests/fetch/nosniff/worker.html:

LayoutTests:

* TestExpectations:
* platform/gtk/TestExpectations:
* platform/ios-simulator/TestExpectations:
* platform/ios/TestExpectations:
* platform/mac-wk1/TestExpectations:
* platform/mac-wk1/imported/w3c/web-platform-tests/FileAPI/url/url-with-fetch.any-expected.txt: Added.
* platform/mac-wk1/imported/w3c/web-platform-tests/FileAPI/url/url-with-fetch.any.worker-expected.txt: Added.
* platform/mac-wk2/TestExpectations:
* platform/mac/TestExpectations:
* platform/wpe/TestExpectations:

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

3 years agoUnreviewed, rolling out r230320.
ross.kirsling@sony.com [Fri, 6 Apr 2018 06:56:38 +0000 (06:56 +0000)]
Unreviewed, rolling out r230320.

Revert fix, as the root cause lies elsewhere.

Reverted changeset:

"[test262] Mark line-terminator-normalisation-CR.js as a
binary file."
https://bugs.webkit.org/show_bug.cgi?id=184341
https://trac.webkit.org/changeset/230320

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

3 years agoAdd a test for scoped cookies used to load AppCache resources
youenn@apple.com [Fri, 6 Apr 2018 06:47:31 +0000 (06:47 +0000)]
Add a test for scoped cookies used to load AppCache resources
https://bugs.webkit.org/show_bug.cgi?id=184315

Reviewed by Ryosuke Niwa.

* http/tests/appcache/document-cookie-http-only-expected.txt:
* http/tests/appcache/document-cookie-http-only.php:
* http/tests/appcache/resources/manifest-protected-script.php: Added.
* http/tests/appcache/resources/scope1/cookie-protected-manifest.php: Added.
* http/tests/appcache/resources/scope2/cookie-protected-script.php: Added.

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

3 years agoMacroAssemblerCodePtr::retagged() should not re-decorate the pointer on ARMv7.
mark.lam@apple.com [Fri, 6 Apr 2018 06:18:54 +0000 (06:18 +0000)]
MacroAssemblerCodePtr::retagged() should not re-decorate the pointer on ARMv7.
https://bugs.webkit.org/show_bug.cgi?id=184347
<rdar://problem/39183165>

Reviewed by Michael Saboff.

* assembler/MacroAssemblerCodeRef.h:
(JSC::MacroAssemblerCodePtr::MacroAssemblerCodePtr):
(JSC::MacroAssemblerCodePtr::retagged const):

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

3 years agoREGRESSION (r230223): LayoutTest http/tests/contentextensions/css-display-none-overfl...
youenn@apple.com [Fri, 6 Apr 2018 05:23:19 +0000 (05:23 +0000)]
REGRESSION (r230223): LayoutTest http/tests/contentextensions/css-display-none-overflows-rule-data-1.html is crashing
https://bugs.webkit.org/show_bug.cgi?id=184306

Reviewed by Ryosuke Niwa.

Source/WebCore:

Add an option to not compile CSS rules since they are not useful in NetworkProcess.
Covered by tests no longer crashing in Debug WK2 bots.

* contentextensions/ContentExtension.cpp:
(WebCore::ContentExtensions::ContentExtension::create):
(WebCore::ContentExtensions::ContentExtension::ContentExtension):
* contentextensions/ContentExtension.h:
* contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::addContentExtension):
* contentextensions/ContentExtensionsBackend.h:

Source/WebKit:

* NetworkProcess/NetworkContentRuleListManager.cpp:
(WebKit::NetworkContentRuleListManager::addContentRuleLists):

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

3 years agoTest expectation updater should handle Win bot results
youenn@apple.com [Fri, 6 Apr 2018 05:00:08 +0000 (05:00 +0000)]
Test expectation updater should handle Win bot results
https://bugs.webkit.org/show_bug.cgi?id=184274

Reviewed by Ryosuke Niwa.

Add processing of win bot results.
They will update platform/win results.

Updated the script so that if there is no mac-wk2 results, it will still process specific results.

* Scripts/webkitpy/common/net/bugzilla/test_expectation_updater.py:
(TestExpectationUpdater.__init__):
(TestExpectationUpdater._bot_type):
(TestExpectationUpdater.do_update):
* Scripts/webkitpy/common/net/bugzilla/test_expectation_updater_unittest.py:
(MockAttachment):
(MockAttachment.__init__):
(MockAttachment.contents):
(MockBugzilla):
(MockBugzilla.__init__):
(MockBugzilla.fetch_bug):
(MockBugzilla.attachments):
(MockZip):
(MockZip.__init__):
(MockZip.unzip):
(MockZip.read):
(TestExpectationUpdaterTest.test_update_test_expectations):
(TestExpectationUpdaterTest):
(TestExpectationUpdaterTest.test_update_win_future_test_expectations):

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

3 years ago[LayoutReloaded] Fix static position for floating boxes when they don't fit the curre...
zalan@apple.com [Fri, 6 Apr 2018 04:57:10 +0000 (04:57 +0000)]
[LayoutReloaded] Fix static position for floating boxes when they don't fit the current line
https://bugs.webkit.org/show_bug.cgi?id=184354

Reviewed by Antti Koivisto.

Do not shrink the current line with the floating box unless it is on the current line.

* LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js:
(InlineFormattingContext.prototype._handleFloatingBox):
(InlineFormattingContext.prototype._mapFloatingVerticalPosition):
* LayoutReloaded/FormattingContext/InlineFormatting/Line.js:
(Line.prototype.addFloatingBox):
(Line):
* LayoutReloaded/test/index.html:
* LayoutReloaded/test/inline-with-right-floats3.html: Added.

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

3 years agoWebContent process is calling CGDisplayUsesInvertedPolarity
bfulgham@apple.com [Fri, 6 Apr 2018 04:44:32 +0000 (04:44 +0000)]
WebContent process is calling CGDisplayUsesInvertedPolarity
https://bugs.webkit.org/show_bug.cgi?id=184337
<rdar://problem/39215702>

Reviewed by Zalan Bujtas.

The PlatformScreenMac code is still calling display-related routines directly, specifically
CGDisplayUsesInvertedPolarity and CGDisplayUsesForceToGray. These should be brokered from
the UIProcess.

There's also no reason to avoid the brokering behavior on current WebKit builds. Remove
the compile guards so all macOS builds use this behavior.

Finally, add some ProcessPrivilege assertions to guard against accidentally calling these
routines in the future.

Source/WebCore:

Tested by existing regression tests.

* platform/PlatformScreen.h:
* platform/ScreenProperties.h:
(WebCore::ScreenProperties::encode const): Add new values.
(WebCore::ScreenProperties::decode):
* platform/mac/PlatformScreenMac.mm:
(WebCore::displayID): Add assertion that this is not calling display-related routines in
the WebContent process.
(WebCore::firstScreen): Ditto.
(WebCore::screenProperties): Moved higher in the file so it can be reused. Add calls to
CGDisplayUsesInvertedPolarity and CGDisplayUsesForceToGray.
(WebCore::getScreenProperties): Moved higher in the file so it can be reused. Stop
double-hashing displayID.
(WebCore::screenIsMonochrome): Use cached values in WebContent process. Assert if this
code attempts a display-related routine in the WebContent process.
(WebCore::screenHasInvertedColors): Ditto.
(WebCore::screenDepth): Add assertion that this is not calling display-related routines in
the WebContent process.
(WebCore::screenDepthPerComponent): Ditto.
(WebCore::screenRect): Ditto.
(WebCore::screenAvailableRect): Ditto.
(WebCore::screen): Ditto.
(WebCore::screenColorSpace): Ditto.
(WebCore::screenSupportsExtendedColor): Ditto.

Source/WebKit:

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::initializeNewWebProcess): Activate screen brokering code for all builds.
* WebProcess/WebProcess.cpp: Ditto.
* WebProcess/WebProcess.h: Ditto.
* WebProcess/WebProcess.messages.in: Ditto.

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

3 years agoFix a bug introduced in r230295 that A/B test result is not shown.
dewei_zhu@apple.com [Fri, 6 Apr 2018 03:18:07 +0000 (03:18 +0000)]
Fix a bug introduced in r230295 that A/B test result is not shown.
https://bugs.webkit.org/show_bug.cgi?id=184350

Reviewed by Ryosuke Niwa.

result.label should be assigned in `TestGroup._computeRequestedCommitSets`.

* public/v3/models/test-group.js:
(TestGroup.prototype._computeRequestedCommitSets):

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

3 years ago[LayoutReloaded] Add support for right floating boxes in inline formatting context
zalan@apple.com [Fri, 6 Apr 2018 03:10:20 +0000 (03:10 +0000)]
[LayoutReloaded] Add support for right floating boxes in inline formatting context
https://bugs.webkit.org/show_bug.cgi?id=184351

Reviewed by Antti Koivisto.

* LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js:
(InlineFormattingContext.prototype._handleFloatingBox):
(InlineFormattingContext.prototype._mapFloatingVerticalPosition):
* LayoutReloaded/FormattingContext/InlineFormatting/Line.js:
(Line.prototype.addFloatingBox):
(Line):
* LayoutReloaded/test/index.html:
* LayoutReloaded/test/inline-with-right-float-simple.html: Added.
* LayoutReloaded/test/inline-with-right-floats2.html: Added.

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

3 years ago[test262] Mark line-terminator-normalisation-CR.js as a binary file.
ross.kirsling@sony.com [Fri, 6 Apr 2018 02:38:41 +0000 (02:38 +0000)]
[test262] Mark line-terminator-normalisation-CR.js as a binary file.
https://bugs.webkit.org/show_bug.cgi?id=184341

Reviewed by Yusuke Suzuki.

This test is all about CR line endings, but `svn-apply` can't deal with them.
Treating the file as binary ensures that its contents never are never shown in a diff.

* .gitattributes: Added.

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

3 years agoResource Load Statistics: Apply cookie blocking to setCookiesFromDOM()
wilander@apple.com [Fri, 6 Apr 2018 02:25:41 +0000 (02:25 +0000)]
Resource Load Statistics: Apply cookie blocking to setCookiesFromDOM()
https://bugs.webkit.org/show_bug.cgi?id=184346
<rdar://problem/39226036>

Reviewed by Brent Fulgham.

Since these cookies can't be seen and are not sent in requests, I
can't write an automated test for them. This really should have been
done as part of: https://bugs.webkit.org/show_bug.cgi?id=180682.
That said, I have tested this manually.

* platform/network/mac/CookieJarMac.mm:
(WebCore::setCookiesFromDOM):

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

3 years ago[LayoutReloaded] Move floating box to the next line when needed
zalan@apple.com [Fri, 6 Apr 2018 02:12:26 +0000 (02:12 +0000)]
[LayoutReloaded] Move floating box to the next line when needed
https://bugs.webkit.org/show_bug.cgi?id=184349

Reviewed by Antti Koivisto.

* LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js:
(InlineFormattingContext.prototype.layout):
(InlineFormattingContext.prototype._handleContent):
(InlineFormattingContext.prototype._handleText):
(InlineFormattingContext.prototype._handleFloatingBox):
(InlineFormattingContext.prototype._mapFloatingHorizontalPosition):
(InlineFormattingContext):
(InlineFormattingContext.prototype._handleFloatingBoxes): Deleted.
(InlineFormattingContext.prototype._floatingBoxes): Deleted.
* LayoutReloaded/FormattingContext/InlineFormatting/Line.js:
(Line.prototype.addTextLineBox):
(Line.prototype.addFloatingBox):
(Line):
* LayoutReloaded/Utils.js:
(LayoutRect.prototype.moveHorizontally):
(LayoutRect.prototype.moveVertically):
* LayoutReloaded/test/index.html:
* LayoutReloaded/test/inline-with-floats-when-they-dont-fit.html: Added.

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

3 years agoIsoHeapImpl not IsoHeapImplBase should add itself to AllIsoHeaps
sbarati@apple.com [Fri, 6 Apr 2018 01:29:26 +0000 (01:29 +0000)]
IsoHeapImpl not IsoHeapImplBase should add itself to AllIsoHeaps
https://bugs.webkit.org/show_bug.cgi?id=184174

Reviewed by Filip Pizlo.

Otherwise, another thread may see a non-fully formed IsoHeapImpl.

* bmalloc/IsoHeapImpl.cpp:
(bmalloc::IsoHeapImplBase::IsoHeapImplBase):
(bmalloc::IsoHeapImplBase::addToAllIsoHeaps):
* bmalloc/IsoHeapImpl.h:
* bmalloc/IsoHeapImplInlines.h:
(bmalloc::IsoHeapImpl<Config>::IsoHeapImpl):

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

3 years agoProcess Swap on Navigation causes many webpages to hang due to attempted process...
beidson@apple.com [Thu, 5 Apr 2018 23:18:01 +0000 (23:18 +0000)]
Process Swap on Navigation causes many webpages to hang due to attempted process swap for iframe navigations.
<rdar://problem/39162236> and https://bugs.webkit.org/show_bug.cgi?id=184318

Reviewed by Andy Estes.

Source/WebKit:

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedPolicyDecision): Don't consider a swap if the navigation is not in the main frame.

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
(-[PSONMessageHandler userContentController:didReceiveScriptMessage:]):
(-[PSONScheme addMappingFromURLString:toData:]):
(-[PSONScheme webView:startURLSchemeTask:]):

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

3 years agoWebContent process sometimes hangs in WebProcess::ensureNetworkProcessConnection
rniwa@webkit.org [Thu, 5 Apr 2018 21:21:50 +0000 (21:21 +0000)]
WebContent process sometimes hangs in WebProcess::ensureNetworkProcessConnection
https://bugs.webkit.org/show_bug.cgi?id=184326

Reviewed by Chris Dumez.

The hang was caused by UI process never sending the reply back to GetNetworkProcessConnection
due to m_pendingOutgoingMachMessage being set and the event handler for DISPATCH_MACH_SEND_POSSIBLE
never getting called. This is because the event handler registration happens asynchronously,
and may not have completed by the time we send the first IPC to the web content process
in which case it can timeout and we may never get the callback.

Fixed the hang by waiting for the event handler registration to be completed using
dispatch_source_set_registration_handler. To do this, this patch adds a new boolean instance variable,
m_isInitializingSendSource, to Connection which is set to true between the time mach port is created
and until the event handler registration has been completed. platformCanSendOutgoingMessages returns
false while m_isInitializingSendSource is set to prevent the attempt to send messages like we do when
m_pendingOutgoingMachMessage is set to true.

* Platform/IPC/Connection.h:
(IPC::Connection::m_isInitializingSendSource): Added.
* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::platformInvalidate): Set m_isInitializingSendSource to false.
(IPC::Connection::sendMessage): Assert that m_isInitializingSendSource is false.
(IPC::Connection::platformCanSendOutgoingMessages const): Return false if m_isInitializingSendSource
is set to true.
(IPC::Connection::sendOutgoingMessage): Assert that m_isInitializingSendSource is false.
(IPC::Connection::initializeSendSource): Set m_isInitializingSendSource to true temporarily until
dispatch_source_set_registration_handler's callback is called. Resume and send any pending outgoing
messages.
(IPC::Connection::resumeSendSource): Extracted from initializeSendSource.

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

3 years agoFolding anonymous blocks should not result in deleting content.
zalan@apple.com [Thu, 5 Apr 2018 21:14:31 +0000 (21:14 +0000)]
Folding anonymous blocks should not result in deleting content.
https://bugs.webkit.org/show_bug.cgi?id=184339
<rdar://problem/37327428>

Reviewed by Antti Koivisto.

Source/WebCore:

While folding multiple anonymous blocks (moving the children from next sibling over to previous sibling)
we should ensure that the block we are about to destroy does not gain new descendants.
In case of 4 sibling anonymous blocks (A B C D), while destroying B
1. we move C's children to A and destroy C.
2. While destroying C, we notice B and C as sibling anonymous blocks and we move
D's children over to B (even though B is going to be destroyed as we climb back on the stack).

In this patch, B is detached from the tree before we start moving renderers around so that a subsequent folding won't
find B anymore as a candidate.

Test: fast/block/crash-while-folding-anonymous-blocks.html

* rendering/updating/RenderTreeBuilderBlock.cpp:
(WebCore::RenderTreeBuilder::Block::detach):

LayoutTests:

* fast/block/crash-when-subtree-is-still-attached-expected.txt: Progressing. This test does not
intend to remove "foobar" text at all.
* fast/block/crash-while-folding-anonymous-blocks-expected.txt: Added.
* fast/block/crash-while-folding-anonymous-blocks.html: Added.

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

3 years agoMark Payment Request as "Supported" in features.json
aestes@apple.com [Thu, 5 Apr 2018 20:09:09 +0000 (20:09 +0000)]
Mark Payment Request as "Supported" in features.json
https://bugs.webkit.org/show_bug.cgi?id=184338

Reviewed by Anders Carlsson.

* features.json:

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

3 years agoAdd necessary colon to CFNetwork selector
wilander@apple.com [Thu, 5 Apr 2018 20:02:19 +0000 (20:02 +0000)]
Add necessary colon to CFNetwork selector
https://bugs.webkit.org/show_bug.cgi?id=184335
<rdar://problem/39213124>

Reviewed by Brent Fulgham.

* pal/spi/cf/CFNetworkSPI.h:
(setIgnoreHSTS):

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

3 years ago[MIPS] Optimize generated JIT code for branches
commit-queue@webkit.org [Thu, 5 Apr 2018 19:12:01 +0000 (19:12 +0000)]
[MIPS] Optimize generated JIT code for branches
https://bugs.webkit.org/show_bug.cgi?id=183130

Patch by Stanislav Ocovaj <stanislav.ocovaj@rt-rk.com> on 2018-04-05
Reviewed by Yusuke Suzuki.

The patch https://bugs.webkit.org/show_bug.cgi?id=101328 added two nop instructions to
branchEqual() and branchNotEqual() in order to allow the code generated by branchPtrWithPatch()
to be reverted back to branchPtrWithPatch after replacing it with a 4-instruction jump.
However, this adds a significant overhead for all other types of branches. Since these nop's
protect the code that is generated by branchPtrWithPatch, this function seems like a better
place to add them.

* assembler/MIPSAssembler.h:
(JSC::MIPSAssembler::repatchInt32):
(JSC::MIPSAssembler::revertJumpToMove):
* assembler/MacroAssemblerMIPS.h:
(JSC::MacroAssemblerMIPS::branchAdd32):
(JSC::MacroAssemblerMIPS::branchMul32):
(JSC::MacroAssemblerMIPS::branchSub32):
(JSC::MacroAssemblerMIPS::branchNeg32):
(JSC::MacroAssemblerMIPS::branchPtrWithPatch):
(JSC::MacroAssemblerMIPS::branchEqual):
(JSC::MacroAssemblerMIPS::branchNotEqual):

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

3 years agobmalloc StaticMutex's constructor should be constexpr
utatane.tea@gmail.com [Thu, 5 Apr 2018 18:07:28 +0000 (18:07 +0000)]
bmalloc StaticMutex's constructor should be constexpr
https://bugs.webkit.org/show_bug.cgi?id=180600

Reviewed by Mark Lam.

StaticMutex and Mutex can be unified. This patch changes std::atomic_flag in StaticMutex
to std::atomic<bool> to add constexpr constructor to StaticMutex. Then, StaticMutex can
be initialized in static storage without calling any static initializers.
And we also rename StaticMutex to Mutex simply.

* CMakeLists.txt:
* bmalloc.xcodeproj/project.pbxproj:
* bmalloc/AllIsoHeaps.cpp:
(bmalloc::AllIsoHeaps::AllIsoHeaps):
* bmalloc/AllIsoHeaps.h:
* bmalloc/Allocator.cpp:
(bmalloc::Allocator::tryAllocate):
(bmalloc::Allocator::allocateImpl):
(bmalloc::Allocator::reallocate):
(bmalloc::Allocator::refillAllocatorSlowCase):
(bmalloc::Allocator::allocateLarge):
* bmalloc/CryptoRandom.cpp:
(bmalloc::ARC4RandomNumberGenerator::ARC4RandomNumberGenerator):
* bmalloc/Deallocator.cpp:
(bmalloc::Deallocator::scavenge):
(bmalloc::Deallocator::processObjectLog):
(bmalloc::Deallocator::deallocateSlowCase):
* bmalloc/Deallocator.h:
(bmalloc::Deallocator::lineCache):
* bmalloc/DebugHeap.cpp:
(bmalloc::DebugHeap::DebugHeap):
* bmalloc/DebugHeap.h:
* bmalloc/Environment.cpp:
(bmalloc::Environment::Environment):
* bmalloc/Environment.h:
* bmalloc/Gigacage.cpp:
(Gigacage::disablePrimitiveGigacage):
(Gigacage::addPrimitiveDisableCallback):
(Gigacage::removePrimitiveDisableCallback):
* bmalloc/Heap.cpp:
(bmalloc::Heap::Heap):
(bmalloc::Heap::freeableMemory):
(bmalloc::Heap::scavenge):
(bmalloc::Heap::deallocateLineCache):
(bmalloc::Heap::allocateSmallChunk):
(bmalloc::Heap::allocateSmallPage):
(bmalloc::Heap::deallocateSmallLine):
(bmalloc::Heap::allocateSmallBumpRangesByMetadata):
(bmalloc::Heap::allocateSmallBumpRangesByObject):
(bmalloc::Heap::splitAndAllocate):
(bmalloc::Heap::tryAllocateLarge):
(bmalloc::Heap::allocateLarge):
(bmalloc::Heap::isLarge):
(bmalloc::Heap::largeSize):
(bmalloc::Heap::shrinkLarge):
(bmalloc::Heap::deallocateLarge):
(bmalloc::Heap::externalCommit):
(bmalloc::Heap::externalDecommit):
* bmalloc/Heap.h:
(bmalloc::Heap::mutex):
(bmalloc::Heap::allocateSmallBumpRanges):
(bmalloc::Heap::derefSmallLine):
* bmalloc/IsoDeallocator.h:
* bmalloc/IsoHeap.h:
* bmalloc/IsoTLSDeallocatorEntry.h:
* bmalloc/IsoTLSDeallocatorEntryInlines.h:
(bmalloc::IsoTLSDeallocatorEntry<Config>::IsoTLSDeallocatorEntry):
* bmalloc/IsoTLSInlines.h:
(bmalloc::IsoTLS::ensureHeap):
* bmalloc/IsoTLSLayout.cpp:
(bmalloc::IsoTLSLayout::IsoTLSLayout):
(bmalloc::IsoTLSLayout::add):
* bmalloc/IsoTLSLayout.h:
* bmalloc/Mutex.cpp: Renamed from Source/bmalloc/bmalloc/StaticMutex.cpp.
(bmalloc::Mutex::lockSlowCase):
* bmalloc/Mutex.h:
(bmalloc::sleep):
(bmalloc::waitUntilFalse):
(bmalloc::Mutex::try_lock):
(bmalloc::Mutex::lock):
(bmalloc::Mutex::unlock):
(bmalloc::Mutex::Mutex): Deleted.
* bmalloc/ObjectType.cpp:
(bmalloc::objectType):
* bmalloc/PerProcess.cpp:
(bmalloc::getPerProcessData):
* bmalloc/PerProcess.h:
(bmalloc::PerProcess::mutex):
(bmalloc::PerProcess::getSlowCase):
* bmalloc/Scavenger.cpp:
(bmalloc::Scavenger::Scavenger):
(bmalloc::Scavenger::scavenge):
(bmalloc::Scavenger::freeableMemory):
* bmalloc/Scavenger.h:
* bmalloc/SmallLine.h:
(bmalloc::SmallLine::refCount):
(bmalloc::SmallLine::ref):
(bmalloc::SmallLine::deref):
* bmalloc/SmallPage.h:
(bmalloc::SmallPage::refCount):
(bmalloc::SmallPage::hasFreeLines const):
(bmalloc::SmallPage::setHasFreeLines):
(bmalloc::SmallPage::ref):
(bmalloc::SmallPage::deref):
* bmalloc/StaticMutex.h: Removed.
* bmalloc/VMHeap.cpp:
(bmalloc::VMHeap::VMHeap):
* bmalloc/VMHeap.h:
* bmalloc/Zone.cpp:
(bmalloc::Zone::Zone):
* bmalloc/Zone.h:
* bmalloc/bmalloc.cpp:
(bmalloc::api::tryLargeZeroedMemalignVirtual):
(bmalloc::api::freeLargeVirtual):
(bmalloc::api::isEnabled):
(bmalloc::api::setScavengerThreadQOSClass):
* bmalloc/bmalloc.h:

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

3 years agoWebRTC data channel only applications require capture permissions for direct connections
youenn@apple.com [Thu, 5 Apr 2018 17:43:35 +0000 (17:43 +0000)]
WebRTC data channel only applications require capture permissions for direct connections
https://bugs.webkit.org/show_bug.cgi?id=174500
<rdar://problem/34134281>

Unreviewed.
Changed the code to suppress: "error: unused variable 'error' [-Werror,-Wunused-variable]"
Added some logging to this error case as a side bonus.

* NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
(WebKit::NetworkMDNSRegister::registerMDNSName):

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

3 years agoFix testcase (missing try/catch).
ryanhaddad@apple.com [Thu, 5 Apr 2018 17:37:49 +0000 (17:37 +0000)]
Fix testcase (missing try/catch).
https://bugs.webkit.org/show_bug.cgi?id=183657

Unreviewed.

* stress/large-unshift-splice.js

Patch by Robin Morisset <rmorisset@apple.com> on 2018-04-05

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

3 years agoUnreviewed, rolling out r230042.
cdumez@apple.com [Thu, 5 Apr 2018 17:32:08 +0000 (17:32 +0000)]
Unreviewed, rolling out r230042.

It is no longer needed now that it is safe to construct a
SecurityOrigin from an on-main thread

Reverted changeset:

"WebSocket::didReceiveMessage() may construct a SecurityOrigin
object on a non-main thread"
https://bugs.webkit.org/show_bug.cgi?id=184068
https://trac.webkit.org/changeset/230042

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

3 years agoRebaseline tests for High Sierra.
ryanhaddad@apple.com [Thu, 5 Apr 2018 17:22:32 +0000 (17:22 +0000)]
Rebaseline tests for High Sierra.

Unreviewed test gardening.

* platform/mac-sierra/fast/forms/input-table-expected.txt: Copied from LayoutTests/platform/mac/fast/forms/input-table-expected.txt.
* platform/mac-sierra/tables/mozilla/bugs/bug30692-expected.txt: Copied from LayoutTests/platform/mac/tables/mozilla/bugs/bug30692-expected.txt.
* platform/mac/fast/forms/input-table-expected.txt:
* platform/mac/tables/mozilla/bugs/bug30692-expected.txt:

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

3 years ago[WTF] Remove StaticLock
utatane.tea@gmail.com [Thu, 5 Apr 2018 17:22:21 +0000 (17:22 +0000)]
[WTF] Remove StaticLock
https://bugs.webkit.org/show_bug.cgi?id=184332

Reviewed by Mark Lam.

Source/JavaScriptCore:

* API/JSValue.mm:
(handerForStructTag):
* API/JSVirtualMachine.mm:
(+[JSVMWrapperCache addWrapper:forJSContextGroupRef:]):
(+[JSVMWrapperCache wrapperForJSContextGroupRef:]):
* API/glib/JSCVirtualMachine.cpp:
(addWrapper):
(removeWrapper):
* assembler/testmasm.cpp:
* b3/air/testair.cpp:
* b3/testb3.cpp:
* bytecode/SuperSampler.cpp:
* dfg/DFGCommon.cpp:
* dfg/DFGCommonData.cpp:
* dynbench.cpp:
* heap/MachineStackMarker.cpp:
(JSC::MachineThreads::tryCopyOtherThreadStacks):
* inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm:
(Inspector::RemoteTargetHandleRunSourceGlobal):
(Inspector::RemoteTargetQueueTaskOnGlobalQueue):
* interpreter/CLoopStack.cpp:
* parser/SourceProvider.cpp:
* profiler/ProfilerDatabase.cpp:
* profiler/ProfilerUID.cpp:
(JSC::Profiler::UID::create):
* runtime/IntlObject.cpp:
(JSC::numberingSystemsForLocale):
* runtime/JSLock.cpp:
* runtime/JSLock.h:
* runtime/SamplingProfiler.cpp:
(JSC::SamplingProfiler::registerForReportAtExit):
* runtime/VM.cpp:
* wasm/WasmFaultSignalHandler.cpp:

Source/WebCore:

No behavior change.

* Modules/webdatabase/Database.cpp:
(WebCore::Database::Database):
(WebCore::Database::performOpenAndVerify):
(WebCore::Database::closeDatabase):
(WebCore::Database::getCachedVersion const):
(WebCore::Database::setCachedVersion):
* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::openDatabaseMutex):
* Modules/webdatabase/DatabaseTracker.h:
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::allActiveWebSocketsMutex):
* Modules/websockets/WebSocket.h:
* bridge/objc/WebScriptObject.mm:
* crypto/CryptoAlgorithmRegistry.cpp:
(WebCore::CryptoAlgorithmRegistry::identifier):
(WebCore::CryptoAlgorithmRegistry::name):
(WebCore::CryptoAlgorithmRegistry::create):
(WebCore::CryptoAlgorithmRegistry::registerAlgorithm):
* dom/Node.cpp:
* platform/URL.cpp:
* platform/graphics/FontCache.cpp:
* platform/graphics/MediaPlayer.cpp:
* platform/ios/QuickLook.mm:
* platform/ios/WebSQLiteDatabaseTrackerClient.mm:
* platform/ios/wak/WebCoreThread.mm:
* platform/ios/wak/WebCoreThreadRun.cpp:
* platform/network/cf/LoaderRunLoopCF.cpp:
(WebCore::loaderRunLoop):
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlShareHandle::mutexFor):
* platform/network/curl/CurlContext.h:
* platform/sql/SQLiteDatabaseTracker.cpp:
(WebCore::SQLiteDatabaseTracker::incrementTransactionInProgressCount):
(WebCore::SQLiteDatabaseTracker::decrementTransactionInProgressCount):
* platform/text/TextEncodingRegistry.cpp:
(WebCore::buildBaseTextCodecMaps):
(WebCore::newTextCodec):
(WebCore::atomicCanonicalTextEncodingName):
* workers/WorkerThread.cpp:
(WebCore::WorkerThread::workerThreadCount):
(WebCore::WorkerThread::WorkerThread):
(WebCore::WorkerThread::~WorkerThread):
(WebCore::WorkerThread::releaseFastMallocFreeMemoryInAllThreads):

Source/WebKitLegacy/ios:

* WebCoreSupport/WebFixedPositionContent.mm:

Source/WebKitLegacy/mac:

* DOM/DOMInternal.mm:
(getDOMWrapper):
(addDOMWrapper):
(removeDOMWrapper):

Source/WebKitLegacy/win:

* WebKitQuartzCoreAdditions/CAView.cpp:
(WKQCA::CAView::releaseAllD3DResources):
* WebLocalizableStrings.cpp:

Source/WTF:

Now, WTF::StaticLock is `using StaticLock = Lock`. Lock just works
in either static storage and dynamic storage. Remove StaticLock and
always use Lock.

We also remove StaticWordLock and StaticReadWriteLock. And we add
WTF::RecursiveLock, which is RecursiveLockAdapter<Lock>.

* wtf/HashTable.cpp:
(WTF::HashTableStats::recordCollisionAtCount):
(WTF::HashTableStats::dumpStats):
* wtf/Language.cpp:
(WTF::userPreferredLanguages):
* wtf/Lock.h:
* wtf/MainThread.cpp:
(WTF::dispatchFunctionsFromMainThread):
(WTF::callOnMainThread):
* wtf/ParkingLot.cpp:
* wtf/ReadWriteLock.h:
* wtf/RecursiveLockAdapter.h:
* wtf/StackStats.cpp:
(WTF::StackStats::CheckPoint::CheckPoint):
(WTF::StackStats::CheckPoint::~CheckPoint):
(WTF::StackStats::probe):
(WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint):
(WTF::StackStats::LayoutCheckPoint::~LayoutCheckPoint):
* wtf/StackStats.h:
* wtf/ThreadMessage.cpp:
(WTF::sendMessageScoped):
* wtf/ThreadingPthreads.cpp:
* wtf/ThreadingWin.cpp:
* wtf/WordLock.h:
* wtf/cf/LanguageCF.cpp:
(WTF::languagePreferencesDidChange):
(WTF::platformUserPreferredLanguages):
* wtf/dtoa.cpp:
* wtf/text/AtomicStringImpl.cpp:
* wtf/text/StringView.cpp:
(WTF::StringView::invalidate):
(WTF::StringView::adoptUnderlyingString):
(WTF::StringView::setUnderlyingString):
* wtf/unicode/icu/CollatorICU.cpp:
(WTF::Collator::Collator):
(WTF::Collator::~Collator):
* wtf/win/LanguageWin.cpp:
(WTF::platformLanguage):

Tools:

* DumpRenderTree/JavaScriptThreading.cpp:

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

3 years ago[LayoutReloaded] Find the correct left edge for a line when floating boxes are in...
zalan@apple.com [Thu, 5 Apr 2018 15:50:26 +0000 (15:50 +0000)]
[LayoutReloaded] Find the correct left edge for a line when floating boxes are in parent formatting context.
https://bugs.webkit.org/show_bug.cgi?id=184330

Reviewed by Antti Koivisto.

In inline formatting context, the floating boxes can come from the parent (block) formatting context. Let's
take them into account when computing the line edges.

* LayoutReloaded/FormattingContext/FloatingContext.js:
(FloatingContext.prototype.left):
(FloatingContext.prototype.right):
* LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js:
(InlineFormattingContext.prototype._createNewLine):
(InlineFormattingContext.prototype._mapFloatingVerticalPosition):
(InlineFormattingContext.prototype._mapFloatingHorizontalPosition):
(InlineFormattingContext.prototype._mapFloatingPosition): Deleted.
* LayoutReloaded/test/index.html:
* LayoutReloaded/test/multiple-left-floats-on-line-from-parent-formatting-context.html: Added.

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

3 years ago[LayoutReloaded] Collect floating boxes in inline formatting context and layout them...
zalan@apple.com [Thu, 5 Apr 2018 15:21:15 +0000 (15:21 +0000)]
[LayoutReloaded] Collect floating boxes in inline formatting context and layout them first.
https://bugs.webkit.org/show_bug.cgi?id=184329

Reviewed by Antti Koivisto.

Let's do this for now. There might be some cases where this violates layout.

* LayoutReloaded/FormattingContext/FormattingContext.js:
(FormattingContext.prototype._outOfFlowDescendants):
(FormattingContext):
* LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js:
(InlineFormattingContext.prototype.layout):
(InlineFormattingContext.prototype._handleFloatingBoxes):
(InlineFormattingContext.prototype._handleFloatingBox):
(InlineFormattingContext.prototype._floatingBoxes):
(InlineFormattingContext):
* LayoutReloaded/test/index.html:
* LayoutReloaded/test/multiple-left-floats-on-line-simple.html: Added.

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

3 years agoREGRESSION(r229831): Test WebKit2.ProvisionalURLAfterWillSendRequestCallback times...
carlosgc@webkit.org [Thu, 5 Apr 2018 09:01:26 +0000 (09:01 +0000)]
REGRESSION(r229831): Test WebKit2.ProvisionalURLAfterWillSendRequestCallback times out since r229831
https://bugs.webkit.org/show_bug.cgi?id=184293

Reviewed by Alex Christensen.

The problem is that after willSendRequest callback changes the request, the load is cancelled while
transitioning to committed state. This happens because the load is not waiting for the response policy check, so
it continues and when transitioning to committed, FrameLoader::closeURL() invalidates the current policy check
that causes a load failure. The new request returned by the API doesn't have any requester, so it's no longer
considered a main resource load. In the network process the resource load task doesn't wait for the response
policy and continues the load, sending the data to the web process. Once the first data is received, the load
transitions to commit, but the response policy check is still ongoing. This can only happen when using the C API
(I don't know about the Cocoa API), but not with the GLib API because it doesn't allow to create a new request,
only to modify the passed in one. With the C API we loss other internal things of the request like the priority,
but I guess the most important one is the requester.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchWillSendRequest):

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

3 years ago[GTK] Add CMake package search for vpx and libevent libraries
commit-queue@webkit.org [Thu, 5 Apr 2018 08:00:49 +0000 (08:00 +0000)]
[GTK] Add CMake package search for vpx and libevent libraries
https://bugs.webkit.org/show_bug.cgi?id=184257

Patch by Alejandro G. Castro <alex@igalia.com> on 2018-04-05
Reviewed by Michael Catanzaro.

Add new cmake search files for libevent, vpx and alsa-lib, this
makes a cleaner detection of the libraries.

* CMakeLists.txt: Use the new cmake find files to detect the
package and add a better error message when the library is not
there.
* Source/cmake/FindAlsaLib.cmake: Added.
* Source/cmake/FindLibEvent.cmake: Added.
* Source/cmake/FindVpx.cmake: Added.

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

3 years agoUpdate TestExpectations for http/tests/media/video-buffered-range-contains-currentTim...
ryanhaddad@apple.com [Thu, 5 Apr 2018 05:00:46 +0000 (05:00 +0000)]
Update TestExpectations for http/tests/media/video-buffered-range-contains-currentTime.html.
https://trac.webkit.org/changeset/223243/webkit

Unreviewed test gardening.

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

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

3 years agoAdded UI to show potential regressions in chart with t-testing against segmentations.
dewei_zhu@apple.com [Thu, 5 Apr 2018 04:49:21 +0000 (04:49 +0000)]
Added UI to show potential regressions in chart with t-testing against segmentations.
https://bugs.webkit.org/show_bug.cgi?id=184131

Reviewed by Ryosuke Niwa.

Added UI in the chart-pane so that user can use new option in trendline which not only
shows the segmentation, but also t-test against potential changes indicated by segmentation.

Fix a bug in AnalysisTaskPage that chart is not updated when change type of task changes.

* public/shared/statistics.js: Added a function to t-test certain range based on segmentation results.
(Statistics.supportedOneSideTTestProbabilities):
(Statistics.findRangesForChangeDetectionsWithWelchsTTest): The argument `segmentations`, every 2 items in the list defines
segmentation, that is why the index incremental is 2 in this funcion.
* public/v3/components/chart-pane-base.js: Will select the range if user clicks on a suggested annotation.
(ChartPaneBase.prototype.configure):
(ChartPaneBase.prototype._didClickAnnotation):
* public/v3/components/chart-styles.js:
(ChartStyles.annotationFillStyleForTask): Added 'annotationFillStyleForTask' to determine the fillStyle for annotation based on change type of a analysis task.
* public/v3/components/interactive-time-series-chart.js:
(InteractiveTimeSeriesChart.prototype._findAnnotation): Also need to search among suggested annotaions.
* public/v3/components/time-series-chart.js: Introduced 'suggested annotaion' which does not have an existing task and is suggested by t-test based on segmentation.
(TimeSeriesChart):
(TimeSeriesChart.prototype.setSuggestedAnnotations):
(TimeSeriesChart.prototype.allAnnotations): Returns both annotations with and without analysis task.
(TimeSeriesChart.prototype._layoutAnnotationBars): Should take all annotations in the calculation.
* public/v3/models/measurement-set.js:
(MeasurementSet.prototype.metricId): Returns metric id.
* public/v3/models/metric.js:
(Metric.prototype.summarizeForValues): Added helper function to summarize a given value
* public/v3/models/test-group.js:
(TestGroup.prototype.compareTestResults): Adapted to use 'Metric.summarizeForValues'.
* public/v3/pages/chart-pane.js: Added 'Segmentation with t-test analysis' to 'ChartTrendLineTypes'.
(ChartPane.prototype._renderTrendLinePopover):
(ChartPane.prototype.async._updateTrendLine): make it an async function.
* unit-tests/statistics-tests.js: Added unit tests for 'findRangesForChangeDetectionsWithWelchsTTest'.

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

3 years agoAdd pointer profiling support to the DFG and supporting files.
mark.lam@apple.com [Thu, 5 Apr 2018 04:30:17 +0000 (04:30 +0000)]
Add pointer profiling support to the DFG and supporting files.
https://bugs.webkit.org/show_bug.cgi?id=184316
<rdar://problem/39188524>

Reviewed by Filip Pizlo.

1. Profile lots of pointers with PtrTags.

2. Remove PtrTag.cpp and make ptrTagName() into an inline function.  It's only
   used for debugging anyway, and not normally called in the code.  Making it
   an inline function prevents it from taking up code space in builds when not in
   use.

3. Change the call to the the arityFixupThunk in DFG code to be a near call.
   It doesn't need to be a far call.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* assembler/testmasm.cpp:
(JSC::testProbeModifiesProgramCounter):
* b3/B3LowerMacros.cpp:
* b3/air/AirCCallSpecial.cpp:
(JSC::B3::Air::CCallSpecial::generate):
* b3/air/AirCCallSpecial.h:
* b3/testb3.cpp:
(JSC::B3::testInterpreter):
* bytecode/AccessCase.cpp:
(JSC::AccessCase::generateImpl):
* bytecode/HandlerInfo.h:
(JSC::HandlerInfo::initialize):
* bytecode/PolymorphicAccess.cpp:
(JSC::PolymorphicAccess::regenerate):
* dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::compileExceptionHandlers):
(JSC::DFG::JITCompiler::link):
(JSC::DFG::JITCompiler::compileFunction):
(JSC::DFG::JITCompiler::noticeCatchEntrypoint):
* dfg/DFGJITCompiler.h:
(JSC::DFG::JITCompiler::appendCall):
* dfg/DFGOSREntry.cpp:
(JSC::DFG::prepareOSREntry):
* dfg/DFGOSRExit.cpp:
(JSC::DFG::reifyInlinedCallFrames):
(JSC::DFG::adjustAndJumpToTarget):
(JSC::DFG::OSRExit::emitRestoreArguments):
(JSC::DFG::OSRExit::compileOSRExit):
* dfg/DFGOSRExitCompilerCommon.cpp:
(JSC::DFG::handleExitCounts):
(JSC::DFG::reifyInlinedCallFrames):
(JSC::DFG::osrWriteBarrier):
(JSC::DFG::adjustAndJumpToTarget):
* dfg/DFGOperations.cpp:
* dfg/DFGSlowPathGenerator.h:
(JSC::DFG::CallResultAndArgumentsSlowPathGenerator::CallResultAndArgumentsSlowPathGenerator):
(JSC::DFG::CallResultAndArgumentsSlowPathGenerator::unpackAndGenerate):
(JSC::DFG::slowPathCall):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileMathIC):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::callOperation):
(JSC::DFG::SpeculativeJIT::appendCall):
(JSC::DFG::SpeculativeJIT::appendCallSetResult):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::cachedGetById):
(JSC::DFG::SpeculativeJIT::cachedGetByIdWithThis):
(JSC::DFG::SpeculativeJIT::cachedPutById):
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGThunks.cpp:
(JSC::DFG::osrExitThunkGenerator):
(JSC::DFG::osrExitGenerationThunkGenerator):
(JSC::DFG::osrEntryThunkGenerator):
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::emitDumbVirtualCall):
* jit/JIT.cpp:
(JSC::JIT::emitEnterOptimizationCheck):
(JSC::JIT::compileWithoutLinking):
* jit/JITCall.cpp:
(JSC::JIT::compileOpCallSlowCase):
* jit/JITMathIC.h:
(JSC::isProfileEmpty):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_catch):
(JSC::JIT::emitSlow_op_loop_hint):
* jit/JITOperations.cpp:
* jit/Repatch.cpp:
(JSC::linkSlowFor):
(JSC::linkFor):
(JSC::revertCall):
(JSC::unlinkFor):
(JSC::linkVirtualFor):
(JSC::linkPolymorphicCall):
* jit/ThunkGenerators.cpp:
(JSC::throwExceptionFromCallSlowPathGenerator):
(JSC::linkCallThunkGenerator):
(JSC::linkPolymorphicCallThunkGenerator):
(JSC::virtualThunkFor):
(JSC::arityFixupGenerator):
(JSC::unreachableGenerator):
* runtime/PtrTag.cpp: Removed.
* runtime/PtrTag.h:
(JSC::ptrTagName):
* runtime/VMEntryScope.cpp:
* wasm/js/WasmToJS.cpp:
(JSC::Wasm::wasmToJS):

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

3 years agoUnreviewed, rolling out r230283.
ryanhaddad@apple.com [Thu, 5 Apr 2018 03:15:46 +0000 (03:15 +0000)]
Unreviewed, rolling out r230283.

Caused webkitpy test failures.

Reverted changeset:

"Use CompletionHandlers for DelayedReplies"
https://bugs.webkit.org/show_bug.cgi?id=182269
https://trac.webkit.org/changeset/230283

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

3 years agowebrtc/video-update-often.html is flakily crashing on iOS simulator Debug
youenn@apple.com [Thu, 5 Apr 2018 02:40:49 +0000 (02:40 +0000)]
webrtc/video-update-often.html is flakily crashing on iOS simulator Debug
https://bugs.webkit.org/show_bug.cgi?id=184022

Reviewed by Jer Noble.

Remove client context once the new context identifier is set.
Covered by test no longer crashing locally.

* WebProcess/cocoa/PlaybackSessionManager.mm:
(WebKit::PlaybackSessionManager::setUpPlaybackControlsManager):

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

3 years agohttp/wpt/loading/redirect-headers.html is flaky
youenn@apple.com [Thu, 5 Apr 2018 02:06:10 +0000 (02:06 +0000)]
http/wpt/loading/redirect-headers.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=184317

Reviewed by Ryosuke Niwa.

Wait for the completion of the fetch to end the test.

* http/wpt/loading/redirect-headers.html:

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

3 years agoWebRTC data channel only applications require capture permissions for direct connections
youenn@apple.com [Thu, 5 Apr 2018 02:05:01 +0000 (02:05 +0000)]
WebRTC data channel only applications require capture permissions for direct connections
https://bugs.webkit.org/show_bug.cgi?id=174500
<rdar://problem/34134281>

Reviewed by Eric Carlson.

Source/WebCore:

Test: webrtc/datachannel/mdns-ice-candidates.html

Add support at PeerConnectionBackend to obfuscate any gathered host candidate
by replacing the IP address with an opaque name that can be resolved by MDNS.
An opaque name is generated for each IP address and is scoped by the document owning the peer connection object.

Add support to resolve any such MDNS ICE candidate.
A limit of 250 ms is fixed for the resolution to happen.
After 250 ms, the candidate is discarded.

Add an experimental flag around this feature, off by default.

* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::extractIPAddres):
(WebCore::PeerConnectionBackend::addIceCandidate):
(WebCore::PeerConnectionBackend::addIceCandidateSucceeded):
(WebCore::PeerConnectionBackend::addIceCandidateFailed):
(WebCore::PeerConnectionBackend::newICECandidate):
(WebCore::PeerConnectionBackend::doneGatheringCandidates):
(WebCore::PeerConnectionBackend::registerMDNSName):
(WebCore::PeerConnectionBackend::finishedRegisteringMDNSName):
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCIceCandidate.h:
(WebCore::RTCIceCandidate::setCandidate):
* Modules/mediastream/RTCPeerConnection.h:
* dom/Document.cpp:
(WebCore::Document::prepareForDestruction):
(WebCore::Document::suspend):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::mdnsICECandidatesEnabled const):
(WebCore::RuntimeEnabledFeatures::setMDNSICECandidatesEnabled):
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:

Source/WebKit:

Add support for MDNS registration and resolution by NetworkProcess.
WebProcess gives instruction to do the actual registrations/resolutions.

* CMakeLists.txt:
* DerivedSources.make:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
(WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
* NetworkProcess/NetworkConnectionToWebProcess.h:
(WebKit::NetworkConnectionToWebProcess::mdnsRegister):
* NetworkProcess/webrtc/NetworkMDNSRegister.cpp: Added.
(WebKit::NetworkMDNSRegister::NetworkMDNSRegister):
(WebKit::NetworkMDNSRegister::~NetworkMDNSRegister):
(WebKit::NetworkMDNSRegister::unregisterMDNSNames):
(WebKit::PendingRegistrationRequest::PendingRegistrationRequest):
(WebKit::registerMDNSNameCallback):
(WebKit::NetworkMDNSRegister::registerMDNSName):
(WebKit::PendingResolutionRequest::PendingResolutionRequest):
(WebKit::PendingResolutionRequest::~PendingResolutionRequest):
(WebKit::PendingResolutionRequest::timeout):
(WebKit::resolveMDNSNameCallback):
(WebKit::NetworkMDNSRegister::resolveMDNSName):
* NetworkProcess/webrtc/NetworkMDNSRegister.h: Added.
* NetworkProcess/webrtc/NetworkMDNSRegister.messages.in: Added.
* Shared/WebPreferences.yaml:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetWebRTCMDNSICECandidatesEnabled):
(WKPreferencesGetWebRTCMDNSICECandidatesEnabled):
* UIProcess/API/C/WKPreferencesRef.h:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::didReceiveMessage):
* WebProcess/Network/webrtc/LibWebRTCNetwork.h:
(WebKit::LibWebRTCNetwork::mdnsRegister):
* WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
(WebKit::LibWebRTCProvider::unregisterMDNSNames):
(WebKit::LibWebRTCProvider::registerMDNSName):
(WebKit::LibWebRTCProvider::resolveMDNSName):
* WebProcess/Network/webrtc/LibWebRTCProvider.h:
* WebProcess/Network/webrtc/WebMDNSRegister.cpp: Added.
(WebKit::WebMDNSRegister::finishedRegisteringMDNSName):
(WebKit::WebMDNSRegister::finishedResolvingMDNSName):
(WebKit::WebMDNSRegister::unregisterMDNSNames):
(WebKit::WebMDNSRegister::registerMDNSName):
(WebKit::WebMDNSRegister::resolveMDNSName):
* WebProcess/Network/webrtc/WebMDNSRegister.h: Added.
* WebProcess/Network/webrtc/WebMDNSRegister.messages.in: Added.

Tools:

Adding options to enable MDNS ICE candidates.

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setMediaDevicesEnabled):
(WTR::TestRunner::setMDNSICECandidatesEnabled):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):

LayoutTests:

* webrtc/datachannel/mdns-ice-candidates-expected.txt: Added.
* webrtc/datachannel/mdns-ice-candidates.html: Added.

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

3 years agoMark storage/websql/database-lock-after-reload.html as flaky.
ryanhaddad@apple.com [Thu, 5 Apr 2018 01:03:05 +0000 (01:03 +0000)]
Mark storage/websql/database-lock-after-reload.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=173928

Unreviewed test gardening.

* platform/ios/TestExpectations:

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

3 years agoDisable failing WKWebViewAutofillTests
ryanhaddad@apple.com [Thu, 5 Apr 2018 01:03:02 +0000 (01:03 +0000)]
Disable failing WKWebViewAutofillTests
https://bugs.webkit.org/show_bug.cgi?id=184196

Unreviewed test gardening.

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

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

3 years agoREGRESSION(r222563): removed DoubleReal type check causes tons of crashes because...
fpizlo@apple.com [Thu, 5 Apr 2018 00:30:48 +0000 (00:30 +0000)]
REGRESSION(r222563): removed DoubleReal type check causes tons of crashes because CSE has never known how to handle SaneChain
https://bugs.webkit.org/show_bug.cgi?id=184319

Reviewed by Saam Barati.

JSTests:

* stress/array-push-nan-to-double-array-cse-sane-and-insane-chain.js: Added.
(foo):
(bar):
* stress/array-push-nan-to-double-array.js: Added.
(foo):
(bar):

Source/JavaScriptCore:

In r222581, we replaced type checks about DoubleReal in ArrayPush in the DFG/FTL backends with
assertions. That's correct because FixupPhase was emitting those checks as Check(DoubleRealRep:) before
the ArrayPush.

But this revealed a longstanding CSE bug: CSE will happily match a SaneChain GetByVal with a InBounds
GetByVal. SaneChain can return NaN while InBounds cannot. This means that if we first use AI to
eliminate the Check(DoubleRealRep:) based on the input being a GetByVal(InBounds) but then replace that
with a GetByVal(SaneChain), then we will hit the assertion.

This teaches CSE to not replace GetByVal(InBounds) with GetByVal(SaneChain) and vice versa. That gets
tricky because PutByVal can match either. So, we use the fact that it's legal for a store to def() more
than once: PutByVal now defs() a HeapLocation for InBounds and a HeapLocation for SaneChain.

* dfg/DFGCSEPhase.cpp:
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGHeapLocation.cpp:
(WTF::printInternal):
* dfg/DFGHeapLocation.h:
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileArrayPush):

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

3 years ago[Cocoa] WebDriver: test imported/w3c/webdriver/tests/cookies/add_cookie.py::test_add_...
bburg@apple.com [Thu, 5 Apr 2018 00:22:09 +0000 (00:22 +0000)]
[Cocoa] WebDriver: test imported/w3c/webdriver/tests/cookies/add_cookie.py::test_add_non_session_cookie fails
https://bugs.webkit.org/show_bug.cgi?id=184314
<rdar://problem/39186578>

Reviewed by Timothy Hatcher.

Covered by several tests in add_cookie.py per the bug title.

* platform/network/cocoa/CookieCocoa.mm:
(WebCore::Cookie::operator NSHTTPCookie * const):
By converting an integral UNIX timestamp to |maxAge| fractional seconds into the future, we introduce unwanted
precision that is truncated when switching back to a UNIX timestamp later. Always round up maxAge so that
the truncated value and actual value are the same.

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

3 years agoResync idlharness web-platform-tests up to 94b33b573a069ae5170104ca581a354a35762536
commit-queue@webkit.org [Wed, 4 Apr 2018 23:33:06 +0000 (23:33 +0000)]
Resync idlharness web-platform-tests up to 94b33b573a069ae5170104ca581a354a35762536
https://bugs.webkit.org/show_bug.cgi?id=184278

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

LayoutTests/imported/w3c:

* web-platform-tests/FileAPI/idlharness-expected.txt:
* web-platform-tests/FileAPI/idlharness.html:
* web-platform-tests/FileAPI/idlharness.idl: Removed.
* web-platform-tests/FileAPI/idlharness.worker.js:
* web-platform-tests/IndexedDB/interfaces.any-expected.txt: Copied from LayoutTests/imported/w3c/web-platform-tests/IndexedDB/interfaces.worker-expected.txt.
* web-platform-tests/IndexedDB/interfaces.any.html: Copied from LayoutTests/imported/w3c/web-platform-tests/IndexedDB/interfaces.worker.html.
* web-platform-tests/IndexedDB/interfaces.any.js: Added.
* web-platform-tests/IndexedDB/interfaces.any.worker-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/IndexedDB/interfaces.worker-expected.txt.
* web-platform-tests/IndexedDB/interfaces.any.worker.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/WebCryptoAPI/idlharness.worker.html.
* web-platform-tests/IndexedDB/interfaces.html: Removed.
* web-platform-tests/IndexedDB/interfaces.idl: Removed.
* web-platform-tests/IndexedDB/interfaces.worker.js: Removed.
* web-platform-tests/WebCryptoAPI/WebCryptoAPI.idl: Removed.
* web-platform-tests/WebCryptoAPI/idlharness.html: Removed.
* web-platform-tests/WebCryptoAPI/idlharness.https.html:
* web-platform-tests/WebCryptoAPI/idlharness.https.worker-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/WebCryptoAPI/idlharness.worker-expected.txt.
* web-platform-tests/WebCryptoAPI/idlharness.https.worker.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/IndexedDB/interfaces.worker.html.
* web-platform-tests/WebCryptoAPI/idlharness.https.worker.js: Renamed from LayoutTests/imported/w3c/web-platform-tests/WebCryptoAPI/idlharness.worker.js.
* web-platform-tests/WebIDL/interfaces-expected.txt:
* web-platform-tests/XMLHttpRequest/interfaces-expected.txt:
* web-platform-tests/background-fetch/interfaces-expected.txt:
* web-platform-tests/background-fetch/interfaces.html:
* web-platform-tests/background-fetch/interfaces.idl: Removed.
* web-platform-tests/background-fetch/interfaces.worker.js:
(promise_test):
* web-platform-tests/css/geometry/interfaces-expected.txt:
* web-platform-tests/css/geometry/interfaces.html:
* web-platform-tests/css/geometry/interfaces.worker-expected.txt:
* web-platform-tests/css/geometry/support/interfaces.js:
(doTest):
* web-platform-tests/cssom-view/interfaces-expected.txt:
* web-platform-tests/cssom/interfaces-expected.txt:
* web-platform-tests/dom/interfaces-expected.txt:
* web-platform-tests/encoding/idlharness-expected.txt:
* web-platform-tests/encoding/idlharness.html:
* web-platform-tests/encrypted-media/EncryptedMediaExtensions.idl: Removed.
* web-platform-tests/encrypted-media/idlharness.https-expected.txt: Added.
* web-platform-tests/encrypted-media/idlharness.https.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/encrypted-media/idlharness.html.
* web-platform-tests/eventsource/interfaces-expected.txt:
* web-platform-tests/eventsource/interfaces.html:
* web-platform-tests/fetch/api/request/request-idl.html:
* web-platform-tests/fetch/api/response/response-idl.html:
* web-platform-tests/hr-time/idlharness-expected.txt:
* web-platform-tests/hr-time/idlharness.html:
* web-platform-tests/html/webappapis/animation-frames/idlharness-expected.txt:
* web-platform-tests/html/webappapis/animation-frames/idlharness.html:
* web-platform-tests/interfaces/encoding.idl: Added.
* web-platform-tests/mediacapture-streams/MediaDevices-IDL-all-expected.txt:
* web-platform-tests/mediacapture-streams/MediaDevices-IDL-enumerateDevices-expected.txt:
* web-platform-tests/notifications/interfaces-expected.txt:
* web-platform-tests/notifications/interfaces.html:
* web-platform-tests/payment-request/interfaces.https-expected.txt:
* web-platform-tests/payment-request/interfaces.https.html:
* web-platform-tests/resources/idlharness.js:
(self.IdlHarnessError):
(IdlHarnessError.prototype.toString):
(IdlArray.prototype.add_untested_idls):
(IdlArray.prototype.internal_add_idls):
(IdlArray.prototype.recursively_get_implements):
(IdlArray.prototype.recursively_get_includes):
(set exposed_in):
(IdlArray.prototype.assert_throws):
(IdlArray.prototype.test):
(IdlArray.prototype.assert_type_is):
(IdlInterface.prototype.test_self):
(IdlInterface.prototype.test_member_const):
(IdlInterface.prototype.test_to_json_operation):
(IdlInterface.prototype.test_object):
* web-platform-tests/service-workers/service-worker/interfaces-window.https-expected.txt:
* web-platform-tests/url/interfaces.any-expected.txt:
* web-platform-tests/url/interfaces.any.js:
(promise_test.async):
* web-platform-tests/url/interfaces.any.worker-expected.txt:
* web-platform-tests/webrtc/RTCPeerConnection-idl-expected.txt: Removed.
* web-platform-tests/webrtc/RTCPeerConnection-idl.html: Removed.
* web-platform-tests/webrtc/datachannel-idlharness-expected.txt: Removed.
* web-platform-tests/webrtc/datachannel-idlharness.html: Removed.
* web-platform-tests/webrtc/interfaces.https-expected.txt:
* web-platform-tests/webrtc/interfaces.https.html:

LayoutTests:

* TestExpectations:
* http/wpt/webauthn/idl.https.html:
* platform/ios/TestExpectations:
* platform/mac/TestExpectations:

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

3 years agoVersioning.
jmarcell@apple.com [Wed, 4 Apr 2018 23:28:14 +0000 (23:28 +0000)]
Versioning.

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