WebKit-https.git
2 years agoDon't invalidate composition for style changes in non-composited layers
antti@apple.com [Thu, 13 Apr 2017 23:20:50 +0000 (23:20 +0000)]
Don't invalidate composition for style changes in non-composited layers
https://bugs.webkit.org/show_bug.cgi?id=170805
<rdar://problem/31606185>

Reviewed by Simon Fraser.

Source/WebCore:

Test: compositing/updates/animation-non-composited.html

In most cases they can't affect composition. Composition updates are expensive, this can
save a lot of work (tumblr.com animations hit this at the moment).

* rendering/RenderElement.h:
(WebCore::RenderElement::createsGroup):
(WebCore::RenderElement::createsGroupForStyle):

    Factor to a static function so we can test style directly.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::layerStyleChanged):
(WebCore::RenderLayerCompositor::styleChangeMayAffectIndirectCompositingReasons):

    Test if style change might cause compositing change that can't be determined without compositing update.

* rendering/RenderLayerCompositor.h:

LayoutTests:

* compositing/updates/animation-non-composited-expected.txt: Added.
* compositing/updates/animation-non-composited.html: Added.

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

2 years agowebkitpy: Ignore previously launched pid when system is under stress
jbedard@apple.com [Thu, 13 Apr 2017 23:20:03 +0000 (23:20 +0000)]
webkitpy: Ignore previously launched pid when system is under stress
https://bugs.webkit.org/show_bug.cgi?id=170741

Reviewed by David Kilzer.

We have seen cases where xcrun simctl launch will return a pid of a previous
process and the process will appear to be running even though it is crashing.
Ensure that the PID that simulator_process is receiving is not the pid of the
previously run process.

* Scripts/webkitpy/port/simulator_process.py:
(SimulatorProcess._start): Check to make sure we aren't receiving an old PID.

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

2 years agoallocationSize should use safe arithmetic by default
oliver@apple.com [Thu, 13 Apr 2017 23:13:41 +0000 (23:13 +0000)]
allocationSize should use safe arithmetic by default
https://bugs.webkit.org/show_bug.cgi?id=170804

Reviewed by JF Bastien.

Make all allocationSize() functions work in terms
of Checked<size_t>

Source/JavaScriptCore:

* runtime/DirectArguments.h:
(JSC::DirectArguments::offsetOfSlot):
(JSC::DirectArguments::allocationSize):
* runtime/HashMapImpl.h:
(JSC::HashMapBuffer::allocationSize):
* runtime/JSArray.h:
(JSC::JSArray::allocationSize):
* runtime/JSArrayBufferView.h:
(JSC::JSArrayBufferView::allocationSize):
* runtime/JSAsyncFunction.h:
(JSC::JSAsyncFunction::allocationSize):
* runtime/JSFixedArray.h:
(JSC::JSFixedArray::allocationSize):
* runtime/JSFunction.h:
(JSC::JSFunction::allocationSize):
* runtime/JSGeneratorFunction.h:
(JSC::JSGeneratorFunction::allocationSize):
* runtime/JSModuleNamespaceObject.h:
* runtime/JSObject.h:
(JSC::JSFinalObject::allocationSize):
* runtime/JSWrapperObject.h:
(JSC::JSWrapperObject::allocationSize):
* runtime/ScopedArguments.h:
(JSC::ScopedArguments::allocationSize):
* runtime/VM.h:
(JSC::ScratchBuffer::allocationSize):
* wasm/js/JSWebAssemblyCodeBlock.h:
(JSC::JSWebAssemblyCodeBlock::offsetOfImportStubs):
(JSC::JSWebAssemblyCodeBlock::allocationSize):
* wasm/js/JSWebAssemblyInstance.h:
(JSC::JSWebAssemblyInstance::allocationSize):

Source/WTF:

* wtf/text/StringImpl.h:
(WTF::StringImpl::allocationSize):
(WTF::StringImpl::tailOffset):

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

2 years agoMark webrtc/video-mute.html as flaky.
ryanhaddad@apple.com [Thu, 13 Apr 2017 22:48:13 +0000 (22:48 +0000)]
Mark webrtc/video-mute.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=170704

Unreviewed test gardening.

* TestExpectations:

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

2 years agoMark media/media-controls-timeline-updates-when-hovered.html as flaky.
ryanhaddad@apple.com [Thu, 13 Apr 2017 22:24:34 +0000 (22:24 +0000)]
Mark media/media-controls-timeline-updates-when-hovered.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=165553

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

2 years agoMark media/track/track-cue-rendering-rtl.html as flaky.
ryanhaddad@apple.com [Thu, 13 Apr 2017 22:15:17 +0000 (22:15 +0000)]
Mark media/track/track-cue-rendering-rtl.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=170831

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

2 years agoMark inspector/sampling-profiler/named-function-expression.html as flaky.
ryanhaddad@apple.com [Thu, 13 Apr 2017 22:11:02 +0000 (22:11 +0000)]
Mark inspector/sampling-profiler/named-function-expression.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=170830

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

2 years agoWebAssembly: manage memory better
jfbastien@apple.com [Thu, 13 Apr 2017 21:48:42 +0000 (21:48 +0000)]
WebAssembly: manage memory better
https://bugs.webkit.org/show_bug.cgi?id=170628

Reviewed by Keith Miller, Michael Saboff.

JSTests:

* wasm/Builder.js: move a helper out so tests can use it
(export.default.Builder.prototype._registerSectionBuilders.const.section.in.WASM.description.section.switch.section.case.string_appeared_here.this.section):
* wasm/WASM.js: add utilities to classify opcodes
(export.opcodes):
(export.const.memoryAccessInfo.op.const.sign):
* wasm/function-tests/memory-access-past-4gib.js: Added. This test
fails before this patch.
(const.op.of.WASM.opcodes):
* wasm/function-tests/memory-many.js: Added. This simple tests
just shouldn't crash. In verbose mode it's useful at determining
if the GC falls behind or not.
* wasm/function-tests/memory-multiagent.js: Added. Emulate postMessage.
(const.startAgents.numAgentsToStart.a.agent.receiveBroadcast):
(const.startAgents.numAgentsToStart.a.write.const.idx.Math.random):
(const.broadcastToAgents):
* wasm/js-api/extension-MemoryMode.js: verbose logging.
(testMemoryNoMax):
(testMemory):
(testInstanceNoMemory):
(testInstanceNoMax):
(testInstance):
* wasm/utilities.js: move a utility here.

Source/JavaScriptCore:

WebAssembly fast memories weren't managed very well. This patch
refactors it and puts us in a good position to further improve our
fast memory handling in the future.

We now cache fast memories at a process granularity, but make sure
that they don't consume dirty pages. We add a cap to the total
number of allocated fast memories to avoid ASLR degradation.

We teach the GC about memories as a kind of resource it should
care about because it didn't have visibility into the amount of
memory each represented. This allows benchmarks which allocate
memories back-to-back to reliably get fast memories 100% of the
time, even on a system under load, which wasn't the case
before. This reliability yields roughly 8% perf bump on x86-64
WasmBench.

The GC heuristic is as follows: each time we allocate a fast
memory we notify the GC, which then keeps track of the total
number of fast memories allocated since it last GC'd. We
separately keep track of the total number of fast memories which
have ever existed at any point in time (cached + allocated). This
is a monotonically-increasing high watermark. The GC will force a
full collection if, since it last ran, half or more of the high
watermark of fast memories was allocated.

At the same time, if we fail obtaining a fast memory from the
cache we do a GC to try to find one. If that fails we'll allocate
a new one (this can also fail, then we go to slow memory). This
can also be improved, but it's a good start.

This currently disables fast memories on iOS because getting fast
memories isn't a guaranteed thing. Rather, we get quite a few of
them and achieve significant speedups, but benchmarks which
allocate memories back-to-back end up falling behind because the
GC can conservatively hold onto memories, which then yields a perf
cliff. That cliff isn't reliable, WasmBench gets roughly 10 of 18
fast memories when in theory it should get all of them fast (as
MacOS does). The patch significantly improves the state of iOS
though, and in a follow-up we could re-enable fast memories.

Part of this good positioning is a facility to pre-allocate fast
memories very early at startup, before any fragmentation
occurs. This is currently disabled but worked extremely reliably
on iOS. Once we fix the above issues we'll want to re-visit and
turn on pre-allocation.

We also avoid locking for fast memory identification when
performing signal handling. I'm very nervous about acquiring locks
in a signal handler because in general signals can happen when
we've messed up. This isn't the case with fast memories: we're
raising a signal on purpose and handling it. However this doesn't
mean we won't mess up elsewhere! This will get more complicated
once we add support for multiple threads sharing memories and
being able to grow their memories. One example: the code calls
CRASH(), which executes the following code in release:

    *(int *)(uintptr_t)0xbbadbeef = 0;

This is a segfault, which our fast memory signal handler tries to
handle. It does so by first figuring out whether 0xbbadbeef is in
a fast memory region, reqiring a lock. If we CRASH() while holding
the lock then our thread self-deadlocks, giving us no crash report
and a bad user experience.

Avoiding a lock therefore it's not about speed or reduced
contention. In fact, I'd use something else than a FIFO if these
were a concern. We're also doing syscalls, which dwarf any locking
cost.

We now only allocate 4GiB + redzone of 64k * 128 for fast memories
instead of 8GiB. This patch reuses the logic from
B3::WasmBoundsCheck to perform bounds checks when accesses could
exceed the redzone. We'll therefore benefit from CSE goodness when
it reaches WasmBoundsCheck. See bug #163469.

* b3/B3LowerToAir.cpp: fix a baaaaddd bug where unsigned->signed
conversion allowed out-of-bounds reads by -2GiB. I'll follow-up in
bug #170692 to prevent this type of bug once and for all.
(JSC::B3::Air::LowerToAir::lower):
* b3/B3Validate.cpp: update WasmBoundsCheck validation.
* b3/B3Value.cpp:
(JSC::B3::Value::effects): update WasmBoundsCheck effects.
* b3/B3WasmBoundsCheckValue.cpp:
(JSC::B3::WasmBoundsCheckValue::WasmBoundsCheckValue):
(JSC::B3::WasmBoundsCheckValue::redzoneLimit):
(JSC::B3::WasmBoundsCheckValue::dumpMeta):
* b3/B3WasmBoundsCheckValue.h:
(JSC::B3::WasmBoundsCheckValue::maximum):
* b3/air/AirCustom.cpp:
(JSC::B3::Air::WasmBoundsCheckCustom::isValidForm):
* b3/testb3.cpp:
(JSC::B3::testWasmBoundsCheck):
* heap/Heap.cpp:
(JSC::Heap::Heap):
(JSC::Heap::reportWebAssemblyFastMemoriesAllocated):
(JSC::Heap::webAssemblyFastMemoriesThisCycleAtThreshold):
(JSC::Heap::updateAllocationLimits):
(JSC::Heap::didAllocateWebAssemblyFastMemories):
(JSC::Heap::shouldDoFullCollection):
(JSC::Heap::collectIfNecessaryOrDefer):
* heap/Heap.h:
* runtime/InitializeThreading.cpp:
(JSC::initializeThreading):
* runtime/Options.cpp:
* runtime/Options.h:
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::fixupPointerPlusOffset):
(JSC::Wasm::B3IRGenerator::B3IRGenerator):
(JSC::Wasm::B3IRGenerator::emitCheckAndPreparePointer):
(JSC::Wasm::B3IRGenerator::emitLoadOp):
(JSC::Wasm::B3IRGenerator::emitStoreOp):
(JSC::Wasm::createJSToWasmWrapper):
* wasm/WasmFaultSignalHandler.cpp:
(JSC::Wasm::trapHandler):
* wasm/WasmMemory.cpp: Rewrite.
(JSC::Wasm::makeString):
(JSC::Wasm::Memory::initializePreallocations):
(JSC::Wasm::Memory::createImpl):
(JSC::Wasm::Memory::create):
(JSC::Wasm::Memory::~Memory):
(JSC::Wasm::Memory::fastMappedRedzoneBytes):
(JSC::Wasm::Memory::fastMappedBytes):
(JSC::Wasm::Memory::maxFastMemoryCount):
(JSC::Wasm::Memory::addressIsInActiveFastMemory):
(JSC::Wasm::Memory::grow):
* wasm/WasmMemory.h:
(Memory::maxFastMemoryCount):
(Memory::addressIsInActiveFastMemory):
* wasm/js/JSWebAssemblyInstance.cpp:
(JSC::JSWebAssemblyInstance::finishCreation):
(JSC::JSWebAssemblyInstance::visitChildren):
(JSC::JSWebAssemblyInstance::globalMemoryByteSize):
* wasm/js/JSWebAssemblyInstance.h:
* wasm/js/JSWebAssemblyMemory.cpp:
(JSC::JSWebAssemblyMemory::grow):
(JSC::JSWebAssemblyMemory::finishCreation):
(JSC::JSWebAssemblyMemory::visitChildren):

Source/WebCore:

Re-use a VM tag which was intended for JavaScript core, was then
used by our GC, and is now unused. If I don't do this then
WebAssembly fast memories will make vmmap look super weird because
it'll look like multi-gigabyte of virtual memory are allocated as
part of our process' regular memory!

Separately I need to update vmmap and other tools to print the
right name. Right now this tag gets identified as "JS garbage
collector".

* page/ResourceUsageData.cpp:
(WebCore::ResourceUsageData::ResourceUsageData):
* page/ResourceUsageData.h:
* page/cocoa/ResourceUsageOverlayCocoa.mm:
(WebCore::HistoricResourceUsageData::HistoricResourceUsageData):
* page/cocoa/ResourceUsageThreadCocoa.mm:
(WebCore::displayNameForVMTag):
(WebCore::categoryForVMTag):

Source/WTF:

Re-use a VM tag which was intended for JavaScript core, was then
used by our GC, and is now unused. If I don't do this then
WebAssembly fast memories will make vmmap look super weird because
it'll look like multi-gigabyte of virtual memory are allocated as
part of our process' regular memory!

Separately I need to update vmmap and other tools to print the
right name. Right now this tag gets identified as "JS garbage
collector".

* wtf/OSAllocator.h:
* wtf/VMTags.h:

Websites/webkit.org:

* docs/b3/intermediate-representation.html: typos

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

2 years agoAdd ios-simulator baseline for imported/w3c/web-platform-tests/fetch/api/request...
ryanhaddad@apple.com [Thu, 13 Apr 2017 21:41:25 +0000 (21:41 +0000)]
Add ios-simulator baseline for imported/w3c/web-platform-tests/fetch/api/request/request-cache-only-if-cached.html.

Unreviewed test gardening.

* platform/ios-simulator/imported/w3c/web-platform-tests/fetch/api/request/request-cache-only-if-cached-expected.txt: Added.

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

2 years agoMark http/tests/inspector/network/resource-request-headers.html as flaky.
ryanhaddad@apple.com [Thu, 13 Apr 2017 21:39:07 +0000 (21:39 +0000)]
Mark http/tests/inspector/network/resource-request-headers.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=170702

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

2 years agoUpdate the comments for the number of bits in RenderStyle::InheritedFlags.
rniwa@webkit.org [Thu, 13 Apr 2017 21:26:08 +0000 (21:26 +0000)]
Update the comments for the number of bits in RenderStyle::InheritedFlags.

Rubber-stamped by Zalan Bujtas

* rendering/style/RenderStyle.h:

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

2 years agoMark media/modern-media-controls/volume-support/volume-support-click.html as flaky.
ryanhaddad@apple.com [Thu, 13 Apr 2017 21:00:43 +0000 (21:00 +0000)]
Mark media/modern-media-controls/volume-support/volume-support-click.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=164229

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

2 years agoBuild ImageDiff with host SDK
jbedard@apple.com [Thu, 13 Apr 2017 20:08:35 +0000 (20:08 +0000)]
Build ImageDiff with host SDK
https://bugs.webkit.org/show_bug.cgi?id=168531

Reviewed by David Kilzer.

ImageDiff should be built and run with the host SDK, not the target SDK.
Build ImageDiff twice, once for the target SDK and once for the host
as an intermediate step towards building for only the host SDK.

* ImageDiff/Makefile: Added.
* Makefile: Add ImageDiff to list of targets.
* Scripts/build-imagediff: Build bmalloc and WTF for the host.
* Scripts/build-webkit: Build ImageDiff for host.
* Scripts/webkitdirs.pm: Export extractNonMacOSHostConfiguration.
(extractNonMacOSHostConfiguration): Remove non-host configuration data from the array.
* Scripts/webkitperl/webkitdirs_unittest/extractNonMacOSHostConfiguration.pl: Added.
* Scripts/webkitpy/port/base.py:
(Port.check_build): Attempt to build image diff if not found.
(Port.check_image_diff): Enable logging flag.
(Port._build_image_diff): Allow webkitpy to build image-diff during testing.

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

