WebKit.git
2 years agoClean up WebPaymentCoordinatorProxy
andersca@apple.com [Thu, 9 Mar 2017 00:43:31 +0000 (00:43 +0000)]
Clean up WebPaymentCoordinatorProxy
https://bugs.webkit.org/show_bug.cgi?id=169393
Part of rdar://problem/28880714.

Reviewed by Beth Dakin.

* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewControllerDidFinish:]):
Move this to where it belongs.

(WebKit::toPKPaymentSummaryItems):
Add a new helper function.

(WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection):
(WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection):
Use the new helper function.

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

2 years agoVersioning.
jmarcell@apple.com [Thu, 9 Mar 2017 00:34:36 +0000 (00:34 +0000)]
Versioning.

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

2 years agoDrop select.remove() / options.remove() overloads taking an option element in parameter
cdumez@apple.com [Thu, 9 Mar 2017 00:30:55 +0000 (00:30 +0000)]
Drop select.remove() / options.remove() overloads taking an option element in parameter
https://bugs.webkit.org/show_bug.cgi?id=169339

Reviewed by Sam Weinig.

Source/WebCore:

Drop select.remove() / options.remove() overloads taking an option element in parameter.
It is non-standard:
- https://html.spec.whatwg.org/multipage/forms.html#the-select-element
- https://html.spec.whatwg.org/multipage/infrastructure.html#htmloptionscollection

It is not supported by Firefox and was removed from Chrome:
- https://bugs.chromium.org/p/chromium/issues/detail?id=345697
- https://bugs.chromium.org/p/chromium/issues/detail?id=398627

Chrome UseCounter data shows consistent 0% usage:
- https://www.chromestatus.com/metrics/feature/timeline/popularity/398

Test: fast/dom/HTMLSelectElement/remove-option-element.html

* html/HTMLOptionsCollection.cpp:
* html/HTMLOptionsCollection.h:
* html/HTMLOptionsCollection.idl:
* html/HTMLSelectElement.cpp:
* html/HTMLSelectElement.h:
* html/HTMLSelectElement.idl:

LayoutTests:

Add layout test coverage.

* fast/dom/HTMLSelectElement/remove-option-element-expected.txt: Added.
* fast/dom/HTMLSelectElement/remove-option-element.html: Added.

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

2 years agoParameter to input.setCustomValidity() should not be nullable
cdumez@apple.com [Thu, 9 Mar 2017 00:30:17 +0000 (00:30 +0000)]
Parameter to input.setCustomValidity() should not be nullable
https://bugs.webkit.org/show_bug.cgi?id=169332

Reviewed by Sam Weinig.

Source/WebCore:

Parameter to input.setCustomValidity() should not be nullable:
- https://html.spec.whatwg.org/#htmlinputelement

Firefox and Chrome agree with the specification so the change
should be safe.

Test: fast/forms/setCustomValidity-null-parameter.html

* html/HTMLButtonElement.idl:
* html/HTMLFieldSetElement.idl:
* html/HTMLInputElement.idl:
* html/HTMLKeygenElement.idl:
* html/HTMLObjectElement.idl:
* html/HTMLOutputElement.idl:
* html/HTMLSelectElement.idl:
* html/HTMLTextAreaElement.idl:

LayoutTests:

* fast/forms/ValidityState-customError-expected.txt:
* fast/forms/ValidityState-customError.html:
Rebaseline now that behavior has changed when passing null or undefined
to setCustomValidity().

* fast/forms/setCustomValidity-null-parameter-expected.txt: Added.
* fast/forms/setCustomValidity-null-parameter.html: Added.
Add layout test coverage.

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

2 years agoUse H264 hardware encoder for Mac libwebrtc
commit-queue@webkit.org [Thu, 9 Mar 2017 00:21:09 +0000 (00:21 +0000)]
Use H264 hardware encoder for Mac libwebrtc
https://bugs.webkit.org/show_bug.cgi?id=169383

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

Switching to H264 hardware encoder if available for Mac.
Adding logs in case hardware encoder cannot be used.

* Configurations/libwebrtc.xcconfig:
* Source/webrtc/sdk/objc/Framework/Classes/h264_video_toolbox_encoder.mm:
(webrtc::H264VideoToolboxEncoder::ResetCompressionSession):
(webrtc::H264VideoToolboxEncoder::ConfigureCompressionSession):

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

2 years agoMark media/modern-media-controls/airplay-button/airplay-button.html as failing.
ryanhaddad@apple.com [Thu, 9 Mar 2017 00:12:02 +0000 (00:12 +0000)]
Mark media/modern-media-controls/airplay-button/airplay-button.html as failing.
https://bugs.webkit.org/show_bug.cgi?id=168409

Unreviewed test gardening.

* TestExpectations:

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

2 years agoSupport transitions/animations of background-position with right/bottom-relative...
simon.fraser@apple.com [Wed, 8 Mar 2017 23:50:43 +0000 (23:50 +0000)]
Support transitions/animations of background-position with right/bottom-relative values
https://bugs.webkit.org/show_bug.cgi?id=162048

Reviewed by Dean Jackson.
Source/WebCore:

Make transitions between "background-position: 10px 20px" and "background-position: right 10px bottom 20px"
work. We do this by by converting "right 10px" to "calc(100% - 10px)" when blending.

Also improve logging of calculated lengths, and better animation logging for FillLayer properties.

Test: transitions/background-position-transitions.html

* page/animation/CSSPropertyAnimation.cpp:
(WebCore::FillLayerAnimationPropertyWrapperBase::FillLayerAnimationPropertyWrapperBase): Keep the propertyID
around so logging can use it.
(WebCore::FillLayerAnimationPropertyWrapperBase::property):
(WebCore::FillLayerPropertyWrapperGetter::FillLayerPropertyWrapperGetter):
(WebCore::FillLayerPropertyWrapperGetter::value):
(WebCore::FillLayerPropertyWrapper::FillLayerPropertyWrapper):
(WebCore::createCalculatedLength):
(WebCore::FillLayerPositionPropertyWrapper::FillLayerPositionPropertyWrapper):
(WebCore::FillLayerRefCountedPropertyWrapper::FillLayerRefCountedPropertyWrapper):
(WebCore::FillLayerStyleImagePropertyWrapper::FillLayerStyleImagePropertyWrapper):
(WebCore::FillLayersPropertyWrapper::FillLayersPropertyWrapper):
(WebCore::CSSPropertyAnimation::blendProperties): Blend then log, so that the logging
can show the result.
* platform/CalculationValue.cpp:
(WebCore::CalcExpressionNumber::dump):
(WebCore::CalcExpressionBinaryOperation::dump):
(WebCore::CalcExpressionLength::dump):
(WebCore::CalcExpressionBlendLength::dump):
(WebCore::operator<<):
* platform/CalculationValue.h:
* platform/Length.cpp:
(WebCore::operator<<):

LayoutTests:

* transitions/background-position-transitions-expected.txt: Added.
* transitions/background-position-transitions.html: Added.
* transitions/resources/transition-test-helpers.js:
* transitions/svg-transitions-expected.txt:

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

2 years ago[Mac][WK2] Whitelist a local cache needed by CFNetwork
bfulgham@apple.com [Wed, 8 Mar 2017 23:31:24 +0000 (23:31 +0000)]
[Mac][WK2] Whitelist a local cache needed by CFNetwork
https://bugs.webkit.org/show_bug.cgi?id=169388
<rdar://problem/30224000>

Reviewed by Alex Christensen.

Whitelist access to a local cache needed by CFNetwork.

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

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

2 years agoSimplify the PaymentCoordinator interface
andersca@apple.com [Wed, 8 Mar 2017 22:56:22 +0000 (22:56 +0000)]
Simplify the PaymentCoordinator interface
https://bugs.webkit.org/show_bug.cgi?id=169382
Part of rdar://problem/28880714.

Reviewed by Tim Horton.

Source/WebCore:

Add four new structs: PaymentAuthorizationResult, PaymentMethodUpdate, ShippingContactUpdate and ShippingMethodUpdate.
Change the various PaymentCoordinator and PaymentCoordinatorClient functions to take these new objects instead of multiple parameters.

* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::completeShippingMethodSelection):
(WebCore::ApplePaySession::completeShippingContactSelection):
(WebCore::ApplePaySession::completePaymentMethodSelection):
(WebCore::ApplePaySession::completePayment):
(WebCore::ApplePaySession::didSelectShippingMethod):
(WebCore::ApplePaySession::didSelectShippingContact):
* Modules/applepay/PaymentAuthorizationStatus.h:
* Modules/applepay/PaymentCoordinator.cpp:
(WebCore::PaymentCoordinator::completeShippingMethodSelection):
(WebCore::PaymentCoordinator::completeShippingContactSelection):
(WebCore::PaymentCoordinator::completePaymentMethodSelection):
(WebCore::PaymentCoordinator::completePaymentSession):
* Modules/applepay/PaymentCoordinator.h:
* Modules/applepay/PaymentCoordinatorClient.h:
* Modules/applepay/PaymentRequest.h:
* loader/EmptyClients.cpp:

Source/WebKit/mac:

Update for PaymentCoordinatorClient changes.

* WebCoreSupport/WebPaymentCoordinatorClient.h:
* WebCoreSupport/WebPaymentCoordinatorClient.mm:
(WebPaymentCoordinatorClient::completeShippingMethodSelection):
(WebPaymentCoordinatorClient::completeShippingContactSelection):
(WebPaymentCoordinatorClient::completePaymentMethodSelection):
(WebPaymentCoordinatorClient::completePaymentSession):

Source/WebKit2:

Send the new structs over the wire to the UI process and update the various proxy object to take them instead of
multiple parameters.

* Scripts/webkit/messages.py:
(headers_for_type):
* Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
(IPC::ArgumentCoder<WebCore::PaymentAuthorizationResult>::encode):
(IPC::ArgumentCoder<WebCore::PaymentAuthorizationResult>::decode):
(IPC::ArgumentCoder<WebCore::PaymentError>::encode):
(IPC::ArgumentCoder<WebCore::PaymentError>::decode):
(IPC::ArgumentCoder<WebCore::PaymentMethodUpdate>::encode):
(IPC::ArgumentCoder<WebCore::PaymentMethodUpdate>::decode):
(IPC::ArgumentCoder<WebCore::ShippingContactUpdate>::encode):
(IPC::ArgumentCoder<WebCore::ShippingContactUpdate>::decode):
(IPC::ArgumentCoder<WebCore::ShippingMethodUpdate>::encode):
(IPC::ArgumentCoder<WebCore::ShippingMethodUpdate>::decode):
* Shared/WebCoreArgumentCoders.h:
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
(WebKit::WebPaymentCoordinatorProxy::completeShippingMethodSelection):
(WebKit::WebPaymentCoordinatorProxy::completeShippingContactSelection):
(WebKit::WebPaymentCoordinatorProxy::completePaymentMethodSelection):
(WebKit::WebPaymentCoordinatorProxy::completePaymentSession):
(WebKit::isValidEnum): Deleted.
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in:
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentSession):
(WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection):
(WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection):
(WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection):
* WebProcess/ApplePay/WebPaymentCoordinator.cpp:
(WebKit::WebPaymentCoordinator::completeShippingMethodSelection):
(WebKit::WebPaymentCoordinator::completeShippingContactSelection):
(WebKit::WebPaymentCoordinator::completePaymentMethodSelection):
(WebKit::WebPaymentCoordinator::completePaymentSession):
* WebProcess/ApplePay/WebPaymentCoordinator.h:

Source/WTF:

* wtf/EnumTraits.h:
Fix a build warning.

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

2 years agoChange determineNonLayerDescendantsPaintedContent to max out based on renderers traversed
simon.fraser@apple.com [Wed, 8 Mar 2017 22:53:20 +0000 (22:53 +0000)]
Change determineNonLayerDescendantsPaintedContent to max out based on renderers traversed
https://bugs.webkit.org/show_bug.cgi?id=169384

Reviewed by Zalan Bujtas.

Source/WebCore:

determineNonLayerDescendantsPaintedContent() would bail after depth 3, sibling count 20. However,
empirical testing shows that it would run to completion more often if the limit was based on the
number of nodes traversed (in particular, it's common to see fairly deep subtrees with few siblings).
Running to completion has huge memory advantages, because we can then be sure to have checked all the
renderers for smoothed text, allowing us, on some pages, to avoid the extra memory cost of using
layers that support subpixel-antialiased text.

Performance measurement shows that mean runtime of this function goes up from 0.30us to 0.34us
with a 200 renderer limit, which seems worthwhile.

Test: compositing/contents-format/subpixel-antialiased-text-traversal.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects):

LayoutTests:

Rebaseline an existing test which changes behavior, and add a new test that generates divs
on both sides of the threshold, in depth and breadth.

* compositing/contents-format/subpixel-antialiased-text-traversal-expected.txt: Added.
* compositing/contents-format/subpixel-antialiased-text-traversal.html: Added.
* platform/mac/compositing/contents-format/subpixel-antialiased-text-configs-antialiasing-style-expected.txt:
* platform/mac/compositing/contents-format/subpixel-antialiased-text-traversal-expected.txt: Added.

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

2 years agoWebAssembly: Make OOB for fast memory do an extra safety check by ensuring the faulti...
keith_miller@apple.com [Wed, 8 Mar 2017 22:50:51 +0000 (22:50 +0000)]
WebAssembly: Make OOB for fast memory do an extra safety check by ensuring the faulting address is in the range we allocated for fast memory
https://bugs.webkit.org/show_bug.cgi?id=169290

Reviewed by Saam Barati.

This patch adds an extra sanity check by ensuring that the the memory address we faulting trying to load is in range
of some wasm fast memory.

* wasm/WasmFaultSignalHandler.cpp:
(JSC::Wasm::trapHandler):
(JSC::Wasm::enableFastMemory):
* wasm/WasmMemory.cpp:
(JSC::Wasm::activeFastMemories):
(JSC::Wasm::viewActiveFastMemories):
(JSC::Wasm::tryGetFastMemory):
(JSC::Wasm::releaseFastMemory):
* wasm/WasmMemory.h:

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

2 years agoSupport canvas captureStream
commit-queue@webkit.org [Wed, 8 Mar 2017 22:44:42 +0000 (22:44 +0000)]
Support canvas captureStream
https://bugs.webkit.org/show_bug.cgi?id=169192

Patch by Youenn Fablet <youenn@apple.com> on 2017-03-08
Reviewed by Dean Jackson.

Source/WebCore:

Tests: fast/mediacapturefromelement/CanvasCaptureMediaStream-2d-events.html
       fast/mediacapturefromelement/CanvasCaptureMediaStream-capture-out-of-DOM-element.html
       fast/mediacapturefromelement/CanvasCaptureMediaStream-clone-track.html
       fast/mediacapturefromelement/CanvasCaptureMediaStream-creation.html
       fast/mediacapturefromelement/CanvasCaptureMediaStream-exceptions.html
       fast/mediacapturefromelement/CanvasCaptureMediaStream-framerate-0.html
       fast/mediacapturefromelement/CanvasCaptureMediaStream-imagebitmaprenderingcontext.html
       fast/mediacapturefromelement/CanvasCaptureMediaStream-offscreencanvas.html
       fast/mediacapturefromelement/CanvasCaptureMediaStream-request-frame-events.html
       fast/mediacapturefromelement/CanvasCaptureMediaStream-webgl-events.html

