WebKit-https.git
2 years ago[iOS] Switching cameras in a WebRTC call makes black frames being sent
commit-queue@webkit.org [Fri, 16 Jun 2017 23:16:38 +0000 (23:16 +0000)]
[iOS] Switching cameras in a WebRTC call makes black frames being sent
https://bugs.webkit.org/show_bug.cgi?id=173486

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

Source/WebCore:

Test: webrtc/video-replace-muted-track.html

* platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
(WebCore::RealtimeOutgoingVideoSource::updateBlackFramesSending):
Ensuring the timer is stopped if needed.
(WebCore::RealtimeOutgoingVideoSource::initializeFromSource):
Calling updateBlackFramesSending to stop sending frame if needed.

LayoutTests:

* webrtc/video-replace-muted-track-expected.txt: Added.
* webrtc/video-replace-muted-track.html: Added.

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

2 years agoRemove a test that was accidentally checked in with r218408.
ryanhaddad@apple.com [Fri, 16 Jun 2017 23:15:53 +0000 (23:15 +0000)]
Remove a test that was accidentally checked in with r218408.

Unreviewed test gardening.

* webrtc/datachannel/test.html: Removed.

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

2 years agoMarked imported/w3c/web-platform-tests/IndexedDB/large-nested-cloning.html as flaky.
jlewis3@apple.com [Fri, 16 Jun 2017 23:13:27 +0000 (23:13 +0000)]
Marked imported/w3c/web-platform-tests/IndexedDB/large-nested-cloning.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=173487

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

2 years agoRemove replaceTrack restriction about video resolution
commit-queue@webkit.org [Fri, 16 Jun 2017 23:10:37 +0000 (23:10 +0000)]
Remove replaceTrack restriction about video resolution
https://bugs.webkit.org/show_bug.cgi?id=173490

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

Source/WebCore:

Covered by updated tests.

* platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
(WebCore::RealtimeOutgoingVideoSource::setSource):

LayoutTests:

* webrtc/video-replace-track-expected.txt:
* webrtc/video-replace-track.html:

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

2 years agoHandle timeout of prepareForPictureInPictureStopWithCompletionHandler.
commit-queue@webkit.org [Fri, 16 Jun 2017 22:56:44 +0000 (22:56 +0000)]
Handle timeout of prepareForPictureInPictureStopWithCompletionHandler.
https://bugs.webkit.org/show_bug.cgi?id=173462
rdar://problem/32128170

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

No new tests because no effect on the DOM.

If WebVideoFullscreenInterfaceAVKit::prepareForPictureInPictureStopWithCompletionHandler doesn't respond fast enough,
the caller will timeout and call will/didStopPictureInPicture.

This is getting fullscreen state confused.

This change keeps state consistent by handling will/didStopPictureInPicture possibly being called before
prepareForPictureInPictureStopWithCompletionHandler calls its callback.

* platform/ios/WebVideoFullscreenInterfaceAVKit.h:
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(WebVideoFullscreenInterfaceAVKit::willStopPictureInPicture):
(WebVideoFullscreenInterfaceAVKit::didStopPictureInPicture):
(WebVideoFullscreenInterfaceAVKit::prepareForPictureInPictureStopWithCompletionHandler):
(WebVideoFullscreenInterfaceAVKit::watchdogTimerFired):

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

2 years agoMake builds faster after r218371
mmaxfield@apple.com [Fri, 16 Jun 2017 22:46:21 +0000 (22:46 +0000)]
Make builds faster after r218371
https://bugs.webkit.org/show_bug.cgi?id=173453

Reviewed by Tim Horton.

Remove #includes from .h files.

No new tests because there is no behavior change.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj: Add new .cpp file, and sort the project file
* platform/graphics/FontFamilySpecificationNull.cpp: Copied from Source/WebCore/platform/graphics/FontFamilySpecificationNull.h.
(WebCore::FontFamilySpecificationNull::fontRanges):
* platform/graphics/FontFamilySpecificationNull.h:
(WebCore::FontFamilySpecificationNull::fontRanges): Deleted.
* platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
(WebCore::FontFamilySpecificationCoreText::FontFamilySpecificationCoreText):
(WebCore::FontFamilySpecificationCoreText::~FontFamilySpecificationCoreText):
* platform/graphics/cocoa/FontFamilySpecificationCoreText.h:
(WebCore::FontFamilySpecificationCoreText::FontFamilySpecificationCoreText): Deleted.

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

2 years agoMarked multiple imported/w3c/web-platform-tests/IndexedDB as flaky.
jlewis3@apple.com [Fri, 16 Jun 2017 22:35:07 +0000 (22:35 +0000)]
Marked multiple imported/w3c/web-platform-tests/IndexedDB as flaky.
https://bugs.webkit.org/show_bug.cgi?id=172834

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

2 years ago[WK2] Add WKProcessPool SPI to efficiently reset all plugin load client policies
cdumez@apple.com [Fri, 16 Jun 2017 22:32:34 +0000 (22:32 +0000)]
[WK2] Add WKProcessPool SPI to efficiently reset all plugin load client policies
https://bugs.webkit.org/show_bug.cgi?id=173472
<rdar://problem/28858817>

Reviewed by Brady Eidson.

Source/WebCore:

Add PluginLoadClientPolicyMaximum value to PluginLoadClientPolicy enumeration
to facilitate input value validation on API side.

* plugins/PluginData.h:

Source/WebKit2:

Add WKProcessPool SPI to efficiently reset all plugin load client policies:
[WKProcessPool _resetPluginLoadClientPolicies]. This new SPI clears all
existing policies and then sets all of them with new values, with a
minimal amount of IPC.

To achieve this, clients would previously have to call
1. WKContextClearPluginClientPolicies() which would cause a broadcast IPC to
   every WebContent process.
2. WKContextSetPluginLoadClientPolicy() repeatedly to add each policy one by
   one. Each call to WKContextSetPluginLoadClientPolicy() would cause a broadcast
   IPC to every WebContent process.

The new SPI does the same job with a single broadcast IPC to every WebContent
process.

* UIProcess/API/Cocoa/WKProcessPool.mm:
(isPluginLoadClientPolicyAcceptable):
(toPluginLoadClientPoliciesHashMap):
(policiesHashMapToDictionary):
(-[WKProcessPool _resetPluginLoadClientPolicies:]):
(-[WKProcessPool _pluginLoadClientPolicies]):
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::setPluginLoadClientPolicy):
(WebKit::WebProcessPool::resetPluginLoadClientPolicies):
* UIProcess/WebProcessPool.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
(WebKit::WebProcess::resetPluginLoadClientPolicies):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

Tools:

Add API test coverage.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/PluginLoadClientPolicies.mm: Added.
(TEST):

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

2 years ago[WK2][macOS] Expand sandbox to better support video playback on mac mini
bfulgham@apple.com [Fri, 16 Jun 2017 22:28:57 +0000 (22:28 +0000)]
[WK2][macOS] Expand sandbox to better support video playback on mac mini
https://bugs.webkit.org/show_bug.cgi?id=173492
<rdar://problem/32804073>

Reviewed by Alex Christensen.

Hardware differences in Mac Mini's require some different IOKit preferences to be accessible.

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

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

2 years ago[iOS] Do not pause playing video when application resigns active state.
jer.noble@apple.com [Fri, 16 Jun 2017 21:59:23 +0000 (21:59 +0000)]
[iOS] Do not pause playing video when application resigns active state.
https://bugs.webkit.org/show_bug.cgi?id=173474

Reviewed by Tim Horton.

Source/WebCore:

Test: media/video-inactive-playback.html

Separate out the concept of "inactive" playback from "process background" playback.
Move the implementation of applicationDidEnterBackground() from MediaSessionManagerIOS
into it's superclass, PlatformMediaSessionManager, and add a new set of restrictions
for "InactiveProcessPlaybackRestricted" and "SuspendedUnderLockPlaybackRestricted".
Leave the default restriction set for iOS as "BackgroundProcessPlaybackRestricted" and
"SuspendedUnderLockPlaybackRestricted", to preserve the existing behavior of suspending
playback when switching apps or when locking the device.

* platform/audio/PlatformMediaSession.cpp:
(WebCore::interruptionName):
* platform/audio/PlatformMediaSession.h:
* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::applicationWillBecomeInactive):
(WebCore::PlatformMediaSessionManager::applicationDidBecomeActive):
(WebCore::PlatformMediaSessionManager::applicationDidEnterBackground):
(WebCore::PlatformMediaSessionManager::applicationWillEnterForeground):
(WebCore::PlatformMediaSessionManager::applicationWillEnterBackground): Deleted.
(WebCore::PlatformMediaSessionManager::applicationDidEnterForeground): Deleted.
* platform/audio/PlatformMediaSessionManager.h:
* platform/audio/ios/MediaSessionManagerIOS.h:
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::resetRestrictions):
(-[WebMediaSessionHelper applicationDidBecomeActive:]):
(-[WebMediaSessionHelper applicationWillResignActive:]):
(WebCore::MediaSessionManageriOS::applicationDidEnterBackground): Deleted.
(WebCore::MediaSessionManageriOS::applicationWillEnterForeground): Deleted.
* testing/Internals.cpp:
(WebCore::Internals::applicationWillBecomeInactive):
(WebCore::Internals::applicationDidBecomeActive):
(WebCore::Internals::applicationWillEnterForeground):
(WebCore::Internals::applicationDidEnterBackground):
(WebCore::Internals::setMediaSessionRestrictions):
(WebCore::Internals::applicationDidEnterForeground): Deleted.
(WebCore::Internals::applicationWillEnterBackground): Deleted.
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* media/video-background-playback-expected.txt:
* media/video-background-playback.html:
* media/video-background-tab-playback-expected.txt:
* media/video-background-tab-playback.html:
* media/video-inactive-playback-expected.txt: Added.
* media/video-inactive-playback.html: Added.

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

2 years agoREGRESSION (r213126): Sync XHR needs partition for cache and credentials
achristensen@apple.com [Fri, 16 Jun 2017 21:43:00 +0000 (21:43 +0000)]
REGRESSION (r213126): Sync XHR needs partition for cache and credentials
https://bugs.webkit.org/show_bug.cgi?id=173496
<rdar://problem/31943596>

Reviewed by Darin Adler.

Source/WebCore:

Test: http/tests/security/sync-xhr-partition.html

* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::createRequest):

LayoutTests:

* http/tests/security/sync-xhr-partition-expected.txt: Added.
* http/tests/security/sync-xhr-partition.html: Added.

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

2 years ago[JSC] Add fast path for Object.assign
utatane.tea@gmail.com [Fri, 16 Jun 2017 21:32:52 +0000 (21:32 +0000)]
[JSC] Add fast path for Object.assign
https://bugs.webkit.org/show_bug.cgi?id=173416

Reviewed by Mark Lam.

JSTests:

* stress/object-assign-changing-properties.js: Added.
(shouldBe):
(throw.new.Error.let.source.get x):
(throw.new.Error):
(shouldBe.let.source.get x):
(shouldBe.let.target.set x):
(shouldBe.let.target.get x):
* stress/object-assign-proxy.js: Added.
(shouldBe):
(throw.new.Error.let.handler.get order):

Source/JavaScriptCore:

In Object.assign implementation, we need to ensure that given key is still enumerable own key.
This seems duplicate look up. And we want to avoid this. However, we still need to perform this
check in the face of Proxy. Proxy can observe that this check is done correctly.

In almost all the cases, the above check is duplicate to the subsequent [[Get]] operation.
In this patch, we perform this check. But at that time, we investigate `isTaintedByOpaqueObject()`.
If it is false, we can say that getOwnPropertySlot is pure. In that case, we can just retrieve the
value by calling `slot.getValue()`.

This further improves performance of Object.assign.

                                baseline                  patched

    object-assign.es6      363.6706+-6.4381     ^    324.1769+-6.9624        ^ definitely 1.1218x faster

* runtime/ObjectConstructor.cpp:
(JSC::objectConstructorAssign):

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

2 years agoIntermittent crash running Internal/Tests/InternalJSTests/Regress/radar-24300617.js
msaboff@apple.com [Fri, 16 Jun 2017 21:12:15 +0000 (21:12 +0000)]
Intermittent crash running Internal/Tests/InternalJSTests/Regress/radar-24300617.js
https://bugs.webkit.org/show_bug.cgi?id=173488

Reviewed by Filip Pizlo.

ClonedArguments lazily sets its callee and interator properties and it used its own inline
code to initialize its butterfly.  This means that these lazily set properties can have
bogus values in those slots.  Instead, let's use the standard BUtterfly:tryCreate() method
to create the butterfly as it clears out of line properties.

* runtime/ClonedArguments.cpp:
(JSC::ClonedArguments::createEmpty):

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

2 years agoMarked imported/w3c/web-platform-tests/fetch/nosniff/importscripts.html as flaky.
jlewis3@apple.com [Fri, 16 Jun 2017 21:08:53 +0000 (21:08 +0000)]
Marked imported/w3c/web-platform-tests/fetch/nosniff/importscripts.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=173432

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

2 years agoInterpreter methods for mapping between Opcode and OpcodeID need not be instance...
mark.lam@apple.com [Fri, 16 Jun 2017 21:02:37 +0000 (21:02 +0000)]
Interpreter methods for mapping between Opcode and OpcodeID need not be instance methods.
https://bugs.webkit.org/show_bug.cgi?id=173491

Reviewed by Keith Miller.

The implementation are based on static data. There's no need to get the
interpreter instance. Hence, we can make these methods static and avoid doing
unnecessary work to compute the interpreter this pointer.

Also removed the unused isCallBytecode method.

* bytecode/BytecodeBasicBlock.cpp:
(JSC::BytecodeBasicBlock::computeImpl):
* bytecode/BytecodeDumper.cpp:
(JSC::BytecodeDumper<Block>::printGetByIdOp):
(JSC::BytecodeDumper<Block>::printGetByIdCacheStatus):
(JSC::BytecodeDumper<Block>::dumpBytecode):
(JSC::BytecodeDumper<Block>::dumpBlock):
* bytecode/BytecodeLivenessAnalysis.cpp:
(JSC::BytecodeLivenessAnalysis::dumpResults):
* bytecode/BytecodeLivenessAnalysisInlines.h:
(JSC::BytecodeLivenessPropagation<DerivedAnalysis>::stepOverInstruction):
* bytecode/BytecodeRewriter.cpp:
(JSC::BytecodeRewriter::adjustJumpTargetsInFragment):
* bytecode/CallLinkStatus.cpp:
(JSC::CallLinkStatus::computeFromLLInt):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::finishCreation):
(JSC::CodeBlock::propagateTransitions):
(JSC::CodeBlock::finalizeLLIntInlineCaches):
(JSC::CodeBlock::hasOpDebugForLineAndColumn):
(JSC::CodeBlock::usesOpcode):
(JSC::CodeBlock::valueProfileForBytecodeOffset):
(JSC::CodeBlock::arithProfileForPC):
(JSC::CodeBlock::insertBasicBlockBoundariesForControlFlowProfiler):
* bytecode/PreciseJumpTargets.cpp:
(JSC::getJumpTargetsForBytecodeOffset):
(JSC::computePreciseJumpTargetsInternal):
(JSC::findJumpTargetsForBytecodeOffset):
* bytecode/PreciseJumpTargetsInlines.h:
(JSC::extractStoredJumpTargetsForBytecodeOffset):
* bytecode/UnlinkedCodeBlock.cpp:
(JSC::UnlinkedCodeBlock::applyModification):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit):
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGCapabilities.cpp:
(JSC::DFG::capabilityLevel):
* interpreter/Interpreter.cpp:
(JSC::Interpreter::Interpreter):
(JSC::Interpreter::isOpcode):
(): Deleted.
* interpreter/Interpreter.h:
(JSC::Interpreter::getOpcode): Deleted.
(JSC::Interpreter::getOpcodeID): Deleted.
(JSC::Interpreter::isCallBytecode): Deleted.
* interpreter/InterpreterInlines.h:
(JSC::Interpreter::getOpcode):
(JSC::Interpreter::getOpcodeID):
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
(JSC::JIT::privateCompileSlowCases):
* jit/JITOpcodes.cpp:
(JSC::JIT::emitNewFuncCommon):
(JSC::JIT::emitNewFuncExprCommon):
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emitSlow_op_put_by_val):
(JSC::JIT::privateCompilePutByVal):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emitSlow_op_put_by_val):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::llint_trace_operand):
(JSC::LLInt::llint_trace_value):
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* profiler/ProfilerBytecodeSequence.cpp:
(JSC::Profiler::BytecodeSequence::BytecodeSequence):

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