2 years agoWeb Inspector: RTL: goto arrow is floated to the wrong side
bburg@apple.com [Thu, 13 Apr 2017 19:54:53 +0000 (19:54 +0000)]
Web Inspector: RTL: goto arrow is floated to the wrong side
https://bugs.webkit.org/show_bug.cgi?id=170816

Reviewed by Matt Baker.

Float it to the other side if necessary.

* UserInterface/Views/Main.css:
(.go-to-link):
(body[dir=ltr] .go-to-link:not(.dont-float)):
(body[dir=rtl] .go-to-link:not(.dont-float)):

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

2 years agoLayoutTest svg/animations/animated-svg-image-outside-viewport-paused.html is a flaky...
cdumez@apple.com [Thu, 13 Apr 2017 19:42:35 +0000 (19:42 +0000)]
LayoutTest svg/animations/animated-svg-image-outside-viewport-paused.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=170745

Reviewed by Tim Horton.

Test was relying on a setTimeout(30) and was flaky. Now use shouldBecomeEqual() to make the
test more robust.

* svg/animations/animated-svg-image-outside-viewport-paused-expected.txt:
* svg/animations/animated-svg-image-outside-viewport-paused.html:

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

2 years agoAddressing post-review comment after r215314.
mmaxfield@apple.com [Thu, 13 Apr 2017 19:34:21 +0000 (19:34 +0000)]
Addressing post-review comment after r215314.
https://bugs.webkit.org/show_bug.cgi?id=169015

Reviewed by Alexey Proskuryakov.

* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontDatabase::fontForPostScriptName):

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

2 years ago[WebIDL] Add support for extended attributes on types in WebIDL
weinig@apple.com [Thu, 13 Apr 2017 19:19:49 +0000 (19:19 +0000)]
[WebIDL] Add support for extended attributes on types in WebIDL
https://bugs.webkit.org/show_bug.cgi?id=170759

Reviewed by Alex Christensen.

- Update parsing for WebIDL grammar changes.
- Adds an extended attributes hash to IDLType that is filled according
  to the WebIDL annotated type rules.
- Updates code generation to take advantage of IDLType's extended attribute
  simplifying some existing code.
- Update IDLs in the project to adhere to the new grammar.

* Modules/indexeddb/IDBFactory.idl:
* Modules/indexeddb/IDBIndex.idl:
* Modules/indexeddb/IDBKeyRange.idl:
* Modules/indexeddb/IDBObjectStore.idl:
* Modules/websockets/WebSocket.idl:
* crypto/parameters/AesCtrParams.idl:
* crypto/parameters/AesKeyParams.idl:
* crypto/parameters/Pbkdf2Params.idl:
* crypto/parameters/RsaKeyGenParams.idl:
* testing/TypeConversions.idl:
Update for grammar change.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDefaultValue):
(GetBaseIDLType):
(GetIDLType):
(GetIntegerConversionConfiguration):
(GetStringConversionConfiguration):
(JSValueToNative):
(UnsafeToNative):
(NativeToJSValueDOMConvertNeedsState):
(NativeToJSValueDOMConvertNeedsGlobalObject):
(NativeToJSValue):
Remove the need for the type's context in many places since type
associated extended attributes are now on the type itself.

* bindings/scripts/IDLParser.pm:
(copyExtendedAttributes):
Move up so it can be reused.

(isExtendedAttributeApplicableToTypes):
Add temporary predicated to indicate which attributes should be moved to types. This
logic should be moved to IDLAttributes.txt.

(moveExtendedAttributesApplicableToTypes):
Add helper to move attributes to the type's extended attributes hash if applicable.

(makeSimpleType):
Use initializer syntax to simplify.

(cloneType):
Support cloning types with extended attributes.

(typeByApplyingTypedefs):
When constructing the clone for a typedef application, move any applicable attributes
to the clone from the original type.

(parseDictionaryMember):
(parseTypedef):
(parseAttributeOrOperationRest):
(parseAttributeRest):
(parseOperationOrIterator):
(parseSpecialOperation):
(parseOptionalIterableInterface):
(parseMapLikeProperties):
(parseOptionalOrRequiredArgument):
(parseType):
(parseTypeWithExtendedAttributes):
(parseUnionMemberType):
(parseNonAnyType):
Update for new grammar, moving applicable attributes eagerly.

(assertNoExtendedAttributesInTypedef): Deleted.
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionClassMethodWithClampOnOptional):
(WebCore::jsTestObjPrototypeFunctionClassMethodWithClampOnOptionalCaller):
(WebCore::jsTestObjPrototypeFunctionClassMethodWithEnforceRangeOnOptional):
(WebCore::jsTestObjPrototypeFunctionClassMethodWithEnforceRangeOnOptionalCaller):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::jsTestTypedefsAttributeWithClamp):
(WebCore::jsTestTypedefsAttributeWithClampGetter):
(WebCore::jsTestTypedefsAttributeWithClampInTypedef):
(WebCore::jsTestTypedefsAttributeWithClampInTypedefGetter):
(WebCore::setJSTestTypedefsAttributeWithClamp):
(WebCore::setJSTestTypedefsAttributeWithClampFunction):
(WebCore::setJSTestTypedefsAttributeWithClampInTypedef):
(WebCore::setJSTestTypedefsAttributeWithClampInTypedefFunction):
(WebCore::jsTestTypedefsPrototypeFunctionFuncWithClampInTypedef):
(WebCore::jsTestTypedefsPrototypeFunctionFuncWithClampInTypedefCaller):
* bindings/scripts/test/TestObj.idl:
* bindings/scripts/test/TestTypedefs.idl:
Update for new grammar. Add some new tests for uncovered cases.

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

2 years agoFix CMake build
achristensen@apple.com [Thu, 13 Apr 2017 18:53:23 +0000 (18:53 +0000)]
Fix CMake build
https://bugs.webkit.org/show_bug.cgi?id=170815

Reviewed by Beth Dakin.

Source/WebCore:

* platform/spi/cocoa/AVKitSPI.h:

Source/WebKit2:

* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration _setShouldCaptureAudioInUIProcess:]):

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

2 years agocmake-build-fix
jfbastien@apple.com [Thu, 13 Apr 2017 18:44:25 +0000 (18:44 +0000)]
cmake-build-fix

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

2 years agoRemove RTCSignalingState::Closed
commit-queue@webkit.org [Thu, 13 Apr 2017 18:28:29 +0000 (18:28 +0000)]
Remove RTCSignalingState::Closed
https://bugs.webkit.org/show_bug.cgi?id=170811

Patch by Youenn Fablet <youenn@apple.com> on 2017-04-13
Reviewed by Eric Carlson.

Source/WebCore:

Covered by existing and rebased tests.

Adding RTCPeerConnection::isClosed to better match the isClosed internal slot in webrtc specification.
Using isClosed instead of checking signalingState value.
Implementing isClosed in terms of m_connectionState which has a Closed value.

* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::setLocalDescriptionTask):
(WebCore::MediaEndpointPeerConnection::replaceTrackTask):
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::createOffer):
(WebCore::PeerConnectionBackend::createOfferSucceeded):
(WebCore::PeerConnectionBackend::createOfferFailed):
(WebCore::PeerConnectionBackend::createAnswer):
(WebCore::PeerConnectionBackend::createAnswerSucceeded):
(WebCore::PeerConnectionBackend::createAnswerFailed):
(WebCore::PeerConnectionBackend::setLocalDescription):
(WebCore::PeerConnectionBackend::setLocalDescriptionSucceeded):
(WebCore::PeerConnectionBackend::setLocalDescriptionFailed):
(WebCore::PeerConnectionBackend::setRemoteDescription):
(WebCore::PeerConnectionBackend::setRemoteDescriptionSucceeded):
(WebCore::PeerConnectionBackend::setRemoteDescriptionFailed):
(WebCore::PeerConnectionBackend::addIceCandidate):
(WebCore::PeerConnectionBackend::addIceCandidateSucceeded):
(WebCore::PeerConnectionBackend::addIceCandidateFailed):
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::create):
(WebCore::RTCPeerConnection::RTCPeerConnection):
(WebCore::RTCPeerConnection::addTrack):
(WebCore::RTCPeerConnection::removeTrack):
(WebCore::RTCPeerConnection::queuedCreateOffer):
(WebCore::RTCPeerConnection::queuedCreateAnswer):
(WebCore::RTCPeerConnection::queuedSetLocalDescription):
(WebCore::RTCPeerConnection::queuedSetRemoteDescription):
(WebCore::RTCPeerConnection::queuedAddIceCandidate):
(WebCore::RTCPeerConnection::setConfiguration):
(WebCore::RTCPeerConnection::createDataChannel):
(WebCore::RTCPeerConnection::doClose):
(WebCore::RTCPeerConnection::updateIceGatheringState):
(WebCore::RTCPeerConnection::updateIceConnectionState):
(WebCore::RTCPeerConnection::scheduleNegotiationNeededEvent):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::signalingState):
* platform/mediastream/RTCSignalingState.h:

LayoutTests:

* webrtc/connection-state.html:

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

2 years ago[WinCairo] Assign WEBKIT_LIBRARIES_DIR to CMAKE_PREFIX_PATH
commit-queue@webkit.org [Thu, 13 Apr 2017 17:54:20 +0000 (17:54 +0000)]
[WinCairo] Assign WEBKIT_LIBRARIES_DIR to CMAKE_PREFIX_PATH
https://bugs.webkit.org/show_bug.cgi?id=170797

Patch by Don Olmstead <don.olmstead@am.sony.com> on 2017-04-13
Reviewed by Alex Christensen.

* Source/cmake/FindCairo.cmake:
* Source/cmake/OptionsWin.cmake:

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

2 years agoBreakingContext::WordTrailingSpace cleanup.
zalan@apple.com [Thu, 13 Apr 2017 17:39:03 +0000 (17:39 +0000)]
BreakingContext::WordTrailingSpace cleanup.
https://bugs.webkit.org/show_bug.cgi?id=170750

Reviewed by Myles C. Maxfield.

No change in functionality.

* rendering/RenderText.cpp:
(WebCore::RenderText::computePreferredLogicalWidths):
* rendering/line/BreakingContext.h:
(WebCore::WordTrailingSpace::WordTrailingSpace):
(WebCore::WordTrailingSpace::width):
(WebCore::BreakingContext::handleText):

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

2 years agoRemove compositing/masks/solid-color-masked.html expectation
jbedard@apple.com [Thu, 13 Apr 2017 17:29:43 +0000 (17:29 +0000)]
Remove compositing/masks/solid-color-masked.html expectation
https://bugs.webkit.org/show_bug.cgi?id=168054

Unreviewed test gardening.

* platform/ios/TestExpectations: Remove compositing/masks/solid-color-masked.html.

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

2 years agoAdd some more WebRTC tests
commit-queue@webkit.org [Thu, 13 Apr 2017 16:54:32 +0000 (16:54 +0000)]
Add some more WebRTC tests
https://bugs.webkit.org/show_bug.cgi?id=170796

Patch by Youenn Fablet <youenn@apple.com> on 2017-04-13
Reviewed by Eric Carlson.

* webrtc/multi-video-expected.txt: Added.
* webrtc/multi-video.html: Added.
* webrtc/video-with-data-channel-expected.txt: Added.
* webrtc/video-with-data-channel.html: Added.

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

2 years ago[Readable Streams API] Implement cloneArrayBuffer in WebCore
commit-queue@webkit.org [Thu, 13 Apr 2017 16:40:25 +0000 (16:40 +0000)]
[Readable Streams API] Implement cloneArrayBuffer in WebCore
https://bugs.webkit.org/show_bug.cgi?id=170008

Patch by Romain Bellessort <romain.bellessort@crf.canon.fr> on 2017-04-13
Reviewed by Youenn Fablet.

Source/WebCore:

Implemented cloneArrayBuffer based on existing structuredCloneArrayBuffer
implementation. The code has been factorized so that both cloneArrayBuffer
and structuredCloneArrayBuffer rely on the same code (which is basically
the previous implementation of structuredCloneArrayBuffer + the ability
to clone only a part of considered buffer).

Test: streams/clone-array-buffer.html

* Modules/streams/ReadableByteStreamInternals.js: Deleted cloneArrayBuffer JS implementation.
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::addBuiltinGlobals): Add cloneArrayBuffer private declaration.
* bindings/js/StructuredClone.cpp:
(WebCore::cloneArrayBufferImpl): Added (mostly based on previous structuredCloneArrayBuffer).
(WebCore::cloneArrayBuffer): Added.
(WebCore::structuredCloneArrayBuffer): Updated.
* bindings/js/StructuredClone.h: Added cloneArrayBuffer declaration.
* bindings/js/WebCoreBuiltinNames.h: Added cloneArrayBuffer declaration.
* testing/Internals.cpp: Added support for testing cloneArrayBuffer.
* testing/Internals.h: Added support for testing cloneArrayBuffer.
* testing/Internals.idl: Added support for testing cloneArrayBuffer.

LayoutTests:

Added test to check cloneArrayBuffer behaviour.

* streams/clone-array-buffer-expected.txt: Added.
* streams/clone-array-buffer.html: Added.

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

2 years agoonnegotiationneeded should only be called once
commit-queue@webkit.org [Thu, 13 Apr 2017 16:38:58 +0000 (16:38 +0000)]
onnegotiationneeded should only be called once
https://bugs.webkit.org/show_bug.cgi?id=170785

Patch by Youenn Fablet <youenn@apple.com> on 2017-04-13
Reviewed by Alex Christensen.

Source/WebCore:

Covered by updated test.

Disabling explicit call to markAsNeedingNegotiation in case libwebrtc is used as libwebrtc is calling it.
Making sure removeTrack gets notified up to libwebrtc.

* Modules/mediastream/PeerConnectionBackend.h:
(WebCore::PeerConnectionBackend::notifyRemovedTrack):
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::addTrack):
(WebCore::RTCPeerConnection::removeTrack):
(WebCore::RTCPeerConnection::completeAddTransceiver):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::removeTrack):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::notifyRemovedTrack):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:

LayoutTests:

* webrtc/negotiatedneeded-event-addStream.html:

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

2 years agoRendering flexbox children across columns
hyatt@apple.com [Thu, 13 Apr 2017 16:37:00 +0000 (16:37 +0000)]
Rendering flexbox children across columns
https://bugs.webkit.org/show_bug.cgi?id=164166
<rdar://problem/29055587>

Reviewed by Zalan Bujtas.

Source/WebCore:

Added fast/multicol/flexbox-rows.html

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::adjustForUnsplittableChild):

LayoutTests:

* fast/multicol/flexbox-rows-expected.html: Added.
* fast/multicol/flexbox-rows.html: Added.

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

2 years agoClean up SharedBuffer public functions
achristensen@apple.com [Thu, 13 Apr 2017 15:28:15 +0000 (15:28 +0000)]
Clean up SharedBuffer public functions
https://bugs.webkit.org/show_bug.cgi?id=170795

Reviewed by Andreas Kling.

Source/WebCore:

Make some member functions that are now only used internally private.

* platform/SharedBuffer.cpp:
(WebCore::SharedBuffer::append):
(WebCore::SharedBuffer::platformDataSize): Deleted.
* platform/SharedBuffer.h:

Tools:

* TestWebKitAPI/Tests/WebCore/SharedBuffer.cpp:
(TestWebKitAPI::TEST_F):

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

2 years ago[JSC] Use proper ifdef guard for code using MachineContext
utatane.tea@gmail.com [Thu, 13 Apr 2017 14:17:00 +0000 (14:17 +0000)]
[JSC] Use proper ifdef guard for code using MachineContext
https://bugs.webkit.org/show_bug.cgi?id=170800

Reviewed by Carlos Alberto Lopez Perez.

Source/JavaScriptCore:

This patch drops MachineContext use if it is not available.
This situation can be considered like, building WebKit with musl.
In that case, we simply disable features that rely on MachineContext.
Examples are wasm fast memory, sampling profiler, and code profiling.

* runtime/Options.cpp:
(JSC::overrideDefaults):
* tools/CodeProfiling.cpp:
(JSC::CodeProfiling::begin):
(JSC::CodeProfiling::end):
Previously, PLATFORM(GTK) is excluded. But it is not obvious why it is excluded.
This patch just includes such platforms.

* wasm/WasmFaultSignalHandler.cpp:
(JSC::Wasm::enableFastMemory):

Source/WTF:

SamplingProfiler and FastMemory rely on MachineContext feature.

* wtf/Platform.h:

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

2 years agoTry to unflake a test.
antti@apple.com [Thu, 13 Apr 2017 08:31:54 +0000 (08:31 +0000)]
Try to unflake a test.

* http/tests/cache/disk-cache/disk-cache-media-small.html:

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

2 years ago[Mac] Future-proof .xcconfig files
mitz@apple.com [Thu, 13 Apr 2017 06:55:50 +0000 (06:55 +0000)]
[Mac] Future-proof .xcconfig files
https://bugs.webkit.org/show_bug.cgi?id=170802

Reviewed by Tim Horton.

Source/bmalloc:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:

Source/JavaScriptCore:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
* Configurations/FeatureDefines.xcconfig:
* Configurations/Version.xcconfig:

Source/ThirdParty/ANGLE:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:

Source/ThirdParty/libwebrtc:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
* Configurations/opus.xcconfig:

Source/WebCore:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
* Configurations/FeatureDefines.xcconfig:
* Configurations/Version.xcconfig:

Source/WebCore/PAL:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
* Configurations/FeatureDefines.xcconfig:
* Configurations/Version.xcconfig:

Source/WebInspectorUI:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
* Configurations/Version.xcconfig:

Source/WebKit/mac:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
* Configurations/FeatureDefines.xcconfig:
* Configurations/Version.xcconfig:

Source/WebKit2:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
* Configurations/FeatureDefines.xcconfig:
* Configurations/Version.xcconfig:

Source/WTF:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:

Tools:

* DumpRenderTree/mac/Configurations/Base.xcconfig:
* DumpRenderTree/mac/Configurations/DebugRelease.xcconfig:
* MiniBrowser/Configurations/Base.xcconfig:
* MiniBrowser/Configurations/DebugRelease.xcconfig:
* TestWebKitAPI/Configurations/Base.xcconfig:
* TestWebKitAPI/Configurations/DebugRelease.xcconfig:
* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:
* WebKitTestRunner/Configurations/Base.xcconfig:
* WebKitTestRunner/Configurations/DebugRelease.xcconfig:

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

2 years agoQuotaExceededError when saving to localStorage in private mode.
beidson@apple.com [Thu, 13 Apr 2017 06:38:19 +0000 (06:38 +0000)]
QuotaExceededError when saving to localStorage in private mode.
https://bugs.webkit.org/show_bug.cgi?id=157010

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (Covered by changes to existing test).

LocalStorage in private browsing is now effectively SessionStorage.
It's ephemeral, per-tab, and copied over to tabs window.open()'ed from the current.

* loader/EmptyClients.cpp:
(WebCore::EmptyStorageNamespaceProvider::createEphemeralLocalStorageNamespace):

* page/Chrome.cpp:
(WebCore::Chrome::createWindow):

* page/Page.cpp:
(WebCore::Page::ephemeralLocalStorage):
(WebCore::Page::setEphemeralLocalStorage):
* page/Page.h:

* page/SecurityOriginData.h:

* storage/Storage.cpp:
(WebCore::Storage::length):
(WebCore::Storage::key):
(WebCore::Storage::getItem):
(WebCore::Storage::setItem):
(WebCore::Storage::removeItem):
(WebCore::Storage::clear):
(WebCore::Storage::contains):
(WebCore::Storage::isDisabledByPrivateBrowsing): Deleted.

* storage/StorageMap.h:

* storage/StorageNamespaceProvider.cpp:
(WebCore::StorageNamespaceProvider::localStorageArea):
* storage/StorageNamespaceProvider.h:

* storage/StorageType.h:
(WebCore::isLocalStorage):
(WebCore::isPersistentLocalStorage):

Source/WebKit:

* Storage/StorageNamespaceImpl.cpp:
(WebKit::StorageNamespaceImpl::createEphemeralLocalStorageNamespace):
(WebKit::StorageNamespaceImpl::StorageNamespaceImpl):
(WebKit::StorageNamespaceImpl::~StorageNamespaceImpl):
(WebKit::StorageNamespaceImpl::copy):
(WebKit::StorageNamespaceImpl::close):
* Storage/StorageNamespaceImpl.h:

* Storage/WebStorageNamespaceProvider.cpp:
(WebKit::WebStorageNamespaceProvider::createEphemeralLocalStorageNamespace):
* Storage/WebStorageNamespaceProvider.h:

Source/WebKit2:

* WebProcess/Storage/StorageAreaMap.cpp:
(WebKit::StorageAreaMap::StorageAreaMap):
(WebKit::StorageAreaMap::~StorageAreaMap):

* WebProcess/Storage/StorageNamespaceImpl.cpp:
(WebKit::StorageNamespaceImpl::createEphemeralLocalStorageNamespace):
(WebKit::StorageNamespaceImpl::storageArea):
(WebKit::StorageNamespaceImpl::ephemeralLocalStorageArea):
(WebKit::StorageNamespaceImpl::copy):
* WebProcess/Storage/StorageNamespaceImpl.h:

* WebProcess/Storage/WebStorageNamespaceProvider.cpp:
(WebKit::WebStorageNamespaceProvider::createEphemeralLocalStorageNamespace):
* WebProcess/Storage/WebStorageNamespaceProvider.h:

LayoutTests:

* platform/mac-wk2/TestExpectations:
* storage/domstorage/localstorage/private-browsing-affects-storage-expected.txt:
* storage/domstorage/localstorage/private-browsing-affects-storage.html:
* storage/domstorage/localstorage/resources/private-browsing-1.html: Added.
* storage/domstorage/localstorage/resources/private-browsing-2.html: Added.
* storage/domstorage/localstorage/resources/private-browsing-3.html: Added.
* storage/domstorage/localstorage/resources/private-browsing-storage-2.html: Added.
* storage/domstorage/sessionstorage/private-browsing-affects-storage-expected.txt: Removed.
* storage/domstorage/sessionstorage/private-browsing-affects-storage.html: Removed.

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

2 years ago[Cocoa] Suppress font download dialog in new matching algorithm
mmaxfield@apple.com [Thu, 13 Apr 2017 05:49:14 +0000 (05:49 +0000)]
[Cocoa] Suppress font download dialog in new matching algorithm
https://bugs.webkit.org/show_bug.cgi?id=169015

Reviewed by Alexey Proskuryakov.

Not testable.

* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontDatabase::lookupPostScriptName):

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

2 years agoUnreviewed, fix build failure on Ubuntu LTS GTK bot
utatane.tea@gmail.com [Thu, 13 Apr 2017 04:29:57 +0000 (04:29 +0000)]
Unreviewed, fix build failure on Ubuntu LTS GTK bot
https://bugs.webkit.org/show_bug.cgi?id=170781

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::createNewWebProcess):

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

2 years agotest262: test262/test/built-ins/NativeErrors/EvalError/proto.js
commit-queue@webkit.org [Thu, 13 Apr 2017 03:12:08 +0000 (03:12 +0000)]
test262: test262/test/built-ins/NativeErrors/EvalError/proto.js
https://bugs.webkit.org/show_bug.cgi?id=170668

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-04-12
Reviewed by Keith Miller.

JSTests:

* ChakraCore.yaml:
* ChakraCore/test/Lib/error.baseline-jsc: Added.
This test does not match the spec.

* test262.yaml:

Source/JavaScriptCore:

* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
The [[Prototype]] of NativeError Constructor's should be the %Error%.
https://tc39.github.io/ecma262/#sec-properties-of-the-nativeerror-constructors

LayoutTests:

* ietestcenter/Javascript/15.2.3.2-2-12-expected.txt:
* ietestcenter/Javascript/15.2.3.2-2-13-expected.txt:
* ietestcenter/Javascript/15.2.3.2-2-14-expected.txt:
* ietestcenter/Javascript/15.2.3.2-2-15-expected.txt:
* ietestcenter/Javascript/15.2.3.2-2-16-expected.txt:
* ietestcenter/Javascript/15.2.3.2-2-17-expected.txt:
These tests are now out of date.

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

2 years agotest262: test262/test/language/literals/regexp/u-dec-esc.js
commit-queue@webkit.org [Thu, 13 Apr 2017 02:51:18 +0000 (02:51 +0000)]
test262: test262/test/language/literals/regexp/u-dec-esc.js
https://bugs.webkit.org/show_bug.cgi?id=170687

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-04-12
Reviewed by Michael Saboff.

JSTests:

* test262.yaml:

Source/JavaScriptCore:

* yarr/YarrParser.h:
(JSC::Yarr::Parser::parseEscape):
* yarr/YarrPattern.cpp:
(JSC::Yarr::YarrPattern::errorMessage):
(JSC::Yarr::YarrPattern::compile):
* yarr/YarrPattern.h:
In unicoe patterns, invalid backreferences are an error.

LayoutTests:

* js/regexp-unicode-expected.txt:
* js/script-tests/regexp-unicode.js:
Extend test to test invalid backreferences.

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

2 years agoMove common stack allocation utilities out of AirAllocateStackByGraphColoring.cpp
fpizlo@apple.com [Thu, 13 Apr 2017 02:26:53 +0000 (02:26 +0000)]
Move common stack allocation utilities out of AirAllocateStackByGraphColoring.cpp
https://bugs.webkit.org/show_bug.cgi?id=170799

Reviewed by Michael Saboff and Keith Miller.

When I added stack allocation to allocateRegistersByLinearScan, I reused a handful of
utility functions from AirAllocateStackByGraphColoring.cpp. I accomplished this by
putting their declarations in AirAllocateStackByGraphColoring.h.

That was pretty weird.

This patch moves a family of stack allocation helper functions out of
AirAllocateStackByGraphColoring.cpp and into the new AirStackAllocation.h|cpp. The
linear scan stack allocator no longer has to include the other stack allocator's
header, which addresses my OCD.

I moved the functions transitively reachable from the two functions that the linear
scan allocator needed. This forced me to give them better names (i.e. no "fooBarImpl")
and short descriptive comments. I think that such comments are useful in code that is
doing a convoluted version of some theoretical concept.

No behavior change.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* b3/air/AirAllocateRegistersAndStackByLinearScan.cpp:
* b3/air/AirAllocateStackByGraphColoring.cpp:
(JSC::B3::Air::allocateStackByGraphColoring):
(JSC::B3::Air::allocateEscapedStackSlots): Deleted.
(JSC::B3::Air::updateFrameSizeBasedOnStackSlots): Deleted.
* b3/air/AirAllocateStackByGraphColoring.h:
* b3/air/AirStackAllocation.cpp: Added.
(JSC::B3::Air::attemptAssignment):
(JSC::B3::Air::assign):
(JSC::B3::Air::allocateAndGetEscapedStackSlotsWithoutChangingFrameSize):
(JSC::B3::Air::allocateEscapedStackSlots):
(JSC::B3::Air::updateFrameSizeBasedOnStackSlots):
* b3/air/AirStackAllocation.h: Added.

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

2 years agoREGRESSION (r215242-215243): [ios-simulator] API test WebKit1.AudioSessionCategoryIOS...
eric.carlson@apple.com [Thu, 13 Apr 2017 00:40:38 +0000 (00:40 +0000)]
REGRESSION (r215242-215243): [ios-simulator] API test WebKit1.AudioSessionCategoryIOS is failing
https://bugs.webkit.org/show_bug.cgi?id=170777
<rdar://problem/31592877>

Reviewed by Jer Noble.

No new tests, fixes an existing test.

* platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
(PlatformMediaSessionManager::updateSessionState): Pass parameters to lambda by reference.

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

2 years agoVersioning.
jmarcell@apple.com [Wed, 12 Apr 2017 23:41:41 +0000 (23:41 +0000)]
Versioning.

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

2 years ago[MediaStream] rename -[WKWebView _stopMediaCapture]
eric.carlson@apple.com [Wed, 12 Apr 2017 23:07:10 +0000 (23:07 +0000)]
[MediaStream] rename -[WKWebView _stopMediaCapture]
https://bugs.webkit.org/show_bug.cgi?id=170791
<rdar://problem/31589204>

Reviewed by Youenn Fablet.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _muteMediaCapture]):
(-[WKWebView _stopMediaCapture]): Deleted.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:

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

2 years agoUnreviewed build fix.
ryanhaddad@apple.com [Wed, 12 Apr 2017 22:44:14 +0000 (22:44 +0000)]
Unreviewed build fix.

* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:handler:]):
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:handler:]):
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:handler:]):
(WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection):
(WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection):
(WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection):

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

2 years agoMove expectation for compositing/iframes/iframe-size-from-zero.htm to top level
jbedard@apple.com [Wed, 12 Apr 2017 22:44:08 +0000 (22:44 +0000)]
Move expectation for compositing/iframes/iframe-size-from-zero.htm to top level

Unreviewed test gardening.

* TestExpectations: Marked compositing/iframes/iframe-size-from-zero.html as flaky.
* platform/ios-wk1/TestExpectations: Move test expectation to top level.
* platform/mac-wk1/TestExpectations: Ditto.
* platform/win/TestExpectations: Ditto.
* platform/wk2/TestExpectations: Ditto.

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

2 years ago[MediaStream] Set correct audio session category when capturing audio
eric.carlson@apple.com [Wed, 12 Apr 2017 22:34:51 +0000 (22:34 +0000)]
[MediaStream] Set correct audio session category when capturing audio
https://bugs.webkit.org/show_bug.cgi?id=170736
<rdar://problem/31559405>

Unreviewed, update an assertion I missed in r215242.

* platform/audio/PlatformMediaSession.cpp:
(WebCore::PlatformMediaSession::PlatformMediaSession):

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

2 years agoRemove unused SharedBuffer::wrapCFDataArray
achristensen@apple.com [Wed, 12 Apr 2017 22:26:38 +0000 (22:26 +0000)]
Remove unused SharedBuffer::wrapCFDataArray
https://bugs.webkit.org/show_bug.cgi?id=170794

Reviewed by Brady Eidson.

Source/WebCore:

It's unused since r215280.

* platform/SharedBuffer.h:
* platform/cf/SharedBufferCF.cpp:
(WebCore::SharedBuffer::wrapCFDataArray): Deleted.

Tools:

* TestWebKitAPI/Tests/WebCore/cocoa/SharedBuffer.mm:
(TestWebKitAPI::TEST_F):

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

2 years ago[WK2] Add a C-API for creating a WKContextConfigurationRef with legacy options.
jer.noble@apple.com [Wed, 12 Apr 2017 22:23:12 +0000 (22:23 +0000)]
[WK2] Add a C-API for creating a WKContextConfigurationRef with legacy options.
https://bugs.webkit.org/show_bug.cgi?id=170790

Reviewed by Alex Christensen.

* UIProcess/API/C/WKContextConfigurationRef.cpp:
(WKContextConfigurationCreate):
(WKContextConfigurationCreateWithLegacyOptions):
* UIProcess/API/C/WKContextConfigurationRef.h:

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

2 years ago[WK2] Do not pass microphone sandbox extension to WebProcess if capturing is happenin...
jer.noble@apple.com [Wed, 12 Apr 2017 22:06:23 +0000 (22:06 +0000)]
[WK2] Do not pass microphone sandbox extension to WebProcess if capturing is happening in UIProcess.
https://bugs.webkit.org/show_bug.cgi?id=170781

Reviewed by Alex Christensen.

Simultaneously, allow clients to configure whether capturing will occur in the UIProcess through
_WKProcessPoolConfiguration.

* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/C/WKContextConfigurationRef.cpp:
(WKContextConfigurationShouldCaptureAudioInUIProcess):
(WKContextConfigurationSetShouldCaptureAudioInUIProcess):
* UIProcess/API/C/WKContextConfigurationRef.h:
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration copyWithZone:]):
(-[WKWebViewConfiguration _shouldCaptureAudioInUIProcess]):
(-[WKWebViewConfiguration _setShouldCaptureAudioInUIProcess:]):
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration shouldCaptureAudioInUIProcess]):
(-[_WKProcessPoolConfiguration setShouldCaptureAudioInUIProcess:]):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::createNewWebProcess):

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

2 years agoBuild fix.
bdakin@apple.com [Wed, 12 Apr 2017 21:51:33 +0000 (21:51 +0000)]
Build fix.

* WebView/WebViewData.h:

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

2 years agoAdd some missing NetworkResourceLoader logging
krollin@apple.com [Wed, 12 Apr 2017 21:46:09 +0000 (21:46 +0000)]
Add some missing NetworkResourceLoader logging
https://bugs.webkit.org/show_bug.cgi?id=170139

Reviewed by Alex Christensen.

Once execution enters the lambda in
NetworkResourceLoader::retrieveCacheEntry, there is little indication
of which exit point was taken. If flow enters into startNetworkLoad,
we'll get some logging from that function, but not from the others.
Add some logging so that we know what the result was from looking up
the resource in the cache.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::retrieveCacheEntry):

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

2 years agoB3 -O1 should not allocateStackByGraphColoring
fpizlo@apple.com [Wed, 12 Apr 2017 21:22:14 +0000 (21:22 +0000)]
B3 -O1 should not allocateStackByGraphColoring
https://bugs.webkit.org/show_bug.cgi?id=170742

Reviewed by Keith Miller.

One of B3 -O1's longest running phases is allocateStackByGraphColoring. One approach to
this would be to make that phase cheaper. But it's weird that this phase reruns
liveness after register allocation already ran liveness. If only it could reuse the
liveness computed by register allocation then it would run a lot faster. At -O2, we do
not want this, since we run phases between register allocation and stack allocation,
and those phases are free to change the liveness of spill slots (in fact,
fixObviousSpills will both shorten and lengthen live ranges because of load and store
elimination, respectively). But at -O1, we don't really need to run any phases between
register and stack allocation.

This changes Air's backend in the following ways:

