WebKit-https.git
5 years ago[ios-simulator] PositionInformationTests API tests are timing out
wenson_hsieh@apple.com [Fri, 21 Apr 2017 00:00:02 +0000 (00:00 +0000)]
[ios-simulator] PositionInformationTests API tests are timing out
https://bugs.webkit.org/show_bug.cgi?id=171089

Rubber-stamped by Tim Horton.

Addresses failures observed in the new position information tests added in r215573 by only running them if the
DATA_INTERACTION feature flag is enabled.

* TestWebKitAPI/Tests/ios/PositionInformationTests.mm:

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

5 years agoUpdate the MASM probe to only take 1 arg instead of 2 (in addition to the callback...
mark.lam@apple.com [Thu, 20 Apr 2017 23:55:45 +0000 (23:55 +0000)]
Update the MASM probe to only take 1 arg instead of 2 (in addition to the callback function).
https://bugs.webkit.org/show_bug.cgi?id=171088

Reviewed by Michael Saboff and Saam Barati.

Experience shows that we never use the 2nd arg.  So, let's remove it to reduce
the footprint at each probe site.

Also fix the MacroAssembler::print() function so that it is a no-op when
!ENABLE(MASM_PROBE).  This will allow us to have print() statements in JIT code
without a lot of #if ENABLE(MASM_PROBE)s later.

* assembler/AbstractMacroAssembler.h:
* assembler/MacroAssembler.cpp:
(JSC::stdFunctionCallback):
(JSC::MacroAssembler::probe):
* assembler/MacroAssembler.h:
* assembler/MacroAssemblerARM.cpp:
(JSC::MacroAssemblerARM::probe):
* assembler/MacroAssemblerARM.h:
* assembler/MacroAssemblerARM64.cpp:
(JSC::MacroAssemblerARM64::probe):
* assembler/MacroAssemblerARM64.h:
* assembler/MacroAssemblerARMv7.cpp:
(JSC::MacroAssemblerARMv7::probe):
* assembler/MacroAssemblerARMv7.h:
* assembler/MacroAssemblerPrinter.cpp:
(JSC::MacroAssemblerPrinter::printCallback):
* assembler/MacroAssemblerPrinter.h:
(JSC::MacroAssemblerPrinter::print):
(JSC::MacroAssembler::print):
* assembler/MacroAssemblerX86Common.cpp:
(JSC::MacroAssemblerX86Common::probe):
* assembler/MacroAssemblerX86Common.h:

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

5 years agoMark media/modern-media-controls/tracks-support/tracks-support-click-track-in-panel...
ryanhaddad@apple.com [Thu, 20 Apr 2017 23:53:28 +0000 (23:53 +0000)]
Mark media/modern-media-controls/tracks-support/tracks-support-click-track-in-panel.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=169109

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

5 years agoMark imported/w3c/web-platform-tests/WebCryptoAPI/sign_verify/ecdsa.worker.html as...
ryanhaddad@apple.com [Thu, 20 Apr 2017 23:53:25 +0000 (23:53 +0000)]
Mark imported/w3c/web-platform-tests/WebCryptoAPI/sign_verify/ecdsa.worker.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=170921

Unreviewed test gardening.

* TestExpectations:

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

5 years agoDisable header postprocessing when building for Sierra
mitz@apple.com [Thu, 20 Apr 2017 23:50:55 +0000 (23:50 +0000)]
Disable header postprocessing when building for Sierra

Absolutely rubber-stamped by Anders Carlsson.

* Configurations/WebKit.xcconfig:

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

5 years agoRemove one use of toPaymentAuthorizationStatus
andersca@apple.com [Thu, 20 Apr 2017 23:49:34 +0000 (23:49 +0000)]
Remove one use of toPaymentAuthorizationStatus
https://bugs.webkit.org/show_bug.cgi?id=171086

Reviewed by Tim Horton.

Just switch on the individual ApplePaySession::STATUS_ values.

* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::completeShippingMethodSelection):

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

5 years agoCocoa: add private API for suppressing first responder changes
mrajca@apple.com [Thu, 20 Apr 2017 23:42:00 +0000 (23:42 +0000)]
Cocoa: add private API for suppressing first responder changes
https://bugs.webkit.org/show_bug.cgi?id=171069
<rdar://problem/31658967>

Reviewed by Tim Horton.

Some clients may not want the web view to be programmatically made the first responder
and invoking -makeFirstResponder: unconditionally posts 'first responder did change'
notifications.

Added API test.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setShouldSuppressFirstResponderChanges:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::setShouldSuppressFirstResponderChanges):
* UIProcess/PageClient.h:
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::makeFirstResponder):

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

5 years agoSkip WebKit2.OpenAndCloseWindowAsyncCallbackException for now.
beidson@apple.com [Thu, 20 Apr 2017 23:27:16 +0000 (23:27 +0000)]
Skip WebKit2.OpenAndCloseWindowAsyncCallbackException for now.
https://bugs.webkit.org/show_bug.cgi?id=171083

Unreviewed.

* TestWebKitAPI/Tests/WebKit2Cocoa/OpenAndCloseWindow.mm:

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

5 years ago[WinCairo] Fix build break after updating ANGLE
commit-queue@webkit.org [Thu, 20 Apr 2017 23:11:52 +0000 (23:11 +0000)]
[WinCairo] Fix build break after updating ANGLE
https://bugs.webkit.org/show_bug.cgi?id=170980

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-04-20
Reviewed by Brent Fulgham.

Source/ThirdParty/ANGLE:

* CMakeLists.txt: Added some new source files.
* PlatformMac.cmake: Ditto.
* PlatformWin.cmake: Ditto. Remove a macro 'ANGLE_WEBKIT_WIN'
because SoftLinking is not used anymore.
* src/third_party/systeminfo/: Restored.

Source/WebCore:

By stopping using SoftLinking for ANGLE, some changes are needed
for WebCore and WebKit.
  - Define a macro 'GL_GLEXT_PROTOTYPES' before #include <GLES2/gl2.h> or <GLES2/gl2ext.h>.
  - Link libEGL import library explicitly.

* PlatformWin.cmake: Link libEGL to WebCore.
* platform/graphics/PlatformDisplay.cpp:
(WebCore::PlatformDisplay::initializeEGLDisplay): Removed the code for SoftLinking.
* platform/graphics/GLContext.cpp: Define GL_GLEXT_PROTOTYPES.
* platform/graphics/egl/GLContextEGL.cpp: Ditto.
* platform/graphics/opengl/Extensions3DOpenGLCommon.cpp: Ditto.
* platform/graphics/opengl/Extensions3DOpenGLES.h: Ditto.
* platform/graphics/opengl/TemporaryOpenGLSetting.cpp: Ditto.
* platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp: Ditto.

Source/WebKit/win:

* WebCoreSupport/AcceleratedCompositingContext.cpp: Define GL_GLEXT_PROTOTYPES.

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

5 years agoWeb Inspector: Add regular expression support to XHR breakpoints
mattbaker@apple.com [Thu, 20 Apr 2017 23:09:55 +0000 (23:09 +0000)]
Web Inspector: Add regular expression support to XHR breakpoints
https://bugs.webkit.org/show_bug.cgi?id=170099
<rdar://problem/31558082>

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/protocol/DOMDebugger.json:
New optional `isRegex` parameter denotes whether `url` contains
a regular expression.

Source/WebCore:

* inspector/InspectorDOMDebuggerAgent.cpp:
(WebCore::InspectorDOMDebuggerAgent::setXHRBreakpoint):
(WebCore::InspectorDOMDebuggerAgent::willSendXMLHttpRequest):
Use ContentSearchUtilities for both Text and RegularExpression breakpoints.

* inspector/InspectorDOMDebuggerAgent.h:
Associate XHR breakpoint with a type.

Source/WebInspectorUI:

* Localizations/en.lproj/localizedStrings.js:
New strings for the Add XHR Breakpoint popover.

* UserInterface/Controllers/DOMDebuggerManager.js:
(WebInspector.DOMDebuggerManager):
(WebInspector.DOMDebuggerManager.prototype.addXHRBreakpoint):
Update for new XHRBreakpoint constructor.
(WebInspector.DOMDebuggerManager.prototype._updateXHRBreakpoint):
Set `isRegex` flag.

* UserInterface/Main.html:
New files for CodeMirror mode and breakpoint popover.

* UserInterface/Models/XHRBreakpoint.js:
Breakpoint can be of type Text or RegularExpression.
(WebInspector.XHRBreakpoint):
(WebInspector.XHRBreakpoint.prototype.get type):
(WebInspector.XHRBreakpoint.prototype.get serializableInfo):

* UserInterface/Views/CodeMirrorRegexMode.css: Added.
(.cm-s-default .cm-regex-character-set):
(.cm-s-default .cm-regex-character-set-negate):
(.cm-s-default :matches(.cm-regex-escape, .cm-regex-escape-2, .cm-regex-escape-3)):
(.cm-s-default :matches(.cm-regex-group, .cm-regex-lookahead)):
(.cm-s-default .cm-regex-quantifier):
(.cm-s-default :matches(.cm-regex-literal, .cm-regex-special, .cm-regex-backreference)):
Colors for regular expression syntax highlighting. The regex mode emits
more class names than we have separate colors for, allowing for further
customization in the future.

* UserInterface/Views/CodeMirrorRegexMode.js: Added.
(characterSetTokenizer):
(consumeEscapeSequence):
(tokenBase):
New CodeMirror mode for highlighting "text/x-regex" content.

* UserInterface/Views/DebuggerSidebarPanel.js:
Use new popover type for creating XHR breakpoints.
(WebInspector.DebuggerSidebarPanel.prototype._addXHRBreakpointButtonClicked):
(WebInspector.DebuggerSidebarPanel.prototype.willDismissPopover):
(WebInspector.DebuggerSidebarPanel):

* UserInterface/Views/XHRBreakpointPopover.css: Added.
(.popover .xhr-breakpoint-content):
(.popover .xhr-breakpoint-content > .editor-wrapper):
(.popover .xhr-breakpoint-content > .editor-wrapper > .editor):
(body[dir=ltr] .popover .xhr-breakpoint-content > .editor-wrapper > .editor):
(body[dir=rtl] .popover .xhr-breakpoint-content > .editor-wrapper > .editor):
(.popover .xhr-breakpoint-content > .editor-wrapper > .editor > .CodeMirror):
(.popover .xhr-breakpoint-content > .editor-wrapper > .editor > .CodeMirror-scroll):
Styles for new popover.

* UserInterface/Views/XHRBreakpointPopover.js: Added.
New popover class. Includes a picker for selecting breakpoint type
(Text or RegularExpression), and has an improved popover caption. Input
field style and placeholder text changes based on the breakpoint type.

(WebInspector.XHRBreakpointPopover):
(WebInspector.XHRBreakpointPopover.prototype.get result):
(WebInspector.XHRBreakpointPopover.prototype.get type):
(WebInspector.XHRBreakpointPopover.prototype.get value):
(WebInspector.XHRBreakpointPopover.prototype.show.addOption):
(WebInspector.XHRBreakpointPopover.prototype.show):
(WebInspector.XHRBreakpointPopover.prototype._createEditor):
(WebInspector.XHRBreakpointPopover.prototype._updateEditor):
(WebInspector.XHRBreakpointPopover.prototype._presentOverTargetElement):

* UserInterface/Views/XHRBreakpointTreeElement.js:
(WebInspector.XHRBreakpointTreeElement):
Differentiate breakpoint type by enclosing subtitle in either double quotes
or regex-literal delimiters, depending on the type of breakpoint.

LayoutTests:

Update tests and expectations for new XHR breakpoint type.

* inspector/dom-debugger/xhr-breakpoints-expected.txt:
* inspector/dom-debugger/xhr-breakpoints.html:

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

5 years ago[MediaStream] Cleanup and simplify CoreAudioCaptureSource
eric.carlson@apple.com [Thu, 20 Apr 2017 23:09:32 +0000 (23:09 +0000)]
[MediaStream] Cleanup and simplify CoreAudioCaptureSource
https://bugs.webkit.org/show_bug.cgi?id=171064

There is no need for a mutex to guard against internal state changes because we
don't currently change configuration after the audio unit is allocated. Once
we do support reconfiguration on the fly, we can just stop the output unit before
changing configuration because the I/O proc isn't called if the output unit
is stopped, and AudioOutputUnitStop blocks until the audio device has stopped.

Reviewed by Jer Noble.

* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioCaptureSource::~CoreAudioCaptureSource): Call cleanupAudioUnits
instead of duplicating logic.
(WebCore::CoreAudioCaptureSource::preferredIOBufferDuration): Change preferred
duration from 20ms to 40ms.
(WebCore::CoreAudioCaptureSource::configureMicrophoneProc): Set mSampleRate to the
preferred sample rate if it is 0.
(WebCore::CoreAudioCaptureSource::configureSpeakerProc): Ditto.
(WebCore::CoreAudioCaptureSource::provideSpeakerData): Only increment counter and
check timestamps in debug builds.
(WebCore::CoreAudioCaptureSource::processMicrophoneSamples): Ditto.
(WebCore::CoreAudioCaptureSource::cleanupAudioUnits): We only need the audio unit
name in debug builds.
(WebCore::CoreAudioCaptureSource::setupAudioUnits): Ditto. No more internal state
lock. Don't try to get the default input device on iOS.
(WebCore::CoreAudioCaptureSource::startProducingData): No more internal state lock.
Assert if not called on the main thread.
(WebCore::CoreAudioCaptureSource::stopProducingData): Ditto.
(WebCore::CoreAudioCaptureSource::suspend): Ditto.
(WebCore::CoreAudioCaptureSource::resume): Ditto.
* platform/mediastream/mac/CoreAudioCaptureSource.h:

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

