WebKit-https.git
7 months ago[iOS] Improve our file picker
cdumez@apple.com [Mon, 4 Mar 2019 20:20:59 +0000 (20:20 +0000)]
[iOS] Improve our file picker
https://bugs.webkit.org/show_bug.cgi?id=195284
<rdar://problem/45655856>

Reviewed by Tim Horton and Wenson Hsieh.

Source/WebCore:

Export UTIUtilities.h so that it can be used from WebKit2.

* WebCore.xcodeproj/project.pbxproj:

Source/WebKit:

Improve our file picker on iOS so that:
- Accepted file extensions specified in the HTML (e.g. <input type="file"> accept=".pdf">) are now
  properly reflected in the file picker. Previously, we only we only supported MIME types in the
  accept attribute that only Image / Video ones.
- If accepted types are specified in the HTML and not of them are Video or Image types, then bypass
  the UIDocumentMenuViewController and show the file picker directly (as if the user had tapped on
  "Browse..." on that menu). Other menu items such as "Take Photo or Video" and "Photo Library" do
  not make sense if the page only accepts PDF files for example.

Things that we should do but are not fixed in this patch:
- Stop using UIDocumentMenuViewController entirely since it was deprecated in favor of using
  UIDocumentPickerViewController directly.
- Add multiple selection support, which is supported both on the HTML side and in the
  UIDocumentPickerViewController API.

* UIProcess/ios/forms/WKFileUploadPanel.mm:
(arrayContainsUTIThatConformsTo):
(-[WKFileUploadPanel dealloc]):
(-[WKFileUploadPanel presentWithParameters:resultListener:]):
(UTIsForMIMETypes):
(-[WKFileUploadPanel _mediaTypesForPickerSourceType:]):
(-[WKFileUploadPanel _cameraButtonLabelAllowingPhoto:allowingVideo:]):
(-[WKFileUploadPanel _showDocumentPickerMenu]):

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

7 months agoImproper use of PLATFORM(TVOS) in PAL
conrad_shultz@apple.com [Mon, 4 Mar 2019 19:58:34 +0000 (19:58 +0000)]
Improper use of PLATFORM(TVOS) in PAL
https://bugs.webkit.org/show_bug.cgi?id=195215

Reviewed by Darin Adler.

There are a couple stray uses of PLATFORM(TVOS) in PAL. The correct usage is
PLATFORM(APPLETV).

* pal/spi/cocoa/NSKeyedArchiverSPI.h:
* pal/spi/cocoa/NSProgressSPI.h:

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

7 months agoREGRESSION: ( r240978-r240985 ) [ iOS Release ] Layout Test imported/w3c/web-platform...
achristensen@apple.com [Mon, 4 Mar 2019 19:54:21 +0000 (19:54 +0000)]
REGRESSION: ( r240978-r240985 ) [ iOS Release ] Layout Test imported/w3c/web-platform-tests/xhr/send-redirect-post-upload.htm is crashing
https://bugs.webkit.org/show_bug.cgi?id=194523

Reviewed by Ryosuke Niwa.

Attempt to work around a CFNetwork bug in the timing of tearing down tasks with upload streams.
See rdar://problem/28233746.

* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa):
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:needNewBodyStream:]):

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

7 months ago[ContentChangeObserver] Decouple mouseMoved event and the "is observing content chang...
zalan@apple.com [Mon, 4 Mar 2019 19:33:04 +0000 (19:33 +0000)]
[ContentChangeObserver] Decouple mouseMoved event and the "is observing content change" status.
https://bugs.webkit.org/show_bug.cgi?id=195286

Reviewed by Simon Fraser.

Now isObservingContentChanges returns true only when we are actively observing content change during timer firing and/or style recalculating.
This patch also renames a couple of functions to follow the didStart/didFinish pattern.

* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::domTimerExecuteDidStart):
(WebCore::ContentChangeObserver::domTimerExecuteDidFinish):
(WebCore::ContentChangeObserver::styleRecalcDidStart):
(WebCore::ContentChangeObserver::styleRecalcDidFinish):
(WebCore::ContentChangeObserver::mouseMovedDidStart):
(WebCore::ContentChangeObserver::mouseMovedDidFinish):
(WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc):
(WebCore::ContentChangeObserver::StyleChangeScope::StyleChangeScope):
(WebCore::ContentChangeObserver::MouseMovedScope::MouseMovedScope):
(WebCore::ContentChangeObserver::MouseMovedScope::~MouseMovedScope):
(WebCore::ContentChangeObserver::StyleRecalcScope::StyleRecalcScope):
(WebCore::ContentChangeObserver::StyleRecalcScope::~StyleRecalcScope):
(WebCore::ContentChangeObserver::DOMTimerScope::DOMTimerScope):
(WebCore::ContentChangeObserver::DOMTimerScope::~DOMTimerScope):
(WebCore::ContentChangeObserver::startObservingDOMTimerExecute): Deleted.
(WebCore::ContentChangeObserver::stopObservingDOMTimerExecute): Deleted.
(WebCore::ContentChangeObserver::startObservingStyleRecalc): Deleted.
(WebCore::ContentChangeObserver::stopObservingStyleRecalc): Deleted.
(WebCore::ContentChangeObserver::startObservingMouseMoved): Deleted.
(WebCore::ContentChangeObserver::stopObservingMouseMoved): Deleted.
(WebCore::ContentChangeObserver::setShouldObserveStyleRecalc): Deleted.
* page/ios/ContentChangeObserver.h:
(WebCore::ContentChangeObserver::setShouldObserveDOMTimerScheduling):
(WebCore::ContentChangeObserver::isObservingDOMTimerScheduling const):
(WebCore::ContentChangeObserver::isObservingStyleRecalc const):
(WebCore::ContentChangeObserver::isObservingContentChanges const):
(WebCore::ContentChangeObserver::startObservingDOMTimerScheduling): Deleted.
(WebCore::ContentChangeObserver::stopObservingDOMTimerScheduling): Deleted.
(WebCore::ContentChangeObserver::shouldObserveStyleRecalc const): Deleted.

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

7 months ago[JSC] Offer @makeTypeError instead of exposing @TypeError
ysuzuki@apple.com [Mon, 4 Mar 2019 18:56:22 +0000 (18:56 +0000)]
[JSC] Offer @makeTypeError instead of exposing @TypeError
https://bugs.webkit.org/show_bug.cgi?id=193858

Reviewed by Mark Lam.

Source/JavaScriptCore:

Instead of exposing @TypeError, we expose @makeTypeError function.
And we make TypeError and Error lazily-allocated objects in non JIT environment.
In JIT environment, only TypeError becomes lazily-allocated since WebAssembly errors
touch Error prototype anyway. But we can make them lazy in a subsequent patch.

* builtins/AsyncFromSyncIteratorPrototype.js:
* builtins/AsyncGeneratorPrototype.js:
(globalPrivate.asyncGeneratorEnqueue):
* builtins/BuiltinNames.h:
* builtins/PromiseOperations.js:
(globalPrivate.createResolvingFunctions.resolve):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::initializeErrorConstructor):
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::errorPrototype const):
(JSC::JSGlobalObject::errorStructure const):
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::globalFuncMakeTypeError):
* runtime/JSGlobalObjectFunctions.h:

Source/WebCore:

Use @makeTypeError instead.

* Modules/mediastream/RTCPeerConnection.js:
* Modules/mediastream/RTCPeerConnectionInternals.js:
* Modules/streams/ReadableByteStreamInternals.js:
(readableByteStreamControllerClose):
(readableByteStreamControllerPullInto):
* Modules/streams/ReadableStream.js:
(cancel):
(pipeTo):
* Modules/streams/ReadableStreamBYOBReader.js:
(cancel):
(read):
* Modules/streams/ReadableStreamDefaultReader.js:
(cancel):
(read):
* Modules/streams/ReadableStreamInternals.js:
(readableStreamReaderGenericRelease):
* Modules/streams/WritableStream.js:
(abort):
(close):
(write):
(getter.closed):
(getter.ready):

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

7 months ago[CoordinatedGraphics] The compositing loop is still running even after exiting AC...
commit-queue@webkit.org [Mon, 4 Mar 2019 18:06:18 +0000 (18:06 +0000)]
[CoordinatedGraphics] The compositing loop is still running even after exiting AC mode
https://bugs.webkit.org/show_bug.cgi?id=195270

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2019-03-04
Reviewed by Don Olmstead.

Suspend the threaded compositor when the painting is paused or layer flush disabled, and resume it again when
painting is resumed and layer flush enabled.

* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::suspend): Increment the suspend counter and mark the scene as inactive if it was suspended.
(WebKit::ThreadedCompositor::resume): Decrement the suspend counter and mark the scene as active if it's now resumed.
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
* WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
(WebKit::DrawingAreaCoordinatedGraphics::forceRepaint): Return early if layer tree state is frozen.
(WebKit::DrawingAreaCoordinatedGraphics::forceRepaintAsync): Ditto.
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
(WebKit::LayerTreeHost::setLayerFlushSchedulingEnabled): Call ThreadedCompositor::suspend()/resume().
(WebKit::LayerTreeHost::pauseRendering): Call ThreadedCompositor::suspend.
(WebKit::LayerTreeHost::resumeRendering): Call ThreadedCompositor::resume().

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

7 months agoPrepare to improve handling of conversion of float to strings
darin@apple.com [Mon, 4 Mar 2019 16:58:33 +0000 (16:58 +0000)]
Prepare to improve handling of conversion of float to strings
https://bugs.webkit.org/show_bug.cgi?id=195262

Reviewed by Daniel Bates.

Source/WTF:

* wtf/dtoa.cpp:
(WTF::truncateTrailingZeros): Renamed from
formatStringTruncatingTrailingZerosIfNeeded and removed the calls
to double_conversion::StringBuilder::Finalizer, since the caller
already does that.
(WTF::numberToFixedPrecisionString): Added an overload for float
and updated to use the new truncateTrailingZeros.
(WTF::numberToFixedWidthString): Added an overload for float.

* wtf/text/AtomicString.cpp:
(WTF::AtomicString::number): Added float overload. This is a
behavior change, but in all cases for the better. The old behavior
was to convert to double first and then do "shortest form"
conversion, and it's always better to just do that as float.
* wtf/text/AtomicString.h: Added float overload of AtomicString::number.

* wtf/text/StringBuilder.cpp:
(WTF::StringBuilder::appendFixedPrecisionNumber): Added float
overload.
(WTF::StringBuilder::appendShortestFormNumber): Renamed from
appendECMAScriptNumber and did the above.
(WTF::StringBuilder::appendFixedWidthNumber): Ditto.
* wtf/text/StringBuilder.h: Added overloads for float and
appendShortestFormNumber. The appendNumber and appendECMAScriptNumber
functions are now inlines in the header, since they are expressed
entirely in terms of the other functions.

* wtf/text/WTFString.cpp:
(WTF::String::numberToStringFixedPrecision): Added float overload.
Removed unnecessary explicit conversion to String.
(WTF::String::numberToStringShortest): Renamed from
numberToStringECMAScript and did the above.
(WTF::String::numberToStringFixedWidth): Ditto.

* wtf/text/WTFString.h: Added overloads for float and
numberToStringShortest. The number and numberToStringECMAScript
functions are now inlines in the header, since they are expressed
entirely in terms of the other functions.

LayoutTests:

* svg/dom/SVGAngle-expected.txt:
* svg/dom/SVGAngle.html:
* svg/dom/SVGLength-px-expected.txt:
* svg/dom/SVGLength-px-with-context-expected.txt:
* svg/dom/SVGLength-px-with-context.html:
* svg/dom/SVGLength-px.html:
Remove checks that depend on the precision and number of serialization.
The current tests depend on behavior that we'd like to change in the future and
some of them had already been updated since the behavior is different in different
web browsers. Tricky issue because of the mix of single and double precision in
the SVG engine and the JavaScript language, and straightforward to keep the tests
useful without this unnecessary dependency. Generally we check the units of the
result of valueAsString, and not the numeric result. Another idea would be to
check the numeric part of the result by converting it back to a number and
comparing it as a number rather than as a string.

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

7 months agoShare more code between overflow and frame scrolling nodes, fixing overflow scrollbar...
simon.fraser@apple.com [Mon, 4 Mar 2019 16:57:38 +0000 (16:57 +0000)]
Share more code between overflow and frame scrolling nodes, fixing overflow scrollbar display
https://bugs.webkit.org/show_bug.cgi?id=195258

Reviewed by Antti Koivisto.

This patch moves management of scrollbar layers and scrollbar painters ("NSScrollerImp") down to
ScrollingStateScrollingNode to be shared between frame and overflow nodes, allowing for
scrolling thread updates of overflow scrollbars. It also moves some scrolling tree-side code
to ScrollingTreeScrollingNodeDelegateMac to be shared between the "tree" nodes for overflow and frames.

Layers for scrollbars are given to scrolling state nodes via setNodeLayers() now, and
RenderLayerCompositor::updateScrollingNodeLayers() is added to provide a bottleneck to call that.
At some point AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange() should be relieved
of the responsibility of pushing scrollbar layers (but the scrolling state tree needs to hold
references to GraphicsLayers before that becomes safe).

The actual fix that allows overflow scrollbars to show is the change in
AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange() that calls scrollableArea.*ScrollbarLayerDidChange()
for all ScrollableAreas. This ensures that the CALayer is pushed onto the NSScrollerImp.

Source/WebCore:

* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange):
(WebCore::AsyncScrollingCoordinator::setNodeLayers):
(WebCore::AsyncScrollingCoordinator::setFrameScrollingNodeState):
(WebCore::AsyncScrollingCoordinator::setScrollingNodeScrollableAreaGeometry):
* page/scrolling/ScrollingCoordinator.h:
* page/scrolling/ScrollingStateFrameScrollingNode.cpp:
(WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
(WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged):
(WebCore::ScrollingStateFrameScrollingNode::setVerticalScrollbarLayer): Deleted.
(WebCore::ScrollingStateFrameScrollingNode::setHorizontalScrollbarLayer): Deleted.
(WebCore::ScrollingStateFrameScrollingNode::setScrollerImpsFromScrollbars): Deleted.
* page/scrolling/ScrollingStateFrameScrollingNode.h:
* page/scrolling/ScrollingStateScrollingNode.cpp:
(WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
(WebCore::ScrollingStateScrollingNode::setAllPropertiesChanged):
(WebCore::ScrollingStateScrollingNode::setHorizontalScrollbarLayer):
(WebCore::ScrollingStateScrollingNode::setVerticalScrollbarLayer):
(WebCore::ScrollingStateScrollingNode::setScrollerImpsFromScrollbars):
* page/scrolling/ScrollingStateScrollingNode.h:
(WebCore::ScrollingStateScrollingNode::horizontalScrollbarLayer const):
(WebCore::ScrollingStateScrollingNode::verticalScrollbarLayer const):
(WebCore::ScrollingStateScrollingNode::verticalScrollerImp const):
(WebCore::ScrollingStateScrollingNode::horizontalScrollerImp const):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::setOrClearLatchedNode):
(WebCore::ScrollingTree::handleWheelEvent):
* page/scrolling/mac/ScrollingStateScrollingNodeMac.mm: Renamed from Source/WebCore/page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm.
(WebCore::ScrollingStateScrollingNode::setScrollerImpsFromScrollbars):
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
(WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
(WebCore::ScrollingTreeFrameScrollingNodeMac::repositionRelatedLayers):
(WebCore::ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac): Deleted.
(WebCore::ScrollingTreeFrameScrollingNodeMac::releaseReferencesToScrollerImpsOnTheMainThread): Deleted.
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
(WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateBeforeChildren):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::handleWheelEvent):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionRelatedLayers):
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h:
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::~ScrollingTreeScrollingNodeDelegateMac):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::updateFromStateNode):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::updateScrollbarPainters):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::releaseReferencesToScrollerImpsOnTheMainThread):
* platform/ScrollbarThemeComposite.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
(WebCore::RenderLayerCompositor::updateScrollingNodeLayers):
(WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
* rendering/RenderLayerCompositor.h:

Source/WebKit:

* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
(ArgumentCoder<ScrollingStateScrollingNode>::encode):
(ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
(ArgumentCoder<ScrollingStateScrollingNode>::decode):
(ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
* SourcesCocoa.txt:
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
* UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
(WebKit::RemoteScrollingTree::createScrollingTreeNode):
* UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp:
(WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::commitStateBeforeChildren):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::repositionRelatedLayers):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::handleMouseEvent):
* UIProcess/RemoteLayerTree/mac/ScrollingTreeOverflowScrollingNodeRemoteMac.cpp: Copied from Source/WebKit/UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp.
(WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::create):
(WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::ScrollingTreeOverflowScrollingNodeRemoteMac):
(WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::~ScrollingTreeOverflowScrollingNodeRemoteMac):
(WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::commitStateBeforeChildren):
(WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::repositionRelatedLayers):
(WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::handleWheelEvent):
(WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::handleMouseEvent):
* WebKit.xcodeproj/project.pbxproj:

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

7 months agowebkit.org/b/195210 resolve by r242308, unskipping tests.
tsavell@apple.com [Mon, 4 Mar 2019 16:57:05 +0000 (16:57 +0000)]
webkit.org/b/195210 resolve by r242308, unskipping tests.
https://bugs.webkit.org/show_bug.cgi?id=195210

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

7 months agoRemove HEVC as a codec requiring hardware support.
jer.noble@apple.com [Mon, 4 Mar 2019 16:51:43 +0000 (16:51 +0000)]
Remove HEVC as a codec requiring hardware support.
https://bugs.webkit.org/show_bug.cgi?id=194960
<rdar://problem/47741432>

Reviewed by Eric Carlson.

* page/cocoa/SettingsBaseCocoa.mm:
(WebCore::SettingsBase::defaultMediaContentTypesRequiringHardwareSupport):

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

7 months ago[Apple Pay] Move WebPaymentCoordinatorProxy from Source/WebKit/UIProcess to Source...
aestes@apple.com [Mon, 4 Mar 2019 16:47:58 +0000 (16:47 +0000)]
[Apple Pay] Move WebPaymentCoordinatorProxy from Source/WebKit/UIProcess to Source/WebKit/Shared
https://bugs.webkit.org/show_bug.cgi?id=195080
<rdar://problem/48421558>

Reviewed by Antti Koivisto.

Source/WebKit:

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources.make:
* Shared/ApplePay/WebPaymentCoordinatorProxy.cpp: Renamed from Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp.
* Shared/ApplePay/WebPaymentCoordinatorProxy.h: Renamed from Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.h.
* Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in: Renamed from Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in.
* Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h: Renamed from Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h.
* Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: Renamed from Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm.
* Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm: Renamed from Source/WebKit/UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm.
* Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm: Renamed from Source/WebKit/UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm.
* Shared/mac/WebHitTestResultData.mm:
* SourcesCocoa.txt:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
* WebKit.xcodeproj/project.pbxproj:

Source/WTF:

* wtf/FeatureDefines.h:

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

7 months ago[iOS] Fullscreen "stay in page" option breaks video playback
jer.noble@apple.com [Mon, 4 Mar 2019 16:44:51 +0000 (16:44 +0000)]
[iOS] Fullscreen "stay in page" option breaks video playback
https://bugs.webkit.org/show_bug.cgi?id=195277
<rdar://problem/48537317>

Reviewed by Eric Carlson.

Source/WebCore:

Add a LOG entry when playback is rejected due to media playback suspension.

* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::playbackPermitted const):