- Linear scan does stack allocation. This means that we don't need to run
  allocateStackByGraphColoring at all. In reality, we reuse some of its innards, but
  we don't run the expensive part of it (liveness->interference->coalescing->coloring).
  This is a speed-up because we only run liveness once and reuse it for both register
  and stack allocation.

- Phases that previously ran between register and stack allocation are taken care of,
  each in its own special way:

  -> handleCalleSaves: this is now a utility function called by both
     allocateStackByGraphColoring and allocateRegistersAndStackByLinearScan.

  -> fixObviousSpills: we didn't run this at -O1, so nothing needs to be done.

  -> lowerAfterRegAlloc: this needed to be able to run before stack allocation because
     it could change register usage (vis a vis callee saves) and it could introduce
     spill slots. I changed this phase to have a secondary mode for when it runs after
     stack allocation.

- The part of allocateStackByGraphColoring that lowered stack addresses and took care
  of the call arg area is now a separate phase called lowerStackArgs. We run this phase
  regardless of optimization level. It's a cheap and general lowering.

This also removes spillEverything, because we never use that phase, we never test it,
and it got in the way in this refactoring.

This is a 21% speed-up on wasm -O1 compile times. This does not significantly change
-O1 throughput. We had already disabled allocateStack's most important optimization
(spill coalescing). This probably regresses average stack frame size, but I didn't
measure by how much. Stack frame size is really not that important. The algorithm in
allocateStackByGraphColoring is about much more than optimal frame size; it also
tries to avoid having to zero-extend 32-bit spills, it kills dead code, and of course
it coalesces.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* b3/B3Procedure.cpp:
(JSC::B3::Procedure::calleeSaveRegisterAtOffsetList):
(JSC::B3::Procedure::calleeSaveRegisters): Deleted.
* b3/B3Procedure.h:
* b3/B3StackmapGenerationParams.cpp:
(JSC::B3::StackmapGenerationParams::unavailableRegisters):
* b3/air/AirAllocateRegistersAndStackByLinearScan.cpp: Copied from Source/JavaScriptCore/b3/air/AirAllocateRegistersByLinearScan.cpp.
(JSC::B3::Air::allocateRegistersAndStackByLinearScan):
(JSC::B3::Air::allocateRegistersByLinearScan): Deleted.
* b3/air/AirAllocateRegistersAndStackByLinearScan.h: Copied from Source/JavaScriptCore/b3/air/AirAllocateRegistersByLinearScan.h.
* b3/air/AirAllocateRegistersByLinearScan.cpp: Removed.
* b3/air/AirAllocateRegistersByLinearScan.h: Removed.
* b3/air/AirAllocateStackByGraphColoring.cpp:
(JSC::B3::Air::allocateEscapedStackSlots):
(JSC::B3::Air::updateFrameSizeBasedOnStackSlots):
(JSC::B3::Air::allocateStackByGraphColoring):
* b3/air/AirAllocateStackByGraphColoring.h:
* b3/air/AirArg.cpp:
(JSC::B3::Air::Arg::stackAddr):
* b3/air/AirArg.h:
(JSC::B3::Air::Arg::stackAddr): Deleted.
* b3/air/AirCode.cpp:
(JSC::B3::Air::Code::addStackSlot):
(JSC::B3::Air::Code::setCalleeSaveRegisterAtOffsetList):
(JSC::B3::Air::Code::calleeSaveRegisterAtOffsetList):
(JSC::B3::Air::Code::dump):
* b3/air/AirCode.h:
(JSC::B3::Air::Code::setStackIsAllocated):
(JSC::B3::Air::Code::stackIsAllocated):
(JSC::B3::Air::Code::calleeSaveRegisters):
* b3/air/AirGenerate.cpp:
(JSC::B3::Air::prepareForGeneration):
(JSC::B3::Air::generate):
* b3/air/AirHandleCalleeSaves.cpp:
(JSC::B3::Air::handleCalleeSaves):
* b3/air/AirHandleCalleeSaves.h:
* b3/air/AirLowerAfterRegAlloc.cpp:
(JSC::B3::Air::lowerAfterRegAlloc):
* b3/air/AirLowerStackArgs.cpp: Added.
(JSC::B3::Air::lowerStackArgs):
* b3/air/AirLowerStackArgs.h: Added.
* b3/testb3.cpp:
(JSC::B3::testPinRegisters):
* ftl/FTLCompile.cpp:
(JSC::FTL::compile):
* jit/RegisterAtOffsetList.h:
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::parseAndCompile):

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

2 years agocanvas/2d.gradient.* LayoutTests failing
dino@apple.com [Wed, 12 Apr 2017 21:11:47 +0000 (21:11 +0000)]
canvas/2d.gradient.* LayoutTests failing
https://bugs.webkit.org/show_bug.cgi?id=170757
<rdar://problem/31177990>

Reviewed by Antoine Quint.

Add a fudge factor to the gradient tests, since we can
now produce noisy (nicer looking) gradients. There might
be 1 or 2 bits of difference per pixel.

* canvas/philip/tests.js:
(_assertPixelWithGradientNoise):
* canvas/philip/tests/2d.gradient.linear.transform.1.html:
* canvas/philip/tests/2d.gradient.linear.transform.2.html:
* canvas/philip/tests/2d.gradient.linear.transform.3.html:
* canvas/philip/tests/2d.gradient.radial.cone.bottom.html:
* canvas/philip/tests/2d.gradient.radial.cone.cylinder.html:
* canvas/philip/tests/2d.gradient.radial.cone.front.html:
* canvas/philip/tests/2d.gradient.radial.cone.shape1.html:
* canvas/philip/tests/2d.gradient.radial.cone.top.html:
* canvas/philip/tests/2d.gradient.radial.inside1.html:
* canvas/philip/tests/2d.gradient.radial.inside2.html:
* canvas/philip/tests/2d.gradient.radial.inside3.html:
* canvas/philip/tests/2d.gradient.radial.outside1.html:
* canvas/philip/tests/2d.gradient.radial.outside2.html:
* canvas/philip/tests/2d.gradient.radial.outside3.html:
* canvas/philip/tests/2d.gradient.radial.touch2.html:
* fast/canvas/script-tests/canvas-gradient-on-compositing.js:
* fast/canvas/canvas-gradient-on-compositing-expected.html:

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

2 years agoTweak WebCore::setMetadataURL function
andersca@apple.com [Wed, 12 Apr 2017 21:08:15 +0000 (21:08 +0000)]
Tweak WebCore::setMetadataURL function
https://bugs.webkit.org/show_bug.cgi?id=170786

Reviewed by Beth Dakin.

Source/WebCore:

Get rid of the "referrer" parameter, it isn't used. Make the remaining parameters const. Swap the
urlString and path parameters since that makes more sense. Use String instead of NSString in the call to WKSetMetadataURL.

* platform/FileSystem.cpp:
(WebCore::setMetadataURL): Deleted.
* platform/FileSystem.h:
* platform/mac/FileSystemMac.mm:
(WebCore::setMetadataURL):

Source/WebKit2:

Update for WebCore changes.

* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::namesOfPromisedFilesDroppedAtDestination):

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

2 years ago[WK2][Mac] Stop allowing access to disk arbitration process
bfulgham@apple.com [Wed, 12 Apr 2017 21:04:18 +0000 (21:04 +0000)]
[WK2][Mac] Stop allowing access to disk arbitration process
https://bugs.webkit.org/show_bug.cgi?id=170517
<rdar://problem/31071151>

Reviewed by Alex Christensen.

* WebProcess/com.apple.WebProcess.sb.in:

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

2 years agoShould always override -[WebStorageManager init].
bweinstein@apple.com [Wed, 12 Apr 2017 20:55:52 +0000 (20:55 +0000)]
Should always override -[WebStorageManager init].
https://bugs.webkit.org/show_bug.cgi?id=170787
-and corresponding-
rdar://problem/31371835

Reviewed by Anders Carlsson.

* Storage/WebStorageManager.mm:
(-[WebStorageManager init]):

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

2 years agoWell-known variations should clamp to the values listed in the @font-face block
mmaxfield@apple.com [Wed, 12 Apr 2017 20:54:02 +0000 (20:54 +0000)]
Well-known variations should clamp to the values listed in the @font-face block
https://bugs.webkit.org/show_bug.cgi?id=169260

Reviewed by Dean Jackson.

Source/WebCore:

Most of this patch is plumbing the variation ranges from the CSSFontFace object
to preparePlatformFont() where variation values get applied.

Beyond that, there is one other piece of this patch - a nonspecified value in an
@font-face block shouldn't perform any clamping, but a specified value should be
clamped. This means that we need to retain whether or not a value is specified.
This patch does this by migrating CSSFontFace from using FontSelectionCapabilities
to using FontSelectionSpecifiedCapabilities, which has its internals behind
std::optionals which represent whether or not the value was specified. For the
purposes of font selection, these unspecified values are replaced with default
values.

Test: fast/text/variations/font-face-clamp.html

* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::font):
* css/CSSFontFace.h:
* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::font):
* css/CSSFontFaceSource.h:
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::addFontFaceRule):
* loader/cache/CachedFont.cpp:
(WebCore::CachedFont::createFont):
(WebCore::CachedFont::platformDataFromCustomData):
* loader/cache/CachedFont.h:
* loader/cache/CachedSVGFont.cpp:
(WebCore::CachedSVGFont::createFont):
(WebCore::CachedSVGFont::platformDataFromCustomData):
* loader/cache/CachedSVGFont.h:
* platform/graphics/FontCache.cpp:
(WebCore::FontPlatformDataCacheKey::FontPlatformDataCacheKey):
(WebCore::FontPlatformDataCacheKey::operator==):
(WebCore::FontPlatformDataCacheKeyHash::hash):
(WebCore::FontCache::getCachedFontPlatformData):
(WebCore::FontCache::fontForFamily):
* platform/graphics/FontCache.h:
(WebCore::FontCache::fontForFamily):
(WebCore::FontCache::getCachedFontPlatformData):
(WebCore::FontCache::createFontPlatformDataForTesting):
* platform/graphics/FontSelectionAlgorithm.h:
(WebCore::FontSelectionRange::uniqueValue):
(WebCore::FontSelectionCapabilities::operator==):
(WebCore::FontSelectionCapabilities::operator!=):
(WebCore::FontSelectionSpecifiedCapabilities::computeFontSelectionCapabilities):
(WebCore::FontSelectionSpecifiedCapabilities::operator==):
(WebCore::FontSelectionSpecifiedCapabilities::operator!=):
(WebCore::FontSelectionSpecifiedCapabilities::operator=):
(WebCore::FontSelectionSpecifiedCapabilities::computeWeight):
(WebCore::FontSelectionSpecifiedCapabilities::computeWidth):
(WebCore::FontSelectionSpecifiedCapabilities::computeSlope):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::preparePlatformFont):
(WebCore::fontWithFamily):
(WebCore::FontCache::createFontPlatformData):
(WebCore::FontCache::systemFallbackForCharacters):
* platform/graphics/mac/FontCacheMac.mm:
(WebCore::FontCache::lastResortFallbackFont):
* platform/graphics/mac/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::fontPlatformData):
* platform/graphics/mac/FontCustomPlatformData.h:

LayoutTests:

* fast/text/variations/font-face-clamp-expected.html: Added.
* fast/text/variations/font-face-clamp.html: Added.

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

2 years agoRemove two passing canvas tests from ios expectations
jbedard@apple.com [Wed, 12 Apr 2017 20:47:31 +0000 (20:47 +0000)]
Remove two passing canvas tests from ios expectations

Unreviewed test gardening.

* platform/ios/TestExpectations:

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

2 years ago32-bit build fix.
bdakin@apple.com [Wed, 12 Apr 2017 20:22:21 +0000 (20:22 +0000)]
32-bit build fix.

* UIProcess/API/mac/WKView.mm:
(-[WKView _mediaPlaybackControlsView]):

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

2 years agoSpeculative open source build fix.
bdakin@apple.com [Wed, 12 Apr 2017 20:20:04 +0000 (20:20 +0000)]
Speculative open source build fix.

* platform/spi/cocoa/AVKitSPI.h:

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

2 years agoMore 32-bit build fix.
bdakin@apple.com [Wed, 12 Apr 2017 20:04:42 +0000 (20:04 +0000)]
More 32-bit build fix.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _mediaPlaybackControlsView]):
(-[WKWebView _addMediaPlaybackControlsView:]):
* UIProcess/API/mac/WKView.mm:
(-[WKView _mediaPlaybackControlsView]):
(-[WKView _addMediaPlaybackControlsView:]):

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

2 years agoAnother 32 bit build fix.
bdakin@apple.com [Wed, 12 Apr 2017 19:56:01 +0000 (19:56 +0000)]
Another 32 bit build fix.

* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::mediaPlaybackControlsView):

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

2 years agoSpeculative build fix.
bdakin@apple.com [Wed, 12 Apr 2017 19:49:00 +0000 (19:49 +0000)]
Speculative build fix.

* WebView/WebViewData.h:

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

2 years agoStop using didReceiveDataArray callback on El Capitan
achristensen@apple.com [Wed, 12 Apr 2017 19:40:58 +0000 (19:40 +0000)]
Stop using didReceiveDataArray callback on El Capitan
https://bugs.webkit.org/show_bug.cgi?id=170780

Reviewed by Brady Eidson.

Source/WebCore:

didReceiveDataArray was an optimization that improved performance on iOS but is not needed any more.
The only platform where this is used is El Capitan, and didReceiveData works fine on that platform.
I've left some cleanup still to be done in SharedBuffer, and doing that is the motivation for this change.

* WebCore.xcodeproj/project.pbxproj:
* loader/ResourceLoader.h:
* loader/SubresourceLoader.h:
* loader/cf/SubresourceLoaderCF.cpp: Removed.
* loader/mac/ResourceLoaderMac.mm:
(WebCore::ResourceLoader::didReceiveDataArray): Deleted.
* platform/network/ResourceHandleClient.h:
(WebCore::ResourceHandleClient::supportsDataArray): Deleted.
(WebCore::ResourceHandleClient::didReceiveDataArray): Deleted.
* platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
(WebCore::ResourceHandleCFURLConnectionDelegate::makeConnectionClient):
(WebCore::ResourceHandleCFURLConnectionDelegate::didReceiveDataArrayCallback): Deleted.
* platform/network/cf/ResourceHandleCFURLConnectionDelegate.h:
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveDataArray): Deleted.
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
* platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveDataArray): Deleted.
* platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.h:
* platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
(-[WebCoreResourceHandleAsDelegate connection:didReceiveDataArray:]): Deleted.
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveDataArray:]): Deleted.

Source/WebKit2:

* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::supportsDataArray): Deleted.
(WebKit::NetworkLoad::didReceiveDataArray): Deleted.
* NetworkProcess/NetworkLoad.h:

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

2 years agoSpeculative build fix.
bdakin@apple.com [Wed, 12 Apr 2017 19:28:05 +0000 (19:28 +0000)]
Speculative build fix.

* UIProcess/API/Cocoa/WKViewPrivate.h:

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

2 years agoREGRESSION: LayoutTest webrtc/negotiatedneeded-event-addStream.html is frequently...
commit-queue@webkit.org [Wed, 12 Apr 2017 19:17:19 +0000 (19:17 +0000)]
REGRESSION: LayoutTest webrtc/negotiatedneeded-event-addStream.html is frequently crashing
https://bugs.webkit.org/show_bug.cgi?id=170754
<rdar://problem/31573169>

Unreviewed.

Patch by Youenn Fablet <youenn@apple.com> on 2017-04-12

* TestExpectations: Marking test as crashing.

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

2 years agoAttempted build fix.
bdakin@apple.com [Wed, 12 Apr 2017 19:12:21 +0000 (19:12 +0000)]
Attempted build fix.

* platform/spi/cocoa/AVKitSPI.h:

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

2 years agoAttempted build fix.
bdakin@apple.com [Wed, 12 Apr 2017 19:02:51 +0000 (19:02 +0000)]
Attempted build fix.

* UIProcess/API/Cocoa/WKWebViewPrivate.h:

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

2 years agoAdopt AVKit name change from AVFunctionBar* to AVTouchBar*
bdakin@apple.com [Wed, 12 Apr 2017 18:38:09 +0000 (18:38 +0000)]
Adopt AVKit name change from AVFunctionBar* to AVTouchBar*
https://bugs.webkit.org/show_bug.cgi?id=170693
-and corresponding-
rdar://problem/31230018

Source/WebCore:

Reviewed by San Weinig.

Since the new names only apply to some versions of macOS, this patch uses typedefs
for the older OS’s. SO:

AVFunctionBarScrubber is now AVTouchBarScrubber

AVFunctionBarPlaybackControlsProvider is now AVTouchBarPlaybackControlsProvider

AVFunctionBarMediaSelectionOption is now AVTouchBarMediaSelectionOption

And the protocol AVFunctionBarPlaybackControlsControlling is now
AVTouchBarPlaybackControlsControlling