5 years ago[MediaStream iOS] Hold process assertion while media capture is active
eric.carlson@apple.com [Thu, 20 Apr 2017 22:23:15 +0000 (22:23 +0000)]
[MediaStream iOS] Hold process assertion while media capture is active
https://bugs.webkit.org/show_bug.cgi?id=171017
<rdar://problem/31719177>

Reviewed by Dean Jackson.

Source/WebCore:

* page/ActivityState.h: Add IsCapturingMedia flag.

* page/Page.cpp:
(WebCore::Page::updateTimerThrottlingState): Enable timer throttling when capture is active
like we do when playing audio.
(WebCore::Page::setActivityState): Ditto.

* page/PerformanceMonitor.cpp:
(WebCore::PerformanceMonitor::updateProcessStateForMemoryPressure): A process is active when
capturing media, as it is when playing audio.

Source/WebKit2:

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::updateActivityState): Update IsCapturingMedia when necessary.
(WebKit::WebPageProxy::updateThrottleState): Hold a token when capture is active.
(WebKit::WebPageProxy::setMuted): Capture state may change when the page is muted,
so pass IsCapturingMedia to activityStateDidChange.
(WebKit::WebPageProxy::isPlayingMediaDidChange): Ditto.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updateThrottleState): Don't allow page suppression when capture
is active.

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

5 years agoInline anchor elements cannot be dragged when starting the drag from a block descendant
wenson_hsieh@apple.com [Thu, 20 Apr 2017 22:06:24 +0000 (22:06 +0000)]
Inline anchor elements cannot be dragged when starting the drag from a block descendant
https://bugs.webkit.org/show_bug.cgi?id=171062
<rdar://problem/31697835>

Reviewed by Tim Horton.

Source/WebCore:

Tweaks DragController::draggableElement to traverse the DOM instead of the render tree when finding a draggable
element. This prevents us from skipping elements that are in the DOM ancestor chain, but appear as siblings to
the hit-tested node's renderer in the render tree.

There was also previously a check to ensure that we skip anonymous RenderObjects while traversing up the chain,
but this is no longer necessary fter this change, since all the elements we traverse in the DOM should have
renderers that are not anonymous.

Test: fast/events/drag-and-drop-link-containing-block.html

* page/DragController.cpp:
(WebCore::DragController::draggableElement):

LayoutTests:

Adds a new test on WK1 Mac to verify that link dragging succeeds when the link's anchor element is inline and
the drag is started from a block element under the link.

* fast/events/drag-and-drop-link-containing-block-expected.txt: Added.
* fast/events/drag-and-drop-link-containing-block.html: Added.
* platform/ios/TestExpectations:
* platform/mac-wk2/TestExpectations:

Skip the test on iOS and Mac WK2.

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

5 years ago-Wformat warning on HistoryController.cpp:295:5
mcatanzaro@igalia.com [Thu, 20 Apr 2017 21:56:46 +0000 (21:56 +0000)]
-Wformat warning on HistoryController.cpp:295:5
https://bugs.webkit.org/show_bug.cgi?id=171028

Reviewed by Daniel Bates.

Need to cast WebCore::FrameLoadType to int before using it in printf.

* loader/HistoryController.cpp:
(WebCore::HistoryController::goToItem):

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

5 years agoThe toleranceBefore parameter in the AVPlayerItem method seekToTime should not be...
pvollan@apple.com [Thu, 20 Apr 2017 21:42:55 +0000 (21:42 +0000)]
The toleranceBefore parameter in the AVPlayerItem method seekToTime should not be negative.
https://bugs.webkit.org/show_bug.cgi?id=171063

Reviewed by Eric Carlson.

The AVPlayerItem method seekToTime will throw an exception if toleranceBefore is negative.

No new tests since the change is a sanity check.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::seekTask):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime):

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

5 years agoFix build.
andersca@apple.com [Thu, 20 Apr 2017 21:30:35 +0000 (21:30 +0000)]
Fix build.

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

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

5 years agoAdd CompletionHandlerCallChecker to SPI added in r215545.
beidson@apple.com [Thu, 20 Apr 2017 20:53:03 +0000 (20:53 +0000)]
Add CompletionHandlerCallChecker to SPI added in r215545.
https://bugs.webkit.org/show_bug.cgi?id=171067

Reviewed by Dan Bernstein.

Source/WebKit2:

* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::UIClient::createNewPageCommon):

Tools:

* TestWebKitAPI/Tests/WebKit2Cocoa/OpenAndCloseWindow.mm:
(TEST):
(-[OpenAndCloseWindowUIDelegateAsync _webView:createWebViewWithConfiguration:forNavigationAction:windowFeatures:completionHandler:]):

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

5 years agoReplace isFinalStateStatus with isFinalStateResult
andersca@apple.com [Thu, 20 Apr 2017 20:52:02 +0000 (20:52 +0000)]
Replace isFinalStateStatus with isFinalStateResult
https://bugs.webkit.org/show_bug.cgi?id=171072
rdar://problem/31589635

Reviewed by Tim Horton.

Source/WebCore:

This will let us get rid of some of the status enum declarations.

* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::completePayment):
* Modules/applepay/PaymentAuthorizationStatus.h:
(WebCore::isFinalStateStatus): Deleted.
* Modules/applepay/PaymentCoordinator.cpp:
(WebCore::PaymentCoordinator::completePaymentSession):
* Modules/applepay/PaymentRequest.cpp:
(WebCore::isFinalStateResult):
* Modules/applepay/PaymentRequest.h:

Source/WebKit2:

* UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
(WebKit::WebPaymentCoordinatorProxy::completePaymentSession):

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

5 years ago[Win] REGRESSION(r215486): Windows Release build is broken
bfulgham@apple.com [Thu, 20 Apr 2017 20:14:55 +0000 (20:14 +0000)]
[Win] REGRESSION(r215486): Windows Release build is broken
https://bugs.webkit.org/show_bug.cgi?id=171024
<rdar://problem/31722618>

Reviewed by Mark Lam.

Add missing include needed for clean Release build on Windows (proper
fix found by Fujii Hironori).

* bindings/js/JSDOMGlobalObject.h:

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

5 years agoCachedImage should cancel loading images for unsupported/unknown types
commit-queue@webkit.org [Thu, 20 Apr 2017 20:09:47 +0000 (20:09 +0000)]
CachedImage should cancel loading images for unsupported/unknown types
https://bugs.webkit.org/show_bug.cgi?id=170697

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2017-04-20
Reviewed by Youenn Fablet.

Currently when the image decoder detects an error with the incoming encoded
data of an image, we mark the image to be a broken image. But the network
process keeps feeding the web process with the rest of the data. We should
cancel loading the rest of the data to save network bandwidth and CPU time
loading and processing useless data.

* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::addIncrementalDataBuffer):
(WebCore::CachedImage::finishLoading):

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

5 years ago[WK2] -[WKContentView doAfterPositionInformationUpdate:atPosition:] should be robust...
wenson_hsieh@apple.com [Thu, 20 Apr 2017 19:59:46 +0000 (19:59 +0000)]
[WK2] -[WKContentView doAfterPositionInformationUpdate:atPosition:] should be robust against synchronous reentrancy
https://bugs.webkit.org/show_bug.cgi?id=170922
<rdar://problem/31634990>

Reviewed by Tim Horton.

Source/WebKit2:

Refactors part of the asynchronous position information mechanism introduced in
<https://trac.webkit.org/changeset/215171>, and introduces infrastructure for unit testing UI-side position
information requests.

_invokeAndRemovePendingHandlersValidForCurrentPositionInformation is a helper method on WKContentView
responsible for invoking queued position information handlers after receiving a position information response
from the web process. Previously, this method would iterate over the list of pending callbacks and invoke all
callbacks whose requests are satisfied by the incoming position information update, saving the indices of these
handled callbacks in the process. At the end, it would then remove callbacks at these indices from the array of
pending callbacks. This is problematic when a synchronous position update (via
ensurePositionInformationIsUpToDate:) is triggered from within one of these callbacks, since
_invokeAndRemovePendingHandlersValidForCurrentPositionInformation will be called from within itself, and then we
will attempt to remove a callback at the same index twice.

To fix this, we change the array of pending position information handlers to be an array of optionals instead.
When invoking and removing pending handlers after a position information response arrives, we now mark callbacks
as handled by setting them to std::nullopt. Then, when the top-level invocation to
_invokeAndRemovePendingHandlersValidForCurrentPositionInformation is finished, we remove all marked handlers
from the pending vector.

Covered by 6 new unit tests:
- PositionInformationTests.FindDraggableLinkAtPosition
- PositionInformationTests.RequestDraggableLinkAtPosition
- PositionInformationTests.FindDraggableLinkAtDifferentPositionWithinRequestBlock
- PositionInformationTests.FindDraggableLinkAtSamePositionWithinRequestBlock
- PositionInformationTests.RequestDraggableLinkAtSamePositionWithinRequestBlock
- PositionInformationTests.RequestDraggableLinkAtDifferentPositionWithinRequestBlock

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView draggableElementAtPosition:]):
(-[WKWebView requestDraggableElementAtPosition:completionBlock:]):

Uses WKContentView's position information request helpers to search for draggable elements on the page. There
are both synchronous and asynchronous versions of this, both of which retrieve a _WKDraggableElementInfo.

* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/_WKDraggableElementInfo.h: Added.
* UIProcess/API/Cocoa/_WKDraggableElementInfo.mm: Added.

Exposes what elements are draggable at a given position as SPI (only for use in testing code, at the moment).

(-[_WKDraggableElementInfo initWithInteractionInformationAtPosition:]):
(-[_WKDraggableElementInfo copyWithZone:]):
* UIProcess/API/Cocoa/_WKDraggableElementInfoInternal.h: Added.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView currentPositionInformation]):
(-[WKContentView doAfterPositionInformationUpdate:forRequest:]):
(-[WKContentView _invokeAndRemovePendingHandlersValidForCurrentPositionInformation]):
* WebKit2.xcodeproj/project.pbxproj:

Tools:

Adds six new unit tests for retrieving interaction information at a given position in the UI process. See
WebKit2 ChangeLog for more details.

* TestWebKitAPI/Tests/ios/PositionInformationTests.mm:
(-[_WKDraggableElementInfo expectToBeLink:image:atPoint:]):
(TestWebKitAPI::TEST):
(TestWebKitAPI::expectCGPointsToBeEqual): Deleted.

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

5 years agoAX: Modern Media Controls Timeline slider should be operable
commit-queue@webkit.org [Thu, 20 Apr 2017 19:45:19 +0000 (19:45 +0000)]
AX: Modern Media Controls Timeline slider should be operable
https://bugs.webkit.org/show_bug.cgi?id=170250

Patch by Aaron Chu <aaron_chu@apple.com> on 2017-04-20
Reviewed by Antoine Quint.

Source/WebCore:

Added a "change" event listener and aria-valuetext to the slider so that when a
VoiceOver user operates the timeline control, VO speaks the updated timestamp

Test: media/modern-media-controls/scrubber/scrubber-has-correct-ax-label.html

* English.lproj/modern-media-controls-localized-strings.js:
* Modules/modern-media-controls/controls/scrubber.js:
(Scrubber.prototype.set inputAccessibleLabel):
(Scrubber.prototype._formatTime):
* Modules/modern-media-controls/controls/slider.js:
(Slider.prototype.handleEvent):
(Slider.prototype._handleInputEvent): Deleted.
* Modules/modern-media-controls/controls/time-control.js:
(TimeControl.prototype.updateScrubberLabel):
* Modules/modern-media-controls/controls/time-label.js:
(TimeLabel.prototype.commitProperty):
(TimeLabel.prototype._formattedTime):
* Modules/modern-media-controls/main.js:
(formatTimeByUnit):
(unitizeTime):

LayoutTests:

* media/modern-media-controls/scrubber/scrubber-has-correct-ax-label-expected.txt: Added.
* media/modern-media-controls/scrubber/scrubber-has-correct-ax-label.html: Added.

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

5 years agoMove notFound into its own file
weinig@apple.com [Thu, 20 Apr 2017 19:44:12 +0000 (19:44 +0000)]
Move notFound into its own file
https://bugs.webkit.org/show_bug.cgi?id=170972

Reviewed by Zalan Bujtas.

It is odd to require including <wtf/Vector.h> just to use WTF::notFound.
This is not causing any current problems, but does in few changes I have
queued up.

* WTF.xcodeproj/project.pbxproj:
* wtf/NotFound.h: Added.
* wtf/Vector.h:
* wtf/text/StringCommon.h:

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

5 years agoFix indentation in AVKitSPI.h
aestes@apple.com [Thu, 20 Apr 2017 19:39:16 +0000 (19:39 +0000)]
Fix indentation in AVKitSPI.h
https://bugs.webkit.org/show_bug.cgi?id=171066

Reviewed by Jer Noble.

* platform/spi/cocoa/AVKitSPI.h:

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

5 years agoFix a PassKit function declaration typo
andersca@apple.com [Thu, 20 Apr 2017 19:34:21 +0000 (19:34 +0000)]
Fix a PassKit function declaration typo
https://bugs.webkit.org/show_bug.cgi?id=171068
rdar://problem/31635008

Reviewed by Tim Horton.

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

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

5 years ago[MediaCapture] gUM() with CoreAudio fails if capturing audio in the UIProcess.
jer.noble@apple.com [Thu, 20 Apr 2017 19:22:23 +0000 (19:22 +0000)]
[MediaCapture] gUM() with CoreAudio fails if capturing audio in the UIProcess.
https://bugs.webkit.org/show_bug.cgi?id=171021

Reviewed by Eric Carlson.

Source/WebCore:

Refactor the creation of RealtimeMediaSources to take a persistent device ID rather
than a CaptureDevice directly. This allows WebKit2 to iterate devices in the UIProcess
rather than the WebProcess.

* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/mac/AVAudioCaptureSource.mm:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioCaptureSource::create):
(WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
* platform/mediastream/mac/CoreAudioCaptureSource.h:
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
(WebCore::RealtimeMediaSourceCenterMac::createMediaStream):
(WebCore::RealtimeMediaSourceCenterMac::bestSourcesForTypeAndConstraints):
* platform/mock/MockRealtimeAudioSource.cpp:
* platform/mock/MockRealtimeVideoSource.cpp:

Source/WebKit2:

Pass a deviceID rather than a CaptureDevice across the process boundary.

* Shared/WebCoreArgumentCoders.h:
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
(WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
* WebProcess/cocoa/UserMediaCaptureManager.cpp:
(WebKit::UserMediaCaptureManager::createMediaSourceForCaptureDeviceWithConstraints):
* WebProcess/cocoa/UserMediaCaptureManager.h:

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

5 years agoFix assertions in webProcessProxyFromConnection
commit-queue@webkit.org [Thu, 20 Apr 2017 19:13:24 +0000 (19:13 +0000)]
Fix assertions in webProcessProxyFromConnection
https://bugs.webkit.org/show_bug.cgi?id=171025
<rdar://problem/31184073>

Patch by Alex Christensen <achristensen@webkit.org> on 2017-04-20
Reviewed by Brady Eidson.

* UIProcess/WebProcessPool.cpp:
(WebKit::webProcessProxyFromConnection):
If we have a Connection, then we have a valid process attached to that connection,
unless it's a Connection to a different type of child process.
Calling ChildProcessProxy::connection on other web processes that are in State::Launching,
then we get an assertion.  Luckily, ChildProcessProxy::hasConnection was introduced in r210861
for this reason.

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

5 years agoMake it possible to request the non-expanded scrollbar width from ScrollbarTheme
timothy_horton@apple.com [Thu, 20 Apr 2017 18:23:29 +0000 (18:23 +0000)]
Make it possible to request the non-expanded scrollbar width from ScrollbarTheme
https://bugs.webkit.org/show_bug.cgi?id=171047

Reviewed by Sam Weinig.

No new tests, new behavior is not exposed in any way.

* platform/ScrollTypes.h:
* platform/ScrollbarTheme.h:
(WebCore::ScrollbarTheme::scrollbarThickness):
* platform/gtk/ScrollbarThemeGtk.cpp:
(WebCore::ScrollbarThemeGtk::scrollbarThickness):
* platform/gtk/ScrollbarThemeGtk.h:
* platform/ios/ScrollbarThemeIOS.h:
* platform/ios/ScrollbarThemeIOS.mm:
(WebCore::ScrollbarThemeIOS::scrollbarThickness):
* platform/mac/ScrollbarThemeMac.h:
* platform/mac/ScrollbarThemeMac.mm:
(WebCore::ScrollbarThemeMac::scrollbarThickness):
* platform/mock/ScrollbarThemeMock.cpp:
(WebCore::ScrollbarThemeMock::scrollbarThickness):
* platform/mock/ScrollbarThemeMock.h:
* platform/win/ScrollbarThemeWin.cpp:
(WebCore::ScrollbarThemeWin::scrollbarThickness):
* platform/win/ScrollbarThemeWin.h:
* rendering/RenderScrollbarTheme.h:
On Mac, when the scrollbar is hovered, it gets bigger.
Currently, scrollbarThickness always returns the big size.
It should be possible to request the smaller, "regular" scrollbar size as well.

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

5 years agoOptimize SharedArrayBuffer in the DFG+FTL
fpizlo@apple.com [Thu, 20 Apr 2017 17:55:44 +0000 (17:55 +0000)]
Optimize SharedArrayBuffer in the DFG+FTL
https://bugs.webkit.org/show_bug.cgi?id=164108

Reviewed by Saam Barati.

JSTests:

Added a fairly comprehensive test of the intrinsics. This creates a function for each possible
combination of type and operation, and then first uses it nicely and then tries a bunch of
erroneous conditions like OOB.

* stress/SharedArrayBuffer-opt.js: Added.
(string_appeared_here.switch):
(string_appeared_here.str):
(runAtomic):
(shouldFail):
(Symbol):
(string_appeared_here.a.of.arrays.m.of.atomics):
* stress/SharedArrayBuffer.js:

Source/JavaScriptCore:

This adds atomics intrinsics to the DFG and wires them through to the DFG and FTL backends. This
was super easy in the FTL since B3 already has comprehensive atomic intrinsics, which are more
powerful than what we need right now. In the DFG backend, I went with an easy-to-write
implementation that just reduces everything to a weak CAS loop. It's very inefficient with
registers (it needs ~8) but it's the DFG backend, so it's not obvious how much we care.

To make the rare cases easy to handle, I refactored AtomicsObject.cpp so that the operations for
the slow paths can share code with the native functions.

This also fixes register handling in the X86 implementations of CAS, in the case that
expectedAndResult is not %rax. This also fixes the ARM64 implementation of branchWeakCAS.

I adapted the CascadeLock from WTF/benchmarks/ToyLocks.h as a microbenchmark of lock performance.
This benchmark performs 2.5x faster, in both the contended and uncontended case, thanks to this
change. It's still about 3x slower than native. I investigated this only a bit. I suspect that
the story will be different in asm.js code, which will get constant-folding of the typed array
backing store by virtue of how it uses lexically scoped variables as pointers to the heap arrays.
It's worth noting that the native lock I was comparing against, the very nicely-tuned
CascadeLock, is at the very high end of lock throughput under virtually all conditions
(uncontended, microcontended, held for a long time). I also compared to WTF::Lock and others, and
the only ones that performed better in this microbenchmark were spinlocks. I don't recommend
using those. So, when I say this is 3x slower than native, I really mean that it's 3x slower than
the fastest native lock that I have in my arsenal.

Also worth noting is that I experimented with exposing Atomics.yield(), which uses sched_yield,
as a way of testing if adding a yield loop to the JS cascadeLock would help. It does not help. I
did not investigate why.

* assembler/AbstractMacroAssembler.h:
(JSC::AbstractMacroAssembler::JumpList::append):
* assembler/CPU.h:
(JSC::is64Bit):
(JSC::is32Bit):
* b3/B3Common.h:
(JSC::B3::is64Bit): Deleted.
(JSC::B3::is32Bit): Deleted.
* b3/B3LowerToAir.cpp:
(JSC::B3::Air::LowerToAir::appendTrapping):
(JSC::B3::Air::LowerToAir::appendCAS):
(JSC::B3::Air::LowerToAir::appendGeneralAtomic):
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNode.h:
(JSC::DFG::Node::hasHeapPrediction):
(JSC::DFG::Node::hasArrayMode):
* dfg/DFGNodeType.h:
(JSC::DFG::isAtomicsIntrinsic):
(JSC::DFG::numExtraAtomicsArgs):
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSSALoweringPhase.cpp:
(JSC::DFG::SSALoweringPhase::handleNode):
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::loadFromIntTypedArray):
(JSC::DFG::SpeculativeJIT::setIntTypedArrayLoadResult):
(JSC::DFG::SpeculativeJIT::compileGetByValOnIntTypedArray):
(JSC::DFG::SpeculativeJIT::getIntTypedArrayStoreOperand):
(JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::callOperation):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLAbstractHeapRepository.cpp:
(JSC::FTL::AbstractHeapRepository::decorateFencedAccess):
(JSC::FTL::AbstractHeapRepository::computeRangesAndDecorateInstructions):
* ftl/FTLAbstractHeapRepository.h:
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileAtomicsReadModifyWrite):
(JSC::FTL::DFG::LowerDFGToB3::compileAtomicsIsLockFree):
(JSC::FTL::DFG::LowerDFGToB3::compileGetByVal):
(JSC::FTL::DFG::LowerDFGToB3::compilePutByVal):
(JSC::FTL::DFG::LowerDFGToB3::pointerIntoTypedArray):
(JSC::FTL::DFG::LowerDFGToB3::loadFromIntTypedArray):
(JSC::FTL::DFG::LowerDFGToB3::storeType):
(JSC::FTL::DFG::LowerDFGToB3::setIntTypedArrayLoadResult):
(JSC::FTL::DFG::LowerDFGToB3::getIntTypedArrayStoreOperand):
(JSC::FTL::DFG::LowerDFGToB3::vmCall):
* ftl/FTLOutput.cpp:
(JSC::FTL::Output::store):
(JSC::FTL::Output::store32As8):
(JSC::FTL::Output::store32As16):
(JSC::FTL::Output::atomicXchgAdd):
(JSC::FTL::Output::atomicXchgAnd):
(JSC::FTL::Output::atomicXchgOr):
(JSC::FTL::Output::atomicXchgSub):
(JSC::FTL::Output::atomicXchgXor):
(JSC::FTL::Output::atomicXchg):
(JSC::FTL::Output::atomicStrongCAS):
* ftl/FTLOutput.h:
(JSC::FTL::Output::store32):
(JSC::FTL::Output::store64):
(JSC::FTL::Output::storePtr):
(JSC::FTL::Output::storeFloat):
(JSC::FTL::Output::storeDouble):
* jit/JITOperations.h:
* runtime/AtomicsObject.cpp:
(JSC::atomicsFuncAdd):
(JSC::atomicsFuncAnd):
(JSC::atomicsFuncCompareExchange):
(JSC::atomicsFuncExchange):
(JSC::atomicsFuncIsLockFree):
(JSC::atomicsFuncLoad):
(JSC::atomicsFuncOr):
(JSC::atomicsFuncStore):
(JSC::atomicsFuncSub):
(JSC::atomicsFuncWait):
(JSC::atomicsFuncWake):
(JSC::atomicsFuncXor):
(JSC::operationAtomicsAdd):
(JSC::operationAtomicsAnd):
(JSC::operationAtomicsCompareExchange):
(JSC::operationAtomicsExchange):
(JSC::operationAtomicsIsLockFree):
(JSC::operationAtomicsLoad):
(JSC::operationAtomicsOr):
(JSC::operationAtomicsStore):
(JSC::operationAtomicsSub):
(JSC::operationAtomicsXor):
* runtime/AtomicsObject.h:

Source/WTF:

Made small changes as part of benchmarking the JS versions of these locks.

* benchmarks/LockSpeedTest.cpp:
* benchmarks/ToyLocks.h:
* wtf/Range.h:
(WTF::Range::dump):

LayoutTests:

Add a test of futex performance.

* workers/sab/cascade_lock-worker.js: Added.
(onmessage):
* workers/sab/cascade_lock.html: Added.
* workers/sab/worker-resources.js:
(cascadeLockSlow):
(cascadeLock):
(cascadeUnlock):

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

5 years agoUpdate pip placard to "picture in picture"
jonlee@apple.com [Thu, 20 Apr 2017 17:53:11 +0000 (17:53 +0000)]
Update pip placard to "picture in picture"
https://bugs.webkit.org/show_bug.cgi?id=171036
rdar://problem/30201536

Reviewed by Antoine Quint.

Source/WebCore:

Updated media/modern-media-controls/pip-placard/pip-placard.html

Update the text shown with the picture in picture placard.

* English.lproj/mediaControlsLocalizedStrings.js:
* English.lproj/modern-media-controls-localized-strings.js:
* Modules/mediacontrols/mediaControlsApple.js:
(Controller.prototype.updatePictureInPicturePlaceholder):
* Modules/modern-media-controls/controls/pip-placard.js:
(PiPPlacard):

LayoutTests:

* media/modern-media-controls/pip-placard/pip-placard-expected.txt: Updated expected results.
* media/modern-media-controls/pip-placard/pip-placard.html:

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

5 years agoMark two crypto/subtle/ecdsa LayoutTests as flaky.
ryanhaddad@apple.com [Thu, 20 Apr 2017 17:49:37 +0000 (17:49 +0000)]
Mark two crypto/subtle/ecdsa LayoutTests as flaky.
https://bugs.webkit.org/show_bug.cgi?id=171059

Unreviewed test gardening.

* TestExpectations:

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

5 years agoMark memory/memory-pressure-simulation.html as flaky.
ryanhaddad@apple.com [Thu, 20 Apr 2017 17:49:35 +0000 (17:49 +0000)]
Mark memory/memory-pressure-simulation.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=170629

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

5 years ago[GTK] Update layout tests expectations after r215556
clopez@igalia.com [Thu, 20 Apr 2017 16:46:04 +0000 (16:46 +0000)]
[GTK] Update layout tests expectations after r215556
https://bugs.webkit.org/show_bug.cgi?id=170942

Unreviewed gardening.

* platform/gtk/TestExpectations:

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

5 years agoBuild fix to start using C++14.
dewei_zhu@apple.com [Thu, 20 Apr 2017 16:16:43 +0000 (16:16 +0000)]
Build fix to start using C++14.
https://bugs.webkit.org/show_bug.cgi?id=171038

Reviewed by Alex Christensen.

Use 'c++14' instead of 'c++11' in order to use 'auto' in lambda.

* Configurations/WebKitLegacy.xcconfig:

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

5 years ago[WK2][macOS] Allow iokit-get-properties for IOAudioControlValue
bfulgham@apple.com [Thu, 20 Apr 2017 15:55:09 +0000 (15:55 +0000)]
[WK2][macOS] Allow iokit-get-properties for IOAudioControlValue
https://bugs.webkit.org/show_bug.cgi?id=171020
<rdar://problem/30878974>

Reviewed by Alexey Proskuryakov.

* WebProcess/com.apple.WebProcess.sb.in: Add missing property name.

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

5 years agoRTCPeerConnection is stopping its backend twice sometimes
commit-queue@webkit.org [Thu, 20 Apr 2017 15:48:49 +0000 (15:48 +0000)]
RTCPeerConnection is stopping its backend twice sometimes
https://bugs.webkit.org/show_bug.cgi?id=171043

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

Source/WebCore:

Test: webrtc/closing-peerconnection.html

Making sure we stop the backend only once.
Adding an internals API to close the peer connection so as to replicate frame disconnection.

* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::doClose):
(WebCore::RTCPeerConnection::doStop):
* Modules/mediastream/RTCPeerConnection.h:
* testing/Internals.cpp:
(WebCore::Internals::stopPeerConnection):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* webrtc/closing-peerconnection-expected.txt: Added.
* webrtc/closing-peerconnection.html: Added.

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

5 years agoIncrease large animation cutoff
antti@apple.com [Thu, 20 Apr 2017 12:57:40 +0000 (12:57 +0000)]
Increase large animation cutoff
https://bugs.webkit.org/show_bug.cgi?id=171051
<rdar://problem/31731532>

Reviewed by Andreas Kling.

We currently switch to per-frame decoding if the animation is larger than 5MB. This is very
power-inefficient and such animations are now common. The cutoff originates from 2007 (r20069),
it is time update it.

Note that the normal low memory handling will still kill animation frames as needed.

* platform/graphics/BitmapImage.h:

    Increase cutoff to 30MB. This is enough (with some room to spare) for animations on current
    tumblr.com/search/aww.

    Also remove the separate cutoff value for iOS.

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

5 years ago[GTK][jhbuild] Update glib and glib-networking to the latest stable versions
commit-queue@webkit.org [Thu, 20 Apr 2017 10:24:37 +0000 (10:24 +0000)]
[GTK][jhbuild] Update glib and glib-networking to the latest stable versions
https://bugs.webkit.org/show_bug.cgi?id=170942

Patch by Xan Lopez <xlopez@igalia.com> on 2017-04-20
Reviewed by Carlos Garcia Campos.

Update glib and glib-networking to the last stable releases. This
is needed to get working TLS certificate verification at all at
least in Fedora.

* gtk/install-dependencies: add libmount, needed for newer glib.
* gtk/jhbuild.modules: update glib and glib-networking to last
stable releases.

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

5 years agoRegister missing AES_CTR, ECDSA and HKDF algorithms in
zandobersek@gmail.com [Thu, 20 Apr 2017 09:02:35 +0000 (09:02 +0000)]
Register missing AES_CTR, ECDSA and HKDF algorithms in
GCrypt's CryptoAlgorithmRegistry implementation.

Rubber-stamped by Carlos Alberto Lopez Perez.

* crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp:
(WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):

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

5 years ago[ATK] Implement support for DPub ARIA roles
jdiggs@igalia.com [Thu, 20 Apr 2017 08:48:53 +0000 (08:48 +0000)]
[ATK] Implement support for DPub ARIA roles
https://bugs.webkit.org/show_bug.cgi?id=170679

Reviewed by Chris Fleizach.

Source/WebCore:

Create two new WebCore AccessibilityRole values: TextGroup and ApplicationTextGroup.
These roles make it possible for platforms to distinguish groups which are primarily
intended to display textual content from groups which are primarily intended to hold
user-interface objects. Use these roles to fix the ATK mapping of DPub's groups, which
should be exposed as ATK_ROLE_SECTION; not ATK_ROLE_PANEL.

Modify the following WebCore AccessibilityRole mappings:
- doc-abstract changed to ApplicationTextGroupRole because this DPub ARIA role does
  not subclass the ARIA landmark role
- doc-biblioentry and doc-endnote changed to ListItemRole, because these DPub ARIA
  roles subclass the ARIA listitem role
- doc-notice and doc-tip changed to DocumentNoteRole because these DPub ARIA roles
  subclass the ARIA note role
- doc-pagebreak changed to SplitterRole because this DPub ARIA role subclasses the
  ARIA separator role

No new tests required: New test cases were added to xml-roles-exposed.html, and
the platform expectations for roles-exposed.html were updated to reflect the
correct mappings.

* accessibility/AccessibilityList.cpp:
(WebCore::AccessibilityList::determineAccessibilityRole):
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::isGroup):
(WebCore::AccessibilityNodeObject::helpText):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::ariaTreeItemContent):
(WebCore::initializeRoleMap):
(WebCore::AccessibilityObject::computedRoleString):
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::helpText):
(WebCore::AccessibilityRenderObject::shouldFocusActiveDescendant):
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(webkitAccessibleGetAttributes):
(atkRole):
(roleIsTextType):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
(-[WebAccessibilityObjectWrapper containsUnnaturallySegmentedChildren]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(createAccessibilityRoleMap):
(-[WebAccessibilityObjectWrapper subrole]):

Tools:

Add DPub ARIA landmark roles to roleToString().

* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:

LayoutTests:

Update tests and expectations to reflect the modified WebCore Accessibility
role mappings, and the corresponding changes for the platforms.

* accessibility/gtk/xml-roles-exposed-expected.txt:
* accessibility/gtk/xml-roles-exposed.html:
* accessibility/roles-exposed.html:
* inspector/dom/getAccessibilityPropertiesForNode-expected.txt:
* platform/gtk/TestExpectations:
* platform/gtk/accessibility/roles-exposed-expected.txt:
* platform/mac/accessibility/roles-exposed-expected.txt:

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

5 years ago[GTK] ../../Source/ThirdParty/xdgmime/src/xdgmimecache.c:200:62: warning: pointer...
mcatanzaro@igalia.com [Thu, 20 Apr 2017 06:26:59 +0000 (06:26 +0000)]
[GTK] ../../Source/ThirdParty/xdgmime/src/xdgmimecache.c:200:62: warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith]
https://bugs.webkit.org/show_bug.cgi?id=171026

Reviewed by Carlos Garcia Campos.

* xdgmime/README.webkit:
* xdgmime/src/xdgmimecache.c:
(cache_magic_matchlet_compare_to_data):

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

5 years agoRemove WebKitTestRunner code for enabling features that are already enabled by default
commit-queue@webkit.org [Thu, 20 Apr 2017 05:26:51 +0000 (05:26 +0000)]
Remove WebKitTestRunner code for enabling features that are already enabled by default
https://bugs.webkit.org/show_bug.cgi?id=171033

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-04-19
Reviewed by Ryosuke Niwa.

Source/WebKit2:

* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):

Tools:

* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::beginTesting):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setShadowDOMEnabled): Deleted.
(WTR::TestRunner::setCustomElementsEnabled): Deleted.
(WTR::TestRunner::setFetchAPIEnabled): Deleted.
(WTR::TestRunner::setDownloadAttributeEnabled): Deleted.
* WebKitTestRunner/InjectedBundle/TestRunner.h:

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

5 years ago[Win] REGRESSION(r215486): Windows Release build is broken
bfulgham@apple.com [Thu, 20 Apr 2017 04:36:57 +0000 (04:36 +0000)]
[Win] REGRESSION(r215486): Windows Release build is broken
https://bugs.webkit.org/show_bug.cgi?id=171024
<rdar://problem/31722618>

Reviewed by Mark Lam.

Windows WebKit refers to a handful of JSC methods that are always
inline. We need to include 'HeapInlines.h' to get the implementation
of these methods.

* Plugins/PluginPackage.cpp:
* WebFrame.cpp:
* WebView.cpp:

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

5 years agoMark imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/hkdf.worker.html...
ryanhaddad@apple.com [Thu, 20 Apr 2017 03:40:52 +0000 (03:40 +0000)]
Mark imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/hkdf.worker.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=170907

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

5 years agoRebaseline imported/w3c/web-platform-tests/html/dom/reflection-embedded.html.
ryanhaddad@apple.com [Thu, 20 Apr 2017 03:40:48 +0000 (03:40 +0000)]
Rebaseline imported/w3c/web-platform-tests/html/dom/reflection-embedded.html.

Unreviewed test gardening.

* platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/reflection-embedded-expected.txt:

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

5 years ago[Mac] Allow customizing H264 encoder
commit-queue@webkit.org [Thu, 20 Apr 2017 03:08:00 +0000 (03:08 +0000)]
[Mac] Allow customizing H264 encoder
https://bugs.webkit.org/show_bug.cgi?id=170829

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

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/ThirdParty/libwebrtc:

* Configurations/libwebrtc.xcconfig:
* Source/webrtc/sdk/objc/Framework/Classes/h264_video_toolbox_encoder.h:
* Source/webrtc/sdk/objc/Framework/Classes/h264_video_toolbox_encoder.mm:
(webrtc::H264VideoToolboxEncoder::ResetCompressionSession):
(webrtc::H264VideoToolboxEncoder::CreateCompressionSession): Default implementation, fixing memory leak for dictionary.
* Source/webrtc/sdk/objc/Framework/Classes/videotoolboxvideocodecfactory.cc:

Source/WebCore:

Using WebKitAdditions CreateCompressionSession if available.

* Configurations/FeatureDefines.xcconfig:
* WebCore.xcodeproj/project.pbxproj:
* platform/mediastream/libwebrtc/H264VideoToolBoxEncoder.h: Added.
* platform/mediastream/libwebrtc/H264VideoToolBoxEncoder.mm: Added.
(WebCore::H264VideoToolboxEncoder::CreateCompressionSession):
* platform/mediastream/libwebrtc/VideoToolBoxEncoderFactory.cpp:
(WebCore::VideoToolboxVideoEncoderFactory::CreateSupportedVideoEncoder):

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:
* WebKit2.xcodeproj/project.pbxproj:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

5 years agoMark imported/w3c/web-platform-tests/XMLHttpRequest/getallresponseheaders-cl.htm...
ryanhaddad@apple.com [Thu, 20 Apr 2017 02:29:35 +0000 (02:29 +0000)]
Mark imported/w3c/web-platform-tests/XMLHttpRequest/getallresponseheaders-cl.htm as failing.
https://bugs.webkit.org/show_bug.cgi?id=171031

Unreviewed test gardening.

* TestExpectations:

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

5 years agoAnother deadlock in CoreAudioCaptureSource
eric.carlson@apple.com [Thu, 20 Apr 2017 00:53:37 +0000 (00:53 +0000)]
Another deadlock in CoreAudioCaptureSource
https://bugs.webkit.org/show_bug.cgi?id=171001

Fix another regression introduced by r215201, plus make changes suggested
in the review of 170771.

Reviewed by Youenn Fablet.

* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioCaptureSource::configureSpeakerProc): Assert if the lock is no held.
(WebCore::CoreAudioCaptureSource::provideSpeakerData): Don't reset the buffer.
(WebCore::CoreAudioCaptureSource::processMicrophoneSamples): Take the state lock. Don't
reset the buffer. No more microphone callbacks.
(WebCore::CoreAudioCaptureSource::stopProducingData): Return early if the io unit isn't
running. Drop the lock before calling setMuted to avoid another deadlock.
(WebCore::CoreAudioCaptureSource::addMicrophoneDataConsumer): Deleted.
(WebCore::CoreAudioCaptureSource::removeMicrophoneDataConsumer): Deleted.
* platform/mediastream/mac/CoreAudioCaptureSource.h:

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

5 years agoAdd asynchronous equivalent of -[<WKUIDelegate> webView:createWebViewWithConfiguratio...
beidson@apple.com [Thu, 20 Apr 2017 00:43:59 +0000 (00:43 +0000)]
Add asynchronous equivalent of -[<WKUIDelegate> webView:createWebViewWithConfiguration:...].
<rdar://problem/30699851> and https://bugs.webkit.org/show_bug.cgi?id=171018

Reviewed by Tim Horton.

Source/WebKit2:

* UIProcess/API/APIUIClient.h:
(API::UIClient::createNewPageAsync):

* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:

* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::setDelegate):
(WebKit::UIDelegate::UIClient::createNewPageCommon):
(WebKit::UIDelegate::UIClient::createNewPage):
(WebKit::UIDelegate::UIClient::createNewPageAsync):

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::createNewPage):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:

Tools:

* TestWebKitAPI/Tests/WebKit2Cocoa/OpenAndCloseWindow.mm:
(TEST):
(-[OpenAndCloseWindowUIDelegateAsync webView:createWebViewWithConfiguration:forNavigationAction:windowFeatures:]):
(-[OpenAndCloseWindowUIDelegateAsync _webView:createWebViewWithConfiguration:forNavigationAction:windowFeatures:completionHandler:]):

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

5 years ago[Win] Activate streams API by default
commit-queue@webkit.org [Wed, 19 Apr 2017 23:48:34 +0000 (23:48 +0000)]
[Win] Activate streams API by default
https://bugs.webkit.org/show_bug.cgi?id=171000

Patch by Youenn Fablet <youenn@apple.com> on 2017-04-19
Reviewed by Brent Fulgham.

* wtf/FeatureDefines.h:

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

5 years agoREGRESSION (r209882): Web Inspector: Console's filter bar has text search field,...
nvasilyev@apple.com [Wed, 19 Apr 2017 23:41:19 +0000 (23:41 +0000)]
REGRESSION (r209882): Web Inspector: Console's filter bar has text search field, but the next/previous buttons don't do anything
https://bugs.webkit.org/show_bug.cgi?id=170556
<rdar://problem/31481755>

Reviewed by Matt Baker.

* UserInterface/Views/LogContentView.js:
(WebInspector.LogContentView.prototype.performSearch):
Update numberOfResults setter, which sets "disabled" attribute to false when numberOfResults > 0.

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

5 years agoRemove two tests after r215515.
ryanhaddad@apple.com [Wed, 19 Apr 2017 23:38:57 +0000 (23:38 +0000)]
Remove two tests after r215515.
https://bugs.webkit.org/show_bug.cgi?id=171014

Unreviewed test gardening.

LayoutTests/imported/w3c:

* web-platform-tests/fetch/api/basic/scheme-about.worker-expected.txt: Removed.
* web-platform-tests/fetch/api/basic/scheme-about.worker.html: Removed.
* web-platform-tests/user-timing/clear_one_measure.worker-expected.txt: Removed.
* web-platform-tests/user-timing/clear_one_measure.worker.html: Removed.

LayoutTests:

* TestExpectations:

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