Source/WebKit:

Make sure we resume media playback when the user chooses "stay in page" from the deceptive
website warning dialog.

* UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
(-[WKFullScreenViewController _showPhishingAlert]):

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

7 months ago[WPE] Enable web process sandbox
mcatanzaro@igalia.com [Mon, 4 Mar 2019 15:25:43 +0000 (15:25 +0000)]
[WPE] Enable web process sandbox
https://bugs.webkit.org/show_bug.cgi?id=195169

Reviewed by Daniel Bates.

.:

* Source/cmake/BubblewrapSandboxChecks.cmake: Added.
* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsWPE.cmake:

Source/WebKit:

* PlatformWPE.cmake:
* UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
(WebKit::bubblewrapSpawn):
* UIProcess/glib/WebProcessPoolGLib.cpp:
(WebKit::WebProcessPool::platformInitialize):

Tools:

* wpe/install-dependencies:
* wpe/jhbuild.modules:

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

7 months agoURLHelpers should use unorm2_quickCheck before converting to NFC
mcatanzaro@igalia.com [Mon, 4 Mar 2019 15:18:42 +0000 (15:18 +0000)]
URLHelpers should use unorm2_quickCheck before converting to NFC
https://bugs.webkit.org/show_bug.cgi?id=194272

Reviewed by Darin Adler.

If the string is already in normalization form C, don't try to normalize it.

* wtf/URLHelpers.cpp:
(WTF::URLHelpers::toNormalizationFormC):

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

7 months agoWebDriver: fix String not terminated with null caracter
commit-queue@webkit.org [Mon, 4 Mar 2019 14:30:46 +0000 (14:30 +0000)]
WebDriver: fix String not terminated with null caracter
https://bugs.webkit.org/show_bug.cgi?id=195274

Patch by Karl Leplat <karl.leplat_ext@softathome.com> on 2019-03-04
Reviewed by Carlos Garcia Campos.

This has been detected by an exception returned by the function
evaluateJavaScriptFunction with the message :
[native code]: JS ERROR SyntaxError: Unexpected keyword 'function'. Expected ')' to end a compound expression.
keyword 'function' has been initialized with a string that come from char array, not a null-terminated string.

* Session.cpp:
(WebDriver::Session::fullscreenWindow):
(WebDriver::Session::findElements):
(WebDriver::Session::isElementSelected):
(WebDriver::Session::isElementDisplayed):
(WebDriver::Session::getElementAttribute):
(WebDriver::Session::elementClear):

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

7 months ago[GTK][WPE] Wrong license header in WebKit{,WebExtension}Autocleanups.h
aperez@igalia.com [Mon, 4 Mar 2019 14:23:45 +0000 (14:23 +0000)]
[GTK][WPE] Wrong license header in WebKit{,WebExtension}Autocleanups.h
https://bugs.webkit.org/show_bug.cgi?id=195245

Reviewed by Carlos Garcia Campos.

Changed license headers to contain the LGPL, which is the correct one for the GTK
and WPE ports. The change was agreed by the contributors to the files involved.

* UIProcess/API/gtk/WebKitAutocleanups.h:
* UIProcess/API/wpe/WebKitAutocleanups.h:
* WebProcess/InjectedBundle/API/gtk/WebKitWebExtensionAutocleanups.h:
* WebProcess/InjectedBundle/API/wpe/WebKitWebExtensionAutocleanups.h:

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

7 months agoUnreviewed, rolling out r242045.
commit-queue@webkit.org [Mon, 4 Mar 2019 12:03:26 +0000 (12:03 +0000)]
Unreviewed, rolling out r242045.
https://bugs.webkit.org/show_bug.cgi?id=195273

WE not ready to enable PSON yet (Requested by KaL on #webkit).

Reverted changeset:

"[GTK] Enable PSON"
https://bugs.webkit.org/show_bug.cgi?id=194979
https://trac.webkit.org/changeset/242045

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

7 months ago[GLib] Returning G_TYPE_OBJECT from a constructor does not work
carlosgc@webkit.org [Mon, 4 Mar 2019 10:34:04 +0000 (10:34 +0000)]
[GLib] Returning G_TYPE_OBJECT from a constructor does not work
https://bugs.webkit.org/show_bug.cgi?id=195206

Reviewed by Žan Doberšek.

Source/JavaScriptCore:

We are freeing the newly created object before returning from the constructor.

* API/glib/JSCCallbackFunction.cpp:
(JSC::JSCCallbackFunction::construct):

Tools:

Add a new test case.

* TestWebKitAPI/Tests/JavaScriptCore/glib/TestJSC.cpp:
(testJSCClass):

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

7 months agoUnreviewed. Update POTFILES.in after r239627.
carlosgc@webkit.org [Mon, 4 Mar 2019 10:30:46 +0000 (10:30 +0000)]
Unreviewed. Update POTFILES.in after r239627.

* POTFILES.in:

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

7 months ago[CoordinatedGraphics] Unify DrawingArea classes
carlosgc@webkit.org [Mon, 4 Mar 2019 09:58:08 +0000 (09:58 +0000)]
[CoordinatedGraphics] Unify DrawingArea classes
https://bugs.webkit.org/show_bug.cgi?id=195167

Reviewed by Žan Doberšek.

Add DrawingAreaProxyCoordinatedGraphics and DrawingAreaCoordinatedGraphics.

* PlatformGTK.cmake:
* PlatformWPE.cmake:
* PlatformWin.cmake:
* Shared/DrawingAreaInfo.h:
* SourcesGTK.txt:
* SourcesWPE.txt:
* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::createDrawingAreaProxy):
(WebKit::PageClientImpl::viewSize):
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseRealize):
(webkitWebViewBaseUnrealize):
(webkitWebViewBaseDraw):
(webkitWebViewBaseSizeAllocate):
(webkitWebViewBaseDidRelaunchWebProcess):
(webkitWebViewBasePageClosed):
* UIProcess/API/wpe/PageClientImpl.cpp:
(WebKit::PageClientImpl::createDrawingAreaProxy):
* UIProcess/AcceleratedDrawingAreaProxy.cpp: Removed.
* UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp: Added.
(WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingAreaProxyCoordinatedGraphics):
(WebKit::DrawingAreaProxyCoordinatedGraphics::~DrawingAreaProxyCoordinatedGraphics):
(WebKit::DrawingAreaProxyCoordinatedGraphics::paint):
(WebKit::DrawingAreaProxyCoordinatedGraphics::sizeDidChange):
(WebKit::DrawingAreaProxyCoordinatedGraphics::deviceScaleFactorDidChange):
(WebKit::DrawingAreaProxyCoordinatedGraphics::waitForBackingStoreUpdateOnNextPaint):
(WebKit::DrawingAreaProxyCoordinatedGraphics::setBackingStoreIsDiscardable):
(WebKit::DrawingAreaProxyCoordinatedGraphics::update):
(WebKit::DrawingAreaProxyCoordinatedGraphics::didUpdateBackingStoreState):
(WebKit::DrawingAreaProxyCoordinatedGraphics::enterAcceleratedCompositingMode):
(WebKit::DrawingAreaProxyCoordinatedGraphics::exitAcceleratedCompositingMode):
(WebKit::DrawingAreaProxyCoordinatedGraphics::updateAcceleratedCompositingMode):
(WebKit::DrawingAreaProxyCoordinatedGraphics::incorporateUpdate):
(WebKit::DrawingAreaProxyCoordinatedGraphics::alwaysUseCompositing const):
(WebKit::DrawingAreaProxyCoordinatedGraphics::backingStoreStateDidChange):
(WebKit::DrawingAreaProxyCoordinatedGraphics::sendUpdateBackingStoreState):
(WebKit::DrawingAreaProxyCoordinatedGraphics::waitForAndDispatchDidUpdateBackingStoreState):
(WebKit::DrawingAreaProxyCoordinatedGraphics::discardBackingStoreSoon):
(WebKit::DrawingAreaProxyCoordinatedGraphics::discardBackingStore):
(WebKit::DrawingAreaProxyCoordinatedGraphics::setNativeSurfaceHandleForCompositing):
(WebKit::DrawingAreaProxyCoordinatedGraphics::destroyNativeSurfaceHandleForCompositing):
(WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::DrawingMonitor):
(WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::~DrawingMonitor):
(WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::webViewDrawCallback):
(WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::start):
(WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::stop):
(WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::didDraw):
(WebKit::DrawingAreaProxyCoordinatedGraphics::dispatchAfterEnsuringDrawing):
* UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h: Renamed from Source/WebKit/UIProcess/AcceleratedDrawingAreaProxy.h.
* UIProcess/DrawingAreaProxyImpl.cpp: Removed.
* UIProcess/DrawingAreaProxyImpl.h: Removed.
* UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
(WebKit::AcceleratedBackingStoreX11::update):
* UIProcess/win/PageClientImpl.cpp:
(WebKit::PageClientImpl::createDrawingAreaProxy):
* UIProcess/win/WebView.cpp:
(WebKit::WebView::paint):
* WebProcess/WebPage/AcceleratedDrawingArea.cpp: Removed.
* WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp: Added.
(WebKit::DrawingAreaCoordinatedGraphics::DrawingAreaCoordinatedGraphics):
(WebKit::DrawingAreaCoordinatedGraphics::~DrawingAreaCoordinatedGraphics):
(WebKit::DrawingAreaCoordinatedGraphics::setNeedsDisplay):
(WebKit::DrawingAreaCoordinatedGraphics::setNeedsDisplayInRect):
(WebKit::DrawingAreaCoordinatedGraphics::scroll):
(WebKit::DrawingAreaCoordinatedGraphics::forceRepaint):
(WebKit::DrawingAreaCoordinatedGraphics::forceRepaintAsync):
(WebKit::DrawingAreaCoordinatedGraphics::setLayerTreeStateIsFrozen):
(WebKit::DrawingAreaCoordinatedGraphics::updatePreferences):
(WebKit::DrawingAreaCoordinatedGraphics::mainFrameContentSizeChanged):
(WebKit::DrawingAreaCoordinatedGraphics::deviceOrPageScaleFactorChanged):
(WebKit::DrawingAreaCoordinatedGraphics::didChangeViewportAttributes):
(WebKit::DrawingAreaCoordinatedGraphics::graphicsLayerFactory):
(WebKit::DrawingAreaCoordinatedGraphics::setRootCompositingLayer):
(WebKit::DrawingAreaCoordinatedGraphics::scheduleCompositingLayerFlush):
(WebKit::DrawingAreaCoordinatedGraphics::layerHostDidFlushLayers):
(WebKit::DrawingAreaCoordinatedGraphics::createDisplayRefreshMonitor):
(WebKit::DrawingAreaCoordinatedGraphics::setNativeSurfaceHandleForCompositing):
(WebKit::DrawingAreaCoordinatedGraphics::destroyNativeSurfaceHandleForCompositing):
(WebKit::DrawingAreaCoordinatedGraphics::activityStateDidChange):
(WebKit::DrawingAreaCoordinatedGraphics::attachViewOverlayGraphicsLayer):
(WebKit::DrawingAreaCoordinatedGraphics::updateBackingStoreState):
(WebKit::DrawingAreaCoordinatedGraphics::didUpdate):
(WebKit::DrawingAreaCoordinatedGraphics::sendDidUpdateBackingStoreState):
(WebKit::DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingModeSoon):
(WebKit::DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingModeNow):
(WebKit::DrawingAreaCoordinatedGraphics::discardPreviousLayerTreeHost):
(WebKit::DrawingAreaCoordinatedGraphics::suspendPainting):
(WebKit::DrawingAreaCoordinatedGraphics::resumePainting):
(WebKit::DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode):
(WebKit::DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingMode):
(WebKit::DrawingAreaCoordinatedGraphics::scheduleDisplay):
(WebKit::DrawingAreaCoordinatedGraphics::displayTimerFired):
(WebKit::DrawingAreaCoordinatedGraphics::display):
(WebKit::shouldPaintBoundsRect):
* WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h: Renamed from Source/WebKit/WebProcess/WebPage/AcceleratedDrawingArea.h.
* WebProcess/WebPage/DrawingArea.cpp:
(WebKit::DrawingArea::create):
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::layerFlushThrottlingIsActive const):
* WebProcess/WebPage/DrawingAreaImpl.cpp: Removed.
* WebProcess/WebPage/DrawingAreaImpl.h: Removed.

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

7 months ago[WPE] Inline wl_array_for_each to workaround C++ compatibility issue
cturner@igalia.com [Mon, 4 Mar 2019 08:32:18 +0000 (08:32 +0000)]
[WPE] Inline wl_array_for_each to workaround C++ compatibility issue
https://bugs.webkit.org/show_bug.cgi?id=194898

Reviewed by Žan Doberšek.

* wpe/backends/WindowViewBackend.cpp: wl_array_for_each relies on
a GCC extension that permits arithmetic on void* pointer. Inline
the macro until this issue is fixed upstream.

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

7 months agoFix typo in previous gardening commit
csaavedra@igalia.com [Mon, 4 Mar 2019 08:20:06 +0000 (08:20 +0000)]
Fix typo in previous gardening commit

Unreviewed.
* platform/wpe/TestExpectations:

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

7 months ago[WPE][EME] Mark two flaky EME tests
csaavedra@igalia.com [Mon, 4 Mar 2019 08:18:59 +0000 (08:18 +0000)]
[WPE][EME] Mark two flaky EME tests

Unreviewed gardening.
* platform/wpe/TestExpectations:

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

7 months agoFix the build.
timothy_horton@apple.com [Mon, 4 Mar 2019 08:07:54 +0000 (08:07 +0000)]
Fix the build.

* dom/Document.h:

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

7 months ago[ContentChangeObserver] Content observation should be limited to the current document.
zalan@apple.com [Mon, 4 Mar 2019 06:05:44 +0000 (06:05 +0000)]
[ContentChangeObserver] Content observation should be limited to the current document.
https://bugs.webkit.org/show_bug.cgi?id=195256
<rdar://problem/48544402>

Source/WebCore:

Move ContentChangeObserver from Page to Document.
It limits content observation to the target node's owner document.

Reviewed by Simon Fraser.

