WebKit-https.git
2 years ago[ARMv6][DFG] ARM MacroAssembler is always emitting cmn when immediate is 0
ticaiolima@gmail.com [Tue, 20 Jun 2017 00:50:23 +0000 (00:50 +0000)]
[ARMv6][DFG] ARM MacroAssembler is always emitting cmn when immediate is 0
https://bugs.webkit.org/show_bug.cgi?id=172972

Reviewed by Mark Lam.

We are changing internalCompare32 implementation in ARM
MacroAssembler to emit "cmp" when the "right.value" is 0.
It is generating wrong comparison cases, since the
semantics of cmn is opposite of cmp[1]. One case that it's breaking is
"branch32(MacroAssembler::Above, gpr, TrustedImm32(0))", where ends
resulting in following assembly code:

```
cmn $r0, #0
bhi <address>
```

However, as cmn is similar to "adds", it will never take the branch
when $r0 > 0. In that case, the correct opcode is "cmp". With this
patch we will fix current broken tests that uses
"branch32(MacroAssembler::Above, gpr, TrustedImm32(0))",
such as ForwardVarargs, Spread and GetRestLength.

[1] - http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0204j/Cihiddid.html

* assembler/MacroAssemblerARM.h:
(JSC::MacroAssemblerARM::internalCompare32):

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

2 years agoImprove debugging ability of some webrtc tests
commit-queue@webkit.org [Mon, 19 Jun 2017 23:53:00 +0000 (23:53 +0000)]
Improve debugging ability of some webrtc tests
https://bugs.webkit.org/show_bug.cgi?id=173549

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

Improve debugging ability for first two tests.
Improve reliability for the next three tests.

* webrtc/audio-replace-track-expected.txt:
* webrtc/audio-replace-track.html: Checking connected state.
* webrtc/video-mute-expected.txt:
* webrtc/video-mute.html: Ditto.
* webrtc/video-replace-track-to-null.html: Improving reliability of test.
* webrtc/video-rotation.html: Adding some delay before testing black frames and increasing delay between the tests..
* webrtc/video-unmute.html: Using counter based testing of black frames.

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

2 years ago[Cocoa] implement URLSession:task:needNewBodyStream: delegate method
darin@apple.com [Mon, 19 Jun 2017 23:51:00 +0000 (23:51 +0000)]
[Cocoa] implement URLSession:task:needNewBodyStream: delegate method
https://bugs.webkit.org/show_bug.cgi?id=173551
rdar://problem/32250512

Source/WebCore:

Reviewed by Alex Christensen.

Covered by http/tests/misc/form-blob-challenge.html

* WebCore.xcodeproj/project.pbxproj: Removed NSURLRequestSPI.h.

* platform/network/cf/FormDataStreamCFNet.cpp:
(WebCore::createHTTPBodyCFReadStream): Factored this out from setHTTPBody.
(WebCore::setHTTPBody): Factored out the function above.
* platform/network/cf/FormDataStreamCFNet.h: Added createHTTPBodyCFReadStream.

* platform/network/cocoa/ResourceRequestCocoa.mm: Use CFNetworkSPI.h.
* platform/network/ios/ResourceRequestIOS.mm: Ditto.

* platform/network/mac/FormDataStreamMac.h: Added createHTTPBodyNSInputStream.
* platform/network/mac/FormDataStreamMac.mm:
(WebCore::createHTTPBodyNSInputStream): Added/

* platform/network/mac/ResourceHandleMac.mm: Use CFNetworkSPI.h.
* platform/network/mac/ResourceRequestMac.mm: Ditto.
* platform/network/mac/WebCoreResourceHandleAsDelegate.mm: Ditto.
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm: Ditto.

* platform/network/mac/WebCoreURLResponse.h: Moved SPI declarations from
here into CFNetworkSPI.h.

* platform/spi/cf/CFNetworkSPI.h: Use #pragma once, consolidated SPI that was
defined in scattered locations.

* platform/spi/cocoa/NSURLRequestSPI.h: Removed. Superceded by CFNetworkSPI.h.

Source/WebKit2:

Reviewed by Alex Christensen.

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate existingTask:]): Added helper method.
(-[WKNetworkSessionDelegate URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:]):
Updated to use existingTask: method.
(-[WKNetworkSessionDelegate URLSession:task:needNewBodyStream:]): Added.
(-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
Updated to use existingTask: method.
(-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]): Ditto.
(-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]): Ditto.
(-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]): Ditto.
(-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]): Ditto.
(-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]): Ditto.
(-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveData:]): Ditto.
(-[WKNetworkSessionDelegate URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]): Ditto.
(-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]): Ditto.
(WebKit::globalAllowsCellularAccess): Deleted. Just use a normal global.
(WebKit::globalLegacyCustomProtocolManager): Deleted. Just use a normal global.
(WebKit::NetworkSessionCocoa::setLegacyCustomProtocolManager): Updated for normal global.
(WebKit::NetworkSessionCocoa::setAllowsCellularAccess): Ditto.
(WebKit::NetworkSessionCocoa::defaultSession): Ditto.
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa): Ditto.

LayoutTests:

Reviewed by Alex Christensen.

* http/tests/misc/form-blob-challenge-expected.txt: Added.
* http/tests/misc/form-blob-challenge.html: Added.
* http/tests/misc/resources/basic-echo-post.php: Added.

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

2 years agoVarious IndexedDB crashes as an after effect of previous test.
beidson@apple.com [Mon, 19 Jun 2017 23:19:11 +0000 (23:19 +0000)]
Various IndexedDB crashes as an after effect of previous test.
<rdar://problem/31418761> and https://bugs.webkit.org/show_bug.cgi?id=170436

Reviewed by Chris Dumez.

No new test (No consistent test possible, in practice covered by all existing IDB tests)

This is timing related, where a UniqueIDBDatabase can be destroyed on the main thread while
it still has one task left to try to execute on the IDBServer thread.

The background thread tasks don't Ref<> the UniqueIDBDatabase, so even though task execution
took a Ref<> protector, there was still a small window for a race.

Should be closed up by making the background thread tasks themselves protect this.

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTask):
(WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTaskReply):
(WebCore::IDBServer::UniqueIDBDatabase::executeNextDatabaseTask):
(WebCore::IDBServer::UniqueIDBDatabase::executeNextDatabaseTaskReply):
* Modules/indexeddb/server/UniqueIDBDatabase.h:

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

2 years agoAdjusted test ecpectaions for webrtc/libwebrtc/descriptionGetters.html.
jlewis3@apple.com [Mon, 19 Jun 2017 22:47:43 +0000 (22:47 +0000)]
Adjusted test ecpectaions for webrtc/libwebrtc/descriptionGetters.html.
https://bugs.webkit.org/show_bug.cgi?id=171703

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

2 years agotest262: Completion values for control flow do not match the spec
commit-queue@webkit.org [Mon, 19 Jun 2017 22:04:20 +0000 (22:04 +0000)]
test262: Completion values for control flow do not match the spec
https://bugs.webkit.org/show_bug.cgi?id=171265

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-06-19
Reviewed by Saam Barati.

JSTests:

* stress/completion-value.js:
Condensed test for completion values in top level statements.

* stress/super-get-by-id.js:
ClassDeclaration when evaled no longer produce values. Convert
these to ClassExpressions so they produce the class value.

* ChakraCore/test/GlobalFunctions/evalreturns3.baseline-jsc:
This is a progression for currect spec behavior.

* mozilla/mozilla-tests.yaml:
This test is now outdated, so mark it as failing for that reason.

* test262.yaml:
Passing all "cptn" completion value tests.

Source/JavaScriptCore:

* bytecompiler/BytecodeGenerator.h:
(JSC::BytecodeGenerator::shouldBeConcernedWithCompletionValue):
When we care about having proper completion values (global code
in programs, modules, and eval) insert undefined results for
control flow statements.

* bytecompiler/NodesCodegen.cpp:
(JSC::SourceElements::emitBytecode):
Reduce writing a default `undefined` value to the completion result to
only once before the last statement we know will produce a value.

(JSC::IfElseNode::emitBytecode):
(JSC::WithNode::emitBytecode):
(JSC::WhileNode::emitBytecode):
(JSC::ForNode::emitBytecode):
(JSC::ForInNode::emitBytecode):
(JSC::ForOfNode::emitBytecode):
(JSC::SwitchNode::emitBytecode):
Insert an undefined to handle cases where code may break out of an
if/else or with statement (break/continue).

(JSC::TryNode::emitBytecode):
Same handling for break cases. Also, finally block statement completion
values are always ignored for the try statement result.

(JSC::ClassDeclNode::emitBytecode):
Class declarations, like function declarations, produce an empty result.

* parser/Nodes.cpp:
(JSC::SourceElements::lastStatement):
(JSC::SourceElements::hasCompletionValue):
(JSC::SourceElements::hasEarlyBreakOrContinue):
(JSC::BlockNode::lastStatement):
(JSC::BlockNode::singleStatement):
(JSC::BlockNode::hasCompletionValue):
(JSC::BlockNode::hasEarlyBreakOrContinue):
(JSC::ScopeNode::singleStatement):
(JSC::ScopeNode::hasCompletionValue):
(JSC::ScopeNode::hasEarlyBreakOrContinue):
The only non-trivial cases need to loop through their list of statements
to determine if this has a completion value or not. Likewise for
determining if there is an early break / continue, meaning a break or
continue statement with no preceding statement that has a completion value.

* parser/Nodes.h:
(JSC::StatementNode::next):
(JSC::StatementNode::hasCompletionValue):
Helper to check if a statement nodes produces a completion value or not.

Tools:

* Scripts/run-jsc-stress-tests:
Include a :failDueToOutdatedOrBadTest to mark failures with justification.

LayoutTests:

* js/eval-throw-return-expected.txt:
* js/kde/completion-expected.txt:
* js/kde/script-tests/completion.js:
* js/script-tests/eval-throw-return.js:
* sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.3_The_for_Statement/S12.6.3_A9-expected.txt:
* sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.3_The_for_Statement/S12.6.3_A9.1-expected.txt:
Rebaseline expectations. These are all outdated. In fact the sputnik
tests were imported into test262 and modified for ES2015.

* js/script-tests/function-toString-vs-name.js:
ClassDeclarations on their own don't produce a value. So output
the class value so the test behaves as expected.

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

2 years ago[WebIDL] Add support for serializers that have members that are themselves serializer...
commit-queue@webkit.org [Mon, 19 Jun 2017 21:55:00 +0000 (21:55 +0000)]
[WebIDL] Add support for serializers that have members that are themselves serializers (or inherit being a serializer from a parent)
https://bugs.webkit.org/show_bug.cgi?id=173395

Patch by Sam Weinig <sam@webkit.org> on 2017-06-19
Reviewed by Simon Fraser.

Source/WebCore:

Test: fast/css/DOMQuad-serialization.html

* bindings/scripts/CodeGenerator.pm:
(InheritsSerializable):
Helper to determine if an interface inherits from any interfaces
that are serializable. This is necessary because an attribute is
serializable even if its interface is not marked as serializable.

(IsSerializableAttribute):
Check ancestor interfaces as well to determine serializability.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateSerializerDefinition):
Specialize attributes that are serializable interfaces to call its interfaces
serialize function, thus allowing nested objects to be serialized.

* dom/DOMQuad.idl:
Add serializer.

* bindings/scripts/test/JS/JSTestSerialization.cpp:
* bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp: Added.
* bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.h: Added.
* bindings/scripts/test/TestSerialization.idl:
* bindings/scripts/test/TestSerializationIndirectInheritance.idl: Added.
Add and update tests.

LayoutTests:

* fast/css/DOMQuad-serialization-expected.txt: Added.
* fast/css/DOMQuad-serialization.html: Added.
Add test for DOMQuad serialization, now that it is supported.

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

2 years agoUnreviewed, rolling out r218505.
commit-queue@webkit.org [Mon, 19 Jun 2017 21:27:05 +0000 (21:27 +0000)]
Unreviewed, rolling out r218505.
https://bugs.webkit.org/show_bug.cgi?id=173563

"It would break internal builds" (Requested by youenn on
#webkit).

Reverted changeset:

"[WebRTC] Prevent capturing at unconventional resolutions when
using the SW encoder on Mac"
https://bugs.webkit.org/show_bug.cgi?id=172602
http://trac.webkit.org/changeset/218505

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

2 years agoOpening certain mails brings up a mail that grows indefinitely.
zalan@apple.com [Mon, 19 Jun 2017 21:22:56 +0000 (21:22 +0000)]
Opening certain mails brings up a mail that grows indefinitely.
https://bugs.webkit.org/show_bug.cgi?id=173562
<rdar://problem/32766579>

Reviewed by Tim Horton.

Source/WebCore:

This reverts the logic where m_autoSizeContentSize always reflects the final layout's.
When the ICB's height is 100%, it causes infinite recursion.
See also webkit.org/b/173561.

* page/FrameView.cpp:
(WebCore::FrameView::autoSizeIfEnabled):

Tools:

* TestWebKitAPI/Tests/WebKit2Cocoa/AutoLayoutIntegration.mm:
(TEST):

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

2 years ago[iOS DnD] Support .zip archives for file uploads via drag and drop
wenson_hsieh@apple.com [Mon, 19 Jun 2017 21:12:28 +0000 (21:12 +0000)]
[iOS DnD] Support .zip archives for file uploads via drag and drop
https://bugs.webkit.org/show_bug.cgi?id=173511
<rdar://problem/32521025>

Reviewed by Tim Horton.

Source/WebCore:

Allows dropped .zip archives to be uploaded as files by accepting types conforming to either
"public.zip-archive" or "public.content" as potential file types. Initially, I opted to accept the more general
"public.data" type; however, this includes UTIs such as "public.url" that should not be represented as files, so
this is a more targeted fix that allows us to very easily add additional content types in the future by adding
more types to supportedFileUploadPasteboardTypes.

Tests:
DataInteractionTests.ExternalSourceZIPArchiveToUploadArea
DataInteractionTests.ExternalSourceZIPArchiveAndURLToSingleFileInput

* page/mac/DragControllerMac.mm:
(WebCore::DragController::updateSupportedTypeIdentifiersForDragHandlingMethod):
* platform/Pasteboard.h:
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::read):
(WebCore::Pasteboard::supportedWebContentPasteboardTypes):
(WebCore::Pasteboard::supportedFileUploadPasteboardTypes):

Rename supportedPasteboardTypes to supportedWebContentPasteboardTypes, and also introduce
supportedFileUploadPasteboardTypes which returns an list of types, such that if a type conforms to any type in
this array, that type may be represented as a file. So far, this list contains "public.content" and
"public.zip-archive".

(WebCore::Pasteboard::types):
(WebCore::Pasteboard::supportedPasteboardTypes): Deleted.
* platform/ios/WebItemProviderPasteboard.mm:
(typeConformsToTypes):

Remove -typeIsAppropriateForSupportedTypes: and replace it with typeConformsToTypes. Use this both when
determining the number of files on the pasteboard, and when determining preferred UTIs to load when dropping.

(-[WebItemProviderPasteboard numberOfFiles]):
(-[WebItemProviderPasteboard typeIdentifierToLoadForRegisteredTypeIdentfiers:]):
(-[WebItemProviderPasteboard typeIsAppropriateForSupportedTypes:]): Deleted.
* platform/mac/DragDataMac.mm:
(WebCore::DragData::containsFiles):
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::supportedFileUploadPasteboardTypes):

Tools:

Adds tests for dropping .zip archives into a JavaScript-based file upload area, as well as into a file input.
Also verifies that URLs are not handled as file drops. See WebCore ChangeLog for more details.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/compressed-files.zip: Added.
* TestWebKitAPI/Tests/ios/DataInteractionTests.mm:
(testZIPArchive):
(TestWebKitAPI::TEST):

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

2 years ago[WebIDL] Remove custom binding for Document.getCSSCanvasContext()
commit-queue@webkit.org [Mon, 19 Jun 2017 21:01:19 +0000 (21:01 +0000)]
[WebIDL] Remove custom binding for Document.getCSSCanvasContext()
https://bugs.webkit.org/show_bug.cgi?id=173516

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

* bindings/js/JSDocumentCustom.cpp:
(WebCore::JSDocument::visitAdditionalChildren):
(WebCore::JSDocument::getCSSCanvasContext): Deleted.
* dom/Document.cpp:
(WebCore::Document::getCSSCanvasContext):
* dom/Document.h:
* dom/Document.idl:
Use a Variant to pass the context and type to the bindings.

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

2 years agoUnreviewed, rolling out r218503.
ryanhaddad@apple.com [Mon, 19 Jun 2017 20:54:14 +0000 (20:54 +0000)]
Unreviewed, rolling out r218503.

This change broke the macOS Sierra build.

Reverted changeset:

"Removed unused lambda captures from WebKit2"
https://bugs.webkit.org/show_bug.cgi?id=173555
http://trac.webkit.org/changeset/218503

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

2 years ago[WebRTC] Prevent capturing at unconventional resolutions when using the SW encoder...
commit-queue@webkit.org [Mon, 19 Jun 2017 20:42:04 +0000 (20:42 +0000)]
[WebRTC] Prevent capturing at unconventional resolutions when using the SW encoder on Mac
https://bugs.webkit.org/show_bug.cgi?id=172602
<rdar://problem/32407693>

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

Source/ThirdParty/libwebrtc:

Adding a parameter to disable hardware encoder.

* Source/webrtc/sdk/objc/Framework/Classes/h264_video_toolbox_encoder.h:
* Source/webrtc/sdk/objc/Framework/Classes/h264_video_toolbox_encoder.mm:
(webrtc::H264VideoToolboxEncoder::CreateCompressionSession):

Source/WebCore:

Test: platform/mac/webrtc/captureCanvas-webrtc-software-encoder.html

Add internal API to switch on/off hardware H264 encoder.
Add checks for standard size. If using a software encoder and frame size is not standard,
the session is destroyed and no frame is sent at all.

Added tests based on captureStream.
Fixed the case of capturing a canvas which size is changing.

* Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
(WebCore::CanvasCaptureMediaStreamTrack::Source::canvasResized):
* platform/mediastream/libwebrtc/H264VideoToolBoxEncoder.h:
* platform/mediastream/libwebrtc/H264VideoToolBoxEncoder.mm:
(WebCore::H264VideoToolboxEncoder::setHardwareEncoderForWebRTCAllowed):
(WebCore::H264VideoToolboxEncoder::hardwareEncoderForWebRTCAllowed):
(WebCore::isUsingSoftwareEncoder):
(WebCore::H264VideoToolboxEncoder::CreateCompressionSession):
(isStandardFrameSize): Added.
(isUsingSoftwareEncoder): Added.
* testing/Internals.cpp:
(WebCore::Internals::setH264HardwareEncoderAllowed):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* platform/mac-wk1/TestExpectations: Mark captureCanvas as flaky due to AVDCreateGPUAccelerator: Error loading GPU renderer" appearing on some bots.
* platform/mac/webrtc/captureCanvas-webrtc-software-encoder-expected.txt: Copied from LayoutTests/webrtc/captureCanvas-webrtc-expected.txt.
* platform/mac/webrtc/captureCanvas-webrtc-software-encoder.html: Added.
* webrtc/captureCanvas-webrtc-expected.txt:
* webrtc/captureCanvas-webrtc.html:

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

2 years ago[iOS DnD] [WK2] Add an internal hook to change the drag lift delay
wenson_hsieh@apple.com [Mon, 19 Jun 2017 20:25:50 +0000 (20:25 +0000)]
[iOS DnD] [WK2] Add an internal hook to change the drag lift delay
https://bugs.webkit.org/show_bug.cgi?id=173523
<rdar://problem/32224510>

Reviewed by Tim Horton.

Add a new private property on WKWebViewConfiguration, _dragLiftDelay, for changing the UIDragInteraction's lift
delay to one of three values: short, medium or long. The short setting simply uses UIKit's default drag lift
delay (at the time of writing, this is 325ms); medium and long are 500ms and 650ms, respectively.

In combination with an internal switch to toggle between lift delays, the purpose of this change is to make it
easier to choose a drag lift delay for web content that doesn't easily cause unintended dragging while panning.

* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(toDragLiftDelay):

Converts an integer (e.g. retrieved from user defaults) to a drag lift delay type.

(-[WKWebViewConfiguration init]):
(-[WKWebViewConfiguration encodeWithCoder:]):
(-[WKWebViewConfiguration initWithCoder:]):
(-[WKWebViewConfiguration copyWithZone:]):
(-[WKWebViewConfiguration _dragLiftDelay]):

Add boilerplate plumbing for the _dragLiftDelay setting.

(-[WKWebViewConfiguration _setDragLiftDelay:]):
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:

Add _dragLiftDelay to as a private property of WKWebViewConiguration.

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

Convert the web view configuration's _WKDragLiftDelay to an actual time interval.

(-[WKContentView setupDataInteractionDelegates]):

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

2 years agoRemoved unused lambda captures from WebKit2
annulen@yandex.ru [Mon, 19 Jun 2017 20:14:54 +0000 (20:14 +0000)]
Removed unused lambda captures from WebKit2
https://bugs.webkit.org/show_bug.cgi?id=173555

Reviewed by Alex Christensen.

* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::fetchWebsiteData):
(WebKit::NetworkProcessProxy::deleteWebsiteData):
(WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::fetchWebsiteData):
(WebKit::WebProcessProxy::deleteWebsiteData):
(WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::topPrivatelyControlledDomainsWithWebsiteData):

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

2 years agoCleanup IconLoader stuff when a DocumentLoader detaches from its frame.
beidson@apple.com [Mon, 19 Jun 2017 20:12:41 +0000 (20:12 +0000)]
Cleanup IconLoader stuff when a DocumentLoader detaches from its frame.
<rdar://problem/31418761> and https://bugs.webkit.org/show_bug.cgi?id=173473

Reviewed by Alex Christensen.

No new tests (No known change in behavior)

I discovered the need to make these changes here due to a transient bug
introduced in r218015 but already explicitly fixed in r218409.

This change adds an assert to guard against a detached DocumentLoader having active IconLoaders.

It also clears out all pending IconLoader and icon load decisions when stopLoading() is called,
as even attempting to start an icon load after detachment is a waste of cycles.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::stopLoading): Also explicitly clear all IconLoaders and icons pending
  load decision.
(WebCore::DocumentLoader::finishedLoadingIcon): Assert that this DocumentLoader is not detached.

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

2 years agoUse WTF::Function instead of std::function in more places in WebCore/
cdumez@apple.com [Mon, 19 Jun 2017 19:53:16 +0000 (19:53 +0000)]
Use WTF::Function instead of std::function in more places in WebCore/
https://bugs.webkit.org/show_bug.cgi?id=173535

Reviewed by Antti Koivisto.

Use WTF::Function instead of std::function in more places in WebCore/ to avoid copying.

Source/WebCore:

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::matchedParent):
* accessibility/AccessibilityObject.h:
* animation/DocumentAnimation.cpp:
(WebCore::DocumentAnimation::getAnimations):
* animation/DocumentAnimation.h:
(WebCore::DocumentAnimation::getAnimations):
* contentextensions/CombinedURLFilters.cpp:
(WebCore::ContentExtensions::CombinedURLFilters::processNFAs):
* contentextensions/CombinedURLFilters.h:
* contentextensions/DFACombiner.cpp:
(WebCore::ContentExtensions::DFACombiner::combineDFAs):
* contentextensions/DFACombiner.h:
* css/CSSCrossfadeValue.cpp:
(WebCore::CSSCrossfadeValue::traverseSubresources):
* css/CSSCrossfadeValue.h:
* css/CSSFilterImageValue.cpp:
(WebCore::CSSFilterImageValue::traverseSubresources):
* css/CSSFilterImageValue.h:
* css/CSSFontFaceSrcValue.cpp:
(WebCore::CSSFontFaceSrcValue::traverseSubresources):
* css/CSSFontFaceSrcValue.h:
* css/CSSImageSetValue.cpp:
(WebCore::CSSImageSetValue::traverseSubresources):
* css/CSSImageSetValue.h:
* css/CSSImageValue.cpp:
(WebCore::CSSImageValue::traverseSubresources):
* css/CSSImageValue.h:
* css/CSSValue.cpp:
(WebCore::CSSValue::traverseSubresources):
* css/CSSValue.h:
* css/CSSValueList.cpp:
(WebCore::CSSValueList::traverseSubresources):
* css/CSSValueList.h:
* css/StyleProperties.cpp:
(WebCore::StyleProperties::traverseSubresources):
* css/StyleProperties.h:
* css/StyleSheetContents.cpp:
(WebCore::traverseSubresourcesInRules):
(WebCore::StyleSheetContents::traverseSubresources):
* css/StyleSheetContents.h:
* dom/Element.cpp:
(WebCore::Element::getAnimations):
* editing/TextIterator.cpp:
(WebCore::findPlainTextMatches):
(WebCore::findClosestPlainText):
(WebCore::findPlainText):
* editing/mac/DictionaryLookup.h:
* editing/mac/DictionaryLookup.mm:
(WebCore::showPopupOrCreateAnimationController):
(WebCore::DictionaryLookup::showPopup):
(WebCore::DictionaryLookup::animationControllerForPopup):
* fileapi/AsyncFileStream.cpp:
(WebCore::AsyncFileStream::perform):
(WebCore::AsyncFileStream::getSize):
(WebCore::AsyncFileStream::openForRead):
(WebCore::AsyncFileStream::read):
* fileapi/AsyncFileStream.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::waitForPreparedForInlineThen):
(WebCore::HTMLMediaElement::setVideoFullscreenLayer):
* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::waitForPreparedForInlineThen):
(WebCore::HTMLMediaElement::setVideoFullscreenLayer):
* loader/EmptyClients.cpp:
(WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
(WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
(WebCore::EmptyFrameLoaderClient::dispatchWillSubmitForm):
* loader/FrameLoaderClient.h:
* loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::LegacyWebArchive::create):
* loader/archive/cf/LegacyWebArchive.h:
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::forEachResource):
(WebCore::MemoryCache::forEachSessionResource):
* loader/cache/MemoryCache.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::createWindow):
(WebCore::DOMWindow::showModalDialog):
* page/DOMWindow.h:
* page/FrameView.cpp:
(WebCore::FrameView::applyRecursivelyWithVisibleRect):
* page/FrameView.h:
* page/Page.cpp:
(WebCore::Page::forEachPage):
(WebCore::Page::decrementNestedRunLoopCount):
(WebCore::Page::whenUnnested):
* page/Page.h:
* page/WheelEventTestTrigger.cpp:
(WebCore::WheelEventTestTrigger::clearAllTestDeferrals):
(WebCore::WheelEventTestTrigger::setTestCallbackAndStartNotificationTimer):
(WebCore::WheelEventTestTrigger::triggerTestTimerFired):
* page/WheelEventTestTrigger.h:
* page/WindowFeatures.cpp:
(WebCore::processFeaturesString):
* page/WindowFeatures.h:
* page/cocoa/ResourceUsageOverlayCocoa.mm:
(WebCore::RingBuffer::forEach):
* platform/cocoa/WebVideoFullscreenModelVideoElement.h:
(WebCore::WebVideoFullscreenModelVideoElement::setVideoFullscreenLayer):
(WebCore::WebVideoFullscreenModelVideoElement::waitForPreparedForInlineThen):
* platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
(WebVideoFullscreenModelVideoElement::setVideoFullscreenLayer):
(WebVideoFullscreenModelVideoElement::waitForPreparedForInlineThen):
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::setVideoFullscreenLayer):
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayer::setVideoFullscreenLayer):
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::setVideoFullscreenLayer):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVideoFullscreenLayer):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVideoFullscreenLayer):
* platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.h:
* platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm:
(WebCore::VideoFullscreenLayerManager::setVideoFullscreenLayer):

Source/WebKit/mac:

* WebCoreSupport/WebFrameLoaderClient.h:
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::dispatchDecidePolicyForResponse):
(WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
(WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
(WebFrameLoaderClient::dispatchWillSubmitForm):
(WebFrameLoaderClient::setUpPolicyListener):
(-[WebFramePolicyListener initWithFrame:policyFunction:]):
(-[WebFramePolicyListener initWithFrame:policyFunction:appLinkURL:]):

Source/WebKit/win:

* WebCoreSupport/WebFrameLoaderClient.cpp:
(WebFrameLoaderClient::dispatchDecidePolicyForResponse):
(WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
(WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
(WebFrameLoaderClient::dispatchWillSubmitForm):
(WebFrameLoaderClient::setUpPolicyListener):
(WebFrameLoaderClient::receivedPolicyDecision):
* WebCoreSupport/WebFrameLoaderClient.h:

Source/WebKit2:

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
(WebKit::WebFrameLoaderClient::dispatchWillSubmitForm):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::setUpPolicyListener):
(WebKit::WebFrame::invalidatePolicyListener):
* WebProcess/WebPage/WebFrame.h:

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

2 years agoRebaseline js/dom/global-constructors-attributes.html.
ryanhaddad@apple.com [Mon, 19 Jun 2017 18:41:42 +0000 (18:41 +0000)]
Rebaseline js/dom/global-constructors-attributes.html.

Unreviewed test gardening.

* platform/mac-elcapitan/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt:

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

2 years ago[WK2] Add WKProcessPool SPI to efficiently reset all plugin load client policies
cdumez@apple.com [Mon, 19 Jun 2017 18:21:58 +0000 (18:21 +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 Antti Koivisto.

Follow-up to r218419 to avoid copying the HashMap unnecessarily.

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::resetPluginLoadClientPolicies):
* UIProcess/WebProcessPool.h:

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

2 years agoUse WTF::Function instead of std::function in WebCore/Modules
cdumez@apple.com [Mon, 19 Jun 2017 17:44:20 +0000 (17:44 +0000)]
Use WTF::Function instead of std::function in WebCore/Modules
https://bugs.webkit.org/show_bug.cgi?id=173534

Reviewed by Alex Christensen.

Use WTF::Function instead of std::function in WebCore/Modules to avoid
copying.

* Modules/applepay/PaymentCoordinatorClient.h:
* Modules/encryptedmedia/CDM.h:
* Modules/encryptedmedia/legacy/LegacyCDM.cpp:
(WebCore::CDMFactory::CDMFactory):
(WebCore::CDM::registerCDMFactory):
* Modules/encryptedmedia/legacy/LegacyCDM.h:
* Modules/mediasession/MediaSession.cpp:
(WebCore::MediaSession::changeActiveMediaElements):
(WebCore::MediaSession::safelyIterateActiveMediaElements):
* Modules/mediasession/MediaSession.h:
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::matchTransceiver):
* Modules/mediastream/MediaStreamRegistry.cpp:
(WebCore::MediaStreamRegistry::forEach):
* Modules/mediastream/MediaStreamRegistry.h:

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

2 years agoA cloned MediaStreamTrack should mute independently other tracks using the same source
commit-queue@webkit.org [Mon, 19 Jun 2017 17:12:57 +0000 (17:12 +0000)]
A cloned MediaStreamTrack should mute independently other tracks using the same source
https://bugs.webkit.org/show_bug.cgi?id=172831
<rdar://problem/32518527>

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

Source/WebCore:

Test: webrtc/clone-audio-track.html

Move enabled handling in MediaStreamTrackPrivate instead of RealtimeMediaSource.
Move WebRTC and WebAudio customers of RealtimeMediaSource to MediaStreamTrackPrivate.
Move creation of WebAudio provider to MediaStreamTrackPrivate.

This allows changing some parameters of tracks having the same source independently.
Using this for enabled track attribute.

We no longer stop generating frames in case track is disabled.
This should be added back as an optimization in a follow-up.

* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::addTrack):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::replaceTrack):
* Modules/webaudio/MediaStreamAudioSource.cpp:
* Modules/webaudio/MediaStreamAudioSource.h:
* WebCore.xcodeproj/project.pbxproj:
* platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::create):
(WebCore::MediaStreamTrackPrivate::~MediaStreamTrackPrivate):
(WebCore::MediaStreamTrackPrivate::setEnabled):
(WebCore::MediaStreamTrackPrivate::audioSourceProvider):
(WebCore::MediaStreamTrackPrivate::videoSampleAvailable):
(WebCore::MediaStreamTrackPrivate::audioSamplesAvailable):
* platform/mediastream/MediaStreamTrackPrivate.h:
(WebCore::MediaStreamTrackPrivate::Observer::audioSamplesAvailable):
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::removeObserver):
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/mac/AVMediaCaptureSource.h:
* platform/mediastream/mac/AVMediaCaptureSource.mm:
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioCaptureSource::startProducingData):
(WebCore::CoreAudioCaptureSource::stopProducingData):
* platform/mediastream/mac/CoreAudioCaptureSource.h:
* platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
* platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
(WebCore::MockRealtimeAudioSourceMac::render):
* platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
(WebCore::RealtimeIncomingAudioSource::~RealtimeIncomingAudioSource):
(WebCore::RealtimeIncomingAudioSource::OnData):
* platform/mediastream/mac/RealtimeIncomingAudioSource.h:
* platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
(WebCore::RealtimeIncomingVideoSource::pixelBufferFromVideoFrame):
* platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
(WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource):
(WebCore::RealtimeOutgoingAudioSource::setSource):
* platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
* platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
(WebCore::RealtimeOutgoingVideoSource::RealtimeOutgoingVideoSource):
(WebCore::RealtimeOutgoingVideoSource::setSource):
(WebCore::RealtimeOutgoingVideoSource::initializeFromSource):
* platform/mediastream/mac/RealtimeOutgoingVideoSource.h:
* platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h:
* platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
(WebCore::WebAudioSourceProviderAVFObjC::create):
(WebCore::WebAudioSourceProviderAVFObjC::WebAudioSourceProviderAVFObjC):
(WebCore::WebAudioSourceProviderAVFObjC::setClient):
(WebCore::WebAudioSourceProviderAVFObjC::audioSamplesAvailable):
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::generateFrame):
* platform/spi/cocoa/PassKitSPI.h:

Source/WebKit2:

* WebProcess/cocoa/UserMediaCaptureManager.cpp:
(WebKit::UserMediaCaptureManager::Source::setStorage):

LayoutTests:

* webrtc/clone-audio-track.html: Added.
* webrtc/video-disabled-black.html:
* webrtc/video-unmute-expected.txt:
* webrtc/video-unmute.html:

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

2 years agoFix Ref to deref before assignment, add tests for this to RefPtr, Ref, Function
darin@apple.com [Mon, 19 Jun 2017 17:01:14 +0000 (17:01 +0000)]
Fix Ref to deref before assignment, add tests for this to RefPtr, Ref, Function
https://bugs.webkit.org/show_bug.cgi?id=173526

Reviewed by Sam Weinig.

Source/WTF:

* wtf/Ref.h: Changed operator= to not be defined inside the class definition.
Added swap functions. Changed operator= implementations to use swap in the
conventional manner, the same way that RefPtr does.

Tools:

* TestWebKitAPI/CMakeLists.txt: Added Function.cpp.
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: Ditto.

* TestWebKitAPI/Tests/WTF/Function.cpp: Added. Contains basic tests and some
tests for assignment before destruction ones.

* TestWebKitAPI/Tests/WTF/MoveOnly.h: Added a () operator so this can be used
as a function, so it can be used in WTF::Function tests.

* TestWebKitAPI/Tests/WTF/Ref.cpp: Use EXPECT macros insead of ASSERT.
Added tests for swap and for assignment before deref.

* TestWebKitAPI/Tests/WTF/RefLogger.cpp: Stopped using inlining; no good reason
to inline everything. Also removed the unnecessary clearing of the log every time
the DerivedRefLogger constructor is called.
* TestWebKitAPI/Tests/WTF/RefLogger.h: Ditto.

* TestWebKitAPI/Tests/WTF/RefPtr.cpp: Use EXPECT macros instead of ASSERT.
Added tests for assignment before deref and similar for releaseNonNull.

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

2 years ago[WebIDL] Properly model buffer source / typed arrays as their own IDL types
commit-queue@webkit.org [Mon, 19 Jun 2017 16:47:06 +0000 (16:47 +0000)]
[WebIDL] Properly model buffer source / typed arrays as their own IDL types
https://bugs.webkit.org/show_bug.cgi?id=173513

Patch by Sam Weinig <sam@webkit.org> on 2017-06-19
Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

* web-platform-tests/WebCryptoAPI/derive_bits_keys/hkdf.worker-expected.txt:
* web-platform-tests/WebCryptoAPI/derive_bits_keys/test_hkdf.https-expected.txt:
Update results for changed exception language.