2 years agoUnreviewed, rolling out r218402 and r218404.
commit-queue@webkit.org [Fri, 16 Jun 2017 20:48:10 +0000 (20:48 +0000)]
Unreviewed, rolling out r218402 and r218404.
https://bugs.webkit.org/show_bug.cgi?id=173494

Seems to have mysteriously broken the build in bizarre ways
(Requested by thorton on #webkit).

Reverted changesets:

"Include a few widespread WTF headers in WebCorePrefix.h"
https://bugs.webkit.org/show_bug.cgi?id=173481
http://trac.webkit.org/changeset/218402

"Fix the Windows build after r218402"
http://trac.webkit.org/changeset/218404

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

2 years agoAdjusted test expectations for media/track/track-in-band-cues-added-once.html.
jlewis3@apple.com [Fri, 16 Jun 2017 20:41:04 +0000 (20:41 +0000)]
Adjusted test expectations for media/track/track-in-band-cues-added-once.html.
https://bugs.webkit.org/show_bug.cgi?id=142152

Unreviewed test gardening.

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

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

2 years agoREGRESSION (r218015) IconLoaders for already-cached resources expect to be asynchrono...
beidson@apple.com [Fri, 16 Jun 2017 20:34:47 +0000 (20:34 +0000)]
REGRESSION (r218015) IconLoaders for already-cached resources expect to be asynchronous, no longer are.
<rdar://problem/32817519> and https://bugs.webkit.org/show_bug.cgi?id=173478

Reviewed by Daniel Bates.

Source/WebCore:

Covered by API test.

Being synchronous is actually better as it's resolved another issue or two.
But only if we can actually deliver the data without crashing first.
So let's do that.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::didGetLoadDecisionForIcon): Put the IconLoader in the set of active icon loaders
  before actually starting the icon loading.

Tools:

* TestWebKitAPI/Tests/WebKit2Cocoa/IconLoadingDelegate.mm:

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

2 years agoMake some WebRTC tests easier to debug when failing
commit-queue@webkit.org [Fri, 16 Jun 2017 20:24:09 +0000 (20:24 +0000)]
Make some WebRTC tests easier to debug when failing
https://bugs.webkit.org/show_bug.cgi?id=173480

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

* webrtc/captureCanvas-webrtc-expected.txt:
* webrtc/captureCanvas-webrtc.html: Splitting test in smaller tests.
* webrtc/datachannel/basic-expected.txt:
* webrtc/datachannel/basic-tcp-expected.txt: Added.
* webrtc/datachannel/basic-tcp.html: Test from basic.html
* webrtc/datachannel/basic.html: Moving TCP specifict test and other creation tests to their own files.
* webrtc/datachannel/bufferedAmountLowThreshold.html: Removing console log message in case of unhandled promise.
* webrtc/datachannel/creation-expected.txt:
* webrtc/datachannel/creation.html: Test from basic.html
* webrtc/datachannel/filter-ice-candidate-expected.txt:
* webrtc/datachannel/filter-ice-candidate.html: Exchanging the tests.
* webrtc/video-stats.html: Improving test that timestamp is milliseconds and not microseconds.

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

2 years agoDon't use WebCore Timer from code that runs in the UI process.
commit-queue@webkit.org [Fri, 16 Jun 2017 20:22:36 +0000 (20:22 +0000)]
Don't use WebCore Timer from code that runs in the UI process.
https://bugs.webkit.org/show_bug.cgi?id=173460
rdar://problem/32750731

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

If a WebCore Timer is fired from the WebKit2 UI process, it will
create a web thread, which can cause a crash in this instance.

It was also causing the timer to be called back on the wrong thread.

* platform/ios/WebVideoFullscreenInterfaceAVKit.h:
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(WebVideoFullscreenInterfaceAVKit::WebVideoFullscreenInterfaceAVKit):

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

2 years agoDRT fails to reset page visibility between tests
cdumez@apple.com [Fri, 16 Jun 2017 20:09:24 +0000 (20:09 +0000)]
DRT fails to reset page visibility between tests
https://bugs.webkit.org/show_bug.cgi?id=173485

Reviewed by Alexey Proskuryakov.

DRT fails to reset page visibility between tests and relies on tests calling testRunner.resetPageVisibility().
Fix this to address flakiness.

I confirmed this by commenting out the call to testRunner.resetPageVisibility() in
fast/events/page-visibility-onvisibilitychange.html and running the test in a loop.
The test became flaky without the DRT change and was no longer flaky with the DRT
change.

WebKitTestRunner already does this.

* DumpRenderTree/mac/DumpRenderTree.mm:
(resetWebViewToConsistentStateBeforeTesting):

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

2 years ago[WK2][iOS][macOS] Extend the sandbox to allow reading of AVFoundation's VideoPerforma...
bfulgham@apple.com [Fri, 16 Jun 2017 19:55:41 +0000 (19:55 +0000)]
[WK2][iOS][macOS] Extend the sandbox to allow reading of AVFoundation's VideoPerformanceHUD preference
https://bugs.webkit.org/show_bug.cgi?id=173476
<rdar://problem/31594568>

Reviewed by Alex Christensen.

Update the sandbox to permit WebContent process to read the AVFoundation preferences for the performance HUD.

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

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

2 years agoFix the Windows build after r218402
timothy_horton@apple.com [Fri, 16 Jun 2017 19:51:40 +0000 (19:51 +0000)]
Fix the Windows build after r218402

* WebCorePrefix.h:
I typed #import instead of #include on auto-pilot, and ... it mostly worked!
Except Windows.

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

2 years agoHide inline captions in fullscreen. Remove fullscreen captions when no longer needed.
commit-queue@webkit.org [Fri, 16 Jun 2017 19:48:32 +0000 (19:48 +0000)]
Hide inline captions in fullscreen. Remove fullscreen captions when no longer needed.
https://bugs.webkit.org/show_bug.cgi?id=173482

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

Hide the inline captions while they are presenting to fullscreen.
Remove the text track representation as soon as it is no longer needed.
This allows the text track to render properly when returning to inline.

* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTextTrackContainerElement::updateTextTrackRepresentation):

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

2 years agoInclude a few widespread WTF headers in WebCorePrefix.h
timothy_horton@apple.com [Fri, 16 Jun 2017 19:44:42 +0000 (19:44 +0000)]
Include a few widespread WTF headers in WebCorePrefix.h
https://bugs.webkit.org/show_bug.cgi?id=173481

Reviewed by Alex Christensen.

* WebCorePrefix.h:
These are four of the headers that contribute the most pre-processed
source to the WebCore build. They (and their dependents) change infrequently
enough that a world rebuild of WebCore when they change seems like an
acceptable tradeoff for the ~9% reduction in WebCore build time that I
measure from this change.

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

2 years agoImplement basic authentication in MiniBrowser
achristensen@apple.com [Fri, 16 Jun 2017 19:20:01 +0000 (19:20 +0000)]
Implement basic authentication in MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=173443

Reviewed by Tim Horton.

* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController webView:didReceiveAuthenticationChallenge:completionHandler:]):

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

2 years agoREGRESSION: AirPlay placard is not shown when in fullscreen
commit-queue@webkit.org [Fri, 16 Jun 2017 18:55:03 +0000 (18:55 +0000)]
REGRESSION: AirPlay placard is not shown when in fullscreen
https://bugs.webkit.org/show_bug.cgi?id=173447
<rdar://problem/32803773>

Patch by Antoine Quint <graouts@apple.com> on 2017-06-16
Reviewed by Jon Lee.

Source/WebCore:

We only allowed a placard to be set on inline controls, but that was an oversight: placards
should be displayed in fullscreen as well. As such, we move the "placard" property up from
InlineMediaControls to MediaControls, and update the layout() logic in MacOSFullscreenMediaControls
to display a placard.

Test: media/modern-media-controls/placard-support/placard-support-airplay-fullscreen.html

* Modules/modern-media-controls/controls/inline-media-controls.js:
(InlineMediaControls):
(InlineMediaControls.prototype.layout):
(InlineMediaControls.prototype.get placard): Deleted.
(InlineMediaControls.prototype.set placard): Deleted.
* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
(MacOSFullscreenMediaControls.prototype.layout):
* Modules/modern-media-controls/controls/media-controls.js:
(MediaControls.prototype.get placard):
(MediaControls.prototype.set placard):
(MediaControls.prototype.placardPreventsControlsBarDisplay):
(MediaControls.prototype.layout):
* Modules/modern-media-controls/media/placard-support.js:
(PlacardSupport.prototype._updatePlacard):
(PlacardSupport):

LayoutTests:

Add a new test to check that we display the AirPlay placard on macOS in fullscreen.

* media/modern-media-controls/placard-support/placard-support-airplay-fullscreen-expected.txt: Added.
* media/modern-media-controls/placard-support/placard-support-airplay-fullscreen.html: Added.
* platform/ios-simulator/TestExpectations:

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

2 years ago[WebRTC] Removing a MediaStreamTrack from a MediaStream reports no recording to WebKi...
jer.noble@apple.com [Fri, 16 Jun 2017 18:46:29 +0000 (18:46 +0000)]
[WebRTC] Removing a MediaStreamTrack from a MediaStream reports no recording to WebKit clients
https://bugs.webkit.org/show_bug.cgi?id=173398
<rdar://problem/32592961>

Reviewed by Eric Carlson.

Source/WebCore:

API Test: Tests/WebKit2/MediaStreamTrackDetached.mm

Move the definition of a MediaStream as a MediaProducer from the stream itself to its constituent
MediaStreamTracks. This ensures that, even if a MediaStreamTrack is removed from its stream, the
document (and thus the clients) are notified that media capture is still occurring.

Though MediaStream is no longer a MediaProducer, it still uses the MediaProducer's state concept
to determine when to fire events. However it's mediaState() implementation will be moved into
MediaStreamTrack, and will instead simply bitwise-or together each of it's track's mediaState().

The MediaStream notifies the document that its state has changed asynchronously, so do the same
for MediaStreamTrack (which reduces the number of calls to the client when changes all occur
during a single run loop).

Because the MediaStreamTrackPrivate may be started externally (not by the MediaStreamTrack directly),
add a new client method that notifies observers when the track has been started, and the
MediaStreamTrack will use this notification to update the document with it's new mediaState().

* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::MediaStream):
(WebCore::MediaStream::~MediaStream):
(WebCore::MediaStream::mediaState):
(WebCore::MediaStream::statusDidChange):
(WebCore::MediaStream::characteristicsChanged):
(WebCore::MediaStream::pageMutedStateDidChange): Deleted.
* Modules/mediastream/MediaStream.h:
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::MediaStreamTrack):
(WebCore::MediaStreamTrack::~MediaStreamTrack):
(WebCore::MediaStreamTrack::pageMutedStateDidChange):
(WebCore::MediaStreamTrack::mediaState):
(WebCore::MediaStreamTrack::trackStarted):
(WebCore::MediaStreamTrack::configureTrackRendering):
(WebCore::MediaStreamTrack::stop):
(WebCore::MediaStreamTrack::document):
* Modules/mediastream/MediaStreamTrack.h:
(WebCore::MediaStreamTrack::source):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::trackStarted):
* platform/mediastream/MediaStreamPrivate.h:
* platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::sourceStarted):
* platform/mediastream/MediaStreamTrackPrivate.h:
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::start):
* platform/mediastream/RealtimeMediaSource.h:

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/MediaStreamTrackDetached.mm: Added.
(-[MediaStreamTrackDetachedUIDelegate _webView:requestUserMediaAuthorizationForDevices:url:mainFrameURL:decisionHandler:]):
(-[MediaStreamTrackDetachedUIDelegate _webView:checkUserMediaPermissionForURL:mainFrameURL:frameIdentifier:decisionHandler:]):
(-[MediaStreamTrackDetachedUIDelegate _webView:mediaCaptureStateDidChange:]):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit2/mediastreamtrack-detached.html: Added.

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

2 years agoBackdrop blur missing in media controls bar on Sierra
commit-queue@webkit.org [Fri, 16 Jun 2017 17:42:27 +0000 (17:42 +0000)]
Backdrop blur missing in media controls bar on Sierra
https://bugs.webkit.org/show_bug.cgi?id=173451

Patch by Antoine Quint <graouts@apple.com> on 2017-06-16
Reviewed by Simon Fraser.

Source/WebCore:

On Sierra, we need to enforce a stacking context on controls bars to guarantee that
the backdrop filters on the BackgroundTint are applied correctly.

Test: media/modern-media-controls/controls-bar/controls-bar-stacking-context.html

* Modules/modern-media-controls/controls/controls-bar.css:
(.controls-bar):

LayoutTests:

Add a new test that checks that a ControlsBar establishes a stacking context.

* media/modern-media-controls/controls-bar/controls-bar-stacking-context-expected.txt: Added.
* media/modern-media-controls/controls-bar/controls-bar-stacking-context.html: Added.
* platform/ios-simulator/TestExpectations:
* platform/mac/TestExpectations:

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

2 years agoUnreviewed, rolling out r218375.
jlewis3@apple.com [Fri, 16 Jun 2017 17:40:51 +0000 (17:40 +0000)]
Unreviewed, rolling out r218375.

The API test MediaStreamTrackDetached is still timing out
after the patch

Reverted changeset:

"[WebRTC] Removing a MediaStreamTrack from a MediaStream
reports no recording to WebKit clients"
https://bugs.webkit.org/show_bug.cgi?id=173398
http://trac.webkit.org/changeset/218375

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

2 years agoREGRESSION: Media control glyphs appear to invert colors when video is dragged
simon.fraser@apple.com [Fri, 16 Jun 2017 17:20:08 +0000 (17:20 +0000)]
REGRESSION: Media control glyphs appear to invert colors when video is dragged
https://bugs.webkit.org/show_bug.cgi?id=173455
rdar://problem/32726887

Reviewed by Tim Horton.

Masks on composited layers were not correctly painted in drag images, because RenderLayer::paintLayerContents()
failed to pass the PaintBehaviorFlattenCompositingLayers flag down through the mask drawing code, causing
RenderBox::paintMaskImages() to fall into the composited mask code path.

Fix by making a local copy of PaintBehavior, and setting the PaintBehaviorFlattenCompositingLayers and PaintBehaviorSnapshotting
bits on it as appropriate, and passing it into paintMaskForFragments() and paintChildClippingMaskForFragments(). This is similar
to code above.

Can't test drag images.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintLayerContents):
(WebCore::RenderLayer::paintMaskForFragments):
(WebCore::RenderLayer::paintChildClippingMaskForFragments):
* rendering/RenderLayer.h:

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