Adding canvas captureStream as defined in https://w3c.github.io/mediacapture-fromelement/#html-canvas-element-media-capture-extensions
This allows creating a video MediaStreamTrack fed by canvas taken frames.
Frames are produced when canvas get changed.

Tests taken from Chromium.

* CMakeLists.txt:
* DerivedSources.make:
* Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp: Added.
(WebCore::CanvasCaptureMediaStreamTrack::create):
(WebCore::CanvasCaptureMediaStreamTrack::CanvasCaptureMediaStreamTrack):
(WebCore::CanvasCaptureMediaStreamTrack::Source::create):
(WebCore::CanvasCaptureMediaStreamTrack::Source::Source):
(WebCore::CanvasCaptureMediaStreamTrack::Source::startProducingData):
(WebCore::CanvasCaptureMediaStreamTrack::Source::stopProducingData):
(WebCore::CanvasCaptureMediaStreamTrack::Source::requestFrameTimerFired):
(WebCore::CanvasCaptureMediaStreamTrack::Source::canvasDestroyed):
(WebCore::CanvasCaptureMediaStreamTrack::Source::canvasResized):
(WebCore::CanvasCaptureMediaStreamTrack::Source::canvasChanged):
(WebCore::CanvasCaptureMediaStreamTrack::Source::captureCanvas):
(WebCore::CanvasCaptureMediaStreamTrack::Source::paintCurrentFrameInContext):
(WebCore::CanvasCaptureMediaStreamTrack::Source::currentFrameImage):
* Modules/mediastream/CanvasCaptureMediaStreamTrack.h: Added.
(isType):
* Modules/mediastream/CanvasCaptureMediaStreamTrack.idl: Added.
* Modules/mediastream/MediaStreamTrack.h:
(WebCore::MediaStreamTrack::isCanvas):
* Modules/mediastream/MediaStreamTrack.idl:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSMediaStreamTrackCustom.cpp:
(WebCore::toJSNewlyCreated):
(WebCore::toJS):
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::toMediaSample):
(WebCore::HTMLCanvasElement::captureStream):
* html/HTMLCanvasElement.h:
* html/HTMLCanvasElement.idl:
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::clear):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::markContextChangedAndNotifyCanvasObserver):
(WebCore::WebGLRenderingContextBase::drawArrays):
(WebCore::WebGLRenderingContextBase::drawElements):
(WebCore::WebGLRenderingContextBase::drawArraysInstanced):
(WebCore::WebGLRenderingContextBase::drawElementsInstanced):
* html/canvas/WebGLRenderingContextBase.h:
* platform/graphics/ImageBuffer.cpp:
(WebCore::ImageBuffer::toBGRAData):
* platform/graphics/ImageBuffer.h:
* platform/graphics/avfoundation/MediaSampleAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
(WebCore::releaseUint8Vector):
(WebCore::MediaSampleAVFObjC::createImageSample):
* platform/graphics/cg/ImageBufferCG.cpp:
* platform/graphics/cg/ImageBufferDataCG.cpp:
(WebCore::transferData):
(WebCore::ImageBufferData::toBGRAData):
* platform/graphics/cg/ImageBufferDataCG.h:

LayoutTests:

* fast/mediacapturefromelement/CanvasCaptureMediaStream-2d-events-expected.txt: Added.
* fast/mediacapturefromelement/CanvasCaptureMediaStream-2d-events.html: Added.
* fast/mediacapturefromelement/CanvasCaptureMediaStream-capture-out-of-DOM-element-expected.txt: Added.
* fast/mediacapturefromelement/CanvasCaptureMediaStream-capture-out-of-DOM-element.html: Added.
* fast/mediacapturefromelement/CanvasCaptureMediaStream-clone-track-expected.txt: Added.
* fast/mediacapturefromelement/CanvasCaptureMediaStream-clone-track.html: Added.
* fast/mediacapturefromelement/CanvasCaptureMediaStream-creation-expected.txt: Added.
* fast/mediacapturefromelement/CanvasCaptureMediaStream-creation.html: Added.
* fast/mediacapturefromelement/CanvasCaptureMediaStream-exceptions-expected.txt: Added.
* fast/mediacapturefromelement/CanvasCaptureMediaStream-exceptions.html: Added.
* fast/mediacapturefromelement/CanvasCaptureMediaStream-framerate-0-expected.txt: Added.
* fast/mediacapturefromelement/CanvasCaptureMediaStream-framerate-0.html: Added.
* fast/mediacapturefromelement/CanvasCaptureMediaStream-imagebitmaprenderingcontext-expected.txt: Added.
* fast/mediacapturefromelement/CanvasCaptureMediaStream-imagebitmaprenderingcontext.html: Added.
* fast/mediacapturefromelement/CanvasCaptureMediaStream-offscreencanvas-expected.txt: Added.
* fast/mediacapturefromelement/CanvasCaptureMediaStream-offscreencanvas.html: Added.
* fast/mediacapturefromelement/CanvasCaptureMediaStream-request-frame-events-expected.txt: Added.
* fast/mediacapturefromelement/CanvasCaptureMediaStream-request-frame-events.html: Added.
* fast/mediacapturefromelement/CanvasCaptureMediaStream-webgl-events-expected.txt: Added.
* fast/mediacapturefromelement/CanvasCaptureMediaStream-webgl-events.html: Added.
* fast/mediacapturefromelement/resources/svg-with-image-with-foreignobject.svg: Added.
* fast/mediacapturefromelement/resources/webgl-test.js: Added.

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

2 years agoUse the new code path when dragging web contents
andersca@apple.com [Wed, 8 Mar 2017 22:14:26 +0000 (22:14 +0000)]
Use the new code path when dragging web contents
https://bugs.webkit.org/show_bug.cgi?id=169298

Reviewed by Beth Dakin.

* editing/Editor.h:
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::writeSelection):
Add a new function that writes the selection to a writer object.

* page/DragController.cpp:
(WebCore::DragController::startDrag):
Use the new writeSelection if mustUseLegacyDragClient is false.

* platform/PasteboardWriterData.cpp:
(WebCore::PasteboardWriterData::WebContent::WebContent):
(WebCore::PasteboardWriterData::WebContent::~WebContent):
(WebCore::PasteboardWriterData::setWebContent):
* platform/PasteboardWriterData.h:
Add getters and setters.

* platform/mac/PasteboardWriter.mm:
(WebCore::toUTIUnlessAlreadyUTI):
Add a helper.

(WebCore::createPasteboardWriter):
Convert web content to pasteboard types.

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

2 years ago[mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html...
commit-queue@webkit.org [Wed, 8 Mar 2017 21:56:12 +0000 (21:56 +0000)]
[mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=168409

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

Adding more detailed assertions to try to understand where the timeouts might be coming from.

* media/modern-media-controls/airplay-button/airplay-button-expected.txt:
* media/modern-media-controls/airplay-button/airplay-button.html:

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

2 years agoFix for dependency fix
megan_gardner@apple.com [Wed, 8 Mar 2017 21:42:06 +0000 (21:42 +0000)]
Fix for dependency fix
https://bugs.webkit.org/show_bug.cgi?id=169369

Reviewed by Beth Dakin.

* WebView/WebViewPrivate.h:

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

2 years agoCSS Multicolumn should not clip columns horizontally
hyatt@apple.com [Wed, 8 Mar 2017 21:11:46 +0000 (21:11 +0000)]
CSS Multicolumn should not clip columns horizontally
https://bugs.webkit.org/show_bug.cgi?id=169363

Reviewed by Sam Weinig.

Source/WebCore:

Revised multiple tests in fast/multicol.

* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::flowThreadPortionOverflowRect):
Stop clipping horizontally. Section 8.1 of the spec changed from "clip" to "don't clip",
so we're changing to match the latest draft. Keep iBooks-based pagination clipping though.

LayoutTests:

* fast/multicol/newmulticol/adjacent-spanners-expected.html:
* fast/multicol/newmulticol/adjacent-spanners.html:
* fast/multicol/newmulticol/clipping-expected.html:
* fast/multicol/newmulticol/clipping.html:
* fast/multicol/newmulticol/spanner-inline-block-expected.html:
* fast/multicol/newmulticol/spanner-inline-block.html:

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

2 years agoRemove the trace command from the sandbox profile.
bfulgham@apple.com [Wed, 8 Mar 2017 20:39:33 +0000 (20:39 +0000)]
Remove the trace command from the sandbox profile.

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

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

2 years agoREGRESSION(r212904): [WK2][Mac] Revise sandbox to support AES3
bfulgham@apple.com [Wed, 8 Mar 2017 20:36:53 +0000 (20:36 +0000)]
REGRESSION(r212904): [WK2][Mac] Revise sandbox to support AES3
https://bugs.webkit.org/show_bug.cgi?id=169361
<rdar://problem/30927476>

Unreviewed sandbox revert. Avoid web compatibility issue by
restoring access to AES3 Plugin path.

Tests: Existing media tests, on older Mac hardware.

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

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

2 years agoAdd support for history.scrollRestoration
simon.fraser@apple.com [Wed, 8 Mar 2017 20:01:15 +0000 (20:01 +0000)]
Add support for history.scrollRestoration
https://bugs.webkit.org/show_bug.cgi?id=147782
rdar://problem/22614568

Reviewed by Sam Weinig.
LayoutTests/imported/w3c:

New passing baselines.

* web-platform-tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-basic-expected.txt:
* web-platform-tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-fragment-scrolling-cross-origin-expected.txt:
* web-platform-tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-navigation-cross-origin-expected.txt:
* web-platform-tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-navigation-samedoc-expected.txt:

Source/WebCore:

Add support for history.scrollRestoration, per spec:
<https://html.spec.whatwg.org/multipage/browsers.html#dom-history-scroll-restoration>

This is a new attribute on the History interface. On setting, sets the "shouldRestoreScrollPosition"
state on the current history item, and the getter returns that state. pushState() inherits the
state from the current item.

HistoryController::restoreScrollPositionAndViewState() consults this state, and if set to "manual"
("don't restore) it just uses the current scroll position (we need something to pass to
setPageScaleFactor() so can't just avoid the restoration).

FrameLoader::scrollToFragmentWithParentBoundary() also needs to consult the historyItem
to know if it's OK to scroll to a fragment, on back/forward same-document loads.

Tests: fast/history/history-scroll-restoration-attribute.html
       fast/history/history-scroll-restoration.html

* history/HistoryItem.cpp:
(WebCore::HistoryItem::HistoryItem):
(WebCore::HistoryItem::shouldRestoreScrollPosition):
(WebCore::HistoryItem::setShouldRestoreScrollPosition):
* history/HistoryItem.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadInSameDocument):
(WebCore::itemAllowsScrollRestoration):
(WebCore::isSameDocumentReload):
(WebCore::FrameLoader::scrollToFragmentWithParentBoundary):
(WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
* loader/FrameLoader.h:
* loader/HistoryController.cpp:
(WebCore::HistoryController::restoreScrollPositionAndViewState):
(WebCore::HistoryController::goToItem):
(WebCore::HistoryController::pushState):
(WebCore::HistoryController::replaceState):
* page/History.cpp:
(WebCore::History::scrollRestoration):
(WebCore::History::setScrollRestoration):
* page/History.h:
* page/History.idl:

Source/WebKit2:

Need to send shouldRestoreScrollPosition to the UI process in SessionState,
WKWebView now stores _unobscuredCenterToRestore and _scrollOffsetToRestore as
std::optionals, and they will be nullopt if scroll restoration should not happen.

ViewGestureControllerIOS also needs knowledge of whether scroll restoration will
happen, and compares UI-process scroll position vs. the position at snapshot time
to know if the snapshot should be shown (this prevents showing a misleading snapshot
when swiping back on a navigation where scroll restoration is disabled).

* Shared/SessionState.cpp:
(WebKit::FrameState::encode):
(WebKit::FrameState::decode):
* Shared/SessionState.h:
* Shared/WebBackForwardListItem.h:
(WebKit::WebBackForwardListItem::pageState):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _processDidExit]):
(-[WKWebView _didCommitLayerTree:]):
(-[WKWebView _restorePageScrollPosition:scrollOrigin:previousObscuredInset:scale:]):
(-[WKWebView _restorePageStateToUnobscuredCenter:scale:]):
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::viewScrollPosition):
* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::viewScrollPosition):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::viewScrollPosition):
(WebKit::PageClientImpl::restorePageState):
(WebKit::PageClientImpl::restorePageCenterAndScale):
* UIProcess/ios/ViewGestureControllerIOS.mm:
(WebKit::ViewGestureController::beginSwipeGesture):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::restorePageState):
(WebKit::WebPageProxy::restorePageCenterAndScale):
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::viewScrollPosition):
* UIProcess/mac/ViewSnapshotStore.h:
(WebKit::ViewSnapshot::setViewScrollPosition):
(WebKit::ViewSnapshot::viewScrollPosition):
* UIProcess/mac/ViewSnapshotStore.mm:
(WebKit::ViewSnapshotStore::recordSnapshot):
* WebProcess/WebCoreSupport/SessionStateConversion.cpp:
(WebKit::toFrameState):
(WebKit::applyFrameState):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::restoreViewState):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::restorePageState):

LayoutTests:

Sadly history-scroll-restoration.html needs to be cloned for iOS and to use uiController.doAfterPresentationUpdate()
there, since restoration involves a trip to the UI process, and this same test did not work for Mac WK1 (dispatch_async()
doesn't seem to give the right timing in DRT).

* TestExpectations:
* fast/dom/Window/window-appendages-cleared-expected.txt:
* fast/history/history-scroll-restoration-attribute-expected.txt: Added.
* fast/history/history-scroll-restoration-attribute.html: Added.
* fast/history/history-scroll-restoration-expected.txt: Added.
* fast/history/history-scroll-restoration.html: Added.
* platform/ios-simulator-wk2/TestExpectations:
* platform/ios-simulator/TestExpectations:

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

2 years ago[iOS] Throttle DOM timers to 30fps in low power mode
cdumez@apple.com [Wed, 8 Mar 2017 19:52:30 +0000 (19:52 +0000)]
[iOS] Throttle DOM timers to 30fps in low power mode
https://bugs.webkit.org/show_bug.cgi?id=169213
<rdar://problem/30876965>

Reviewed by Simon Fraser.

Source/WebCore:

Throttle and align DOM timers to ~30fps in low power mode on iOS
to save battery.

Test: fast/dom/timer-throttling-lowPowerMode.html

* page/DOMTimer.h:
* page/Page.cpp:
(WebCore::Page::handleLowModePowerChange):
(WebCore::Page::updateDOMTimerAlignmentInterval):

LayoutTests:

Add layout test coverage.

* fast/dom/timer-throttling-lowPowerMode-expected.txt: Added.
* fast/dom/timer-throttling-lowPowerMode.html: Added.

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

2 years agoUpdate outdated comment about HTMLElement.dropzone
cdumez@apple.com [Wed, 8 Mar 2017 19:03:07 +0000 (19:03 +0000)]
Update outdated comment about HTMLElement.dropzone
https://bugs.webkit.org/show_bug.cgi?id=169338

Reviewed by Sam Weinig.

Update outdated comment about HTMLElement.dropzone since it was dropped
from the HTML specification:
- https://github.com/whatwg/html/commit/3044a7e8517a4488cea811789d19974a8d5a56ae

Also add comment about HTMLElement.webkitdropzone since Blink dropped
it in:
- https://bugs.chromium.org/p/chromium/issues/detail?id=688943

* html/HTMLElement.idl:

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

2 years agoMark editing/selection/move-by-word-visually-multi-space.html as flaky on Sierra...
ryanhaddad@apple.com [Wed, 8 Mar 2017 18:55:05 +0000 (18:55 +0000)]
Mark editing/selection/move-by-word-visually-multi-space.html as flaky on Sierra Debug WK2.
https://bugs.webkit.org/show_bug.cgi?id=168346

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

2 years agoAdd support for updating autoplay policies after a page has been loaded.
mrajca@apple.com [Wed, 8 Mar 2017 18:48:32 +0000 (18:48 +0000)]
Add support for updating autoplay policies after a page has been loaded.
https://bugs.webkit.org/show_bug.cgi?id=169360

Reviewed by Alex Christensen.

Source/WebKit2:

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

Tools:

* TestWebKitAPI/Tests/WebKit2/autoplay-check.html:
* TestWebKitAPI/Tests/WebKit2Cocoa/WebsitePolicies.mm:
(TEST):

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

2 years agoAdd support for an autoplay play-pause events quirk.
mrajca@apple.com [Wed, 8 Mar 2017 18:48:29 +0000 (18:48 +0000)]
Add support for an autoplay play-pause events quirk.
https://bugs.webkit.org/show_bug.cgi?id=169235

Reviewed by Jer Noble.

For sites that assume media starts off playing, send a playing and pause event to trigger
custom media controls to update.

* html/HTMLMediaElement.cpp:
(WebCore::needsAutoplayPlayPauseEventsQuirk):
(WebCore::HTMLMediaElement::dispatchPlayPauseEventsIfNeedsQuirks):
(WebCore::HTMLMediaElement::setReadyState):
(WebCore::HTMLMediaElement::play):
* html/HTMLMediaElement.h:

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

2 years agoSwitching focus from a UITextField to an editable WKWebView causes the keyboard to...
timothy_horton@apple.com [Wed, 8 Mar 2017 18:33:15 +0000 (18:33 +0000)]
Switching focus from a UITextField to an editable WKWebView causes the keyboard to dance
https://bugs.webkit.org/show_bug.cgi?id=168932
<rdar://problem/30193996>

Reviewed by Beth Dakin.

When WKWebView first becomes first responder from a tap, we don't have
enough information to immediately respond accurately to various questions
from UIKit, because we haven't had time to ask the Web Content process
what is under the touch. Defer updating input views until we get a
response or lose first responder status, so that the keyboard doesn't
start transitioning to its new state until we know what that is.

There is currently no test because TestWebKitAPI has no UIApplication,
and thus cannot generate mock events.

* Platform/spi/ios/UIKitSPI.h:
* WebKit2.xcodeproj/project.pbxproj:
* UIProcess/ios/InputViewUpdateDeferrer.h: Added.
* UIProcess/ios/InputViewUpdateDeferrer.mm: Added.
Add an RAII object that defers input view updates while alive.

* UIProcess/ios/WKContentView.mm:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView cleanupInteraction]):
(-[WKContentView _commitPotentialTapFailed]):
(-[WKContentView _didNotHandleTapAsClick:]):
(-[WKContentView _didCompleteSyntheticClick]):
(-[WKContentView _singleTapCommited:]):
(-[WKContentView _attemptClickAtLocation:]):
(-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]):
Create a InputViewUpdateDeferrer just before we become first responder
from a tap, and destroy it when we get a response (of any kind) or lose
first-responder status (or interaction is torn down).

* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::didCompleteSyntheticClick):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::didCompleteSyntheticClick):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::completeSyntheticClick):
Plumb an indication that the synthetic click completed, regardless of
how it was handled.

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

2 years agoFix Project Dependency
megan_gardner@apple.com [Wed, 8 Mar 2017 18:19:24 +0000 (18:19 +0000)]
Fix Project Dependency
https://bugs.webkit.org/show_bug.cgi?id=169340

Unreviewed Dependency Fix.

* WebView/WebViewPrivate.h:

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

2 years agoMark http/tests/cache/disk-cache/disk-cache-remove-several-pending-writes.html as...
ryanhaddad@apple.com [Wed, 8 Mar 2017 18:15:15 +0000 (18:15 +0000)]
Mark http/tests/cache/disk-cache/disk-cache-remove-several-pending-writes.html as flaky on mac-wk2.
https://bugs.webkit.org/show_bug.cgi?id=169359

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

2 years agoMark media/track/media-element-enqueue-event-crash.html as flaky.
ryanhaddad@apple.com [Wed, 8 Mar 2017 18:09:34 +0000 (18:09 +0000)]
Mark media/track/media-element-enqueue-event-crash.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=169324

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

2 years agoMark media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen...
ryanhaddad@apple.com [Wed, 8 Mar 2017 18:09:31 +0000 (18:09 +0000)]
Mark media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-buttons-containers-styles.html as flaky on mac-wk1.
https://bugs.webkit.org/show_bug.cgi?id=167589

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

2 years agoMark media/modern-media-controls/play-pause-button/play-pause-button.html as flaky...
ryanhaddad@apple.com [Wed, 8 Mar 2017 18:09:28 +0000 (18:09 +0000)]
Mark media/modern-media-controls/play-pause-button/play-pause-button.html as flaky on mac-wk1.
https://bugs.webkit.org/show_bug.cgi?id=167447

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

2 years agoUnreviewed, rolling out r213545.
jbedard@apple.com [Wed, 8 Mar 2017 17:50:36 +0000 (17:50 +0000)]
Unreviewed, rolling out r213545.

iOS EWS broken by this change

Reverted changeset:

"Standardize device/simulator naming conventions"
https://bugs.webkit.org/show_bug.cgi?id=169083
http://trac.webkit.org/changeset/213545

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

2 years ago[WK2] Guard GLib-specific code in Module, Connection files with USE(GLIB)
zandobersek@gmail.com [Wed, 8 Mar 2017 17:44:23 +0000 (17:44 +0000)]
[WK2] Guard GLib-specific code in Module, Connection files with USE(GLIB)
https://bugs.webkit.org/show_bug.cgi?id=169349

Reviewed by Carlos Garcia Campos.

Use the USE(GLIB) build guards for GLib-specific code in Connection and
Module header files and the ConnectionUnix implementation file, instead
of the PLATFORM(GTK) guard.

* Platform/IPC/Connection.h:
* Platform/IPC/unix/ConnectionUnix.cpp:
(IPC::Connection::platformInitialize):
(IPC::Connection::platformInvalidate):
(IPC::Connection::open):
(IPC::Connection::sendOutputMessage):
* Platform/Module.h:

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

2 years agoMediaPlayerPrivateGStreamerBase::volume() should override the MediaPlayerPrivate...
zandobersek@gmail.com [Wed, 8 Mar 2017 17:43:30 +0000 (17:43 +0000)]
MediaPlayerPrivateGStreamerBase::volume() should override the MediaPlayerPrivate method
https://bugs.webkit.org/show_bug.cgi?id=169347

Reviewed by Carlos Garcia Campos.

Enable the MediaPlayerPrivate::volume() method for the USE(GSTREAMER) configuration
and override it in the MediaPlayerPrivateGStreamerBase class.

* platform/graphics/MediaPlayerPrivate.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:

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

2 years ago[mac-wk2 Debug] LayoutTest webrtc/libwebrtc/descriptionGetters.html is failing
commit-queue@webkit.org [Wed, 8 Mar 2017 17:10:12 +0000 (17:10 +0000)]
[mac-wk2 Debug] LayoutTest webrtc/libwebrtc/descriptionGetters.html is failing
https://bugs.webkit.org/show_bug.cgi?id=169317

Unreviewed.

Patch by Youenn Fablet <youenn@apple.com> on 2017-03-08

* platform/mac-wk2/TestExpectations: Removing failure expectation.
* webrtc/libwebrtc/descriptionGetters.html: Fixing paths.

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

2 years agoFixed ARES-6 animations for other browsers
jond@apple.com [Wed, 8 Mar 2017 16:37:32 +0000 (16:37 +0000)]
Fixed ARES-6 animations for other browsers

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

2 years ago[GStreamer][MSE] Actually implement flush() on playback pipeline
eocanha@igalia.com [Wed, 8 Mar 2017 12:49:27 +0000 (12:49 +0000)]
[GStreamer][MSE] Actually implement flush() on playback pipeline
https://bugs.webkit.org/show_bug.cgi?id=169202

Reviewed by Žan Doberšek.

* platform/graphics/gstreamer/GRefPtrGStreamer.cpp: Added GRefPtr support for GstQuery.
(WTF::adoptGRef):
(WTF::refGPtr<GstQuery>):
(WTF::derefGPtr<GstQuery>):
* platform/graphics/gstreamer/GRefPtrGStreamer.h: Ditto.
* platform/graphics/gstreamer/GUniquePtrGStreamer.h: Added GUniquePtr support for GstSegment.
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
(WebCore::MediaSourceClientGStreamerMSE::flush): Only actually flush in the non-seek case. For the seek case,
GStreamer seek will already do the flush.
* platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
(WebCore::PlaybackPipeline::addSourceBuffer): Configure appsrc to be time-based instead of bytes-based to ensure
that the segments it produces are time-based.
(WebCore::segmentFixerProbe): This captures the next segment in the stream and "fixes" its base time by setting
it to the start time. This prevent audio/video desynchronizations.
(WebCore::PlaybackPipeline::flush): Really implement flushing by sending flush start/stop events, reconfiguring
appsrc with a new (seamless) segment (so it reconfigures the rest of the elements in that stream), and attached
a segmentFixerProbe to fix the segment emitted by basesrc (appsrc). The current pipeline position is used as
start time used for the new segment. This prevents displaying samples already displayed before flushing, while
allowing the decoder to decode them as a base for future (dependent) p-frame and b-frame samples.

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

2 years agoRemove unused WebPageIOS::zoomToRect and plumbing
timothy_horton@apple.com [Wed, 8 Mar 2017 09:35:40 +0000 (09:35 +0000)]
Remove unused WebPageIOS::zoomToRect and plumbing
https://bugs.webkit.org/show_bug.cgi?id=169344

Reviewed by Alex Christensen.

* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::zoomToRect): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::zoomToRect): Deleted.

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

2 years agoUIViewController with WKWebView presented modally causes the presented UIViewControll...
commit-queue@webkit.org [Wed, 8 Mar 2017 09:15:10 +0000 (09:15 +0000)]
UIViewController with WKWebView presented modally causes the presented UIViewController to be dismissed.
https://bugs.webkit.org/show_bug.cgi?id=165225

Patch by Brad Wright <bwright2@apple.com> on 2017-03-08
Reviewed by Wenson Hsieh.

The problem happens on an iPhone with a WKWebView inside a view controller presented modally. If the user selects an HTML file input
tag button, a UIDocumentMenuViewController will appear. Anything the user does next causes the entire modal view controller to get dismissed.

To fix this problem, I prevent the UIDocumentMenuViewController from being dismissed by not saving a pointer to it. The UIDocumentMenuViewController
always goes away by itself on any user interaction. Trying to dismiss the UIDocumentMenuViewController when it is already dismissed causes the modal view controller
to be dismissed.

* UIProcess/ios/forms/WKFileUploadPanel.mm:
(-[WKFileUploadPanel _cancel]):
(-[WKFileUploadPanel dismiss]):
(-[WKFileUploadPanel _showDocumentPickerMenu]):
(-[WKFileUploadPanel _presentMenuOptionForCurrentInterfaceIdiom:]):
(-[WKFileUploadPanel _presentForCurrentInterfaceIdiom:]): Deleted.

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

2 years agoWebKit should not export dyld install name hints on watchOS and tvOS
ap@apple.com [Wed, 8 Mar 2017 07:52:12 +0000 (07:52 +0000)]
WebKit should not export dyld install name hints on watchOS and tvOS
https://bugs.webkit.org/show_bug.cgi?id=169342

Reviewed by Dan Bernstein.

* Shared/API/Cocoa/WebKit.m:

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

2 years agoWebKitLegacy should re-export symbols from WebCore on watchos and tvos
ap@apple.com [Wed, 8 Mar 2017 07:32:49 +0000 (07:32 +0000)]
WebKitLegacy should re-export symbols from WebCore on watchos and tvos
https://bugs.webkit.org/show_bug.cgi?id=169341
<rdar://problem/30913788>

Reviewed by Dan Bernstein.

* MigrateHeaders.make:

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

2 years agoRemove never-implemented CSS3 text decoration-related properties
simon.fraser@apple.com [Wed, 8 Mar 2017 06:06:41 +0000 (06:06 +0000)]
Remove never-implemented CSS3 text decoration-related properties
https://bugs.webkit.org/show_bug.cgi?id=169009

Reviewed by Zalan Bujtas.

The following CSS properties were added many years ago based on an old CSS3 Text
draft (https://www.w3.org/TR/2003/CR-css3-text-20030514/), but never had any implementations.
Remove them.

    text-line-through
    text-line-through-color
    text-line-through-mode
    text-line-through-style
    text-line-through-width
    text-overline
    text-overline-color
    text-overline-mode
    text-overline-style
    text-overline-width
    text-underline
    text-underline-color
    text-underline-mode
    text-underline-style
    text-underline-width

* WebCore.xcodeproj/project.pbxproj:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSProperties.json:
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isKeywordPropertyID):

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

2 years agoHave fixedPositionCreatesStackingContext be on by default everywhere
simon.fraser@apple.com [Wed, 8 Mar 2017 05:46:52 +0000 (05:46 +0000)]
Have fixedPositionCreatesStackingContext be on by default everywhere
https://bugs.webkit.org/show_bug.cgi?id=169334

Reviewed by Zalan Bujtas.

It makes no sense to have web-exposed CSS functionality be different based on setting,
and other browser are now aligned with having position:fixed create stacking context.

So remove the fixedPositionCreatesStackingContext setting and have StyleResolver::adjustRenderStyle()
always force stacking context for position:fixed.

Source/WebCore:

* css/StyleResolver.cpp:
(WebCore::StyleResolver::adjustRenderStyle):
* page/Settings.cpp:
* page/Settings.in:

Source/WebKit/mac:

* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKit2:

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setUseFixedLayout):
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::updatePreferences):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::updatePreferences):

LayoutTests:

* compositing/absolute-inside-out-of-view-fixed.html:
* compositing/geometry/fixed-position-composited-page-scale-smaller-than-viewport.html:
* compositing/layer-creation/fixed-overlap-extent-rtl.html:
* compositing/layer-creation/fixed-overlap-extent.html:
* compositing/layer-creation/fixed-position-change-out-of-view-in-view.html:
* compositing/layer-creation/fixed-position-in-view-dynamic.html:
* compositing/layer-creation/fixed-position-out-of-view-dynamic.html:
* compositing/layer-creation/fixed-position-out-of-view-scaled-iframe-scroll.html:
* compositing/layer-creation/fixed-position-out-of-view-scaled-iframe.html:
* compositing/layer-creation/fixed-position-out-of-view-scaled-scroll.html:
* compositing/layer-creation/fixed-position-out-of-view-scaled.html:
* compositing/layer-creation/fixed-position-transformed-into-view.html:
* compositing/layer-creation/fixed-position-transformed-outside-view.html:
* compositing/layer-creation/no-compositing-for-fixed-position-under-transform.html:
* compositing/repaint/scroll-fixed-layer-no-content.html:
* compositing/repaint/scroll-fixed-layer-out-of-view.html:
* fast/block/positioning/fixed-position-stacking-context2.html:
* fullscreen/full-screen-fixed-pos-parent.html:

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