Source/WebCore:

- Adds IDL type hierarchy for buffer source types.
- Includes a special type, IDLArrayBufferView, which WebIDL defines as the union
  of DataView and all the typed array types, but we model as shared base class.
  This should not be observable, and allows us to avoid using a Variant for ArrayBufferView
  and instead use the existing base class.
- Add builtin typedefs for BufferSource and DOMTimeStamp as defined in WebIDL. As noted
  above, rather than define a typedef of ArrayBufferView that maps to a union, we treat
  it as a special type.

* bindings/IDLTypes.h:
Add type hierarchy for buffer source types.
- IDLBufferSource is the root
- IDLArrayBuffer, IDLArrayBufferView, IDLDataView, IDLTypedArray derive from it.
- And then the specific typed array types derive from IDLTypedArray, and are defined
  in JSDOMConvertBufferSource so we don't have to include a ton of typed array includes
  in this file, as they cannot be forward declared.

* bindings/js/JSDOMConvertBufferSource.h:
(WebCore::Detail::BufferSourceConverter::convert):
(WebCore::Converter<IDLArrayBuffer>::convert):
(WebCore::JSConverter<IDLArrayBuffer>::convert):
(WebCore::Converter<IDLDataView>::convert):
(WebCore::JSConverter<IDLDataView>::convert):
(WebCore::Converter<IDLInt8Array>::convert):
(WebCore::JSConverter<IDLInt8Array>::convert):
(WebCore::Converter<IDLInt16Array>::convert):
(WebCore::JSConverter<IDLInt16Array>::convert):
(WebCore::Converter<IDLInt32Array>::convert):
(WebCore::JSConverter<IDLInt32Array>::convert):
(WebCore::Converter<IDLUint8Array>::convert):
(WebCore::JSConverter<IDLUint8Array>::convert):
(WebCore::Converter<IDLUint16Array>::convert):
(WebCore::JSConverter<IDLUint16Array>::convert):
(WebCore::Converter<IDLUint32Array>::convert):
(WebCore::JSConverter<IDLUint32Array>::convert):
(WebCore::Converter<IDLUint8ClampedArray>::convert):
(WebCore::JSConverter<IDLUint8ClampedArray>::convert):
(WebCore::Converter<IDLFloat32Array>::convert):
(WebCore::JSConverter<IDLFloat32Array>::convert):
(WebCore::Converter<IDLFloat64Array>::convert):
(WebCore::JSConverter<IDLFloat64Array>::convert):
(WebCore::Converter<IDLArrayBufferView>::convert):
(WebCore::JSConverter<IDLArrayBufferView>::convert):
Add native and javascript conversion for all the new types.

* bindings/js/JSDOMConvertUnion.h:
Add support for steps 7, 8, and 9 of the union conversion algorithm now that
buffer source types are properly modeled.

* bindings/js/JSSubtleCryptoCustom.cpp:
* bindings/js/JSWebKitSubtleCryptoCustom.cpp:
Replace use of now repurposed IDLBufferSource, with its definition, IDLUnion<IDLArrayBufferView, IDLArrayBuffer>.

* bindings/scripts/CodeGenerator.pm:
(IsBufferSourceType):
Renamed from IsTypedArrayType.

(IsNonPointerType): Deleted.
Was only used by DumpRenderTree and WebKitTestRunner generators. They have
been switched to the equivalent IsPrimitiveType.

(IsTypedArrayType): Deleted.
Renamed to IsBufferSourceType.

(IsRefPtrType): Deleted. Unused.

* bindings/scripts/CodeGeneratorJS.pm:
(AddToIncludesForIDLType):
(AddClassForwardIfNeeded):
(GetArgumentExceptionFunction):
(GetAttributeExceptionFunction):
(PassArgumentExpression):
(GenerateDefaultValue):
(GenerateOverloadDispatcher):
(ShouldPassArgumentByReference):
(NativeToJSValueDOMConvertNeedsState):
(NativeToJSValueDOMConvertNeedsGlobalObject):
Update for rename of IsTypedArrayType -> IsBufferSourceType and remove specialized BufferSource
condition.

(GetBaseIDLType):
Add mappings for new buffer source types.

* bindings/scripts/IDLParser.pm:
(Parse):
Insert builtin typedefs to the typedef map before parsing.

(addBuiltinTypedefs):
Generate typedefs for BufferSource and DOMTimeStamp as specified by WebIDL.

(applyTypedefs):
Add support for applying typedefs to iterable and maplike, necessary now because BufferSource
is used as the key to iterable in MediaKeyStatusMap.idl

* bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
* bindings/scripts/test/JS/JSTestCallbackInterface.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
* bindings/scripts/test/JS/JSTestVoidCallbackFunction.cpp:
* bindings/scripts/test/JS/JSTestVoidCallbackFunction.h:
Update test results.

* bindings/scripts/test/TestTypedefs.idl:
Add tests for builtin typedefs.

* Modules/geolocation/Geoposition.idl:
* dom/Event.idl:
* fileapi/Blob.idl:
* fileapi/File.idl:
* page/FrameView.h:
* xml/XMLHttpRequest.idl:
Remove typedef for DOMTimeStamp and BufferSource which are now automatically included.

Tools:

* DumpRenderTree/Bindings/CodeGeneratorDumpRenderTree.pm:
* WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm:
Replace IsNonPointerType subroutine with IsPrimitiveType so we can remove IsNonPointerType.

LayoutTests:

* crypto/subtle/aes-cbc-cfb-encrypt-malformed-parameters-expected.txt:
* crypto/subtle/hkdf-derive-bits-malformed-parametrs-expected.txt:
* crypto/subtle/pbkdf2-derive-bits-malformed-parametrs-expected.txt:
Update results for changed exception language.

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

2 years ago[Win] fast/dom/assign-to-window-status.html is flaky.
pvollan@apple.com [Mon, 19 Jun 2017 16:34:44 +0000 (16:34 +0000)]
[Win] fast/dom/assign-to-window-status.html is flaky.
https://bugs.webkit.org/show_bug.cgi?id=173512

Reviewed by Alex Christensen.

We should not dump status callbacks when test is done.

* DumpRenderTree/win/UIDelegate.cpp:
(UIDelegate::setStatusText):

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

2 years agoUnreviewed GTK+ gardening
csaavedra@igalia.com [Mon, 19 Jun 2017 15:50:40 +0000 (15:50 +0000)]
Unreviewed GTK+ gardening

Unmarked a bunch of http multimedia tests that were failing with gst 1.6.3.
We're now depending on 1.10.4 and these are passing. Also marked as slow
a couple more.
* platform/gtk/TestExpectations:

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

2 years agoUnreviewed GTK+ gardening.
zandobersek@gmail.com [Mon, 19 Jun 2017 13:22:19 +0000 (13:22 +0000)]
Unreviewed GTK+ gardening.

Enable RSA-PSS tests on the GTK+ port. Tests covering this Web Crypto
algorithm are skipped on all platforms, but since the libgcrypt-based
implementation is operating properly, we can enable the majority of
these tests for GTK+. The tests that remain skipped cover SPKI and
PKCS#8 import and export capabilities that still have to be landed.

WPE will enable these tests in a separate patch.

* platform/gtk/TestExpectations:

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

2 years ago[WPE][JHBuild] Update WPEBackend-mesa
clopez@igalia.com [Mon, 19 Jun 2017 13:09:45 +0000 (13:09 +0000)]
[WPE][JHBuild] Update WPEBackend-mesa
https://bugs.webkit.org/show_bug.cgi?id=173433

Unreviewed.

Update WPEBackend-mesa back (like it was done originally in r218344)
after fixing the issue with the DISPLAY environment variables that
caused the crashes.

* wpe/jhbuild.modules:

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

2 years agoRename unit test file after r218482
clopez@igalia.com [Mon, 19 Jun 2017 13:01:18 +0000 (13:01 +0000)]
Rename unit test file after r218482
https://bugs.webkit.org/show_bug.cgi?id=173483

Unreviewed.

* Scripts/webkitpy/port/waylanddriver_unittest.py: Renamed from Tools/Scripts/webkitpy/port/wayland_unittest.py.

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

2 years agoUnreviewed. Fix wrong style checker condition added in r218487.
carlosgc@webkit.org [Mon, 19 Jun 2017 12:54:21 +0000 (12:54 +0000)]
Unreviewed. Fix wrong style checker condition added in r218487.

* Scripts/webkitpy/style/checkers/cpp.py:
(check_identifier_name_in_declaration):

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

2 years agoMissing <functional> includes make builds fail with GCC 7.x
aperez@igalia.com [Mon, 19 Jun 2017 12:51:51 +0000 (12:51 +0000)]
Missing <functional> includes make builds fail with GCC 7.x
https://bugs.webkit.org/show_bug.cgi?id=173544

Unreviewed gardening.

Fix compilation with GCC 7.

Source/JavaScriptCore:

* API/tests/CompareAndSwapTest.cpp:
* runtime/VMEntryScope.h:

Source/WebCore:

* Modules/mediastream/MediaStreamRegistry.h:
* animation/DocumentAnimation.h:
* page/WheelEventTestTrigger.h:
* page/csp/ContentSecurityPolicy.h:
* platform/Timer.h:
* platform/graphics/gstreamer/MainThreadNotifier.h:
* platform/network/NetworkStorageSession.h:

Tools:

* TestWebKitAPI/Tests/WTF/HashSet.cpp:
* TestWebKitAPI/Tests/WebKit2Gtk/WebProcessTest.h:

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

2 years ago[GTK] Move GTK+ API files that could be shared to glib dirs
carlosgc@webkit.org [Mon, 19 Jun 2017 12:45:19 +0000 (12:45 +0000)]
[GTK] Move GTK+ API files that could be shared to glib dirs
https://bugs.webkit.org/show_bug.cgi?id=173545

Reviewed by Žan Doberšek.

Source/WebCore/platform/gtk/po:

Update paths on files with translatable string.

* POTFILES.in:

Source/WebKit2:

Most of the files don't use GTK+ at all, or only for a few things that could be ifdefed. Public headers can
never be shared, so move only private headers and cpp files. This patch moves the files without any
modification to make everything easier, in follow up commits we will add the required ifdefs and refactorings to
ensure the code can actually be shared.

* PlatformGTK.cmake:
* Shared/API/glib/WebKitContextMenu.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitContextMenu.cpp.
* Shared/API/glib/WebKitContextMenuActions.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuActions.cpp.
* Shared/API/glib/WebKitContextMenuActionsPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuActionsPrivate.h.
* Shared/API/glib/WebKitContextMenuItem.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItem.cpp.
* Shared/API/glib/WebKitContextMenuItemPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItemPrivate.h.
* Shared/API/glib/WebKitContextMenuPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuPrivate.h.
* Shared/API/glib/WebKitHitTestResult.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResult.cpp.
* Shared/API/glib/WebKitHitTestResultPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResultPrivate.h.
* Shared/API/glib/WebKitURIRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitURIRequest.cpp.
* Shared/API/glib/WebKitURIRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitURIRequestPrivate.h.
* Shared/API/glib/WebKitURIResponse.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitURIResponse.cpp.
* Shared/API/glib/WebKitURIResponsePrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitURIResponsePrivate.h.
* UIProcess/API/glib/WebKitAuthenticationRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitAuthenticationRequest.cpp.
* UIProcess/API/glib/WebKitAuthenticationRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitAuthenticationRequestPrivate.h.
* UIProcess/API/glib/WebKitAutomationSession.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitAutomationSession.cpp.
* UIProcess/API/glib/WebKitAutomationSessionPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitAutomationSessionPrivate.h.
* UIProcess/API/glib/WebKitBackForwardList.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardList.cpp.
* UIProcess/API/glib/WebKitBackForwardListItem.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardListItem.cpp.
* UIProcess/API/glib/WebKitBackForwardListPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardListPrivate.h.
* UIProcess/API/glib/WebKitContextMenuClient.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuClient.cpp.
* UIProcess/API/glib/WebKitContextMenuClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuClient.h.
* UIProcess/API/glib/WebKitCookieManager.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitCookieManager.cpp.
* UIProcess/API/glib/WebKitCookieManagerPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitCookieManagerPrivate.h.
* UIProcess/API/glib/WebKitCredential.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitCredential.cpp.
* UIProcess/API/glib/WebKitCredentialPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitCredentialPrivate.h.
* UIProcess/API/glib/WebKitCustomProtocolManagerClient.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitCustomProtocolManagerClient.cpp.
* UIProcess/API/glib/WebKitCustomProtocolManagerClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitCustomProtocolManagerClient.h.
* UIProcess/API/glib/WebKitDownload.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitDownload.cpp.
* UIProcess/API/glib/WebKitDownloadClient.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitDownloadClient.cpp.
* UIProcess/API/glib/WebKitDownloadClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitDownloadClient.h.
* UIProcess/API/glib/WebKitDownloadPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitDownloadPrivate.h.
* UIProcess/API/glib/WebKitEditorState.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitEditorState.cpp.
* UIProcess/API/glib/WebKitEditorStatePrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitEditorStatePrivate.h.
* UIProcess/API/glib/WebKitError.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitError.cpp.
* UIProcess/API/glib/WebKitFaviconDatabase.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFaviconDatabase.cpp.
* UIProcess/API/glib/WebKitFaviconDatabasePrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFaviconDatabasePrivate.h.
* UIProcess/API/glib/WebKitFileChooserRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFileChooserRequest.cpp.
* UIProcess/API/glib/WebKitFileChooserRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFileChooserRequestPrivate.h.
* UIProcess/API/glib/WebKitFindController.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFindController.cpp.
* UIProcess/API/glib/WebKitFormClient.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFormClient.cpp.
* UIProcess/API/glib/WebKitFormClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFormClient.h.
* UIProcess/API/glib/WebKitFormSubmissionRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFormSubmissionRequest.cpp.
* UIProcess/API/glib/WebKitFormSubmissionRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFormSubmissionRequestPrivate.h.
* UIProcess/API/glib/WebKitGeolocationPermissionRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationPermissionRequest.cpp.
* UIProcess/API/glib/WebKitGeolocationPermissionRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationPermissionRequestPrivate.h.
* UIProcess/API/glib/WebKitGeolocationProvider.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationProvider.cpp.
* UIProcess/API/glib/WebKitGeolocationProvider.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationProvider.h.
* UIProcess/API/glib/WebKitInjectedBundleClient.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitInjectedBundleClient.cpp.
* UIProcess/API/glib/WebKitInjectedBundleClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitInjectedBundleClient.h.
* UIProcess/API/glib/WebKitInstallMissingMediaPluginsPermissionRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitInstallMissingMediaPluginsPermissionRequest.cpp.
* UIProcess/API/glib/WebKitInstallMissingMediaPluginsPermissionRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitInstallMissingMediaPluginsPermissionRequestPrivate.h.
* UIProcess/API/glib/WebKitJavascriptResult.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitJavascriptResult.cpp.
* UIProcess/API/glib/WebKitJavascriptResultPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitJavascriptResultPrivate.h.
* UIProcess/API/glib/WebKitLoaderClient.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp.
* UIProcess/API/glib/WebKitLoaderClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.h.
* UIProcess/API/glib/WebKitMimeInfo.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitMimeInfo.cpp.
* UIProcess/API/glib/WebKitMimeInfoPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitMimeInfoPrivate.h.
* UIProcess/API/glib/WebKitNavigationAction.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNavigationAction.cpp.
* UIProcess/API/glib/WebKitNavigationActionPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNavigationActionPrivate.h.
* UIProcess/API/glib/WebKitNavigationPolicyDecision.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNavigationPolicyDecision.cpp.
* UIProcess/API/glib/WebKitNavigationPolicyDecisionPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNavigationPolicyDecisionPrivate.h.
* UIProcess/API/glib/WebKitNetworkProxySettings.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNetworkProxySettings.cpp.
* UIProcess/API/glib/WebKitNetworkProxySettingsPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNetworkProxySettingsPrivate.h.
* UIProcess/API/glib/WebKitNotification.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNotification.cpp.
* UIProcess/API/glib/WebKitNotificationPermissionRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNotificationPermissionRequest.cpp.
* UIProcess/API/glib/WebKitNotificationPermissionRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNotificationPermissionRequestPrivate.h.
* UIProcess/API/glib/WebKitNotificationPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNotificationPrivate.h.
* UIProcess/API/glib/WebKitNotificationProvider.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNotificationProvider.cpp.
* UIProcess/API/glib/WebKitNotificationProvider.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNotificationProvider.h.
* UIProcess/API/glib/WebKitPermissionRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPermissionRequest.cpp.
* UIProcess/API/glib/WebKitPlugin.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPlugin.cpp.
* UIProcess/API/glib/WebKitPluginPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPluginPrivate.h.
* UIProcess/API/glib/WebKitPolicyClient.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPolicyClient.cpp.
* UIProcess/API/glib/WebKitPolicyClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPolicyClient.h.
* UIProcess/API/glib/WebKitPolicyDecision.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPolicyDecision.cpp.
* UIProcess/API/glib/WebKitPolicyDecisionPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPolicyDecisionPrivate.h.
* UIProcess/API/glib/WebKitPrivate.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.cpp.
* UIProcess/API/glib/WebKitPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h.
* UIProcess/API/glib/WebKitResponsePolicyDecision.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitResponsePolicyDecision.cpp.
* UIProcess/API/glib/WebKitResponsePolicyDecisionPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitResponsePolicyDecisionPrivate.h.
* UIProcess/API/glib/WebKitScriptDialog.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitScriptDialog.cpp.
* UIProcess/API/glib/WebKitScriptDialogPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitScriptDialogPrivate.h.
* UIProcess/API/glib/WebKitSecurityManager.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitSecurityManager.cpp.
* UIProcess/API/glib/WebKitSecurityManagerPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitSecurityManagerPrivate.h.
* UIProcess/API/glib/WebKitSecurityOrigin.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitSecurityOrigin.cpp.
* UIProcess/API/glib/WebKitSecurityOriginPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitSecurityOriginPrivate.h.
* UIProcess/API/glib/WebKitSettings.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp.
* UIProcess/API/glib/WebKitSettingsPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitSettingsPrivate.h.
* UIProcess/API/glib/WebKitUIClient.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitUIClient.cpp.
* UIProcess/API/glib/WebKitUIClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitUIClient.h.
* UIProcess/API/glib/WebKitURISchemeRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequest.cpp.
* UIProcess/API/glib/WebKitURISchemeRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h.
* UIProcess/API/glib/WebKitUserContent.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitUserContent.cpp.
* UIProcess/API/glib/WebKitUserContentManager.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitUserContentManager.cpp.
* UIProcess/API/glib/WebKitUserContentManagerPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitUserContentManagerPrivate.h.
* UIProcess/API/glib/WebKitUserContentPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitUserContentPrivate.h.
* UIProcess/API/glib/WebKitUserMediaPermissionRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitUserMediaPermissionRequest.cpp.
* UIProcess/API/glib/WebKitUserMediaPermissionRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitUserMediaPermissionRequestPrivate.h.
* UIProcess/API/glib/WebKitWebContext.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp.
* UIProcess/API/glib/WebKitWebContextPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebContextPrivate.h.
* UIProcess/API/glib/WebKitWebResource.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebResource.cpp.
* UIProcess/API/glib/WebKitWebResourcePrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebResourcePrivate.h.
* UIProcess/API/glib/WebKitWebView.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp.
* UIProcess/API/glib/WebKitWebViewPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebViewPrivate.h.
* UIProcess/API/glib/WebKitWebViewSessionState.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebViewSessionState.cpp.
* UIProcess/API/glib/WebKitWebViewSessionStatePrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebViewSessionStatePrivate.h.
* UIProcess/API/glib/WebKitWebsiteData.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebsiteData.cpp.
* UIProcess/API/glib/WebKitWebsiteDataManager.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebsiteDataManager.cpp.
* UIProcess/API/glib/WebKitWebsiteDataManagerPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebsiteDataManagerPrivate.h.
* UIProcess/API/glib/WebKitWebsiteDataPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebsiteDataPrivate.h.
* UIProcess/API/glib/WebKitWindowProperties.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWindowProperties.cpp.
* UIProcess/API/glib/WebKitWindowPropertiesPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWindowPropertiesPrivate.h.
* WebProcess/InjectedBundle/API/glib/WebKitConsoleMessage.cpp: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitConsoleMessage.cpp.
* WebProcess/InjectedBundle/API/glib/WebKitConsoleMessagePrivate.h: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitConsoleMessagePrivate.h.
* WebProcess/InjectedBundle/API/glib/WebKitFrame.cpp: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitFrame.cpp.
* WebProcess/InjectedBundle/API/glib/WebKitFramePrivate.h: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitFramePrivate.h.
* WebProcess/InjectedBundle/API/glib/WebKitScriptWorld.cpp: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitScriptWorld.cpp.
* WebProcess/InjectedBundle/API/glib/WebKitScriptWorldPrivate.h: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitScriptWorldPrivate.h.
* WebProcess/InjectedBundle/API/glib/WebKitWebEditor.cpp: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.cpp.
* WebProcess/InjectedBundle/API/glib/WebKitWebEditorPrivate.h: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebEditorPrivate.h.
* WebProcess/InjectedBundle/API/glib/WebKitWebExtension.cpp: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp.
* WebProcess/InjectedBundle/API/glib/WebKitWebExtensionPrivate.h: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebExtensionPrivate.h.
* WebProcess/InjectedBundle/API/glib/WebKitWebHitTestResult.cpp: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebHitTestResult.cpp.
* WebProcess/InjectedBundle/API/glib/WebKitWebHitTestResultPrivate.h: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebHitTestResultPrivate.h.
* WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp.
* WebProcess/InjectedBundle/API/glib/WebKitWebPagePrivate.h: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebPagePrivate.h.