2 years agoUnreviewed, rolling out r218376.
jlewis3@apple.com [Fri, 16 Jun 2017 16:47:21 +0000 (16:47 +0000)]
Unreviewed, rolling out r218376.

The patch cause multiple Layout Test Crashes.

Reverted changeset:

"Web Inspector: Instrument 2D/WebGL canvas contexts in the
backend"
https://bugs.webkit.org/show_bug.cgi?id=172623
http://trac.webkit.org/changeset/218376

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

2 years ago[GTK] Layout Test fast/events/tabindex-focus-blur-all.html is flaky
commit-queue@webkit.org [Fri, 16 Jun 2017 16:34:41 +0000 (16:34 +0000)]
[GTK] Layout Test fast/events/tabindex-focus-blur-all.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=145171

Unreviewed gardening.

Recently, this test case results in flaky crash, no flaky timeout.

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-06-16

* platform/gtk/TestExpectations: Marked it Crash Pass.

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

2 years agoUse the term icon instead of favicon
commit-queue@webkit.org [Fri, 16 Jun 2017 16:12:38 +0000 (16:12 +0000)]
Use the term icon instead of favicon
https://bugs.webkit.org/show_bug.cgi?id=173400

Patch by Daniel Bates <dabates@apple.com> on 2017-06-16
Reviewed by Alex Christensen.

Source/WebCore:

* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::cachedResourceContent):
(WebCore::InspectorPageAgent::cachedResourceType):
* loader/LinkLoader.cpp:
(WebCore::createLinkPreloadResourceClient):
* loader/ResourceLoadInfo.cpp:
(WebCore::toResourceType):
* loader/SubresourceLoader.cpp:
(WebCore::logResourceLoaded):
* loader/cache/CachedRawResource.cpp:
(WebCore::CachedRawResource::CachedRawResource):
* loader/cache/CachedRawResource.h:
(isType):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::defaultPriorityForResourceType):
* loader/cache/CachedResource.h:
(WebCore::CachedResource::isMainOrMediaOrIconOrRawResource):
(WebCore::CachedResource::ignoreForRequestCount):
(WebCore::CachedResource::isMainOrMediaOrFaviconOrRawResource): Deleted.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::createResource):
(WebCore::CachedResourceLoader::requestIcon):
(WebCore::contentTypeFromResourceType):
(WebCore::CachedResourceLoader::checkInsecureContent):
(WebCore::CachedResourceLoader::allowedByContentSecurityPolicy):
(WebCore::CachedResourceLoader::determineRevalidationPolicy):
(WebCore::CachedResourceLoader::requestFavicon): Deleted.
* loader/cache/CachedResourceLoader.h:
* loader/icon/IconLoader.cpp:
(WebCore::IconLoader::startLoading):

Source/WebKit2:

* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::maximumBufferingTime):

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

2 years agoREGRESSION(r166799): LogsPageMessagesToSystemConsoleEnabled corrupts non-ASCII characters
annulen@yandex.ru [Fri, 16 Jun 2017 16:08:30 +0000 (16:08 +0000)]
REGRESSION(r166799): LogsPageMessagesToSystemConsoleEnabled corrupts non-ASCII characters
https://bugs.webkit.org/show_bug.cgi?id=173470

Reviewed by Joseph Pecoraro.

ConsoleClient::printConsoleMessageWithArguments() incorrectly uses
const char* overload of StringBuilder::append() that assummes Latin1
encoding, not UTF8.

* runtime/ConsoleClient.cpp:
(JSC::ConsoleClient::printConsoleMessageWithArguments):

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

2 years agoREGRESSION(r215188?): Test platform/gtk/fast/forms/menulist-typeahead-find.html is...
aperez@igalia.com [Fri, 16 Jun 2017 15:34:08 +0000 (15:34 +0000)]
REGRESSION(r215188?): Test platform/gtk/fast/forms/menulist-typeahead-find.html is failing
https://bugs.webkit.org/show_bug.cgi?id=171492

Unreviewed gardening.

* platform/gtk/TestExpectations: The fixes needed for the test to pass
have landed, so the test can be unskipped.

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

2 years agoUpdated Spanish translation for WebKitGTK+
mcatanzaro@igalia.com [Fri, 16 Jun 2017 14:35:05 +0000 (14:35 +0000)]
Updated Spanish translation for WebKitGTK+
https://bugs.webkit.org/show_bug.cgi?id=173465

Patch by Daniel Mustieles <daniel.mustieles@gmail.com> on 2017-06-16
Rubber-stamped by Michael Catanzaro.

* es.po:

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

2 years ago[GTK][WPE] Remove WKCookieManagerSoup
carlosgc@webkit.org [Fri, 16 Jun 2017 14:17:24 +0000 (14:17 +0000)]
[GTK][WPE] Remove WKCookieManagerSoup
https://bugs.webkit.org/show_bug.cgi?id=173467

Reviewed by Michael Catanzaro.

It's unused.

* PlatformGTK.cmake:
* PlatformWPE.cmake:
* UIProcess/API/C/soup/WKCookieManagerSoup.cpp: Removed.
* UIProcess/API/C/soup/WKCookieManagerSoup.h: Removed.

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

2 years agoWebKit does not honor closed caption stroke width.
pvollan@apple.com [Fri, 16 Jun 2017 14:16:58 +0000 (14:16 +0000)]
WebKit does not honor closed caption stroke width.
https://bugs.webkit.org/show_bug.cgi?id=173402

Reviewed by Eric Carlson.

WebKit currently has an upper limit on the stroke width returned from MACaptionAppearanceCopyFontDescriptorWithStrokeForStyle.
Since only half the stroke is visible because the stroke is drawn before the fill, double the stroke width from
MediaAccessibility to get the correct visual stroke width. Also, the stroke width returned from this function should not be
interpreted as CSS points, but as CSS pixels.

* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTextTrackContainerElement::updateTextStrokeStyle):
* page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::CaptionUserPreferencesMediaAF::captionStrokeWidthForFont):

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

2 years ago[GTK] Layout Test fast/canvas/webgl/tex-image-and-sub-image-2d-with-video.html makes...
commit-queue@webkit.org [Fri, 16 Jun 2017 11:24:20 +0000 (11:24 +0000)]
[GTK] Layout Test fast/canvas/webgl/tex-image-and-sub-image-2d-with-video.html makes the subsequent test case flaky crash.
https://bugs.webkit.org/show_bug.cgi?id=173459

Unreviewed gardening.

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-06-16

* platform/gtk/TestExpectations: Marked it Skip.

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

2 years agoUnreviewed. Remove wrong headers check from some GTK+ API files.
carlosgc@webkit.org [Fri, 16 Jun 2017 10:13:20 +0000 (10:13 +0000)]
Unreviewed. Remove wrong headers check from some GTK+ API files.

Remove the __WEBKIT_WEB_EXTENSION_H_INSIDE__ check since these are not actually shared.

* UIProcess/API/gtk/WebKitEditorState.h:
* UIProcess/API/gtk/WebKitOptionMenu.h:
* UIProcess/API/gtk/WebKitPrintCustomWidget.h:

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

2 years ago[WPE] fast/animation gardening
csaavedra@igalia.com [Fri, 16 Jun 2017 10:03:43 +0000 (10:03 +0000)]
[WPE] fast/animation gardening

Unreviewed gardening.

fast/animation tests are flaky, report and mark.
fast/animation/height-auto-transition-computed-value.html is not really failing, unmark.
storage/domstorage/sessionstorage/set-item-synchronous-keydown.html
depends on event injection in WTR that is not implemented in WPE
yet, reported and marked as failing.
* platform/wpe/TestExpectations:

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

2 years ago[Win] WebKit renders scrollbar wrong at 125% scale.
pvollan@apple.com [Fri, 16 Jun 2017 07:36:00 +0000 (07:36 +0000)]
[Win] WebKit renders scrollbar wrong at 125% scale.
https://bugs.webkit.org/show_bug.cgi?id=173363

Reviewed by Darin Adler.

Scrollbars are drawn with the GDI function DrawThemeBackground. Sometimes, the GDI clip
rectangle will be too small since we clamp a FloatRect to integer values when setting the
GDI clip rectangle.

* platform/graphics/win/GraphicsContextWin.cpp:
(WebCore::GraphicsContextPlatformPrivate::clip):

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

2 years ago[Win] Update expectations for layout tests.
pvollan@apple.com [Fri, 16 Jun 2017 06:15:39 +0000 (06:15 +0000)]
[Win] Update expectations for layout tests.
https://bugs.webkit.org/show_bug.cgi?id=172437

Unreviewed test gardening, update test expectations for failing tests.

* platform/win/TestExpectations:

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

2 years agoREGRESSION(r218325): [GTK] Runtime critical warnings running layout tests that show...
carlosgc@webkit.org [Fri, 16 Jun 2017 06:03:18 +0000 (06:03 +0000)]
REGRESSION(r218325): [GTK] Runtime critical warnings running layout tests that show a popup menu
https://bugs.webkit.org/show_bug.cgi?id=173421

Reviewed by Carlos Alberto Lopez Perez.

In r218325 I forgot to create a WebKitPopupMenu or WebPopupMenuProxyGtk depending on whether the view is a
WebKitWebView or not.

* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::createPopupMenuProxy):

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

2 years agoAdd a JSRunLoopTimer registry in VM.
mark.lam@apple.com [Fri, 16 Jun 2017 04:38:35 +0000 (04:38 +0000)]
Add a JSRunLoopTimer registry in VM.
https://bugs.webkit.org/show_bug.cgi?id=173429
<rdar://problem/31287961>

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

This way, we can be sure we've got every JSRunLoopTimer instance covered if we
need to change their run loop (e.g. when setting to the WebThread's run loop).

* heap/Heap.cpp:
(JSC::Heap::Heap):
(JSC::Heap::setRunLoop): Deleted.
* heap/Heap.h:
(JSC::Heap::runLoop): Deleted.
* runtime/JSRunLoopTimer.cpp:
(JSC::JSRunLoopTimer::JSRunLoopTimer):
(JSC::JSRunLoopTimer::setRunLoop):
(JSC::JSRunLoopTimer::~JSRunLoopTimer):
* runtime/VM.cpp:
(JSC::VM::VM):
(JSC::VM::registerRunLoopTimer):
(JSC::VM::unregisterRunLoopTimer):
(JSC::VM::setRunLoop):
* runtime/VM.h:
(JSC::VM::runLoop):

Source/WebCore:

No new tests needed because:
1. it's already covered: it was also originally discovered by our API tests while
   running on the iOS simulator. The test was intermittently failing on a debug
   build.
2. the issue is racy (it depends on a JSRunLoopTimer firing at the right time).
   Hence, it's non trivial to write a better test than the one we already have.

* bindings/js/CommonVM.cpp:
(WebCore::commonVMSlow):

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

2 years ago[iOS DnD] [WK1] Dropping links onto UIWebViews should not trigger navigation by default
wenson_hsieh@apple.com [Fri, 16 Jun 2017 04:06:04 +0000 (04:06 +0000)]
[iOS DnD] [WK1] Dropping links onto UIWebViews should not trigger navigation by default
https://bugs.webkit.org/show_bug.cgi?id=173454
<rdar://problem/31720671>

Reviewed by Tim Horton.

Adds -webView:dragDestinationActionMaskForSession: as SPI to WebUIDelegate.
If unimplemented, the default UI delegate allows all actions except for URL loading.

* DefaultDelegates/WebDefaultUIDelegate.mm:
(-[WebDefaultUIDelegate webView:dragDestinationActionMaskForSession:]):
* WebView/WebUIDelegatePrivate.h:
* WebView/WebView.mm:
(-[WebView dragDestinationActionMaskForSession:]):

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

2 years ago[Cocoa] Modernize some internal initializers to use instancetype instead of id
commit-queue@webkit.org [Fri, 16 Jun 2017 03:55:43 +0000 (03:55 +0000)]
[Cocoa] Modernize some internal initializers to use instancetype instead of id
https://bugs.webkit.org/show_bug.cgi?id=173112

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-06-15
Reviewed by Wenson Hsieh.

* API/JSContextInternal.h:
* API/JSWrapperMap.h:
* API/JSWrapperMap.mm:
(-[JSObjCClassInfo initForClass:]):
(-[JSWrapperMap initWithGlobalContextRef:]):

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

2 years agoNull deref under ViewGestureController::endSwipeGesture (navigationGestureDidEnd)
timothy_horton@apple.com [Fri, 16 Jun 2017 03:26:55 +0000 (03:26 +0000)]
Null deref under ViewGestureController::endSwipeGesture (navigationGestureDidEnd)
https://bugs.webkit.org/show_bug.cgi?id=173441
<rdar://problem/25876512>

Reviewed by Simon Fraser.

This is a speculative fix for a crash that we don't have repro steps for.

In a few places, ViewGestureController looks itself up by pageID (in cases
where we're in an asynchronous callback), and then calls some
function on it (endSwipeGesture, or something that will get there).
However, if in the meantime an API client has turned the swipe gesture
on and off, the page's ViewGestureController will be a different one
than the one that originally started this process, with fresh state,
and nullptrs in all sorts of places, ripe for dereferencing.

To fix this, instead of just looking ViewGestureController up by
pageID, also keep track of the current gestureID, process-wide (previously
the gestureID was per-ViewGestureController), and only return the
ViewGestureController if it's currently processing the same gesture
that started the asynchronous task.

* UIProcess/Cocoa/ViewGestureController.cpp:
(WebKit::ViewGestureController::controllerForGesture):
(WebKit::ViewGestureController::takeNextGestureID):
(WebKit::ViewGestureController::willBeginGesture):
(WebKit::ViewGestureController::didEndGesture):
(WebKit::ViewGestureController::gestureControllerForPage): Deleted.
* UIProcess/Cocoa/ViewGestureController.h:
Add helpers that set and reset activeGestureType and currentGestureID together.
Make gesture IDs process global, to avoid two ViewGestureControllers using the same IDs.

* UIProcess/ios/ViewGestureControllerIOS.mm:
(WebKit::ViewGestureController::beginSwipeGesture):
(WebKit::ViewGestureController::endSwipeGesture):
(WebKit::ViewGestureController::removeSwipeSnapshot):
* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::didCollectGeometryForMagnificationGesture):
(WebKit::ViewGestureController::handleMagnificationGestureEvent):
(WebKit::ViewGestureController::endMagnificationGesture):
(WebKit::ViewGestureController::beginSwipeGesture):
(WebKit::ViewGestureController::forceRepaintIfNeeded):
(WebKit::ViewGestureController::removeSwipeSnapshot):
Adopt willBeginGesture/didEndGesture and controllerForGesture.

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

2 years agoREGRESSION: AirPlay button is incorrectly highlighted in inline and fullscreen
commit-queue@webkit.org [Fri, 16 Jun 2017 03:08:33 +0000 (03:08 +0000)]
REGRESSION: AirPlay button is incorrectly highlighted in inline and fullscreen
https://bugs.webkit.org/show_bug.cgi?id=173446

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

Source/WebCore:

A button's color should be applied to its <picture> element, not the containing
<button> element.

* Modules/modern-media-controls/controls/airplay-button.css:
(button.airplay.on > picture):
(button.airplay.on): Deleted.

LayoutTests:

Update the test to explicitly check the color on the <picture>. We also make the test check
the color with a value depending on the platform, so we can use a single expectation file.

* media/modern-media-controls/airplay-button/airplay-button-on-expected.txt:
* media/modern-media-controls/airplay-button/airplay-button-on.html:
* platform/ios/media/modern-media-controls/airplay-button/airplay-button-on-expected.txt: Removed.

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

2 years agoWeb Inspector: Instrument 2D/WebGL canvas contexts in the backend
mattbaker@apple.com [Fri, 16 Jun 2017 02:55:37 +0000 (02:55 +0000)]
Web Inspector: Instrument 2D/WebGL canvas contexts in the backend
https://bugs.webkit.org/show_bug.cgi?id=172623
<rdar://problem/32415986>

Reviewed by Devin Rousso.

Source/JavaScriptCore:

This patch adds a basic Canvas protocol. It includes Canvas and related
types and events for monitoring the lifetime of canvases in the page.

* CMakeLists.txt:
* DerivedSources.make:
* inspector/protocol/Canvas.json: Added.

* inspector/scripts/codegen/generator.py:
(Generator.stylized_name_for_enum_value):
Add special handling for Canvas.ContextType protocol enumeration,
so that "canvas-2d" and "webgl" map to `Canvas2D` and `WebGL`.

Source/WebCore:

Test: inspector/canvas/create-canvas-contexts.html

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:

* dom/Document.cpp:
(WebCore::Document::getCSSCanvasElement):
Instrument creation of CSS canvases. This merely registers the canvas
element with InspectorCanvasAgent and stores the name (identifier passed
to getCSSCanvasContext) for later use. It isn't until the context is
actually created that the frontend receives a notification.

* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::getContext2d):
(WebCore::HTMLCanvasElement::getContextWebGL):
Instrument creation of 2D and WebGL canvas contexts.