* platform/mac/WebPlaybackControlsManager.h:
* platform/mac/WebPlaybackControlsManager.mm:
(-[WebPlaybackControlsManager audioFunctionBarMediaSelectionOptions]):
(-[WebPlaybackControlsManager setAudioFunctionBarMediaSelectionOptions:]):
(-[WebPlaybackControlsManager currentAudioFunctionBarMediaSelectionOption]):
(-[WebPlaybackControlsManager setCurrentAudioFunctionBarMediaSelectionOption:]):
(-[WebPlaybackControlsManager legibleFunctionBarMediaSelectionOptions]):
(-[WebPlaybackControlsManager setLegibleFunctionBarMediaSelectionOptions:]):
(-[WebPlaybackControlsManager currentLegibleFunctionBarMediaSelectionOption]):
(-[WebPlaybackControlsManager setCurrentLegibleFunctionBarMediaSelectionOption:]):
(mediaSelectionOptions):

Here is where the typedefs and #define are declared.
* platform/spi/cocoa/AVKitSPI.h:

Source/WebKit/mac:

Reviewed by Sam Weinig.

Since the new names only apply to some versions of macOS, this patch uses typedefs
for the older OS’s. SO:

AVFunctionBarScrubber is now AVTouchBarScrubber

AVFunctionBarPlaybackControlsProvider is now AVTouchBarPlaybackControlsProvider

AVFunctionBarMediaSelectionOption is now AVTouchBarMediaSelectionOption

And the protocol AVFunctionBarPlaybackControlsControlling is now
AVTouchBarPlaybackControlsControlling

Soft links and allocations cannot use the typedefs.
* WebView/WebView.mm:
(-[WebView updateMediaTouchBar]):
* WebView/WebViewData.h:

Source/WebKit2:

Reviewed by Sam Weinig.

Since the new names only apply to some versions of macOS, this patch uses typedefs
for the older OS’s. SO:

AVFunctionBarScrubber is now AVTouchBarScrubber

AVFunctionBarPlaybackControlsProvider is now AVTouchBarPlaybackControlsProvider

AVFunctionBarMediaSelectionOption is now AVTouchBarMediaSelectionOption

And the protocol AVFunctionBarPlaybackControlsControlling is now
AVTouchBarPlaybackControlsControlling

Use the new name.
* UIProcess/API/Cocoa/WKViewPrivate.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _mediaPlaybackControlsView]):
(-[WKWebView _addMediaPlaybackControlsView:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/mac/WKView.mm:
(-[WKView _mediaPlaybackControlsView]):
(-[WKView _addMediaPlaybackControlsView:]):
* UIProcess/Cocoa/WebViewImpl.h:

Soft links and allocations cannot use the typedefs.
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::mediaPlaybackControlsView):
(WebKit::WebViewImpl::updateMediaTouchBar):

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

2 years ago[MediaStream] Audio source in UI process not identified as capture source
eric.carlson@apple.com [Wed, 12 Apr 2017 18:10:43 +0000 (18:10 +0000)]
[MediaStream] Audio source in UI process not identified as capture source
https://bugs.webkit.org/show_bug.cgi?id=170776

Reviewed by Youenn Fablet.

* WebProcess/cocoa/UserMediaCaptureManager.cpp: Override isCaptureSource.

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

2 years agoImplement Object.isFrozen() and Object.isSealed() per ECMA spec
msaboff@apple.com [Wed, 12 Apr 2017 17:35:31 +0000 (17:35 +0000)]
Implement Object.isFrozen() and Object.isSealed() per ECMA spec
https://bugs.webkit.org/show_bug.cgi?id=170753

Reviewed by Mark Lam.

JSTests:

Added JSC baseline and enabled defineIndexProperty test.

Note that JSC differs from Chakra in that a JSC doesn't use indexed
properties placed on the Array prototype when sorting the indexed
properties of an Object.  This is behavior is considered undefined
in the standard.

* ChakraCore.yaml:
* ChakraCore/test/es5/defineIndexProperty.baseline-jsc: Added.

Source/JavaScriptCore:

* runtime/ObjectConstructor.cpp:
(JSC::testIntegrityLevel): Added local helper as described in the ECMA standard.

(JSC::objectConstructorSeal):
(JSC::objectConstructorFreeze):
Eliminated incomplete special handling of JSFinalObjects.

(JSC::objectConstructorIsSealed):
(JSC::objectConstructorIsFrozen):
Refactored to use the new testIntegrityLevel() helper.

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

2 years agoAllow iOS to toggle webRTCAPI legacy flag.
commit-queue@webkit.org [Wed, 12 Apr 2017 17:23:09 +0000 (17:23 +0000)]
Allow iOS to toggle webRTCAPI legacy flag.
https://bugs.webkit.org/show_bug.cgi?id=170735

Patch by Andrew Gold <agold@apple.com> on 2017-04-12
Reviewed by Eric Carlson.

* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _webRTCLegacyAPIEnabled]):
(-[WKPreferences _setWebRTCLegacyAPIEnabled:]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:

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

2 years agoUse HAVE(MACHINE_CONTEXT) instead of USE(MACHINE_CONTEXT)
utatane.tea@gmail.com [Wed, 12 Apr 2017 17:19:57 +0000 (17:19 +0000)]
Use HAVE(MACHINE_CONTEXT) instead of USE(MACHINE_CONTEXT)
https://bugs.webkit.org/show_bug.cgi?id=170770

Rubber stamped by Mark Lam.

Source/JavaScriptCore:

* heap/MachineStackMarker.cpp:
(JSC::MachineThreads::MachineThread::Registers::framePointer):
(JSC::MachineThreads::MachineThread::Registers::instructionPointer):
(JSC::MachineThreads::MachineThread::Registers::llintPC):
* runtime/MachineContext.h:
(JSC::MachineContext::stackPointer):
(JSC::MachineContext::framePointer):
(JSC::MachineContext::instructionPointer):
(JSC::MachineContext::argumentPointer<1>):
(JSC::MachineContext::llintInstructionPointer):

Source/WTF:

* wtf/Platform.h:
* wtf/PlatformRegisters.h:
* wtf/ThreadingPthreads.cpp:
(WTF::Thread::getRegisters):

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

2 years ago[JSC] Clean up heap/MachineStackMarker by introducing USE(MACHINE_CONTEXT)
utatane.tea@gmail.com [Wed, 12 Apr 2017 16:59:26 +0000 (16:59 +0000)]
[JSC] Clean up heap/MachineStackMarker by introducing USE(MACHINE_CONTEXT)
https://bugs.webkit.org/show_bug.cgi?id=170770

Reviewed by Mark Lam.

Source/JavaScriptCore:

We use USE(MACHINE_CONTEXT) to clean up runtime/MachineContext.h. And
we clean up heap/MachineStackMarker.cpp by using MachineContext functions.

* heap/MachineStackMarker.cpp:
(JSC::MachineThreads::MachineThread::Registers::stackPointer):
(JSC::MachineThreads::MachineThread::Registers::framePointer):
(JSC::MachineThreads::MachineThread::Registers::instructionPointer):
(JSC::MachineThreads::MachineThread::Registers::llintPC):
* heap/MachineStackMarker.h:
* runtime/MachineContext.h:
(JSC::MachineContext::stackPointer):
(JSC::MachineContext::framePointer):
(JSC::MachineContext::instructionPointer):
(JSC::MachineContext::argumentPointer<1>):
(JSC::MachineContext::llintInstructionPointer):

Source/WTF:

We add a new define USE_MACHINE_CONTEXT, which becomes true if mcontext_t exists
and we know the way to retrieve values from mcontext_t.

* wtf/Platform.h:
* wtf/PlatformRegisters.h:
* wtf/ThreadingPthreads.cpp:
(WTF::Thread::getRegisters):

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

2 years agoFix WinCairo build after r215265
achristensen@apple.com [Wed, 12 Apr 2017 15:52:39 +0000 (15:52 +0000)]
Fix WinCairo build after r215265
https://bugs.webkit.org/show_bug.cgi?id=170502

m_threadId was removed in the header but not in the constructor implementation.
Initializer lists are our friends.

* platform/network/curl/CurlDownload.cpp:
(WebCore::CurlDownloadManager::CurlDownloadManager):
(WebCore::CurlDownload::CurlDownload): Deleted.
* platform/network/curl/CurlDownload.h:

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

2 years agoUnreviewed, build fix for Win and GTK
utatane.tea@gmail.com [Wed, 12 Apr 2017 12:33:03 +0000 (12:33 +0000)]
Unreviewed, build fix for Win and GTK
https://bugs.webkit.org/show_bug.cgi?id=170758

* platform/posix/SharedBufferPOSIX.cpp:
(WebCore::SharedBuffer::createFromReadingFile):
* platform/win/SharedBufferWin.cpp:
(WebCore::SharedBuffer::createFromReadingFile):

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

2 years agoUnreviewed, build fix for GTK port after r215262
utatane.tea@gmail.com [Wed, 12 Apr 2017 12:16:24 +0000 (12:16 +0000)]
Unreviewed, build fix for GTK port after r215262
https://bugs.webkit.org/show_bug.cgi?id=170758

* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::didRead):

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

2 years ago[WTF] Introduce Thread class and use RefPtr<Thread> and align Windows Threading imple...
utatane.tea@gmail.com [Wed, 12 Apr 2017 12:08:29 +0000 (12:08 +0000)]
[WTF] Introduce Thread class and use RefPtr<Thread> and align Windows Threading implementation semantics to Pthread one
https://bugs.webkit.org/show_bug.cgi?id=170502

Reviewed by Mark Lam.

Source/JavaScriptCore:

* API/tests/CompareAndSwapTest.cpp:
(testCompareAndSwap):
* JavaScriptCore.xcodeproj/project.pbxproj:
* b3/air/testair.cpp:
* b3/testb3.cpp:
(JSC::B3::run):
* bytecode/SuperSampler.cpp:
(JSC::initializeSuperSampler):
* dfg/DFGWorklist.cpp:
* disassembler/Disassembler.cpp:
* heap/Heap.cpp:
(JSC::Heap::lastChanceToFinalize):
(JSC::Heap::notifyIsSafeToCollect):
* heap/Heap.h:
* heap/MachineStackMarker.cpp:
(JSC::MachineThreads::~MachineThreads):
(JSC::MachineThreads::addCurrentThread):
(JSC::MachineThreads::removeThread):
(JSC::MachineThreads::removeThreadIfFound):
(JSC::MachineThreads::MachineThread::MachineThread):
(JSC::MachineThreads::MachineThread::getRegisters):
(JSC::MachineThreads::MachineThread::Registers::stackPointer):
(JSC::MachineThreads::MachineThread::Registers::framePointer):
(JSC::MachineThreads::MachineThread::Registers::instructionPointer):
(JSC::MachineThreads::MachineThread::Registers::llintPC):
(JSC::MachineThreads::MachineThread::captureStack):
(JSC::MachineThreads::tryCopyOtherThreadStack):
(JSC::MachineThreads::tryCopyOtherThreadStacks):
(pthreadSignalHandlerSuspendResume): Deleted.
(JSC::threadData): Deleted.
(JSC::MachineThreads::Thread::Thread): Deleted.
(JSC::MachineThreads::Thread::createForCurrentThread): Deleted.
(JSC::MachineThreads::Thread::operator==): Deleted.
(JSC::MachineThreads::machineThreadForCurrentThread): Deleted.
(JSC::MachineThreads::ThreadData::ThreadData): Deleted.
(JSC::MachineThreads::ThreadData::~ThreadData): Deleted.
(JSC::MachineThreads::ThreadData::suspend): Deleted.
(JSC::MachineThreads::ThreadData::resume): Deleted.
(JSC::MachineThreads::ThreadData::getRegisters): Deleted.
(JSC::MachineThreads::ThreadData::Registers::stackPointer): Deleted.
(JSC::MachineThreads::ThreadData::Registers::framePointer): Deleted.
(JSC::MachineThreads::ThreadData::Registers::instructionPointer): Deleted.
(JSC::MachineThreads::ThreadData::Registers::llintPC): Deleted.
(JSC::MachineThreads::ThreadData::freeRegisters): Deleted.
(JSC::MachineThreads::ThreadData::captureStack): Deleted.
* heap/MachineStackMarker.h:
(JSC::MachineThreads::MachineThread::suspend):
(JSC::MachineThreads::MachineThread::resume):
(JSC::MachineThreads::MachineThread::threadID):
(JSC::MachineThreads::MachineThread::stackBase):
(JSC::MachineThreads::MachineThread::stackEnd):
(JSC::MachineThreads::threadsListHead):
(JSC::MachineThreads::Thread::operator!=): Deleted.
(JSC::MachineThreads::Thread::suspend): Deleted.
(JSC::MachineThreads::Thread::resume): Deleted.
(JSC::MachineThreads::Thread::getRegisters): Deleted.
(JSC::MachineThreads::Thread::freeRegisters): Deleted.
(JSC::MachineThreads::Thread::captureStack): Deleted.
(JSC::MachineThreads::Thread::platformThread): Deleted.
(JSC::MachineThreads::Thread::stackBase): Deleted.
(JSC::MachineThreads::Thread::stackEnd): Deleted.
* jit/ICStats.cpp:
(JSC::ICStats::ICStats):
(JSC::ICStats::~ICStats):
* jit/ICStats.h:
* jsc.cpp:
(functionDollarAgentStart):
(startTimeoutThreadIfNeeded):
* runtime/JSLock.cpp:
(JSC::JSLock::lock):
* runtime/JSLock.h:
(JSC::JSLock::ownerThread):
(JSC::JSLock::currentThreadIsHoldingLock):
* runtime/SamplingProfiler.cpp:
(JSC::FrameWalker::isValidFramePointer):
(JSC::SamplingProfiler::SamplingProfiler):
(JSC::SamplingProfiler::createThreadIfNecessary):
(JSC::SamplingProfiler::takeSample):
* runtime/SamplingProfiler.h:
* runtime/VM.h:
(JSC::VM::ownerThread):
* runtime/VMTraps.cpp:
(JSC::findActiveVMAndStackBounds):
(JSC::VMTraps::SignalSender::send):
(JSC::VMTraps::fireTrap):

Source/WebCore:

Mechanical change. Use Thread:: APIs.

* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::IDBServer):
* Modules/indexeddb/server/IDBServer.h:
* Modules/webaudio/AsyncAudioDecoder.cpp:
(WebCore::AsyncAudioDecoder::AsyncAudioDecoder):
(WebCore::AsyncAudioDecoder::~AsyncAudioDecoder):
(WebCore::AsyncAudioDecoder::runLoop):
* Modules/webaudio/AsyncAudioDecoder.h:
* Modules/webaudio/OfflineAudioDestinationNode.cpp:
(WebCore::OfflineAudioDestinationNode::OfflineAudioDestinationNode):
(WebCore::OfflineAudioDestinationNode::uninitialize):
(WebCore::OfflineAudioDestinationNode::startRendering):
* Modules/webaudio/OfflineAudioDestinationNode.h:
* Modules/webdatabase/Database.cpp:
(WebCore::Database::securityOrigin):
* Modules/webdatabase/DatabaseThread.cpp:
(WebCore::DatabaseThread::start):
(WebCore::DatabaseThread::databaseThread):
(WebCore::DatabaseThread::recordDatabaseOpen):
(WebCore::DatabaseThread::recordDatabaseClosed):
* Modules/webdatabase/DatabaseThread.h:
(WebCore::DatabaseThread::getThreadID):
* bindings/js/GCController.cpp:
(WebCore::GCController::garbageCollectOnAlternateThreadForDebugging):
* fileapi/AsyncFileStream.cpp:
(WebCore::callOnFileThread):
* loader/icon/IconDatabase.cpp:
(WebCore::IconDatabase::open):
(WebCore::IconDatabase::close):
* loader/icon/IconDatabase.h:
* page/ResourceUsageThread.cpp:
(WebCore::ResourceUsageThread::createThreadIfNeeded):
* page/ResourceUsageThread.h:
* page/scrolling/ScrollingThread.cpp:
(WebCore::ScrollingThread::ScrollingThread):
(WebCore::ScrollingThread::isCurrentThread):
(WebCore::ScrollingThread::createThreadIfNeeded):
(WebCore::ScrollingThread::threadCallback):
* page/scrolling/ScrollingThread.h:
* platform/audio/HRTFDatabaseLoader.cpp:
(WebCore::HRTFDatabaseLoader::HRTFDatabaseLoader):
(WebCore::HRTFDatabaseLoader::loadAsynchronously):
(WebCore::HRTFDatabaseLoader::waitForLoaderThreadCompletion):
* platform/audio/HRTFDatabaseLoader.h:
* platform/audio/ReverbConvolver.cpp:
(WebCore::ReverbConvolver::ReverbConvolver):
(WebCore::ReverbConvolver::~ReverbConvolver):
* platform/audio/ReverbConvolver.h:
* platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
(WebCore::createBusFromAudioFile):
(WebCore::createBusFromInMemoryAudioFile):
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(ResourceHandleStreamingClient::ResourceHandleStreamingClient):
(ResourceHandleStreamingClient::~ResourceHandleStreamingClient):
* platform/network/cf/LoaderRunLoopCF.cpp:
(WebCore::loaderRunLoop):
* platform/network/curl/CurlDownload.cpp:
(WebCore::CurlDownloadManager::startThreadIfNeeded):
(WebCore::CurlDownloadManager::stopThread):
* platform/network/curl/CurlDownload.h:
* platform/network/curl/SocketStreamHandleImpl.h:
* platform/network/curl/SocketStreamHandleImplCurl.cpp:
(WebCore::SocketStreamHandleImpl::startThread):
(WebCore::SocketStreamHandleImpl::stopThread):
* workers/WorkerThread.cpp:
(WebCore::WorkerThread::WorkerThread):
(WebCore::WorkerThread::start):
(WebCore::WorkerThread::workerThread):
* workers/WorkerThread.h:
(WebCore::WorkerThread::threadID):