5 years agoStop using deprecated APIs, part 3
andersca@apple.com [Wed, 19 Apr 2017 23:30:47 +0000 (23:30 +0000)]
Stop using deprecated APIs, part 3
https://bugs.webkit.org/show_bug.cgi?id=171003
rdar://problem/31589635
Source/WebCore:

rdar://problem/31589635

Reviewed by Tim Horton.

* Modules/applepay/ApplePaySession.cpp:
(WebCore::convertAndValidate):
The status member variable has been removed from ApplePayShippingMethodUpdate.

(WebCore::ApplePaySession::completeShippingMethodSelection):
If status is not STATUS_SUCCESS, cancel the payment session.

(WebCore::ApplePaySession::canSuspendForDocumentSuspension):
(WebCore::ApplePaySession::canBegin):
(WebCore::ApplePaySession::canAbort):
(WebCore::ApplePaySession::canCancel):
(WebCore::ApplePaySession::canCompleteShippingMethodSelection):
(WebCore::ApplePaySession::canCompleteShippingContactSelection):
(WebCore::ApplePaySession::canCompletePaymentMethodSelection):
(WebCore::ApplePaySession::canCompletePayment):
(WebCore::ApplePaySession::isFinalState):
Add State::CancelRequested.

* Modules/applepay/ApplePayShippingMethodUpdate.h:
* Modules/applepay/ApplePayShippingMethodUpdate.idl:
Remove status.

* Modules/applepay/PaymentCoordinator.cpp:
(WebCore::PaymentCoordinator::cancelPaymentSession):
Call through to the client.

* Modules/applepay/PaymentCoordinator.h:
* Modules/applepay/PaymentCoordinatorClient.h:
Add cancelPaymentSession().

* Modules/applepay/PaymentRequest.h:
Remove status.

* loader/EmptyClients.cpp:
Add new client member function.

Source/WebKit/mac:

Reviewed by Tim Horton.

* WebCoreSupport/WebPaymentCoordinatorClient.h:
* WebCoreSupport/WebPaymentCoordinatorClient.mm:
(WebPaymentCoordinatorClient::cancelPaymentSession):
Update for WebCore changes.

Source/WebKit2:

Reviewed by Tim Horton.

* Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
(IPC::ArgumentCoder<WebCore::ShippingMethodUpdate>::encode):
(IPC::ArgumentCoder<WebCore::ShippingMethodUpdate>::decode):
Don't encode/decode status.

* UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
(WebKit::WebPaymentCoordinatorProxy::cancelPaymentSession):
Hide the UI and report back.

* UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
Add new member.

* UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in:
Add new message.

* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection):
Always pass success in the old code path. Stop using the deprecated method.

* WebProcess/ApplePay/WebPaymentCoordinator.cpp:
(WebKit::WebPaymentCoordinator::cancelPaymentSession):
Send a message to the UI process.

* WebProcess/ApplePay/WebPaymentCoordinator.h:
Add new member.

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

5 years agoRebaseline tests after r215515.
ryanhaddad@apple.com [Wed, 19 Apr 2017 23:27:05 +0000 (23:27 +0000)]
Rebaseline tests after r215515.
https://bugs.webkit.org/show_bug.cgi?id=171014

Unreviewed test gardening.

LayoutTests/imported/w3c:

* web-platform-tests/XMLHttpRequest/getallresponseheaders-cl-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-count-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-count-worker-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-location-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-location-worker-expected.txt:
* web-platform-tests/html/webappapis/timers/negative-settimeout-expected.txt:

LayoutTests:

* TestExpectations:
* platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/reflection-embedded-expected.txt:
* platform/ios/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-fragment-scrolling-cross-origin-expected.txt:
* platform/ios/imported/w3c/web-platform-tests/html/dom/reflection-embedded-expected.txt:

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

5 years agoTune GC related JSC options for iOS
msaboff@apple.com [Wed, 19 Apr 2017 23:23:39 +0000 (23:23 +0000)]
Tune GC related JSC options for iOS
https://bugs.webkit.org/show_bug.cgi?id=171019

Reviewed by Mark Lam.

Always set these GC options on iOS.

* runtime/Options.cpp:
(JSC::overrideDefaults):

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

5 years agoVector.h: error: 'auto' not allowed in lambda parameter
ddkilzer@apple.com [Wed, 19 Apr 2017 23:21:19 +0000 (23:21 +0000)]
Vector.h: error: 'auto' not allowed in lambda parameter
<https://webkit.org/b/171010>
<rdar://problem/31716076>

Reviewed by Saam Barati.

* wtf/Vector.h:
(WTF::removeRepeatedElements): Replace 'auto' with a specific
type, 'T', based on a Vector<> template type.

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

5 years ago[MediaStream] Limit capture to one tab at a time
eric.carlson@apple.com [Wed, 19 Apr 2017 23:13:31 +0000 (23:13 +0000)]
[MediaStream] Limit capture to one tab at a time
https://bugs.webkit.org/show_bug.cgi?id=171009

Reviewed by Jon Lee.

Source/WebCore:

No new tests yet, filed bug 171011.

* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::stopTrack): Drive-by fix: renamed from stopProducingData
because stopProducingData is a method in RealtimeMediaSource that does something different.
(WebCore::MediaStreamTrack::stop): Call stopTrack.
(WebCore::MediaStreamTrack::stopProducingData): Deleted.
* Modules/mediastream/MediaStreamTrack.h:
* Modules/mediastream/MediaStreamTrack.idl:

* Modules/mediastream/RTCRtpSender.cpp:
(WebCore::RTCRtpSender::replaceTrack): Update for rename.

* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::muted): Drive-by fix: a track that has ended but
which is not muted will never produce data.

Source/WebKit2:

* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::stopCapture): Deleted, not used.
* UIProcess/UserMediaPermissionRequestManagerProxy.h:

* UIProcess/UserMediaProcessManager.cpp:
(WebKit::UserMediaProcessManager::willEnableMediaStreamInPage): Mute media streams
on other pages.
(WebKit::UserMediaProcessManager::willCreateMediaStream): Call willEnableMediaStreamInPage.
* UIProcess/UserMediaProcessManager.h:

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setMuted): If media streams in the page will be unmuted, call
willEnableMediaStreamInPage so streams in other pages are muted first.

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

5 years agoREGRESSION (r213168): An extra Web Content process is spun up on launch and is never...
beidson@apple.com [Wed, 19 Apr 2017 22:43:49 +0000 (22:43 +0000)]
REGRESSION (r213168): An extra Web Content process is spun up on launch and is never closed.
<rdar://problem/30774839> and https://bugs.webkit.org/show_bug.cgi?id=171002

Reviewed by Alex Christensen.

Source/WebKit2:

The original change unnecessarily avoided using the initial warmed process if an explicit
data store was set on the new WKWebView.

Fixing that fixes the regression.

* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _webProcessCount]):
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:

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

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/InitialWarmedProcessUsed.mm: Added.

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

5 years agoParsing large XML strings fails
achristensen@apple.com [Wed, 19 Apr 2017 22:27:04 +0000 (22:27 +0000)]
Parsing large XML strings fails
https://bugs.webkit.org/show_bug.cgi?id=170999
<rdar://problem/17336267>

Reviewed by Brady Eidson.

Source/WebCore:

Test: fast/dom/xml-large.html

* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLParserContext::createStringParser):
(WebCore::XMLParserContext::createMemoryParser):
Allow huge XML strings. They work fine in Chrome and Firefox.

LayoutTests:

* fast/dom/xml-large-expected.txt: Added.
* fast/dom/xml-large.html: Added.

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

5 years agoUnreviewed, rolling out r215518.
ryanhaddad@apple.com [Wed, 19 Apr 2017 22:06:58 +0000 (22:06 +0000)]
Unreviewed, rolling out r215518.

This change appears to have broken the Windows build.

Reverted changeset:

"Move notFound into its own file"
https://bugs.webkit.org/show_bug.cgi?id=170972
http://trac.webkit.org/changeset/215518

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

5 years agoWebAssembly: fast memory cleanups
jfbastien@apple.com [Wed, 19 Apr 2017 22:05:51 +0000 (22:05 +0000)]
WebAssembly: fast memory cleanups
https://bugs.webkit.org/show_bug.cgi?id=170909

Reviewed by Saam Barati.

* b3/B3LowerToAir.cpp: correct comment, and make wasm-independent
(JSC::B3::Air::LowerToAir::lower):
* b3/B3Procedure.h:
* b3/B3Validate.cpp:
* b3/B3Value.cpp:
(JSC::B3::Value::effects):
* b3/B3WasmBoundsCheckValue.cpp: have the creator pass in a
maximum, so we don't have to know so much about wasm here
(JSC::B3::WasmBoundsCheckValue::WasmBoundsCheckValue):
(JSC::B3::WasmBoundsCheckValue::cloneImpl):
(JSC::B3::WasmBoundsCheckValue::dumpMeta):
* b3/B3WasmBoundsCheckValue.h:
(JSC::B3::WasmBoundsCheckValue::boundsType):
(JSC::B3::WasmBoundsCheckValue::bounds):
* b3/air/AirCode.h:
* b3/air/AirCustom.h:
(JSC::B3::Air::WasmBoundsCheckCustom::generate):
* b3/testb3.cpp:
(JSC::B3::testWasmBoundsCheck):
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::B3IRGenerator):
(JSC::Wasm::B3IRGenerator::emitCheckAndPreparePointer):
(JSC::Wasm::createJSToWasmWrapper): remove dead code
* wasm/WasmMemory.cpp: don't GC if no memory could possibly be free'd
(JSC::Wasm::Memory::initializePreallocations): verbose-only code,
and copy-pasta bug

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

5 years agoAX: <hr> should use a different role description than interactive separators
cfleizach@apple.com [Wed, 19 Apr 2017 21:58:05 +0000 (21:58 +0000)]
AX: <hr> should use a different role description than interactive separators
https://bugs.webkit.org/show_bug.cgi?id=170317
<rdar://problem/31363024>

Reviewed by Joanmarie Diggs.

Source/WebCore:

Users are confused with WebKit's accessibility description of separators.
We should call these what they are, horizontal rules.

Updated test: accessibility/mac/hr-element-expected.txt

* English.lproj/Localizable.strings:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::orientation):
* platform/cocoa/LocalizedStringsCocoa.mm:
(WebCore::AXHorizontalRuleDescriptionText):

LayoutTests:

* accessibility/mac/hr-element-expected.txt:
* accessibility/mac/hr-element.html:

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

5 years agoB3StackmapSpecial should handle when stackmap values are not recoverable from a Def...
mark.lam@apple.com [Wed, 19 Apr 2017 21:51:52 +0000 (21:51 +0000)]
B3StackmapSpecial should handle when stackmap values are not recoverable from a Def'ed arg.
https://bugs.webkit.org/show_bug.cgi?id=170973
<rdar://problem/30318657>

Reviewed by Filip Pizlo.

JSTests:

* stress/regress-170973.js: Added.

Source/JavaScriptCore:

In the event of an arithmetic overflow on a binary sub instruction (where the
result register is same as one of the operand registers), the CheckSub FTL
operation will try to recover the original value in the clobbered result register.

This recover is done by adding the other operand value to the result register.
However, this recovery method only works if the width of the original value in
the result register is less or equal to the width of the expected result.  If the
width of the original operand value (e.g. a JSInt32) is wider than the result
(e.g. a machine Int32), then the sub operation would have zero extended the
result and cleared the upper 32-bits of the result register.  Recovery by adding
back the other operand will not restore the JSValue tag in the upper word.

This poses a problem if the stackmap value for the operand relies on that same
clobbered register.

The fix is to detect this potential scenario (i.e. width of the Def's arg < width
of a stackmap value).  If this condition is detected, we'll declare the stackmap
value to be LateColdUse to ensure that the register allocator gives it a
different register if needed so that it's not dependent on the clobbered register.

* b3/B3CheckSpecial.cpp:
(JSC::B3::CheckSpecial::forEachArg):
* b3/B3PatchpointSpecial.cpp:
(JSC::B3::PatchpointSpecial::forEachArg):
* b3/B3StackmapSpecial.cpp:
(JSC::B3::StackmapSpecial::forEachArgImpl):
* b3/B3StackmapSpecial.h:

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

5 years agoRename cancelPayment to cancelPaymentSession
andersca@apple.com [Wed, 19 Apr 2017 21:30:05 +0000 (21:30 +0000)]
Rename cancelPayment to cancelPaymentSession
https://bugs.webkit.org/show_bug.cgi?id=171007

Reviewed by Tim Horton.

Source/WebCore:

* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::didCancelPaymentSession):
(WebCore::ApplePaySession::didCancelPayment): Deleted.
* Modules/applepay/ApplePaySession.h:
* Modules/applepay/PaymentCoordinator.cpp:
(WebCore::PaymentCoordinator::didCancelPaymentSession):
(WebCore::PaymentCoordinator::didCancelPayment): Deleted.
* Modules/applepay/PaymentCoordinator.h:

Source/WebKit2:

* UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
(WebKit::WebPaymentCoordinatorProxy::showPaymentUI):
(WebKit::WebPaymentCoordinatorProxy::didCancelPaymentSession):
(WebKit::WebPaymentCoordinatorProxy::didCancelPayment): Deleted.
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewControllerDidFinish:]):
* WebProcess/ApplePay/WebPaymentCoordinator.cpp:
(WebKit::WebPaymentCoordinator::didCancelPaymentSession):
(WebKit::WebPaymentCoordinator::didCancelPayment): Deleted.
* WebProcess/ApplePay/WebPaymentCoordinator.h:
* WebProcess/ApplePay/WebPaymentCoordinator.messages.in:

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

5 years agoASAN Crash running LayoutTests/inspector/worker tests
commit-queue@webkit.org [Wed, 19 Apr 2017 20:22:49 +0000 (20:22 +0000)]
ASAN Crash running LayoutTests/inspector/worker tests
https://bugs.webkit.org/show_bug.cgi?id=170967
<rdar://problem/31256437>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-04-19
Reviewed by Alex Christensen.