* inspector/InspectorAllInOne.cpp:

* inspector/InspectorCanvasAgent.cpp: Added.
New backend agent for canvas inspection. Canvas creation and destruction
are continuously monitored by the agent, regardless of the presence of
a frontend. This is necessary since there is no way to retrieve the
rendering contexts for with a given frame once they've been created.

(WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
(WebCore::InspectorCanvasAgent::didCreateFrontendAndBackend):
(WebCore::InspectorCanvasAgent::willDestroyFrontendAndBackend):
(WebCore::InspectorCanvasAgent::discardAgent):
Unregister canvas observers to prevent dangling agent pointer.
(WebCore::InspectorCanvasAgent::enable):
Dispatch events for existing canvases, now that the frontend exists.
(WebCore::InspectorCanvasAgent::disable):
(WebCore::InspectorCanvasAgent::frameNavigated):
(WebCore::InspectorCanvasAgent::didCreateCSSCanvas):
Register the name/identifier associated with the CSS canvas, so that it
can be retrieved and associated with the rendering context later.

(WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
(WebCore::InspectorCanvasAgent::canvasDestroyed):
Removes the canvas from the agent, and queues it for notifying the
frontend during the next event loop.

(WebCore::InspectorCanvasAgent::canvasDestroyedTimerFired):
(WebCore::InspectorCanvasAgent::clearCanvasData):
(WebCore::InspectorCanvasAgent::getCanvasEntry):
(WebCore::InspectorCanvasAgent::buildObjectForCanvas):
* inspector/InspectorCanvasAgent.h: Added.

* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):

* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didCommitLoadImpl):
(WebCore::InspectorInstrumentation::didCreateCSSCanvasImpl):
(WebCore::InspectorInstrumentation::didCreateCanvasRenderingContextImpl):

* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didCreateCSSCanvas):
(WebCore::InspectorInstrumentation::didCreateCanvasRenderingContext):
These instrumentation points should not fast return when no frontend
is attached.

* inspector/InstrumentingAgents.cpp:
(WebCore::InstrumentingAgents::reset):

* inspector/InstrumentingAgents.h:
(WebCore::InstrumentingAgents::inspectorCanvasAgent):
(WebCore::InstrumentingAgents::setInspectorCanvasAgent):
Plumbing for the new agent.

Source/WebInspectorUI:

* UserInterface/Base/Main.js:
(WebInspector.loaded):

* UserInterface/Controllers/CanvasManager.js: Added.
New frontend manager for the Canvas domain.
(WebInspector.CanvasManager):
(WebInspector.CanvasManager.prototype.get canvases):
(WebInspector.CanvasManager.prototype.canvasAdded):
(WebInspector.CanvasManager.prototype.canvasRemoved):
(WebInspector.CanvasManager.prototype._mainResourceDidChange):

* UserInterface/Main.html:
New files.

* UserInterface/Models/Canvas.js: Added.
(WebInspector.Canvas):
(WebInspector.Canvas.fromPayload):
(WebInspector.Canvas.displayNameForContextType):
Get displayable text "2D" or "WebGL" based on context type.
(WebInspector.Canvas.resetUniqueDisplayNameNumbers):
Called by CanvasManager when canvases are cleared.
(WebInspector.Canvas.prototype.get identifier):
(WebInspector.Canvas.prototype.get contextType):
(WebInspector.Canvas.prototype.get frame):
(WebInspector.Canvas.prototype.get cssCanvasName):
For CSS canvases, the identifier passed to getCSSCanvasContext.
(WebInspector.Canvas.prototype.get displayName):
Get displayable canvas name. The name depends on how the canvas was
created, and the information available:
  - getCSSCanvasContext: "CSS Canvas <identifier>"
  - getContext: "Canvas #<DOM id attribute value>"
  - Otherwise: "Canvas 1", "Canvas 2", ...

(WebInspector.Canvas.saveIdentityToCookie):

* UserInterface/Protocol/CanvasObserver.js: Added.
(WebInspector.CanvasObserver.prototype.canvasAdded):
(WebInspector.CanvasObserver.prototype.canvasRemoved):
(WebInspector.CanvasObserver):

* UserInterface/Test.html:
* UserInterface/Test/Test.js:
(WebInspector.loaded):

LayoutTests:

Test that CanvasAgent dispatches events for canvas lifecycle events.

* inspector/canvas/create-canvas-contexts-expected.txt: Added.
* inspector/canvas/create-canvas-contexts.html: Added.

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

2 years ago[WebRTC] Removing a MediaStreamTrack from a MediaStream reports no recording to WebKi...
jer.noble@apple.com [Fri, 16 Jun 2017 02:49:38 +0000 (02:49 +0000)]
[WebRTC] Removing a MediaStreamTrack from a MediaStream reports no recording to WebKit clients
https://bugs.webkit.org/show_bug.cgi?id=173398
<rdar://problem/32592961>

Reviewed by Eric Carlson.

Source/WebCore:

API Test: Tests/WebKit2/MediaStreamTrackDetached.mm

Move the definition of a MediaStream as a MediaProducer from the stream itself to its constituent
MediaStreamTracks. This ensures that, even if a MediaStreamTrack is removed from its stream, the
document (and thus the clients) are notified that media capture is still occurring.

Though MediaStream is no longer a MediaProducer, it still uses the MediaProducer's state concept
to determine when to fire events. However it's mediaState() implementation will be moved into
MediaStreamTrack, and will instead simply bitwise-or together each of it's track's mediaState().

The MediaStream notifies the document that its state has changed asynchronously, so do the same
for MediaStreamTrack (which reduces the number of calls to the client when changes all occur
during a single run loop).

Because the MediaStreamTrackPrivate may be started externally (not by the MediaStreamTrack directly),
add a new client method that notifies observers when the track has been started, and the
MediaStreamTrack will use this notification to update the document with it's new mediaState().

* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::MediaStream):
(WebCore::MediaStream::~MediaStream):
(WebCore::MediaStream::mediaState):
(WebCore::MediaStream::statusDidChange):
(WebCore::MediaStream::characteristicsChanged):
(WebCore::MediaStream::pageMutedStateDidChange): Deleted.
* Modules/mediastream/MediaStream.h:
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::MediaStreamTrack):
(WebCore::MediaStreamTrack::~MediaStreamTrack):
(WebCore::MediaStreamTrack::pageMutedStateDidChange):
(WebCore::MediaStreamTrack::mediaState):
(WebCore::MediaStreamTrack::trackStarted):
(WebCore::MediaStreamTrack::configureTrackRendering):
(WebCore::MediaStreamTrack::stop):
(WebCore::MediaStreamTrack::document):
* Modules/mediastream/MediaStreamTrack.h:
(WebCore::MediaStreamTrack::source):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::trackStarted):
* platform/mediastream/MediaStreamPrivate.h:
* platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::sourceStarted):
* platform/mediastream/MediaStreamTrackPrivate.h:
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::start):
* platform/mediastream/RealtimeMediaSource.h:

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/MediaStreamTrackDetached.mm: Added.
(-[MediaStreamTrackDetachedUIDelegate _webView:requestUserMediaAuthorizationForDevices:url:mainFrameURL:decisionHandler:]):
(-[MediaStreamTrackDetachedUIDelegate _webView:checkUserMediaPermissionForURL:mainFrameURL:frameIdentifier:decisionHandler:]):
(-[MediaStreamTrackDetachedUIDelegate _webView:mediaCaptureStateDidChange:]):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit2/mediastreamtrack-detached.html: Added.

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

2 years ago[iOS WK2] YouTube videos flash at the wrong place at the end of rotation
simon.fraser@apple.com [Fri, 16 Jun 2017 01:43:27 +0000 (01:43 +0000)]
[iOS WK2] YouTube videos flash at the wrong place at the end of rotation
https://bugs.webkit.org/show_bug.cgi?id=173445
rdar://problem/31584852

Reviewed by Tim Horton.

In MobileSafari where WKWebView rotation uses _dynamicViewportUpdateModes, we could do a
visibleContentRect update at the end of rotation which computed a bad layoutViewportRect,
because it used a m_baseLayoutViewportSize from the old orientation.

We have actually sent a new m_baseLayoutViewportSize to the UI process by this point in
a layer tree commit, but _didCommitLayerTree: ignored it because we had a _dynamicViewportUpdateMode.

Fix is to always update the layout viewport data from the web process, since during dynamic
viewport updates, we still need these data to compute rectangles sent back to the web process via
visible content rect updates.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _didCommitLayerTree:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::computeCustomFixedPositionRect):
(WebKit::WebPageProxy::updateLayoutViewportParameters): Cleanup.

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

2 years agoUse WTFLogAlways for debug logging so that it shows up in device system logs
simon.fraser@apple.com [Fri, 16 Jun 2017 01:39:31 +0000 (01:39 +0000)]
Use WTFLogAlways for debug logging so that it shows up in device system logs
https://bugs.webkit.org/show_bug.cgi?id=173450

Reviewed by Tim Horton.

If you want to showRenderTree() on-device, the result doesn't show in system log so you can't see it
Switch to WTFLogAlways to fix this, for all the debug logging in WebCore.

Also WKError () -> WKError() in the old WAK code, to allow for easier searching pending cleanup.

* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::~AudioContext):
* Modules/webaudio/AudioNode.cpp:
(WebCore::AudioNode::~AudioNode):
(WebCore::AudioNode::ref):
(WebCore::AudioNode::finishDeref):
(WebCore::AudioNode::printNodeCounts):
* bridge/objc/objc_instance.mm:
(ObjcInstance::invokeObjcMethod):
* bridge/objc/objc_utility.mm:
(JSC::Bindings::convertObjcValueToValue):
* css/StyleProperties.cpp:
(WebCore::StyleProperties::showStyle):
* dom/DocumentMarkerController.cpp:
(DocumentMarkerController::showMarkers):
* dom/Node.cpp:
(WebCore::Node::showNode):
(WebCore::Node::showNodePathForThis):
(WebCore::traverseTreeAndMark):
* dom/Position.cpp:
(WebCore::Position::debugPosition):
(WebCore::Position::showAnchorTypeAndOffset):
* dom/Range.cpp:
(showTree):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::debugRenderer):
* editing/VisiblePosition.cpp:
(WebCore::VisiblePosition::debugPosition):
* editing/VisibleSelection.cpp:
(WebCore::VisibleSelection::debugPosition):
* history/HistoryItem.cpp:
(WebCore::HistoryItem::showTreeWithIndent):
* html/parser/HTMLFormattingElementList.cpp:
(WebCore::HTMLFormattingElementList::show):
* inspector/DOMPatchSupport.cpp:
(WebCore::DOMPatchSupport::dumpMap):
* page/scrolling/ScrollingStateTree.cpp:
(showScrollingStateTree):
* platform/audio/ios/AudioDestinationIOS.cpp:
(WebCore::AudioDestinationIOS::frameSizeChangedProc):
* platform/graphics/GraphicsLayer.cpp:
(showGraphicsLayerTree):
* platform/graphics/displaylists/DisplayList.cpp:
(WebCore::DisplayList::DisplayList::dump):
* platform/ios/wak/WAKView.mm:
(+[WAKView _wrapperForViewRef:]):
(-[WAKView displayRect:]):
(-[WAKView displayRectIgnoringOpacity:inContext:]):
* platform/ios/wak/WKUtilities.c:
(WKRelease):
* platform/ios/wak/WKView.mm:
(_WKViewSetViewContext):
(WKViewGetBounds):
(WKViewGetFrame):
(_WKViewRecursivelyInvalidateGState):
(WKViewSetFrameOrigin):
(WKViewSetFrameSize):
(WKViewGetWindow):
(WKViewGetSubviews):
(WKViewAddSubview):
(WKViewRemoveFromSuperview):
(WKViewFirstChild):
(WKViewNextSibling):
(WKViewTraverseNext):
(WKViewGetVisibleRect):
(WKViewConvertRectToSuperview):
(WKViewConvertRectToBase):
(WKViewConvertPointToSuperview):
(WKViewConvertPointFromSuperview):
(WKViewConvertPointToBase):
(_WKViewGetAncestorViewsIncludingView):
(WKViewConvertPointFromBase):
(WKViewConvertRectFromSuperview):
(WKViewConvertRectFromBase):
(WKViewGetAutoresizingMask):
(WKViewSetAutoresizingMask):
* platform/text/TextEncodingRegistry.cpp:
(WebCore::dumpTextEncodingNameMap):
* rendering/CounterNode.cpp:
(WebCore::showTreeAndMark):
* rendering/InlineBox.cpp:
(WebCore::InlineBox::showLineBox):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::showLineBox):
* rendering/RenderCounter.cpp:
(showCounterRendererTree):
* rendering/RenderLayer.cpp:
(WebCore::showLayerTree):
* rendering/RenderObject.cpp:
(WebCore::showRenderTreeLegend):
(WebCore::RenderObject::showRegionsInformation):
(WebCore::RenderObject::showRenderObject):
(WebCore::printRenderTreeForLiveDocuments):
(WebCore::printLayerTreeForLiveDocuments):
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::printPrefix):
(WebCore::SimpleLineLayout::showLineLayoutForFlow):
* rendering/svg/SVGResources.cpp:
(WebCore::SVGResources::dump):
* rendering/svg/SVGResourcesCycleSolver.cpp:
(WebCore::SVGResourcesCycleSolver::resolveCycles):
* rendering/svg/SVGTextLayoutAttributes.cpp:
(WebCore::dumpSVGCharacterDataMapValue):
(WebCore::SVGTextLayoutAttributes::dump):
* rendering/svg/SVGTextLayoutEngine.cpp:
(WebCore::dumpTextBoxes):
(WebCore::SVGTextLayoutEngine::finishLayout):

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

2 years agoRemoving stray whitespace after r218371
mmaxfield@apple.com [Fri, 16 Jun 2017 01:07:59 +0000 (01:07 +0000)]
Removing stray whitespace after r218371
https://bugs.webkit.org/show_bug.cgi?id=173043

Unreviewed.

No new tests because there is no behavior change.