* dom/Document.cpp:
(WebCore::m_contentChangeObserver):
(WebCore::Document::updateStyleIfNeeded):
(WebCore::Document::willDetachPage):
(WebCore::Document::platformSuspendOrStopActiveDOMObjects):
(WebCore::m_undoManager): Deleted.
* dom/Document.h:
(WebCore::Document::contentChangeObserver):
* page/DOMTimer.cpp:
(WebCore::DOMTimer::install):
(WebCore::DOMTimer::removeById):
(WebCore::DOMTimer::fired):
* page/Frame.cpp:
(WebCore::Frame::willDetachPage):
* page/Page.cpp:
(WebCore::Page::Page):
* page/Page.h:
(WebCore::Page::pointerLockController const):
(WebCore::Page::contentChangeObserver): Deleted.
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::ContentChangeObserver):
(WebCore::ContentChangeObserver::didInstallDOMTimer):
(WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
(WebCore::ContentChangeObserver::stopObservingStyleRecalc):
(WebCore::ContentChangeObserver::clearTimersAndReportContentChange):
(WebCore::ContentChangeObserver::startObservingMouseMoved):
(WebCore::ContentChangeObserver::hasDeterminateState const):
(WebCore::ContentChangeObserver::adjustObservedState):
(WebCore::ContentChangeObserver::notifyContentChangeIfNeeded):
(WebCore::ContentChangeObserver::StyleChangeScope::StyleChangeScope):
(WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
(WebCore::ContentChangeObserver::MouseMovedScope::MouseMovedScope):
(WebCore::ContentChangeObserver::MouseMovedScope::~MouseMovedScope):
(WebCore::ContentChangeObserver::StyleRecalcScope::StyleRecalcScope):
(WebCore::ContentChangeObserver::StyleRecalcScope::~StyleRecalcScope):
(WebCore::ContentChangeObserver::DOMTimerScope::DOMTimerScope):
(WebCore::ContentChangeObserver::DOMTimerScope::~DOMTimerScope):
(WebCore::hasPendingStyleRecalc): Deleted.
* page/ios/ContentChangeObserver.h:
* page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::mouseMoved):
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateElementRenderer):

Source/WebKit:

Reviewed by Simon Fraser.

* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleSyntheticClick):
(WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
(WebKit::WebPage::completeSyntheticClick):
(WebKit::WebPage::handleTap):
(WebKit::WebPage::handleTwoFingerTapAtPoint):
(WebKit::WebPage::commitPotentialTap):

Source/WebKitLegacy/ios:

Reviewed by Simon Fraser.

* WebCoreSupport/WebChromeClientIOS.mm:
(WebChromeClientIOS::observedContentChange):

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

7 months agoRid the world of WK_API_ENABLED
timothy_horton@apple.com [Mon, 4 Mar 2019 05:12:47 +0000 (05:12 +0000)]
Rid the world of WK_API_ENABLED
https://bugs.webkit.org/show_bug.cgi?id=195263

Reviewed by Dan Bernstein.

List of changed files elided because it's useless.

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

7 months agoUnreviewed follow-up to r242292.
ross.kirsling@sony.com [Mon, 4 Mar 2019 05:09:31 +0000 (05:09 +0000)]
Unreviewed follow-up to r242292.

By Darin's suggestion, adopt an approach that uses EXPECT_STREQ without scattering utf8().data() everywhere.

* TestWebKitAPI/Tests/WebKit/EnvironmentUtilitiesTest.cpp:
(TestWebKitAPI::testStrip): Renamed from strip.
(TestWebKitAPI::TEST):

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

7 months agoAdd a WebViewDidMoveToWindowObserver for WKWebView
jiewen_tan@apple.com [Mon, 4 Mar 2019 04:38:26 +0000 (04:38 +0000)]
Add a WebViewDidMoveToWindowObserver for WKWebView
https://bugs.webkit.org/show_bug.cgi?id=195223
<rdar://problem/48520161>

Reviewed by Darin Adler.

The load optimizer would only allow itself to optimize loads whenever the web view
who owns the page is (visible && focused), otherwises it will wait until the web view
becomes (visible && focused). Therefore, we need a way to notify the load optimizer
changes of statuses.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView didMoveToWindow]):
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::viewDidMoveToWindow):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::addWebViewDidMoveToWindowObserver):
(WebKit::WebPageProxy::removeWebViewDidMoveToWindowObserver):
(WebKit::WebPageProxy::webViewDidMoveToWindow):
* UIProcess/WebPageProxy.h:
* UIProcess/WebViewDidMoveToWindowObserver.h: Added.
* WebKit.xcodeproj/project.pbxproj:

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

7 months agoShare more code for updating the state of frame scrolling nodes
simon.fraser@apple.com [Mon, 4 Mar 2019 00:36:57 +0000 (00:36 +0000)]
Share more code for updating the state of frame scrolling nodes
https://bugs.webkit.org/show_bug.cgi?id=195254

Reviewed by Antti Koivisto.
Source/WebCore:

Responsibility for updating state on ScrollingStateFrameScrolling nodes was split between
AsyncScrollingCoordinator::frameViewLayoutUpdated(), which is called post-layout, and
RenderLayerCompositor. This patch gives that responsibility entirely to RenderLayerCompositor,
ensuring that we update frame scrolling nodes at the same time as the rest of the scrolling
state tree.

We also share code between updating ScrollingStateFrameScrollingNodes and
ScrollingStateOverflowScrollingNodews, since both can be updated from a ScrollableArea.
Some minor cleanup of ScrollableArea is doing to help. For the first time, we're pushing
ScrollableAreaParameters for overflow scrolling nodes, allowing rubber-banding to work
on macOS.

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::AsyncScrollingCoordinator::setRectRelativeToParentNode):
(WebCore::AsyncScrollingCoordinator::setFrameScrollingNodeState):
(WebCore::AsyncScrollingCoordinator::setScrollingNodeScrollableAreaGeometry):
(WebCore::AsyncScrollingCoordinator::setViewportConstraintedNodeConstraints):
(WebCore::AsyncScrollingCoordinator::setScrollingNodeGeometry): Deleted.
(WebCore::AsyncScrollingCoordinator::setViewportConstraintedNodeGeometry): Deleted.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::setRectRelativeToParentNode):
(WebCore::ScrollingCoordinator::setScrollingNodeScrollableAreaGeometry):
(WebCore::ScrollingCoordinator::setFrameScrollingNodeState):
(WebCore::ScrollingCoordinator::setViewportConstraintedNodeConstraints):
(WebCore::ScrollingCoordinator::setScrollingNodeGeometry): Deleted.
(WebCore::ScrollingCoordinator::setViewportConstraintedNodeGeometry): Deleted.
* platform/ScrollView.h:
(WebCore::ScrollView::horizontalScrollbarMode const): Deleted.
(WebCore::ScrollView::verticalScrollbarMode const): Deleted.
* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::reachableTotalContentsSize const):
* platform/ScrollableArea.h:
(WebCore::ScrollableArea::horizontalScrollbarMode const):
(WebCore::ScrollableArea::verticalScrollbarMode const):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::overhangAmount const):
(WebCore::RenderLayer::reachableTotalContentsSize const):
(WebCore::RenderLayer::scrollableContentsSize const): Deleted.
* rendering/RenderLayer.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingLayers):
(WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
(WebCore::RenderLayerCompositor::updateScrollingNodeForViewportConstrainedRole):
(WebCore::RenderLayerCompositor::rootParentRelativeScrollableRect const):
(WebCore::RenderLayerCompositor::parentRelativeScrollableRect const):
(WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
(WebCore::RenderLayerCompositor::updateScrollingNodeForFrameHostingRole):
(WebCore::RenderLayerCompositor::computeFrameScrollingGeometry const): Deleted.
(WebCore::RenderLayerCompositor::computeFrameHostingGeometry const): Deleted.
(WebCore::RenderLayerCompositor::computeOverflowScrollingGeometry const): Deleted.
* rendering/RenderLayerCompositor.h:

LayoutTests:

New baselines. Overflow nodes get some state from ScrollableAreaParameters now, and
frame nodes get the current scroll position (which is good, since they already have
the new layout viewport).

* fast/scrolling/ios/change-scrollability-on-content-resize-expected.txt:
* fast/scrolling/ios/change-scrollability-on-content-resize-nested-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-gain-scrolling-ancestor-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-in-fixed-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-lose-scrolling-ancestor-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/gain-scrolling-node-parent-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/lose-scrolling-node-parent-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/overflow-in-fixed-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/remove-scrolling-role-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/reparent-across-compositing-layers-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/reparent-with-layer-removal-expected.txt:
* scrollingcoordinator/scrolling-tree/gain-scrolling-node-parent-expected.txt:
* scrollingcoordinator/scrolling-tree/lose-scrolling-node-parent-expected.txt:
* scrollingcoordinator/scrolling-tree/overflow-in-fixed-expected.txt:
* scrollingcoordinator/scrolling-tree/remove-scrolling-role-expected.txt:
* scrollingcoordinator/scrolling-tree/reparent-across-compositing-layers-expected.txt:
* scrollingcoordinator/scrolling-tree/reparent-with-layer-removal-expected.txt:
* tiled-drawing/scrolling/clamp-out-of-bounds-scrolls-expected.txt:
* tiled-drawing/scrolling/fixed/absolute-inside-fixed-expected.txt:
* tiled-drawing/scrolling/fixed/absolute-inside-out-of-view-fixed-expected.txt:
* tiled-drawing/scrolling/fixed/fixed-in-overflow-expected.txt:
* tiled-drawing/scrolling/fixed/four-bars-expected.txt:
* tiled-drawing/scrolling/fixed/four-bars-with-header-and-footer-expected.txt:
* tiled-drawing/scrolling/fixed/four-bars.html:
* tiled-drawing/scrolling/fixed/nested-fixed-expected.txt:
* tiled-drawing/scrolling/fixed/percentage-inside-fixed-expected.txt:
* tiled-drawing/scrolling/sticky/sticky-horizontal-expected.txt:
* tiled-drawing/scrolling/sticky/sticky-vertical-expected.txt:

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

7 months ago[Apple Pay] Untangle WebPageProxy and WebPaymentCoordinatorProxy
aestes@apple.com [Sun, 3 Mar 2019 22:16:35 +0000 (22:16 +0000)]
[Apple Pay] Untangle WebPageProxy and WebPaymentCoordinatorProxy
https://bugs.webkit.org/show_bug.cgi?id=195219
<rdar://problem/48518082>

Reviewed by Darin Adler.

Rather than having WebPaymentCoordinatorProxy know about WebPageProxy, give
WebPaymentCoordinatorProxy a client interface that WebPageProxy conforms to.

In a follow-on patch, WebPaymentCoordinatorProxy will have a non-WebPageProxy client.

* UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
(WebKit::WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy): Replaced use of
m_webPageProxy with m_client.
(WebKit::WebPaymentCoordinatorProxy::~WebPaymentCoordinatorProxy): Ditto.
(WebKit::WebPaymentCoordinatorProxy::messageSenderConnection const): Implemented
IPC::MessageSender via m_client.
(WebKit::WebPaymentCoordinatorProxy::messageSenderDestinationID const): Ditto.
(WebKit::WebPaymentCoordinatorProxy::canMakePaymentsWithActiveCard): Replaced use of
m_webPageProxy with m_client.
(WebKit::WebPaymentCoordinatorProxy::openPaymentSetup): Ditto.
(WebKit::WebPaymentCoordinatorProxy::didCancelPaymentSession): Called our own
MessageSender::send rather than going through m_webPageProxy.
(WebKit::WebPaymentCoordinatorProxy::validateMerchant): Ditto.
(WebKit::WebPaymentCoordinatorProxy::didAuthorizePayment): Ditto.
(WebKit::WebPaymentCoordinatorProxy::didSelectShippingMethod): Ditto.
(WebKit::WebPaymentCoordinatorProxy::didSelectShippingContact): Ditto.
(WebKit::WebPaymentCoordinatorProxy::didSelectPaymentMethod): Ditto.
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: Defined the Client abstract class and
changed m_webPageProxy to m_client.
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard): Replaced use of
m_webPageProxy with m_client.
(WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest): Renamed from toPKPaymentRequest.
(WebKit::toPKPaymentRequest): Renamed to WebPaymentCoordinatorProxy::platformPaymentRequest.
* UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
(WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): Replaced use of m_webPageProxy
with m_client.
* UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
(WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): Ditto.
* UIProcess/AuxiliaryProcessProxy.h:
(WebKit::AuxiliaryProcessProxy::messageReceiverMap): Added.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::paymentCoordinatorConnection): Implemented WebPaymentCoordinatorProxy::Client.
(WebKit::WebPageProxy::paymentCoordinatorMessageReceiver): Ditto.
(WebKit::WebPageProxy::paymentCoordinatorSourceApplicationBundleIdentifier): Ditto.
(WebKit::WebPageProxy::paymentCoordinatorSourceApplicationSecondaryIdentifier): Ditto.
(WebKit::WebPageProxy::paymentCoordinatorDestinationID): Ditto.
* UIProcess/WebPageProxy.h: Made WebPageProxy derive from WebPaymentCoordinatorProxy::Client.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::paymentCoordinatorPresentingViewController): Implemented WebPaymentCoordinatorProxy::Client.
(WebKit::WebPageProxy::paymentCoordinatorCTDataConnectionServiceType): Ditto.
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::paymentCoordinatorPresentingWindow): Ditto.
* WebKit.xcodeproj/project.pbxproj:

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

7 months ago[GTK] Unreviewed test gardening
dpino@igalia.com [Sun, 3 Mar 2019 22:08:29 +0000 (22:08 +0000)]
[GTK] Unreviewed test gardening
https://bugs.webkit.org/show_bug.cgi?id=195261

Unreviewed test gardening.

* platform/gtk/TestExpectations:

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

7 months agoRetire legacy dtoa function and DecimalNumber class
darin@apple.com [Sun, 3 Mar 2019 20:43:01 +0000 (20:43 +0000)]
Retire legacy dtoa function and DecimalNumber class
https://bugs.webkit.org/show_bug.cgi?id=195253

Reviewed by Daniel Bates.

LayoutTests/imported/w3c:

* web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-iteration-composite-operation-expected.txt:
Rebaseline still-failing part of this test that dumps super-small numbers that are formatted
differently by the new code (exponential style).

Source/JavaScriptCore:

* runtime/NumberPrototype.cpp:
(JSC::numberProtoFuncToExponential): Removed dependency on NumberToStringBufferLength,
using NumberToStringBuffer instead. Also tweaked style of implementation a bit.

Source/WebCore:

* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::formatNumberValue const): Use makeString instead
of DecimalNumber. Also changed return type to String and use StringView and
removed special handling of literals.
(WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText const): Removed an
unnecessary use of StringBuilder.

* css/CSSPrimitiveValue.h: Updated for changes to formatNumberValue.

Source/WTF:

* WTF.xcodeproj/project.pbxproj: Removed DecimalNumber.cpp/h.
* wtf/CMakeLists.txt: Ditto.

* wtf/DecimalNumber.cpp: Removed.
* wtf/DecimalNumber.h: Removed.

* wtf/JSONValues.cpp:
(WTF::JSONImpl::Value::writeJSON const): Use
StringBuilder::appendECMAScriptNumber instead of custom logic
using the DecimalNumber class.

* wtf/dtoa.cpp:
(WTF::storeInc): Deleted.
(WTF::BigInt): Deleted.
(WTF::multadd): Deleted.
(WTF::hi0bits): Deleted.
(WTF::lo0bits): Deleted.
(WTF::i2b): Deleted.
(WTF::mult): Deleted.
(WTF::P5Node::P5Node): Deleted.
(WTF::pow5mult): Deleted.
(WTF::lshift): Deleted.
(WTF::cmp): Deleted.
(WTF::diff): Deleted.
(WTF::d2b): Deleted.
(WTF::quorem): Deleted.
(WTF::dtoa): Deleted.

* wtf/dtoa.h: Removed DtoaBuffer, dtoa, and NumberToStringBufferLength.

LayoutTests:

* fast/css/large-value-csstext-expected.txt:
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-volume-styles-expected.txt:
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-volume-styles.html:
Updated expected value to expect exponential syntax for super-small numbers that are formatted
differently by the new code.

* platform/ios/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-expected.txt:
* platform/ios/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-expected.txt:
* platform/ios/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-expected.txt:
* platform/mac/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-expected.txt:
* platform/mac/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-expected.txt:
* platform/mac/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-expected.txt:
Rebaseline still-failing parts of these tests that dump super-small numbers that are formatted
differently by the new code. Still probably needs to be done for 4 other platforms.

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

7 months agoUnreviewed, remove accidentally-committed URLHelpers.cpp test
mcatanzaro@igalia.com [Sun, 3 Mar 2019 19:11:25 +0000 (19:11 +0000)]
Unreviewed, remove accidentally-committed URLHelpers.cpp test

This test isn't built by any port and was committed in r240962 by mistake. See bug #174816
and bug #194272 for details.

* TestWebKitAPI/Tests/WTF/URLHelpers.cpp: Removed.

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