* workers/WorkerMessagingProxy.h:
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::WorkerMessagingProxy):
(WebCore::WorkerMessagingProxy::workerGlobalScopeDestroyedInternal):
Make the MessagingProxy thread safe ref counted. Since it used to
delete itself, turn this into a ref (implicit on construction)
and deref (replacing delete this).

(WebCore::WorkerMessagingProxy::postMessageToPageInspector):
When dispatching have the lambda implicitly ref/deref with the
lambda to keep the proxy alive while a lambda is queued.

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

5 years agoRemove executable property from a header file.
ryanhaddad@apple.com [Wed, 19 Apr 2017 20:20:15 +0000 (20:20 +0000)]
Remove executable property from a header file.

* include/KHR/khrplatform.h: Removed property svn:executable.

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

5 years agoUnreviewed, rolling out r215520.
jfbastien@apple.com [Wed, 19 Apr 2017 20:03:52 +0000 (20:03 +0000)]
Unreviewed, rolling out r215520.

Broke Debian 8

Reverted changeset:

"[INTL] Implement Intl.DateTimeFormat.prototype.formatToParts"
https://bugs.webkit.org/show_bug.cgi?id=169458
http://trac.webkit.org/changeset/215520

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

5 years agoWebAssembly: limit slow memories
jfbastien@apple.com [Wed, 19 Apr 2017 19:38:52 +0000 (19:38 +0000)]
WebAssembly: limit slow memories
https://bugs.webkit.org/show_bug.cgi?id=170825

Reviewed by Saam Barati.

JSTests:

* wasm.yaml:
* wasm/stress/oom.js: Added.
(try.true.WebAssemblyMemoryMode):
(catch):

Source/JavaScriptCore:

We limits the number of fast memories, partly because ASLR. The
code then falls back to slow memories. It first tries to virtually
allocated any declared maximum (and in there, physically the
initial), and if that fails it tries to physically allocate the
initial without any extra.

This can still be used to cause a bunch of virtual
allocation. This patch imposes soft limit on slow memories as
well. The total virtual maximum for slow memories is set at the
same (theoretical) value as that for fast memories.

Anything exceeding that limit causes allocation/grow to fail.

* wasm/WasmMemory.cpp:

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

5 years ago[WK2] Run tests with ResourceLoadStatistics enabled
bfulgham@apple.com [Wed, 19 Apr 2017 19:11:25 +0000 (19:11 +0000)]
[WK2] Run tests with ResourceLoadStatistics enabled
https://bugs.webkit.org/show_bug.cgi?id=170952

Reviewed by Andy Estes.

Excercise the load statistics code during tests.

* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::initializeWebViewConfiguration):

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

5 years agoclose_fds should be set to False on Windows.
commit-queue@webkit.org [Wed, 19 Apr 2017 18:57:49 +0000 (18:57 +0000)]
close_fds should be set to False on Windows.
https://bugs.webkit.org/show_bug.cgi?id=170838

Patch by Bill Ming <mbbill@gmail.com> on 2017-04-19
Reviewed by Brent Fulgham.

* Scripts/webkitpy/common/system/executive.py:
(Executive._should_close_fds):

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

5 years agoCannot compile JavaScriptCore/runtime/VMTraps.cpp on FreeBSD because std::pair has...
jfbastien@apple.com [Wed, 19 Apr 2017 18:25:43 +0000 (18:25 +0000)]
Cannot compile JavaScriptCore/runtime/VMTraps.cpp on FreeBSD because std::pair has a non-trivial copy constructor
https://bugs.webkit.org/show_bug.cgi?id=170875

Reviewed by Mark Lam.

WTF::ExpectedDetail::ConstexprBase doesn't have a user-defined
copy constructor, and its implicitly-defined copy constructor is
deleted because the default std::pair implementation on FreeBSD
has a non-trivial copy constructor. /usr/include/c++/v1/__config
says _LIBCPP_TRIVIAL_PAIR_COPY_CTOR is disabled in order to keep
ABI compatibility:
https://svnweb.freebsd.org/changeset/base/261801.

That's a huge bummer, and I'm not a fan of broken stdlibs, but in
this case it's pretty nice to have a custom named type anyways and
costs nothing.

* runtime/VMTraps.cpp:
(JSC::findActiveVMAndStackBounds):
(JSC::handleSigusr1):
(JSC::handleSigtrap):

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

5 years agoStop using strcpy() in WebKit::EnvironmentUtilities::stripValuesEndingWithString()
ddkilzer@apple.com [Wed, 19 Apr 2017 18:17:02 +0000 (18:17 +0000)]
Stop using strcpy() in WebKit::EnvironmentUtilities::stripValuesEndingWithString()
<https://webkit.org/b/170994>
<rdar://problem/29889932>

Reviewed by Brent Fulgham.

Source/WebKit2:

* Platform/unix/EnvironmentUtilities.cpp:
(WebKit::EnvironmentUtilities::stripValuesEndingWithString):
Switch from using strcpy() to strlcpy().  Also switch from using
strstr() to strnstr().
* Platform/unix/EnvironmentUtilities.h: Switch to #pragma once.
(WebKit::EnvironmentUtilities::stripValuesEndingWithString):
Export function for testing.
* WebKit2.xcodeproj/project.pbxproj:
(EnvironmentUtilitiesTest.h): Make header private for testing.

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
(EnvironmentUtilitiesTest.cpp): Add to TestWebKitAPILibrary
target.
* TestWebKitAPI/Tests/WebKit2/EnvironmentUtilitiesTest.cpp: Add.
(TestWebKitAPI::strip): Helper method to set/get environment
variable for testing.
(TestWebKitAPI::WebKit2_StripValuesEndingWithString_Test): Add
tests.

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

5 years ago[INTL] Implement Intl.DateTimeFormat.prototype.formatToParts
commit-queue@webkit.org [Wed, 19 Apr 2017 18:08:03 +0000 (18:08 +0000)]
[INTL] Implement Intl.DateTimeFormat.prototype.formatToParts
https://bugs.webkit.org/show_bug.cgi?id=169458

Patch by Andy VanWagoner <thetalecrafter@gmail.com> on 2017-04-19
Reviewed by JF Bastien.

Source/JavaScriptCore:

Use udat_formatForFields to iterate through the parts of a formatted date string.

* icu/unicode/udat.h: Update to 55.1.
* icu/unicode/ufieldpositer.h: Added from 55.1.
* runtime/IntlDateTimeFormat.cpp:
(JSC::IntlDateTimeFormat::partTypeString): Convert UDateFormatField to string.
(JSC::IntlDateTimeFormat::formatToParts): Return parts of formatted date string.
* runtime/IntlDateTimeFormat.h:
* runtime/IntlDateTimeFormatPrototype.cpp:
(JSC::IntlDateTimeFormatPrototypeFuncFormatToParts): Add prototype function formatToParts.

LayoutTests:

Add tests for formatToParts

* js/intl-datetimeformat-expected.txt:
* js/script-tests/intl-datetimeformat.js:

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

5 years agoWebAssembly: add script which can import GCC torture tests
jfbastien@apple.com [Wed, 19 Apr 2017 18:02:04 +0000 (18:02 +0000)]
WebAssembly: add script which can import GCC torture tests
https://bugs.webkit.org/show_bug.cgi?id=170740

Reviewed by Saam Barati.

Add a script which can import the GCC torture tests and create a
yaml file to run them as part of jsc's WebAssembly regression
tests.

This patch doesn't commit the tests themselves because they're
licensed differently.

* Scripts/run-jsc-stress-tests: learn how to run
Emscripten-generated .js+.wasm files, and do a bit of cleanup on
the options because WebAssembly is enabled by default.
* Scripts/update-wasm-gcc-torture.py: Added.
(parse_args):
(update_lkgr):
(untar_torture):
(list_js_files):
(waterfall_known_failures):
(create_yaml):
(main):

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

5 years agoMove notFound into its own file
commit-queue@webkit.org [Wed, 19 Apr 2017 17:57:53 +0000 (17:57 +0000)]
Move notFound into its own file
https://bugs.webkit.org/show_bug.cgi?id=170972

Patch by Sam Weinig <sam@webkit.org> on 2017-04-19
Reviewed by Zalan Bujtas.

It is odd to require including <wtf/Vector.h> just to use WTF::notFound.
This is not causing any current problems, but does in few changes I have
queued up.

* WTF.xcodeproj/project.pbxproj:
* wtf/NotFound.h: Added.
* wtf/Vector.h:
* wtf/text/StringCommon.h:

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

5 years agoWebAssembly: don't expose any WebAssembly JS object if JIT is off
jfbastien@apple.com [Wed, 19 Apr 2017 17:12:37 +0000 (17:12 +0000)]
WebAssembly: don't expose any WebAssembly JS object if JIT is off
https://bugs.webkit.org/show_bug.cgi?id=170782

Reviewed by Saam Barati.

JSTests:

* wasm.yaml:
* wasm/noJIT/noJIT.js: Added.

Source/JavaScriptCore:

It's unexpected that we expose the global WebAssembly object if no
JIT is present because it can't be used to compile or
instantiate. Other APIs such as Memory should also be Inaccessible
in those circumstances.

Also ensure that we don't pre-allocate fast memories if
WebAssembly won't be used, and don't mark our intention to use a
fast TLS slot for WebAssembly.

* runtime/Options.cpp:
(JSC::recomputeDependentOptions):

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

5 years agor211670 broke double to int conversion.
utatane.tea@gmail.com [Wed, 19 Apr 2017 16:49:38 +0000 (16:49 +0000)]
r211670 broke double to int conversion.
https://bugs.webkit.org/show_bug.cgi?id=170961

Reviewed by Mark Lam.

In this patch, we take a template parameter way.
While it reduces duplicate code, it effectively produces
optimized code for operationToInt32SensibleSlow,
and fixes kraken pbkdf2 regression on Linux.

And this patch also fixes undefined behavior by changing
int32_t to uint32_t. If exp is 31, missingOne is 1 << 31,
INT32_MIN. Thus missingOne - 1 will cause int32_t overflow,
and it is an undefined behavior.

* runtime/MathCommon.cpp:
(JSC::operationToInt32SensibleSlow):
* runtime/MathCommon.h:
(JSC::toInt32Internal):
(JSC::toInt32):

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

5 years agoLayoutTests/imported/w3c:
ryanhaddad@apple.com [Wed, 19 Apr 2017 16:32:27 +0000 (16:32 +0000)]
LayoutTests/imported/w3c:
Adding wpt tools

Import web-platform-tests/tools
https://bugs.webkit.org/show_bug.cgi?id=170718

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