* platform/graphics/FontCascadeFonts.cpp:
(WebCore::shouldIgnoreRotation):
(WebCore::glyphDataForNonCJKCharacterWithGlyphOrientation):
* platform/graphics/FontDescription.cpp:
* platform/graphics/FontDescription.h:
* platform/graphics/FontFamilySpecificationNull.h:
* platform/graphics/cocoa/FontDescriptionCocoa.cpp:
(WebCore::SystemFontDatabase::systemFontCascadeList):
(WebCore::systemFontParameters):
* platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
(WebCore::FontFamilySpecificationCoreText::fontRanges):
* platform/graphics/cocoa/FontFamilySpecificationCoreText.h:

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

2 years ago[Cocoa] Expand system-ui to include every item in the Core Text cascade list
mmaxfield@apple.com [Fri, 16 Jun 2017 00:56:44 +0000 (00:56 +0000)]
[Cocoa] Expand system-ui to include every item in the Core Text cascade list
https://bugs.webkit.org/show_bug.cgi?id=173043
<rdar://problem/21125708>

Reviewed by Simon Fraser.

Source/WebCore:

The concept of the system font on Cocoa platforms represents the entire Core Text cascade list.
However, previously, WebKit only represented system-ui by pulling out the first item in the Core
Text cascade list. Instead, we should make all text rendered with "system-ui" match what the
platform would natively render.

Previously, we walked through the strings in the font-family property and looked them up one by
one. However, now we want to abstract this idea of a font family to possibly hold a
CTFontDescriptorRef instead of a string. This way, we expand a font-family list of ["fontA",
"system-ui", "fontB"] to ["fontA", ... a bunch of CTFontDescriptorRefs ..., "FontB"]. We can
then modify the consumer of this object to have two codepaths: the old string-based codepath,
and a new, platform-specific codepath which simply embeds the CTFontDesriptorRefs inside a Font
object.

We don't want to simply pull out the family name from each item in the Core Text fallback list
because that is a lossy translation. There is more information in these font descriptors which
cannot be represented by CSS. Therefore, we must keep the descriptors alive and add the new
codepath for them.

We also don't want to run the CSS font matching algorithm on each member of the Core Text
fallback list because it may yield different results from Core Text's font matching algorithm.
Our goal is to draw text as closely as possible to the system APIs. If we ran it, we may find
a font which is closer to the requested traits, but it would look out of place on the system.

This new codepath is only enabled on macOS High Sierra and iOS 11, because enabling it on all
operating systems would make fixing https://bugs.webkit.org/show_bug.cgi?id=173300 impossible.

Tests: fast/text/system-font-fallback-emoji.html
       fast/text/system-font-fallback.html
       fast/text/system-font-zero-size.html

* WebCore.xcodeproj/project.pbxproj:
* page/MemoryRelease.cpp:
(WebCore::releaseNoncriticalMemory):
* platform/graphics/FontCascadeFonts.cpp:
(WebCore::realizeNextFallback): The consumer of our new data type. Now uses WTF::visit().
(WebCore::FontCascadeFonts::realizeFallbackRangesAt): Now that the number of items to test
against the current character is larger than the number of strings in the font-family list,
we need to update the existing code to use the correct value.
* platform/graphics/FontDescription.cpp: Default implementation for non-Cocoa ports.
(WebCore::FontDescription::invalidateCaches):
(WebCore::FontCascadeDescription::effectiveFamilyCount):
(WebCore::FontCascadeDescription::effectiveFamilyAt):
* platform/graphics/FontDescription.h: Our new data type is a Variant of AtomicString and a
platform-specific class. Cocoa uses a class that holds a CTFontDescriptorRef and other ports
use an empty non-constructable class.
* platform/graphics/FontFamilySpecificationNull.h: Added. The empty non-constructable
class.
(WebCore::FontFamilySpecificationNull::fontRanges):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::fontCacheRegisteredFontsChangedNotificationCallback):
(WebCore::FontCache::platformInit): Changing the system language will change the system font
fallback list, so we need to listen to this notification. This also matters for
FontCache::systemFallbackForCharacters(), so we should build off the same callback we are
already using for font installation.
(WebCore::invalidateFontCache):
* platform/graphics/cocoa/FontDescriptionCocoa.cpp: Added. The platform-specific creation of
our CTFontDescriptorRefs. We hold them cached in a SystemFontDatabase.
(WebCore::SystemFontDatabase::CoreTextCascadeListParameters::CoreTextCascadeListParameters):
(WebCore::SystemFontDatabase::CoreTextCascadeListParameters::isHashTableDeletedValue):
(WebCore::SystemFontDatabase::CoreTextCascadeListParameters::operator==):
(WebCore::SystemFontDatabase::CoreTextCascadeListParameters::hash):
(WebCore::SystemFontDatabase::singleton):
(WebCore::SystemFontDatabase::systemFontCascadeList):
(WebCore::SystemFontDatabase::clear):
(WebCore::SystemFontDatabase::SystemFontDatabase):
(WebCore::SystemFontDatabase::applyWeightAndItalics):
(WebCore::SystemFontDatabase::removeCascadeList):
(WebCore::SystemFontDatabase::computeCascadeList):
(WebCore::SystemFontDatabase::CoreTextCascadeListParametersHash::hash):
(WebCore::SystemFontDatabase::CoreTextCascadeListParametersHash::equal):
(WebCore::isSystemFontString):
(WebCore::systemFontParameters):
(WebCore::FontDescription::invalidateCaches):
(WebCore::FontCascadeDescription::effectiveFamilyCount): We don't store the result of this
because it would probably be a bad idea to increase the size of every single FontCascade just
in case it might ask for the system font. Most fonts never mention system-ui. Because it's so
rare, we can just recalculate the result of this as necessary. This shouldn't be slow because
the results are cached.
(WebCore::FontCascadeDescription::effectiveFamilyAt):
* platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp: Added.
(WebCore::FontFamilySpecificationCoreText::fontRanges): Create a FontRanges from a
CTFontDescriptorRef.
* platform/graphics/cocoa/FontFamilySpecificationCoreText.h: Added.
(WebCore::FontFamilySpecificationCoreText::FontFamilySpecificationCoreText):
* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::platformFontWithFamilySpecialCase):
* platform/graphics/mac/FontCacheMac.mm:
(WebCore::platformFontWithFamilySpecialCase):

LayoutTests:

* fast/text/system-font-fallback-emoji-expected.txt: Added.
* fast/text/system-font-fallback-emoji.html: Added.
* fast/text/system-font-fallback-expected.html: Added.
* fast/text/system-font-fallback.html: Added.
* fast/text/system-font-zero-size-expected.txt: Added.
* fast/text/system-font-zero-size.html: Added.
* platform/ios/TestExpectations:
* platform/mac/TestExpectations:
* platform/mac/fast/text/international/system-language/system-font-punctuation-expected.png: Added.

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

2 years agoRevert: [iOS] Generate a simulated crash when the WebThread starts in MobileSafari
ddkilzer@apple.com [Fri, 16 Jun 2017 00:45:13 +0000 (00:45 +0000)]
Revert: [iOS] Generate a simulated crash when the WebThread starts in MobileSafari
<https://webkit.org/b/173386>
<rdar://problem/32776426>

Revert r218347 and r218339 since we're going to take a different
approach to investigating a crash on the WebThread.

* WebCore.xcodeproj/project.pbxproj:
* platform/ios/CrashReporterSupportSoftLink.h: Remove.
* platform/ios/CrashReporterSupportSoftLink.mm: Remove.
* platform/ios/wak/WebCoreThread.mm:
(WebThreadEnable):
* platform/spi/ios/CrashReporterSupportSPI.h: Remove.

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

2 years agoUnreviewed, rolling out r218365.
jlewis3@apple.com [Fri, 16 Jun 2017 00:16:36 +0000 (00:16 +0000)]
Unreviewed, rolling out r218365.

The revision caused API timeouts on all builds.

Reverted changeset:

"[WebRTC] Removing a MediaStreamTrack from a MediaStream
reports no recording to WebKit clients"
https://bugs.webkit.org/show_bug.cgi?id=173398
http://trac.webkit.org/changeset/218365

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

2 years agoAllow use of Layout* TextStream operators in WebKit2
simon.fraser@apple.com [Thu, 15 Jun 2017 23:49:12 +0000 (23:49 +0000)]
Allow use of Layout* TextStream operators in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=173440

Reviewed by Zalan Bujtas.

Export TextStream& operator<< for LayoutPoint, LayoutSize and LayoutRect so that
WebKit2 can log them.

Use #pragma once in these geometry headers.

* platform/graphics/FloatPoint.h:
* platform/graphics/FloatRect.h:
* platform/graphics/FloatSize.h:
* platform/graphics/IntPoint.h:
* platform/graphics/IntRect.h:
* platform/graphics/IntSize.h:
* platform/graphics/LayoutPoint.h:
* platform/graphics/LayoutRect.h:
* platform/graphics/LayoutSize.h:

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

2 years agoModern media controls tests error in Button.js
commit-queue@webkit.org [Thu, 15 Jun 2017 23:34:15 +0000 (23:34 +0000)]
Modern media controls tests error in Button.js
https://bugs.webkit.org/show_bug.cgi?id=173439

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

Tests would sometime yield an error when commit() would be called and the _imageSource
ivar hadn't been set. To more safely commit the mask image when it's loaded, we now use
a markDirtyProperty() call and a commitProperty() override to ensure that we cover the
case where we want to commit the mask image, and for other commits not to have to worry
about the mask image being defined.

* Modules/modern-media-controls/controls/button.js:
(Button.prototype.commitProperty):
(Button.prototype._updateImage):
(Button.prototype.commit): Deleted.

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

2 years agoMarked webrtc/video-unmute.html as flaky.
jlewis3@apple.com [Thu, 15 Jun 2017 22:54:03 +0000 (22:54 +0000)]
Marked webrtc/video-unmute.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=172879

Unreviewed test gardening.

* platform/ios-simulator-wk2/TestExpectations:

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

2 years ago[WebRTC] Removing a MediaStreamTrack from a MediaStream reports no recording to WebKi...
jer.noble@apple.com [Thu, 15 Jun 2017 22:48:46 +0000 (22:48 +0000)]
[WebRTC] Removing a MediaStreamTrack from a MediaStream reports no recording to WebKit clients
https://bugs.webkit.org/show_bug.cgi?id=173398
<rdar://problem/32592961>

Reviewed by Eric Carlson.

Source/WebCore:

API Test: Tests/WebKit2/MediaStreamTrackDetached.mm

Move the definition of a MediaStream as a MediaProducer from the stream itself to its constituent
MediaStreamTracks. This ensures that, even if a MediaStreamTrack is removed from its stream, the
document (and thus the clients) are notified that media capture is still occurring.

Though MediaStream is no longer a MediaProducer, it still uses the MediaProducer's state concept
to determine when to fire events. However it's mediaState() implementation will be moved into
MediaStreamTrack, and will instead simply bitwise-or together each of it's track's mediaState().

The MediaStream notifies the document that its state has changed asynchronously, so do the same
for MediaStreamTrack (which reduces the number of calls to the client when changes all occur
during a single run loop).

Because the MediaStreamTrackPrivate may be started externally (not by the MediaStreamTrack directly),
add a new client method that notifies observers when the track has been started, and the
MediaStreamTrack will use this notification to update the document with it's new mediaState().

* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::MediaStream):
(WebCore::MediaStream::~MediaStream):
(WebCore::MediaStream::mediaState):
(WebCore::MediaStream::statusDidChange):
(WebCore::MediaStream::characteristicsChanged):
(WebCore::MediaStream::pageMutedStateDidChange): Deleted.
* Modules/mediastream/MediaStream.h:
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::MediaStreamTrack):
(WebCore::MediaStreamTrack::~MediaStreamTrack):
(WebCore::MediaStreamTrack::pageMutedStateDidChange):
(WebCore::MediaStreamTrack::mediaState):
(WebCore::MediaStreamTrack::trackStarted):
(WebCore::MediaStreamTrack::configureTrackRendering):
(WebCore::MediaStreamTrack::stop):
(WebCore::MediaStreamTrack::document):
* Modules/mediastream/MediaStreamTrack.h:
(WebCore::MediaStreamTrack::source):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::trackStarted):
* platform/mediastream/MediaStreamPrivate.h:
* platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::sourceStarted):
* platform/mediastream/MediaStreamTrackPrivate.h:
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::start):
* platform/mediastream/RealtimeMediaSource.h:

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/MediaStreamTrackDetached.mm: Added.
(-[MediaStreamTrackDetachedUIDelegate _webView:requestUserMediaAuthorizationForDevices:url:mainFrameURL:decisionHandler:]):
(-[MediaStreamTrackDetachedUIDelegate _webView:checkUserMediaPermissionForURL:mainFrameURL:frameIdentifier:decisionHandler:]):
(-[MediaStreamTrackDetachedUIDelegate _webView:mediaCaptureStateDidChange:]):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit2/mediastreamtrack-detached.html: Added.

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

2 years ago[iOS wk2] Layout Test perf/object-keys.html is flaky
sbarati@apple.com [Thu, 15 Jun 2017 22:26:42 +0000 (22:26 +0000)]
[iOS wk2] Layout Test perf/object-keys.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=171617
<rdar://problem/31977874>

Reviewed by Mark Lam.

Increase the starting magnitude of the object-keys test to
remove variance from having objects with a very few number of keys.

* perf/object-keys.html:
* platform/ios-wk2/TestExpectations:

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

2 years agoMarked webrtc/datachannel/basic.html as flaky.
jlewis3@apple.com [Thu, 15 Jun 2017 22:08:12 +0000 (22:08 +0000)]
Marked webrtc/datachannel/basic.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=172922

Unreviewed test gardening.

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

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

2 years agoWeb Inspector: Search highlight doesn't show up in resources when paused
commit-queue@webkit.org [Thu, 15 Jun 2017 21:50:37 +0000 (21:50 +0000)]
Web Inspector: Search highlight doesn't show up in resources when paused
https://bugs.webkit.org/show_bug.cgi?id=173438
<rdar://problem/32800114>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-06-15
Reviewed by Matt Baker.

* UserInterface/Views/TextEditor.js:
(WebInspector.TextEditor.prototype.revealPosition.revealAndHighlightLine):
Previously we were bailing if executionLineNumber was NaN, which means that when
we were paused we were incorrectly disabling highlights in any resource that does
not have the active callframe. Relax this and make it match the intended behavior
of only disabling highlights if the highlight line matches the execution line.

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

2 years ago[Win] WebKit shouldn't include the forwarding header of WebKit itself
commit-queue@webkit.org [Thu, 15 Jun 2017 21:38:49 +0000 (21:38 +0000)]
[Win] WebKit shouldn't include the forwarding header of WebKit itself
https://bugs.webkit.org/show_bug.cgi?id=173352

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

* WebKitPrefix.h: Include WebKit.h of DerivedSources/WebKit instead of DerivedSources/ForwardingHeaders.

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

2 years ago[cmake] ADD_PRECOMPILED_HEADER should append OBJECT_DEPENDS, not overwrite it
annulen@yandex.ru [Thu, 15 Jun 2017 21:35:57 +0000 (21:35 +0000)]
[cmake] ADD_PRECOMPILED_HEADER should append OBJECT_DEPENDS, not overwrite it
https://bugs.webkit.org/show_bug.cgi?id=173428

Reviewed by Michael Catanzaro.

Right now, if any of source files that are passed to
ADD_PRECOMPILED_HEADER have non-empty OBJECT_DEPENDS property (e.g.
changed with ADD_SOURCE_DEPENDENCIES call), its value is lost.

* Source/cmake/WebKitMacros.cmake:

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