7 months ago[SOUP] Cleanups in SoupNetworkSession
mcatanzaro@igalia.com [Sun, 3 Mar 2019 17:51:40 +0000 (17:51 +0000)]
[SOUP] Cleanups in SoupNetworkSession
https://bugs.webkit.org/show_bug.cgi?id=195247

Reviewed by Daniel Bates.

This renames clientCertificates to allowedCertificates, since they are not client
certificates at all, but server certificates. It also adds a using statement to avoid
repeating the long type of the map, and avoids an unnecessary copy.

* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::allowedCertificates):
(WebCore::SoupNetworkSession::checkTLSErrors):
(WebCore::SoupNetworkSession::allowSpecificHTTPSCertificateForHost):
(WebCore::clientCertificates): Deleted.

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

7 months ago-Wformat error in SharedBuffer::tryCreateArrayBuffer
mcatanzaro@igalia.com [Sun, 3 Mar 2019 16:45:38 +0000 (16:45 +0000)]
-Wformat error in SharedBuffer::tryCreateArrayBuffer
https://bugs.webkit.org/show_bug.cgi?id=195004

Reviewed by Darin Adler.

Seems C++ has no format specifier appropriate for printing the result of sizeof. We should
just not try to print it. Anyway, that's easy in this case, because sizeof(char) is
guaranteed to be 1. This code was an attempt to be pedantic to account for mythical systems
with char larger than one byte, but perhaps it didn't realize sizeof always returns
multiples of char and so sizeof(char) is always one even on such mythical systems.

Note the sizeof(char) use two lines up is left since it's not clear that switching it to 1
would actually be more readable.

* platform/SharedBuffer.cpp:
(WebCore::SharedBuffer::tryCreateArrayBuffer const):

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

7 months agoRemove some more unused 32-bit code
timothy_horton@apple.com [Sun, 3 Mar 2019 10:35:46 +0000 (10:35 +0000)]
Remove some more unused 32-bit code
https://bugs.webkit.org/show_bug.cgi?id=195255

Reviewed by Darin Adler.

Source/WebCore:

* platform/gamepad/cocoa/GameControllerGamepad.h:
* platform/gamepad/cocoa/GameControllerGamepad.mm:
* platform/gamepad/cocoa/GameControllerGamepadProvider.h:
* platform/gamepad/cocoa/GameControllerGamepadProvider.mm:
* platform/graphics/cocoa/FontCascadeCocoa.mm:
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::globalPointForEvent):
(WebCore::pointForEvent):
(WebCore::mouseButtonForEvent):
(WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::servicesRolloverButtonCell const):
(WebCore::RenderThemeMac::paintImageControlsButton):
(WebCore::RenderThemeMac::imageControlsButtonSize const):
(WebCore::RenderThemeMac::imageControlsButtonPositionOffset const):

Source/WebCore/PAL:

* PAL.xcodeproj/project.pbxproj:
* pal/PlatformMac.cmake:
* pal/spi/cocoa/IOKitSPI.h:
* pal/spi/mac/QuickDrawSPI.h: Removed.

Source/WebKit:

* Platform/Module.cpp:
(WebKit::Module::Module):
* Platform/Module.h:
* Platform/cf/ModuleCF.cpp:
(WebKit::Module::unload):
(WebKit::Module::bundleResourceMap): Deleted.
* PluginProcess/mac/PluginProcessMac.mm:
(WebKit::initializeShim):
(WebKit::PluginProcess::platformInitializeProcess):
(WebKit::shouldCallRealDebugger): Deleted.
(WebKit::isWindowActive): Deleted.
(WebKit::getCurrentEventButtonState): Deleted.
(WebKit::carbonWindowShown): Deleted.
(WebKit::carbonWindowHidden): Deleted.
(WebKit::openCFURLRef): Deleted.
(WebKit::isMallocTinyMemoryTag): Deleted.
(WebKit::shouldMapMemoryExecutable): Deleted.
* PluginProcess/mac/PluginProcessShim.h:
* PluginProcess/mac/PluginProcessShim.mm:
(WebKit::shimDebugger): Deleted.
(WebKit::shimGetCurrentEventButtonState): Deleted.
(WebKit::shimIsWindowActive): Deleted.
(WebKit::shimModalDialog): Deleted.
(WebKit::shimAlert): Deleted.
(WebKit::shimShowWindow): Deleted.
(WebKit::shimHideWindow): Deleted.
(WebKit::shimLSOpenCFURLRef): Deleted.
(WebKit::shimMachVMMap): Deleted.
* Shared/API/Cocoa/WKFoundation.h:
* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
(WebKit::XPCServiceMain):
* Shared/Plugins/Netscape/NetscapePluginModule.cpp:
(WebKit::NetscapePluginModule::tryLoad):
* Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
(WebKit::getPluginArchitecture):
(WebKit::NetscapePluginModule::determineQuirks):
* Shared/Plugins/PluginQuirks.h:
* Shared/cf/ArgumentCodersCF.cpp:
(IPC::sizeForNumberType):
* Shared/mac/WebEventFactory.mm:
(WebKit::mouseButtonForEvent):
(WebKit::globalPointForEvent):
(WebKit::pointForEvent):
(WebKit::WebEventFactory::createWebMouseEvent):
* UIProcess/API/C/mac/WKPagePrivateMac.h:
* UIProcess/API/C/mac/WKPagePrivateMac.mm:
(WKPageLoadFileReturningNavigation):
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::pressureChangeWithEvent):
* UIProcess/Gamepad/cocoa/UIGamepadProviderCocoa.mm:
(WebKit::UIGamepadProvider::platformSetDefaultGamepadProvider):
* UIProcess/mac/ServicesController.mm:
(WebKit::ServicesController::ServicesController):
* UIProcess/mac/WebContextMenuProxyMac.mm:
(WebKit::WebContextMenuProxyMac::setupServicesMenu):
* WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
(WebKit::NPN_GetValue):
* WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
(WebKit::NetscapePlugin::NetscapePlugin):
* WebProcess/Plugins/Netscape/NetscapePlugin.h:
(WebKit::NetscapePlugin::isWindowActive const): Deleted.
* WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
(WebKit::NetscapePlugin::setDrawingModel):
(WebKit::NetscapePlugin::setEventModel):
(WebKit::NetscapePlugin::platformPostInitialize):
(WebKit::NetscapePlugin::platformDestroy):
(WebKit::NetscapePlugin::platformGeometryDidChange):
(WebKit::NetscapePlugin::platformPaint):
(WebKit::NetscapePlugin::platformHandleMouseEvent):
(WebKit::NetscapePlugin::platformHandleWheelEvent):
(WebKit::NetscapePlugin::platformHandleMouseEnterEvent):
(WebKit::NetscapePlugin::platformHandleMouseLeaveEvent):
(WebKit::NetscapePlugin::platformHandleKeyboardEvent):
(WebKit::NetscapePlugin::platformSetFocus):
(WebKit::NetscapePlugin::windowFocusChanged):
(WebKit::NetscapePlugin::windowAndViewFramesChanged):
(WebKit::NetscapePlugin::sendComplexTextInput):
(): Deleted.
(WebKit::windowMap): Deleted.
(WebKit::NetscapePlugin::netscapePluginFromWindow): Deleted.
(WebKit::NetscapePlugin::windowRef const): Deleted.
(WebKit::NetscapePlugin::updateFakeWindowBounds): Deleted.
(WebKit::NetscapePlugin::buttonState): Deleted.
(WebKit::initializeEventRecord): Deleted.
(WebKit::anyMouseButtonIsDown): Deleted.
(WebKit::rightMouseButtonIsDown): Deleted.
(WebKit::modifiersForEvent): Deleted.
(WebKit::convertStringToKeyCodes): Deleted.
(WebKit::scriptCodeFromCurrentKeyboardInputSource): Deleted.
(WebKit::NetscapePlugin::nullEventTimerFired): Deleted.

Source/WebKitLegacy/mac:

* Plugins/WebNetscapePluginEventHandler.mm:
(WebNetscapePluginEventHandler::create):
* Plugins/WebNetscapePluginView.h:
* Plugins/WebNetscapePluginView.mm:
(-[WebNetscapePluginView saveAndSetNewPortStateForUpdate:]):
(-[WebNetscapePluginView restorePortState:]):
(-[WebNetscapePluginView sendEvent:isDrawRect:]):
(-[WebNetscapePluginView isNewWindowEqualToOldWindow]):
(-[WebNetscapePluginView updateAndSetWindow]):
(-[WebNetscapePluginView setWindowIfNecessary]):
(-[WebNetscapePluginView createPlugin]):
(-[WebNetscapePluginView fini]):
(-[WebNetscapePluginView drawRect:]):
(-[WebNetscapePluginView invalidateRegion:]):
(-[WebNetscapePluginView getVariable:value:]):
(-[WebNetscapePluginView setVariable:value:]):
(isDrawingModelQuickDraw): Deleted.
(-[WebNetscapePluginView fixWindowPort]): Deleted.
(getQDPixelFormatForBitmapContext): Deleted.
(-[WebNetscapePluginView tellQuickTimeToChill]): Deleted.
(-[WebNetscapePluginView _printedPluginBitmap]): Deleted.
* WebView/WebDelegateImplementationCaching.mm:

Tools:

* DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
* DumpRenderTree/TestNetscapePlugIn/Tests/mac/SupportsCarbonEventModel.cpp: Removed.
* DumpRenderTree/TestNetscapePlugIn/main.cpp:
(NPP_New):
(NPP_HandleEvent):
(handleEventCarbon): Deleted.

LayoutTests:

* platform/mac/plugins/supports-carbon-event-model-expected.txt: Removed.
* platform/mac/plugins/supports-carbon-event-model.html: Removed.

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

7 months ago[ContentChangeObserver] Introduce ContentChangeObserver::MouseMovedScope
zalan@apple.com [Sun, 3 Mar 2019 02:50:52 +0000 (02:50 +0000)]
[ContentChangeObserver] Introduce ContentChangeObserver::MouseMovedScope
https://bugs.webkit.org/show_bug.cgi?id=195252
<rdar://problem/48539446>

Reviewed by Simon Fraser.

Source/WebCore:

Scope the mouse-moved event to make the callsites less error-prone.

* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::startObservingMouseMoved):
(WebCore::ContentChangeObserver::stopObservingMouseMoved):
(WebCore::ContentChangeObserver::MouseMovedScope::MouseMovedScope):
(WebCore::ContentChangeObserver::MouseMovedScope::~MouseMovedScope):
(WebCore::ContentChangeObserver::startObservingContentChanges): Deleted.
(WebCore::ContentChangeObserver::stopObservingContentChanges): Deleted.
* page/ios/ContentChangeObserver.h:
* page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::mouseMoved):

Source/WebKit:

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleSyntheticClick):

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

7 months agoUnreviewed follow-up to r242292. Keep EXPECT_STREQ in tests per Darin's request.
ross.kirsling@sony.com [Sun, 3 Mar 2019 01:03:26 +0000 (01:03 +0000)]
Unreviewed follow-up to r242292. Keep EXPECT_STREQ in tests per Darin's request.

* TestWebKitAPI/Tests/WebKit/EnvironmentUtilitiesTest.cpp:
(TestWebKitAPI::TEST):

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

7 months agoWeb Inspector: Unexpectedly frequent flashing of DOM node attributes
drousso@apple.com [Sun, 3 Mar 2019 00:18:55 +0000 (00:18 +0000)]
Web Inspector: Unexpectedly frequent flashing of DOM node attributes
https://bugs.webkit.org/show_bug.cgi?id=148049
<rdar://problem/22296830>

Reviewed by Joseph Pecoraro.

Save a timestamp of when the CSS animation began, so that if the attribute's node is replaced,
we can "resume" the CSS animation at the same point with the attribute's new node.

* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement):
(WI.DOMTreeElement.prototype.attributeDidChange):
(WI.DOMTreeElement.prototype._buildAttributeDOM):
(WI.DOMTreeElement.prototype._createModifiedAnimation):
(WI.DOMTreeElement.prototype._markNodeChanged): Deleted.
(WI.DOMTreeElement.prototype._nodeChangedAnimationEnd): Deleted.
(WI.DOMTreeElement.prototype._fireDidChange): Deleted.

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

7 months ago[ContentChangeObserver] Introduce ContentChangeObserver::adjustObservedState
zalan@apple.com [Sun, 3 Mar 2019 00:15:11 +0000 (00:15 +0000)]
[ContentChangeObserver] Introduce ContentChangeObserver::adjustObservedState
https://bugs.webkit.org/show_bug.cgi?id=195244
<rdar://problem/48536737>

Reviewed by Simon Fraser.

Source/WebCore:

Move state change handling code to adjustObservedState() and introduce signalContentChangeIfNeeded() to
let the client know about the state change (or lack of state change).

Test: fast/events/touch/ios/visibility-change-happens-at-the-second-timer.html

* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::didInstallDOMTimer):
(WebCore::ContentChangeObserver::didRemoveDOMTimer):
(WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
(WebCore::ContentChangeObserver::stopObservingStyleRecalc):
(WebCore::ContentChangeObserver::clearTimersAndReportContentChange):
(WebCore::ContentChangeObserver::didContentVisibilityChange):
(WebCore::ContentChangeObserver::addObservedDOMTimer):
(WebCore::ContentChangeObserver::removeObservedDOMTimer):
(WebCore::ContentChangeObserver::setShouldObserveStyleRecalc):
(WebCore::ContentChangeObserver::adjustObservedState):
(WebCore::ContentChangeObserver::signalContentChangeIfNeeded):
* page/ios/ContentChangeObserver.h:
(WebCore::ContentChangeObserver::isObservingDOMTimerScheduling const):
(WebCore::ContentChangeObserver::addObservedDOMTimer): Deleted.
(WebCore::ContentChangeObserver::setShouldObserveStyleRecalc): Deleted.

LayoutTests:

* fast/events/touch/ios/visibility-change-happens-at-the-second-timer-expected.txt: Added.
* fast/events/touch/ios/visibility-change-happens-at-the-second-timer.html: Added.

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

7 months agoMove EditingRange <-> Range methods to EditingRange instead of WebPage
timothy_horton@apple.com [Sun, 3 Mar 2019 00:02:34 +0000 (00:02 +0000)]
Move EditingRange <-> Range methods to EditingRange instead of WebPage
https://bugs.webkit.org/show_bug.cgi?id=195201

Reviewed by Sam Weinig.

* Shared/EditingRange.h:
* Shared/EditingRange.cpp:
Also, modernize the coders.

* Sources.txt:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::insertTextAsync):
(WebKit::WebPage::getMarkedRangeAsync):
(WebKit::WebPage::getSelectedRangeAsync):
(WebKit::WebPage::characterIndexForPointAsync):
(WebKit::WebPage::firstRectForCharacterRangeAsync):
(WebKit::WebPage::setCompositionAsync):
(WebKit::WebPage::rangeFromEditingRange): Deleted.
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::insertDictatedTextAsync):
(WebKit::WebPage::attributedSubstringForCharacterRangeAsync):

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

7 months ago[ContentChangeObserver] Move away from WKContentChange values
zalan@apple.com [Sat, 2 Mar 2019 22:57:18 +0000 (22:57 +0000)]
[ContentChangeObserver] Move away from WKContentChange values
https://bugs.webkit.org/show_bug.cgi?id=195240
<rdar://problem/48532358>

Reviewed by Simon Fraser.

This is in preparation for moving towards a state machine-like implementation.

* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::didInstallDOMTimer): Do not install the timer if we are already in "hover" state.
(WebCore::ContentChangeObserver::didRemoveDOMTimer):
(WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
(WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
(WebCore::ContentChangeObserver::startObservingStyleRecalc): No need to start observing the style recalc if we are already in "hover" state.
(WebCore::ContentChangeObserver::stopObservingStyleRecalc):
(WebCore::ContentChangeObserver::clearTimersAndReportContentChange):
(WebCore::ContentChangeObserver::didContentVisibilityChange):
(WebCore::ContentChangeObserver::startObservingContentChanges):
(WebCore::ContentChangeObserver::observedContentChange const):
(WebCore::ContentChangeObserver::removeObservedDOMTimer):
(WebCore::ContentChangeObserver::hasDeterminedState const):
(WebCore::ContentChangeObserver::observedContentChange): Deleted.
(WebCore::ContentChangeObserver::resetObservedContentChange): Deleted.
(WebCore::ContentChangeObserver::setObservedContentChange): Deleted.
(WebCore::ContentChangeObserver::addObservedDOMTimer): Deleted.
* page/ios/ContentChangeObserver.h:
(WebCore::ContentChangeObserver::addObservedDOMTimer):
(WebCore::ContentChangeObserver::clearObservedDOMTimers):
(WebCore::ContentChangeObserver::hasVisibleChangeState const):
(WebCore::ContentChangeObserver::hasObservedDOMTimer const):
(WebCore::ContentChangeObserver::setHasNoChangeState):
(WebCore::ContentChangeObserver::setHasIndeterminateState):
(WebCore::ContentChangeObserver::setHasVisibleChangeState):
(WebCore::ContentChangeObserver::countOfObservedDOMTimers const): Deleted.

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

7 months agoWeb Inspector: Debugger: DOM, URL, and Event breakpoints don't grey out when all...
drousso@apple.com [Sat, 2 Mar 2019 22:40:43 +0000 (22:40 +0000)]
Web Inspector: Debugger: DOM, URL, and Event breakpoints don't grey out when all breakpoints are disabled
https://bugs.webkit.org/show_bug.cgi?id=195170
<rdar://problem/48478193>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/DOMBreakpointTreeElement.js:
(WI.DOMBreakpointTreeElement):
(WI.DOMBreakpointTreeElement.prototype.onattach):
(WI.DOMBreakpointTreeElement.prototype.ondetach):
(WI.DOMBreakpointTreeElement.prototype._updateStatus):
* UserInterface/Views/EventBreakpointTreeElement.js:
(WI.EventBreakpointTreeElement):
(WI.EventBreakpointTreeElement.prototype.onattach):
(WI.EventBreakpointTreeElement.prototype.ondetach):
(WI.EventBreakpointTreeElement.prototype._updateStatus):
* UserInterface/Views/URLBreakpointTreeElement.js:
(WI.URLBreakpointTreeElement):
(WI.URLBreakpointTreeElement.prototype.onattach):
(WI.URLBreakpointTreeElement.prototype.ondetach):
(WI.URLBreakpointTreeElement.prototype._updateStatus):
Remove the `"resolved"` class when the global "breakpoints enabled" state is changed.

* UserInterface/Controllers/DOMDebuggerManager.js:
(WI.DOMDebuggerManager):
(WI.DOMDebuggerManager.prototype._handleDOMBreakpointDisabledStateChanged): Added.
(WI.DOMDebuggerManager.prototype._handleEventBreakpointDisabledStateChanged): Added.
(WI.DOMDebuggerManager.prototype._handleURLBreakpointDisabledStateChanged): Added.
(WI.DOMDebuggerManager.prototype._updateEventBreakpoint):
(WI.DOMDebuggerManager.prototype._updateURLBreakpoint):
(WI.DOMDebuggerManager.prototype._resolveEventBreakpoint):
(WI.DOMDebuggerManager.prototype._resolveURLBreakpoint):
(WI.DOMDebuggerManager.prototype._updateEventBreakpoint.breakpointUpdated): Deleted.
(WI.DOMDebuggerManager.prototype._updateURLBreakpoint.breakpointUpdated): Deleted.
* UserInterface/Models/DOMBreakpoint.js:
(WI.DOMBreakpoint):
(WI.DOMBreakpoint.deserialize): Added.
(WI.DOMBreakpoint.prototype.set disabled):
(WI.DOMBreakpoint.prototype.set domNodeIdentifier):
* UserInterface/Models/EventBreakpoint.js:
(WI.EventBreakpoint.deserialize): Added.
(WI.EventBreakpoint.prototype.set disabled):
(WI.EventBreakpoint.fromPayload): Deleted.
* UserInterface/Models/URLBreakpoint.js:
(WI.URLBreakpoint.deserialize): Added.
(WI.URLBreakpoint.prototype.set disabled):
* UserInterface/Views/DOMTreeContentView.js:
(WI.DOMTreeContentView):
(WI.DOMTreeContentView.prototype._handleDOMBreakpointDisabledStateChanged): Added.
(WI.DOMTreeContentView.prototype._handleDOMBreakpointDOMNodeChanged): Added.
* UserInterface/Views/DebuggerSidebarPanel.js:
(WI.DebuggerSidebarPanel.prototype._handleDOMBreakpointResolvedStateChanged): Added.
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel):
(WI.SourcesNavigationSidebarPanel.prototype._handleDOMBreakpointResolvedStateChanged): Added.
Drive-by: rename all events with the name `*DidChange` to `*Changed`.
Drive-by: create static `deserialize` helper functions.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242318 268f45cc-cd09-0410-ab3c-d52691b4dbfc

7 months ago[iOS] Programmatic paste access should be granted when copying and pasting within...
wenson_hsieh@apple.com [Sat, 2 Mar 2019 21:50:43 +0000 (21:50 +0000)]
[iOS] Programmatic paste access should be granted when copying and pasting within the same origin
https://bugs.webkit.org/show_bug.cgi?id=195053
<rdar://problem/48134710>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Plumb the document pasteboard identifier through the client when making a DOM paste access request. See WebKit
ChangeLog for more details.

Test: editing/pasteboard/ios/dom-paste-same-origin.html

* WebCore.xcodeproj/project.pbxproj:
* dom/DOMPasteAccess.h: Renamed from Source/WebCore/dom/DOMPasteAccessPolicy.h.

Introduce DOMPasteAccessResponse, which is either DeniedForGesture, GrantedForCommand, or GrantedForGesture. In
particular, when pasteboard identifiers match, we only grant access for the current paste command, rather than
throughout the user gesture.

* dom/UserGestureIndicator.h:
(WebCore::UserGestureToken::didRequestDOMPasteAccess):
* loader/EmptyClients.cpp:
* page/EditorClient.h:
* page/Frame.cpp:
(WebCore::Frame::requestDOMPasteAccess):

Source/WebKit:

Add support for automatically granting programmatic pasteboard access when the pasteboard identifier of the
document requesting programmatic paste matches the identifier in the custom pasteboard data blob in the
UIPasteboard. To do this, we send the pasteboard identifier of the document requesting the DOM paste to the UI
process, and check this against the pasteboard identifiers for each item on the platform pasteboard. If all
items in the platform pasteboard match the given pasteboard identifier (since we don't support writing multiple
pasteboard items via bindings, this should only be a single item), we skip showing the paste callout and
immediately invoke the programmatic paste handler.

* Scripts/webkit/messages.py:
* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::requestDOMPasteAccess):
* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/API/wpe/PageClientImpl.cpp:
(WebKit::PageClientImpl::requestDOMPasteAccess):
* UIProcess/API/wpe/PageClientImpl.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::requestDOMPasteAccess):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:

Add plumbing to deliver the pasteboard identifier to the client when requesting DOM paste.

* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::requestDOMPasteAccess):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView cleanupInteraction]):
(-[WKContentView resignFirstResponderForWebView]):
(-[WKContentView _webTouchEventsRecognized:]):
(-[WKContentView _willHideMenu:]):
(-[WKContentView pasteForWebView:]):
(-[WKContentView _handleDOMPasteRequestWithResult:]):
(-[WKContentView _willPerformAction:sender:]):
(-[WKContentView _didPerformAction:sender:]):
(-[WKContentView handleKeyWebEvent:withCompletionHandler:]):
(allPasteboardItemOriginsMatchOrigin):
(-[WKContentView _requestDOMPasteAccessWithElementRect:originIdentifier:completionHandler:]):
(-[WKContentView _requestDOMPasteAccessWithElementRect:completionHandler:]): Deleted.

Bail early in the case where all items' pasteboard identifiers (read via custom pasteboard data) match. When
this happens, we only grant access for the current paste command, rather than granting access for the user
gesture token.

* UIProcess/mac/PageClientImplMac.h:
* UIProcess/win/PageClientImpl.cpp:
(WebKit::PageClientImpl::requestDOMPasteAccess):
* UIProcess/win/PageClientImpl.h:
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::requestDOMPasteAccess):
* WebProcess/WebCoreSupport/WebEditorClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::requestDOMPasteAccess):
* WebProcess/WebPage/WebPage.h:

Source/WebKitLegacy/mac:

* WebCoreSupport/WebEditorClient.h:

Source/WebKitLegacy/win:

* WebCoreSupport/WebEditorClient.h:

LayoutTests:

Adjust several existing DOM paste tests to copy text from a child frame that has a different origin as the main
frame, such that we'll trigger the paste callout menu when performing a programmatic paste. Also add a new
layout test that copies and programmatically pastes within the same document, to verify that no paste callout is
displayed and the paste is allowed.

* editing/pasteboard/ios/dom-paste-confirmation-expected.txt:
* editing/pasteboard/ios/dom-paste-confirmation.html:
* editing/pasteboard/ios/dom-paste-consecutive-confirmations-expected.txt:
* editing/pasteboard/ios/dom-paste-consecutive-confirmations.html:
* editing/pasteboard/ios/dom-paste-rejection-expected.txt:
* editing/pasteboard/ios/dom-paste-rejection.html:
* editing/pasteboard/ios/dom-paste-requires-user-gesture-expected.txt:
* editing/pasteboard/ios/dom-paste-requires-user-gesture.html:
* editing/pasteboard/ios/dom-paste-same-origin-expected.txt: Copied from LayoutTests/editing/pasteboard/ios/dom-paste-confirmation-expected.txt.
* editing/pasteboard/ios/dom-paste-same-origin.html: Copied from LayoutTests/editing/pasteboard/ios/dom-paste-confirmation.html.

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

7 months agoFixed makeString(float) to do shortest-form serialization without first converting...
darin@apple.com [Sat, 2 Mar 2019 20:54:59 +0000 (20:54 +0000)]
Fixed makeString(float) to do shortest-form serialization without first converting to double
https://bugs.webkit.org/show_bug.cgi?id=195142

Reviewed by Daniel Bates.

Source/WebCore:

* platform/graphics/Color.cpp: Removed unneeded include of DecimalNumber.h.

Source/WebKit:

* UIProcess/PerActivityStateCPUUsageSampler.cpp: Removed unneeded include of DecimalNumber.h.

Source/WTF:

* wtf/DecimalNumber.cpp: Removed unneeded includes.

* wtf/DecimalNumber.h: Removed unused constructors; over time we will be
deprecating DecimalNumber, so we should removed the unused parts. Also
marked the constructor explicit, removed types used only for arguments for
the constructors, and removed the sign, exponent, significand, and precision
member functions.

* wtf/JSONValues.cpp:
(WTF::JSONImpl::Value::writeJSON const): Updated for changes to DecimalNumber
switched from NumberToLStringBuffer to NumberToStringBuffer, and for use of
std::array instead of C arrays.

* wtf/dtoa.cpp: Removed unused dtoaRoundSF and dtoaRoundDP functions.
(WTF::dtoa): Updated to use std::array instead of C arrays.
(WTF::dtoaRoundSF): Removed.
(WTF::dtoaRoundDP): Removed.
(WTF::numberToString): Added an overload for float and updated to use std::array.
(WTF::formatStringTruncatingTrailingZerosIfNeeded): Updated to use std::array.
(WTF::numberToFixedPrecisionString): Ditto.
(WTF::numberToFixedWidthString): Ditto.

* wtf/dtoa.h: Changed arrays to be std::array instead of C arrays so the
array types will be checked. Removed dtoaRoundSF and dtoaRoundDP.
Added float overloads for numberToString, numberToFixedPrecisionString,
and numberToFixedWidthString. The only one of these that is called at this
time is numberToString, called by the floating point StringTypeAdapter in
StringConcatenateNummbers.h.

* wtf/text/StringConcatenateNumbers.h: Updated for std::array.

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

7 months agoWeb Inspector: Sources: breakpoints should be disabled when an audit is running
drousso@apple.com [Sat, 2 Mar 2019 20:50:08 +0000 (20:50 +0000)]
Web Inspector: Sources: breakpoints should be disabled when an audit is running
https://bugs.webkit.org/show_bug.cgi?id=195105
<rdar://problem/48441373>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel):
(WI.SourcesNavigationSidebarPanel.prototype.closed):
(WI.SourcesNavigationSidebarPanel.prototype._updateTemporarilyDisabledBreakpointsButtons): Added.
(WI.SourcesNavigationSidebarPanel.prototype._updateBreakpointsDisabledBanner):
(WI.SourcesNavigationSidebarPanel.prototype._handleTimelineCapturingWillStart):
(WI.SourcesNavigationSidebarPanel.prototype._handleTimelineCapturingStopped):
(WI.SourcesNavigationSidebarPanel.prototype._handleAuditManagerTestScheduled): Added.
(WI.SourcesNavigationSidebarPanel.prototype._handleAuditManagerTestCompleted): Added.
* UserInterface/Views/SourcesNavigationSidebarPanel.css:
(.sidebar > .panel.navigation.sources > .content > .warning-banner + .warning-banner): Added.

* UserInterface/Views/DebuggerSidebarPanel.js:
(WI.DebuggerSidebarPanel):

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

7 months agoWeb Inspector: Debugger: don't enable breakpoints when source location changes
drousso@apple.com [Sat, 2 Mar 2019 20:32:11 +0000 (20:32 +0000)]
Web Inspector: Debugger: don't enable breakpoints when source location changes
https://bugs.webkit.org/show_bug.cgi?id=195081
<rdar://problem/48422701>

Reviewed by Joseph Pecoraro.

* UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager.prototype._breakpointDisplayLocationDidChange):
(WI.DebuggerManager.prototype._breakpointEditablePropertyDidChange):

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

7 months agoREGRESSION (r242132): Incorrect positioning with multiple position:fixed elements
simon.fraser@apple.com [Sat, 2 Mar 2019 19:15:21 +0000 (19:15 +0000)]
REGRESSION (r242132): Incorrect positioning with multiple position:fixed elements
https://bugs.webkit.org/show_bug.cgi?id=195246

Reviewed by Frederic Wang.

Source/WebCore:

r242132 introduced a bug where the management of 'cumulativeDelta' in ScrollingTree::notifyRelatedNodesRecursive
was incorrect. This value should propagate from ancestors to descendants, but not between siblings in the scrolling
tree, which it did, causing sibling position:fixed to behave incorrectly.

Test: scrollingcoordinator/mac/multiple-fixed.html

* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::notifyRelatedNodesRecursive):
* page/scrolling/ScrollingTree.h:

LayoutTests:

Test that uses eventSender to scroll (and is thus macOS-only).

* platform/ios-wk2/TestExpectations:
* scrollingcoordinator/mac/multiple-fixed-expected.html: Added.
* scrollingcoordinator/mac/multiple-fixed.html: Added.

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

7 months ago[WPE] Public API headers are missing autocleanup definitions
aperez@igalia.com [Sat, 2 Mar 2019 17:50:12 +0000 (17:50 +0000)]
[WPE] Public API headers are missing autocleanup definitions
https://bugs.webkit.org/show_bug.cgi?id=195211

Reviewed by Philippe Normand.

* PlatformWPE.cmake: List new API headers as installable.
* UIProcess/API/wpe/WebKitAutocleanups.h: Added. This is a copy of the header from the GTK
port, adapted to fit the WPE port.
* UIProcess/API/wpe/webkit.h: Add inclusion of WebKitAutocleanups.h
* WebProcess/InjectedBundle/API/wpe/WebKitWebExtensionAutocleanups.h: Added. Also adapted
from the equivalent header of the GTK port.
* WebProcess/InjectedBundle/API/wpe/webkit-web-extension.h: Add inclusion of
WebKitWebExtensionAutocleanups.h

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

7 months agoImprove some comments
darin@apple.com [Sat, 2 Mar 2019 17:33:20 +0000 (17:33 +0000)]
Improve some comments
https://bugs.webkit.org/show_bug.cgi?id=195243

Reviewed by Daniel Bates.

* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _addAccessibilityObject:toTextMarkerArray:]):
Fix a typo in a comment.

* dom/RadioButtonGroups.cpp: Fix a typo in a comment.
(WebCore::RadioButtonGroups::checkedButtonForGroup const): Use nullptr instead of 0.

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::~HTMLInputElement): Improved a comment, but sadly made
it a bit longer. Use nullptr instead of 0.
(WebCore::HTMLInputElement::didMoveToNewDocument): Added a comment.

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

7 months agoRemove unused WebPageProxy::m_navigationID
mcatanzaro@igalia.com [Sat, 2 Mar 2019 16:28:46 +0000 (16:28 +0000)]
Remove unused WebPageProxy::m_navigationID
https://bugs.webkit.org/show_bug.cgi?id=195209

Reviewed by Darin Adler.

WebPageProxy::m_navigationID is never assigned to and is only used once by mistake in a
debug LOG(). It must be a refactoring mistake.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didCommitLoadForFrame):
* UIProcess/WebPageProxy.h:

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

7 months ago[Datalist] fast/forms/datalist/datalist-child-validation.html crashes with a debug...
wenson_hsieh@apple.com [Sat, 2 Mar 2019 06:09:31 +0000 (06:09 +0000)]
[Datalist] fast/forms/datalist/datalist-child-validation.html crashes with a debug assertion in isValidFormControlElement()
https://bugs.webkit.org/show_bug.cgi?id=190620
<rdar://problem/19226679>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Fixes and re-enables an existing layout test that is asserting on debug builds (and failing on release builds).
To understand why we hit this assertion, we first note several observations:

    -   The validity of a form control (`isValid()`) depends on the value of `willValidate()`.
    -   Both of these results are cached in member variables: `m_isValid` and `m_willValidate`, respectively.
    -   `willValidate()` changes the cached value of `m_willValidate` if necessary, but `isValid()` uses the
        cached value without update.