* resources/TestRepositories:
* resources/import-expectations.json:
* resources/resource-files.json:
* resources/web-platform-tests-modules.json: Removed.
* web-platform-tests/.gitignore:
* web-platform-tests/XMLHttpRequest/XMLHttpRequest-withCredentials.any.worker-expected.txt: Added.
* web-platform-tests/XMLHttpRequest/XMLHttpRequest-withCredentials.any.worker.html: Copied from LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/XMLHttpRequest-withCredentials.worker.html.
* web-platform-tests/XMLHttpRequest/XMLHttpRequest-withCredentials.worker-expected.txt: Removed.
* web-platform-tests/XMLHttpRequest/getallresponseheaders-cl-expected.txt:
* web-platform-tests/XMLHttpRequest/responsetype-expected.txt:
* web-platform-tests/XMLHttpRequest/send-usp.any.worker-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-usp.worker-expected.txt.
* web-platform-tests/XMLHttpRequest/send-usp.any.worker.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-usp.worker.html.
* web-platform-tests/XMLHttpRequest/send-usp.worker.js: Removed.
* web-platform-tests/XMLHttpRequest/timeout-sync-expected.txt:
* web-platform-tests/dom/nodes/Document-contentType/contentType/contenttype_datauri_01-expected.txt:
* web-platform-tests/dom/nodes/Document-contentType/contentType/contenttype_datauri_02-expected.txt:
* web-platform-tests/fetch/api/basic/accept-header.any-expected.txt:
* web-platform-tests/fetch/api/basic/accept-header.any.worker-expected.txt: Added.
* web-platform-tests/fetch/api/basic/accept-header.any.worker.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/accept-header.worker.html.
* web-platform-tests/fetch/api/basic/accept-header.worker-expected.txt: Removed.
* web-platform-tests/fetch/api/basic/mode-same-origin.any-expected.txt:
* web-platform-tests/fetch/api/basic/mode-same-origin.any.worker-expected.txt: Added.
* web-platform-tests/fetch/api/basic/mode-same-origin.any.worker.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/mode-same-origin.worker.html.
* web-platform-tests/fetch/api/basic/mode-same-origin.worker-expected.txt: Removed.
* web-platform-tests/fetch/api/basic/referrer.any-expected.txt:
* web-platform-tests/fetch/api/basic/referrer.any.worker-expected.txt: Added.
* web-platform-tests/fetch/api/basic/referrer.any.worker.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/referrer.worker.html.
* web-platform-tests/fetch/api/basic/referrer.worker-expected.txt: Removed.
* web-platform-tests/fetch/api/basic/request-forbidden-headers.any-expected.txt:
* web-platform-tests/fetch/api/basic/request-forbidden-headers.any.worker-expected.txt: Added.
* web-platform-tests/fetch/api/basic/request-forbidden-headers.any.worker.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-forbidden-headers.worker.html.
* web-platform-tests/fetch/api/basic/request-forbidden-headers.worker-expected.txt: Removed.
* web-platform-tests/fetch/api/basic/request-head.any.worker-expected.txt: Added.
* web-platform-tests/fetch/api/basic/request-head.any.worker.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-head.worker.html.
* web-platform-tests/fetch/api/basic/request-head.worker-expected.txt: Removed.
* web-platform-tests/fetch/api/basic/request-headers.any-expected.txt:
* web-platform-tests/fetch/api/basic/request-headers.any.worker-expected.txt: Added.
* web-platform-tests/fetch/api/basic/request-headers.any.worker.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-headers.worker.html.
* web-platform-tests/fetch/api/basic/request-headers.worker-expected.txt: Removed.
* web-platform-tests/fetch/api/basic/request-referrer-redirected-worker-expected.txt:
* web-platform-tests/fetch/api/basic/request-referrer.any-expected.txt:
* web-platform-tests/fetch/api/basic/request-referrer.any.worker-expected.txt: Added.
* web-platform-tests/fetch/api/basic/request-referrer.any.worker.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-referrer.worker.html.
* web-platform-tests/fetch/api/basic/request-referrer.worker-expected.txt: Removed.
* web-platform-tests/fetch/api/basic/request-upload.any-expected.txt:
* web-platform-tests/fetch/api/basic/request-upload.any.worker-expected.txt: Added.
* web-platform-tests/fetch/api/basic/request-upload.any.worker.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-upload.worker.html.
* web-platform-tests/fetch/api/basic/request-upload.worker-expected.txt: Removed.
* web-platform-tests/fetch/api/basic/scheme-about.any.worker-expected.txt: Added.
* web-platform-tests/fetch/api/basic/scheme-about.any.worker.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/scheme-data.worker.html.
* web-platform-tests/fetch/api/basic/scheme-about.worker-expected.txt:
* web-platform-tests/fetch/api/basic/scheme-data.any.worker-expected.txt: Added.
* web-platform-tests/fetch/api/basic/scheme-data.any.worker.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/stream-response.worker.html.
* web-platform-tests/fetch/api/basic/scheme-data.worker-expected.txt: Removed.
* web-platform-tests/fetch/api/basic/stream-response.any-expected.txt:
* web-platform-tests/fetch/api/basic/stream-response.any.worker-expected.txt: Added.
* web-platform-tests/fetch/api/basic/stream-response.any.worker.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic.worker.html.
* web-platform-tests/fetch/api/basic/stream-response.worker-expected.txt: Removed.
* web-platform-tests/fetch/api/cors/cors-basic.any-expected.txt:
* web-platform-tests/fetch/api/cors/cors-basic.any.worker-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-basic.any.worker.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies.worker.html.
* web-platform-tests/fetch/api/cors/cors-basic.worker-expected.txt: Removed.
* web-platform-tests/fetch/api/cors/cors-cookies.any-expected.txt:
* web-platform-tests/fetch/api/cors/cors-cookies.any.worker-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-cookies.any.worker.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight.worker.html.
* web-platform-tests/fetch/api/cors/cors-cookies.worker-expected.txt: Removed.
* web-platform-tests/fetch/api/cors/cors-no-preflight.any-expected.txt:
* web-platform-tests/fetch/api/cors/cors-no-preflight.any.worker-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-no-preflight.any.worker.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin.worker.html.
* web-platform-tests/fetch/api/cors/cors-no-preflight.worker-expected.txt: Removed.
* web-platform-tests/fetch/api/cors/cors-origin.any-expected.txt:
* web-platform-tests/fetch/api/cors/cors-origin.any.worker-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-origin.any.worker.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-redirect.worker.html.
* web-platform-tests/fetch/api/cors/cors-origin.worker-expected.txt: Removed.
* web-platform-tests/fetch/api/cors/cors-preflight-redirect.any-expected.txt:
* web-platform-tests/fetch/api/cors/cors-preflight-redirect.any.worker-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-redirect.any.worker.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-referrer.worker.html.
* web-platform-tests/fetch/api/cors/cors-preflight-redirect.worker-expected.txt: Removed.
* web-platform-tests/fetch/api/cors/cors-preflight-referrer.any-expected.txt:
* web-platform-tests/fetch/api/cors/cors-preflight-referrer.any.worker-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-referrer.any.worker.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-star.worker.html.
* web-platform-tests/fetch/api/cors/cors-preflight-referrer.worker-expected.txt: Removed.
* web-platform-tests/fetch/api/cors/cors-preflight-star.any-expected.txt:
* web-platform-tests/fetch/api/cors/cors-preflight-star.any.worker-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-star.any.worker.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status.worker.html.
* web-platform-tests/fetch/api/cors/cors-preflight-star.worker-expected.txt: Removed.
* web-platform-tests/fetch/api/cors/cors-preflight-status.any-expected.txt:
* web-platform-tests/fetch/api/cors/cors-preflight-status.any.worker-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-status.any.worker.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight.worker.html.
* web-platform-tests/fetch/api/cors/cors-preflight-status.worker-expected.txt: Removed.
* web-platform-tests/fetch/api/cors/cors-preflight.any-expected.txt:
* web-platform-tests/fetch/api/cors/cors-preflight.any.worker-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-preflight.any.worker.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-credentials.worker.html.
* web-platform-tests/fetch/api/cors/cors-preflight.worker-expected.txt: Removed.
* web-platform-tests/fetch/api/cors/cors-redirect-credentials.any-expected.txt:
* web-platform-tests/fetch/api/cors/cors-redirect-credentials.any.worker-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-redirect-credentials.any.worker.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-preflight.worker.html.
* web-platform-tests/fetch/api/cors/cors-redirect-credentials.worker-expected.txt: Removed.
* web-platform-tests/fetch/api/cors/cors-redirect-preflight.any-expected.txt:
* web-platform-tests/fetch/api/cors/cors-redirect-preflight.any.worker-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-redirect-preflight.any.worker.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect.worker.html.
* web-platform-tests/fetch/api/cors/cors-redirect-preflight.worker-expected.txt: Removed.
* web-platform-tests/fetch/api/cors/cors-redirect.any-expected.txt:
* web-platform-tests/fetch/api/cors/cors-redirect.any.worker-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-redirect.any.worker.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/authentication-basic.worker.html.
* web-platform-tests/fetch/api/cors/cors-redirect.worker-expected.txt: Removed.
* web-platform-tests/fetch/api/credentials/authentication-basic.any-expected.txt:
* web-platform-tests/fetch/api/credentials/authentication-basic.any.worker-expected.txt: Added.
* web-platform-tests/fetch/api/credentials/authentication-basic.any.worker.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/cookies.worker.html.
* web-platform-tests/fetch/api/credentials/authentication-basic.worker-expected.txt: Removed.
* web-platform-tests/fetch/api/credentials/cookies.any-expected.txt:
* web-platform-tests/fetch/api/credentials/cookies.any.worker-expected.txt: Added.
* web-platform-tests/fetch/api/credentials/cookies.any.worker.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/fetch/api/headers/historical.worker.html.
* web-platform-tests/fetch/api/credentials/cookies.worker-expected.txt: Removed.
* web-platform-tests/fetch/api/headers/historical.any.worker-expected.txt: Added.
* web-platform-tests/fetch/api/headers/historical.any.worker.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/hr-time/basic.worker.html.
* web-platform-tests/fetch/api/headers/historical.worker-expected.txt: Removed.
* web-platform-tests/fetch/api/redirect/redirect-count-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-count-worker-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-location-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-location-worker-expected.txt:
* web-platform-tests/fetch/api/request/request-cache-only-if-cached-expected.txt: Copied from LayoutTests/platform/mac/imported/w3c/web-platform-tests/fetch/api/request/request-cache-only-if-cached-expected.txt.
* web-platform-tests/fetch/http-cache/partial-expected.txt:
* web-platform-tests/hr-time/basic.any.worker-expected.txt: Added.
* web-platform-tests/hr-time/basic.any.worker.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/hr-time/monotonic-clock.worker.html.
* web-platform-tests/hr-time/basic.worker-expected.txt: Removed.
* web-platform-tests/hr-time/basic.worker.js: Removed.
* web-platform-tests/hr-time/monotonic-clock.any.worker-expected.txt: Added.
* web-platform-tests/hr-time/monotonic-clock.any.worker.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/html/dom/self-origin.worker.html.
* web-platform-tests/hr-time/monotonic-clock.worker-expected.txt: Removed.

Tools:
Import web-platform-tests/tools
https://bugs.webkit.org/show_bug.cgi?id=170718

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

* Scripts/webkitpy/layout_tests/servers/web_platform_test_launcher.py:
(main):
* Scripts/webkitpy/layout_tests/servers/web_platform_test_server.py:
(WebPlatformTestServer.ports_to_forward):
(WebPlatformTestServer._prepare_config):
(WebPlatformTestServer._install_modules): Deleted.
* Scripts/webkitpy/w3c/test_importer.py:
(TestImporter.write_html_files_for_templated_js_tests):

LayoutTests:
Import web-platform-tests/tools
https://bugs.webkit.org/show_bug.cgi?id=170718

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

* TestExpectations:
* platform/mac-wk1/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic.any-expected.txt: Added.
* platform/mac-wk1/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic.any.worker-expected.txt: Added.
* platform/mac-wk1/imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight.any-expected.txt: Added.
* platform/mac-wk1/imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight.any.worker-expected.txt: Added.
* platform/mac-wk1/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin.any-expected.txt: Added.
* platform/mac-wk1/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin.any.worker-expected.txt: Added.
* platform/mac-wk1/imported/w3c/web-platform-tests/fetch/api/request/request-cache-only-if-cached-expected.txt: Renamed from LayoutTests/platform/mac/imported/w3c/web-platform-tests/fetch/api/request/request-cache-only-if-cached-expected.txt.
* tests-options.json:

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

5 years ago[iOS, macOS] Guard against passing nullptr to vImagePremultiplyData
bfulgham@apple.com [Wed, 19 Apr 2017 16:17:53 +0000 (16:17 +0000)]
[iOS, macOS] Guard against passing nullptr to vImagePremultiplyData
https://bugs.webkit.org/show_bug.cgi?id=170912
<rdar://problem/30565800>

Reviewed by Brady Eidson.

* platform/graphics/cg/ImageBufferDataCG.cpp:
(WebCore::affineWarpBufferData): Assert if we passed nullptr buffers.
(WebCore::transferData): Ditto.
(WebCore::ImageBufferData::getData): Check for nullptr data member and avoid passing to vImage routines.
(WebCore::ImageBufferData::putData): Ditto.

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

5 years agoRemove bogus assert for :not.
hyatt@apple.com [Wed, 19 Apr 2017 16:14:51 +0000 (16:14 +0000)]
Remove bogus assert for :not.
https://bugs.webkit.org/show_bug.cgi?id=170995
<rdar://problem/29693115>

Reviewed by Zalan Bujtas.

* css/parser/CSSSelectorParser.cpp:

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

5 years agoProvide a way for clients to unmute a media stream.
eric.carlson@apple.com [Wed, 19 Apr 2017 15:51:37 +0000 (15:51 +0000)]
Provide a way for clients to unmute a media stream.
https://bugs.webkit.org/show_bug.cgi?id=170855
<rdar://problem/31656855>

Unreviewed, fix a typo missed in the review of r215420.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setPageMuted:]):

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

5 years agoVersioning.
jmarcell@apple.com [Wed, 19 Apr 2017 15:20:50 +0000 (15:20 +0000)]
Versioning.

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

5 years ago[Modern Media Controls] Allow non-PNG resources
graouts@webkit.org [Wed, 19 Apr 2017 14:57:52 +0000 (14:57 +0000)]
[Modern Media Controls] Allow non-PNG resources
https://bugs.webkit.org/show_bug.cgi?id=170992
<rdar://problem/31706590>

Reviewed by Dean Jackson.

Instead of passing in a name and a platform to MediaControlsHost::base64StringForIconAndPlatform(),
we now pass in a name and a type to MediaControlsHost::base64StringForIconNameAndType(). We've removed
the need to provide a platform by copying the resources directly under "Resources/modern-media-controls"
insted of "Resources/modern-media-controls/platform-name-here", and now we provide a type so that it
may be passed down to -[NSBundle pathForResource:ofType:inDirectory:].

* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::base64StringForIconNameAndType):
(WebCore::MediaControlsHost::base64StringForIconAndPlatform): Deleted.
* Modules/mediacontrols/MediaControlsHost.h:
* Modules/mediacontrols/MediaControlsHost.idl:
* Modules/modern-media-controls/controls/icon-service.js:
(const.iconService.new.IconService.prototype.imageForIconNameAndLayoutTraits):
* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderTheme.h:
(WebCore::RenderTheme::mediaControlsBase64StringForIconNameAndType):
(WebCore::RenderTheme::mediaControlsBase64StringForIconAndPlatform): Deleted.
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::mediaControlsBase64StringForIconNameAndType):
(WebCore::RenderThemeIOS::mediaControlsBase64StringForIconAndPlatform): Deleted.
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::mediaControlsBase64StringForIconNameAndType):
(WebCore::RenderThemeMac::mediaControlsBase64StringForIconAndPlatform): Deleted.

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

5 years ago[GTK] WebKitAutocleanups.h regression in v2.16.1 release
commit-queue@webkit.org [Wed, 19 Apr 2017 13:00:37 +0000 (13:00 +0000)]
[GTK] WebKitAutocleanups.h regression in v2.16.1 release
https://bugs.webkit.org/show_bug.cgi?id=170987

Patch by Adrian Perez de Castro <aperez@igalia.com> on 2017-04-19
Reviewed by Carlos Garcia Campos.

* UIProcess/API/gtk/WebKitAutocleanups.h: Remove stray semicolon.

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

5 years agoAvoid repaints for invisible animations on tumblr.com/search/aww
antti@apple.com [Wed, 19 Apr 2017 12:15:37 +0000 (12:15 +0000)]
Avoid repaints for invisible animations on tumblr.com/search/aww
https://bugs.webkit.org/show_bug.cgi?id=170986
<rdar://problem/28644580>

Reviewed by Andreas Kling.

Source/WebCore:

Test: fast/repaint/mutate-non-visible.html