2 years agoWeb Inspector: DOM Tree broken if an element has a "debounce" attribute
commit-queue@webkit.org [Wed, 8 Mar 2017 05:18:35 +0000 (05:18 +0000)]
Web Inspector: DOM Tree broken if an element has a "debounce" attribute
https://bugs.webkit.org/show_bug.cgi?id=169336
<rdar://problem/30899430>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-03-07
Reviewed by Brian Burg.

* UserInterface/Models/DOMNode.js:
(WebInspector.DOMNode):
(WebInspector.DOMNode.prototype.getAttribute):
(WebInspector.DOMNode.prototype.removeAttribute.mycallback):
(WebInspector.DOMNode.prototype.removeAttribute):
Convert the attributes map to an actual Map to avoid name collisions
with Object.prototype properties.

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

2 years ago[Mac][WK2] Whitelist iokit-get-properties
bfulgham@apple.com [Wed, 8 Mar 2017 04:49:26 +0000 (04:49 +0000)]
[Mac][WK2] Whitelist iokit-get-properties
https://bugs.webkit.org/show_bug.cgi?id=169331
<rdar://problem/16363632>

Reviewed by Alex Christensen.

Block access to all IOKit properties by default. Turn on only those properties
that are actually needed by our engine.

* DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
* PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
* WebProcess/com.apple.WebProcess.sb.in:

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

2 years agoAsynchronous image decoding should consider the drawing size if it is smaller than...
commit-queue@webkit.org [Wed, 8 Mar 2017 03:54:28 +0000 (03:54 +0000)]
Asynchronous image decoding should consider the drawing size if it is smaller than the size of the image
https://bugs.webkit.org/show_bug.cgi?id=168814

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2017-03-07
Reviewed by Simon Fraser.

If the image destinationRect.size() is smaller than the imageSourceSize
(e.g. 3000x3000 pixels), CGImageSourceCreateThumbnailAtIndex() is slower
than CGImageSourceCreateImageAtIndex() in decoding this image. To overcome
this problem, the entry (kCGImageSourceThumbnailMaxPixelSize,
max(destinationRect.width, destinationRect.height)) is added to the options
dictionary when calling CGImageSourceCreateThumbnailAtIndex(). This will
avoid copying a large block of memory for the unscaled bitmap image.

An argument named 'sizeForDrawing' of type std::optional<IntSize> will be passed
all the way from BitmapImage to ImageDecoder. If bool(sizeForDrawing) equals
true that means we want async image decoding. Otherwise the image will be decoded
synchronously.

The subsamplingLevel argument will be passed as std::optional<SubsamplingLevel>.
to ImageFrame query functions. When combined with sizeForDrawing, the meaning of
these two arguments will be the following:
-- !bool(subsamplingLevel): No caching is required. return what is stored in ImageFrameCache.
-- bool(subsamplingLevel) && !bool(sizeForDrawing): Match subsamplingLevel only. Recache if it's different.
-- bool(subsamplingLevel) && bool(sizeForDrawing): Match both both. . Recache if one of them is different.

We are going to allow decoding the same ImageFrame for different sizeForDrawings.
The rule is a new decoding is allowed only if the maxPixelSize(sizeForDrawing) of
the last requested image decoding is less than the new request sizeForDrawing.

* loader/cache/CachedImage.h: Add a helper function which returns the URL of a CachedImage.

* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::frameImageAtIndex): Add a new argument for sizeForDrawing.
(WebCore::BitmapImage::nativeImage): Pass an empty sizeForDrawing to frameImageAtIndex(). We an image with the native size.
(WebCore::BitmapImage::nativeImageForCurrentFrame): Ditto.
(WebCore::BitmapImage::nativeImageOfSize): Ditto.
(WebCore::BitmapImage::draw): Pass the destRect.size() to internalStartAnimation().
(WebCore::BitmapImage::isAsyncDecodingRequired): A helper function to answer the question
whether the async image decoding is required. It takes into account the animated images, the
large image, and the image size.
(WebCore::BitmapImage::internalStartAnimation):  If async image decoding is requested for this frame m_sizeForDraw
will be set. If internalStartAnimation() is called from startAnimation(), sizeForDraw will be empty. In this
case no async image decoding will be requested. This happens only when startAnimation() is called from outside
BitmapImage::draw().
(WebCore::BitmapImage::advanceAnimation): Change the log message.
(WebCore::BitmapImage::newFrameNativeImageAvailableAtIndex): Ditto.
* platform/graphics/BitmapImage.h:

* platform/graphics/ImageFrame.cpp:
(WebCore::ImageFrame::operator=):  Include m_sizeForDraw in the properties of ImageFrame.
(WebCore::maxPixelSize): Returns the maximum of the width() and the height of an IntSize.
(WebCore::ImageFrame::isBeingDecoded): Returns true if the ImageFrame is currently being decoded for a specific sizeForDrawing.
(WebCore::ImageFrame::hasValidNativeImage): Ditto.
* platform/graphics/ImageFrame.h:
(WebCore::ImageFrame::enqueueSizeForDecoding): Adds a new sizeForDrawing; this sets the ImageFrame is being decoded for this sizeForDrawing.
(WebCore::ImageFrame::dequeueSizeForDecoding): Removes the first sizeForDrawing was enqueued; this marks this ImageFrame has finished decoding for this sizeForDrawing.
(WebCore::ImageFrame::clearSizeForDecoding): Clears the sizeForDecoding queue. Marks the ImageFrame for not being decoded.
(WebCore::ImageFrame::isEmpty): Replace Decoding::Empty by Decoding::None.
(WebCore::ImageFrame::sizeForDrawing): Returns the ImageFrame sizeForDraw.
(WebCore::ImageFrame::hasDecodedNativeImage): Returns true if the ImageFrame doesn't need decoding before drawing.
(WebCore::ImageFrame::hasValidNativeImage): Deleted. Moved to the source file.

* platform/graphics/ImageFrameCache.cpp:
(WebCore::ImageFrameCache::setFrameNativeImageAtIndex): Take a new argument for sizeForDraw.
(WebCore::ImageFrameCache::setFrameMetadataAtIndex):  When sizeForDraw is set, use the decoder to get the image
frame size. Otherwise, get the size of the nativeImage.
(WebCore::ImageFrameCache::replaceFrameNativeImageAtIndex): Take a new argument for sizeForDraw.
(WebCore::ImageFrameCache::cacheFrameNativeImageAtIndex): Ditto.
(WebCore::ImageFrameCache::startAsyncDecodingQueue): Pass the sizeForDraw as a new property of the ImageFrame.
(WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex): Store sizeForDraw in ImageFrameRequest. Delete unneeded check.
This function always receives a valid subsamplingLevel.
(WebCore::ImageFrameCache::stopAsyncDecodingQueue): Marks all the queued ImageFrames for not being decoded.
(WebCore::ImageFrameCache::frameAtIndexCacheIfNeeded): Take a new argument for sizeForDraw. If this function fixes the
properties of ImageFrame properties, keep the old sizeForDraw and/or subsamplingLevel. If a new frame is
decoded, no async image decoding will be done in this code path. So pass an empty std::optional<IntSize> to
ImageDecoder::createFrameImageAtIndex() and store std::optional<IntSize> in ImageFrame.
(WebCore::ImageFrameCache::frameMetadataAtIndex): A new helper function which takes a variable number of arguments which
will be passed to the (ImageFrame::*functor).
(WebCore::ImageFrameCache::frameMetadataAtIndexCacheIfNeeded): Make this function takes a variable number of arguments which
will be passed to the frameAtIndexCacheIfNeeded().
(WebCore::ImageFrameCache::size): Pass an Metadata, valid SubsamplingLevel and empty sizeForDraw to frameMetadataAtIndexCacheIfNeeded().
(WebCore::ImageFrameCache::sizeRespectingOrientation): Ditto.
(WebCore::ImageFrameCache::singlePixelSolidColor): Pass MetadataAndImage, empty SubsamplingLevel and empty sizeForDraw to
frameMetadataAtIndexCacheIfNeeded(); we can use the current frame image regardless of its size.
(WebCore::ImageFrameCache::frameIsBeingDecodedAtIndex): Pass the ImageFrame method as a function argument instead of
passing it as a template argument.
(WebCore::ImageFrameCache::frameIsCompleteAtIndex): Ditto.
(WebCore::ImageFrameCache::frameHasAlphaAtIndex): Ditto.
(WebCore::ImageFrameCache::frameHasImageAtIndex): Ditto.
(WebCore::ImageFrameCache::frameHasValidNativeImageAtIndex): Pass subsamplingLevel and sizeForDrawing to frameMetadataAtIndex().
(WebCore::ImageFrameCache::frameHasDecodedNativeImage): New helper function to answer the question whether an ImageFrame will need
decoding when drawing or not.
(WebCore::ImageFrameCache::frameSubsamplingLevelAtIndex):  Pass the ImageFrame method as a function argument instead of
passing it as a template argument.
(WebCore::ImageFrameCache::frameSizeAtIndex): Ditto.
(WebCore::ImageFrameCache::frameBytesAtIndex): Ditto.
(WebCore::ImageFrameCache::frameDurationAtIndex): Ditto.
(WebCore::ImageFrameCache::frameOrientationAtIndex):
(WebCore::ImageFrameCache::frameImageAtIndex): Ditto.
(WebCore::ImageFrameCache::frameAtIndex): Deleted. Renamed to frameAtIndexCacheIfNeeded().
* platform/graphics/ImageFrameCache.h:
(WebCore::ImageFrameCache::frameAtIndexCacheIfNeeded):

* platform/graphics/ImageObserver.h: Define a virtual function for image sourceUrl().

* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::frameImageAtIndex): Take a new argument for sizeForDrawing.
* platform/graphics/ImageSource.h:
(WebCore::ImageSource::requestFrameAsyncDecodingAtIndex): Take a new argument for sizeForDrawing.
(WebCore::ImageSource::frameHasValidNativeImageAtIndex): Ditto.
(WebCore::ImageSource::frameHasDecodedNativeImage): New helper function.
(WebCore::ImageSource::frameImageAtIndex): Ditto.

* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::createImageSourceOptions): Create a dictionary with the basic image decoding options.
(WebCore::createImageSourceAsyncOptions): Create a dictionary with the basic asynchronous image decoding options.
(WebCore::appendImageSourceOption): Append the SubsamplingLevel or the MaxPixelSize option to an CGImageSource options dictionary.
(WebCore::appendImageSourceOptions): Append the SubsamplingLevel and the MaxPixelSize option to an CGImageSource options dictionary.
(WebCore::imageSourceOptions): Creates a dictionary for the synchronous image decoding options.
(WebCore::imageSourceAsyncOptions): Creates a dictionary for the asynchronous image decoding options.
(WebCore::ImageDecoder::createFrameImageAtIndex): Replace the DecodingMode argument by an std::optional<IntSize>.
* platform/graphics/cg/ImageDecoderCG.h: Change a prototype.

* platform/graphics/win/ImageDecoderDirect2D.cpp:
(WebCore::ImageDecoder::createFrameImageAtIndex): Replace the DecodingMode argument by an std::optional<IntSize>.
* platform/graphics/win/ImageDecoderDirect2D.h: Change a prototype.

* platform/image-decoders/ImageDecoder.cpp:
(WebCore::ImageDecoder::createFrameImageAtIndex): Replace the DecodingMode argument by an std::optional<IntSize>.
* platform/image-decoders/ImageDecoder.h: Change a prototype.

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

2 years agoPerf and layout test results should report using correct scm revision.
commit-queue@webkit.org [Wed, 8 Mar 2017 03:46:19 +0000 (03:46 +0000)]
Perf and layout test results should report using correct scm revision.
https://bugs.webkit.org/show_bug.cgi?id=169171

Patch by Kocsen Chung <kocsen_chung@apple.com> on 2017-03-07
Reviewed by Ryosuke Niwa.

For accurate record keeping, perf test and layout test results should
report using the native scm revision as an identifier.
To do so we introduce a new scm functions:
    `native_revision()` and `timestamp_of_native_revision()`.
The former is responsible for returning a git hash if scm.git or an
svn revision if scm.svn. The latter is responsible for retrieving the correct timestamp.
We also add the corresponding tests and a helper function `_most_recent_log_for_revision`.

* Scripts/webkitpy/common/checkout/scm/scm.py:
(SCM.run):
Drive-by indentation fix to adhere to WebKit style conventions.
(SCM.svn_revision):
Remove superfluous comment.
(SCM.native_revision):
Add new abstract function `native_revision` and make it a `_subclass_must_implement()`
as we want to closely mimic `svn_revision()` function due to their similar behavior.
(SCM.timestamp_of_native_revision):
Add new abstract function `timestamp_of_native_revision` to closely mimic `timestamp_of_revision`.

* Scripts/webkitpy/common/checkout/scm/git.py:
(Git._most_recent_log_for_revision):
New helper function similar to `_most_recent_log_matching` that is git hash friendly.
(Git.native_revision):
Implement new function `native_revision()`. Get the native_revision by running:

    `git log -1 --pretty=format:%H`

and thus returning the latest git hash (in long format).
(Git.timestamp_of_native_revision):
Since perftestrunner and layout_test.controllers.manager use the new native_revision
function, we create a new native_revision timestamp retriever.
You will notice this uses a far more simplified way to retrieve UTC strict-ISO timestamp
than its non-native counterpart: `timestamp_of_revision()`.
* Scripts/webkitpy/common/checkout/scm/svn.py:
(SVN.native_revision):
Implement native_revision for SVN: simply return self.svn_revision()
(SVN.timestamp_of_native_revision):
Implement timestamp_of_native_revision for SVN: simply return self.timestamp_of_revision()

* Scripts/webkitpy/common/checkout/scm/scm_unittest.py:
(test_native_revision):
[SVN] Confirm that svn_revision == native_revision. And that native_revision returns 5.
Use '.' as the path parameter instead of svn_checkout_path to avoid violating pylint/E1101
and since we are guaranteed by test setUp to be in the correct SVN dir.
(GitTest.test_native_revision):
[Git] Confirm that `git rev-parse HEAD` is equal to newly implemented native_revision().
(GitSVNTest.test_native_revision):
[Git] Confirm that `git rev-parse HEAD` is equal to newly implemented native_revision().
(test_timestamp_of_native_revision):
Test new function `timestamp_of_native_revision`. Very similar fashion to
`test_timestamp_of_revision`.

* Scripts/webkitpy/common/checkout/scm/scm_mock.py:
(MockSCM.native_revision):
Add MockSCM.native_revision to behave like svn.py (default).
(MockSCM.test_native_revision):
Add MockSCM.test_native_revision to behave like its non-native counterpart.

* Scripts/webkitpy/layout_tests/controllers/manager.py:
(Manager.upload_results):
When iterating through a list of projects, make sure we use the project's new native revision.
* Scripts/webkitpy/performance_tests/perftestsrunner.py:
(_generate_results_dict):
As per the FIXME in manager.py, we have duplicate code in perftestsrunner.py.
So make the same exact change here.

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