Now, consider the following scenario:

    1.  Something changes in the DOM that changes the result of `willValidate()`. This can happen as a result of
        several things:
        a.  The form control changes readonly state
        b.  The form control changes disabled state
        c.  The form control is added to a datalist element
        d.  The form control is removed from a datalist element
    2.  Call `willValidate()`.
    3.  Call `isValid()`.

In scenarios (a) - (c), we ensure that cached form control validity (`m_isValid`) is updated alongside
`m_willValidate` by invoking `setNeedsWillValidateCheck()`, such that the result of `isValid()` matches the
result of `m_isValid` in step (3). However, in the last scenario (d), we don't do this, which causes form
control validity to fall out of sync with the result of `isValid()`. To fix the bug, we update willValidate and
isValid when a form control is removed from an ancestor, only if one of its ancestors is a datalist element.

* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::insertedIntoAncestor):
(WebCore::HTMLFormControlElement::removedFromAncestor):

Make a couple of minor tweaks:
  - Currently, we always invalidate `m_dataListAncestorState` by resetting the state to `Unknown` when the form
    control is removed from an ancestor or inserted. Instead, we only need to reset it when the form control
    already has an ancestor that is a datalist (in the case where it's being removed) or when the form control
    does not yet have an ancestor (in the case where it is being added).
  - If the form control was inside a datalist prior to removal, recompute its cached value of `m_willValidate`,
    as well as its cached validity (`m_isValid`).

LayoutTests:

Re-enables a crashing layout test. See WebCore ChangeLog for more details.

* platform/ios/TestExpectations:
* platform/mac/TestExpectations:

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

7 months agoFinish removing String::format
darin@apple.com [Sat, 2 Mar 2019 05:45:11 +0000 (05:45 +0000)]
Finish removing String::format
https://bugs.webkit.org/show_bug.cgi?id=194893

Reviewed by Daniel Bates.
Source/JavaScriptCore:

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::nameForRegister): Use makeString instead of String::format,
using the new "pad" function.

Source/WebCore:

* dom/Document.cpp:
(WebCore::Document::lastModified const): Use makeString and pad.
* html/FTPDirectoryDocument.cpp:
(WebCore::processFileDateString): Ditto.

* mathml/MathMLElement.cpp:
(WebCore::convertToPercentageIfNeeded): Use makeString and FormattedNumber.

* page/cocoa/ResourceUsageOverlayCocoa.mm:
(WebCore::ResourceUsageOverlay::platformDraw): Use makeString and pad.

* page/linux/ResourceUsageOverlayLinux.cpp:
(WebCore::cpuUsageString): Use makeString, FormattedNumber, and pad.
(WebCore::gcTimerString): Use String::number.

* platform/DateComponents.cpp:
(WebCore::DateComponents::toStringForTime const): Use makeString and pad.
(WebCore::DateComponents::toString const): Ditto.

* platform/LocalizedStrings.cpp: Removed comment that mentioned String::format,
and that was also inaccurate.

* platform/audio/HRTFElevation.cpp:
(WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
Use makeString and pad.
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::drawText): Ditto.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::logLayerInfo): Ditto.
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::formatMediaControlsTime const): Ditto.

Source/WebKit:

* UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
(WebKit::LocalAuthenticator::getAssertion): Use makeString, attempting to fix
a problem where we passed an NSData * to format with a "%s"."

Source/WebKitLegacy/win:

* FullscreenVideoController.cpp:
(timeToString): Use makeString and pad.

Source/WTF:

* wtf/Assertions.cpp:
(WTF::createWithFormatAndArguments): Moved this here from WTFString.cpp.
(WTFLog): Use WTF::createWithFormatAndArguments instead of String::format.

* wtf/HexNumber.h: Deleted unneeded toString function.

* wtf/text/StringConcatenate.h: Got rid of unneeded forward declaration of
StringTypeAdapter, since that's now in Forward.h. Tweaked formatting of templates
a bit. Use function templates for writeTo functions rather than having two of each.
Removed unused toString functions. Optimized case where we use have a UChar* and
a length of zero to not force the result to be 16-bit. Also gets rid of a small
NO_RETURN_DUE_TO_CRASH mess that we don't need. Refactored constructors to use some
static member helper functions to compute string lengths. Added the pad function
and the PaddingSpecification struct template, so we can add padding to anything
we can turn into a string. Got rid of the special case overload for single
arguments, since it only worked for things that the String constructor can handle.
Instead we will now use StringTypeAdapter, which works for more types. Possibly
less optimal for some special cases, which we could specialize for later if we like.
* wtf/text/StringConcatenateNumbers.h: Ditto.
* wtf/text/StringOperators.h: Ditto.
* wtf/text/StringView.h: Ditto.

* wtf/text/WTFString.cpp:
(WTF::createWithFormatAndArguments): Deleted.
(WTF::String::format): Deleted.
* wtf/text/WTFString.h: Deleted declaration of String::format.

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

7 months agoDo not attempt to set WAL Journal mode on a readonly SQLite database
cdumez@apple.com [Sat, 2 Mar 2019 03:44:52 +0000 (03:44 +0000)]
Do not attempt to set WAL Journal mode on a readonly SQLite database
https://bugs.webkit.org/show_bug.cgi?id=195237

Reviewed by Simon Fraser.

This avoids logging errors when opening the database.

* platform/sql/SQLiteDatabase.cpp:
(WebCore::SQLiteDatabase::open):
(WebCore::SQLiteDatabase::useWALJournalMode):
* platform/sql/SQLiteDatabase.h:

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

7 months ago[PlayStation] Upstream playstation's remote inspector server
chris.reid@sony.com [Sat, 2 Mar 2019 03:27:56 +0000 (03:27 +0000)]
[PlayStation] Upstream playstation's remote inspector server
https://bugs.webkit.org/show_bug.cgi?id=193806

Reviewed by Joseph Pecoraro.

Upstreaming PlayStation's Remote Inspector implementation.
It is using a JSON RPC protocol over TCP sockets.
This inspector implementation is planned to also support running on a WinCairo Client and Server.

* PlatformPlayStation.cmake:
* SourcesGTK.txt:
* SourcesWPE.txt:
* inspector/remote/RemoteConnectionToTarget.cpp: Renamed from Source/JavaScriptCore/inspector/remote/glib/RemoteConnectionToTargetGlib.cpp.
* inspector/remote/RemoteInspector.h:
* inspector/remote/playstation/RemoteInspectorConnectionClient.h: Added.
* inspector/remote/playstation/RemoteInspectorConnectionClientPlayStation.cpp: Added.
* inspector/remote/playstation/RemoteInspectorMessageParser.h: Added.
* inspector/remote/playstation/RemoteInspectorMessageParserPlayStation.cpp: Added.
* inspector/remote/playstation/RemoteInspectorPlayStation.cpp: Added.
* inspector/remote/playstation/RemoteInspectorServer.h: Added.
* inspector/remote/playstation/RemoteInspectorServerPlayStation.cpp: Added.
* inspector/remote/playstation/RemoteInspectorSocket.h: Added.
* inspector/remote/playstation/RemoteInspectorSocketClient.h: Added.
* inspector/remote/playstation/RemoteInspectorSocketClientPlayStation.cpp: Added.
* inspector/remote/playstation/RemoteInspectorSocketPlayStation.cpp: Added.
* inspector/remote/playstation/RemoteInspectorSocketServer.h: Added.
* inspector/remote/playstation/RemoteInspectorSocketServerPlayStation.cpp: Added.

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

7 months agoUnreviewed Windows build fix after r242302.
cdumez@apple.com [Sat, 2 Mar 2019 03:12:58 +0000 (03:12 +0000)]
Unreviewed Windows build fix after r242302.

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

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

7 months agoNetworkDataTask redirection should not keep alive its NetworkSession
achristensen@apple.com [Sat, 2 Mar 2019 02:41:21 +0000 (02:41 +0000)]
NetworkDataTask redirection should not keep alive its NetworkSession
https://bugs.webkit.org/show_bug.cgi?id=194927

Reviewed by Darin Adler.

This should fix rdar://problem/47580502

* NetworkProcess/NetworkDataTask.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):

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

7 months agoRevert r241223, r241235, and r241287
achristensen@apple.com [Sat, 2 Mar 2019 02:29:40 +0000 (02:29 +0000)]
Revert r241223, r241235, and r241287
https://bugs.webkit.org/show_bug.cgi?id=194427
<rdar://48045861>

Source/WebKit:

This caused crashes, and feature design has evolved away from needing the daemon in this form.

* NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.mm:
(WebKit::DaemonMain):
* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h:
* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
(WebKit::XPCServiceEventHandler):
(WebKit::XPCServiceMain):
(WebKit::XPCEventHandler): Deleted.
(WebKit::XPCInitializationHandler): Deleted.
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration usesNetworkingDaemon]): Deleted.
(-[_WKProcessPoolConfiguration setUsesNetworkingDaemon:]): Deleted.
* UIProcess/AuxiliaryProcessProxy.cpp:
(WebKit::AuxiliaryProcessProxy::getLaunchOptions):
* UIProcess/Launcher/ProcessLauncher.h:
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::serviceName):
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::getLaunchOptions):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::usesNetworkingDaemon const): Deleted.
* UIProcess/WebProcessPool.h:

Source/WTF:

* wtf/spi/darwin/XPCSPI.h:

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

7 months agoAdd setters on WKWebsiteDataStore for sourceApplicationBundleIdentifier and sourceApp...
achristensen@apple.com [Sat, 2 Mar 2019 02:27:21 +0000 (02:27 +0000)]
Add setters on WKWebsiteDataStore for sourceApplicationBundleIdentifier and sourceApplicationSecondaryIdentifier
https://bugs.webkit.org/show_bug.cgi?id=195229
<rdar://problem/48520362>

Reviewed by Chris Dumez.

Source/WebKit:

Just like _setBoundInterfaceIdentifier, we need a way to set these properties after instantiation of a WKWebsiteDataStore,
but we need to make sure we don't set it after the parameters have been copied to the NetworkProcess.

Functionality verified by manual testing.  See radar.
Added an API test that verifies the setter restrictions work as expected.

* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _sourceApplicationBundleIdentifier]):
(-[WKWebsiteDataStore _setSourceApplicationBundleIdentifier:]):
(-[WKWebsiteDataStore _sourceApplicationSecondaryIdentifier]):
(-[WKWebsiteDataStore _setSourceApplicationSecondaryIdentifier:]):
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::toPKPaymentRequest):
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::WebsiteDataStore):
(WebKit::WebsiteDataStore::setSourceApplicationSecondaryIdentifier):
(WebKit::WebsiteDataStore::setSourceApplicationBundleIdentifier):
* UIProcess/WebsiteData/WebsiteDataStore.h:
(WebKit::WebsiteDataStore::sourceApplicationBundleIdentifier):
(WebKit::WebsiteDataStore::sourceApplicationSecondaryIdentifier):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm:
(TEST):

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

7 months agoCreate SPI to crash if a JSC VM is created
sbarati@apple.com [Sat, 2 Mar 2019 01:33:17 +0000 (01:33 +0000)]
Create SPI to crash if a JSC VM is created
https://bugs.webkit.org/show_bug.cgi?id=195231
<rdar://problem/47717990>

Reviewed by Mark Lam.

* API/JSVirtualMachine.mm:
(+[JSVirtualMachine setCrashOnVMCreation:]):
* API/JSVirtualMachinePrivate.h:
* runtime/VM.cpp:
(JSC::VM::VM):
(JSC::VM::setCrashOnVMCreation):
* runtime/VM.h:

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

7 months agoWeb Inspector: CPU Usage - Energy Impact Section
joepeck@webkit.org [Sat, 2 Mar 2019 01:18:13 +0000 (01:18 +0000)]
Web Inspector: CPU Usage - Energy Impact Section
https://bugs.webkit.org/show_bug.cgi?id=195151

Reviewed by Devin Rousso.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Main.html:
New strings and resources.

* UserInterface/Views/CPUTimelineView.css:
(.timeline-view.cpu > .content .subtitle > .info):
(@media (prefers-color-scheme: dark)):
(.energy-info-popover-content):
(.timeline-view.cpu > .content > .overview > .divider):
(body[dir=ltr] .timeline-view.cpu > .content > .overview > .divider):
(body[dir=rtl] .timeline-view.cpu > .content > .overview > .divider):
(.timeline-view.cpu :matches(.area-chart, .stacked-area-chart) svg > path):
(.timeline-view.cpu .gauge-chart:not(.empty) > svg > path.low):
(.timeline-view.cpu .gauge-chart:not(.empty) > svg > path.medium):
(.timeline-view.cpu .gauge-chart:not(.empty) > svg > path.high):
(.timeline-view.cpu .gauge-chart:not(.empty) > svg > polygon.needle):
(.timeline-view.cpu .energy):
(.timeline-view.cpu .energy .energy-impact):
(.timeline-view.cpu .energy .energy-impact.low):
(.timeline-view.cpu .energy .energy-impact.medium):
(.timeline-view.cpu .energy .energy-impact.high):
(.timeline-view.cpu .energy .energy-impact-number):
Styling the chart and text for the different energy impact levels.

* UserInterface/Views/CPUTimelineView.js:
(WI.CPUTimelineView.prototype.get lowEnergyValue):
(WI.CPUTimelineView.prototype.get highEnergyValue):
(WI.CPUTimelineView.prototype.initialLayout):
(WI.CPUTimelineView.prototype.layout):
(WI.CPUTimelineView.prototype._layoutEnergyChart.mapWithBias):
(WI.CPUTimelineView.prototype._layoutEnergyChart.valuesForGauge):
(WI.CPUTimelineView.prototype._layoutEnergyChart):
(WI.CPUTimelineView.prototype._clearEnergyImpactText):
New gauge chart and associated popover.
We do a bit of biasing of the data for each of the sections
in the gauge chart. Each section biases toward the cap of the
section so that:
  - we encourage lower power usage (sub 3%)
  - the gauge needle quickly moves past the low value of a range

* UserInterface/Views/GaugeChart.css: Added.
(.gauge-chart):
(body[dir=rtl] .gauge-chart):
(.gauge-chart > svg > path,):
(.gauge-chart > svg > polygon.needle):
(.gauge-chart.empty > svg > polygon.needle):
(@media (prefers-color-scheme: dark)):
* UserInterface/Views/GaugeChart.js: Added.
(WI.GaugeChart.prototype.get size):
(WI.GaugeChart.prototype.get segments):
(WI.GaugeChart.prototype.get value):
(WI.GaugeChart.prototype.set value):
(WI.GaugeChart.prototype.clear):
(WI.GaugeChart.prototype.initialLayout):
(WI.GaugeChart.prototype.layout):
(WI.GaugeChart.prototype._validateSegments):
(WI.GaugeChart.prototype._createSegmentPathData):
GaugeChart with variable number of sections and a
current value needle. It has a bit of customization
when drawing the arc at the start of each segment.

* UserInterface/Views/Variables.css:
(:root):
(@media (prefers-color-scheme: dark)):
New CPU colors for the different energy impact levels.

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

7 months ago[JSC] Fix FTL build on ARM32_64 by adding stubs for JSRopeString::offsetOfXXX
ysuzuki@apple.com [Sat, 2 Mar 2019 01:05:30 +0000 (01:05 +0000)]
[JSC] Fix FTL build on ARM32_64 by adding stubs for JSRopeString::offsetOfXXX
https://bugs.webkit.org/show_bug.cgi?id=195235

Reviewed by Saam Barati.

This is a workaround until https://bugs.webkit.org/show_bug.cgi?id=195234 is done.

* runtime/JSString.h:

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

7 months ago[iOS] Turn mouse event simulation on by default
commit-queue@webkit.org [Sat, 2 Mar 2019 00:50:06 +0000 (00:50 +0000)]
[iOS] Turn mouse event simulation on by default
https://bugs.webkit.org/show_bug.cgi?id=195218
<rdar://problem/48516794>

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

Source/WebCore:

* page/RuntimeEnabledFeatures.h:

Source/WebKit:

* Shared/WebPreferences.yaml:

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

7 months agoWeb Inspector: Data grid border colors don't match accent colors
nvasilyev@apple.com [Sat, 2 Mar 2019 00:37:18 +0000 (00:37 +0000)]
Web Inspector: Data grid border colors don't match accent colors
https://bugs.webkit.org/show_bug.cgi?id=195232

Reviewed by Matt Baker.

* UserInterface/Views/DataGrid.css:
(.data-grid:focus tr.selected td:not(:last-child)):
(body[dir=ltr] .data-grid:focus tr.selected td:not(:last-child)):
(body[dir=rtl] .data-grid:focus tr.selected td:not(:last-child)):

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