Source/WebKit:

Mechanical change. Use Thread:: APIs.

* Storage/StorageThread.cpp:
(WebCore::StorageThread::StorageThread):
(WebCore::StorageThread::~StorageThread):
(WebCore::StorageThread::start):
(WebCore::StorageThread::dispatch):
(WebCore::StorageThread::terminate):
* Storage/StorageThread.h:

Source/WebKit2:

Mechanical change. Use Thread:: APIs.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
(WebKit::NetworkCache::IOChannel::readSyncInThread):
* Platform/IPC/Connection.cpp:
(IPC::Connection::processIncomingMessage):
* Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
(WebKit::XPCServiceInitializer):
* UIProcess/linux/MemoryPressureMonitor.cpp:
(WebKit::MemoryPressureMonitor::MemoryPressureMonitor):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):

Source/WTF:

This patch is refactoring of WTF Threading mechanism to merge JavaScriptCore's threading extension to WTF Threading.
Previously, JavaScriptCore requires richer threading features (such as suspending and resuming threads), and they
are implemented for PlatformThread in JavaScriptCore. But these features should be implemented in WTF Threading side
instead of maintaining JSC's own threading features too. This patch removes these features from JSC and move it to
WTF Threading.

However, current WTF Threading has one problem: Windows version of WTF Threading has different semantics from Pthreads
one. In Windows WTF Threading, we cannot perform any operation after the target thread is detached: WTF Threading stop
tracking the state of the thread once the thread is detached. But this is not the same to Pthreads one. In Pthreads,
pthread_detach just means that the resource of the thread will be destroyed automatically. While some operations like
pthread_join will be rejected, some operations like pthread_kill will be accepted.

The problem is that detached thread can be suspended and resumed in JSC. For example, in jsc.cpp, we start the worker
thread and detach it immediately. In worker thread, we will create VM and thus concurrent GC will suspend and resume
the detached thread. However, in Windows WTF Threading, we have no reference to the detached thread. Thus we cannot
perform suspend and resume operations onto the detached thread.

To solve the problem, we change Windows Threading mechanism drastically to align it to the Pthread semantics. In the
new Threading, we have RefPtr<Thread> class. It holds a handle to a platform thread. We can perform threading operations
with this class. For example, Thread::suspend is offered. And we use destructor of the thread local variable to release
the resources held by RefPtr<Thread>. In Windows, Thread::detach does nothing because the resource will be destroyed
automatically by RefPtr<Thread>.

To do so, we introduce ThreadHolder for Windows. This is similar to the previous ThreadIdentifierData for Pthreads.
It holds RefPtr<Thread> in the thread local storage (technically, it is Fiber Local Storage in Windows). Thread::current()
will return this reference.

The problematic situation is that the order of the deallocation of the thread local storage is not defined. So we should
not touch thread local storage in the destructor of the thread local storage. To avoid such edge cases, we have
currentThread() / Thread::currentID() APIs. They are safe to be called even in the destructor of the other thread local
storage. And in Windows, in the FLS destructor, we will create the thread_local variable to defer the destruction of
the ThreadHolder. We ensure that this destructor is called after the other FLS destructors are called in Windows 10.

This patch is performance neutral.

* WTF.xcodeproj/project.pbxproj:
* benchmarks/ConditionSpeedTest.cpp:
* benchmarks/LockFairnessTest.cpp:
* benchmarks/LockSpeedTest.cpp:
* wtf/AutomaticThread.cpp:
(WTF::AutomaticThread::start):
* wtf/CMakeLists.txt:
* wtf/MainThread.h:
* wtf/MemoryPressureHandler.h:
* wtf/ParallelJobsGeneric.cpp:
(WTF::ParallelEnvironment::ThreadPrivate::tryLockFor):
(WTF::ParallelEnvironment::ThreadPrivate::workerThread):
* wtf/ParallelJobsGeneric.h:
(WTF::ParallelEnvironment::ThreadPrivate::ThreadPrivate): Deleted.
* wtf/ParkingLot.cpp:
(WTF::ParkingLot::forEachImpl):
* wtf/ParkingLot.h:
(WTF::ParkingLot::forEach):
* wtf/PlatformRegisters.h: Renamed from Source/JavaScriptCore/runtime/PlatformThread.h.
* wtf/RefPtr.h:
(WTF::RefPtr::RefPtr):
* wtf/ThreadFunctionInvocation.h:
(WTF::ThreadFunctionInvocation::ThreadFunctionInvocation):
* wtf/ThreadHolder.cpp: Added.
(WTF::ThreadHolder::~ThreadHolder):
(WTF::ThreadHolder::initialize):
* wtf/ThreadHolder.h: Renamed from Source/WTF/wtf/ThreadIdentifierDataPthreads.h.
(WTF::ThreadHolder::thread):
(WTF::ThreadHolder::ThreadHolder):
* wtf/ThreadHolderPthreads.cpp: Renamed from Source/WTF/wtf/ThreadIdentifierDataPthreads.cpp.
(WTF::ThreadHolder::initializeOnce):
(WTF::ThreadHolder::current):
(WTF::ThreadHolder::destruct):
* wtf/ThreadHolderWin.cpp: Added.
(WTF::threadMapMutex):
(WTF::threadMap):
(WTF::ThreadHolder::initializeOnce):
(WTF::ThreadHolder::current):
(WTF::ThreadHolder::destruct):
* wtf/ThreadSpecific.h:
* wtf/Threading.cpp:
(WTF::Thread::normalizeThreadName):
(WTF::threadEntryPoint):
(WTF::Thread::create):
(WTF::Thread::setCurrentThreadIsUserInteractive):
(WTF::Thread::setCurrentThreadIsUserInitiated):
(WTF::Thread::setGlobalMaxQOSClass):
(WTF::Thread::adjustedQOSClass):
(WTF::Thread::dump):
(WTF::initializeThreading):
(WTF::normalizeThreadName): Deleted.
(WTF::createThread): Deleted.
(WTF::setCurrentThreadIsUserInteractive): Deleted.
(WTF::setCurrentThreadIsUserInitiated): Deleted.
(WTF::setGlobalMaxQOSClass): Deleted.
(WTF::adjustedQOSClass): Deleted.
* wtf/Threading.h:
(WTF::Thread::id):
(WTF::Thread::operator==):
(WTF::Thread::operator!=):
(WTF::Thread::joinableState):
(WTF::Thread::didBecomeDetached):
(WTF::Thread::didJoin):
(WTF::Thread::hasExited):
(WTF::currentThread):
* wtf/ThreadingPthreads.cpp:
(WTF::Thread::Thread):
(WTF::Thread::~Thread):
(WTF::Thread::signalHandlerSuspendResume):
(WTF::Thread::initializePlatformThreading):
(WTF::initializeCurrentThreadEvenIfNonWTFCreated):
(WTF::wtfThreadEntryPoint):
(WTF::Thread::createInternal):
(WTF::Thread::initializeCurrentThreadInternal):
(WTF::Thread::changePriority):
(WTF::Thread::waitForCompletion):
(WTF::Thread::detach):
(WTF::Thread::current):
(WTF::Thread::currentID):
(WTF::Thread::signal):
(WTF::Thread::resume):
(WTF::Thread::getRegisters):
(WTF::Thread::didExit):
(WTF::Thread::establish):
(WTF::PthreadState::PthreadState): Deleted.
(WTF::PthreadState::joinableState): Deleted.
(WTF::PthreadState::pthreadHandle): Deleted.
(WTF::PthreadState::didBecomeDetached): Deleted.
(WTF::PthreadState::didExit): Deleted.
(WTF::PthreadState::didJoin): Deleted.
(WTF::PthreadState::hasExited): Deleted.
(WTF::threadMapMutex): Deleted.
(WTF::initializeThreading): Deleted.
(WTF::threadMap): Deleted.
(WTF::identifierByPthreadHandle): Deleted.
(WTF::establishIdentifierForPthreadHandle): Deleted.
(WTF::pthreadHandleForIdentifierWithLockAlreadyHeld): Deleted.
(WTF::createThreadInternal): Deleted.
(WTF::initializeCurrentThreadInternal): Deleted.
(WTF::changeThreadPriority): Deleted.
(WTF::waitForThreadCompletion): Deleted.
(WTF::detachThread): Deleted.
(WTF::threadDidExit): Deleted.
(WTF::currentThread): Deleted.
(WTF::signalThread): Deleted.
* wtf/ThreadingWin.cpp:
(WTF::Thread::Thread):
(WTF::Thread::~Thread):
(WTF::Thread::initializeCurrentThreadInternal):
(WTF::Thread::initializePlatformThreading):
(WTF::wtfThreadEntryPoint):
(WTF::Thread::createInternal):
(WTF::Thread::changePriority):
(WTF::Thread::waitForCompletion):
(WTF::Thread::detach):
(WTF::Thread::resume):
(WTF::Thread::getRegisters):
(WTF::Thread::current):
(WTF::Thread::currentID):
(WTF::Thread::didExit):
(WTF::Thread::establish):
(WTF::initializeCurrentThreadInternal): Deleted.
(WTF::threadMapMutex): Deleted.
(WTF::initializeThreading): Deleted.
(WTF::threadMap): Deleted.
(WTF::storeThreadHandleByIdentifier): Deleted.
(WTF::threadHandleForIdentifier): Deleted.
(WTF::clearThreadHandleForIdentifier): Deleted.
(WTF::createThreadInternal): Deleted.
(WTF::changeThreadPriority): Deleted.
(WTF::waitForThreadCompletion): Deleted.
(WTF::detachThread): Deleted.
(WTF::currentThread): Deleted.
* wtf/WorkQueue.cpp:
(WTF::WorkQueue::concurrentApply):
* wtf/WorkQueue.h:
* wtf/cocoa/WorkQueueCocoa.cpp:
(WTF::dispatchQOSClass):
* wtf/generic/WorkQueueGeneric.cpp:
(WorkQueue::platformInitialize):
(WorkQueue::platformInvalidate):
* wtf/linux/MemoryPressureHandlerLinux.cpp:
(WTF::MemoryPressureHandler::EventFDPoller::EventFDPoller):
(WTF::MemoryPressureHandler::EventFDPoller::~EventFDPoller):
* wtf/win/MainThreadWin.cpp:
(WTF::initializeMainThreadPlatform):

Tools:

Mechanical change. Use Thread:: APIs.

* DumpRenderTree/JavaScriptThreading.cpp:
(runJavaScriptThread):
(startJavaScriptThreads):
(stopJavaScriptThreads):
* DumpRenderTree/mac/DumpRenderTree.mm:
(testThreadIdentifierMap):
* TestWebKitAPI/Tests/WTF/Condition.cpp:
* TestWebKitAPI/Tests/WTF/Lock.cpp:
(TestWebKitAPI::runLockTest):
* TestWebKitAPI/Tests/WTF/ParkingLot.cpp:

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

2 years ago[css-grid] Replaced elements don't properly resolve percentage heights
rego@igalia.com [Wed, 12 Apr 2017 10:14:30 +0000 (10:14 +0000)]
[css-grid] Replaced elements don't properly resolve percentage heights
https://bugs.webkit.org/show_bug.cgi?id=159670

Reviewed by Darin Adler.

The issue was fixed in r213149 (bug #168657), but the Blink test was not imported.
This patch only adds the test to avoid regressions in the future.

* fast/css-grid-layout/grid-item-with-percent-height-replaced-element-expected.txt: Added.
* fast/css-grid-layout/grid-item-with-percent-height-replaced-element.html: Added.

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

2 years agoCache small media resources in disk cache
antti@apple.com [Wed, 12 Apr 2017 10:09:14 +0000 (10:09 +0000)]
Cache small media resources in disk cache
https://bugs.webkit.org/show_bug.cgi?id=170676
<rdar://problem/31532649>

Reviewed by Andreas Kling.

Source/WebCore:

Test: http/tests/cache/disk-cache/disk-cache-media-small.html

Testing support. Functional changes are in WebKit2.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerCreateResourceLoader):
(WebCore::HTMLMediaElement::lastMediaResourceLoaderForTesting):
* html/HTMLMediaElement.h:
* loader/MediaResourceLoader.cpp:
(WebCore::MediaResourceLoader::MediaResourceLoader):
(WebCore::MediaResourceLoader::addResponseForTesting):
(WebCore::MediaResource::responseReceived):
* loader/MediaResourceLoader.h:
* platform/network/cocoa/WebCoreNSURLSession.mm:
(-[WebCoreNSURLSessionDataTask resource:receivedResponse:]):

    We can now receive cached responses.

* testing/Internals.cpp:
(WebCore::responseSourceToString):
(WebCore::Internals::xhrResponseSource):
(WebCore::Internals::mediaResponseSources):
(WebCore::Internals::mediaResponseContentRanges):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit2:

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::makeRetrieveDecision):

    Allow retrieving media resources.

(WebKit::NetworkCache::expectedTotalResourceSizeFromContentRange):
(WebKit::NetworkCache::expectedTotalResourceSize):
(WebKit::NetworkCache::makeStoreDecision):

    Store media resource if we can figure out its total size and it is less than 5MB
    (and it is cacheable by the usual rules).

LayoutTests:

* http/tests/cache/disk-cache/disk-cache-media-small-expected.txt: Added.
* http/tests/cache/disk-cache/disk-cache-media-small.html: Added.

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

2 years agoModernize vector adoption
commit-queue@webkit.org [Wed, 12 Apr 2017 09:25:04 +0000 (09:25 +0000)]
Modernize vector adoption
https://bugs.webkit.org/show_bug.cgi?id=170758

Patch by Alex Christensen <achristensen@webkit.org> on 2017-04-12
Reviewed by Geoffrey Garen.

Source/WebCore:

* Modules/encryptedmedia/InitDataRegistry.cpp:
(WebCore::extractKeyIDsKeyids):
* Modules/indexeddb/IDBGetResult.cpp:
(WebCore::IDBGetResult::dataFromBuffer):
* Modules/indexeddb/IDBKeyData.cpp:
(WebCore::IDBKeyData::decode):
* Modules/indexeddb/server/IDBSerialization.cpp:
(WebCore::serializeIDBKeyData):
(WebCore::decodeKey):
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey):
* Modules/indexeddb/server/SQLiteIDBCursor.cpp:
(WebCore::IDBServer::SQLiteIDBCursor::internalFetchNextRecord):
* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::font):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadResourceSynchronously):
* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::loadCache):
* loader/archive/mhtml/MHTMLParser.cpp:
(WebCore::MHTMLParser::parseNextPart):
* loader/cache/CachedFont.cpp:
(WebCore::CachedFont::createCustomFontData):
* loader/cache/CachedSVGFont.cpp:
(WebCore::CachedSVGFont::ensureCustomFontData):
* platform/SharedBuffer.cpp:
(WebCore::SharedBuffer::create):
(WebCore::utf8Buffer):
(WebCore::SharedBuffer::adoptVector): Deleted.
* platform/SharedBuffer.h:
* platform/ThreadSafeDataBuffer.h:
(WebCore::ThreadSafeDataBufferImpl::ThreadSafeDataBufferImpl):
(WebCore::ThreadSafeDataBuffer::create):
(WebCore::ThreadSafeDataBuffer::ThreadSafeDataBuffer):
(WebCore::ThreadSafeDataBuffer::decode):
(): Deleted.
(WebCore::ThreadSafeDataBuffer::adoptVector): Deleted.
* platform/network/BlobRegistryImpl.cpp:
(WebCore::BlobRegistryImpl::registerBlobURL):
* platform/network/DataURLDecoder.cpp:
(WebCore::DataURLDecoder::decodeBase64):
(WebCore::DataURLDecoder::decodeEscaped):

Source/WebKit2:

* NetworkProcess/capture/NetworkCaptureEvent.cpp:
(WebKit::NetworkCapture::JSONCoder<WebCore::SharedBuffer>::decode):
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::bufferForType):

Tools:

* TestWebKitAPI/Tests/WebCore/SharedBuffer.cpp:
(TestWebKitAPI::TEST_F):

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