2 years agoParsing -webkit-hyphenate-character uses confusingly named consumeLocale()
simon.fraser@apple.com [Wed, 8 Mar 2017 03:15:02 +0000 (03:15 +0000)]
Parsing -webkit-hyphenate-character uses confusingly named consumeLocale()
https://bugs.webkit.org/show_bug.cgi?id=168638

Reviewed by Zalan Bujtas.

Parsing CSSPropertyWebkitHyphenateCharacter very confusingly called consumeLocale(),
which is really just "consume the 'auto' ident or a string", so rename that function.

* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeAutoOrString):
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::consumeLocale): Deleted.

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

2 years ago[WebCrypto] Implement ECDH ImportKey/ExportKey operations
jiewen_tan@apple.com [Wed, 8 Mar 2017 02:09:38 +0000 (02:09 +0000)]
[WebCrypto] Implement ECDH ImportKey/ExportKey operations
https://bugs.webkit.org/show_bug.cgi?id=169257
<rdar://problem/23789585>

Reviewed by Brent Fulgham.

LayoutTests/imported/w3c:

* web-platform-tests/WebCryptoAPI/import_export/ec_importKey.worker-expected.txt:
* web-platform-tests/WebCryptoAPI/import_export/test_ec_importKey-expected.txt:

Source/WebCore:

This patch implements ECDH ImportKey/ExportKey operations according to:
https://www.w3.org/TR/WebCryptoAPI/#ecdh-operations. Sad that we can't
support SPKI/PKCS8 formats at this moment due to lack of necessary
support in the underlying crypto library. Bug 169318 is tracking the
issue. Also, this patch fixes minor bugs while importing JWK keys for
HMAC/RSA.

Tests: crypto/subtle/ec-export-key-malformed-parameters.html
       crypto/subtle/ec-import-jwk-key-export-jwk-key-private.html
       crypto/subtle/ec-import-jwk-key-export-jwk-key-public.html
       crypto/subtle/ec-import-jwk-key-export-raw-key.html
       crypto/subtle/ec-import-key-malformed-parameters.html
       crypto/subtle/ec-import-raw-key-export-jwk-key.html
       crypto/subtle/ec-import-raw-key-export-raw-key.html
       crypto/subtle/ecdh-generate-export-jwk-key-p256.html
       crypto/subtle/ecdh-generate-export-jwk-key-p384.html
       crypto/subtle/ecdh-generate-export-key-raw-p256.html
       crypto/subtle/ecdh-generate-export-key-raw-p384.html
       crypto/subtle/ecdh-import-jwk-key-minimum.html
       crypto/subtle/ecdh-import-jwk-private-key-p256.html
       crypto/subtle/ecdh-import-jwk-private-key-p384.html
       crypto/subtle/ecdh-import-jwk-public-key-p256.html
       crypto/subtle/ecdh-import-jwk-public-key-p384.html
       crypto/subtle/ecdh-import-raw-key-p256.html
       crypto/subtle/ecdh-import-raw-key-p384.html
       crypto/workers/subtle/ec-generate-export-jwk-key.html
       crypto/workers/subtle/ec-generate-export-raw-key.html
       crypto/workers/subtle/ec-import-jwk-key-private.html
       crypto/workers/subtle/ec-import-jwk-key-public.html
       crypto/workers/subtle/ec-import-raw-key.html

* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::normalizeCryptoAlgorithmParameters):
(WebCore::supportExportKeyThrow):
Added EC family support.
* crypto/CommonCryptoUtilities.h:
Added needed CommonCrypto SPIs.
* crypto/CryptoAlgorithm.h:
* crypto/algorithms/CryptoAlgorithmECDH.cpp:
(WebCore::CryptoAlgorithmECDH::importKey):
(WebCore::CryptoAlgorithmECDH::exportKey):
* crypto/algorithms/CryptoAlgorithmECDH.h:
* crypto/gnutls/CryptoKeyECGnuTLS.cpp:
(WebCore::CryptoKeyEC::keySizeInBits):
(WebCore::CryptoKeyEC::exportRaw):
(WebCore::CryptoKeyEC::platformImportRaw):
(WebCore::CryptoKeyEC::platformImportJWKPublic):
(WebCore::CryptoKeyEC::platformImportJWKPrivate):
(WebCore::CryptoKeyEC::platformAddFieldElements):
Faked implementations for GTK+.
* crypto/keys/CryptoKeyEC.cpp:
(WebCore::toNamedCurve):
(WebCore::CryptoKeyEC::generatePair):
(WebCore::CryptoKeyEC::importRaw):
(WebCore::CryptoKeyEC::importJwk):
(WebCore::CryptoKeyEC::exportJwk):
* crypto/keys/CryptoKeyEC.h:
* crypto/keys/CryptoKeyHMAC.cpp:
(WebCore::CryptoKeyHMAC::importJwk):
Fixed a bug.
* crypto/keys/CryptoKeyRSA.cpp:
(WebCore::CryptoKeyRSA::importJwk):
Fixed a bug.
* crypto/mac/CryptoKeyECMac.cpp:
(WebCore::doesUncompressedPointMatchNamedCurve):
(WebCore::doesFieldElementMatchNamedCurve):
(WebCore::getKeySizeFromNamedCurve):
(WebCore::CryptoKeyEC::~CryptoKeyEC):
(WebCore::CryptoKeyEC::keySizeInBits):
(WebCore::CryptoKeyEC::exportRaw):
(WebCore::CryptoKeyEC::platformGeneratePair):
(WebCore::CryptoKeyEC::platformImportRaw):
(WebCore::CryptoKeyEC::platformImportJWKPublic):
(WebCore::CryptoKeyEC::platformImportJWKPrivate):
(WebCore::CryptoKeyEC::platformAddFieldElements):

LayoutTests:

* crypto/subtle/ec-export-key-malformed-parameters-expected.txt: Added.
* crypto/subtle/ec-export-key-malformed-parameters.html: Added.
* crypto/subtle/ec-import-jwk-key-export-jwk-key-private-expected.txt: Added.
* crypto/subtle/ec-import-jwk-key-export-jwk-key-private.html: Added.
* crypto/subtle/ec-import-jwk-key-export-jwk-key-public-expected.txt: Added.
* crypto/subtle/ec-import-jwk-key-export-jwk-key-public.html: Added.
* crypto/subtle/ec-import-jwk-key-export-raw-key-expected.txt: Added.
* crypto/subtle/ec-import-jwk-key-export-raw-key.html: Added.
* crypto/subtle/ec-import-key-malformed-parameters-expected.txt: Added.
* crypto/subtle/ec-import-key-malformed-parameters.html: Added.
* crypto/subtle/ec-import-raw-key-export-jwk-key-expected.txt: Added.
* crypto/subtle/ec-import-raw-key-export-jwk-key.html: Added.
* crypto/subtle/ec-import-raw-key-export-raw-key-expected.txt: Added.
* crypto/subtle/ec-import-raw-key-export-raw-key.html: Added.
* crypto/subtle/ecdh-generate-export-jwk-key-p256-expected.txt: Added.
* crypto/subtle/ecdh-generate-export-jwk-key-p256.html: Added.
* crypto/subtle/ecdh-generate-export-jwk-key-p384-expected.txt: Added.
* crypto/subtle/ecdh-generate-export-jwk-key-p384.html: Added.
* crypto/subtle/ecdh-generate-export-key-raw-p256-expected.txt: Added.
* crypto/subtle/ecdh-generate-export-key-raw-p256.html: Added.
* crypto/subtle/ecdh-generate-export-key-raw-p384-expected.txt: Added.
* crypto/subtle/ecdh-generate-export-key-raw-p384.html: Added.
* crypto/subtle/ecdh-import-jwk-key-minimum-expected.txt: Added.
* crypto/subtle/ecdh-import-jwk-key-minimum.html: Added.
* crypto/subtle/ecdh-import-jwk-private-key-p256-expected.txt: Added.
* crypto/subtle/ecdh-import-jwk-private-key-p256.html: Added.
* crypto/subtle/ecdh-import-jwk-private-key-p384-expected.txt: Added.
* crypto/subtle/ecdh-import-jwk-private-key-p384.html: Added.
* crypto/subtle/ecdh-import-jwk-public-key-p256-expected.txt: Added.
* crypto/subtle/ecdh-import-jwk-public-key-p256.html: Added.
* crypto/subtle/ecdh-import-jwk-public-key-p384-expected.txt: Added.
* crypto/subtle/ecdh-import-jwk-public-key-p384.html: Added.
* crypto/subtle/ecdh-import-raw-key-p256-expected.txt: Added.
* crypto/subtle/ecdh-import-raw-key-p256.html: Added.
* crypto/subtle/ecdh-import-raw-key-p384-expected.txt: Added.
* crypto/subtle/ecdh-import-raw-key-p384.html: Added.
* crypto/subtle/hmac-import-key-malformed-parameters-expected.txt:
* crypto/subtle/hmac-import-key-malformed-parameters.html:
* crypto/subtle/rsa-import-key-malformed-parameters-expected.txt:
* crypto/subtle/rsa-import-key-malformed-parameters.html:
Fixed some minor bugs.
* crypto/workers/subtle/ec-generate-export-jwk-key-expected.txt: Added.
* crypto/workers/subtle/ec-generate-export-jwk-key.html: Added.
* crypto/workers/subtle/ec-generate-export-raw-key-expected.txt: Added.
* crypto/workers/subtle/ec-generate-export-raw-key.html: Added.
* crypto/workers/subtle/ec-import-jwk-key-private-expected.txt: Added.
* crypto/workers/subtle/ec-import-jwk-key-private.html: Added.
* crypto/workers/subtle/ec-import-jwk-key-public-expected.txt: Added.
* crypto/workers/subtle/ec-import-jwk-key-public.html: Added.
* crypto/workers/subtle/ec-import-raw-key-expected.txt: Added.
* crypto/workers/subtle/ec-import-raw-key.html: Added.
* crypto/workers/subtle/resources/ec-generate-export-jwk-key.js: Added.
* crypto/workers/subtle/resources/ec-generate-export-raw-key.js: Added.
* crypto/workers/subtle/resources/ec-import-jwk-key-private.js: Added.
* crypto/workers/subtle/resources/ec-import-jwk-key-public.js: Added.
* crypto/workers/subtle/resources/ec-import-raw-key.js: Added.

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

2 years agoInitialize the subpixelAntialiasedLayerTextEnabled Setting in WebKit1
simon.fraser@apple.com [Wed, 8 Mar 2017 01:50:40 +0000 (01:50 +0000)]
Initialize the subpixelAntialiasedLayerTextEnabled Setting in WebKit1
https://bugs.webkit.org/show_bug.cgi?id=169230

Reviewed by Tim Horton.

* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

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

2 years agoWebRTC can be used even if getUserMedia is off
commit-queue@webkit.org [Wed, 8 Mar 2017 01:48:23 +0000 (01:48 +0000)]
WebRTC can be used even if getUserMedia is off
https://bugs.webkit.org/show_bug.cgi?id=169303

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

* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::peerConnectionEnabled): No longer tieing peerConnectionEnabled to
mediaStreamEnabled.

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

2 years agoEnable SubpixelAntialiasedLayerTextEnabled by default on some versions of macOS
simon.fraser@apple.com [Wed, 8 Mar 2017 01:43:21 +0000 (01:43 +0000)]
Enable SubpixelAntialiasedLayerTextEnabled by default on some versions of macOS
https://bugs.webkit.org/show_bug.cgi?id=169329

Reviewed by Tim Horton.

If the macOS version is > 101300, enable subpixelAntialiasedLayerTextEnabled.

Source/WebKit/mac:

* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):

Source/WebKit2:

* Shared/WebPreferencesDefinitions.h:

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

2 years agoMake platformDevice() not inline, to avoid a
dino@apple.com [Wed, 8 Mar 2017 01:36:45 +0000 (01:36 +0000)]
Make platformDevice() not inline, to avoid a
weak external symbol issue on newer compilers/linkers

* platform/graphics/cocoa/GPUDeviceMetal.mm:
(WebCore::GPUDevice::platformDevice):
* platform/graphics/gpu/GPUDevice.h:
(WebCore::GPUDevice::platformDevice): Deleted.

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

2 years agoFix the TestWebKitAPI build
timothy_horton@apple.com [Wed, 8 Mar 2017 01:03:38 +0000 (01:03 +0000)]
Fix the TestWebKitAPI build

Rubber-stamped by Anders Carlsson.

* TestWebKitAPI/Tests/WTF/MetaAllocator.cpp:
(TestWebKitAPI::TEST_F):
Fix a new warning about default argument promotion and va_start by
making this a enum class.

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

2 years agoAdd Debug flag to TestExpectation for webrtc/libwebrtc/descriptionGetters.html.
ryanhaddad@apple.com [Wed, 8 Mar 2017 00:59:46 +0000 (00:59 +0000)]
Add Debug flag to TestExpectation for webrtc/libwebrtc/descriptionGetters.html.

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

2 years agoMark webrtc/libwebrtc/descriptionGetters.html as failing.
ryanhaddad@apple.com [Wed, 8 Mar 2017 00:54:55 +0000 (00:54 +0000)]
Mark webrtc/libwebrtc/descriptionGetters.html as failing.
https://bugs.webkit.org/show_bug.cgi?id=169317

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

2 years agoTurnPort::OnSocketConnect is crashing
commit-queue@webkit.org [Wed, 8 Mar 2017 00:54:33 +0000 (00:54 +0000)]
TurnPort::OnSocketConnect is crashing
https://bugs.webkit.org/show_bug.cgi?id=169284

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

* Source/webrtc/p2p/base/turnport.cc: Fixing the assertion.

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

2 years agoAdditional DataInteraction Support
megan_gardner@apple.com [Wed, 8 Mar 2017 00:41:27 +0000 (00:41 +0000)]
Additional DataInteraction Support
https://bugs.webkit.org/show_bug.cgi?id=169316
<rdar://problem/30884234>

Reviewed by Wenson Hsieh.

Add stub implementations to WebView for methods that handle data interaction

* WebView/WebView.mm:
(-[WebView _enteredDataInteraction:client:global:operation:]):
(-[WebView _updatedDataInteraction:client:global:operation:]):
(-[WebView _exitedDataInteraction:client:global:operation:]):
(-[WebView _performDataInteraction:client:global:operation:]):
(-[WebView _endedDataInteraction:global:]):
* WebView/WebViewPrivate.h:

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

2 years agoAdd test case to check that MessageEvent.data returns the value it was initialized to
cdumez@apple.com [Wed, 8 Mar 2017 00:31:32 +0000 (00:31 +0000)]
Add test case to check that MessageEvent.data returns the value it was initialized to
https://bugs.webkit.org/show_bug.cgi?id=169311

Reviewed by Sam Weinig.

* fast/events/constructors/message-event-constructor-data-identity-expected.txt: Added.
* fast/events/constructors/message-event-constructor-data-identity.html: Added.

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

2 years agoSome platforms won't be able to create a GPUDevice
dino@apple.com [Wed, 8 Mar 2017 00:09:37 +0000 (00:09 +0000)]
Some platforms won't be able to create a GPUDevice
https://bugs.webkit.org/show_bug.cgi?id=169314
<rdar://problems/30907521>

Reviewed by Jon Lee.

Source/JavaScriptCore:

Disable WEB_GPU on the iOS Simulator.

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

Protect for the case where the hardware doesn't support Metal. And
we might as well disable WebGPU completely in the iOS simulator
for now.

* Configurations/FeatureDefines.xcconfig:
* platform/graphics/cocoa/GPUDeviceMetal.mm:
(WebCore::GPUDevice::GPUDevice):
* platform/graphics/gpu/GPUDevice.cpp:
(WebCore::GPUDevice::create):

Source/WebCore/PAL:

Disable WEB_GPU on the iOS Simulator.

* Configurations/FeatureDefines.xcconfig:

Source/WebKit/mac:

Disable WEB_GPU on the iOS Simulator.

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

Disable WEB_GPU on the iOS Simulator.

* Configurations/FeatureDefines.xcconfig:

Tools:

Protect for the case where the hardware doesn't support Metal.

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:
* TestWebKitAPI/Tests/WebCore/mac/GPUDevice.mm:
(TestWebKitAPI::TEST):

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

2 years agoUpdate ReadMe.md to use directory format for backing up & restoring the database
rniwa@webkit.org [Tue, 7 Mar 2017 23:21:49 +0000 (23:21 +0000)]
Update ReadMe.md to use directory format for backing up & restoring the database
https://bugs.webkit.org/show_bug.cgi?id=169263

Reviewed by Joseph Pecoraro.

Update ReadMe.md's instruction to backup and restore the database to use directory format instead of
piping it to gzip. The new command will backup and restore the database with multiple concurrent processes
with a custom compression level.

* ReadMe.md:

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

2 years agoCorrectly check for an empty database file.
ryanhaddad@apple.com [Tue, 7 Mar 2017 23:12:34 +0000 (23:12 +0000)]
Correctly check for an empty database file.
<rdar://problem/30542242> Removing Website Data not working (WebSQL directories being left behind)
https://bugs.webkit.org/show_bug.cgi?id=169256

Patch by Maureen Daum <mdaum@apple.com> on 2017-03-07
Reviewed by Brady Eidson.

Source/WebCore:

Tests: DatabaseTrackerTest.DeleteDatabaseFileIfEmpty verifies that we actually delete an empty file.

Instead of checking that a database file's size is zero bytes, we should check if it contains
any tables. Once we open an empty database file and set its journal mode to WAL, it will have a
valid SQLite header and therefore will no longer be empty. We can know that the database was empty
if it does not contain any tables.

* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::deleteDatabaseFileIfEmpty):
Use BEGIN EXCLUSIVE TRANSACTION in order to obtain the exclusive lock. If the database doesn't contain
any tables, it is empty and can be deleted.

Source/WebKit/mac:

Check if the folder for an origin's WebSQL databases is empty after trying to delete
all of its files. Currently we check if the deletedDatabaseFileCount matches the number
of files that were in the folder. However, when we delete the actual database file in
DatabaseTracker::deleteDatabaseFileIfEmpty(), the shm and wal files get deleted along with
the database file, but deletedDatabaseFileCount only gets incremented once.

* Storage/WebDatabaseManager.mm:
(+[WebDatabaseManager removeEmptyDatabaseFiles]):
Delete the folder if it is empty.

Tools:

Add a test for DatabaseTracker::deleteDatabaseFileIfEmpty that verifies
that if we pass in an empty file it actually gets deleted.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
Add TestWebKitAPI/Tests/WebCore/DatabaseTrackerTest.cpp.
* TestWebKitAPI/Tests/WebCore/DatabaseTrackerTest.cpp: Added.
(TestWebKitAPI::TEST):

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

2 years ago[URLParser] Fix file URLs that are just file:// and a Windows drive letter
commit-queue@webkit.org [Tue, 7 Mar 2017 23:07:56 +0000 (23:07 +0000)]
[URLParser] Fix file URLs that are just file:// and a Windows drive letter
https://bugs.webkit.org/show_bug.cgi?id=169242

Patch by Alex Christensen <achristensen@webkit.org> on 2017-03-07
Reviewed by Tim Horton.

LayoutTests/imported/w3c:

* web-platform-tests/url/a-element-expected.txt:
* web-platform-tests/url/a-element-xhtml-expected.txt:
* web-platform-tests/url/url-constructor-expected.txt:

Source/WebCore:

This is specified in https://url.spec.whatwg.org/#file-host-state and tested by a newly-passing
web platform test.  I added the check for the windows drive quirk in the FileHost state of the
parser but I forgot it when FileHost is the terminal state.

* platform/URLParser.cpp:
(WebCore::URLParser::parse):

Tools:

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

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

2 years agoStandardize device/simulator naming conventions
jbedard@apple.com [Tue, 7 Mar 2017 23:05:57 +0000 (23:05 +0000)]
Standardize device/simulator naming conventions
https://bugs.webkit.org/show_bug.cgi?id=169083
<rdar://problem/30810466>

Reviewed by Alexey Proskuryakov.

* Scripts/build-webkit: Document --ios-device and --simulator options.
* Scripts/package-root:
(usage): Ditto.
* Scripts/run-api-tests: Document --simulator option.
* Scripts/webkitdirs.pm:
(argumentsForConfiguration): Use --ios-device by default rather than --device.
(determineXcodeSDK): Parse --ios-device and --simulator options.
* Scripts/webkitpy/common/config/ews.json: Change port name from ios to ios-device.
* Scripts/webkitpy/common/config/ports.py: Ditto.
(DeprecatedPort.port):
(IOSPort): Change port name from ios to ios-device.
* Scripts/webkitpy/port/factory.py:
(platform_options): Add --simulator option.
(PortFactory): Update comment.
* Scripts/webkitpy/port/ios_device.py:
(IOSDevicePort): Change port name from ios to ios-device.
(IOSDevicePort.operating_system): Ditto.

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

2 years ago[Mac][iOS][WK2] Whitelist sysctl-read
bfulgham@apple.com [Tue, 7 Mar 2017 22:53:17 +0000 (22:53 +0000)]
[Mac][iOS][WK2] Whitelist sysctl-read
https://bugs.webkit.org/show_bug.cgi?id=169306
<rdar://problem/16371458>

Reviewed by Alex Christensen.

Limit access to the 'sysctl' call to read-only cases of the very small
set of operations we actually use.

* DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
* PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
* Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb:
* Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
* WebProcess/com.apple.WebProcess.sb.in:

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

2 years agoDrop non-standard MessageEvent.webkitInitMessageEvent()
cdumez@apple.com [Tue, 7 Mar 2017 22:44:53 +0000 (22:44 +0000)]
Drop non-standard MessageEvent.webkitInitMessageEvent()
https://bugs.webkit.org/show_bug.cgi?id=169295

Reviewed by Joseph Pecoraro.

Source/WebCore:

Drop non-standard MessageEvent.webkitInitMessageEvent().

Chrome dropped it almost 3 years ago. They had UseCounter data showing
consistent 0% usage:
- https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/H6lsGFqdy3Y
- https://www.chromestatus.com/metrics/feature/timeline/popularity/223
- https://src.chromium.org/viewvc/blink?revision=174967&view=revision

* bindings/js/JSMessageEventCustom.cpp:
(WebCore::handleInitMessageEvent): Deleted.
(WebCore::JSMessageEvent::webkitInitMessageEvent): Deleted.
* dom/MessageEvent.idl:

Source/WebInspectorUI:

Drop MessageEvent.webkitInitMessageEvent and update parameters for various
init*Event() operations to match the current implementation.

* UserInterface/Models/NativeFunctionParameters.js:

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

2 years agoLabel of an <option> element should not be displayed in quirks mode
cdumez@apple.com [Tue, 7 Mar 2017 22:24:19 +0000 (22:24 +0000)]
Label of an <option> element should not be displayed in quirks mode
https://bugs.webkit.org/show_bug.cgi?id=169296
<rdar://problem/30900751>

Reviewed by Simon Fraser.

Source/WebCore:

Label of an <option> element should not be displayed in quirks mode, to
match Chrome and Firefox. However, we should still display the label in
strict mode, as per the HTML specification:
- https://html.spec.whatwg.org/multipage/rendering.html#the-select-element-2

Chrome renders the label in strict mode, same as us. Firefox does not:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1345242

Tests: fast/dom/HTMLOptionElement/option-label-quirksmode.html
       fast/dom/HTMLOptionElement/option-label-quirksmode2.html
       fast/dom/HTMLOptionElement/option-label-strictmode.html

* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::displayLabel):
(WebCore::HTMLOptionElement::textIndentedToRespectGroupLabel):
* html/HTMLOptionElement.h:

LayoutTests:

Add layout test coverage.

* fast/dom/HTMLOptionElement/option-label-quirksmode-expected.html: Added.
* fast/dom/HTMLOptionElement/option-label-quirksmode.html: Added.
* fast/dom/HTMLOptionElement/option-label-quirksmode2-expected.html: Added.
* fast/dom/HTMLOptionElement/option-label-quirksmode2.html: Added.
* fast/dom/HTMLOptionElement/option-label-strictmode-expected.html: Added.
* fast/dom/HTMLOptionElement/option-label-strictmode.html: Added.

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

2 years agoAdd GPUDevice implementation and WebGPULayer
dino@apple.com [Tue, 7 Mar 2017 22:23:33 +0000 (22:23 +0000)]
Add GPUDevice implementation and WebGPULayer
https://bugs.webkit.org/show_bug.cgi?id=169219
<rdar://problem/30879048>

Reviewed by Sam Weinig.

Source/WebCore:

Add a basic implementation of a GPUDevice object,
which references a MTLDevice. Also add a WebGPULayer
that will ultimately be used to host WebGPU content.

WebKit API Test: WebCore/mac/GPUDevice.mm

* Configurations/WebCore.xcconfig: Link to Metal.

* PlatformMac.cmake: New files.
* WebCore.xcodeproj/project.pbxproj:

* platform/Logging.h: Add a WebGPU logging channel.

* platform/graphics/cocoa/GPUDeviceMetal.mm: Added.
(WebCore::GPUDevice::GPUDevice): Cocoa implementation.
(WebCore::GPUDevice::reshape):
* platform/graphics/cocoa/WebGPULayer.h: Added.
* platform/graphics/cocoa/WebGPULayer.mm: Added.
(-[WebGPULayer initWithGPUDevice:]):
(-[WebGPULayer copyImageSnapshotWithColorSpace:]):
(-[WebGPULayer display]):
* platform/graphics/gpu/GPUDevice.cpp: Added.
(WebCore::GPUDevice::create):
(WebCore::GPUDevice::~GPUDevice):
(WebCore::GPUDevice::GPUDevice): Implementation for platforms
other than Mac and iOS hardware.
(WebCore::GPUDevice::reshape):
* platform/graphics/gpu/GPUDevice.h: Added.
(WebCore::GPUDevice::platformLayer):
(WebCore::GPUDevice::platformDevice):
(WebCore::GPUDevice::layer):

Tools:

Test for WebCore's GPUDevice class.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebCore/mac/GPUDevice.mm: Added.
(TestWebKitAPI::TEST):

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

2 years ago[Modern Media Controls] Log an error to the console when an image fails to load
commit-queue@webkit.org [Tue, 7 Mar 2017 22:22:32 +0000 (22:22 +0000)]
[Modern Media Controls] Log an error to the console when an image fails to load
https://bugs.webkit.org/show_bug.cgi?id=169292

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

In order to help debug flaky tests we now log the image source when an image fails to load.

* Modules/modern-media-controls/controls/icon-button.js:
(IconButton.prototype.handleEvent):
(IconButton.prototype._loadImage):

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

2 years agoMark media/modern-media-controls/seek-backward-support/seek-backward-support.html...
ryanhaddad@apple.com [Tue, 7 Mar 2017 21:26:55 +0000 (21:26 +0000)]
Mark media/modern-media-controls/seek-backward-support/seek-backward-support.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=165386

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

2 years agoMark media/modern-media-controls/macos-inline-media-controls/macos-inline-media-contr...
ryanhaddad@apple.com [Tue, 7 Mar 2017 21:26:52 +0000 (21:26 +0000)]
Mark media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-audio-background.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=169117

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

2 years agoRemove Debug flag from flaky test http/tests/cache/disk-cache/memory-cache-revalidati...
ryanhaddad@apple.com [Tue, 7 Mar 2017 21:26:49 +0000 (21:26 +0000)]
Remove Debug flag from flaky test http/tests/cache/disk-cache/memory-cache-revalidation-updates-disk-cache.html.
https://bugs.webkit.org/show_bug.cgi?id=162975

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

2 years agoSimple line layout: Do not use invalid m_lastNonWhitespaceFragment while removing...
zalan@apple.com [Tue, 7 Mar 2017 21:02:15 +0000 (21:02 +0000)]
Simple line layout: Do not use invalid m_lastNonWhitespaceFragment while removing trailing whitespace.
https://bugs.webkit.org/show_bug.cgi?id=169288
rdar://problem/30576976

Reviewed by Antti Koivisto.

Source/WebCore:

When the current line has nothing but whitespace, m_lastNonWhitespaceFragment is invalid so
we should not use the start/end values to decide how many characters we need to revert.
This patch makes m_lastNonWhitespaceFragment optional. When it's invalid we just remove
all the runs from the current line since they are all considered whitespace runs.

Test: fast/text/simple-line-layout-line-is-all-whitespace.html

* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::revertAllRunsOnCurrentLine):
(WebCore::SimpleLineLayout::LineState::removeTrailingWhitespace):

LayoutTests:

* fast/text/simple-line-layout-line-is-all-whitespace-expected.txt: Added.
* fast/text/simple-line-layout-line-is-all-whitespace.html: Added.

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

2 years ago[Content Extensions] Rename "Domain" to "Condition" where appropriate
achristensen@apple.com [Tue, 7 Mar 2017 20:54:09 +0000 (20:54 +0000)]
[Content Extensions] Rename "Domain" to "Condition" where appropriate
https://bugs.webkit.org/show_bug.cgi?id=169297

Reviewed by Brady Eidson.

Source/WebCore:

In r184116 I added the ability for a content blocker author to add conditions to the triggers,
if-domain and unless-domain which look at the domain of the main document URL.
I plan to add more conditions soon to run regexes on the entire URL, but to make that patch more
manageable, I took the non-behavior-changing parts and put them in this patch.

No change in behavior except some error messages were made more generic.