2 years agoUncaught Exception: TypeError: null is not an object (evaluating 'this.contentBrowser...
commit-queue@webkit.org [Thu, 15 Jun 2017 21:26:33 +0000 (21:26 +0000)]
Uncaught Exception: TypeError: null is not an object (evaluating 'this.contentBrowser.contentViewForRepresentedObject')
https://bugs.webkit.org/show_bug.cgi?id=173425
<rdar://problem/32744172>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-06-15
Reviewed by Devin Rousso.

* UserInterface/Views/ContentBrowserTabContentView.js:
(WebInspector.ContentBrowserTabContentView.prototype.shown):
Reorder slightly so the NavigationSidebar has its ContentBrowser set
before anyone tries to restore views in the sidebar.

* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel.prototype.showDefaultContentView):
Try to select a script/resource content view instead of nothing.

(WebInspector.DebuggerSidebarPanel.prototype.saveStateToCookie):
When a resource is selected, save it using the normal path.

* UserInterface/Views/NetworkSidebarPanel.js:
(WebInspector.NetworkSidebarPanel.prototype.canShowDifferentContentView):
Remove a reference to an unused / stale member variable.

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

2 years agoREGRESSION(r218344): [WPE] Thousands of layout test crashes
clopez@igalia.com [Thu, 15 Jun 2017 21:19:08 +0000 (21:19 +0000)]
REGRESSION(r218344): [WPE] Thousands of layout test crashes
https://bugs.webkit.org/show_bug.cgi?id=173433

Unreviewed.

* wpe/jhbuild.modules: Revert the update of WPEBackend-mesa.

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

2 years agoUnreviewed build fix after r218336
jbedard@apple.com [Thu, 15 Jun 2017 20:15:23 +0000 (20:15 +0000)]
Unreviewed build fix after r218336

* platform/spi/cocoa/PassKitSPI.h: Add missing #ifdefs for Internal builds.

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

2 years agoEnsure we only log changes to the ScriptedAnimationController suspended state in...
commit-queue@webkit.org [Thu, 15 Jun 2017 20:08:07 +0000 (20:08 +0000)]
Ensure we only log changes to the ScriptedAnimationController suspended state in debug builds
https://bugs.webkit.org/show_bug.cgi?id=173423

Patch by Antoine Quint <graouts@apple.com> on 2017-06-15
Reviewed by Tim Horton.

We added logging for when the suspended state of the scripted animation controller would change in
webkit.org/b/173326. It was meant to only be enabled in debug builds and we actually did the wrong
thing and enabled it in non-debug builds.

We also added a setting that wasn't used and that we are removing here.

* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::logSuspendCount):
* page/Settings.in:
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::resetToConsistentState):
(WebCore::InternalSettings::shouldLogScritedAnimationControllerSuspensionChange): Deleted.
(WebCore::InternalSettings::setShouldLogScritedAnimationControllerSuspensionChange): Deleted.
* testing/InternalSettings.h:
* testing/InternalSettings.idl:

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

2 years agoAdd logging to MachineStackMarker to try to diagnose crashes in the wild
keith_miller@apple.com [Thu, 15 Jun 2017 20:02:22 +0000 (20:02 +0000)]
Add logging to MachineStackMarker to try to diagnose crashes in the wild
https://bugs.webkit.org/show_bug.cgi?id=173427

Reviewed by Mark Lam.

This patch adds some logging to the MachineStackMarker constructor
to help figure out where we are seeing crashes. Since macOS does
not support os_log_info my hope is that if we set all the callee
save registers before making any calls in the C++ code we can
figure out which calls is the source of the crash. We also, set
all the caller save registers before returning in case some
weirdness is happening in the Heap constructor.

This logging should not matter from a performance perspective. We
only create MachineStackMarkers when we are creating a new VM,
which is already expensive.

* heap/MachineStackMarker.cpp:
(JSC::MachineThreads::MachineThreads):

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

2 years agoFix typo in XPCSPI.h
cdumez@apple.com [Thu, 15 Jun 2017 19:49:40 +0000 (19:49 +0000)]
Fix typo in XPCSPI.h
https://bugs.webkit.org/show_bug.cgi?id=173426

Reviewed by Alex Christensen.

We should check if xpc_release is defined before defining it,
not xpc_retain.

* wtf/spi/darwin/XPCSPI.h:

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

2 years ago[JSC] Implement Object.assign in C++
utatane.tea@gmail.com [Thu, 15 Jun 2017 19:37:21 +0000 (19:37 +0000)]
[JSC] Implement Object.assign in C++
https://bugs.webkit.org/show_bug.cgi?id=173414

Reviewed by Saam Barati.

JSTests:

* stress/object-assign-string-first.js: Added.
(shouldBe):
(source.get Symbol):
(source.get 1):
(source.get cocoa):

Source/JavaScriptCore:

Implementing Object.assign in JS is not so good compared to C++ version because,

1. JS version allocates JS array for object own keys. And we allocate JSString / Symbol for each key.
But basically, they can be handled as UniquedStringImpl in C++. Allocating these cells are wasteful.

2. While implementing builtins in JS offers some good type speculation chances, Object.assign is inherently super polymorphic.
So JS's type profile doesn't help well.

3. We have a chance to introduce various fast path for Object.assign in C++.

This patch moves implementation from JS to C++. It achieves the above (1) and (2). (3) is filed in [1].

We can see 1.65x improvement in SixSpeed object-assign.es6.

                            baseline                  patched

object-assign.es6      643.3253+-8.0521     ^    389.1075+-8.8840        ^ definitely 1.6533x faster

[1]: https://bugs.webkit.org/show_bug.cgi?id=173416

* builtins/ObjectConstructor.js:
(entries):
(assign): Deleted.
* runtime/JSCJSValueInlines.h:
(JSC::JSValue::putInline):
* runtime/JSCell.h:
* runtime/JSCellInlines.h:
(JSC::JSCell::putInline):
* runtime/JSObject.cpp:
(JSC::JSObject::put):
* runtime/JSObject.h:
* runtime/JSObjectInlines.h:
(JSC::JSObject::putInlineForJSObject):
(JSC::JSObject::putInline): Deleted.
* runtime/ObjectConstructor.cpp:
(JSC::objectConstructorAssign):

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

2 years agoBuild fix: [iOS] Generate a simulated crash when the WebThread starts in MobileSafari
ddkilzer@apple.com [Thu, 15 Jun 2017 19:29:53 +0000 (19:29 +0000)]
Build fix: [iOS] Generate a simulated crash when the WebThread starts in MobileSafari
<https://webkit.org/b/173386>
<rdar://problem/32776426>

* platform/ios/CrashReporterSupportSoftLink.h:
* platform/ios/CrashReporterSupportSoftLink.mm:
* platform/ios/wak/WebCoreThread.mm:
(WebThreadEnable): Log to the console on iOS Simulator.
* platform/spi/ios/CrashReporterSupportSPI.h:
- CrashReporterSupport.h is not available on iOS Simulator, so
  restrict to iOS hardware only.

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

2 years agoREGRESSION (r218228): Layout Test editing/execCommand/strikethrough-uses-strike-tag...
jlewis3@apple.com [Thu, 15 Jun 2017 19:00:29 +0000 (19:00 +0000)]
REGRESSION (r218228): Layout Test editing/execCommand/strikethrough-uses-strike-tag.html is failing
https://bugs.webkit.org/show_bug.cgi?id=173375

Unreviewed test gardening.

Reverted an incorrect baseline and skipped a test causing test failures.

* TestExpectations:
* platform/mac-wk1/editing/execCommand/strikethrough-uses-strike-tag-expected.txt: Removed.
* platform/win/editing/execCommand/strikethrough-uses-strike-tag-expected.txt: Removed.

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

2 years agoUnreviewed, rolling out r218318.
cdumez@apple.com [Thu, 15 Jun 2017 18:59:28 +0000 (18:59 +0000)]
Unreviewed, rolling out r218318.

Seems to have caused an 11% PLT regression. Rolling out to
confirm.

Reverted changeset:

"Don't always recalc the style of display: contents elements."
https://bugs.webkit.org/show_bug.cgi?id=172753
http://trac.webkit.org/changeset/218318

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

2 years ago[WPE] The run-minibrowser script should allow to execute also a WPE launcher
clopez@igalia.com [Thu, 15 Jun 2017 18:44:42 +0000 (18:44 +0000)]
[WPE] The run-minibrowser script should allow to execute also a WPE launcher
https://bugs.webkit.org/show_bug.cgi?id=173061

Reviewed by Žan Doberšek.

Launch dyz <https://github.com/Igalia/dyz> with the script
run-minibrowser for the wpe port. It is now built as part of the
WPE dependencies with JHBuild.

* Scripts/run-minibrowser:
* Scripts/webkitdirs.pm:
(launcherPath):
(launcherName):
* wpe/install-dependencies: Luajit is needed for building dyz.
* wpe/jhbuild.modules: Add dyz and update the revision for WPEBackend-mesa.

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

2 years agoUsing -[WebItemProviderPasteboard setItemProviders:] to swap out item providers befor...
wenson_hsieh@apple.com [Thu, 15 Jun 2017 18:11:52 +0000 (18:11 +0000)]
Using -[WebItemProviderPasteboard setItemProviders:] to swap out item providers before a drop breaks item provider loading
https://bugs.webkit.org/show_bug.cgi?id=173338
<rdar://problem/32777720>

Reviewed by Tim Horton.

Source/WebCore:

Currently, replacing the list of UIItemProviders right before a drop is handled results in
WebItemProviderPasteboard failing to load non-"public.content"-conformant items. This is because DragController
computes and sends to the UI process a list of UTIs to load (preferredTypeIdentifiers: one type identifier for
each item provider in WebItemProviderPasteboard). However, if the list of item providers changes immediately
before a drop is performed, WebItemProviderPasteboard will get into an inconsistent state where it has a
different number of preferred type identifiers to load than available item providers. This causes
WebItemProviderPasteboard to fail when choosing what type identifiers to load from each item provider.

To fix this, we instead have the web process propagate a list of supported type identifiers to the UI process,
which is a property of only the drop destination rather than both the destination and item providers. When
performing a drop, we then use the current item providers on WebItemProviderPasteboard to consult this list of
supported type identifiers to resolve our list of preferred type identifiers to load.

Globally renames updatePreferredTypeIdentifiers to updateSupportedTypeIdentifiers.

Tests:
DataInteractionTests.ExternalSourceOverrideDropFileUpload
DataInteractionTests.ExternalSourceOverrideDropInsertURL

* page/DragController.cpp:
(WebCore::DragController::dragEnteredOrUpdated):
(WebCore::DragController::updateSupportedTypeIdentifiersForDragHandlingMethod):
(WebCore::DragController::updatePreferredTypeIdentifiersForDragHandlingMethod): Deleted.
* page/DragController.h:
* page/mac/DragControllerMac.mm:
(WebCore::DragController::updateSupportedTypeIdentifiersForDragHandlingMethod):
(WebCore::DragController::updatePreferredTypeIdentifiersForDragHandlingMethod): Deleted.
* platform/DragData.h:
* platform/PasteboardStrategy.h:
* platform/PlatformPasteboard.h:
* platform/ios/AbstractPasteboard.h:
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::updateSupportedTypeIdentifiers):
(WebCore::PlatformPasteboard::updatePreferredTypeIdentifiers): Deleted.
* platform/ios/WebItemProviderPasteboard.mm:
(-[WebItemProviderPasteboard init]):
(-[WebItemProviderPasteboard updateSupportedTypeIdentifiers:]):
(-[WebItemProviderPasteboard setItemProviders:]):
(-[WebItemProviderPasteboard typeIsAppropriateForSupportedTypes:]):
(-[WebItemProviderPasteboard typeIdentifierToLoadForRegisteredTypeIdentfiers:]):

Add logic to resolve preferred type identifiers from an item providers list of registered type identifiers.
This formerly existed on DragData.

(-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:synchronousTimeout:]):
(-[WebItemProviderPasteboard updatePreferredTypeIdentifiers:]): Deleted.
* platform/mac/DragDataMac.mm:

Remove preferred type identifier resolution logic from DragData.

(WebCore::typeIsAppropriateForSupportedTypes): Deleted.
(WebCore::DragData::updatePreferredTypeIdentifiers): Deleted.

Source/WebKit/mac:

Rename updatePreferredTypeIdentifiers to updateSupportedTypeIdentifiers.

* WebCoreSupport/WebPlatformStrategies.h:
* WebCoreSupport/WebPlatformStrategies.mm:
(WebPlatformStrategies::updateSupportedTypeIdentifiers):
(WebPlatformStrategies::updatePreferredTypeIdentifiers): Deleted.

Source/WebKit2:

Rename updatePreferredTypeIdentifiers to updateSupportedTypeIdentifiers. Also, introduce
_webView:willPerformDropWithSession: as SPI on WKUIDelegate.

* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
(WebKit::WebPasteboardProxy::updateSupportedTypeIdentifiers):
(WebKit::WebPasteboardProxy::updatePreferredTypeIdentifiers): Deleted.
* UIProcess/WebPasteboardProxy.h:
* UIProcess/WebPasteboardProxy.messages.in:
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::updateSupportedTypeIdentifiers):
(WebKit::WebPlatformStrategies::updatePreferredTypeIdentifiers): Deleted.
* WebProcess/WebCoreSupport/WebPlatformStrategies.h:

Tools:

Adds new unit tests to ensure that -_webView:willPerformDropWithSession: can be used to filter out drag items
used by WebKit when handling a drop. These tests ensure that WebItemProviderPasteboard is still able to handle
these remaining items on drop.

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

Add -overridePerformDropBlock, which can be set to provide custom handling of dropped items.

(-[DataInteractionSimulator _webView:willPerformDropWithSession:]):

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

2 years ago[WebIDL] Replace general inclusion of JSDOMConvert.h with inclusion of individual...
commit-queue@webkit.org [Thu, 15 Jun 2017 17:49:50 +0000 (17:49 +0000)]
[WebIDL] Replace general inclusion of JSDOMConvert.h with inclusion of individual converter files to reduce unnecessary inclusion
https://bugs.webkit.org/show_bug.cgi?id=173392

Patch by Sam Weinig <sam@webkit.org> on 2017-06-15
Reviewed by Tim Horton.

Stop including the umbrella header JSDOMConvert.h in every generated bindings and
instead only include the specific converter needed. Then, go around and add all the
now missing includes that used to be obtained transitively.