2 years agoImplement stroke-color CSS property.
pvollan@apple.com [Wed, 12 Apr 2017 08:01:51 +0000 (08:01 +0000)]
Implement stroke-color CSS property.
https://bugs.webkit.org/show_bug.cgi?id=169352

Reviewed by Jon Lee.

Source/WebCore:

Support setting text stroke color using the CSS property stroke-color, see https://drafts.fxtf.org/paint/.
Text stroke color can currently be set with the -webkit-text-stroke-color property. To make sure this still
works, I added a check to determine if the stroke-color property has been explicitly set. If it has not been
set, we fall back to the value of the -webkit-text-stroke-color property.

Tests: fast/css/stroke-color-fallback.html
       fast/css/stroke-color.html
       fast/css/visited-link-stroke-color.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSProperties.json:
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueStrokeColor):
* css/StyleResolver.cpp:
(WebCore::isValidVisitedLinkProperty):
* css/parser/CSSParserFastPaths.cpp:
(WebCore::isColorPropertyID):
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
* rendering/TextDecorationPainter.cpp:
(WebCore::decorationColor):
* rendering/TextPaintStyle.cpp:
(WebCore::computeTextPaintStyle):
(WebCore::computeTextSelectionPaintStyle):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeRequiresRepaintIfTextOrBorderOrOutline):
(WebCore::RenderStyle::colorIncludingFallback):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::strokeColor):
(WebCore::RenderStyle::setStrokeColor):
(WebCore::RenderStyle::setVisitedLinkStrokeColor):
(WebCore::RenderStyle::visitedLinkStrokeColor):
(WebCore::RenderStyle::setHasExplicitlySetStrokeColor):
(WebCore::RenderStyle::hasExplicitlySetStrokeColor):
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator==):
* rendering/style/StyleRareInheritedData.h:

LayoutTests:

* fast/css/stroke-color-expected.html: Added.
* fast/css/stroke-color-fallback-expected.html: Added.
* fast/css/stroke-color-fallback.html: Added.
* fast/css/stroke-color.html: Added.
* fast/css/visited-link-stroke-color-expected.html: Added.
* fast/css/visited-link-stroke-color.html: Added.

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

2 years agoUnreviewed GTK+ debug build fix. Drop an unused debug-only member
zandobersek@gmail.com [Wed, 12 Apr 2017 07:29:33 +0000 (07:29 +0000)]
Unreviewed GTK+ debug build fix. Drop an unused debug-only member
variable in the CompositingRunLoop class.

* Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:

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

2 years ago[GTK] Use the DisplayRefreshMonitor facilities
zandobersek@gmail.com [Wed, 12 Apr 2017 06:50:50 +0000 (06:50 +0000)]
[GTK] Use the DisplayRefreshMonitor facilities
https://bugs.webkit.org/show_bug.cgi?id=170599

Reviewed by Carlos Garcia Campos.

Source/WebCore:

* CMakeLists.txt: Add missing files to the build.
* platform/graphics/DisplayRefreshMonitor.cpp: Build fixes.
(WebCore::DisplayRefreshMonitor::createDefaultDisplayRefreshMonitor):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::updatePlatformLayer): Mark the
platform layer as updated in the layer's CoordinatedGraphicsState.
* platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:

Source/WebKit2:

ThreadedCompositor gains a DisplayRefreshMonitor member that it can use
to better coordinate display refresh callbacks on the main thread. Still,
because currently the GTK+ port doesn't have a reliable way of notifying
the ThreadedCompositor of a vsync event, a timer targeting 60FPS is used
in order to keep the updates at a reasonable rate. When the timer is fired,
the ThreadedCompositor decides how to proceed based on state changes that
might have occurred during composition or whether there's any display
refresh callbacks that require handling on the main thread.

CompositingRunLoop now stores its state in an atomic variable that's then
inspected whenever a new update is scheduled or completed. When scheduled,
if there's no update in progress, a new update is requested through the
timer. If there's already an update in progress, a new update is marked
as pending after the current one completes. In that case, when the update
is completed, a new update is requested through the timer.

ThreadedDisplayRefreshMonitor is used to coordinate updates between the
main and the composition thread whenever the CoordinatedGraphics state
demands it, or whenever there are clients registered to that monitor that
require an update (e.g. a requestAnimationFrame() callback). After the
update on the composition thread is finished, and the DisplayRefreshMonitor
object requires an update, a callback at the same priority as the layer
flush timer is scheduled on the main thread. In that callback we handle
any clients registered for this DisplayRefreshMonitor before proceeding
to handle any changes to the CoordinatedGraphics scene. In case the
DisplayRefreshMonitor clients or the layer flushes already queued up
any changes to the state, we immediately ask the ThreadedCompositor for
an update.

* PlatformGTK.cmake:
* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::updateViewport):
(WebKit::CoordinatedGraphicsScene::commitSceneState):
* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
* Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
(WebKit::CompositingRunLoop::CompositingRunLoop):
(WebKit::CompositingRunLoop::isActive):
(WebKit::CompositingRunLoop::scheduleUpdate):
(WebKit::CompositingRunLoop::stopUpdates):
(WebKit::CompositingRunLoop::updateCompleted):
(WebKit::CompositingRunLoop::updateTimerFired):
(WebKit::CompositingRunLoop::isCurrent):
(WebKit::CompositingRunLoop::startUpdateTimer): Deleted.
(WebKit::CompositingRunLoop::stopUpdateTimer): Deleted.
* Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
(): Deleted.
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::m_displayRefreshMonitor):
(WebKit::ThreadedCompositor::invalidate):
(WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing):
(WebKit::ThreadedCompositor::updateViewport):
(WebKit::ThreadedCompositor::scheduleDisplayImmediately):
(WebKit::ThreadedCompositor::renderLayerTree):
(WebKit::ThreadedCompositor::sceneUpdateFinished):
(WebKit::ThreadedCompositor::updateSceneState):
(WebKit::ThreadedCompositor::displayRefreshMonitor):
(WebKit::ThreadedCompositor::renderNextFrameIfNeeded):
(WebKit::ThreadedCompositor::completeCoordinatedUpdateIfNeeded):
(WebKit::ThreadedCompositor::coordinateUpdateCompletionWithClient):
(WebKit::ThreadedCompositor::performFrameCompletion):
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp: Added.
(WebKit::ThreadedDisplayRefreshMonitor::ThreadedDisplayRefreshMonitor):
(WebKit::ThreadedDisplayRefreshMonitor::requestRefreshCallback):
(WebKit::ThreadedDisplayRefreshMonitor::requiresDisplayRefreshCallback):
(WebKit::ThreadedDisplayRefreshMonitor::dispatchDisplayRefreshCallback):
(WebKit::ThreadedDisplayRefreshMonitor::invalidate):
(WebKit::ThreadedDisplayRefreshMonitor::displayRefreshCallback):
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.h: Copied from Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h.
* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::createDisplayRefreshMonitor):
* WebProcess/WebPage/AcceleratedDrawingArea.h:
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
(WebKit::ThreadedCoordinatedLayerTreeHost::createDisplayRefreshMonitor):
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
* WebProcess/WebPage/LayerTreeHost.h:
(WebKit::LayerTreeHost::createDisplayRefreshMonitor):

Source/WTF:

* wtf/Platform.h: Enable USE_REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR for the GTK+ port.
* wtf/glib/RunLoopSourcePriority.h: Add the DisplayRefreshMonitorTimer entry that
matches the value of LayerFlushTimer.

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

2 years agoRetrying an A/B testing does not set the repetition count in some cases
rniwa@webkit.org [Wed, 12 Apr 2017 04:37:38 +0000 (04:37 +0000)]
Retrying an A/B testing does not set the repetition count in some cases
https://bugs.webkit.org/show_bug.cgi?id=170695

Reviewed by Joseph Pecoraro.

When selecting an existing A/B test group, the analysis task page automatically sets the repetition count
of its retry to be that of the original test group. However, this information wasn't being passed correctly
to the code that actually created a test group. As a result, the retried test group's repetition count does
not match that of the original group or the number shown to the user on UI.

Fixed the bug by updating this._repetitionCount in setRepetitionCount.

* browser-tests/index.html:
* browser-tests/test-group-form-tests.js: Added. Added tests.
(.createTestGroupFormWithContext): Added.
* public/v3/components/test-group-form.js:
(TestGroupForm.prototype.setRepetitionCount):
(TestGroupForm.formContent):
(TestGroupForm):

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

2 years agoWeb Inspector: checkboxes in Settings screen use inappropriate layout
mattbaker@apple.com [Wed, 12 Apr 2017 03:05:34 +0000 (03:05 +0000)]
Web Inspector: checkboxes in Settings screen use inappropriate layout
https://bugs.webkit.org/show_bug.cgi?id=166993
<rdar://problem/30002272>

Reviewed by Devin Rousso.

* Localizations/en.lproj/localizedStrings.js:
New checkbox setting strings.

* UserInterface/Main.html:
New settings view classes.

* UserInterface/Views/GeneralSettingsView.js: Added.
(WebInspector.GeneralSettingsView):
(WebInspector.GeneralSettingsView.prototype.initialLayout):
Move settings UI creation from SettingsTabContentView.

* UserInterface/Views/SettingEditor.js: Added.
Basic setting editor UI for the following input types: checkbox,
number, and select. In the future it may be useful to include
additional types, such as radio buttons.

(WebInspector.SettingEditor):
(WebInspector.SettingEditor.createForSetting):
(WebInspector.SettingEditor.prototype.get element):
(WebInspector.SettingEditor.prototype.get type):
(WebInspector.SettingEditor.prototype.get label):
(WebInspector.SettingEditor.prototype.get value):
(WebInspector.SettingEditor.prototype.set value):
(WebInspector.SettingEditor.prototype._createEditorElement):

* UserInterface/Views/SettingsGroup.js: Added.
A container holding editors for one or more WebInspector.Settings.
Every editor belongs to a group. SettingsView provides convenience
methods for adding settings and groups, so create instances directly
shouldn't normally be necessary.

(WebInspector.SettingsGroup):
(WebInspector.SettingsGroup.prototype.get element):
(WebInspector.SettingsGroup.prototype.addSetting):
(WebInspector.SettingsGroup.prototype.addCustomSetting):

* UserInterface/Views/SettingsTabContentView.css:
Refactored styles to more closely match Xcode settings UI.
Eliminated redundant use of "setting" from CSS class names.

(.content-view.settings):
(.content-view.settings .navigation-bar .item.radio.button.text-only):
(.content-view.settings .navigation-bar .item.radio.button.text-only.selected):
(.content-view.settings > .settings-view > .separator):
(.content-view.settings > .settings-view > .container):
(.content-view.settings > .settings-view > .container > .title):
(body[dir=ltr] .content-view.settings > .settings-view > .container > .title):
(body[dir=rtl] .content-view.settings > .settings-view > .container > .title):
(.content-view.settings > .settings-view > .container > .editor-group):
(.content-view.settings > .settings-view > .container > .editor-group > .editor input):
(.content-view.settings > .settings-view > .container > .editor-group > .editor input[type="checkbox"]):
(body[dir=ltr] .content-view.settings > .settings-view > .container > .editor-group > .editor input[type="checkbox"]):
(body[dir=rtl] .content-view.settings > .settings-view > .container > .editor-group > .editor input[type="checkbox"]):
(.content-view.settings > .settings-view > .container > .editor-group > .editor select):
(.content-view.settings > .settings-view > .container > .editor-group > .editor input[type="number"]):
(body[dir=ltr] .content-view.settings > .settings-view > .container > .editor-group > .editor input[type="number"]):
(body[dir=rtl] .content-view.settings > .settings-view > .container > .editor-group > .editor input[type="number"]):
(.content-view.settings > .header): Deleted.
(.content-view.settings > .separator): Deleted.
(.content-view.settings > .setting-container): Deleted.
(.content-view.settings > .setting-container.combined): Deleted.
(.content-view.settings > .setting-container > .setting-name): Deleted.
(body[dir=ltr] .content-view.settings > .setting-container > .setting-name): Deleted.
(body[dir=rtl] .content-view.settings > .setting-container > .setting-name): Deleted.
(.content-view.settings > .setting-container > .setting-value-controller): Deleted.
(.content-view.settings > .setting-container > .setting-value-controller input): Deleted.
(.content-view.settings > .setting-container > .setting-value-controller input[type="checkbox"]): Deleted.
(body[dir=ltr] .content-view.settings > .setting-container > .setting-value-controller input[type="checkbox"]): Deleted.
(body[dir=rtl] .content-view.settings > .setting-container > .setting-value-controller input[type="checkbox"]): Deleted.
(.content-view.settings > .setting-container > .setting-value-controller select): Deleted.
(.content-view.settings > .setting-container > .setting-value-controller input[type="number"]): Deleted.
(body[dir=ltr] .content-view.settings > .setting-container > .setting-value-controller input[type="number"]): Deleted.
(body[dir=rtl] .content-view.settings > .setting-container > .setting-value-controller input[type="number"]): Deleted.

* UserInterface/Views/SettingsTabContentView.js:
To better organize the growing number of settings, multiple settings views
are now supported, with a navigation bar for switching between them. For
now there is a single "General" setting view, and and the navigation bar
is hidden. Adding a second view will cause the bar to be shown.

(WebInspector.SettingsTabContentView):
(WebInspector.SettingsTabContentView.prototype.get type):
(WebInspector.SettingsTabContentView.prototype.get selectedSettingsView):
(WebInspector.SettingsTabContentView.prototype.set selectedSettingsView):
(WebInspector.SettingsTabContentView.prototype.addSettingsView):
(WebInspector.SettingsTabContentView.prototype._navigationItemSelected):
(WebInspector.SettingsTabContentView.prototype.layout): Deleted.
No longer needed.

* UserInterface/Views/SettingsView.js: Added.
Base class for displaying editing UI for a collection of related
WebInspector.Setting objects.

(WebInspector.SettingsView):
(WebInspector.SettingsView.prototype.get identifier):
(WebInspector.SettingsView.prototype.get displayName):
A string suitable for display in a NavigationBar showing a list of
SettingsViews (e.g. "General", "Text Editing", "Fonts & Colors", etc).

(WebInspector.SettingsView.prototype.addSetting):
Add UI for a setting, consisting of a title, an editor appropriate for
the setting's value type, and optional label and formatting options.
For example:

    addSetting("Setting 1:", new WebInspector.Setting(…, true), "Item one")
    addSetting("Setting 2:", new WebInspector.Setting(…, 1), "units")

will create a checkbox and number input field:

    Setting 1: [x] Item one
    Setting 2: [  1] units

(WebInspector.SettingsView.prototype.addCustomSetting):
Add UI for a specific editor type, with optional formatting options.
A setting can be updated in response to changes in the editor's value.

(WebInspector.SettingsView.prototype.addGroup):
Add a group, for listing multiple settings under one title. For example:

   group = addGroup("Title:")
   group.addSetting(new WebInspector.Setting(…, true), "Item one")
   group.addSetting(new WebInspector.Setting(…, false), "Item two")

will create two checkboxes under the same title:

   Title: [x] Item one
          [ ] Item two

(WebInspector.SettingsView.prototype.addSeparator):
Add vertical space between two settings or groups.

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

2 years agoModernize and clean up code
achristensen@apple.com [Tue, 11 Apr 2017 23:24:26 +0000 (23:24 +0000)]
Modernize and clean up code
https://bugs.webkit.org/show_bug.cgi?id=170752

Reviewed by Sam Weinig.

* NetworkProcess/NetworkResourceLoader.h:
* Shared/WebPreferencesStore.h:
* UIProcess/API/APIHitTestResult.cpp:
(API::HitTestResult::create):
* UIProcess/API/APIHitTestResult.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesCreate):
(WKPreferencesCreateWithIdentifier):
(WKPreferencesCreateCopy):
* UIProcess/Authentication/AuthenticationChallengeProxy.h:
* UIProcess/WebPreferences.cpp:
(WebKit::WebPreferences::createWithLegacyDefaults):
(WebKit::WebPreferences::copy):
* UIProcess/WebPreferences.h:
* WebProcess/Network/WebLoaderStrategy.h:
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::requestCheckingOfString):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::addTextCheckingRequest):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::rangeForWebSelectionAtPosition):
(WebKit::WebPage::rangeForBlockAtPoint):
(WebKit::WebPage::expandedRangeFromHandle):
(WebKit::WebPage::contractedRangeFromHandle):
(WebKit::WebPage::computeExpandAndShrinkThresholdsForHandle):
(WebKit::WebPage::changeBlockSelection):
(WebKit::WebPage::rangeForGranularityAtPoint):
(WebKit::WebPage::computePagesForPrintingAndDrawToPDF):

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

2 years ago[Modern Media Controls] Allow modern-media-controls to be provided through WebKitAddi...
commit-queue@webkit.org [Tue, 11 Apr 2017 23:03:47 +0000 (23:03 +0000)]
[Modern Media Controls] Allow modern-media-controls to be provided through WebKitAdditions
https://bugs.webkit.org/show_bug.cgi?id=170722
<rdar://problem/31553089>