* contentextensions/CompiledContentExtension.h:
* contentextensions/ContentExtension.cpp:
(WebCore::ContentExtensions::ContentExtension::ContentExtension):
(WebCore::ContentExtensions::ContentExtension::compileGlobalDisplayNoneStyleSheet):
(WebCore::ContentExtensions::ContentExtension::populateConditionCacheIfNeeded):
Pass the main document URL instead of just the domain.  No change in behavior yet.
(WebCore::ContentExtensions::ContentExtension::cachedConditionedActions):
(WebCore::ContentExtensions::ContentExtension::universalActionsWithConditions):
(WebCore::ContentExtensions::ContentExtension::populateDomainCacheIfNeeded): Deleted.
(WebCore::ContentExtensions::ContentExtension::cachedDomainActions): Deleted.
(WebCore::ContentExtensions::ContentExtension::universalActionsWithDomains): Deleted.
* contentextensions/ContentExtension.h:
(WebCore::ContentExtensions::ContentExtension::universalActionsWithoutConditions):
(WebCore::ContentExtensions::ContentExtension::universalActionsWithoutDomains): Deleted.
* contentextensions/ContentExtensionCompiler.cpp:
(WebCore::ContentExtensions::serializeActions):
(WebCore::ContentExtensions::compileRuleList):
* contentextensions/ContentExtensionCompiler.h:
* contentextensions/ContentExtensionError.cpp:
(WebCore::ContentExtensions::contentExtensionErrorCategory):
* contentextensions/ContentExtensionError.h:
* contentextensions/ContentExtensionParser.cpp:
(WebCore::ContentExtensions::getStringList):
Don't pass the error type as a parameter.  It's always JSONInvalidConditionList.
(WebCore::ContentExtensions::getDomainList):
(WebCore::ContentExtensions::loadTrigger):
* contentextensions/ContentExtensionRule.h:
(WebCore::ContentExtensions::Trigger::~Trigger):
(WebCore::ContentExtensions::Trigger::isEmpty):
(WebCore::ContentExtensions::Trigger::operator==):
(WebCore::ContentExtensions::TriggerHash::hash):
Use bitwise xor instead of bitwise or to have fewer hash collisions.
Also, before we were accidentally doing the same hash operation here for IfDomain and UnlessDomain.
This caused unnecessary hash collisions.  This is fixed, but should not change any behavior.
* contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
* contentextensions/DFABytecode.h:
(WebCore::ContentExtensions::instructionSizeWithArguments):
* contentextensions/DFABytecodeCompiler.cpp:
(WebCore::ContentExtensions::DFABytecodeCompiler::emitAppendAction):
* contentextensions/DFABytecodeInterpreter.cpp:
(WebCore::ContentExtensions::matchesCondition):
(WebCore::ContentExtensions::DFABytecodeInterpreter::interpretAppendAction):
(WebCore::ContentExtensions::DFABytecodeInterpreter::interpretTestFlagsAndAppendAction):
(WebCore::ContentExtensions::DFABytecodeInterpreter::actionsMatchingEverything):
(WebCore::ContentExtensions::DFABytecodeInterpreter::interpretWithConditions):
(WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
(WebCore::ContentExtensions::matchesDomain): Deleted.
(WebCore::ContentExtensions::DFABytecodeInterpreter::interpretWithDomains): Deleted.
* contentextensions/DFABytecodeInterpreter.h:
* loader/ResourceLoadInfo.h:

Source/WebKit2:

* Shared/WebCompiledContentExtension.cpp:
(WebKit::WebCompiledContentExtension::filtersWithoutConditionsBytecode):
(WebKit::WebCompiledContentExtension::filtersWithoutConditionsBytecodeLength):
(WebKit::WebCompiledContentExtension::filtersWithConditionsBytecode):
(WebKit::WebCompiledContentExtension::filtersWithConditionsBytecodeLength):
(WebKit::WebCompiledContentExtension::conditionedFiltersBytecode):
(WebKit::WebCompiledContentExtension::conditionedFiltersBytecodeLength):
(WebKit::WebCompiledContentExtension::filtersWithoutDomainsBytecode): Deleted.
(WebKit::WebCompiledContentExtension::filtersWithoutDomainsBytecodeLength): Deleted.
(WebKit::WebCompiledContentExtension::filtersWithDomainsBytecode): Deleted.
(WebKit::WebCompiledContentExtension::filtersWithDomainsBytecodeLength): Deleted.
(WebKit::WebCompiledContentExtension::domainFiltersBytecode): Deleted.
(WebKit::WebCompiledContentExtension::domainFiltersBytecodeLength): Deleted.
* Shared/WebCompiledContentExtension.h:
* Shared/WebCompiledContentExtensionData.cpp:
(WebKit::WebCompiledContentExtensionData::encode):
(WebKit::WebCompiledContentExtensionData::decode):
* Shared/WebCompiledContentExtensionData.h:
(WebKit::WebCompiledContentExtensionData::WebCompiledContentExtensionData):
* UIProcess/API/APIUserContentExtensionStore.cpp:
(API::ContentExtensionMetaData::fileSize):
(API::encodeContentExtensionMetaData):
(API::decodeContentExtensionMetaData):
(API::compiledToFile):
(API::createExtension):
(API::UserContentExtensionStore::lookupContentExtension):
(API::UserContentExtensionStore::compileContentExtension):
(API::UserContentExtensionStore::removeContentExtension):
* UIProcess/API/APIUserContentExtensionStore.h:

Tools:

* TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:
(TestWebKitAPI::InMemoryCompiledContentExtension::create):
(TestWebKitAPI::TEST_F):

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

2 years ago[FreeType] FontPlatformData::fallbacks() returns unprepared FcPatterns
mcatanzaro@igalia.com [Tue, 7 Mar 2017 20:36:29 +0000 (20:36 +0000)]
[FreeType] FontPlatformData::fallbacks() returns unprepared FcPatterns
https://bugs.webkit.org/show_bug.cgi?id=164689

Reviewed by Carlos Garcia Campos.

From the documentation of FcFontSort():

"""The returned FcFontSet references FcPattern structures which may be shared by the
return value from multiple FcFontSort calls, applications must not modify these patterns.
Instead, they should be passed, along with p to FcFontRenderPrepare which combines them into
a complete pattern."""

That means each call to FcFontSort() must be followed up by a call to FcFontRenderPrepare(),
else the patterns will lack information about how to draw the font properly.

* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
(WebCore::FontPlatformData::fallbacks):

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

2 years agoFlaky Test: media/modern-media-controls/tracks-support/tracks-support-click-track...
commit-queue@webkit.org [Tue, 7 Mar 2017 20:16:03 +0000 (20:16 +0000)]
Flaky Test: media/modern-media-controls/tracks-support/tracks-support-click-track-in-panel.html
https://bugs.webkit.org/show_bug.cgi?id=169159

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

Make this test more defensive to ensure it doesn't fail.

* media/modern-media-controls/tracks-support/tracks-support-click-track-in-panel-expected.txt:
* media/modern-media-controls/tracks-support/tracks-support-click-track-in-panel.html:
* platform/mac/TestExpectations:

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

2 years agowebkitpy: Refactor setup_test_run for IOSPort and IOSSimulator
jbedard@apple.com [Tue, 7 Mar 2017 20:05:50 +0000 (20:05 +0000)]
webkitpy: Refactor setup_test_run for IOSPort and IOSSimulator
https://bugs.webkit.org/show_bug.cgi?id=169220
<rdar://problem/30879645>

Reviewed by Daniel Bates.

Provide more specific port setup functions for iOS ports to allow more sharing of common code.

* Scripts/webkitpy/port/ios.py:
(IOSPort):
(IOSPort._create_devices): Added.
(IOSPort.setup_test_run): Shared iOS device setup code.
* Scripts/webkitpy/port/ios_simulator.py:
(IOSSimulatorPort._create_devices): Renamed from setup_test_run.
(IOSSimulatorPort.setup_test_run): Renamed as _create_devices.

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

2 years agoRewrite the DRT Pasteboard implementation to use UTIs and WTF types
andersca@apple.com [Tue, 7 Mar 2017 19:27:51 +0000 (19:27 +0000)]
Rewrite the DRT Pasteboard implementation to use UTIs and WTF types
https://bugs.webkit.org/show_bug.cgi?id=169289

Reviewed by Tim Horton.

* DumpRenderTree/mac/DumpRenderTreePasteboard.mm:
(-[LocalPasteboard initWithName:]):
(-[LocalPasteboard name]):
(-[LocalPasteboard declareTypes:owner:]):
(isUTI):
(toUTI):
(-[LocalPasteboard addTypes:owner:]):
(-[LocalPasteboard changeCount]):
(-[LocalPasteboard types]):
(-[LocalPasteboard availableTypeFromArray:]):
(-[LocalPasteboard setData:forType:]):
(-[LocalPasteboard dataForType:]):
(-[LocalPasteboard writeObjects:]):
(-[LocalPasteboard dealloc]): Deleted.

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

2 years agoParsing font descriptors inside @font-face needs to accept ranges
mmaxfield@apple.com [Tue, 7 Mar 2017 19:26:21 +0000 (19:26 +0000)]
Parsing font descriptors inside @font-face needs to accept ranges
https://bugs.webkit.org/show_bug.cgi?id=168893

Reviewed by Dean Jackson.

Source/WebCore:

Parse font-weight, font-stretch, and font-style ranges according to
https://drafts.csswg.org/css-fonts-4/#font-prop-desc. There is one difference, though:
as documented in https://github.com/w3c/csswg-drafts/issues/783, slashes are a better
delimiters than hyphens, so this patch implements that instead. I'll update the spec to
include slashes as soon as possible.

Because this patch is all about creating FontSelectionValues from fonts, it doesn't
actually modify the font selection algorithm, and therefore only tests the creation of
these new values. The font selection algorithm itself is already tested elsewhere.

This new work is behind the ENABLE(VARIATION_FONTS) flag.

Test: fast/text/font-selection-font-face-parse.html

* css/CSSFontFace.cpp:
(WebCore::calculateWeightRange):
(WebCore::calculateStretchRange):
(WebCore::calculateItalicRange):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontWeightRange):
(WebCore::consumeFontStretchRange):
(WebCore::consumeFontStyleRange):
(WebCore::CSSPropertyParser::parseFontFaceDescriptor):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::extractVariationBounds):
(WebCore::variationCapabilitiesForFontDescriptor):
(WebCore::capabilitiesForFontDescriptor):

LayoutTests:

* fast/text/font-selection-font-face-parse-expected.txt:
* fast/text/font-selection-font-face-parse.html:
* platform/mac-elcapitan/fast/text/font-selection-font-face-parse-expected.txt:
Variations are off on El Capitan, so this platform needs explicit results.

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

2 years agoRevise the ARES-6 explainer text
fpizlo@apple.com [Tue, 7 Mar 2017 19:21:02 +0000 (19:21 +0000)]
Revise the ARES-6 explainer text
https://bugs.webkit.org/show_bug.cgi?id=169287

Reviewed by Saam Barati.

Just did some copy-editing.

* ARES-6/about.html:

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

2 years agoMove webrtc/descriptionGetters.html to webrtc/libwebrtc/descriptionGetters.html
clopez@igalia.com [Tue, 7 Mar 2017 19:16:09 +0000 (19:16 +0000)]
Move webrtc/descriptionGetters.html to webrtc/libwebrtc/descriptionGetters.html
https://bugs.webkit.org/show_bug.cgi?id=169216

Unreviewed test gardening.

Move the test webrtc/descriptionGetters.html under the directory webrtc/libwebrtc
because its still not testing the spec, but the current libwebrtc based implementation.

This way the test is skipped on the GTK+ port (The whole directory webrtc/libwebrtc is skipped).

* webrtc/libwebrtc/descriptionGetters-expected.txt: Renamed from LayoutTests/webrtc/descriptionGetters-expected.txt.
* webrtc/libwebrtc/descriptionGetters.html: Renamed from LayoutTests/webrtc/descriptionGetters.html.

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

2 years agoAdd David Jonathan Ross to contributors.json
mmaxfield@apple.com [Tue, 7 Mar 2017 18:54:56 +0000 (18:54 +0000)]
Add David Jonathan Ross to contributors.json
https://bugs.webkit.org/show_bug.cgi?id=169265

Unreviewed.

David Jonathan Ross very kindly offered to create and contribute his Boxis font in r211060,
which is used for testing font variations.

* Scripts/webkitpy/common/config/contributors.json:

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

2 years ago[Mac][WK2] Expand sandbox to support access to audio component registrar
bfulgham@apple.com [Tue, 7 Mar 2017 18:06:10 +0000 (18:06 +0000)]
[Mac][WK2] Expand sandbox to support access to audio component registrar
https://bugs.webkit.org/show_bug.cgi?id=169283
<rdar://problem/30793512>

Reviewed by Alexey Proskuryakov.

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

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

2 years agoAnimated GIFs fail to play in multi-column layout
hyatt@apple.com [Tue, 7 Mar 2017 17:59:13 +0000 (17:59 +0000)]
Animated GIFs fail to play in multi-column layout
https://bugs.webkit.org/show_bug.cgi?id=167901
<rdar://problem/30382262>

Reviewed by Zalan Bujtas.

* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeRectForRepaint):
Make sure to handle the case where we pass in a null repaintContainer and need
to cross a multicolumn flow thread -> region boundary as a result.

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

2 years agoShadowBlur::calculateLayerBoundingRect doesn't need to return the enclosingIntRect...
zalan@apple.com [Tue, 7 Mar 2017 17:33:45 +0000 (17:33 +0000)]
ShadowBlur::calculateLayerBoundingRect doesn't need to return the enclosingIntRect of layerRect
https://bugs.webkit.org/show_bug.cgi?id=168650

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-03-07
Reviewed by Simon Fraser.

No new tests, no behavior change.

* platform/graphics/ShadowBlur.h: Change the type of return value
from IntRect to IntSize.
* platform/graphics/ShadowBlur.cpp:
(WebCore::ShadowBlur::calculateLayerBoundingRect): Ditto.
(WebCore::ShadowBlur::drawRectShadow): Rename a variable layerRect layerSize.
(WebCore::ShadowBlur::drawInsetShadow): Ditto.
(WebCore::ShadowBlur::drawRectShadowWithoutTiling): Ditto.
(WebCore::ShadowBlur::drawInsetShadowWithoutTiling): Ditto.
(WebCore::ShadowBlur::beginShadowLayer): Ditto.

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

2 years agoReplace debug assertion with release one in Frame::setView()
cdumez@apple.com [Tue, 7 Mar 2017 17:22:35 +0000 (17:22 +0000)]
Replace debug assertion with release one in Frame::setView()
https://bugs.webkit.org/show_bug.cgi?id=169189

Reviewed by Ryosuke Niwa.

Replace debug assertion with release one in Frame::setView() to make make sure the
document does not have a living render tree. This will help identify possible
remaining cases where this can happen.

* dom/Document.cpp:
(WebCore::Document::didBecomeCurrentDocumentInView): Deleted.
* dom/Document.h:
* page/Frame.cpp:
(WebCore::Frame::setView):

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

2 years agoExpose WebRTC current/pending description getters
commit-queue@webkit.org [Tue, 7 Mar 2017 17:15:06 +0000 (17:15 +0000)]
Expose WebRTC current/pending description getters
https://bugs.webkit.org/show_bug.cgi?id=169216

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

Source/WebCore:

Test: webrtc/descriptionGetters.html

Implement pending and current description getters through libwebrtc.
These getters do not yet match the spec as can be seen from the test, which is written to match the implemented behavior.

* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::currentLocalDescription):
(WebCore::LibWebRTCPeerConnectionBackend::currentRemoteDescription):
(WebCore::LibWebRTCPeerConnectionBackend::pendingLocalDescription):
(WebCore::LibWebRTCPeerConnectionBackend::pendingRemoteDescription):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:

LayoutTests:

* webrtc/descriptionGetters-expected.txt: Added.
* webrtc/descriptionGetters.html: Added.

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

2 years agoPort DOMTimer from std::chrono::milliseconds to WTF::Seconds type
cdumez@apple.com [Tue, 7 Mar 2017 17:11:06 +0000 (17:11 +0000)]
Port DOMTimer from std::chrono::milliseconds to WTF::Seconds type
https://bugs.webkit.org/show_bug.cgi?id=169236

Reviewed by Simon Fraser.