* Modules/indexeddb/IDBRequest.cpp:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
* Modules/plugins/QuickTimePluginReplacement.mm:
* bindings/js/IDBBindingUtilities.cpp:
* bindings/js/JSCSSStyleDeclarationCustom.cpp:
* bindings/js/JSCryptoAlgorithmDictionary.cpp:
* bindings/js/JSCustomElementInterface.cpp:
* bindings/js/JSCustomElementRegistryCustom.cpp:
* bindings/js/JSDOMConvertBase.h:
* bindings/js/JSDOMConvertInterface.h:
* bindings/js/JSDOMConvertRecord.h:
* bindings/js/JSDOMConvertSequences.h:
* bindings/js/JSDOMConvertUnion.h:
* bindings/js/JSDOMGlobalObject.h:
* bindings/js/JSDOMWindowCustom.cpp:
* bindings/js/JSDOMWindowProperties.cpp:
* bindings/js/JSDocumentCustom.cpp:
* bindings/js/JSErrorHandler.cpp:
* bindings/js/JSEventListener.cpp:
* bindings/js/JSHTMLCanvasElementCustom.cpp:
* bindings/js/JSHTMLDocumentCustom.cpp:
* bindings/js/JSHistoryCustom.cpp:
* bindings/js/JSMessageEventCustom.cpp:
(WebCore::JSMessageEvent::data):
* bindings/js/JSMockContentFilterSettingsCustom.cpp:
* bindings/js/JSMutationCallback.cpp:
* bindings/js/JSXMLHttpRequestCustom.cpp:
(WebCore::JSXMLHttpRequest::retrieveResponse):
* bindings/js/ScriptGlobalObject.cpp:
* bindings/js/SerializedScriptValue.cpp:
* bindings/scripts/CodeGeneratorJS.pm:
(AddToIncludesForIDLType):
(GetJSCAttributesForAttribute):
(GenerateEnumerationHeader):
(GenerateEnumerationImplementation):
(GenerateEnumerationImplementationContent):
(GenerateEnumerationsImplementationContent):
(GenerateEnumerationHeaderContent):
(GenerateEnumerationsHeaderContent):
(GenerateDictionaryHeaderContent):
(GenerateDictionariesHeaderContent):
(GenerateDictionaryImplementationContent):
(GenerateDictionariesImplementationContent):
(GenerateHeader):
(GeneratePropertiesHashTable):
(GenerateOverloadDispatcher):
(GenerateImplementation):
(GenerateAttributeGetterDefinition):
(GenerateSerializerDefinition):
(GenerateDictionaryHeader):
(JSValueToNative):
(NativeToJSValueUsingReferences):
(NativeToJSValueUsingPointers):
(IsValidContextForNativeToJSValue):
(NativeToJSValue):
(GenerateConstructorDefinition):
(ComputeFunctionSpecial):
* bindings/scripts/test/JS/JSMapLike.cpp:
* bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
* bindings/scripts/test/JS/JSTestCEReactions.cpp:
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
* bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
* bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.cpp:
* bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp:
* bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
* bindings/scripts/test/JS/JSTestCallbackInterface.h:
* bindings/scripts/test/JS/JSTestDOMJIT.cpp:
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
* bindings/scripts/test/JS/JSTestEventConstructor.h:
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
* bindings/scripts/test/JS/JSTestException.cpp:
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
* bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
* bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
* bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
* bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestNode.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
* bindings/scripts/test/JS/JSTestPromiseRejectionEvent.h:
* bindings/scripts/test/JS/JSTestSerialization.cpp:
* bindings/scripts/test/JS/JSTestSerialization.h:
* bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
* bindings/scripts/test/JS/JSTestSerializationInherit.h:
* bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
* bindings/scripts/test/JS/JSTestSerializationInheritFinal.h:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
* bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
* bindings/scripts/test/JS/JSTestStandaloneEnumeration.h:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
* bindings/scripts/test/JS/JSTestVoidCallbackFunction.cpp:
* dom/MouseEvent.cpp:
* html/HTMLPlugInImageElement.cpp:

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

2 years ago[iOS] Generate a simulated crash when the WebThread starts in MobileSafari
ddkilzer@apple.com [Thu, 15 Jun 2017 17:05:04 +0000 (17:05 +0000)]
[iOS] Generate a simulated crash when the WebThread starts in MobileSafari
<https://webkit.org/b/173386>
<rdar://problem/32776426>

Reviewed by Andy Estes.

* WebCore.xcodeproj/project.pbxproj: Add new files to project.
* platform/ios/CrashReporterSupportSoftLink.h: Add.  The using
statement is so that we don't have to write
WebCore::SimulateCrash() in WebCoreThread.mm since it's
functions are not defined inside a WebCore namespace.  I also
kept the 'pid' argument despite the style checker warning
because it matches the internal method definition.
* platform/ios/CrashReporterSupportSoftLink.mm: Add.
* platform/ios/wak/WebCoreThread.mm: Sort headers.  Soft link to
CrashReporterSupport.framework.
(WebThreadEnable): Generate a simulated crash log if the
WebThread ever starts in MobileSafari.
* platform/spi/ios/CrashReporterSupportSPI.h: Add.  The header
isn't safe to include in C++ source, so wrap the import in
extern "C" macros.

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

2 years ago[Win] Crash in accessibility layout test.
pvollan@apple.com [Thu, 15 Jun 2017 17:01:26 +0000 (17:01 +0000)]
[Win] Crash in accessibility layout test.
https://bugs.webkit.org/show_bug.cgi?id=173401

Reviewed by Brent Fulgham.

We should not manually release the punkVal IUnknown member in a _variant_t object, since the punkVal
member will be automatically released when the _variant_t object goes out of scope if the vt member
does not equal VT_UNKNOWN | VT_BYREF.
See https://msdn.microsoft.com/en-us/library/windows/desktop/ms221165(v=vs.85).aspx.

* DumpRenderTree/win/AccessibilityUIElementWin.cpp:
(AccessibilityUIElement::titleUIElement):

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

2 years agoBuild WebKit with High Sierra (Seed 1)
jbedard@apple.com [Thu, 15 Jun 2017 16:57:17 +0000 (16:57 +0000)]
Build WebKit with High Sierra (Seed 1)
https://bugs.webkit.org/show_bug.cgi?id=173371

Reviewed by Andy Estes.

* crypto/CommonCryptoUtilities.h: Added ccRSAPSSPadding to CCAsymmetricPading enum.
* platform/spi/cocoa/AVKitSPI.h: Declare AVKit SPI used by WebKit in High Sierra.
(-[AVTouchBarPlaybackControlsControlling NS_ENUM]): Added AVTouchBarMediaSelectionOptionType
SPI used in WebPlaybackControlManager in High Sierra.
* platform/spi/cocoa/PassKitSPI.h: Declare PassKit SPI used by WebKit in High Sierra.
(NS_ERROR_ENUM): Added PKPaymentErrorCode used in WebPayment in High Sierra.

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

2 years agoRTCPeerConnection returns RTCSessionDescription where RTCSessionDescriptionInit would...
commit-queue@webkit.org [Thu, 15 Jun 2017 16:24:20 +0000 (16:24 +0000)]
RTCPeerConnection returns RTCSessionDescription where RTCSessionDescriptionInit would be appropriate
https://bugs.webkit.org/show_bug.cgi?id=173118
<rdar://problem/32746761>

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

LayoutTests/imported/w3c:

* web-platform-tests/webrtc/RTCPeerConnection-createOffer-expected.txt:

Source/WebCore:

Test: webrtc/createOfferAnswer.html

Making the promise return a RTCSessionDescription::Init instead of a RTCSessionDescription.
This aligns with the spec and is more optimal.

* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::createOfferSucceeded):
(WebCore::PeerConnectionBackend::createAnswerSucceeded):
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCSessionDescription.idl:

LayoutTests:

* fast/mediastream/RTCPeerConnection-setLocalDescription-offer-expected.txt:
* fast/mediastream/RTCPeerConnection-setRemoteDescription-offer-expected.txt:
* webrtc/createOfferAnswer-expected.txt: Added.
* webrtc/createOfferAnswer.html: Added.

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

2 years agoMarked imported/w3c/web-platform-tests/dom/nodes/Document-constructor-svg.svg as...
jlewis3@apple.com [Thu, 15 Jun 2017 16:19:57 +0000 (16:19 +0000)]
Marked imported/w3c/web-platform-tests/dom/nodes/Document-constructor-svg.svg as skip.
https://bugs.webkit.org/show_bug.cgi?id=173333

Unreviewed test gardening.

* TestExpectations:

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

2 years agoImplement FALLTHROUGH macro for compilers other than Clang
annulen@yandex.ru [Thu, 15 Jun 2017 16:14:21 +0000 (16:14 +0000)]
Implement FALLTHROUGH macro for compilers other than Clang
https://bugs.webkit.org/show_bug.cgi?id=173385

Reviewed by Alex Christensen.

FALLTHROUGH should be able to use [[gnu::fallthrough]] attribute of
GCC, and [[fallthrough]] from C++17, whichever is available.

* wtf/Compiler.h:

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

2 years ago[GTK] Cleanup headers includes in GTK+ API files
carlosgc@webkit.org [Thu, 15 Jun 2017 15:40:20 +0000 (15:40 +0000)]
[GTK] Cleanup headers includes in GTK+ API files
https://bugs.webkit.org/show_bug.cgi?id=173415

Reviewed by Michael Catanzaro.

- Remove WTFGType.h from WebKitPrivate.h and include it in all other files instead of WebKitPrivate if needed.
- Stop including WebKitPrivate.h in all other private headers.
- Remove all C API includes.

* UIProcess/API/gtk/WebKitAuthenticationDialog.cpp:
* UIProcess/API/gtk/WebKitAuthenticationRequest.cpp:
* UIProcess/API/gtk/WebKitAuthenticationRequestPrivate.h:
* UIProcess/API/gtk/WebKitAutomationSession.cpp:
* UIProcess/API/gtk/WebKitBackForwardList.cpp:
* UIProcess/API/gtk/WebKitBackForwardListItem.cpp:
* UIProcess/API/gtk/WebKitColorChooser.h:
* UIProcess/API/gtk/WebKitColorChooserRequest.cpp:
* UIProcess/API/gtk/WebKitContextMenu.cpp:
* UIProcess/API/gtk/WebKitContextMenuItem.cpp:
* UIProcess/API/gtk/WebKitContextMenuItemPrivate.h:
* UIProcess/API/gtk/WebKitContextMenuPrivate.h:
* UIProcess/API/gtk/WebKitCookieManager.cpp:
* UIProcess/API/gtk/WebKitCookieManagerPrivate.h:
* UIProcess/API/gtk/WebKitCredentialPrivate.h:
* UIProcess/API/gtk/WebKitDownload.cpp:
* UIProcess/API/gtk/WebKitDownloadClient.cpp:
* UIProcess/API/gtk/WebKitDownloadPrivate.h:
* UIProcess/API/gtk/WebKitEditorState.cpp:
* UIProcess/API/gtk/WebKitEditorStatePrivate.h:
* UIProcess/API/gtk/WebKitError.cpp:
* UIProcess/API/gtk/WebKitFaviconDatabase.cpp:
* UIProcess/API/gtk/WebKitFileChooserRequest.cpp:
* UIProcess/API/gtk/WebKitFileChooserRequestPrivate.h:
* UIProcess/API/gtk/WebKitFindController.cpp:
* UIProcess/API/gtk/WebKitFormClient.cpp:
* UIProcess/API/gtk/WebKitFormSubmissionRequest.cpp:
* UIProcess/API/gtk/WebKitFormSubmissionRequestPrivate.h:
* UIProcess/API/gtk/WebKitGeolocationPermissionRequest.cpp:
* UIProcess/API/gtk/WebKitGeolocationPermissionRequestPrivate.h:
* UIProcess/API/gtk/WebKitHitTestResult.cpp:
* UIProcess/API/gtk/WebKitHitTestResultPrivate.h:
* UIProcess/API/gtk/WebKitInstallMissingMediaPluginsPermissionRequest.cpp:
* UIProcess/API/gtk/WebKitInstallMissingMediaPluginsPermissionRequestPrivate.h:
* UIProcess/API/gtk/WebKitJavascriptResult.cpp:
* UIProcess/API/gtk/WebKitJavascriptResultPrivate.h:
* UIProcess/API/gtk/WebKitMimeInfoPrivate.h:
* UIProcess/API/gtk/WebKitNavigationActionPrivate.h:
* UIProcess/API/gtk/WebKitNavigationPolicyDecision.cpp:
* UIProcess/API/gtk/WebKitNavigationPolicyDecisionPrivate.h:
* UIProcess/API/gtk/WebKitNetworkProxySettings.cpp:
* UIProcess/API/gtk/WebKitNetworkProxySettingsPrivate.h:
* UIProcess/API/gtk/WebKitNotification.cpp:
* UIProcess/API/gtk/WebKitNotificationPermissionRequest.cpp:
* UIProcess/API/gtk/WebKitNotificationPermissionRequestPrivate.h:
* UIProcess/API/gtk/WebKitNotificationPrivate.h:
* UIProcess/API/gtk/WebKitOptionMenu.cpp:
* UIProcess/API/gtk/WebKitPlugin.cpp:
* UIProcess/API/gtk/WebKitPluginPrivate.h:
* UIProcess/API/gtk/WebKitPolicyDecision.cpp:
* UIProcess/API/gtk/WebKitPolicyDecisionPrivate.h:
* UIProcess/API/gtk/WebKitPrintCustomWidget.cpp:
* UIProcess/API/gtk/WebKitPrintCustomWidgetPrivate.h:
* UIProcess/API/gtk/WebKitPrintOperation.cpp:
* UIProcess/API/gtk/WebKitPrivate.h:
* UIProcess/API/gtk/WebKitResponsePolicyDecision.cpp:
* UIProcess/API/gtk/WebKitResponsePolicyDecisionPrivate.h:
* UIProcess/API/gtk/WebKitSecurityManager.cpp:
* UIProcess/API/gtk/WebKitSecurityOrigin.cpp:
* UIProcess/API/gtk/WebKitSecurityOriginPrivate.h:
* UIProcess/API/gtk/WebKitSettings.cpp:
* UIProcess/API/gtk/WebKitUIClient.cpp:
* UIProcess/API/gtk/WebKitURIRequest.cpp:
* UIProcess/API/gtk/WebKitURIResponse.cpp:
* UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
* UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h:
* UIProcess/API/gtk/WebKitUserContent.cpp:
* UIProcess/API/gtk/WebKitUserContentManager.cpp:
* UIProcess/API/gtk/WebKitUserMediaPermissionRequest.cpp:
* UIProcess/API/gtk/WebKitUserMediaPermissionRequestPrivate.h:
* UIProcess/API/gtk/WebKitWebContext.cpp:
* UIProcess/API/gtk/WebKitWebContextPrivate.h:
* UIProcess/API/gtk/WebKitWebInspector.cpp:
* UIProcess/API/gtk/WebKitWebInspectorPrivate.h:
* UIProcess/API/gtk/WebKitWebResource.cpp:
* UIProcess/API/gtk/WebKitWebResourcePrivate.h:
* UIProcess/API/gtk/WebKitWebView.cpp:
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
* UIProcess/API/gtk/WebKitWebViewBaseAccessible.cpp:
* UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
* UIProcess/API/gtk/WebKitWebViewPrivate.h:
* UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:
* UIProcess/API/gtk/WebKitWebsiteDataManagerPrivate.h:
* UIProcess/API/gtk/WebKitWebsiteDataPrivate.h:
* UIProcess/API/gtk/WebKitWindowProperties.cpp:
* UIProcess/API/gtk/WebKitWindowPropertiesPrivate.h:
* WebProcess/InjectedBundle/API/gtk/WebKitFrame.cpp:
* WebProcess/InjectedBundle/API/gtk/WebKitScriptWorld.cpp:
* WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.cpp:
* WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp:
* WebProcess/InjectedBundle/API/gtk/WebKitWebHitTestResult.cpp:
* WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:

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

2 years ago[GTK] Do not use the C API in WebGtkExtensionManager
carlosgc@webkit.org [Thu, 15 Jun 2017 15:37:31 +0000 (15:37 +0000)]
[GTK] Do not use the C API in WebGtkExtensionManager
https://bugs.webkit.org/show_bug.cgi?id=173408

Reviewed by Michael Catanzaro.

.:

Update exported symbol signature.

* Source/cmake/gtksymbols.filter:

Source/WebKit2:

Use the C++ API instead.

* WebProcess/gtk/WebGtkExtensionManager.cpp:
(WebKit::parseUserData):
(WebKit::WebGtkExtensionManager::initialize):
* WebProcess/gtk/WebGtkExtensionManager.h:
* WebProcess/gtk/WebGtkInjectedBundleMain.cpp:
(WKBundleInitialize):

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