Tools:

Update paths of GTK+ API in watchlist and style checker.

* Scripts/webkitpy/common/config/watchlist:
* Scripts/webkitpy/style/checker.py:
* Scripts/webkitpy/style/checkers/cpp.py:
(check_identifier_name_in_declaration):

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

2 years ago[GTK] Rebaseline js/dom/dom-static-property-for-in-iteration.html
csaavedra@igalia.com [Mon, 19 Jun 2017 12:44:41 +0000 (12:44 +0000)]
[GTK] Rebaseline js/dom/dom-static-property-for-in-iteration.html
https://bugs.webkit.org/show_bug.cgi?id=133868

Unreviewed gardening

This test needs expectations to be updated after changes to DOM
static properties. Update and unskip.
* platform/gtk/TestExpectations: Unskip.
* platform/gtk/js/dom/dom-static-property-for-in-iteration-expected.txt:

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

2 years agoUnreviewed build fix after r218484.
zandobersek@gmail.com [Mon, 19 Jun 2017 12:03:45 +0000 (12:03 +0000)]
Unreviewed build fix after r218484.

Source/WebCore:

Properly access the GCryptCipherOperation type (now CipherOperation)
in the PAL::GCrypt namespace. This somehow worked in local builds.

* crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp:
(WebCore::callOperation):
(WebCore::gcryptAES_CTR):

Source/WebCore/PAL:

* pal/crypto/gcrypt/Utilities.h: Drop the GCrypt prefix from the
GCryptCipherOperation type definition, since it's already nested
in the PAL::GCrypt namespace.

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

2 years ago[GCrypt] AES_CTR support
zandobersek@gmail.com [Mon, 19 Jun 2017 11:56:26 +0000 (11:56 +0000)]
[GCrypt] AES_CTR support
https://bugs.webkit.org/show_bug.cgi?id=171420

Reviewed by Michael Catanzaro.

Source/WebCore:

Implement AES_CTR support for build configurations that use libgcrypt.

Both encryption and decryption operations are handled in a single gcryptAES_CTR() function,
with the specific operation being passed as the first argument. The appropriate AES
algorithm is picked, and a gcry_cipher_hd_t object is created and has the given key set.
This key will remain the same throughout the gcry_cipher_hd_t lifetime, even after
gcry_cipher_reset() calls.

The encrypt/decrypt operation is wrapped into a helper lambda functor that accepts the
given counter and input data. It resets the cipher object, sets the counter data, and
performs the specified operation, returning the output data.

libgcrypt doesn't support setting counter data on a gcry_cipher_hd_t object with only
part of that data being used as the actual counter, with the rest acting as a nonce, like
the Web Crypto specification allows. We have to implement the support for that on our own.

We compute the number of blocks we'll be processing and the upper exclusive limit for the
given counter length. We immediately bail if the counter limit is less than the computed
block count, since that would mean that the counter values would be repeated.

We short-cut to a direct operation call if the counter length matches size of the counter
data -- we don't have to adjust the counter data in any way if that's the case.

Otherwise we move counter data into the MPI format. The nonce and the actual counter MPIs
can split out of the counter data MPI with the modulus operation and the counter limit MPI.

We take another shortcut straight to the operation call if we're able to determine that the
'counter leeway' value, i.e. the difference between the initial counter MPI and the counter
limit MPI, is larger or equal to the predicted block size -- if that's the case, the counter
won't wrap around and change the nonce data.

In worst-case scenario the counter data will wrap around and we have to address that. The
current implementation takes the slowest possible path for the moment, encrypting/decrypting
each block separately. For each step the counter is combined with the nonce, the resulting
MPI data retrieved and passed to the operation function, and the returned block output
appended to the final output vector. The counter MPI is then incremented and ran through the
modulus operation, limiting the MPI value to the previously-computed counter limit.

No new tests -- relevant tests are passing and are unskipped.

* crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp:
(WebCore::callOperation):
(WebCore::gcryptAES_CTR):
(WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):

Source/WebCore/PAL:

* pal/crypto/gcrypt/Utilities.h: Add a GCryptCipherOperation type alias that can be used
for the gcry_cipher_decrypt or gcry_cipher_encrypt function pointers.

LayoutTests:

* platform/gtk/TestExpectations: Unskip the relevant AES_CTR tests.

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

2 years ago[GTK] Layout Test imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-createOffe...
commit-queue@webkit.org [Mon, 19 Jun 2017 11:39:52 +0000 (11:39 +0000)]
[GTK] Layout Test imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-createOffer.html crashes
https://bugs.webkit.org/show_bug.cgi?id=173456

Unreviewed gardening.

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

* platform/gtk/TestExpectations: Marked
imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-createOffer.html,
webrtc/createOfferAnswer.html and webrtc/video-addTransceiver.html Crash.

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

2 years agoPort setup_environ_for_server should not set environment variables related with the...
clopez@igalia.com [Mon, 19 Jun 2017 10:39:23 +0000 (10:39 +0000)]
Port setup_environ_for_server should not set environment variables related with the driver.
https://bugs.webkit.org/show_bug.cgi?id=173483

Reviewed by Carlos Garcia Campos.

The port setup_environ_for_server() should not set environment variables
that depend on the type of driver (like DISPLAY or GDK_BACKEND).
This varibles should be only set on the driver setup_environ_for_test().

This causes that (for example) the variable DISPLAY or XAUTHORITY leaks
into the test environment even when running the tests with a driver
that is not the Xorg or Xvfb one.

* Scripts/webkitpy/port/base.py: Stop setting XAUTHORITY and DISPLAY here.
(Port.to.setup_environ_for_server):
* Scripts/webkitpy/port/driver.py: Remove unneded WEBKIT_OUTPUTDIR that is already set on base.py
(Driver._setup_environ_for_driver):
* Scripts/webkitpy/port/driver_unittest.py:
(DriverTest.test_setup_environ_for_test):
(DriverTest):
(DriverTest.test_setup_environ_base_vars):
* Scripts/webkitpy/port/gtk.py: Stop setting GDK_BACKEND here and do that on the driver (Xvfb).
(GtkPort.setup_environ_for_server):
* Scripts/webkitpy/port/wayland_unittest.py: Added.
(WaylandDriverTest):
(WaylandDriverTest.make_driver):
(WaylandDriverTest.make_environment):
(WaylandDriverTest.test_checkdriver):
(WaylandDriverTest.test_environment_needed_variables):
(WaylandDriverTest.test_environment_forbidden_variables):
(WaylandDriverTest.test_environment_optional_variables):
* Scripts/webkitpy/port/waylanddriver.py: Allow the driver to run also with WAYLAND_SOCKET.
(WaylandDriver.check_driver):
(WaylandDriver._setup_environ_for_test):
* Scripts/webkitpy/port/xorgdriver.py:
(XorgDriver.check_driver):
(XorgDriver._setup_environ_for_test):
* Scripts/webkitpy/port/xorgdriver_unittest.py: Added.
(XorgDriverTest):
(XorgDriverTest.make_driver):
(XorgDriverTest.make_environment):
(XorgDriverTest.test_checkdriver):
(XorgDriverTest.test_environment_needed_variables):
(XorgDriverTest.test_environment_forbidden_variables):
(XorgDriverTest.test_environment_optional_variables):
* Scripts/webkitpy/port/xvfbdriver.py:
(XvfbDriver._setup_environ_for_test):
* Scripts/webkitpy/port/xvfbdriver_unittest.py:
(XvfbDriverTest.assertDriverStartSuccessful):

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

2 years ago[GTK][WPE] Rebaseline after r218458
csaavedra@igalia.com [Mon, 19 Jun 2017 10:03:40 +0000 (10:03 +0000)]
[GTK][WPE] Rebaseline after r218458

Unreviewed gardening.

Add new DOMQuad attribute to the test expectations.
* platform/gtk/js/dom/global-constructors-attributes-expected.txt:
* platform/wpe/js/dom/global-constructors-attributes-dedicated-worker-expected.txt:
* platform/wpe/js/dom/global-constructors-attributes-expected.txt:

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

2 years agoAdd heuristic to avoid flattening "fullscreen" iframes
commit-queue@webkit.org [Mon, 19 Jun 2017 07:41:11 +0000 (07:41 +0000)]
Add heuristic to avoid flattening "fullscreen" iframes
https://bugs.webkit.org/show_bug.cgi?id=171914

Patch by Frederic Wang <fwang@igalia.com> on 2017-05-14
Reviewed by Simon Fraser.

Source/WebCore:

Some authors implement fullscreen popups as out-of-flow iframes with size set to full viewport (using vw/vh CSS units).
When iframe flattening is enabled, such iframes may unexpectedly become larger than the viewport.
This commit adds a simple heuristic to avoid frame flattening in that case.
It is experimented by introducing a "enable for non-fullscreen iframes" state for the frame
flattening setting.
The default frame flattening is still either disabled or (fully) enabled on all platforms.
InternalSettings is also adjusted so that the tests can still set the frame flattening setting.

Test: fast/frames/flattening/iframe-flattening-fullscreen.html

* page/FrameView.cpp:
(WebCore::FrameView::frameFlatteningEnabled): Use the frame flattening enum setting.
* page/Settings.h: Define a frame flattening enum that includes a "enable for non-fullscreen
iframes" state.
* page/Settings.in: Redefine frame flattening using that enum.
* rendering/RenderFrameSet.cpp:
(WebCore::RenderFrameSet::flattenFrameSet): Use the frame flattening enum setting.
* rendering/RenderIFrame.cpp:
(WebCore::RenderIFrame::isFullScreenIFrame): Add a heuristic when partial frame flattening
is enabled setting is enabled.
There is not a strict comparison against the viewport size since authors may not exactly use
100vw/100vh.
Anyway, it is hard to do such comparison using the resolved width & height on RenderStyle.
(WebCore::RenderIFrame::flattenFrame): Add a comment for the existing "zero size" heuristic.
Use isFullScreenIFrame heuristic.
* rendering/RenderView.cpp:
(WebCore::FrameFlatteningLayoutDisallower::FrameFlatteningLayoutDisallower): Use the frame flattening enum setting.
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup): Add backup for frame flattening.
(WebCore::InternalSettings::Backup::restoreTo): Ditto.
(WebCore::internalSettingsToWebCoreValue): Helper function to cast the frame flattening values.
(WebCore::InternalSettings::setFrameFlattening): Redefine setFrameFlattening to accept an enum.
* testing/InternalSettings.h: Define new enum & setter for frame flattening as well as a backup value.
* testing/InternalSettings.idl: Define new enum & setter for frame flattening.

Source/WebKit/mac:

This commit adjusts the mac/ios preference interface to treat frame flattening as an enum.

* WebView/WebPreferenceKeysPrivate.h: Rename the key.
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]): Handle frame flattening as an enum.
(-[WebPreferences isFrameFlatteningEnabled]): Ditto.
(-[WebPreferences setFrameFlatteningEnabled:]): Ditto.
(-[WebPreferences frameFlattening]): New function to get frame flattening as an enum.
(-[WebPreferences setFrameFlattening:]): New function to set frame flattening as an enum.
* WebView/WebPreferencesPrivate.h: Ditto.
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]): Ditto.
* WebView/WebPreferencesPrivate.h: Add new enum definition.

Source/WebKit/win:

This commit ajusts the window port to internally use the new preference type for frame flattening.
However, the "partial frame flattening" value is not exposed yet.

* WebView.cpp:
(WebView::notifyPreferencesChanged): Use the new type for frame flattening.

Source/WebKit2:

This commit ajusts the preference API to internally treat frame flattening as an enum.
However, the "partial frame flattening" value is not exposed to GTK, C or InjectedBundle APIs yet.

* Shared/WebPreferencesDefinitions.h: Define frame flattening as an enum.
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetFrameFlatteningEnabled): Treat frame flattening as an enum.
(WKPreferencesGetFrameFlatteningEnabled): Ditto.
* UIProcess/API/gtk/WebKitSettings.cpp:
(webkit_settings_get_enable_frame_flattening): Ditto.
(webkit_settings_set_enable_frame_flattening): Ditto.
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): Do not handle frame flattening since it is an enum.
For now, this breaks one test checking preference overriding because of bug 128594.
(WebKit::InjectedBundle::setFrameFlatteningEnabled): Treat frame flattening as an enum.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::contentsSizeChanged): Use enum value.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences): Ditto.

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(resetWebPreferencesToConsistentValues): Use WebKitFrameFlatteningDisabled.

LayoutTests:

This commit adjusts tests to work when frame flattening is an enum.
It also adds a test to check the new heuristic when "frame flattening for non-fullscreen
iframes" is enabled.
set-preference.html is disabled for now, as the test suite does not support overridePreference()
for non-boolean values (bug 128594).

* fast/forms/ios/delete-in-input-in-iframe.html: Use enum value "FullyEnabled".
* fast/forms/ios/focus-input-in-iframe.html: Ditto.
* fast/forms/ios/programmatic-focus-input-in-iframe.html: Ditto.
* fast/forms/ios/typing-in-input-in-iframe.html: Ditto.
* fast/frames/flattening/crash-remove-iframe-during-object-beforeload.html: Ditto.
* fast/frames/flattening/crash-svg-document.html: Ditto.
* fast/frames/flattening/crash-when-sibling-iframe-is-destroyed-with-subtree-layoutroot.html: Ditto.
* fast/frames/flattening/frameset-flattening-advanced.html: Ditto.
* fast/frames/flattening/frameset-flattening-grid.html: Ditto.
* fast/frames/flattening/frameset-flattening-simple.html: Ditto.
* fast/frames/flattening/frameset-flattening-subframe-resize.html: Ditto.
* fast/frames/flattening/frameset-flattening-subframesets.html: Ditto.
* fast/frames/flattening/hittest-iframe-while-style-changes-crash.html: Ditto.
Be sure to use single quotes for the inline iframe page.
* fast/frames/flattening/iframe-flattening-crash.html: Use enum value "FullyEnabled".
* fast/frames/flattening/iframe-flattening-fixed-height.html: Ditto.
* fast/frames/flattening/iframe-flattening-fixed-width-and-height-no-scrolling-with-js-forced-layout.html: Ditto.
* fast/frames/flattening/iframe-flattening-fixed-width-and-height-no-scrolling.html: Ditto.
* fast/frames/flattening/iframe-flattening-fixed-width-and-height-zero-size.html: Ditto.
* fast/frames/flattening/iframe-flattening-fixed-width-and-height.html: Ditto.
* fast/frames/flattening/iframe-flattening-fixed-width.html: Ditto.
* fast/frames/flattening/iframe-flattening-fullscreen.html: Added. Check the new heuristic.
* fast/frames/flattening/iframe-flattening-fullscreen-expected.txt: Added.
* fast/frames/flattening/iframe-flattening-inside-flexbox-with-delayed-scroll-update.html: Use enum value "FullyEnabled".
* fast/frames/flattening/iframe-flattening-nested.html: Ditto.
* fast/frames/flattening/iframe-flattening-offscreen.html: Ditto.
* fast/frames/flattening/iframe-flattening-out-of-view-and-scroll.html: Ditto.
* fast/frames/flattening/iframe-flattening-out-of-view-scroll-and-relayout.html: Ditto.
* fast/frames/flattening/iframe-flattening-out-of-view.html: Ditto.
* fast/frames/flattening/iframe-flattening-resize-event-count.html: Ditto.
* fast/frames/flattening/iframe-flattening-selection-crash.html: Ditto.
* fast/frames/flattening/iframe-flattening-simple.html: Ditto.
* fast/frames/flattening/iframe-tiny.html: Ditto.
* fast/frames/flattening/scrollable-flexbox-inside-iframe-with-zero-height-and-needs-full-repaint-crash.html: Ditto.
* fast/frames/flattening/scrollable-flexbox-inside-iframe-with-zero-height-assertion-failure.html: Ditto.
* fast/frames/flattening/scrolling-in-object.html: Ditto.
* fast/spatial-navigation/snav-iframe-flattening-simple.html: Ditto.
* http/tests/misc/iframe-flattening-3level-nesting-with-blocking-resource.html: Ditto.
* platform/mac/TestExpectations: Disable this due to limitation in the test infrastructure.
* plugins/frameset-with-plugin-frame.html: Use enum value "FullyEnabled".

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