7 months agoDisable NetworkStateNotifier::singleton()'s isMainThread() assertion when the WebThre...
cdumez@apple.com [Sat, 2 Mar 2019 00:30:38 +0000 (00:30 +0000)]
Disable NetworkStateNotifier::singleton()'s isMainThread() assertion when the WebThread is enabled
https://bugs.webkit.org/show_bug.cgi?id=195230
<rdar://problem/47925359>

Reviewed by Ryosuke Niwa.

Disable NetworkStateNotifier::singleton()'s isMainThread() assertion when the WebThread is enabled
to address crashes on iOS WK1.

* platform/network/NetworkStateNotifier.cpp:
(WebCore::shouldSuppressThreadSafetyCheck):
(WebCore::NetworkStateNotifier::singleton):

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

7 months agoAdd a system trace scope for event region building
simon.fraser@apple.com [Sat, 2 Mar 2019 00:23:56 +0000 (00:23 +0000)]
Add a system trace scope for event region building
https://bugs.webkit.org/show_bug.cgi?id=195226

Reviewed by Jon Lee.

This trace scope measures the time spend converting element rects into Region objects,
which can be large on some pages.

The value for "Display Refresh Dispatch to main thread" was wrong and I fixed it.

Source/WTF:

* wtf/SystemTracing.h:

Tools:

* Tracing/SystemTracePoints.plist:

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

7 months agoShow mouse event regions in the overlay
simon.fraser@apple.com [Sat, 2 Mar 2019 00:23:53 +0000 (00:23 +0000)]
Show mouse event regions in the overlay
https://bugs.webkit.org/show_bug.cgi?id=195227

Reviewed by Tim Horton.

Enhance event region overlays to show more kinds of events.

* page/DebugPageOverlays.cpp:
(WebCore::touchEventRegionColors):
(WebCore::NonFastScrollableRegionOverlay::drawRect):

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

7 months agoEnvironmentUtilities::stripValuesEndingWithString isn't thread-safe
ross.kirsling@sony.com [Fri, 1 Mar 2019 23:30:16 +0000 (23:30 +0000)]
EnvironmentUtilities::stripValuesEndingWithString isn't thread-safe
https://bugs.webkit.org/show_bug.cgi?id=194612

Reviewed by Alex Christensen.

Source/WebKit:

This API test really shouldn't be verifying that the actual environment was successfully modified.

At its core, stripValuesEndingWithString is really just split-filter-join. By replacing it with a pair of
simple functions -- one for string processing, one for environment processing -- the API test only needs to
worry about the former.

* Platform/unix/EnvironmentUtilities.cpp:
(WebKit::EnvironmentUtilities::stripEntriesEndingWith):
(WebKit::EnvironmentUtilities::removeValuesEndingWith):
(WebKit::EnvironmentUtilities::stripValuesEndingWithString): Deleted.
* Platform/unix/EnvironmentUtilities.h:
Replace old function with a pair of simpler ones.

* NetworkProcess/EntryPoint/Cocoa/XPCService/NetworkServiceEntryPoint.mm:
(NetworkServiceInitializer):
* PluginProcess/EntryPoint/Cocoa/XPCService/PluginServiceEntryPoint.mm:
(PluginServiceInitializer):
* WebProcess/EntryPoint/Cocoa/XPCService/WebContentServiceEntryPoint.mm:
(WebContentServiceInitializer):
Update function name.

Tools:

* TestWebKitAPI/Tests/WebKit/EnvironmentUtilitiesTest.cpp:
Just test the new string-processing function and don't touch the actual environment.
(Test cases are all as before, but based on operator== instead of strcmp.)

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

7 months ago[ews-app] Update primary keys for handling multiple Buildbot instances
aakash_jain@apple.com [Fri, 1 Mar 2019 23:09:31 +0000 (23:09 +0000)]
[ews-app] Update primary keys for handling multiple Buildbot instances
https://bugs.webkit.org/show_bug.cgi?id=195120

Reviewed by Stephanie Lewis.

Use a new primary key uid for build and step tables. Previous primary keys build_id and step_id
were not enough to handle multiple buildbot instances. This new primary key uid would be generated
by a combination of buildbot_instance_id and current primary key. e.g.: buildbot_instance_id + build_id

* BuildSlaveSupport/ews-app/ews/models/build.py: Added new primary key uid.
* BuildSlaveSupport/ews-app/ews/models/step.py: Ditto.
* BuildSlaveSupport/ews-app/ews/models/buildbotinstance.py: Generate uid and instance_id.
* BuildSlaveSupport/ews-app/ews/views/results.py: Updated to receive hostname in events.
* BuildSlaveSupport/ews-build/events.py: Send hostname along-with events.
* BuildSlaveSupport/ews-build/master.cfg: Ditto.

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

7 months ago[ContentChangeObserver] Check for pending style recalcs at the end of each timer...
zalan@apple.com [Fri, 1 Mar 2019 22:48:54 +0000 (22:48 +0000)]
[ContentChangeObserver] Check for pending style recalcs at the end of each timer run.
https://bugs.webkit.org/show_bug.cgi?id=195220
<rdar://problem/48518979>

Reviewed by Simon Fraser.

Source/WebCore:

didScheduleStyleRecalc callback was introduced to see if a style recalc is scheduled while firing the DOM timer. However it does not handle the case
when in addition to this style recalc scheduling, something later (though during the same timer firing) triggers a sync style recalc.
Let's just check if we've got a pending style recalc when the DOM timer comes back.

Test: fast/events/touch/ios/style-recalc-schedule-and-force-relalc.html

* dom/Document.cpp:
(WebCore::Document::scheduleStyleRecalc):
* page/ios/ContentChangeObserver.cpp:
(WebCore::hasPendingStyleRecalc):
(WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
(WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
(WebCore::ContentChangeObserver::startObservingContentChanges):
(WebCore::ContentChangeObserver::didScheduleStyleRecalc): Deleted.
* page/ios/ContentChangeObserver.h:
(WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling): Deleted.
(WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling): Deleted.
(WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling const): Deleted.

LayoutTests:

* fast/events/touch/ios/style-recalc-schedule-and-force-relalc-expected.txt: Added.
* fast/events/touch/ios/style-recalc-schedule-and-force-relalc.html: Added.

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

7 months agoUnify WebsiteDataStore::defaultDataStoreConfiguration across ports
don.olmstead@sony.com [Fri, 1 Mar 2019 22:18:22 +0000 (22:18 +0000)]
Unify WebsiteDataStore::defaultDataStoreConfiguration across ports
https://bugs.webkit.org/show_bug.cgi?id=194844

Reviewed by Youenn Fablet.

Move the Cocoa implementation into APIWebsiteDataStore.cpp as the source of truth and
append configuration for Glib's DeviceIdHashSalts storage directory. This also fixes
a crash in Windows when running a Service Worker.

* UIProcess/API/APIWebsiteDataStore.cpp:
(API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory):
(API::WebsiteDataStore::defaultDataStoreConfiguration):
* UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
(API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory): Deleted.
(API::WebsiteDataStore::defaultDataStoreConfiguration): Deleted.
* UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
(API::WebsiteDataStore::defaultDataStoreConfiguration): Deleted.
* UIProcess/API/win/APIWebsiteDataStoreWin.cpp:
(API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory): Deleted.
(API::WebsiteDataStore::defaultDataStoreConfiguration): Deleted.

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

7 months agoResource Load Statistics: Further restrict client-side cookie persistence after cross...
wilander@apple.com [Fri, 1 Mar 2019 22:11:33 +0000 (22:11 +0000)]
Resource Load Statistics: Further restrict client-side cookie persistence after cross-site navigations with link decoration
https://bugs.webkit.org/show_bug.cgi?id=195196
<rdar://problem/48006419>

Reviewed by Brent Fulgham.

Source/WebCore:

Tests: http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-decoration-same-site.html
       http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-fragment-from-prevalent-resource.html
       http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-and-fragment-from-prevalent-resource.html
       http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-from-prevalent-resource.html
       http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-without-link-decoration-from-prevalent-resource.html

Trackers abuse link query parameters to transport user identifiers cross-site.
This patch detects such navigations and applies further restrictions to
client-site cookies on the destination page.

* platform/network/NetworkStorageSession.cpp:
(WebCore::NetworkStorageSession::setAgeCapForClientSideCookies):
    Now sets the regular 7-day cap and a reduced 1-day cap.
(WebCore::NetworkStorageSession::clearPageSpecificDataForResourceLoadStatistics):
    Renamed NetworkStorageSession::removeStorageAccessForAllFramesOnPage() to
    NetworkStorageSession::clearPageSpecificDataForResourceLoadStatistics since
    it now clears out two types of page-specific data.
(WebCore::NetworkStorageSession::committedCrossSiteLoadWithLinkDecoration):
    This function receives a cross-site navigation and checks if the originating
    site is a prevalent resource. If so, it marks the page or stricter cookie
    rules.
(WebCore::NetworkStorageSession::resetCrossSiteLoadsWithLinkDecorationForTesting):
    Test infrastructure. This sets a state that overrides the regular per-page
    clear of data. The reason is that the double clear was racy and caused test
    failures.
(WebCore::NetworkStorageSession::clientSideCookieCap const):
    New function that returns the current cookie lifetime cap.
(WebCore::NetworkStorageSession::removeStorageAccessForAllFramesOnPage): Deleted.
    Renamed to NetworkStorageSession::clearPageSpecificDataForResourceLoadStatistics().
* platform/network/NetworkStorageSession.h:
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::NetworkStorageSession::setCookiesFromDOM const):
    Now calls NetworkStorageSession::clientSideCookieCap() to set the cap.

Source/WebKit:

Trackers abuse link query parameters to transport user identifiers cross-site.
This patch detects such navigations and applies further restrictions to
client-site cookies on the destination page.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::clearPageSpecificDataForResourceLoadStatistics):
(WebKit::NetworkConnectionToWebProcess::removeStorageAccessForAllFramesOnPage): Deleted.
    Renamed NetworkConnectionToWebProcess::clearPageSpecificDataForResourceLoadStatistics().
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::committedCrossSiteLoadWithLinkDecoration):
    Reporting IPC message when a link decorated cross-site navigation happens.
(WebKit::NetworkProcess::resetCrossSiteLoadsWithLinkDecorationForTesting):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreStatisticsResetToConsistentState):
    Added clearing of the new state between test runs.
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::resetCrossSiteLoadsWithLinkDecorationForTesting):
    Test infrastructure.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::isNonUniqueNavigationWithLinkDecoration):
    Convenience function.
(WebKit::WebPageProxy::didCommitLoadForFrame):
    This function now reports to the network process when a link decorated
    cross-site navigation happens.
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::resetCrossSiteLoadsWithLinkDecorationForTesting):
    Test infrastructure.
* UIProcess/WebsiteData/WebsiteDataStore.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::close):
    Name change of function called.

LayoutTests:

* http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-decoration-same-site-expected.txt: Added.
* http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-decoration-same-site.html: Added.
* http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-fragment-from-prevalent-resource-expected.txt: Added.
* http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-fragment-from-prevalent-resource.html: Added.
* http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-and-fragment-from-prevalent-resource-expected.txt: Added.
* http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-and-fragment-from-prevalent-resource.html: Added.
* http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-from-prevalent-resource-expected.txt: Added.
* http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-from-prevalent-resource.html: Added.
* http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-without-link-decoration-from-prevalent-resource-expected.txt: Added.
* http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-without-link-decoration-from-prevalent-resource.html: Added.
* http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js.html:
    Now clears cookies after the test.

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

7 months agoRemove unused code in WebKitLegacy
timothy_horton@apple.com [Fri, 1 Mar 2019 21:58:46 +0000 (21:58 +0000)]
Remove unused code in WebKitLegacy
https://bugs.webkit.org/show_bug.cgi?id=189614

Reviewed by Simon Fraser.

Source/WebKit:

* mac/MigrateHeadersFromWebKitLegacy.make:

Source/WebKitLegacy:

* WebKitLegacy.xcodeproj/project.pbxproj:

Source/WebKitLegacy/mac:

* Carbon/CarbonUtils.h: Removed.
* Carbon/CarbonUtils.m: Removed.
* Carbon/CarbonWindowAdapter.h: Removed.
* Carbon/CarbonWindowAdapter.mm: Removed.
* Carbon/CarbonWindowContentView.h: Removed.
* Carbon/CarbonWindowContentView.m: Removed.
* Carbon/CarbonWindowFrame.h: Removed.
* Carbon/CarbonWindowFrame.m: Removed.
* Carbon/HIViewAdapter.h: Removed.
* Carbon/HIViewAdapter.m: Removed.
* Carbon/HIWebView.h: Removed.
* Carbon/HIWebView.mm: Removed.
* Configurations/WebKitLegacy.xcconfig:
* WebKit.mac.exp:

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

7 months ago[JSC] Use runtime calls for DFG MakeRope if !CPU(ADDRESS64)
ysuzuki@apple.com [Fri, 1 Mar 2019 21:46:08 +0000 (21:46 +0000)]
[JSC] Use runtime calls for DFG MakeRope if !CPU(ADDRESS64)
https://bugs.webkit.org/show_bug.cgi?id=195221

Reviewed by Mark Lam.

ARM32_64 builds DFG 64bit, but the size of address is 32bit. Make DFG MakeRope a runtime call not only for DFG 32_64,
but also DFG 64 with !CPU(ADDRESS64). This patch unifies compileMakeRope again, and use a runtime call for !CPU(ADDRESS64).

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileMakeRope):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compileMakeRope): Deleted.
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compileMakeRope): Deleted.

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

7 months agoModernize WebKit::AttributedString a little bit
timothy_horton@apple.com [Fri, 1 Mar 2019 21:37:33 +0000 (21:37 +0000)]
Modernize WebKit::AttributedString a little bit
https://bugs.webkit.org/show_bug.cgi?id=195200

Reviewed by Wenson Hsieh.

* Shared/mac/AttributedString.h:
(WebKit::AttributedString::AttributedString):
(WebKit::AttributedString::operator NSAttributedString * const):
* Shared/mac/AttributedString.mm:
(IPC::ArgumentCoder<WebKit::AttributedString>::encode):
(IPC::ArgumentCoder<WebKit::AttributedString>::decode):
(WebKit::AttributedString::encode const): Deleted.
(WebKit::AttributedString::decode): Deleted.
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::attributedSubstringForProposedRange):
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::attributedSubstringForCharacterRangeAsync):
Modern coders, and a constructor and cast operator to/from NSAttributedString.
Also adopt those in a few places just for fun.

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

7 months agoAdjust XMLHttpRequest Content-Type handling
commit-queue@webkit.org [Fri, 1 Mar 2019 21:32:53 +0000 (21:32 +0000)]
Adjust XMLHttpRequest Content-Type handling
https://bugs.webkit.org/show_bug.cgi?id=184645

Patch by Rob Buis <rbuis@igalia.com> on 2019-03-01
Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Sync test and update test expectation (all PASSes).

* web-platform-tests/xhr/send-content-type-charset-expected.txt:
* web-platform-tests/xhr/send-content-type-charset.htm:

Source/WebCore:

Implement steps 4.4.1.2 and 4.4.1.3 of send() [1].

Test: web-platform-tests/xhr/send-content-type-charset.htm

[1] https://xhr.spec.whatwg.org/#dom-xmlhttprequest-send

* platform/network/ParsedContentType.cpp:
(WebCore::ParsedContentType::setCharset):
* platform/network/ParsedContentType.h:
* xml/XMLHttpRequest.cpp:
(WebCore::replaceCharsetInMediaTypeIfNeeded):
(WebCore::XMLHttpRequest::send):
(WebCore::replaceCharsetInMediaType): Deleted.

LayoutTests:

Fix 2 subtest expectations.

* http/tests/xmlhttprequest/request-encoding2.html:

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

7 months agoUpdate originsMatch to handle the case of file origins which enforce file path separation
youenn@apple.com [Fri, 1 Mar 2019 21:31:05 +0000 (21:31 +0000)]
Update originsMatch to handle the case of file origins which enforce file path separation
https://bugs.webkit.org/show_bug.cgi?id=195216

Reviewed by Brady Eidson.

Covered by the assertion and existing tests like fast/xmlhttprequest/xmlhttprequest-no-file-access.html.
Make sure originsMatch returns true if either compared origins are the same object
or they have the same file path separation behavior.

* page/SecurityOrigin.cpp:
(WebCore::areOriginsMatching):
(WebCore::originsMatch):

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

7 months agoContinued gardening of storage/indexeddb/ crashes after r242189
tsavell@apple.com [Fri, 1 Mar 2019 21:00:20 +0000 (21:00 +0000)]
Continued gardening of storage/indexeddb/ crashes after r242189
https://bugs.webkit.org/show_bug.cgi?id=195210

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