2 years ago[GTK] Stop using GtkAction in WebPopupMenuProxyGtk
aperez@igalia.com [Thu, 15 Jun 2017 14:03:03 +0000 (14:03 +0000)]
[GTK] Stop using GtkAction in WebPopupMenuProxyGtk
https://bugs.webkit.org/show_bug.cgi?id=173417

Reviewed by Carlos Garcia Campos.

This gets rid of GtkAction in WebPopupMenuProxyGtk, which was deprecated in GTK+ 3.10
and will not be available in GTK+ 4.0. Using GtkMenuItem directly makes populating
long menus slightly faster, which can be noticeable in lower-end machines.

* UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
(WebKit::WebPopupMenuProxyGtk::populatePopupMenu):
(WebKit::WebPopupMenuProxyGtk::menuItemActivated):
(WebKit::WebPopupMenuProxyGtk::createGtkActionForMenuItem): Deleted.
* UIProcess/gtk/WebPopupMenuProxyGtk.h:
(WebKit::WebPopupMenuProxyGtk::setCurrentlySelectedMenuItem):
Instantiate GtkMenuItem objects directly when populating the menu.

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

2 years agoUnreviewed GTK+ gardening. Update expectations of several tests failing after r218320.
magomez@igalia.com [Thu, 15 Jun 2017 12:56:28 +0000 (12:56 +0000)]
Unreviewed GTK+ gardening. Update expectations of several tests failing after r218320.

* platform/gtk/TestExpectations:

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

2 years ago[WPE] dom storage gardening
csaavedra@igalia.com [Thu, 15 Jun 2017 09:58:43 +0000 (09:58 +0000)]
[WPE] dom storage gardening

Unreviewed gardening.

Two dom storage tests marked as failing have been passing always,
so remove them.
* platform/wpe/TestExpectations:

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

2 years agoUnreviewed. Fix copy-paste error in GTK+ WEBKIT_JAVASCRIPT_ERROR definition.
carlosgc@webkit.org [Thu, 15 Jun 2017 09:49:18 +0000 (09:49 +0000)]
Unreviewed. Fix copy-paste error in GTK+ WEBKIT_JAVASCRIPT_ERROR definition.

The print one was copied there.

* UIProcess/API/gtk/WebKitError.h:

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

2 years ago[GTK] Add API to allow overriding popup menus
carlosgc@webkit.org [Thu, 15 Jun 2017 09:41:27 +0000 (09:41 +0000)]
[GTK] Add API to allow overriding popup menus
https://bugs.webkit.org/show_bug.cgi?id=172905

Reviewed by Michael Catanzaro.

Source/WebKit2:

The GTK+ API uses GTK+ for the default implementation of several UI elements like the file chooser, print dialog,
color picker, context menu, etc. but in all those cases it allows to override the default implementation. It's
not possible to override the popup menu used for select elements. This patch adds WebKitOptionMenu to represent
a select dropdown menu. It's passed as an argument of the new signal WebKitWebView::show-option-menu, and
contains WebKitOptionMenuItem elements representing the items to be displayed.

* PlatformGTK.cmake:
* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::createPopupMenuProxy): Create a WebKitPopupMenu.
* UIProcess/API/gtk/WebKitOptionMenu.cpp: Added.
(webkitOptionMenuCreate):
(webkit_option_menu_get_n_items):
(webkit_option_menu_get_item):
(webkit_option_menu_select_item):
(webkit_option_menu_activate_item):
(webkit_option_menu_close):
* UIProcess/API/gtk/WebKitOptionMenu.h: Added.
* UIProcess/API/gtk/WebKitOptionMenuItem.cpp: Added.
(webkit_option_menu_item_copy):
(webkit_option_menu_item_free):
(webkit_option_menu_item_get_label):
(webkit_option_menu_item_get_tooltip):
(webkit_option_menu_item_is_group_label):
(webkit_option_menu_item_is_group_child):
(webkit_option_menu_item_is_enabled):
(webkit_option_menu_item_is_selected):
* UIProcess/API/gtk/WebKitOptionMenuItem.h: Added.
* UIProcess/API/gtk/WebKitOptionMenuItemPrivate.h: Added.
(_WebKitOptionMenuItem::_WebKitOptionMenuItem):
* UIProcess/API/gtk/WebKitOptionMenuPrivate.h: Added.
* UIProcess/API/gtk/WebKitPopupMenu.cpp: Added.
(WebKit::WebKitPopupMenu::WebKitPopupMenu):
(WebKit::menuCloseCallback):
(WebKit::WebKitPopupMenu::showPopupMenu): Call webkitWebViewShowOptionMenu() falling back to default
implementation if the user didn't handle the signal.
(WebKit::WebKitPopupMenu::hidePopupMenu):
(WebKit::WebKitPopupMenu::cancelTracking):
(WebKit::WebKitPopupMenu::selectItem):
(WebKit::WebKitPopupMenu::activateItem):
* UIProcess/API/gtk/WebKitPopupMenu.h: Added.
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkit_web_view_class_init):
(webkitWebViewShowOptionMenu): Emit WebKitWebView::show-option-menu.
* UIProcess/API/gtk/WebKitWebView.h:
* UIProcess/API/gtk/WebKitWebViewPrivate.h:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols.
* UIProcess/API/gtk/docs/webkit2gtk-4.0.types: Add new get_type functions.
* UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new sections.
* UIProcess/API/gtk/webkit2.h: Add new public headers.
* UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
(WebKit::WebPopupMenuProxyGtk::WebPopupMenuProxyGtk): Do not create the GtkMenu in constructor.
(WebKit::WebPopupMenuProxyGtk::showPopupMenu): Create the GtkMenu and connect to the signals here.
(WebKit::WebPopupMenuProxyGtk::hidePopupMenu): Return early if the Gtk hasn't been shown.
* UIProcess/gtk/WebPopupMenuProxyGtk.h: Make constructor and webview protected.

Tools:

Add a unit test to check the new API.

* TestWebKitAPI/Tests/WebKit2Gtk/CMakeLists.txt:
* TestWebKitAPI/Tests/WebKit2Gtk/TestOptionMenu.cpp: Added.
(OptionMenuTest::OptionMenuTest):
(OptionMenuTest::~OptionMenuTest):
(OptionMenuTest::destroyMenu):
(OptionMenuTest::showOptionMenuCallback):
(OptionMenuTest::menuCloseCallback):
(OptionMenuTest::showOptionMenu):
(OptionMenuTest::clickAtPositionAndWaitUntilOptionMenuShown):
(OptionMenuTest::close):
(OptionMenuTest::activateItem):
(OptionMenuTest::selectItem):
(testOptionMenuSimple):
(testOptionMenuGroups):
(testOptionMenuActivate):
(testOptionMenuSelect):
(beforeAll):
(afterAll):

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

2 years ago[GTK] Use API::InjectedBundle::ResourceLoadClient in WebKitWebPage
carlosgc@webkit.org [Thu, 15 Jun 2017 09:19:50 +0000 (09:19 +0000)]
[GTK] Use API::InjectedBundle::ResourceLoadClient in WebKitWebPage
https://bugs.webkit.org/show_bug.cgi?id=173364

Reviewed by Michael Catanzaro.

Instead of the C API.

* WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
(webkitWebPageCreate):
(didInitiateLoadForResource): Deleted.
(willSendRequestForFrame): Deleted.
(didReceiveResponseForResource): Deleted.
(didReceiveContentLengthForResource): Deleted.
(didFinishLoadForResource): Deleted.
(didFailLoadForResource): Deleted.

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

2 years ago[GTK] Use API::InjectedBundle::Client in WebKitWebExtension
carlosgc@webkit.org [Thu, 15 Jun 2017 09:10:09 +0000 (09:10 +0000)]
[GTK] Use API::InjectedBundle::Client in WebKitWebExtension
https://bugs.webkit.org/show_bug.cgi?id=173358

Reviewed by Michael Catanzaro.

Instead of the C API.

* WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp:
(webkitWebExtensionCreate):
(webkitWebExtensionPageCreated): Deleted.
(webkitWebExtensionPageDestroy): Deleted.
(webkitWebExtensionDidReceiveMessage): Deleted.
(didCreatePage): Deleted.
(willDestroyPage): Deleted.
(didReceiveMessage): Deleted.
(didReceiveMessageToPage): Deleted.

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

2 years ago[GTK] Use API::NotificationProvider
carlosgc@webkit.org [Thu, 15 Jun 2017 08:31:58 +0000 (08:31 +0000)]
[GTK] Use API::NotificationProvider
https://bugs.webkit.org/show_bug.cgi?id=173312

Reviewed by Žan Doberšek.

Also cleanup a bit the WebKitNotificationProvider implementation, it doesn't need to be refcounted.

* UIProcess/API/gtk/WebKitNotificationProvider.cpp:
(WebKitNotificationProvider::WebKitNotificationProvider):
(WebKitNotificationProvider::~WebKitNotificationProvider):
(WebKitNotificationProvider::show):
(WebKitNotificationProvider::clearNotifications):
(WebKitNotificationProvider::notificationPermissions):
(WebKitNotificationProvider::setNotificationPermissions):
* UIProcess/API/gtk/WebKitNotificationProvider.h:
* UIProcess/API/gtk/WebKitWebContext.cpp:
(webkitWebContextConstructed):
(addOriginToMap):
(webkit_web_context_initialize_notification_permissions):

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

2 years agoAdd API::InjectedBundle::ResourceLoadClient
carlosgc@webkit.org [Thu, 15 Jun 2017 08:20:34 +0000 (08:20 +0000)]
Add API::InjectedBundle::ResourceLoadClient
https://bugs.webkit.org/show_bug.cgi?id=173362

Reviewed by Alex Christensen.

It will be used by the GTK+ port instead of the C API.

* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/InjectedBundle/API/APIInjectedBundlePageResourceLoadClient.h: Copied from Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.h.
(API::InjectedBundle::ResourceLoadClient::didInitiateLoadForResource):
(API::InjectedBundle::ResourceLoadClient::willSendRequestForFrame):
(API::InjectedBundle::ResourceLoadClient::didReceiveResponseForResource):
(API::InjectedBundle::ResourceLoadClient::didReceiveContentLengthForResource):
(API::InjectedBundle::ResourceLoadClient::didFinishLoadForResource):
(API::InjectedBundle::ResourceLoadClient::didFailLoadForResource):
(API::InjectedBundle::ResourceLoadClient::shouldCacheResponse):
(API::InjectedBundle::ResourceLoadClient::shouldUseCredentialStorage):
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageSetResourceLoadClient):
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(setUpResourceLoadClient):
(-[WKWebProcessPlugInBrowserContextController setLoadDelegate:]):
* WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.cpp:
(WebKit::InjectedBundlePageResourceLoadClient::InjectedBundlePageResourceLoadClient):
(WebKit::InjectedBundlePageResourceLoadClient::didInitiateLoadForResource):
(WebKit::InjectedBundlePageResourceLoadClient::willSendRequestForFrame):
(WebKit::InjectedBundlePageResourceLoadClient::didReceiveResponseForResource):
(WebKit::InjectedBundlePageResourceLoadClient::didReceiveContentLengthForResource):
(WebKit::InjectedBundlePageResourceLoadClient::didFinishLoadForResource):
(WebKit::InjectedBundlePageResourceLoadClient::didFailLoadForResource):
(WebKit::InjectedBundlePageResourceLoadClient::shouldCacheResponse):
(WebKit::InjectedBundlePageResourceLoadClient::shouldUseCredentialStorage):
* WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.h:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::assignIdentifierToInitialRequest):
(WebKit::WebFrameLoaderClient::dispatchWillSendRequest):
(WebKit::WebFrameLoaderClient::shouldUseCredentialStorage):
(WebKit::WebFrameLoaderClient::dispatchDidReceiveResponse):
(WebKit::WebFrameLoaderClient::dispatchDidReceiveContentLength):
(WebKit::WebFrameLoaderClient::dispatchDidFinishLoading):
(WebKit::WebFrameLoaderClient::dispatchDidFailLoading):
(WebKit::WebFrameLoaderClient::willCacheResponse):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setInjectedBundleResourceLoadClient):
(WebKit::WebPage::close):
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::injectedBundleResourceLoadClient):

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

2 years ago[WinCairo] DumpRenderTree.cpp: error C3861: 'CFURLCacheCreate': identifier not found
commit-queue@webkit.org [Thu, 15 Jun 2017 07:18:32 +0000 (07:18 +0000)]
[WinCairo] DumpRenderTree.cpp: error C3861: 'CFURLCacheCreate': identifier not found
https://bugs.webkit.org/show_bug.cgi?id=173399

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-06-15
Reviewed by Per Arne Vollan.

OpenCFLite doesn't have CFURLCacheCreate and CFURLCacheSetSharedURLCache.
Curl port needs to do nothing because libcurl doesn't have disk cache.

* DumpRenderTree/win/DumpRenderTree.cpp:
(prepareConsistentTestingEnvironment): Call CFURLCacheCreate() and
CFURLCacheSetSharedURLCache() only if USE(CFURLCONNECTION).

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

2 years agoAdd API::InjectedBundle::Client
carlosgc@webkit.org [Thu, 15 Jun 2017 07:02:38 +0000 (07:02 +0000)]
Add API::InjectedBundle::Client
https://bugs.webkit.org/show_bug.cgi?id=173357

Reviewed by Alex Christensen.

It will be used by the GTK+ port instead of the C API.

* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/InjectedBundle/API/APIInjectedBundleBundleClient.h: Copied from Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleClient.h.
(API::InjectedBundle::Client::didCreatePage):
(API::InjectedBundle::Client::willDestroyPage):
(API::InjectedBundle::Client::didInitializePageGroup):
(API::InjectedBundle::Client::didReceiveMessage):
(API::InjectedBundle::Client::didReceiveMessageToPage):
* WebProcess/InjectedBundle/API/c/WKBundle.cpp:
(WKBundleSetClient):
* WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp:
(webkitWebExtensionPageCreated): Deleted.
(webkitWebExtensionPageDestroy): Deleted.
(webkitWebExtensionDidReceiveMessage): Deleted.
(didCreatePage): Deleted.
(willDestroyPage): Deleted.
(didReceiveMessage): Deleted.
(didReceiveMessageToPage): Deleted.
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::setClient):
(WebKit::InjectedBundle::didCreatePage):
(WebKit::InjectedBundle::willDestroyPage):
(WebKit::InjectedBundle::didInitializePageGroup):
(WebKit::InjectedBundle::didReceiveMessage):
(WebKit::InjectedBundle::didReceiveMessageToPage):
* WebProcess/InjectedBundle/InjectedBundle.h:
* WebProcess/InjectedBundle/InjectedBundleClient.cpp:
(WebKit::InjectedBundleClient::InjectedBundleClient):
(WebKit::InjectedBundleClient::didCreatePage):
(WebKit::InjectedBundleClient::willDestroyPage):
(WebKit::InjectedBundleClient::didInitializePageGroup):
(WebKit::InjectedBundleClient::didReceiveMessage):
(WebKit::InjectedBundleClient::didReceiveMessageToPage):
* WebProcess/InjectedBundle/InjectedBundleClient.h:

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

2 years agoDon't always recalc the style of display: contents elements.
commit-queue@webkit.org [Thu, 15 Jun 2017 06:58:02 +0000 (06:58 +0000)]
Don't always recalc the style of display: contents elements.
https://bugs.webkit.org/show_bug.cgi?id=172753

Patch by Emilio Cobos Álvarez <ecobos@igalia.com> on 2017-06-15
Reviewed by Antti Koivisto.

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

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

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