2 years agoUnreviewed. Update OptionsGTK.cmake and NEWS for 2.17.4 release.
carlosgc@webkit.org [Mon, 19 Jun 2017 06:37:07 +0000 (06:37 +0000)]
Unreviewed. Update OptionsGTK.cmake and NEWS for 2.17.4 release.

.:

* Source/cmake/OptionsGTK.cmake: Bump version numbers.

Source/WebKit2:

* gtk/NEWS: Add release notes for 2.17.4.

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

2 years agoREGRESSION(r218253): Infinite animated gifs no longer loop
carlosgc@webkit.org [Mon, 19 Jun 2017 05:22:47 +0000 (05:22 +0000)]
REGRESSION(r218253): Infinite animated gifs no longer loop
https://bugs.webkit.org/show_bug.cgi?id=173464

Reviewed by Carlos Alberto Lopez Perez.

After the first loop iteration we keep rendering the same frame all the time, so it looks like if the animation
stopped. This is because in r218253 we changed to use SharedBuffer instead of a Vector in ImageBackingStore, but
we are not correctly copying the data in the copy constructor. We are using SharedBuffer::copy() that doesn't
actually copy the data of the segments.

* platform/graphics/ImageBackingStore.h:
(WebCore::ImageBackingStore::ImageBackingStore): Copy the data of the other SharedBuffer.

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

2 years ago[GStreamer] MainThreadNotifier ASSERTION FAILED: m_boundThread == currentThread(...
carlosgc@webkit.org [Mon, 19 Jun 2017 05:12:37 +0000 (05:12 +0000)]
[GStreamer] MainThreadNotifier ASSERTION FAILED: m_boundThread == currentThread() in _WebKitWebSrcPrivate::~_WebKitWebSrcPrivate
https://bugs.webkit.org/show_bug.cgi?id=152043

Reviewed by Xabier Rodriguez-Calvar.

Stop using a WeakPtr in MainThreadNotifier, because it's not thread safe, which causes a crash in debug builds when
the notifier is destroyed in a different thread. Make MainThreadNotifier thread safe refcounted instead, and add
an invalidate() method to mark it as invalid.

* platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
(WebCore::InbandTextTrackPrivateGStreamer::handleSample):
(WebCore::InbandTextTrackPrivateGStreamer::streamChanged):
* platform/graphics/gstreamer/MainThreadNotifier.h:
(WebCore::MainThreadNotifier::MainThreadNotifier): Deleted.
(WebCore::MainThreadNotifier::notify): Deleted.
(WebCore::MainThreadNotifier::cancelPendingNotifications): Deleted.
(WebCore::MainThreadNotifier::addPendingNotification): Deleted.
(WebCore::MainThreadNotifier::removePendingNotification): Deleted.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::videoChangedCallback):
(WebCore::MediaPlayerPrivateGStreamer::videoSinkCapsChangedCallback):
(WebCore::MediaPlayerPrivateGStreamer::audioChangedCallback):
(WebCore::MediaPlayerPrivateGStreamer::textChangedCallback):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
(WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
(WebCore::MediaPlayerPrivateGStreamerBase::volumeChangedCallback):
(WebCore::MediaPlayerPrivateGStreamerBase::muteChangedCallback):
(WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
(WebCore::TrackPrivateBaseGStreamer::TrackPrivateBaseGStreamer):
(WebCore::TrackPrivateBaseGStreamer::~TrackPrivateBaseGStreamer):
(WebCore::TrackPrivateBaseGStreamer::disconnect):
(WebCore::TrackPrivateBaseGStreamer::activeChangedCallback):
(WebCore::TrackPrivateBaseGStreamer::tagsChanged):
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webkit_web_src_init):
(webKitWebSrcDispose):
(webKitWebSrcStop):
(webKitWebSrcStart):
(webKitWebSrcNeedData):
(webKitWebSrcEnoughData):
(webKitWebSrcSeek):

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

2 years agoDrop redundant IPC in WebPage::tryClose()
cdumez@apple.com [Mon, 19 Jun 2017 04:53:08 +0000 (04:53 +0000)]
Drop redundant IPC in WebPage::tryClose()
https://bugs.webkit.org/show_bug.cgi?id=173533

Reviewed by Sam Weinig.

Drop redundant IPC to stop the responsiveness timer in WebPage::tryClose(). The
destructor for the SendStopResponsivenessTimer already takes care of sending the
IPC.

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

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

2 years agoMeter element doesn't respect the writing direction
rniwa@webkit.org [Mon, 19 Jun 2017 04:00:49 +0000 (04:00 +0000)]
Meter element doesn't respect the writing direction
https://bugs.webkit.org/show_bug.cgi?id=173507

Reviewed by Sam Weinig.

Source/WebCore:

The bug was caused by NSLevelIndicatorCell no longer using the value of baseWritingDirection
to determine the direction of rendering in macOS Sierra and later. It instead relies on
the value of userInterfaceLayoutDirection.

Fixed the bug by setting both values. Once we dropped the support for macOS El Capitan
and earlier, we can remove the code to set baseWritingDirection.

Test: fast/dom/HTMLMeterElement/meter-rtl.html

* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::levelIndicatorFor):

LayoutTests:

A regression ref test since existing tests were pixel tests and did not catch this regression.
Note that black border was added to workaround the anti-aliasing differences in macOS High Sierra.

* fast/dom/HTMLMeterElement/meter-rtl-expected.html: Added.
* fast/dom/HTMLMeterElement/meter-rtl.html: Added.

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

2 years agoRemove 'EditCommand::isEditCommandComposition'.
dewei_zhu@apple.com [Mon, 19 Jun 2017 03:12:15 +0000 (03:12 +0000)]
Remove 'EditCommand::isEditCommandComposition'.
https://bugs.webkit.org/show_bug.cgi?id=173525

Reviewed by Wenson Hsieh.

Should remove 'isEditCommandComposition' from 'EditCommand' for:
    1. 'EditCommandComposition' is no longer a subclass of EditCommand.
    2. 'isEditCommandComposition' is not used at all.

* editing/EditCommand.h:
(WebCore::EditCommand::isCompositeEditCommand):
(WebCore::EditCommand::isEditCommandComposition): Deleted.

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

2 years agoDrop unused UserMediaPermissionRequestManager::cancelPendingRequests()
cdumez@apple.com [Mon, 19 Jun 2017 01:59:17 +0000 (01:59 +0000)]
Drop unused UserMediaPermissionRequestManager::cancelPendingRequests()
https://bugs.webkit.org/show_bug.cgi?id=173529
<rdar://problem/32836986>

Reviewed by Sam Weinig.

Drop UserMediaPermissionRequestManager::cancelPendingRequests() as it is unused
and its implementation is wrong (modifies the hash maps it is iterating on).

* WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
(WebKit::UserMediaPermissionRequestManager::cancelPendingRequests): Deleted.
* WebProcess/MediaStream/UserMediaPermissionRequestManager.h:

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

2 years agoCrash when re-entering MediaDevicesEnumerationRequest::cancel()
cdumez@apple.com [Sun, 18 Jun 2017 20:25:19 +0000 (20:25 +0000)]
Crash when re-entering MediaDevicesEnumerationRequest::cancel()
https://bugs.webkit.org/show_bug.cgi?id=173522
<rdar://problem/31185739>

Reviewed by Darin Adler.

Source/WebCore:

When a MediaDevicesRequest is started, it creates a MediaDevicesEnumerationRequest
object and passes a completion handler to that MediaDevicesEnumerationRequest
object. The completion handler holds a reference to the MediaDevicesRequest object
so that its stays alive until the MediaDevicesEnumerationRequest either completes
or is canceled. MediaDevicesRequest also holds a reference to the
MediaDevicesEnumerationRequest object via its m_enumerationRequest data member.

When the document is destroyed, both MediaDevicesRequest::contextDestroyed() and
MediaDevicesEnumerationRequest::contextDestroyed() gets called and the other is not
pre-determined. If MediaDevicesEnumerationRequest::contextDestroyed() gets called
first then it calls MediaDevicesEnumerationRequest::cancel(). Calling cancel() ends
up destroying the completion handler. Destroying the completion handler ends up
dereferencing and destroying the MediaDevicesRequest object. The MediaDevicesRequest
destructor would call MediaDevicesEnumerationRequest::cancel() again, causing us to
re-enter it and assign nullptr to the completion callback again. Re-entering
std::function's operator=(nullptr_t) is not safe because of the way it is implemented
as we end up trying to destroy the lambda twice and crashing. Using a WTF::Function
instead fixes this particular issue because re-entering WTF::Function's operator=(nullptr_t)
is safe.

However, this fix is not sufficient. Calling the MediaDevicesRequest destructor also
dereferencing and destroys the MediaDevicesEnumerationRequest object. As a result,
when MediaDevicesEnumerationRequest::contextDestroyed() returns from its call to cancel
|this| is already dead when we call ContextDestructionObserver::contextDestroyed().
To address this issue, we now protect |this| in MediaDevicesEnumerationRequest::contextDestroyed().

Test: fast/mediastream/destroy-document-while-enumerating-devices.html

* Modules/mediastream/MediaDevicesEnumerationRequest.cpp:
(WebCore::MediaDevicesEnumerationRequest::contextDestroyed):
Protect |this| as the call to cancel() may destroy |this| before calling
ContextDestructionObserver::contextDestroyed() otherwise.

* Modules/mediastream/MediaDevicesEnumerationRequest.h:
Use WTF::Function instead of std::function for the completion handler as
it is safer (in terms of re-entrency) and avoids unnecessary copying.

* Modules/mediastream/MediaDevicesRequest.cpp:
(WebCore::MediaDevicesRequest::~MediaDevicesRequest):
Stop calling MediaDevicesEnumerationRequest::cancel(). When the destructor
is called, the MediaDevicesEnumerationRequest has either completed or been
canceled so there is no need to cancel again. I added an assertion to
make sure it is the case. This avoids re-entering
MediaDevicesEnumerationRequest::cancel() is some cases, which was risky.

(WebCore::MediaDevicesRequest::start):
Add comment for clarity and capture a Ref<> instead of a RefPtr<> now that
we can since we use WTF::Function.

Tools:

Add API test for re-entering Function's assignment operators.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WTF/Function.cpp: Added.
(TestWebKitAPI::TestObject::TestObject):
(TestWebKitAPI::TestObject::~TestObject):
(TestWebKitAPI::TestObject::operator()):
(TestWebKitAPI::TEST):

LayoutTests:

Add layout test coverage. This test would flakily crash before the fix because it
relies on the order in which contextDestroyed() is called for MediaDevicesRequest
and MediaDevicesEnumerationRequest.

* fast/mediastream/destroy-document-while-enumerating-devices-expected.txt: Added.
* fast/mediastream/destroy-document-while-enumerating-devices.html: Added.
* fast/mediastream/resources/enumerate-devices-frame.html: Added.

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

2 years agoUse WTF::Function instead of std::function in WTF/
cdumez@apple.com [Sun, 18 Jun 2017 19:49:12 +0000 (19:49 +0000)]
Use WTF::Function instead of std::function in WTF/
https://bugs.webkit.org/show_bug.cgi?id=173519

Reviewed by Sam Weinig.

Source/WebCore:

Replace a few uses of std::function with WTF::Function in WebCore/
as well. It was either this or including <functional> and I decided
it made more sense to port the code.

* platform/graphics/FontSelectionAlgorithm.h:
(WebCore::FontSelectionAlgorithm::iterateActiveCapabilitiesWithReturn):
* platform/mediastream/MediaConstraints.cpp:
(WebCore::StringConstraint::find):
(WebCore::MediaTrackConstraintSetMap::forEach):
(WebCore::MediaTrackConstraintSetMap::filter):
(WebCore::MediaConstraints::isConstraintSet):
* platform/mediastream/MediaConstraints.h:
(WebCore::NumericConstraint::find):
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::applyConstraint):

Source/WTF:

Use WTF::Function instead of std::function in WTF/ to avoid
copying.

* wtf/Brigand.h:
* wtf/Condition.h:
* wtf/Expected.h:
* wtf/FunctionDispatcher.h:
* wtf/MainThread.h:
* wtf/MemoryPressureHandler.h:
(WTF::MemoryPressureHandler::setMemoryKillCallback):
(WTF::MemoryPressureHandler::setMemoryPressureStatusChangedCallback):
(WTF::MemoryPressureHandler::setDidExceedInactiveLimitWhileActiveCallback):
* wtf/Optional.h:
* wtf/ParkingLot.h:
* wtf/RefCounter.h:
(WTF::RefCounter<T>::RefCounter):
* wtf/WorkQueue.h:
* wtf/linux/MemoryPressureHandlerLinux.cpp:
(WTF::MemoryPressureHandler::EventFDPoller::EventFDPoller):
* wtf/text/WTFString.cpp:
(WTF::String::split):
* wtf/text/WTFString.h:

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

2 years ago[MSE] Seeking or entering fullscreen can cause extreme CPU usage
jer.noble@apple.com [Sun, 18 Jun 2017 15:55:55 +0000 (15:55 +0000)]
[MSE] Seeking or entering fullscreen can cause extreme CPU usage
https://bugs.webkit.org/show_bug.cgi?id=173505

Reviewed by Tim Horton.

When support for painting MSE to WebGL was added in r217185, the implementation of
SourceBufferPrivateAVFObjC::isReadyForMoreSamples() was modified to support asking
the decompression session if it was ready. That change, however, caused an extreme
performance regression in the normal playback path, where WebKit will effectively
append samples endlessly to the AVSampleBufferDisplayLayer, which admirably enqueued
each of them for decoding. Eventually, the cost of iterating over the CMBufferQueue
overwhelmed the cost of decoding, and caused the extreme lag seen when seeking.

Make sure to property query the AVSampleBufferDisplayLayer for isReadyForMoreMediaData
before enqueuing.

A previous version of this patch exposed some errors which caused failing tests:

In sourceBufferPrivateDidReceiveSample(), we were using local versions of
presentationTimestamp and decodeTimestamp as keys to the decodeQueue; those local versions
were floating point values (because MediaTime + float = float), but the sample itself uses
non-floating point MediaTimes. This causes samples to be left in the queue when they should
be removed.

In didBecomeReadyForMoreSamples(), we were getting spurious assertions when a
AVSampleBufferDisplayLayer or a AVSampleBufferAudioRenderer would fire a callback from
-requestMediaDataWhenReadyOnQueue:usingBlock: even after it had been told to
-stopRequestingMediaData. Apparently it's expected behavior and so an ASSERT_NOT_REACHED is
inappropriate here.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::isReadyForMoreSamples):
(WebCore::SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples):

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

2 years agoAddressing post-review comment after r218456.
zalan@apple.com [Sun, 18 Jun 2017 03:57:26 +0000 (03:57 +0000)]
Addressing post-review comment after r218456.
https://bugs.webkit.org/show_bug.cgi?id=173509

Reviewed by Darin Adler.

* dom/Document.cpp:
(WebCore::Document::destroyRenderTree):

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

2 years agoDOMQuad::getBounds() should return a Ref<>
cdumez@apple.com [Sun, 18 Jun 2017 01:36:07 +0000 (01:36 +0000)]
DOMQuad::getBounds() should return a Ref<>
https://bugs.webkit.org/show_bug.cgi?id=173517

Reviewed by Simon Fraser.

DOMQuad::getBounds() should return a Ref<> as it cannot return
null.

* dom/DOMQuad.cpp:
(WebCore::DOMQuad::getBounds):
* dom/DOMQuad.h:

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

2 years agoUnreviewed, follow-up build fix after r218457.
cdumez@apple.com [Sun, 18 Jun 2017 00:10:41 +0000 (00:10 +0000)]
Unreviewed, follow-up build fix after r218457.

* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):

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

2 years agoUnreviewed, follow-up build fix after r218457.
cdumez@apple.com [Sat, 17 Jun 2017 23:55:41 +0000 (23:55 +0000)]
Unreviewed, follow-up build fix after r218457.

* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):

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

2 years agoImplement DOMQuad
simon.fraser@apple.com [Sat, 17 Jun 2017 22:34:28 +0000 (22:34 +0000)]
Implement DOMQuad
https://bugs.webkit.org/show_bug.cgi?id=163534

Reviewed by Sam Weinig.
LayoutTests/imported/w3c:

Implement DOMQuad per https://drafts.fxtf.org/geometry/#DOMQuad.

* web-platform-tests/css/geometry-1/DOMQuad-001-expected.txt: Tests against an older version
of the spec, so some failures.
* web-platform-tests/css/geometry-1/DOMQuad-002-expected.txt: All tests pass other than a NaN
propagation issue which needs spec clarification.
* web-platform-tests/css/geometry-1/structured-serialization-expected.txt:

Source/WebCore:

Implement DOMQuad per https://drafts.fxtf.org/geometry/#DOMQuad, other than serialization
which requires some bindings changes.