* rendering/style/RenderStyle.cpp:
(WebCore::requiresPainting):
(WebCore::RenderStyle::changeRequiresRepaint):

    If an element is invisible it does not require repaint even if something else changes.

LayoutTests:

* fast/repaint/mutate-non-visible-expected.txt: Added.
* fast/repaint/mutate-non-visible.html: Added.

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

5 years agoNon-muxable GPUs shouldn't allow offline rendering
dino@apple.com [Wed, 19 Apr 2017 08:41:29 +0000 (08:41 +0000)]
Non-muxable GPUs shouldn't allow offline rendering
https://bugs.webkit.org/show_bug.cgi?id=170984
<rdar://problem/31614406>

Reviewed by Myles Maxfield.

Setting the kCGLPFAAllowOfflineRenderers flag doesn't do any
harm on devices that only have one GPU. It's also what we
want on devices that can mux between GPUs. However, we were
also setting it unconditionally on devices with multiple
GPUs that have issues muxing.

* platform/graphics/mac/GraphicsContext3DMac.mm:
(WebCore::setPixelFormat): Add a test for hasMuxableGPU.

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

5 years agoAnother build fix after r215061. Clear TriggerableRepositoryGroup's static map in...
rniwa@webkit.org [Wed, 19 Apr 2017 07:42:12 +0000 (07:42 +0000)]
Another build fix after r215061. Clear TriggerableRepositoryGroup's static map in each iteration.

* tools/sync-buildbot.js:
(syncLoop):

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

5 years agoDragging a few items over MiniBrowser has 0 in the red indicator.
pvollan@apple.com [Wed, 19 Apr 2017 05:59:27 +0000 (05:59 +0000)]
Dragging a few items over MiniBrowser has 0 in the red indicator.
https://bugs.webkit.org/show_bug.cgi?id=170874

Reviewed by Tim Horton.

When WebKit does not accept the drag items, the drag count badge should not be updated.
Also, if WebKit changes the drag count badge, it should be restored to its original
value when the drag exits.

* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::draggingEntered):
(WebKit::WebViewImpl::draggingUpdated):
(WebKit::WebViewImpl::draggingExited):

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

5 years agoBuild fix after r215061.
rniwa@webkit.org [Wed, 19 Apr 2017 05:58:44 +0000 (05:58 +0000)]
Build fix after r215061.

There was a mismatch between the format updateTriggerable and /api/update-triggerable were using.
Namely, each repository group was assumed to contain a name field in /api/update-triggerable
but updateTriggerable was not including that at all.

We didn't catch this because the test for updateTriggerable also used the wrong format :(

* server-tests/tools-buildbot-triggerable-tests.js:
* tools/js/buildbot-triggerable.js:
(BuildbotTriggerable.prototype.updateTriggerable):

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

5 years ago[WK2] Add infrastructure and unit tests for file uploads using data interaction
wenson_hsieh@apple.com [Wed, 19 Apr 2017 04:22:19 +0000 (04:22 +0000)]
[WK2] Add infrastructure and unit tests for file uploads using data interaction
https://bugs.webkit.org/show_bug.cgi?id=170903
<rdar://problem/31314689>

Reviewed by Tim Horton.

Source/WebKit2:

See Tools/ChangeLog for more details. Makes a small adjustment to _simulateDataInteractionUpdated: to return a
BOOL indicating whether or not to allow the operation to proceed. This is necessary for testing scenarios where
multiple files are being "data interacted" onto an element. See <https://bugs.webkit.org/show_bug.cgi?id=170880>
for more details about the change this patch is testing.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _simulateDataInteractionUpdated:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/ios/WKContentViewInteraction.h:

Tools:

Adds 5 new unit tests covering different cases of uploading files through data interaction, as well as
infrastructure for simulating UIItemProviders that load file data. Makes a few adjustments to the
DataInteractionSimulator along the way, detailed in the per-method annotations below. See
<https://bugs.webkit.org/show_bug.cgi?id=170880> for more details about the change this patch is testing.

New tests:
DataInteractionTests.ExternalSourceImageToFileInput
DataInteractionTests.ExternalSourceHTMLToUploadArea
DataInteractionTests.ExternalSourceImageAndHTMLToSingleFileInput
DataInteractionTests.ExternalSourceImageAndHTMLToMultipleFileInput
DataInteractionTests.ExternalSourceImageAndHTMLToUploadArea

* TestWebKitAPI/Tests/ios/DataInteractionTests.mm:
(testIconImage):
(temporaryURLForDataInteractionFileLoad):
(cleanUpDataInteractionTemporaryPath):

Creates and tears down temporary file directories for testing data interaction.

(-[UIItemProvider registerFileRepresentationForTypeIdentifier:withData:filename:]):
(TestWebKitAPI::TEST):
* TestWebKitAPI/ios/DataInteractionSimulator.h:
* TestWebKitAPI/ios/DataInteractionSimulator.mm:

Make necessary changes to be able to test what happens when data interaction ends over an element with no
operation. Previously, we would always simulate performing a data interaction operation when ending the
simulation, but this causes us to wait indefinitely for a data operation response to arrive in the UI process.
Instead, we need to note whether or not the content view is allowing data interaction, and only perform an
operation and wait for the -didPerform call if the operation was allowed. Otherwise, we immediately transition
the phase to Cancelled and end the run.

(-[DataInteractionSimulator _resetSimulatedState]):
(-[DataInteractionSimulator runFrom:to:]):
(-[DataInteractionSimulator _concludeDataInteractionAndPerformOperationIfNecessary]):
(-[DataInteractionSimulator _advanceProgress]):
(-[DataInteractionSimulator externalItemProviders]):
(-[DataInteractionSimulator setExternalItemProviders:]):

Previously, we hard-coded DataInteractionSimulator to only support a single external item provider. In order to
test the scenario where multiple files are being "data interacted" into a file-type input, we generalize this to
take multiple item providers.

(-[DataInteractionSimulator externalItemProvider]): Deleted.
(-[DataInteractionSimulator setExternalItemProvider:]): Deleted.

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

5 years agoRTCOfferOptions iceRestart should be supported
commit-queue@webkit.org [Wed, 19 Apr 2017 04:01:48 +0000 (04:01 +0000)]
RTCOfferOptions iceRestart should be supported
https://bugs.webkit.org/show_bug.cgi?id=170966

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

No ability to test iceRestart as of now.
Passing iceRestart value to libwebrtc.
Passing also voiceActivityDetection value to libwebrtc.
Updating mock to use the new overloaded CreateOffer method.

* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::doCreateOffer):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
* testing/MockLibWebRTCPeerConnection.cpp:
(WebCore::MockLibWebRTCPeerConnection::CreateOffer):
* testing/MockLibWebRTCPeerConnection.h:

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

5 years agoAdd the actual content to the files, now that
dino@apple.com [Wed, 19 Apr 2017 03:29:59 +0000 (03:29 +0000)]
Add the actual content to the files, now that
SVN knows they can have tabs.

* src/third_party/murmurhash/MurmurHash3.cpp:
* src/third_party/murmurhash/MurmurHash3.h:

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

5 years agoWinCairo needs these files I recently removed
dino@apple.com [Wed, 19 Apr 2017 03:27:28 +0000 (03:27 +0000)]
WinCairo needs these files I recently removed
from our copy of ANGLE.

* src/third_party/murmurhash/LICENSE: Added.
* src/third_party/murmurhash/MurmurHash3.cpp: Added.
* src/third_party/murmurhash/MurmurHash3.h: Added.

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

5 years ago[WK2] Support DataTransfer::files() when performing a DHTML data interaction
wenson_hsieh@apple.com [Wed, 19 Apr 2017 03:22:58 +0000 (03:22 +0000)]
[WK2] Support DataTransfer::files() when performing a DHTML data interaction
https://bugs.webkit.org/show_bug.cgi?id=170880
<rdar://problem/31314689>

Reviewed by Tim Horton.

Source/WebCore:

Adds support for fetching files from the DataTransfer when performing a data interaction operation handled by
JavaScript. There are two changes we make here to achieve this:

First, we teach the Pasteboard on iOS to know what file paths hold the item provider contents used in the
current data interaction operation. On iOS, Pasteboard::readFilenames is currently hard-coded to return an empty
vector. To fix this, we add logic to the iOS Pasteboard to remember what the paths of all files that were
successfully loaded from item providers as the data interaction is taking place. This ensures that at the
WebCore layer, the implementation of Pasteboard::readFilenames on Mac and iOS is similar -- they both call out
to the client layer in order to read file paths off of their respective pasteboards. Once in the client layer
(WebKit1 or WebKit2) we then call into PlatformPasteboard::filenamesForDataInteraction, which then calls into
WebItemProviderPasteboard if applicable.

The second tweak is to propagate information about whether the document is preventing default data interaction
behavior to the client layer. This prevents us from having to save pasteboard content when performing data
interaction in cases where file information is not needed (i.e. the default behavior is being performed, and
the target is not a file input). This also avoids compatibility issues with insertion animations when performing
data interaction in editable areas, due to the extra time spent loading item provider data into a temporary
file.

Unit tests in <https://bugs.webkit.org/show_bug.cgi?id=170903>.

* page/DragController.cpp:
(WebCore::DragController::DragController):
(WebCore::DragController::performDragOperation):
(WebCore::DragController::dragEnteredOrUpdated):
(WebCore::DragController::tryDocumentDrag):

Refactor DragController::tryDocumentDrag to return a DragHandlingMethod. This method currently returns either
true or false; this patch changes it to return a DragHandlingMethod, which is either None (the equivalent of
returning false before the patch), Default (indicating that the drop destination is allowing default handling),
or NonDefault, which indicates that the drop destination has explicitly prevented default.

* page/DragController.h:
(WebCore::DragController::documentIsHandlingNonDefaultDrag):

Used by WebPage when sending an IPC response after handling dragentered or dragupdated.

* platform/PasteboardStrategy.h:
* platform/PlatformPasteboard.h:
* platform/ios/AbstractPasteboard.h:
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::readFilenames):
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::filenamesForDataInteraction):
* platform/ios/WebItemProviderPasteboard.h:
* platform/ios/WebItemProviderPasteboard.mm:

WebItemProviderPasteboard now remembers the file URLs of successfully loaded item provider content when a data
interaction is being performed. The new filenamesForDataInteraction property returns the array of data
interaction file URLs which have been propagated to the web process along with sandbox extensions. This state
is cleaned up when list of item providers change (i.e. when the data interaction operation is finished, or if
the web content process crashes, etc.)

(-[WebItemProviderPasteboard init]):
(-[WebItemProviderPasteboard setItemProviders:]):
(-[WebItemProviderPasteboard filenamesForDataInteraction]):
(-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:]):

Source/WebKit/mac:

Adjust for a change in PasteboardStrategy. See WebCore ChangeLog for more details.

* WebCoreSupport/WebPlatformStrategies.h:
* WebCoreSupport/WebPlatformStrategies.mm:
(WebPlatformStrategies::getFilenamesForDataInteraction):

Source/WebKit2:

See the WebCore ChangeLog for more details.

* UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
(WebKit::WebPasteboardProxy::getFilenamesForDataInteraction):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didPerformDragControllerAction):
(WebKit::WebPageProxy::resetCurrentDragInformation):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::documentIsHandlingNonDefaultDrag):
* UIProcess/WebPageProxy.messages.in:

Adds an IPC argument to DidPerformDragControllerAction specifying whether the page prevented the default behavior.

* UIProcess/WebPasteboardProxy.h:
* UIProcess/WebPasteboardProxy.messages.in:

Adds IPC plumbing for the new filenamesForDataInteraction Pasteboard codepath.

* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::getFilenamesForDataInteraction):
* WebProcess/WebCoreSupport/WebPlatformStrategies.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::performDragControllerAction):

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

5 years agoCairo build fix.
dino@apple.com [Wed, 19 Apr 2017 02:12:14 +0000 (02:12 +0000)]
Cairo build fix.
https://bugs.webkit.org/show_bug.cgi?id=170941

* platform/graphics/cairo/GraphicsContext3DCairo.cpp:
(WebCore::GraphicsContext3D::GraphicsContext3D):

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

5 years agoStill trying to fix Windows.
dino@apple.com [Wed, 19 Apr 2017 02:10:06 +0000 (02:10 +0000)]
Still trying to fix Windows.

* PlatformWin.cmake:

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

5 years agoAttempt to fix the Windows build.
dino@apple.com [Wed, 19 Apr 2017 01:56:26 +0000 (01:56 +0000)]
Attempt to fix the Windows build.

* PlatformWin.cmake:

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

5 years agoAdd NDEBUG and CodeStripping to libwebrtc build system
commit-queue@webkit.org [Wed, 19 Apr 2017 01:51:00 +0000 (01:51 +0000)]
Add NDEBUG and CodeStripping to libwebrtc build system
https://bugs.webkit.org/show_bug.cgi?id=170954

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

This optimizes libwebrtc library size and efficiency.
This allows allocating libwebrtc objects in WebCore without issues.

* Configurations/Base.xcconfig:
* Configurations/boringssl.xcconfig:
* Configurations/libsrtp.xcconfig:
* Configurations/libwebrtc.xcconfig:
* Configurations/libwebrtcpcrtc.xcconfig:
* Configurations/opus.xcconfig:
* Configurations/usrsctp.xcconfig:

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

5 years agoRebaseline bindings tests after r215486.
ryanhaddad@apple.com [Wed, 19 Apr 2017 01:46:15 +0000 (01:46 +0000)]
Rebaseline bindings tests after r215486.

Unreviewed test gardening.

* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjOnfooGetter):
(WebCore::jsTestObjOnwebkitfooGetter):

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

5 years agoAttempted build fix. Add/remove some files from ANGLE.
dino@apple.com [Wed, 19 Apr 2017 01:22:10 +0000 (01:22 +0000)]
Attempted build fix. Add/remove some files from ANGLE.

* CMakeLists.txt:

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