Patch by Antoine Quint <graouts@apple.com> on 2017-04-11
Reviewed by Dean Jackson.

If modern media controls source files are provided through WebKitAdditions, use these instead
of the sources found in the WebCore module.

* WebCore.xcodeproj/project.pbxproj:

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

2 years agoLayoutTest webrtc/video-mute.html is a flaky failure
commit-queue@webkit.org [Tue, 11 Apr 2017 22:48:16 +0000 (22:48 +0000)]
LayoutTest webrtc/video-mute.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=170704

Patch by Youenn Fablet <youenn@apple.com> on 2017-04-11
Reviewed by Eric Carlson.

* webrtc/video-mute.html: Trying to make it less flaky.

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

2 years ago[WK1] Add captureStream test with webrtc
commit-queue@webkit.org [Tue, 11 Apr 2017 22:47:49 +0000 (22:47 +0000)]
[WK1] Add captureStream test with webrtc
https://bugs.webkit.org/show_bug.cgi?id=170746

Patch by Youenn Fablet <youenn@apple.com> on 2017-04-11
Reviewed by Eric Carlson.

* platform/mac-wk1/TestExpectations: Activating this new test in WK1.
* webrtc/captureCanvas-webrtc-expected.txt: Added.
* webrtc/captureCanvas-webrtc.html: Added.

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

2 years agoMigrating webrtc tests to latest API
commit-queue@webkit.org [Tue, 11 Apr 2017 22:47:26 +0000 (22:47 +0000)]
Migrating webrtc tests to latest API
https://bugs.webkit.org/show_bug.cgi?id=170709

Patch by Youenn Fablet <youenn@apple.com> on 2017-04-11
Reviewed by Eric Carlson.

* webrtc/audio-peer-connection-webaudio.html:
* webrtc/libwebrtc/descriptionGetters.html:
* webrtc/negotiatedneeded-event-addStream.html:
* webrtc/peer-connection-audio-mute.html:
* webrtc/peer-connection-audio-mute2.html:
* webrtc/peer-connection-remote-audio-mute.html:
* webrtc/peer-connection-remote-audio-mute2.html:
* webrtc/release-after-getting-track.html:
* webrtc/video-disabled-black.html:
* webrtc/video-mute.html:
* webrtc/video-remote-mute.html:
* webrtc/video-with-receiver.html:
* webrtc/video.html:

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

2 years agoDisable outdated WritableStream API
dino@apple.com [Tue, 11 Apr 2017 21:30:47 +0000 (21:30 +0000)]
Disable outdated WritableStream API
https://bugs.webkit.org/show_bug.cgi?id=170749
<rdar://problem/31446233>

Reviewed by Tim Horton.

The API we implement is no longer accurate. Disable it until we
are compatible with the new specification

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

2 years agoConsider the current document when allowing autoplay quirks.
mrajca@apple.com [Tue, 11 Apr 2017 20:39:51 +0000 (20:39 +0000)]
Consider the current document when allowing autoplay quirks.
https://bugs.webkit.org/show_bug.cgi?id=170744

Reviewed by Eric Carlson.

Added API test.

In addition to checking if the top-level document supports autoplay quirks, we should check
if the current document supports quirks. This allows all embedded YouTube videos (which use
iframes) to play correctly if the client allows autoplay quirks on youtube.com.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::dispatchPlayPauseEventsIfNeedsQuirks):

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

2 years agoUnreviewed, rolling out r215245.
ryanhaddad@apple.com [Tue, 11 Apr 2017 19:51:42 +0000 (19:51 +0000)]
Unreviewed, rolling out r215245.

This change broke internal builds.

Reverted changeset:

"[Modern Media Controls] Allow modern-media-controls to be
provided through WebKitAdditions"
https://bugs.webkit.org/show_bug.cgi?id=170722
http://trac.webkit.org/changeset/215245

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

2 years ago[Cocoa] WebKit unnecessarily soft-links CorePrediction
mitz@apple.com [Tue, 11 Apr 2017 19:13:23 +0000 (19:13 +0000)]
[Cocoa] WebKit unnecessarily soft-links CorePrediction
https://bugs.webkit.org/show_bug.cgi?id=170644

Reviewed by Sam Weinig.

Source/WebKit2:

* Configurations/BaseTarget.xcconfig: Defined HAVE_CORE_PREDICTION and added
  HAVE_CORE_PREDICTION to the preprocessor defintions when the former is YES.

* Configurations/WebKit.xcconfig: Have the linker link against CorePrediction where
  available. On macOS, use weak linking, because CorePrediction is not available in the
  Base System.

* Platform/classifier/cocoa/CorePredictionSoftLink.h: Removed.

* Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp: Guarded with
  #if HAVE(CORE_PREDICTION).
(WebKit::isNullFunctionPointer): Added this helper.
(WebKit::ResourceLoadStatisticsClassifierCocoa::canUseCorePrediction): Replaced
  dlopen()-based runtime check with a null check.

* Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.h: Guarded with #if
  HAVE(CORE_PREDICTION).

* Platform/spi/Cocoa/CorePredictionSPI.h: Added.

* UIProcess/WebResourceLoadStatisticsStore.h: Updated guards to include HAVE(CORE_PREDICTION).

* WebKit2.xcodeproj/project.pbxproj: pdated file references for removal and addition.

WebKitLibraries:

* WebKitPrivateFrameworkStubs/iOS/10/CorePrediction.framework: Added this framework stub.
* WebKitPrivateFrameworkStubs/iOS/10/CorePrediction.framework/CorePrediction.tbd: Added.

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

2 years agoAdd SPI for handling geolocation authorization requests
commit-queue@webkit.org [Tue, 11 Apr 2017 18:43:46 +0000 (18:43 +0000)]
Add SPI for handling geolocation authorization requests
https://bugs.webkit.org/show_bug.cgi?id=170362
rdar://problem/17508627

Patch by David Quesada <david_quesada@apple.com> on 2017-04-11
Reviewed by Alex Christensen.

Source/WebKit2:

Add a new WKUIDelegate method for the WKGeolocationProviderIOS to call when a web page
requests geolocation access. To support testing this change, make it possible to override
the CoreLocation abstraction WKGeolocationProviderIOS uses. There is now a configurable
object on the process pool that implements a protocol for providing location updates for
web views in the process pool. If the client doesn't provide this object,
WKGeolocationProviderIOS falls back to an object that wraps the existing WebKit1
WebGeolocationCoreLocationProvider and conforms to the new protocol.

* Shared/Cocoa/APIObject.mm:
(API::Object::newObject):
* Shared/WebGeolocationPosition.h:
(WebKit::WebGeolocationPosition::create):
* UIProcess/API/C/WKGeolocationPosition.cpp:
(WKGeolocationPositionCreate_b):
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _coreLocationProvider]):
(-[WKProcessPool _setCoreLocationProvider:]):
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/API/Cocoa/_WKGeolocationCoreLocationProvider.h: Copied from Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.cpp.
* UIProcess/API/Cocoa/_WKGeolocationPosition.h: Copied from Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.cpp.
* UIProcess/API/Cocoa/_WKGeolocationPosition.mm: Added.
(WebKit::if):
(-[_WKGeolocationPosition dealloc]):
(-[_WKGeolocationPosition _apiObject]):
* UIProcess/API/Cocoa/_WKGeolocationPositionInternal.h: Copied from Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.cpp.
(WebKit::wrapper):
* UIProcess/ios/WKGeolocationProviderIOS.mm:
(kit):
(-[WKGeolocationProviderIOS initWithProcessPool:]):
(-[WKGeolocationProviderIOS geolocationAuthorizationGranted]):
(-[WKGeolocationProviderIOS positionChanged:]):
(-[WKLegacyCoreLocationProvider setListener:]):
(-[WKLegacyCoreLocationProvider requestGeolocationAuthorization]):
(-[WKLegacyCoreLocationProvider start]):
(-[WKLegacyCoreLocationProvider stop]):
(-[WKLegacyCoreLocationProvider setEnableHighAccuracy:]):
(-[WKLegacyCoreLocationProvider geolocationAuthorizationGranted]):
(-[WKLegacyCoreLocationProvider geolocationAuthorizationDenied]):
(-[WKLegacyCoreLocationProvider positionChanged:]):
(-[WKLegacyCoreLocationProvider errorOccurred:]):
(-[WKLegacyCoreLocationProvider resetGeolocation]):
Implement a new class that bridges the currently used WebGeolocationCoreLocationProvider
to conform to the _WKGeolocationCoreLocationProvider protocol that WKGeolocationProviderIOS
expects.
* WebKit2.xcodeproj/project.pbxproj:

Tools:

Add API tests for the new WKUIDelegate SPI for allowing or denying websites permission
to use geolocation. Adopt the new WKProcessPool._coreLocationProvider property to
provide a stub object to simulate the various configurations of geolocation permissions:
1. The app doesn't have permission to use geolocation.
2. The app is allowed to use geolocation, but the UI delegate denies the web view permission.
3. The app is allowed to use geolocation, and the UI delegate allows the web view permission.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/Geolocation.mm: Added.
(-[TestCoreLocationProvider setListener:]):
(-[TestCoreLocationProvider requestGeolocationAuthorization]):
(-[TestCoreLocationProvider start]):
(-[TestCoreLocationProvider stop]):
(-[TestCoreLocationProvider setEnableHighAccuracy:]):
(expectException):
(-[GeolocationTestUIDelegate _webView:requestGeolocationAuthorizationForURL:frame:decisionHandler:]):
(-[GeolocationTestUIDelegate webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:completionHandler:]):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit2Cocoa/GeolocationGetCurrentPositionResult.html: Added.

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

2 years ago[Modern Media Controls] Allow modern-media-controls to be provided through WebKitAddi...
commit-queue@webkit.org [Tue, 11 Apr 2017 18:41:39 +0000 (18:41 +0000)]
[Modern Media Controls] Allow modern-media-controls to be provided through WebKitAdditions
https://bugs.webkit.org/show_bug.cgi?id=170722
<rdar://problem/31553089>

Patch by Antoine Quint <graouts@apple.com> on 2017-04-11
Reviewed by Dean Jackson.

If modern media controls source files are provided through WebKitAdditions, use these instead
of the sources found in the WebCore module.

* WebCore.xcodeproj/project.pbxproj:

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

2 years agoUnreviewed, build fix for CF ports after r215241
utatane.tea@gmail.com [Tue, 11 Apr 2017 18:39:09 +0000 (18:39 +0000)]
Unreviewed, build fix for CF ports after r215241
https://bugs.webkit.org/show_bug.cgi?id=170725

* heap/GCActivityCallback.cpp:
(JSC::GCActivityCallback::nextFireTime):

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

2 years agoChange autoplay state to "prevented" when media is paused due to restrictions.
mrajca@apple.com [Tue, 11 Apr 2017 18:29:03 +0000 (18:29 +0000)]
Change autoplay state to "prevented" when media is paused due to restrictions.
https://bugs.webkit.org/show_bug.cgi?id=170686

Reviewed by Alex Christensen.

Source/WebCore:

Added API tests.

Currently, the autoplay state is set to "prevented" when playback is about to begin without
user interaction and there are restrictions in place. We should also be setting this flag when
autoplay is allowed but due to a change in audio tracks, for example, it gets paused.

This patch also moves some common logic into setPlaybackWithoutUserGesture without changing behavior.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setReadyState):
(WebCore::HTMLMediaElement::play):
(WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack):
(WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
(WebCore::HTMLMediaElement::setPlaybackWithoutUserGesture):
(WebCore::HTMLMediaElement::updateShouldPlay):

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/autoplay-muted-with-controls.html: Added test.
* TestWebKitAPI/Tests/WebKit2Cocoa/WebsitePolicies.mm:
(TEST):

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

2 years ago[MediaStream] Set correct audio session category when capturing audio
eric.carlson@apple.com [Tue, 11 Apr 2017 18:27:01 +0000 (18:27 +0000)]
[MediaStream] Set correct audio session category when capturing audio
https://bugs.webkit.org/show_bug.cgi?id=170736
<rdar://problem/31559405>

Reviewed by Jer Noble.

Source/WebCore:

No new tests yet, filed bug 170737.

* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::MediaStream): Initialize m_mediaSession.
(WebCore::MediaStream::statusDidChange): Call canProduceAudioChanged.
(WebCore::MediaStream::mediaType): New. Return MediaStreamCapturingAudio when actively
capturing audio.
(WebCore::MediaStream::presentationType):
(WebCore::MediaStream::characteristics):
(WebCore::MediaStream::mayResumePlayback):
(WebCore::MediaStream::suspendPlayback):
(WebCore::MediaStream::sourceApplicationIdentifier):
(WebCore::MediaStream::canProduceAudio):
* Modules/mediastream/MediaStream.h:

* platform/audio/PlatformMediaSession.h: Add MediaStreamCapturingAudio.
* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::has): Adjust assert for MediaStreamCapturingAudio.
(WebCore::PlatformMediaSessionManager::count): Ditto.
* platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
(PlatformMediaSessionManager::updateSessionState): Set small preferred buffer size when
capturing audio. Set audio session category to PlayAndRecord whenever there is a media
stream that is capturing audio.

Source/WebKit2:

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

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

2 years ago[WebCore][JSC] ResourceUsageData.{timeOfNextEdenCollection,timeOfNextFullCollection...
utatane.tea@gmail.com [Tue, 11 Apr 2017 18:25:42 +0000 (18:25 +0000)]
[WebCore][JSC] ResourceUsageData.{timeOfNextEdenCollection,timeOfNextFullCollection} should be MonotonicTime
https://bugs.webkit.org/show_bug.cgi?id=170725

Reviewed by Sam Weinig.

Source/JavaScriptCore:

This patch makes GCActivityCallback return MonotonicTime instead of raw double value.

* heap/GCActivityCallback.cpp:
(JSC::GCActivityCallback::nextFireTime):
* heap/GCActivityCallback.h:

Source/WebCore:

Use MonotonicTime instead of raw doubles.
Currently, large part of data structures and helper functions are the same in
ResourceUsageOverlayCocoa.mm and ResourceUsageOverlayLinux.cpp. This should be
unified in a separate patch.

* page/ResourceUsageData.h:
* page/cocoa/ResourceUsageOverlayCocoa.mm:
(WebCore::gcTimerString):
(WebCore::ResourceUsageOverlay::platformDraw):
* page/linux/ResourceUsageOverlayLinux.cpp:
(WebCore::gcTimerString):

Source/WTF:

Make MonotonicTime more constexpr friendly mainly to annotate MonotonicTime::nan() as constexpr.

* wtf/MonotonicTime.h:
(WTF::MonotonicTime::MonotonicTime):
(WTF::MonotonicTime::fromRawSeconds):
(WTF::MonotonicTime::infinity):
(WTF::MonotonicTime::nan):
(WTF::MonotonicTime::secondsSinceEpoch):
(WTF::MonotonicTime::operator bool):
(WTF::MonotonicTime::operator+):
(WTF::MonotonicTime::operator-):
(WTF::MonotonicTime::operator==):
(WTF::MonotonicTime::operator!=):
(WTF::MonotonicTime::operator<):
(WTF::MonotonicTime::operator>):
(WTF::MonotonicTime::operator<=):
(WTF::MonotonicTime::operator>=):

Tools:

* TestWebKitAPI/Tests/WTF/Time.cpp:
(TestWebKitAPI::TEST):

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

2 years ago[iOS] Simple HTML documents should allow non-markup JavaScript
mitz@apple.com [Tue, 11 Apr 2017 17:34:01 +0000 (17:34 +0000)]
[iOS] Simple HTML documents should allow non-markup JavaScript
https://bugs.webkit.org/show_bug.cgi?id=170734

Reviewed by Sam Weinig.

* WebView/WebView.mm:
(-[WebView initSimpleHTMLDocumentWithStyle:frame:preferences:groupName:]): Enabled scripting
  but disabled scripting markup.

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

2 years agoActivate WebRTC data channel tests for WK1
commit-queue@webkit.org [Tue, 11 Apr 2017 17:27:10 +0000 (17:27 +0000)]
Activate WebRTC data channel tests for WK1
https://bugs.webkit.org/show_bug.cgi?id=170710

Patch by Youenn Fablet <youenn@apple.com> on 2017-04-11
Reviewed by Eric Carlson.

Source/WebCore:

Covered by existing and activated tests.

Making LibWebRTCProvider::factory not static.
For that purpose LibWebRTCMediaEndpoint now stores its peer connection factory reference.
Making LibWebRTCProvider use libebrtc networking by default.

Removing some no longer needed checks related to libwebrtc availability.

* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
(WebCore::LibWebRTCMediaEndpoint::addTrack):
(WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
(WebCore::LibWebRTCMediaEndpoint::doCreateAnswer):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
(WebCore::LibWebRTCProvider::factory):
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:

Source/WebKit2:

* WebProcess/Network/webrtc/LibWebRTCProvider.h: Making sure networking is not done in the Web process.

LayoutTests:

* platform/mac-wk1/TestExpectations:

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