web-platform-tests/css/geometry-1/DOMRect-001.html tests against an older version of the spec,
so has some failures. DOMQuad-002.html passes, other than a NaN propagation issue that requires
spec clarification.

* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMQuadCustom.cpp: Added.
(WebCore::JSDOMQuad::getBounds):
* bindings/scripts/CodeGenerator.pm:
(IsSerializableDOMType):
(IsSerializableAttribute):
* dom/DOMPoint.h:
* dom/DOMQuad.cpp: Added.
(WebCore::DOMQuad::DOMQuad):
(WebCore::DOMQuad::getBounds):
* dom/DOMQuad.h: Added.
(WebCore::DOMQuad::create):
(WebCore::DOMQuad::fromRect):
(WebCore::DOMQuad::fromQuad):
(WebCore::DOMQuad::p1):
(WebCore::DOMQuad::p2):
(WebCore::DOMQuad::p3):
(WebCore::DOMQuad::p4):
* dom/DOMQuad.idl: Added.
* dom/DOMQuadInit.h: Added.
* dom/DOMQuadInit.idl: Added.

LayoutTests:

Implement DOMQuad per https://drafts.fxtf.org/geometry/#DOMQuad.

* js/dom/global-constructors-attributes-dedicated-worker-expected.txt:
* platform/mac/js/dom/global-constructors-attributes-expected.txt:

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

2 years agoUse WTF::Function instead of std::function in WebKit2/
cdumez@apple.com [Sat, 17 Jun 2017 20:55:56 +0000 (20:55 +0000)]
Use WTF::Function instead of std::function in WebKit2/
https://bugs.webkit.org/show_bug.cgi?id=173504

Reviewed by Darin Adler.

Use WTF::Function instead of std::function in WebKit2/ to avoid
unnecessary copying.

Source/WebCore:

* Modules/applepay/PaymentCoordinator.cpp:
(WebCore::PaymentCoordinator::canMakePaymentsWithActiveCard):
(WebCore::PaymentCoordinator::openPaymentSetup):
* Modules/applepay/PaymentCoordinator.h:
* Modules/applepay/PaymentCoordinatorClient.h:
* loader/EmptyClients.cpp:
* loader/NetscapePlugInStreamLoader.cpp:
(WebCore::NetscapePlugInStreamLoader::willSendRequest):
* loader/NetscapePlugInStreamLoader.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::willSendRequest):
* loader/ResourceLoader.h:

Source/WebKit/mac:

* Plugins/Hosted/HostedNetscapePluginStream.h:
* Plugins/Hosted/HostedNetscapePluginStream.mm:
(WebKit::HostedNetscapePluginStream::willSendRequest):
* Plugins/WebNetscapePluginStream.h:
* Plugins/WebNetscapePluginStream.mm:
(WebNetscapePluginStream::willSendRequest):
* WebCoreSupport/WebPaymentCoordinatorClient.h:
* WebCoreSupport/WebPaymentCoordinatorClient.mm:
(WebPaymentCoordinatorClient::canMakePaymentsWithActiveCard):
(WebPaymentCoordinatorClient::openPaymentSetup):

Source/WebKit/win:

* Plugins/PluginStream.cpp:
(WebCore::PluginStream::willSendRequest):
* Plugins/PluginStream.h:

Source/WebKit2:

* DatabaseProcess/DatabaseProcess.cpp:
(WebKit::DatabaseProcess::getSandboxExtensionsForBlobFiles):
* DatabaseProcess/DatabaseProcess.h:
* NetworkProcess/cache/NetworkCacheData.h:
* NetworkProcess/cache/NetworkCacheFileSystem.h:
* Platform/IPC/Connection.cpp:
(IPC::Connection::installIncomingSyncMessageCallback):
* Platform/IPC/Connection.h:
* Platform/IPC/glib/GSocketMonitor.h:
* Platform/Logging.h:
* Shared/API/APIObject.h:
* Shared/AsyncRequest.cpp:
(WebKit::AsyncRequest::AsyncRequest):
(WebKit::AsyncRequest::setAbortHandler):
* Shared/AsyncRequest.h:
* Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
(WebKit::CompositingRunLoop::CompositingRunLoop):
* Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
* Shared/WebContextMenuItemData.h:
* UIProcess/API/APIDownloadClient.h:
(API::DownloadClient::willSendRequest):
* UIProcess/API/APIIconLoadingClient.h:
(API::IconLoadingClient::getLoadDecisionForIcon):
* UIProcess/API/APIUIClient.h:
(API::UIClient::createNewPageAsync):
* UIProcess/API/C/WKPage.cpp:
(toGenericCallbackFunction):
* UIProcess/API/Cocoa/WKWebView.mm:
* UIProcess/API/mac/WKView.mm:
(-[WKView maybeInstallIconLoadingClient]):
* UIProcess/AcceleratedDrawingAreaProxy.cpp:
(WebKit::AcceleratedDrawingAreaProxy::dispatchAfterEnsuringDrawing):
* UIProcess/AcceleratedDrawingAreaProxy.h:
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
(WebKit::WebPaymentCoordinatorProxy::platformOpenPaymentSetup):
* UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
(WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
* UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
(WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::performKeyboardInteractions):
* UIProcess/Cocoa/IconLoadingDelegate.h:
* UIProcess/Cocoa/IconLoadingDelegate.mm:
(WebKit::IconLoadingDelegate::IconLoadingClient::getLoadDecisionForIcon):
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::tryAppLink):
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::UIClient::createNewPageCommon):
(WebKit::UIDelegate::UIClient::createNewPageAsync):
* UIProcess/Cocoa/ViewGestureController.cpp:
(WebKit::ViewGestureController::SnapshotRemovalTracker::start):
* UIProcess/Cocoa/ViewGestureController.h:
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::prepareForMoveToWindow):
* UIProcess/Databases/DatabaseProcessProxy.cpp:
(WebKit::DatabaseProcessProxy::fetchWebsiteData):
(WebKit::DatabaseProcessProxy::deleteWebsiteData):
(WebKit::DatabaseProcessProxy::deleteWebsiteDataForOrigins):
* UIProcess/Databases/DatabaseProcessProxy.h:
* UIProcess/DrawingAreaProxy.h:
(WebKit::DrawingAreaProxy::dispatchAfterEnsuringDrawing):
* UIProcess/DrawingAreaProxyImpl.cpp:
(WebKit::DrawingAreaProxyImpl::DrawingMonitor::start):
(WebKit::DrawingAreaProxyImpl::dispatchAfterEnsuringDrawing):
* UIProcess/DrawingAreaProxyImpl.h:
* UIProcess/GenericCallback.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::fetchWebsiteData):
(WebKit::NetworkProcessProxy::deleteWebsiteData):
(WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/PageClient.h:
* UIProcess/Plugins/PlugInAutoStartProvider.cpp:
(WebKit::PlugInAutoStartProvider::setAutoStartOriginsTableWithItemsPassingTest):
* UIProcess/Plugins/PlugInAutoStartProvider.h:
* UIProcess/Plugins/PluginProcessManager.cpp:
(WebKit::PluginProcessManager::fetchWebsiteData):
(WebKit::PluginProcessManager::deleteWebsiteData):
(WebKit::PluginProcessManager::deleteWebsiteDataForHostNames):
* UIProcess/Plugins/PluginProcessManager.h:
* UIProcess/Plugins/PluginProcessProxy.cpp:
(WebKit::PluginProcessProxy::fetchWebsiteData):
(WebKit::PluginProcessProxy::deleteWebsiteData):
(WebKit::PluginProcessProxy::deleteWebsiteDataForHostNames):
* UIProcess/Plugins/PluginProcessProxy.h:
* UIProcess/ProcessAssertion.h:
* UIProcess/WebBackForwardList.cpp:
(WebKit::WebBackForwardList::backForwardListState):
* UIProcess/WebBackForwardList.h:
* UIProcess/WebCookieManagerProxy.cpp:
(WebKit::WebCookieManagerProxy::setCookieObserverCallback):
(WebKit::WebCookieManagerProxy::cookiesDidChange):
* UIProcess/WebCookieManagerProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setInitialFocus):
(WebKit::WebPageProxy::validateCommand):
(WebKit::WebPageProxy::sessionState):
(WebKit::WebPageProxy::runJavaScriptInMainFrame):
(WebKit::WebPageProxy::getRenderTreeExternalRepresentation):
(WebKit::WebPageProxy::getSourceForFrame):
(WebKit::WebPageProxy::getContentsAsString):
(WebKit::WebPageProxy::getBytecodeProfile):
(WebKit::WebPageProxy::getSamplingProfilerOutput):
(WebKit::WebPageProxy::isWebProcessResponsive):
(WebKit::WebPageProxy::getSelectionOrContentsAsString):
(WebKit::WebPageProxy::createNewPage):
(WebKit::WebPageProxy::getMarkedRangeAsync):
(WebKit::WebPageProxy::getSelectedRangeAsync):
(WebKit::WebPageProxy::characterIndexForPointAsync):
(WebKit::WebPageProxy::firstRectForCharacterRangeAsync):
(WebKit::WebPageProxy::takeSnapshot):
(WebKit::WebPageProxy::installActivityStateChangeCompletionHandler):
(WebKit::WebPageProxy::callAfterNextPresentationUpdate):
(WebKit::WebPageProxy::getLoadDecisionForIcon):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::isResponsive):
* UIProcess/WebProcessProxy.h:
* UIProcess/WebsiteData/WebsiteDataStore.h:
* UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
(WebKit::XDamageNotifier::add):
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::requestPasswordForQuickLookDocument):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::selectWithGesture):
(WebKit::WebPageProxy::updateSelectionWithTouches):
(WebKit::WebPageProxy::requestAutocorrectionData):
(WebKit::WebPageProxy::applyAutocorrection):
(WebKit::WebPageProxy::executeEditCommand):
(WebKit::WebPageProxy::selectTextWithGranularityAtPoint):
(WebKit::WebPageProxy::selectPositionAtBoundaryWithDirection):
(WebKit::WebPageProxy::moveSelectionAtBoundaryWithDirection):
(WebKit::WebPageProxy::selectPositionAtPoint):
(WebKit::WebPageProxy::beginSelectionInDirection):
(WebKit::WebPageProxy::updateSelectionWithExtentPoint):
(WebKit::WebPageProxy::updateSelectionWithExtentPointAndBoundary):
(WebKit::WebPageProxy::requestDictationContext):
(WebKit::WebPageProxy::requestAutocorrectionContext):
(WebKit::WebPageProxy::getSelectionContext):
(WebKit::WebPageProxy::selectWithTwoTouches):
(WebKit::WebPageProxy::requestRectsForGranularityWithSelectionOffset):
(WebKit::WebPageProxy::requestRectsAtSelectionOffsetWithText):
(WebKit::WebPageProxy::moveSelectionByOffset):
(WebKit::WebPageProxy::focusNextAssistedNode):
(WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame):
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
(WebKit::TiledCoreAnimationDrawingAreaProxy::dispatchAfterEnsuringDrawing):
* UIProcess/mac/WKTextFinderClient.mm:
* UIProcess/mac/WebContextMenuProxyMac.mm:
(-[WKSelectionHandlerWrapper initWithSelectionHandler:]):
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::attributedSubstringForCharacterRangeAsync):
(WebKit::WebPageProxy::fontAtSelection):
* WebProcess/ApplePay/WebPaymentCoordinator.cpp:
(WebKit::WebPaymentCoordinator::canMakePaymentsWithActiveCard):
(WebKit::WebPaymentCoordinator::openPaymentSetup):
* WebProcess/ApplePay/WebPaymentCoordinator.h:
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::Stream::willSendRequest):
* WebProcess/WebPage/DrawingArea.cpp:
(WebKit::DrawingArea::dispatchAfterEnsuringUpdatedScrollPosition):
* WebProcess/WebPage/DrawingArea.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::markLayersVolatile):
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::markLayersVolatile):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::dispatchAfterEnsuringUpdatedScrollPosition):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::markAllLayersVolatile):
* WebProcess/WebProcess.h:

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

2 years agoDemote the "we have navigated away" check to an assertion.
zalan@apple.com [Sat, 17 Jun 2017 20:37:07 +0000 (20:37 +0000)]
Demote the "we have navigated away" check to an assertion.
https://bugs.webkit.org/show_bug.cgi?id=173509

Reviewed by Simon Fraser.

Now that the expected behavior is that the render tree can't get to the page cache, it's ok to assert.
TODO: We should also have view() check removed at some point.

* dom/Document.cpp:
(WebCore::Document::destroyRenderTree):

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

2 years agoFix CMake build
achristensen@apple.com [Sat, 17 Jun 2017 20:03:58 +0000 (20:03 +0000)]
Fix CMake build

Source/WebCore:

* PlatformMac.cmake:
* bindings/js/ScriptGlobalObject.cpp:

Source/WebKit2:

* CMakeLists.txt:
* NetworkProcess/capture/NetworkCaptureEvent.cpp:
* PlatformGTK.cmake:
* PlatformWPE.cmake:

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

2 years agoUnreviewed, rolling out r218438.
commit-queue@webkit.org [Sat, 17 Jun 2017 19:50:51 +0000 (19:50 +0000)]
Unreviewed, rolling out r218438.
https://bugs.webkit.org/show_bug.cgi?id=173515