Source/WebCore:

* dom/Document.cpp:
(WebCore::Document::minimumDOMTimerInterval):
(WebCore::Document::timerAlignmentInterval):
* dom/Document.h:
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::adjustMinimumDOMTimerInterval):
(WebCore::ScriptExecutionContext::minimumDOMTimerInterval):
(WebCore::ScriptExecutionContext::timerAlignmentInterval):
* dom/ScriptExecutionContext.h:
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didInstallTimerImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didInstallTimer):
* inspector/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::didInstallTimer):
* inspector/InspectorTimelineAgent.h:
* inspector/TimelineRecordFactory.cpp:
(WebCore::TimelineRecordFactory::createTimerInstallData):
* inspector/TimelineRecordFactory.h:
* page/DOMTimer.cpp:
(WebCore::shouldForwardUserGesture):
(WebCore::userGestureTokenToForward):
(WebCore::DOMTimer::DOMTimer):
(WebCore::DOMTimer::install):
(WebCore::DOMTimer::intervalClampedToMinimum):
(WebCore::DOMTimer::alignedFireTime):
* page/DOMTimer.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::setTimeout):
(WebCore::DOMWindow::setInterval):
* page/Page.cpp:
(WebCore::Page::setTimerThrottlingState):
(WebCore::Page::setDOMTimerAlignmentIntervalIncreaseLimit):
(WebCore::Page::updateDOMTimerAlignmentInterval):
* page/Page.h:
(WebCore::Page::domTimerAlignmentInterval):
* page/Settings.cpp:
(WebCore::Settings::setMinimumDOMTimerInterval):
* page/Settings.h:
(WebCore::Settings::minimumDOMTimerInterval):
* page/SuspendableTimer.h:
(WebCore::SuspendableTimer::startRepeating):
(WebCore::SuspendableTimer::startOneShot):
(WebCore::SuspendableTimer::augmentFireInterval):
(WebCore::SuspendableTimer::augmentRepeatInterval):
* platform/Timer.cpp:
(WebCore::TimerBase::setNextFireTime):
* platform/Timer.h:
(WebCore::TimerBase::alignedFireTime):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::setMinimumTimerInterval):
* testing/InternalSettings.h:
* testing/Internals.cpp:
(WebCore::Internals::isTimerThrottled):
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::setTimeout):
(WebCore::WorkerGlobalScope::setInterval):

Source/WebKit2:

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::updateHiddenPageThrottlingAutoIncreaseLimit):
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::setHiddenPageDOMTimerThrottlingIncreaseLimit):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::setHiddenPageDOMTimerThrottlingIncreaseLimit):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

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

2 years agoW3C importer should be able to update the import expectations file
commit-queue@webkit.org [Tue, 7 Mar 2017 17:08:57 +0000 (17:08 +0000)]
W3C importer should be able to update the import expectations file
https://bugs.webkit.org/show_bug.cgi?id=168037

LayoutTests/imported/w3c:

Patch by Youenn Fablet <youenn@apple.com> on 2017-03-07
Reviewed by Ryosuke Niwa.

* resources/import-expectations.json:

Tools:

Patch by Youenn Fablet <youennf@gmail.com> on 2017-03-07
Reviewed by Ryosuke Niwa.

Changing import expectations from an array to a map.
Marking all test paths as import and updating import expectations file accordingly.

* Scripts/webkitpy/w3c/test_downloader.py:
(TestDownloader.__init__):
(TestDownloader._init_paths_from_expectations):
(TestDownloader):
(TestDownloader.update_import_expectations):
* Scripts/webkitpy/w3c/test_importer.py:
(TestImporter.do_import):
* Scripts/webkitpy/w3c/test_importer_unittest.py:

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

2 years agoAlign initEvent / initCustomEvent / initMessageEvent with the latest specification
cdumez@apple.com [Tue, 7 Mar 2017 17:03:16 +0000 (17:03 +0000)]
Align initEvent / initCustomEvent / initMessageEvent with the latest specification
https://bugs.webkit.org/show_bug.cgi?id=169176

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Re-sync web-platform tests from upstream after:
- https://github.com/w3c/web-platform-tests/pull/5043
- https://github.com/w3c/web-platform-tests/pull/5044

* web-platform-tests/dom/events/CustomEvent-expected.txt:
* web-platform-tests/dom/events/CustomEvent.html:
* web-platform-tests/dom/events/Event-initEvent-expected.txt:
* web-platform-tests/dom/events/Event-initEvent.html:
* web-platform-tests/dom/interfaces-expected.txt:
* web-platform-tests/dom/interfaces.html:
* web-platform-tests/html/dom/interfaces-expected.txt:
* web-platform-tests/html/dom/interfaces.html:
* web-platform-tests/html/dom/resources/interfaces.idl: Copied from LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces.html.
* web-platform-tests/html/dom/resources/untested-interfaces.idl: Added.
* web-platform-tests/html/webappapis/scripting/events/messageevent-constructor-expected.txt: Removed.
* web-platform-tests/html/webappapis/scripting/events/messageevent-constructor.html: Removed.
* web-platform-tests/html/webappapis/scripting/events/messageevent-constructor.https-expected.txt:
* web-platform-tests/html/webappapis/scripting/events/messageevent-constructor.https.html:

Source/WebCore:

Align initEvent / initCustomEvent / initMessageEvent with the latest specification
after:
- https://github.com/whatwg/dom/pull/417
- https://github.com/whatwg/html/pull/2410

In particular, the following changes were made:
- initEvent: The length property now properly returns 1 instead of 3 as only the
  first parameter is mandatory. We were already behaving correcting the the length
  property value was wrong because we forgot to drop a hack from the bindings
  generator.
- initCustomEvent: Make all parameters except the first optional. Previously, all
  parameters were mandatory so this is safe.
- initMessageEvent: Drop the custom code and mark the first parameter as mandatory.
  A side effect of dropping the custom code is that null is no longer considered as
  valid input for the last parameter. The parameter is of type sequence<> and the
  new behavior is consistent with the specification and Firefox. If it turns out to
  break existing content, I'll make the parameter nullable in a follow-up.

No new tests, updated existing tests.

* bindings/js/JSMessageEventCustom.cpp:
* bindings/scripts/CodeGeneratorJS.pm:
(GeneratePropertiesHashTable):
* dom/CustomEvent.idl:
* dom/MessageEvent.idl:

LayoutTests:

Updated existing tests to reflect behavior change.

* fast/events/init-events-expected.txt:
* fast/events/script-tests/init-events.js:
* fast/eventsource/eventsource-attribute-listeners.html:

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

2 years ago[GTK][Wayland] Update list of test failing on the Wayland release test bot.
clopez@igalia.com [Tue, 7 Mar 2017 17:02:27 +0000 (17:02 +0000)]
[GTK][Wayland] Update list of test failing on the Wayland release test bot.

Unreviewed test gardening.

* platform/gtk-wayland/TestExpectations: Update list of test failing on the Wayland release test bot.
* platform/gtk/TestExpectations: media/video-played-collapse.html crashes sometimes.

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

2 years agoDifferentiate between pending head and body stylesheets in Style::Scope
antti@apple.com [Tue, 7 Mar 2017 16:54:56 +0000 (16:54 +0000)]
Differentiate between pending head and body stylesheets in Style::Scope
https://bugs.webkit.org/show_bug.cgi?id=169277

Reviewed by Andreas Kling.

Split pending stylesheet node set into separate sets for head and body elements and processing instructions.

This tightens typing and will also be useful later.

* style/StyleScope.cpp:
(WebCore::Style::Scope::~Scope):
(WebCore::Style::Scope::addPendingSheet):
(WebCore::Style::Scope::removePendingSheet):
(WebCore::Style::Scope::didRemovePendingStylesheet):
(WebCore::Style::Scope::hasPendingSheet):
(WebCore::Style::Scope::hasPendingSheetInBody):
(WebCore::Style::Scope::hasProcessingInstructionWithPendingSheet): Deleted.
* style/StyleScope.h:
(WebCore::Style::Scope::hasPendingSheet): Deleted.
(WebCore::Style::Scope::hasPendingSheets): Deleted.
* style/StyleTreeResolver.cpp:
(WebCore::Style::hasLoadingStylesheet):

    Just test for body stylesheets.

(WebCore::Style::TreeResolver::resolve):

    Treat all before-body stylesheets uniformly.

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

2 years ago[Modern Media Controls] Setting a valid source after an invalid one retains the inval...
commit-queue@webkit.org [Tue, 7 Mar 2017 16:23:30 +0000 (16:23 +0000)]
[Modern Media Controls] Setting a valid source after an invalid one retains the invalid placard
https://bugs.webkit.org/show_bug.cgi?id=169280
<rdar://problem/30876078>

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

Source/WebCore:

We need to track when a new load start to see if we might have recovered from an error
and hide the "invalid" placard.

Test: media/modern-media-controls/placard-support/placard-support-error-recover.html

* Modules/modern-media-controls/media/placard-support.js:
(PlacardSupport.prototype.get mediaEvents):

LayoutTests:

Add a new test that checks that we know to remove the "invalid" placard if a new source is
set and media starts loading again.

* media/modern-media-controls/placard-support/placard-support-error-recover-expected.txt: Added.
* media/modern-media-controls/placard-support/placard-support-error-recover.html: Added.

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

2 years ago[GTK] Mark media/video-buffered.html as flaky.
clopez@igalia.com [Tue, 7 Mar 2017 14:45:42 +0000 (14:45 +0000)]
[GTK] Mark media/video-buffered.html as flaky.

Unreviewed test gardening.

* platform/gtk/TestExpectations:

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

2 years agoAdd pdr to the rendering watchlist
rego@igalia.com [Tue, 7 Mar 2017 13:16:22 +0000 (13:16 +0000)]
Add pdr to the rendering watchlist
https://bugs.webkit.org/show_bug.cgi?id=167298

Patch by Philip Rogers <pdr@google.com> on 2017-03-07
Reviewed by Andreas Kling.

* Scripts/webkitpy/common/config/contributors.json: Switch to pdr+autocc@chromium.org
* Scripts/webkitpy/common/config/watchlist: Add pdr to the rendering watchlist.

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

2 years ago[css-grid] Mark a few tests from the W3C suite as pass after r213480
rego@igalia.com [Tue, 7 Mar 2017 13:05:51 +0000 (13:05 +0000)]
[css-grid] Mark a few tests from the W3C suite as pass after r213480
https://bugs.webkit.org/show_bug.cgi?id=169270

Unreviewed test gardening.

r213480 was porting some Blink patches that makes these tests to pass now.
Check the following bugs for more information:
- http://webkit.org/b/169197
- http://webkit.org/b/169198

* TestExpectations: Mark grid-minimum-size-grid-items-007.xht and
grid-minimum-size-grid-items-009.xht as passing.
Keep grid-items-sizing-alignment-001.html as failure but now for a different issue
(see http://webkit.org/b/169271).

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

2 years ago[GTK] ECDH tests from imported/w3c/web-platform-tests/WebCryptoAPI/generateKey fail.
clopez@igalia.com [Tue, 7 Mar 2017 12:46:57 +0000 (12:46 +0000)]
[GTK] ECDH tests from imported/w3c/web-platform-tests/WebCryptoAPI/generateKey fail.

Unreviewed test gardening.

* platform/gtk/TestExpectations:

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

2 years agoUnreviewed. Removed myself from the Accessibility watch list
mario@webkit.org [Tue, 7 Mar 2017 10:15:38 +0000 (10:15 +0000)]
Unreviewed. Removed myself from the Accessibility watch list

Patch by Mario Sanchez Prada <mario@webkit.org> on 2017-03-07

* Scripts/webkitpy/common/config/watchlist: Removed myself.

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

2 years agoREGRESSION (r213412): JPEG premultiplication tests fail under GuardMalloc
aestes@apple.com [Tue, 7 Mar 2017 09:51:17 +0000 (09:51 +0000)]
REGRESSION (r213412): JPEG premultiplication tests fail under GuardMalloc
https://bugs.webkit.org/show_bug.cgi?id=169266

Reviewed by Tim Horton.

r213412 added functions to create a CGImageRef from a canvas image buffer, which were used
to create data: URLs and blobs. If JPEG premultiplication is applied, though,
WebCore::cgImage() would return an image with a data provider pointing to stack memory.

I fixed a similar issue in ImageBuffer::toCGImage() by leaking the reference to a
Uint8ClampedArray then creating a CGDataProviderRef with a releaseData function that adopts
the leaked reference.

We could take that approach in cgImage() too by allocating the premultiplied data buffer on
the heap then freeing it with a releaseData function, but it's simpler to refactor
toCGImage()/cgImage() to return an encoded image as a CFDataRef instead of a CFImageRef.
This ensures that a CGDataProviderRef never outlives the data it points to.

Covered by existing tests.

* platform/graphics/ImageBuffer.h: Renamed toCGImage() to toCFData().
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::dataURL): Changed to take a CFDataRef.
(WebCore::dataVector): Renamed from data(). Changed to take a CFDataRef.
(WebCore::ImageBuffer::toDataURL): Changed to call toCFData().
(WebCore::ImageBuffer::toData): Ditto.
(WebCore::ImageBuffer::toCFData): Changed to return a CFDataRef after encoding the
CGImageRef that was previously returned.
(WebCore::cfData): Ditto.
(WebCore::dataURL): Changed to call cfData().
(WebCore::data): Ditto.
(WebCore::ImageBuffer::toCGImage): Renamed to ImageBuffer::toCFData().
(WebCore::cgImage): Renamed to WebCore::cfData().

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

2 years agoTest fix after r213505
mmaxfield@apple.com [Tue, 7 Mar 2017 08:47:03 +0000 (08:47 +0000)]
Test fix after r213505
https://bugs.webkit.org/show_bug.cgi?id=169267

Unreviewed.

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

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

2 years agoWebAssembly: Implement the WebAssembly.instantiate API
sbarati@apple.com [Tue, 7 Mar 2017 07:38:41 +0000 (07:38 +0000)]
WebAssembly: Implement the WebAssembly.instantiate API
https://bugs.webkit.org/show_bug.cgi?id=165982
<rdar://problem/29760110>

Reviewed by Keith Miller.

JSTests:

* wasm/js-api/web-assembly-instantiate.js: Added.
(assert.eq.async.test):
(assert.eq):
(assert.truthy.async.test):
(assert.truthy):

Source/JavaScriptCore:

This patch is a straight forward implementation of the WebAssembly.instantiate
API: https://github.com/WebAssembly/design/blob/master/JS.md#webassemblyinstantiate

I implemented the API in a synchronous manner. We should make it
asynchronous: https://bugs.webkit.org/show_bug.cgi?id=169187

* wasm/JSWebAssembly.cpp:
(JSC::webAssemblyCompileFunc):
(JSC::webAssemblyInstantiateFunc):
(JSC::JSWebAssembly::finishCreation):
* wasm/js/WebAssemblyInstanceConstructor.cpp:
(JSC::constructJSWebAssemblyInstance):
(JSC::WebAssemblyInstanceConstructor::createInstance):
* wasm/js/WebAssemblyInstanceConstructor.h:
* wasm/js/WebAssemblyModuleConstructor.cpp:
(JSC::constructJSWebAssemblyModule):
(JSC::WebAssemblyModuleConstructor::createModule):
* wasm/js/WebAssemblyModuleConstructor.h:

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