7 months agoSerialize IndexedDB::ObjectStoreOverwriteMode as an enum
youenn@apple.com [Fri, 1 Mar 2019 20:36:08 +0000 (20:36 +0000)]
Serialize IndexedDB::ObjectStoreOverwriteMode as an enum
https://bugs.webkit.org/show_bug.cgi?id=195213

Reviewed by Alex Christensen.

Source/WebCore:

Add traits to enable enum IPC encoding.
No change of behavior.

* Modules/indexeddb/IndexedDB.h:

Source/WebKit:

Make use of enum trait to automatically check for correct enum value when receiving a putOrAdd message.

* NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
(WebKit::WebIDBConnectionToClient::putOrAdd):
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
* Scripts/webkit/messages.py:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::putOrAdd):

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

7 months agoUnskip test read-dead-bytecode-locals-in-must-have-handle-values2.js on ARM/MIPS
dinfuehr@igalia.com [Fri, 1 Mar 2019 20:18:39 +0000 (20:18 +0000)]
Unskip test read-dead-bytecode-locals-in-must-have-handle-values2.js on ARM/MIPS
https://bugs.webkit.org/show_bug.cgi?id=195207

Unreviewed. After test runtime was reduced in r242213, test can be
run again on ARM/MIPS.

* stress/read-dead-bytecode-locals-in-must-handle-values2.js:

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

7 months ago[WinCairo] Enable service worker
don.olmstead@sony.com [Fri, 1 Mar 2019 19:58:30 +0000 (19:58 +0000)]
[WinCairo] Enable service worker
https://bugs.webkit.org/show_bug.cgi?id=188318

Reviewed by Youenn Fablet.

.:

* Source/cmake/OptionsWin.cmake:

Source/WebCore:

* WebCorePrefix.h:
* testing/ServiceWorkerInternals.h:
* workers/service/context/SWContextManager.cpp:
(WebCore::SWContextManager::serviceWorkerFailedToTerminate):
* workers/service/context/SWContextManager.h:

Source/WebKit:

* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::terminateProcess):
* WebProcess/Storage/WebSWContextManagerConnection.h:
* config.h:

Tools:

* DumpRenderTree/DumpRenderTreePrefix.h:
* TestWebKitAPI/PlatformWin.cmake:
* TestWebKitAPI/win/TestWebKitAPIPrefix.h:
* WebKitTestRunner/InjectedBundle/win/TestRunnerInjectedBundlePrefix.h:
* WebKitTestRunner/WebKitTestRunnerPrefix.h:

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

7 months agoAdd a quirk for bostongloble.com and latimes.com
sihui_liu@apple.com [Fri, 1 Mar 2019 19:55:48 +0000 (19:55 +0000)]
Add a quirk for bostongloble.com and latimes.com
https://bugs.webkit.org/show_bug.cgi?id=195155

Reviewed by Geoffrey Garen.

Covered by manual testing.

* Modules/webdatabase/DOMWindowWebDatabase.idl:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateRuntimeEnableConditionalString):
* bindings/scripts/IDLAttributes.json:
* bindings/scripts/preprocess-idls.pl:
(GenerateConstructorAttributes):
* page/Quirks.cpp:
(WebCore::Quirks::hasWebSQLSupportQuirk const):
* page/Quirks.h:

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

7 months agoFlaky API Test TestWebKitAPI.ProcessSwap.LoadUnload
cdumez@apple.com [Fri, 1 Mar 2019 19:33:47 +0000 (19:33 +0000)]
Flaky API Test TestWebKitAPI.ProcessSwap.LoadUnload
https://bugs.webkit.org/show_bug.cgi?id=195110

Reviewed by Ryosuke Niwa.

The test was attempting to disable PageCache via view preferences instead of using the
process pool configuration flag. This would fail to disable PageCache because the
usesPageCache preference would not prevent the creation of SuspendedPageProxy objects.
As a result, the firing on the unload event would get delayed until the SuspendedPageProxy
objects would get destroyed, which would lead to flakiness.

This patch updates WebPageProxy::suspendCurrentPageIfPossible() to not create suspended
pages proxies when the usesPageCache preference is set to false.

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

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

7 months agoDFG: Loop-invariant code motion (LICM) should not hoist dead code
rmorisset@apple.com [Fri, 1 Mar 2019 19:24:08 +0000 (19:24 +0000)]
DFG: Loop-invariant code motion (LICM) should not hoist dead code
https://bugs.webkit.org/show_bug.cgi?id=194945
<rdar://problem/48311657>

Reviewed by Saam Barati.

* dfg/DFGLICMPhase.cpp:
(JSC::DFG::LICMPhase::run):

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

7 months ago[ContentChangeObserver] Rename members and move implementation to header.
zalan@apple.com [Fri, 1 Mar 2019 19:23:50 +0000 (19:23 +0000)]
[ContentChangeObserver] Rename members and move implementation to header.
https://bugs.webkit.org/show_bug.cgi?id=195198
<rdar://problem/48499967>

Reviewed by Simon Fraser.

* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
(WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
(WebCore::ContentChangeObserver::startObservingStyleRecalc):
(WebCore::ContentChangeObserver::stopObservingStyleRecalc):
(WebCore::ContentChangeObserver::startObservingContentChanges):
(WebCore::ContentChangeObserver::stopObservingContentChanges):
(WebCore::ContentChangeObserver::StyleRecalcScope::StyleRecalcScope):
(WebCore::ContentChangeObserver::StyleRecalcScope::~StyleRecalcScope):
(WebCore::ContentChangeObserver::startObservingStyleResolve): Deleted.
(WebCore::ContentChangeObserver::stopObservingStyleResolve): Deleted.
(WebCore::ContentChangeObserver::isObservingContentChanges): Deleted.
(WebCore::ContentChangeObserver::startObservingDOMTimerScheduling): Deleted.
(WebCore::ContentChangeObserver::stopObservingDOMTimerScheduling): Deleted.
(WebCore::ContentChangeObserver::isObservingDOMTimerScheduling): Deleted.
(WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling): Deleted.
(WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling): Deleted.
(WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling): Deleted.
(WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc): Deleted.
(WebCore::ContentChangeObserver::shouldObserveNextStyleRecalc): Deleted.
(WebCore::ContentChangeObserver::countOfObservedDOMTimers): Deleted.
(WebCore::ContentChangeObserver::clearObservedDOMTimers): Deleted.
(WebCore::ContentChangeObserver::containsObservedDOMTimer): Deleted.
* page/ios/ContentChangeObserver.h:
(WebCore::ContentChangeObserver::startObservingDOMTimerScheduling):
(WebCore::ContentChangeObserver::stopObservingDOMTimerScheduling):
(WebCore::ContentChangeObserver::isObservingDOMTimerScheduling const):
(WebCore::ContentChangeObserver::containsObservedDOMTimer const):
(WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling):
(WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling):
(WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling const):
(WebCore::ContentChangeObserver::setShouldObserveStyleRecalc):
(WebCore::ContentChangeObserver::shouldObserveStyleRecalc const):
(WebCore::ContentChangeObserver::isObservingContentChanges const):
(WebCore::ContentChangeObserver::countOfObservedDOMTimers const):
(WebCore::ContentChangeObserver::clearObservedDOMTimers):

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

7 months agoCodify the naming convention for fooIfExists
rniwa@webkit.org [Fri, 1 Mar 2019 19:21:15 +0000 (19:21 +0000)]
Codify the naming convention for fooIfExists
https://bugs.webkit.org/show_bug.cgi?id=194930

Reviewed by Darin Adler.

Updating the coding style guideline after the discussion following
https://lists.webkit.org/pipermail/webkit-dev/2013-June/025056.html

* code-style.md:

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

7 months ago[ContentChangeObserver] ContentChangeObserver::StyleChangeScope should not set WKCont...
zalan@apple.com [Fri, 1 Mar 2019 19:14:02 +0000 (19:14 +0000)]
[ContentChangeObserver] ContentChangeObserver::StyleChangeScope should not set WKContentVisibilityChange directly
https://bugs.webkit.org/show_bug.cgi?id=195197
<rdar://problem/48498332>

Reviewed by Simon Fraser.

Add didContentVisibilityChange to hide WKContentVisibilityChange value. We might also want to add some logic to didContentVisibilityChange at some point.

* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::didContentVisibilityChange):
(WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
* page/ios/ContentChangeObserver.h:

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

7 months ago[EME] Make sure the hasSessionSemaphore is set even if HAVE(AVSTREAMSESSION) is false
jer.noble@apple.com [Fri, 1 Mar 2019 19:10:58 +0000 (19:10 +0000)]
[EME] Make sure the hasSessionSemaphore is set even if HAVE(AVSTREAMSESSION) is false
https://bugs.webkit.org/show_bug.cgi?id=195217

Reviewed by Eric Carlson.

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

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

7 months ago[ThreadedCompositor] Simply the compositing run loop worker thread
commit-queue@webkit.org [Fri, 1 Mar 2019 18:08:00 +0000 (18:08 +0000)]
[ThreadedCompositor] Simply the compositing run loop worker thread
https://bugs.webkit.org/show_bug.cgi?id=195208

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2019-03-01
Reviewed by Don Olmstead.

We can remove the WorkQueuePool, since we never really supported more than one thread, and now that single
process model non longer exists it doesn't even make sense. We can simply use a RunLoop instead of a WorkQueue
so that the implementation is not specific to the generic WorkQueue implementation.

* Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
(WebKit::createRunLoop): Helper function to create the RunLoop in a worker thread before m_updateTimer is initialized.
(WebKit::CompositingRunLoop::CompositingRunLoop): Use createRunLoop().
(WebKit::CompositingRunLoop::~CompositingRunLoop): Stop the worker thread run loop in the next main run loop iteration.
(WebKit::CompositingRunLoop::performTask): Use m_runLoop.
(WebKit::CompositingRunLoop::performTaskSync): Ditto.
(WebKit::WorkQueuePool::singleton): Deleted.
(WebKit::WorkQueuePool::dispatch): Deleted.
(WebKit::WorkQueuePool::runLoop): Deleted.
(WebKit::WorkQueuePool::invalidate): Deleted.
(WebKit::WorkQueuePool::WorkQueuePool): Deleted.
(WebKit::WorkQueuePool::getOrCreateWorkQueueForContext): Deleted.
(): Deleted.
* Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:

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

7 months agoEnable WPT Pointer Events tests
commit-queue@webkit.org [Fri, 1 Mar 2019 17:57:56 +0000 (17:57 +0000)]
Enable WPT Pointer Events tests
https://bugs.webkit.org/show_bug.cgi?id=195204
<rdar://problem/48502751>

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

The touch-action property has been enabled as part of the work on webkit.org/b/195008 but the WPT tests
LayoutTests/imported/w3c:

had not been enabled yet, so we're now adding the progressions made.

* web-platform-tests/pointerevents/extension/pointerevent_touch-action-verification-expected.txt:
* web-platform-tests/pointerevents/pointerevent_touch-action-verification-expected.txt:

LayoutTests:

had not been enabled yet.

* platform/mac/TestExpectations:

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

7 months agoREGRESSION: (r242189): Six Layout Tests in storage/indexeddb/ are crashing after...
tsavell@apple.com [Fri, 1 Mar 2019 17:08:10 +0000 (17:08 +0000)]
REGRESSION: (r242189): Six Layout Tests in storage/indexeddb/ are crashing after r242189
https://bugs.webkit.org/show_bug.cgi?id=195210

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

7 months ago[Web GPU] 32-bit builds broken by attempt to disable WebGPU on 32-bit
justin_fan@apple.com [Fri, 1 Mar 2019 17:05:31 +0000 (17:05 +0000)]
[Web GPU] 32-bit builds broken by attempt to disable WebGPU on 32-bit
https://bugs.webkit.org/show_bug.cgi?id=195191

Rubber-stamped by Dean Jackson.

Dropping support for 32-bit entirely, so I'm intentionally leaving 32-bit broken.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

* Configurations/FeatureDefines.xcconfig:

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

7 months agoFix debug builds with GCC
dinfuehr@igalia.com [Fri, 1 Mar 2019 11:43:32 +0000 (11:43 +0000)]
Fix debug builds with GCC
https://bugs.webkit.org/show_bug.cgi?id=195205

Unreviewed. Fix debug builds in GCC by removing
the constexpr-keyword for this function.

* runtime/CachedTypes.cpp:
(JSC::tagFromSourceCodeType):

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

7 months ago[ARM] Fix assembler warnings in ctiMasmProbeTrampoline
dinfuehr@igalia.com [Fri, 1 Mar 2019 09:50:21 +0000 (09:50 +0000)]
[ARM] Fix assembler warnings in ctiMasmProbeTrampoline
https://bugs.webkit.org/show_bug.cgi?id=195164

Reviewed by Mark Lam.

Short branches in IT blocks are deprecated in AArch32. In addition the
the conditional branch was the only instruction in the IT block. Short
branches are able to encode the condition code themselves, the additional
IT instruction is not needed.

The assembler was also warning that writing into APSR without a bitmask
was deprecated. Therefore use APSR_nzcvq instead, this generates the same
instruction encoding.

* assembler/MacroAssemblerARMv7.cpp:

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

7 months agoUnreviewed, fix lldb webkitpy tests
ysuzuki@apple.com [Fri, 1 Mar 2019 08:41:23 +0000 (08:41 +0000)]
Unreviewed, fix lldb webkitpy tests
https://bugs.webkit.org/show_bug.cgi?id=194375

Since we changed the value of Is8Bit flag in StringImpl, we change lldb webkitpy tests accordingly.

* lldb/lldb_webkit.py:
(WTFStringImplProvider.is_8bit):

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

7 months agoRemove CachedPtr::m_isEmpty and CachedOptional::m_isEmpty fields
tzagallo@apple.com [Fri, 1 Mar 2019 07:31:44 +0000 (07:31 +0000)]
Remove CachedPtr::m_isEmpty and CachedOptional::m_isEmpty fields
https://bugs.webkit.org/show_bug.cgi?id=194999

Reviewed by Saam Barati.

These fields are unnecessary, since we can just check that m_offset
has not been initialized (I added VariableLengthObject::isEmpty for
that). They also add 7-byte padding to these classes, which is pretty
bad given how frequently CachedPtr is used.

* runtime/CachedTypes.cpp:
(JSC::CachedObject::operator new[]):
(JSC::VariableLengthObject::allocate):
(JSC::VariableLengthObject::isEmpty const):
(JSC::CachedPtr::encode):
(JSC::CachedPtr::decode const):
(JSC::CachedPtr::get const):
(JSC::CachedOptional::encode):
(JSC::CachedOptional::decode const):
(JSC::CachedOptional::decodeAsPtr const):

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

7 months agoHTTPSUpgradeList.db database should be opened in readonly mode
Hironori.Fujii@sony.com [Fri, 1 Mar 2019 04:40:56 +0000 (04:40 +0000)]
HTTPSUpgradeList.db database should be opened in readonly mode
https://bugs.webkit.org/show_bug.cgi?id=195194
<rdar://problem/47103889>

Unreviewed build fix for curl.

* platform/network/curl/CookieJarDB.cpp:
(WebCore::CookieJarDB::openDatabase): Removed the second arguemnt of SQLiteDatabase::open.

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

7 months agoUnreviewed Windows build fix after r242251.
cdumez@apple.com [Fri, 1 Mar 2019 03:41:21 +0000 (03:41 +0000)]
Unreviewed Windows build fix after r242251.

* platform/win/SearchPopupMenuDB.cpp:
(WebCore::SearchPopupMenuDB::openDatabase):

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

7 months ago[WinCairo] Turn ENABLE_RESOURCE_LOAD_STATISTICS on
don.olmstead@sony.com [Fri, 1 Mar 2019 03:35:32 +0000 (03:35 +0000)]
[WinCairo] Turn ENABLE_RESOURCE_LOAD_STATISTICS on
https://bugs.webkit.org/show_bug.cgi?id=194267

Reviewed by Brent Fulgham.

* Source/cmake/OptionsWin.cmake:

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

7 months ago[ContentChangeObserver] Move timer removal code from DOMWindow::clearTimeout to DOMTi...
zalan@apple.com [Fri, 1 Mar 2019 03:15:14 +0000 (03:15 +0000)]
[ContentChangeObserver] Move timer removal code from DOMWindow::clearTimeout to DOMTimer::removeById
https://bugs.webkit.org/show_bug.cgi?id=195143
<rdar://problem/48462351>

Reviewed by Simon Fraser.

Currently DOMWindow::clearTimeout() is the only callsite that we are interested in, but this is more future-proof.

* page/DOMTimer.cpp:
(WebCore::DOMTimer::removeById):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::clearTimeout):
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
(WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
(WebCore::ContentChangeObserver::didRemoveDOMTimer):
(WebCore::ContentChangeObserver::removeDOMTimer): Deleted.
* page/ios/ContentChangeObserver.h:

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