Caused imported/w3c/web-platform-tests/media-
source/mediasource* tests to fail (Requested by smfr on
#webkit).

Reverted changeset:

"[MSE] Seeking or entering fullscreen can cause extreme CPU
usage"
https://bugs.webkit.org/show_bug.cgi?id=173505
http://trac.webkit.org/changeset/218438

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

2 years agoTried to fix non-iOS builds.
mitz@apple.com [Sat, 17 Jun 2017 15:49:32 +0000 (15:49 +0000)]
Tried to fix non-iOS builds.

* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:

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

2 years agoArrayBuffer constructor needs to create subclass structures before its buffer
keith_miller@apple.com [Sat, 17 Jun 2017 14:13:13 +0000 (14:13 +0000)]
ArrayBuffer constructor needs to create subclass structures before its buffer
https://bugs.webkit.org/show_bug.cgi?id=173510

Reviewed by Yusuke Suzuki.

JSTests:

* test262.yaml:

Source/JavaScriptCore:

* runtime/JSArrayBufferConstructor.cpp:
(JSC::constructArrayBuffer):

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

2 years agoCrash due to infinite recursion via FrameSelection::updateAppearanceAfterLayout
antti@apple.com [Sat, 17 Jun 2017 13:02:08 +0000 (13:02 +0000)]
Crash due to infinite recursion via FrameSelection::updateAppearanceAfterLayout
https://bugs.webkit.org/show_bug.cgi?id=173468

Reviewed by Ryosuke Niwa.

Source/WebCore:

Test: editing/selection/updateAppearanceAfterLayout-recursion.html

Calling FrameSelection::updateAppearanceAfterLayout() from Document::resolveStyle is unsafe
because it may cause another call to resolveStyle. We have some cases where the style
is still unclean when updateAppearanceAfterLayout() is called. This can lead to infinite
recursion.

The test case is not the common stack seen in CrashTracer (couldn't quit replicate it) but
the updateAppearanceAfterLayout/resolveStyle recursion is the same.

* dom/Document.cpp:
(WebCore::Document::resolveStyle):

    Normally selection appearance update is done in post-layout but not all style resolutions schedule a layout.
    Invoke it asynchronously in that case instead of the previous synchronous call.

* editing/FrameSelection.cpp:
(WebCore::FrameSelection::FrameSelection):
(WebCore::FrameSelection::updateAppearanceAfterLayout):
(WebCore::FrameSelection::scheduleAppearanceUpdateAfterStyleChange):
(WebCore::FrameSelection::appearanceUpdateTimerFired):
(WebCore::FrameSelection::updateAppearanceAfterLayoutOrStyleChange):
* editing/FrameSelection.h:

LayoutTests:

* editing/selection/updateAppearanceAfterLayout-recursion-expected.txt: Added.
* editing/selection/updateAppearanceAfterLayout-recursion.html: Added.

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

2 years ago[Win] Update expectations for layout tests.
pvollan@apple.com [Sat, 17 Jun 2017 12:31:13 +0000 (12:31 +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@218450 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoArrayPrototype methods should use JSValue::toLength for non-Arrays.
keith_miller@apple.com [Sat, 17 Jun 2017 10:52:34 +0000 (10:52 +0000)]
ArrayPrototype methods should use JSValue::toLength for non-Arrays.
https://bugs.webkit.org/show_bug.cgi?id=173506

JSTests:

Reviewed by Ryosuke Niwa.

Re-baseline tests.

* ChakraCore/test/Function/apply3.baseline-jsc:
* test262.yaml:

Source/JavaScriptCore:

Reviewed by Ryosuke Niwa.

This patch changes the result of unshift if old length +
unshift.arguments.length > (2 ** 53) - 1 to be a type error. Also,
the getLength function, which was always incorrect to use, has
been removed. Additionally, some cases where we were using a
constant for (2 ** 53) - 1 have been replaced with
maxSafeInteger()

* interpreter/Interpreter.cpp:
(JSC::sizeOfVarargs):
* runtime/ArrayPrototype.cpp:
(JSC::arrayProtoFuncToLocaleString):
(JSC::arrayProtoFuncPop):
(JSC::arrayProtoFuncPush):
(JSC::arrayProtoFuncReverse):
(JSC::arrayProtoFuncShift):
(JSC::arrayProtoFuncSlice):
(JSC::arrayProtoFuncSplice):
(JSC::arrayProtoFuncUnShift):
(JSC::arrayProtoFuncIndexOf):
(JSC::arrayProtoFuncLastIndexOf):
* runtime/JSArrayInlines.h:
(JSC::getLength): Deleted.
* runtime/JSCJSValue.cpp:
(JSC::JSValue::toLength):
* runtime/NumberConstructor.cpp:
(JSC::numberConstructorFuncIsSafeInteger):

LayoutTests:

Unreviewed test gardening.

* TestExpectations:

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

2 years agoUnreviewed test gardening. Remove duplicate entries for tests.
pvollan@apple.com [Sat, 17 Jun 2017 07:54:42 +0000 (07:54 +0000)]
Unreviewed test gardening. Remove duplicate entries for tests.

* platform/win/TestExpectations:

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

2 years agoFix Mac CMake build.
achristensen@apple.com [Sat, 17 Jun 2017 07:47:16 +0000 (07:47 +0000)]
Fix Mac CMake build.

* PlatformMac.cmake:

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

2 years agoREGRESSION(r209495): materiauxlaverdure.com fails to load
rniwa@webkit.org [Sat, 17 Jun 2017 07:21:13 +0000 (07:21 +0000)]
REGRESSION(r209495): materiauxlaverdure.com fails to load
https://bugs.webkit.org/show_bug.cgi?id=173301
<rdar://problem/32624850>

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

Rebaselined the tests that are now passing.

* web-platform-tests/cssom/CSSNamespaceRule-expected.txt:
* web-platform-tests/cssom/serialize-values-expected.txt:

Source/WebCore:

The bug was caused by WebKit wrapping CSS string values with single quotation marks instead of
double quotation marks as spec'ed in https://drafts.csswg.org/cssom/#serialize-a-string and
implemented in Firefox and Chrome.

The website eval's the computed value of the `content` CSS property with the value `'{name: "flat"}'`
after stripping single quotation marks from both ends. Prior to r209495, WebKit serialized this CSS value
in single quotations without escaping double quotations. After r209495, double quotations are escaped
with backslashes as `'{name: \"flat\"}'`. As a result, `eval` is invoked with `{name: \"flat\"}`
after stripping single quotations from both ends, which resulted in an exception.

Chrome and Firefox don't encounter this exception despite of the fact they escape double quotations
as well because serialize with double quotations as `"{name: \"flat\"}"`. Because there is no code
to strip double quotations, eval is invoked with the same string, resulting in the entire value as
being parsed as string, instead of an object with a single key "name" with the value of "flat" as
was the case in WebKit prior to r209495. While this behavior was most certainly not the intent of
the website author, Chrome and Firefox don't encounter an exception and the website continues to work.

This patch aligns WebKit's behavior to that of the CSS OM specification, Firefox, and Chrome by
serializing CSS string values using double quotation marks instead of single quotation marks.

Note: inline change log comments are added below for every call site of serializeString for clarity.

Test: fast/css/getPropertyValue-serialization-with-double-quotes.html

* css/CSSBasicShapes.cpp:
(WebCore::buildPathString): Use double quotation marks in path(~) of shapes.
* css/CSSMarkup.cpp:
(WebCore::serializeString):
(WebCore::serializeURL): Use double quotation marks to serialize URLs.
(WebCore::serializeAsStringOrCustomIdent): Use double quotation marks to serialize strings. We still avoid
using wrapping the value with double quotations when the value can be an identifier. See r209495.
(WebCore::serializeFontFamily): Ditto for font-family names such as "San Francisco".
* css/CSSMarkup.h:
* css/CSSNamespaceRule.cpp:
(WebCore::CSSNamespaceRule::cssText): Use double quotation marks to serialize namespace URIs.
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText): Use double quotation marks to serialize
the separators; e.g. counter(sectionNumber, ".") to produce "1.".
* css/CSSSelector.cpp:
(WebCore::CSSSelector::selectorText): Use double quotation marks to serialize attribute values.
* css/parser/CSSParserToken.cpp:
(WebCore::CSSParserToken::serialize): Use double quotation marks to serialize strings in @support.
* editing/EditingStyle.cpp:
(WebCore::StyleChange::extractTextStyles): Updated to strip double quotation marks in font family names to
maintain the compatibility with old versions of Microsoft Outlook.
* html/HTMLElement.cpp:
(WebCore::HTMLElement::mapLanguageAttributeToLocale): Use double quotations marks to serialize the value
of the lang content attribute. It doesn't matter which one is used here because it's only a temporary value
only fed into the CSS parser to set the equivalent CSS value from the content attribute.

LayoutTests:

Rebaselined the existing tests and added a new regression test for serializing CSS properties and values.

* accessibility/mac/alt-for-css-content-expected.txt:
* accessibility/mac/webkit-alt-for-css-content-expected.txt:
* editing/pasteboard/cjk-line-height-expected.txt:
* fast/css/alt-inherit-initial-expected.txt:
* fast/css/alt-inherit-initial.html:
* fast/css/content-language-comma-separated-list-expected.txt:
* fast/css/content-language-empty-expected.txt:
* fast/css/content-language-only-whitespace-expected.txt:
* fast/css/content-language-with-whitespace-expected.txt:
* fast/css/counters/counter-cssText-expected.txt:
* fast/css/counters/counter-cssText.html:
* fast/css/font-family-trailing-bracket-gunk-expected.txt:
* fast/css/font-family-trailing-bracket-gunk.html:
* fast/css/getComputedStyle/computed-style-font-family-expected.txt:
* fast/css/getComputedStyle/computed-style-properties-expected.txt:
* fast/css/getComputedStyle/computed-style-properties.html:
* fast/css/getComputedStyle/font-family-fallback-reset-expected.txt:
* fast/css/getComputedStyle/font-family-fallback-reset.html:
* fast/css/lang-mapped-to-webkit-locale-expected.txt:
* fast/css/lang-mapped-to-webkit-locale.xhtml:
* fast/css/serialization-with-double-quotes-expected.txt: Added.
* fast/css/serialization-with-double-quotes.html: Added.
* fast/css/uri-token-parsing-expected.txt:
* fast/css/uri-token-parsing.html:
* fast/inspector-support/cssURLQuotes-expected.txt:
* fast/inspector-support/style-expected.txt:
* fast/text/font-stretch-parse-expected.txt:
* fast/text/font-stretch-parse.html:
* fast/text/font-style-parse-expected.txt:
* fast/text/font-style-parse.html:
* fast/text/font-weight-parse-expected.txt:
* fast/text/font-weight-parse.html:
* media/controls/track-menu.html:
* platform/mac-elcapitan/fast/css/getComputedStyle/computed-style-font-family-expected.txt:
* platform/mac-elcapitan/fast/text/font-stretch-parse-expected.txt:
* platform/mac-elcapitan/fast/text/font-style-parse-expected.txt:
* platform/mac-elcapitan/fast/text/font-weight-parse-expected.txt:

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

2 years ago[GTK] Rename WebContextMenuItemGtk as WebContextMenuItemGlib
carlosgc@webkit.org [Sat, 17 Jun 2017 07:21:03 +0000 (07:21 +0000)]
[GTK] Rename WebContextMenuItemGtk as WebContextMenuItemGlib
https://bugs.webkit.org/show_bug.cgi?id=173469

Reviewed by Michael Catanzaro.

Now that we switched to GAction this is actually a glib implementation, we keep the GtkAction support only for
backwards compatibility. We could rename the file and make the GtkAction action conditional to the GTK+ port.

* PlatformGTK.cmake:
* Shared/glib/WebContextMenuItemGlib.cpp: Renamed from Source/WebKit2/Shared/gtk/WebContextMenuItemGtk.cpp.
(WebKit::gtkStockIDFromContextMenuAction):
(WebKit::WebContextMenuItemGlib::WebContextMenuItemGlib):
(WebKit::WebContextMenuItemGlib::~WebContextMenuItemGlib):
(WebKit::WebContextMenuItemGlib::buildActionName):
(WebKit::WebContextMenuItemGlib::createActionIfNeeded):
* Shared/glib/WebContextMenuItemGlib.h: Renamed from Source/WebKit2/Shared/gtk/WebContextMenuItemGtk.h.
* UIProcess/API/gtk/WebKitContextMenu.cpp:
(webkitContextMenuPopulate):
* UIProcess/API/gtk/WebKitContextMenuActions.cpp:
(webkitContextMenuActionGetForContextMenuItem):
* UIProcess/API/gtk/WebKitContextMenuActionsPrivate.h:
* UIProcess/API/gtk/WebKitContextMenuItem.cpp:
(webkitContextMenuItemCreate):
(webkitContextMenuItemToWebContextMenuItemGlib):
(webkit_context_menu_item_new):
(webkit_context_menu_item_new_from_gaction):
(webkit_context_menu_item_new_from_stock_action):
(webkit_context_menu_item_new_from_stock_action_with_label):
(webkit_context_menu_item_new_with_submenu):
(webkit_context_menu_item_new_separator):
* UIProcess/API/gtk/WebKitContextMenuItemPrivate.h:
* UIProcess/API/gtk/WebKitContextMenuPrivate.h:
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkitWebViewPopulateContextMenu):
* UIProcess/gtk/WebContextMenuProxyGtk.cpp:
(WebKit::WebContextMenuProxyGtk::append):
(WebKit::WebContextMenuProxyGtk::buildMenu):
(WebKit::WebContextMenuProxyGtk::populate):
* UIProcess/gtk/WebContextMenuProxyGtk.h:

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

2 years ago[Cocoa] Some declarations have missing or incorrect availability attributes
mitz@apple.com [Sat, 17 Jun 2017 06:28:09 +0000 (06:28 +0000)]
[Cocoa] Some declarations have missing or incorrect availability attributes
https://bugs.webkit.org/show_bug.cgi?id=173508

Reviewed by Tim Horton.

Source/WebKit2:

* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h: Removed a redundant attribute.

In all of the below files, added missing availability attributes for declarations that have
not appeared yet in any GM SDK, and fixed availability attributes for declarations that
have already appeared in the macOS 10.12.3 and iOS 10.3 SDKs.

* UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h:
* UIProcess/API/Cocoa/WKHTTPCookieStore.h:
* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
* UIProcess/API/Cocoa/WKPreferences.h: Also fixed capitalization in a comment.
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Also removed unnecessary conditionals.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _draggableElementAtPosition:]): Prepended an underscore to this private method’s name.
(-[WKWebView _requestDraggableElementAtPosition:completionBlock:]): Ditto.
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
* UIProcess/API/Cocoa/WKWebViewPrivate.h: Also updated for renames.
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
* UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
* UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h:
* UIProcess/API/Cocoa/_WKGeolocationCoreLocationProvider.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.h:
* UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h:
* UIProcess/API/Cocoa/_WKUserContentFilterPrivate.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.h:
* UIProcess/_WKWebViewPrintFormatter.h:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.h:

Tools:

* TestWebKitAPI/Tests/ios/PositionInformationTests.mm:
(TestWebKitAPI::TEST): Updated for renames.

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

2 years ago[Win] Update expectations for layout tests.
pvollan@apple.com [Sat, 17 Jun 2017 06:07:14 +0000 (06:07 +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@218443 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoUnreviewed test gardening. Update test expectations for failing tests.
pvollan@apple.com [Sat, 17 Jun 2017 05:47:08 +0000 (05:47 +0000)]
Unreviewed test gardening. Update test expectations for failing tests.

* platform/win/TestExpectations:

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

2 years ago[WebRTC] CrashTracer: Regression : com.apple.WebKit.Networking at WebKit: WebKit...
commit-queue@webkit.org [Sat, 17 Jun 2017 03:42:34 +0000 (03:42 +0000)]
[WebRTC] CrashTracer: Regression : com.apple.WebKit.Networking at WebKit: WebKit::LibWebRTCSocketClient::sendTo
https://bugs.webkit.org/show_bug.cgi?id=173501

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

When a libwebrtc socket fails to be created in the network process,
the network process sends back a close message, but it keeps it in a map.
If the web process sends a message dedicated to this socket, we will try
processing it and calling the socket which is null, hence the cache.
This patch makes it so that if the socket is null, it is not added to the map.

* NetworkProcess/webrtc/LibWebRTCSocketClient.cpp:
(WebKit::LibWebRTCSocketClient::LibWebRTCSocketClient):
* NetworkProcess/webrtc/NetworkRTCProvider.cpp:
(WebKit::NetworkRTCProvider::createSocket):
(WebKit::NetworkRTCProvider::createUDPSocket):
(WebKit::NetworkRTCProvider::createServerTCPSocket):
(WebKit::NetworkRTCProvider::createClientTCPSocket):
* NetworkProcess/webrtc/NetworkRTCProvider.h:

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

2 years agoWeb Inspector: Instrument 2D/WebGL canvas contexts in the backend
mattbaker@apple.com [Sat, 17 Jun 2017 02:58:24 +0000 (02:58 +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 and Joseph Pecoraro.

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@218440 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoAdd a WebKit2 setting to control whether media documents should automatically enter...
commit-queue@webkit.org [Sat, 17 Jun 2017 02:39:20 +0000 (02:39 +0000)]
Add a WebKit2 setting to control whether media documents should automatically enter fullscreen
https://bugs.webkit.org/show_bug.cgi?id=173503

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

Source/WebCore:

New WebCore setting to specify whether a media document should automatically enter fullscreen.

* page/Settings.in:

Source/WebKit2:

New WebKit2 setting to specify whether a media document should automatically enter fullscreen.

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

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

2 years ago[MSE] Seeking or entering fullscreen can cause extreme CPU usage
jer.noble@apple.com [Sat, 17 Jun 2017 02:20:02 +0000 (02:20 +0000)]
[MSE] Seeking or entering fullscreen can cause extreme CPU usage
https://bugs.webkit.org/show_bug.cgi?id=173505

Reviewed by Tim Horton.

When support for painting MSE to WebGL was added in r217185, the implementation of
SourceBufferPrivateAVFObjC::isReadyForMoreSamples() was modified to support asking
the decompression session if it was ready. That change, however, caused an extreme
performance regression in the normal playback path, where WebKit will effectively
append samples endlessly to the AVSampleBufferDisplayLayer, which admirably enqueued
each of them for decoding. Eventually, the cost of iterating over the CMBufferQueue
overwhelmed the cost of decoding, and caused the extreme lag seen when seeking.

Make sure to property query the AVSampleBufferDisplayLayer for isReadyForMoreMediaData
before enqueuing.

* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::isReadyForMoreSamples):

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

2 years ago[WebIDL] Remove custom bindings for HTMLDocument
weinig@apple.com [Sat, 17 Jun 2017 01:19:28 +0000 (01:19 +0000)]
[WebIDL] Remove custom bindings for HTMLDocument
https://bugs.webkit.org/show_bug.cgi?id=173444

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

* web-platform-tests/html/dom/dynamic-markup-insertion/closing-the-input-stream/document.close-01-expected.txt:
* web-platform-tests/html/dom/dynamic-markup-insertion/document-write/document.write-01-expected.txt:
* web-platform-tests/html/dom/dynamic-markup-insertion/document-writeln/document.writeln-01-expected.txt:
* web-platform-tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/document.open-01-expected.txt:
* web-platform-tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/document.open-02-expected.txt:
Update now passing results.

Source/WebCore:

* bindings/js/JSDOMBindingSecurity.cpp:
(WebCore::canAccessDocument):
(WebCore::BindingSecurity::shouldAllowAccessToFrame):
(WebCore::BindingSecurity::shouldAllowAccessToDOMWindow):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::showModalDialog):
Pass ExecState by reference to window accessors.

* bindings/js/JSDOMWindowBase.cpp:
(WebCore::incumbentDOMWindow):
(WebCore::activeDOMWindow):
(WebCore::firstDOMWindow):
(WebCore::callerDocument):
* bindings/js/JSDOMWindowBase.h:
Pass ExecState by reference to window accessors and add callerDocument.

* bindings/js/JSHTMLDocumentCustom.cpp:
(WebCore::JSHTMLDocument::getOwnPropertySlot): Deleted.
(WebCore::JSHTMLDocument::all): Deleted.
(WebCore::JSHTMLDocument::setAll): Deleted.
(WebCore::findCallingDocument): Deleted.
(WebCore::JSHTMLDocument::open): Deleted.
(WebCore::documentWrite): Deleted.
(WebCore::JSHTMLDocument::write): Deleted.
Remove custom bindings.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateCallWith):
Add support CallWith=CallerDocument

* bindings/scripts/IDLAttributes.json:
Remove CallerWindow, which has not been supported for a while. CallerDocument, despite
having it's support removed in the past, was still listed, so keep it.

* bindings/scripts/test/JS/JSTestObj.cpp:
Update test results.

* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createHTMLDocument):
Update for new signature of Document.write().

* dom/Document.h:
* dom/Document.idl:
* dom/Document.cpp:
(WebCore::Document::open):
Add DOMWindow returning overload that calls through to the DOMWindow.
Add return value and currently not utilized parameters to the Document returning overload.
Update to return exceptions as specified.

(WebCore::Document::close):
Update to return exceptions as specified.

(WebCore::Document::write):
(WebCore::Document::writeln):
Update to take a Vector<String> argument and the caller Document first
as per convention and return exceptions as specified.

(WebCore::Document::bgColor):
(WebCore::Document::setBgColor):
(WebCore::Document::fgColor):
(WebCore::Document::setFgColor):
(WebCore::Document::alinkColor):
(WebCore::Document::setAlinkColor):
(WebCore::Document::linkColorForBindings):
(WebCore::Document::setLinkColorForBindings):
(WebCore::Document::vlinkColor):
(WebCore::Document::setVlinkColor):
(WebCore::Document::clear):
(WebCore::Document::captureEvents):
(WebCore::Document::releaseEvents):
Move from HTMLDocument.

* html/HTMLDocument.cpp:
(WebCore::HTMLDocument::bgColor): Deleted.
(WebCore::HTMLDocument::setBgColor): Deleted.
(WebCore::HTMLDocument::fgColor): Deleted.
(WebCore::HTMLDocument::setFgColor): Deleted.
(WebCore::HTMLDocument::alinkColor): Deleted.
(WebCore::HTMLDocument::setAlinkColor): Deleted.
(WebCore::HTMLDocument::linkColor): Deleted.
(WebCore::HTMLDocument::setLinkColor): Deleted.
(WebCore::HTMLDocument::vlinkColor): Deleted.
(WebCore::HTMLDocument::setVlinkColor): Deleted.
(WebCore::HTMLDocument::clear): Deleted.
(WebCore::HTMLDocument::captureEvents): Deleted.
(WebCore::HTMLDocument::releaseEvents): Deleted.
* html/HTMLDocument.h:
* html/HTMLDocument.idl:
Moved operations and attributes to Document.

* inspector/DOMPatchSupport.cpp:
(WebCore::DOMPatchSupport::patchDocument):
Update for new signature of Document.write().

* page/DOMWindow.cpp:
(WebCore::DOMWindow::postMessage):
(WebCore::DOMWindow::focus):
* page/DOMWindow.h:
Use the term incumbentWindow, matching IDL, and so not to be confused
with the callerWindow, which is slightly different.

Source/WebKit/mac:

* DOM/DOMHTMLDocument.mm:
(-[DOMHTMLDocument linkColor]):
(-[DOMHTMLDocument setLinkColor:]):
(-[DOMHTMLDocument write:]):
(-[DOMHTMLDocument writeln:]):
Update for new signature of write/writeln and rename of linkColor to linkColorForBindings.

Source/WebKit/win:

* DOMHTMLClasses.cpp:
(DOMHTMLDocument::write):
(DOMHTMLDocument::writeln):
Update for new signature of write/writeln.

Source/WebKit2:

* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.cpp:
(webkit_dom_html_document_get_link_color):
(webkit_dom_html_document_set_link_color):
Update for rename of linkColor to linkColorForBindings.

LayoutTests:

* dom/xhtml/level2/html/HTMLDocument17-expected.txt:
* dom/xhtml/level2/html/HTMLDocument18-expected.txt:
* dom/xhtml/level2/html/HTMLDocument19-expected.txt:
* dom/xhtml/level2/html/HTMLDocument20-expected.txt:
* dom/xhtml/level2/html/HTMLDocument21-expected.txt:
Update test results for correct exception being thrown.

* fast/dom/frame-deleted-in-document-open-expected.txt: Removed.
* fast/dom/frame-deleted-in-document-open.html: Removed.
* http/tests/security/isolatedWorld/document-open-expected.txt: Removed.
* http/tests/security/isolatedWorld/document-open.html: Removed.
Remove two tests that were testing the behavior of document.open using javascript
to call the window.open operation. This is not how it is specified and no
longer how it is implemented.

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

2 years agoFix Mac CMake build.
achristensen@apple.com [Sat, 17 Jun 2017 01:10:42 +0000 (01:10 +0000)]
Fix Mac CMake build.

.:

* Source/cmake/WebKitFS.cmake:
Add new DerivedSources/WTF directory.

Source/WTF:

* wtf/PlatformMac.cmake:
Generate MachExceptionsServer.h

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

2 years agoCleanup: WebContextMenuClient::searchWithGoogle() should parse URL using URL { URL...
dbates@webkit.org [Sat, 17 Jun 2017 00:55:56 +0000 (00:55 +0000)]
Cleanup: WebContextMenuClient::searchWithGoogle() should parse URL using URL { URL { }, ... }
instead of URL { ParsedURLString, ... }
https://bugs.webkit.org/show_bug.cgi?id=173495
<rdar://problem/32827445>

Reviewed by Alex Christensen.

URL(ParsedURLString, ...) should only be used with a string that was the result of URL::string().
Otherwise, it will cause an assertion failure if the canonicalized URL differs from the string.
Although it is unlikely that the hardcoded string in WebContextMenuClient::searchWithGoogle()
would differ from the canonicalized URL it is best practice to use URL(URL(), ...) to
parse an arbitrary string that looks like a URL.

Also modernize the code using C++14 idioms.

Source/WebKit/win:

* WebCoreSupport/WebContextMenuClient.cpp:
(WebContextMenuClient::searchWithGoogle):

Source/WebKit2:

* WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
(WebKit::WebContextMenuClient::searchWithGoogle):

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

2 years agoRemove header OptionSet.h from FrameLoaderTypes.h
dbates@webkit.org [Sat, 17 Jun 2017 00:50:53 +0000 (00:50 +0000)]
Remove header OptionSet.h from FrameLoaderTypes.h
https://bugs.webkit.org/show_bug.cgi?id=173489

Reviewed by Joseph Pecoraro.

Although the header FrameLoaderTypes.h defines exactly one enum class, ReloadOption, whose
enumerators conform the power of two prerequisite for parameterizing an OptionSet for it
FrameLoaderTypes.h does not actually make use of the functionality provided by header
OptionSet.h. And not all source files that include FrameLoaderTypes.h need to use an OptionSet.

* loader/DocumentLoader.h: Include <wtf/OptionSet.h>.
* loader/FrameLoader.h: Ditto.
* loader/FrameLoaderTypes.h: Remove header <wtf/OptionSet.h>.
* replay/UserInputBridge.h: Include <wtf/Forward.h>.

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

2 years ago[iOS DnD] Upstream iOS drag and drop implementation into OpenSource WebKit
wenson_hsieh@apple.com [Sat, 17 Jun 2017 00:33:23 +0000 (00:33 +0000)]
[iOS DnD] Upstream iOS drag and drop implementation into OpenSource WebKit
https://bugs.webkit.org/show_bug.cgi?id=173366
<rdar://problem/32767014>

Reviewed by Tim Horton.

Source/JavaScriptCore:

Introduce ENABLE_DATA_INTERACTION and ENABLE_DRAG_SUPPORT to FeatureDefines.xcconfig.

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

Moves all drag and drop logic previously hidden behind WebKitAdditions into the open source repository, along
with unit test pages in TestWebKitAPI. Also removes all #includes and #imports of dragging-related files in
WebKitAdditions from the open source repository.

This initial upstreaming phase is only concerned with moving code out of WebKitAdditions, and attempts to
preserve the code as-is, with the exception of trivial style changes so that the open source linter passes.
Future patches will remove the DATA_INTERACTION feature flag altogether and unobscure all variable and function
names referencing "data interaction".

No change in behavior from the internal build.

* Configurations/FeatureDefines.xcconfig:
* page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::createDraggingDataTransfer):
(WebCore::EventHandler::eventLoopHandleMouseDragged):
(WebCore::EventHandler::tryToBeginDataInteractionAtPoint):
* platform/ios/DragImageIOS.mm:
(WebCore::dragImageSize):
(WebCore::scaleDragImage):
(WebCore::createDragImageFromImage):
(WebCore::deleteDragImage):
(WebCore::createDragImageForLink):
(WebCore::createDragImageIconForCachedImageFilename):
(WebCore::platformAdjustDragImageForDeviceScaleFactor):
(WebCore::createDragImageForSelection):
(WebCore::dissolveDragImageToFraction):
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::Pasteboard):
(WebCore::Pasteboard::setDragImage):
(WebCore::Pasteboard::createForDragAndDrop):
* platform/mac/DragDataMac.mm:
(WebCore::rtfPasteboardType):
(WebCore::rtfdPasteboardType):
(WebCore::stringPasteboardType):
(WebCore::urlPasteboardType):
(WebCore::htmlPasteboardType):
(WebCore::colorPasteboardType):
(WebCore::pdfPasteboardType):
(WebCore::tiffPasteboardType):
(WebCore::DragData::asFilenames):
(WebCore::DragData::containsURL):
(rtfPasteboardType): Deleted.
(rtfdPasteboardType): Deleted.
(stringPasteboardType): Deleted.
(urlPasteboardType): Deleted.
(htmlPasteboardType): Deleted.
(colorPasteboardType): Deleted.
(pdfPasteboardType): Deleted.
(tiffPasteboardType): Deleted.

Source/WebCore/PAL:

Introduce ENABLE_DATA_INTERACTION and ENABLE_DRAG_SUPPORT to FeatureDefines.xcconfig.

* Configurations/FeatureDefines.xcconfig:

Source/WebKit/mac:

Move pieces of iOS WebKit1 drag and drop implementation into OpenSource. No change in behavior.

* Configurations/FeatureDefines.xcconfig:
* WebCoreSupport/WebDragClient.mm:
(WebDragClient::useLegacyDragClient):
(WebDragClient::willPerformDragDestinationAction):
(WebDragClient::dragSourceActionMaskForPoint):
(WebDragClient::willPerformDragSourceAction):
(WebDragClient::startDrag):
(WebDragClient::beginDrag):
(WebDragClient::declareAndWriteDragImage):
(WebDragClient::declareAndWriteAttachment):
(WebDragClient::didConcludeEditDrag):
* WebView/WebView.mm:
(-[WebView _setDataInteractionData:textIndicator:atClientPosition:anchorPoint:action:]):
(-[WebView _getDataInteractionData]):
(-[WebView dragDataForSession:client:global:operation:]):
(-[WebView _enteredDataInteraction:client:global:operation:]):
(-[WebView _updatedDataInteraction:client:global:operation:]):
(-[WebView _exitedDataInteraction:client:global:operation:]):
(-[WebView _performDataInteraction:client:global:operation:]):
(-[WebView _tryToPerformDataInteraction:client:global:operation:]):
(-[WebView _endedDataInteraction:global:]):
(-[WebView _didConcludeEditDataInteraction]):
(floatRectsForCGRectArray): Deleted.
(-[WebView _createImageWithPlatterForImage:boundingRect:contentScaleFactor:clippingRects:]): Deleted.
* WebView/WebViewData.h:
* WebView/WebViewData.mm:
(-[WebViewPrivate dealloc]):
* WebView/WebViewPrivate.h:

Source/WebKit2:

Move pieces of iOS WebKit2 drag and drop implementation into OpenSource. No change in behavior.

* Configurations/FeatureDefines.xcconfig:
* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::setDragImage):
(WebKit::WebPageProxy::setPromisedDataForImage):
(WebKit::WebPageProxy::setPromisedDataForAttachment):
(WebKit::WebPageProxy::setDragCaretRect):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(longPressActionDelayAfterLift):
(-[WKContentView webViewUIDelegate]):
(-[WKContentView setupDataInteractionDelegates]):
(-[WKContentView teardownDataInteractionDelegates]):
(-[WKContentView _startDataInteractionWithImage:withIndicatorData:atClientPosition:anchorPoint:action:]):
(-[WKContentView _didHandleStartDataInteractionRequest:]):
(uiImageForImage):
(shouldUseTextIndicatorToCreatePreviewForDragAction):
(-[WKContentView dragPreviewForImage:frameInRootViewCoordinates:clippingRectsInFrameCoordinates:backgroundColor:]):
(-[WKContentView dragPreviewForCurrentDataInteractionState]):
(-[WKContentView performDeferredActionAtDragOrigin]):
(-[WKContentView cancelDeferredActionAtDragOrigin]):
(-[WKContentView computeClientAndGlobalPointsForDropSession:outClientPoint:outGlobalPoint:]):
(dropOperationForWebCoreDragOperation):
(-[WKContentView dragDataForDropSession:dragDestinationAction:]):
(-[WKContentView cleanUpDragSourceSessionState]):
(extractItemProvidersFromDragItems):
(extractItemProvidersFromDropSession):
(-[WKContentView _didConcludeEditDataInteraction:]):
(-[WKContentView _didPerformDataInteractionControllerOperation:]):
(-[WKContentView _transitionDragPreviewToImageIfNecessary:]):
(-[WKContentView _didChangeDataInteractionCaretRect:currentRect:]):
(-[WKContentView _dragDestinationActionForDropSession:]):
(positionInformationMayStartDataInteraction):
(-[WKContentView currentDragOrDropSession]):
(-[WKContentView _dragInteraction:prepareForSession:completion:]):
(-[WKContentView dragInteraction:itemsForBeginningSession:]):
(-[WKContentView _api_dragInteraction:previewForLiftingItem:session:]):
(-[WKContentView dragInteraction:sessionWillBegin:]):
(-[WKContentView _api_dragInteraction:session:didEndWithOperation:]):
(-[WKContentView dragInteraction:previewForCancellingItem:withDefault:]):
(-[WKContentView _api_dragInteraction:item:willAnimateCancelWithAnimator:]):
(-[WKContentView dropInteraction:canHandleSession:]):
(-[WKContentView _api_dropInteraction:sessionDidEnter:]):
(-[WKContentView _api_dropInteraction:sessionDidUpdate:]):
(-[WKContentView dropInteraction:sessionDidExit:]):
(-[WKContentView dropInteraction:performDrop:]):
(-[WKContentView dropInteraction:previewForDroppingItem:withDefault:]):
(-[WKContentView dropInteraction:sessionDidEnd:]):
(-[WKContentView _simulateDataInteractionEntered:]):
(-[WKContentView _simulateDataInteractionUpdated:]):
(-[WKContentView _simulateDataInteractionEnded:]):
(-[WKContentView _simulateDataInteractionPerformOperation:]):
(-[WKContentView _simulateDataInteractionSessionDidEnd:]):
(-[WKContentView _simulateWillBeginDataInteractionWithSession:]):
(-[WKContentView _simulatedItemsForSession:]):
(-[WKContentView _simulatePrepareForDataInteractionSession:completion:]):
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::convertCGImageToBitmap):
(WebKit::WebDragClient::startDrag):
(WebKit::WebDragClient::declareAndWriteDragImage):
(WebKit::WebDragClient::didConcludeEditDrag):
(WebKit::WebDragClient::declareAndWriteAttachment):

Source/WTF:

Define ENABLE_DRAG_SUPPORT as 1 by default and 0 for iOS, and define ENABLE_DATA_INTERACTION as 0 by default.
These are overridden to both be 1 for iOS 11+ in the FeatureDefines.xcconfig within each individual project.

* wtf/Platform.h:

Tools:

Move test pages and pieces of DataInteractionSimulator hidden behind WebKitAdditions into TestWebKitAPI. No
change in behavior.

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/autofocus-contenteditable.html: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/background-image-link-and-input.html: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/contenteditable-and-textarea.html: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/div-and-large-image.html: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/file-uploading.html: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/image-and-contenteditable.html: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/image-and-textarea.html: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/link-and-input.html: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/link-and-target-div.html: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/prevent-operation.html: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/prevent-start.html: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/textarea-to-input.html: Added.
* TestWebKitAPI/ios/DataInteractionSimulator.mm:
(-[MockDragDropSession initWithItems:location:window:]):
(-[MockDragDropSession allowsMoveOperation]):
(-[MockDragDropSession isRestrictedToDraggingApplication]):
(-[MockDragDropSession hasItemsConformingToTypeIdentifiers:]):
(-[MockDragDropSession canLoadObjectsOfClass:]):
(-[MockDragDropSession canLoadObjectsOfClasses:]):
(-[MockDragDropSession items]):
(-[MockDragDropSession setItems:]):
(-[MockDragDropSession locationInView:]):
(-[MockDataOperationSession initWithProviders:location:window:]):
(-[MockDataOperationSession session]):
(-[MockDataOperationSession isLocal]):
(-[MockDataOperationSession progress]):
(-[MockDataOperationSession setProgressIndicatorStyle:]):
(-[MockDataOperationSession progressIndicatorStyle]):
(-[MockDataOperationSession operationMask]):
(-[MockDataOperationSession localDragSession]):
(-[MockDataOperationSession hasItemsConformingToTypeIdentifier:]):
(-[MockDataOperationSession canCreateItemsOfClass:]):
(-[MockDataOperationSession loadObjectsOfClass:completion:]):
(-[MockDataInteractionSession initWithWindow:]):
(-[MockDataInteractionSession localOperationMask]):
(-[MockDataInteractionSession externalOperationMask]):
(-[MockDataInteractionSession session]):
(-[DataInteractionSimulator _advanceProgress]):

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

2 years agoWebRTC sockets should be closed at destruction time if not closed explicitly
commit-queue@webkit.org [Sat, 17 Jun 2017 00:29:38 +0000 (00:29 +0000)]
WebRTC sockets should be closed at destruction time if not closed explicitly
https://bugs.webkit.org/show_bug.cgi?id=173479

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

Source/WebKit2:

* WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
(WebKit::LibWebRTCSocket::~LibWebRTCSocket):
(WebKit::LibWebRTCSocket::Close):

LayoutTests:

* webrtc/datachannel/multiple-connections-expected.txt: Added.
* webrtc/datachannel/multiple-connections.html: Added.

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

2 years agoaddTransceiver should trigger mid generation in the SDP
commit-queue@webkit.org [Sat, 17 Jun 2017 00:27:33 +0000 (00:27 +0000)]
addTransceiver should trigger mid generation in the SDP
https://bugs.webkit.org/show_bug.cgi?id=173452

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

Source/WebCore:

Test: webrtc/video-addTransceiver.html

Adding support for recvonly SDP based on call to addTransceiver.
Using offer_to_receive options of libwebrtc for that purpose.

Making sure that addTransceiver and using a real track afterwards is working too.

* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::enqueueReplaceTrackTask): notify the backend that a track is added in case the sender has no track.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::shouldOfferAllowToReceiveAudio): Detect whether some audio mid should be recvonly.
(WebCore::LibWebRTCMediaEndpoint::shouldOfferAllowToReceiveVideo): Detect whether some video mid should be recvonly.
(WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:

LayoutTests:

* webrtc/routines.js:
(createConnections):
* webrtc/video-addTransceiver-expected.txt: Added.
* webrtc/video-addTransceiver.html: Added.

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

2 years agoFix Visual Studio 2017 64-bit build after r218258
achristensen@apple.com [Sat, 17 Jun 2017 00:20:54 +0000 (00:20 +0000)]
Fix Visual Studio 2017 64-bit build after r218258
https://bugs.webkit.org/show_bug.cgi?id=173308

* PlatformWin.cmake:
We still need the enable_language(ASM_MASM) even if we explicitly call ml64 with VS2017.
Otherwise CMake complains about a missing variable CMAKE_ASM_MASM_COMPILE_OBJECT.

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

2 years agoClean-up lint-test-expectation errors
jbedard@apple.com [Fri, 16 Jun 2017 23:50:32 +0000 (23:50 +0000)]
Clean-up lint-test-expectation errors

Unreviewed test gardening

* platform/ios-wk1/TestExpectations:
* platform/ios-wk2/TestExpectations:
* platform/win/TestExpectations:

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

2 years agoWebCore::LibWebRTCMediaEndpoint::gatherStatsForLogging is crashing
commit-queue@webkit.org [Fri, 16 Jun 2017 23:49:00 +0000 (23:49 +0000)]
WebCore::LibWebRTCMediaEndpoint::gatherStatsForLogging is crashing
https://bugs.webkit.org/show_bug.cgi?id=173493

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

Speculative preventive fix.

* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::gatherStatsForLogging):

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

2 years agoShow punycode to user if a URL has dotless i or j followed by diacritic dot
achristensen@apple.com [Fri, 16 Jun 2017 23:43:57 +0000 (23:43 +0000)]
Show punycode to user if a URL has dotless i or j followed by diacritic dot
https://bugs.webkit.org/show_bug.cgi?id=173431

Reviewed by Darin Adler.

Source/WebCore:

Covered by new API tests.

* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::isLookalikeCharacter):
(WebCore::allCharactersInIDNScriptWhiteList):
(WebCore::createStringWithEscapedUnsafeCharacters):

Tools:

* TestWebKitAPI/Tests/WebCore/cocoa/URLExtras.mm:
(TestWebKitAPI::TEST):

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

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