aacaf7326df24610267ce3f4f8fdc29d80d46142
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-03-11  Philippe Normand  <pnormand@igalia.com>
2
3         [GStreamer][v4l2] Synchronous video texture flushing support
4         https://bugs.webkit.org/show_bug.cgi?id=195453
5
6         Reviewed by Xabier Rodriguez-Calvar.
7
8         The v4l2 video decoder currently requires that downstream users of
9         the graphics resources complete any pending draw call and release
10         resources before returning from the DRAIN query.
11
12         To accomplish this the player monitors the pipeline and whenever a
13         v4l2 decoder is added, synchronous video texture flushing support
14         is enabled. Additionally and for all decoder configurations, a
15         flush is performed before disposing of the player.
16
17         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
18         (WebCore::MediaPlayerPrivateGStreamer::playbinDeepElementAddedCallback):
19         Monitor elements added to the decodebin bin.
20         (WebCore::MediaPlayerPrivateGStreamer::decodebinElementAdded): Set
21         a flag if a v4l2 decoder was added in decodebin.
22         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Connect
23         to the deep-element-added signal so as to monitor pipeline
24         topology updates.
25         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
26         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
27         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
28         Flush video texture before disposing of the player.
29         (WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
30         Synchronously flush if the pipeline contains a v4l2 decoder.
31         (WebCore::MediaPlayerPrivateGStreamerBase::createGLAppSink): Monitor push events only.
32         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
33         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
34         (WebCore::TextureMapperPlatformLayerProxy::pushNextBuffer): New
35         boolean flag used mostly to trigger synchronous flush conditions.
36         (WebCore::TextureMapperPlatformLayerProxy::dropCurrentBufferWhilePreservingTexture):
37         Optionally drop the current buffer in a synchronous manner. By
38         default the method keeps operating asynchronously.
39         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
40
41 2019-03-11  Antti Koivisto  <antti@apple.com>
42
43         Rename contentOffsetInCompostingLayer to contentOffsetInCompositingLayer
44         https://bugs.webkit.org/show_bug.cgi?id=195553
45
46         Reviewed by Simon Fraser.
47
48         Less composting, more compositing.
49
50         * rendering/RenderLayerBacking.cpp:
51         (WebCore::RenderLayerBacking::updateBackdropFiltersGeometry):
52         (WebCore::RenderLayerBacking::resetContentsRect):
53         (WebCore::RenderLayerBacking::updateChildClippingStrategy):
54         (WebCore::RenderLayerBacking::updateImageContents):
55         (WebCore::RenderLayerBacking::contentOffsetInCompositingLayer const):
56         (WebCore::RenderLayerBacking::contentsBox const):
57         (WebCore::RenderLayerBacking::backgroundBoxForSimpleContainerPainting const):
58         (WebCore::RenderLayerBacking::contentOffsetInCompostingLayer const): Deleted.
59         * rendering/RenderLayerBacking.h:
60
61 2019-03-10  Ross Kirsling  <ross.kirsling@sony.com>
62
63         Invalid flags in a RegExp literal should be an early SyntaxError
64         https://bugs.webkit.org/show_bug.cgi?id=195514
65
66         Reviewed by Darin Adler.
67
68         * bindings/js/SerializedScriptValue.cpp:
69         (WebCore::CloneDeserializer::readTerminal):
70         Consume YarrFlags.
71
72 2019-03-10  Tim Horton  <timothy_horton@apple.com>
73
74         Add SPI to retrieve the set of text inputs in a given rect, and later focus one
75         https://bugs.webkit.org/show_bug.cgi?id=195499
76
77         Reviewed by Darin Adler.
78
79         New API tests: WebKit.RequestTextInputContext and WebKit.FocusTextInputContext
80
81         * WebCore.xcodeproj/project.pbxproj:
82         * dom/Document.cpp:
83         (WebCore::Document::identifierForElement):
84         (WebCore::Document::elementWithIdentifier):
85         (WebCore::Document::identifiedElementWasRemovedFromDocument):
86         * dom/Document.h:
87         Add a mechanism where Document will vend an ObjectIdentifier for a given
88         element, and can (if possible) retrieve that element later.
89
90         * dom/Element.cpp:
91         (WebCore::Element::removedFromAncestor):
92         If an Element has an identifier created for it, inform Document to remove
93         it from the identifier map when the element is detached.
94
95         (WebCore::Element::createElementIdentifier):
96         * dom/Element.h:
97         * dom/ElementIdentifier.h: Added.
98         * dom/ElementRareData.cpp:
99         * dom/ElementRareData.h:
100         (WebCore::ElementRareData::hasElementIdentifier const):
101         (WebCore::ElementRareData::setHasElementIdentifier):
102         (WebCore::ElementRareData::ElementRareData):
103         Store a bit indicating if the Element has had a identifier created for it,
104         so that we can avoid a hash lookup on every Element removal.
105
106         * dom/Node.h:
107         * html/HTMLTextFormControlElement.h:
108
109 2019-03-10  Zalan Bujtas  <zalan@apple.com>
110
111         [ContentChangeObserver] Fix failing test cases
112         https://bugs.webkit.org/show_bug.cgi?id=195524
113         <rdar://problem/48745101>
114
115         Reviewed by Simon Fraser.
116
117         1. Do not start DOM timer install observation when we already detected change at touchstart.
118         2. hasPendingActivity() should only care about ContentChangeObserver flags.
119         3. Do not try to notify the client when we are in the mouseMoved dispatch call (currently it could happen
120         when a timer gets intalled and removed right away).
121
122         * page/ios/ContentChangeObserver.cpp:
123         (WebCore::ContentChangeObserver::adjustObservedState):
124         (WebCore::ContentChangeObserver::isNotifyContentChangeAllowed const): Deleted.
125         * page/ios/ContentChangeObserver.h:
126         (WebCore::ContentChangeObserver::hasPendingActivity const):
127         (WebCore::ContentChangeObserver::isObservationTimeWindowActive const):
128
129 2019-03-10  Simon Fraser  <simon.fraser@apple.com>
130
131         ScrollingTree should have the final say on where layers go
132         https://bugs.webkit.org/show_bug.cgi?id=195507
133
134         Reviewed by Antti Koivisto.
135
136         Main thread layer flushing can race with scrolling tree layer changes on macOS, causing
137         flashing as layers jump around sometimes. We go to some lengths to avoid this by trying
138         not to touch properties on layers that are being interacted with (scrollableArea->setIsUserScroll in
139         updateScrollPositionAfterAsyncScroll()), but that's fragile.
140
141         This patch adds ScrollingTree::applyScrollingTreeLayerPositions(), which enters
142         ScrollingTree::applyLayerPositions() on the main thread/UI process. This traverses
143         the tree allowing each node to run their layer positioning logic.
144
145         For macOS WK2, this is called from TiledCoreAnimationDrawingArea::flushLayers() after flushCompositingStateIncludingSubframes().
146         For macOS WK2 with UI-side compositing, RemoteLayerTreeDrawingAreaProxy::commitLayerTree()
147         calls m_webPageProxy.scrollingCoordinatorProxy()->applyScrollingTreeLayerPositions().
148         iOS WK2 is unchanged, using viewportChangedViaDelegatedScrolling() which does the same thing, allowing
149         for the dynamic viewport changes that happen when zooming on iOS.
150
151         Testing this requires infrastructure that we don't have yet.
152
153         * page/scrolling/AsyncScrollingCoordinator.cpp:
154         (WebCore::AsyncScrollingCoordinator::applyScrollingTreeLayerPositions):
155         * page/scrolling/AsyncScrollingCoordinator.h:
156         * page/scrolling/ScrollingCoordinator.h:
157         (WebCore::ScrollingCoordinator::applyScrollingTreeLayerPositions):
158         * page/scrolling/ScrollingTree.cpp:
159         (WebCore::ScrollingTree::handleWheelEvent):
160         (WebCore::ScrollingTree::commitTreeState):
161         (WebCore::ScrollingTree::applyLayerPositions):
162         (WebCore::ScrollingTree::applyLayerPositionsRecursive):
163         * page/scrolling/ScrollingTree.h:
164         * page/scrolling/ScrollingTreeFrameHostingNode.cpp:
165         (WebCore::ScrollingTreeFrameHostingNode::applyLayerPositions):
166         * page/scrolling/ScrollingTreeFrameHostingNode.h:
167         * page/scrolling/ScrollingTreeNode.h:
168         * page/scrolling/ScrollingTreeScrollingNode.cpp:
169         (WebCore::ScrollingTreeScrollingNode::applyLayerPositions):
170         * page/scrolling/ScrollingTreeScrollingNode.h:
171         * page/scrolling/cocoa/ScrollingTreeFixedNode.h:
172         * page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
173         (WebCore::ScrollingTreeFixedNode::relatedNodeScrollPositionDidChange):
174         * page/scrolling/cocoa/ScrollingTreeStickyNode.h:
175         * page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
176         (WebCore::ScrollingTreeStickyNode::applyLayerPositions):
177         (WebCore::ScrollingTreeStickyNode::relatedNodeScrollPositionDidChange):
178         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
179         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
180         (WebCore::ScrollingTreeFrameScrollingNodeMac::applyLayerPositions):
181
182 2019-03-09  Andy Estes  <aestes@apple.com>
183
184         [Apple Pay] CanMakePaymentsWithActiveCard and OpenPaymentSetup should be async messages
185         https://bugs.webkit.org/show_bug.cgi?id=195526
186         <rdar://problem/48745636>
187
188         Reviewed by Chris Dumez.
189
190         * Modules/applepay/PaymentCoordinatorClient.h:
191         * loader/EmptyClients.cpp:
192         * testing/MockPaymentCoordinator.cpp:
193         (WebCore::MockPaymentCoordinator::canMakePaymentsWithActiveCard):
194         (WebCore::MockPaymentCoordinator::openPaymentSetup):
195         * testing/MockPaymentCoordinator.h:
196
197 2019-03-09  Zalan Bujtas  <zalan@apple.com>
198
199         [ContentChangeObserver] Click event fires immediately on hover menu at seriouseats.com
200         https://bugs.webkit.org/show_bug.cgi?id=195520
201         <rdar://problem/48740098>
202
203         Reviewed by Simon Fraser.
204
205         Unfortunately seriouseats has a 300ms hover intent delay to deal with accidental menupane pop-ups. This page also hides this
206         non-fixed width menupane using absolute positioning and negative left.  
207
208         Test: fast/events/touch/ios/content-observation/move-content-from-offscreen.html
209
210         * page/ios/ContentChangeObserver.cpp:
211         (WebCore::ContentChangeObserver::didInstallDOMTimer):
212         (WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
213         (WebCore::ContentChangeObserver::StyleChangeScope::isConsideredHidden const): Content auhtors tend to use x - 1 values (where x = 10^y)
214
215 2019-03-09  Chris Dumez  <cdumez@apple.com>
216
217         Add assertions to help debug crash under DOMWindowExtension::suspendForPageCache()
218         https://bugs.webkit.org/show_bug.cgi?id=195488
219
220         Reviewed by Ryosuke Niwa.
221
222         Try and figure out how the document can be detached from its frame while we're suspending
223         DOMWindowExtensions.
224
225         * page/DOMWindow.cpp:
226         (WebCore::DOMWindow::willDetachDocumentFromFrame):
227         (WebCore::DOMWindow::suspendForPageCache):
228         * page/DOMWindow.h:
229
230 2019-03-09  Chris Dumez  <cdumez@apple.com>
231
232         Simplify DOMWindowProperty code / handling
233         https://bugs.webkit.org/show_bug.cgi?id=195495
234
235         Reviewed by Ryosuke Niwa.
236
237         DOMWindowProperty code was unnecessarily complex because DOMWindowExtension inherited
238         from it and DOMWindowExtension needs a lot of information about the global object's
239         lifetime to communicate to the injected bbundle client. This subclassing is also
240         very confusing because a DOMWindowExtension is not a *property* on the Window object.
241
242         This patch updates DOMWindowExtension to stop subclassing DOMWindowProperty and
243         moves all the complexity from DOMWindowProperty to DOMWindowExtension.
244         DOMWindowProperty is now a very simple base class which merely has a WeakPtr to
245         the window and getters for the window and the frame.
246
247         * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
248         (WebCore::DOMWindowIndexedDatabase::DOMWindowIndexedDatabase):
249         (WebCore::DOMWindowIndexedDatabase::indexedDB):
250         * Modules/indexeddb/DOMWindowIndexedDatabase.h:
251         There is no reason for DOMWindowIndexedDatabase to move its IDBFactory to a
252         separate data member which in PageCache. Script do not run while in PageCache.
253         Also, frames are nulled out while in the PageCache so the indexedDB() getter
254         would return null anyway while in PageCache.
255
256         * css/StyleMedia.idl:
257         * loader/appcache/ApplicationCacheHost.cpp:
258         (WebCore::ApplicationCacheHost::setDOMApplicationCache):
259         Store a WeakPtr to the DOMApplicationCache for safety.
260
261         (WebCore::ApplicationCacheHost::dispatchDOMEvent):
262         Do not fire events on the DOMApplicationCache if it is frameless to maintain
263         previous behavior. Previously, the DOMApplicationCache would have been nulled
264         out when detached from its frame so we would not have fired events.
265
266         * loader/appcache/ApplicationCacheHost.h:
267         * loader/appcache/DOMApplicationCache.cpp:
268         * loader/appcache/DOMApplicationCache.h:
269         Remove some unnecessary complexity. The ApplicationCacheHost is owned by the
270         DocumentLoader, which changes on navigation. There is therefore no reason to
271         null out the DOMApplicationCache on the ApplicationCacheHost when its gets
272         detached from its frame or enters PageCache.
273
274         * page/BarProp.idl:
275         * page/DOMSelection.idl:
276         * page/DOMWindow.cpp:
277         (WebCore::DOMWindow::willDestroyCachedFrame):
278         (WebCore::DOMWindow::willDestroyDocumentInFrame):
279         (WebCore::DOMWindow::willDetachDocumentFromFrame):
280         (WebCore::DOMWindow::registerExtension):
281         (WebCore::DOMWindow::unregisterExtension):
282
283         (WebCore::DOMWindow::resetDOMWindowProperties): Removed.
284         Stop clearing some of the DOMWindow's properties when the document gets destroyed or when
285         the Window for the initial empty document gets reused on navigation. I think we used to
286         need this because DOMWindowProperty used to hold pointers to their frame. However, this
287         is no longer the case nowadays as DOMWindowProperty objects get their frame from their
288         Window.
289
290         (WebCore::DOMWindow::resetUnlessSuspendedForDocumentSuspension):
291         (WebCore::DOMWindow::suspendForPageCache):
292         (WebCore::DOMWindow::resumeFromPageCache):
293         * page/DOMWindow.h:
294         * page/DOMWindowExtension.cpp:
295         (WebCore::DOMWindowExtension::DOMWindowExtension):
296         (WebCore::DOMWindowExtension::~DOMWindowExtension):
297         (WebCore::DOMWindowExtension::frame const):
298         (WebCore::DOMWindowExtension::suspendForPageCache):
299         (WebCore::DOMWindowExtension::resumeFromPageCache):
300         (WebCore::DOMWindowExtension::willDestroyGlobalObjectInCachedFrame):
301         (WebCore::DOMWindowExtension::willDestroyGlobalObjectInFrame):
302         (WebCore::DOMWindowExtension::willDetachGlobalObjectFromFrame):
303         * page/DOMWindowExtension.h:
304         * page/DOMWindowProperty.cpp:
305         (WebCore::DOMWindowProperty::DOMWindowProperty):
306         * page/DOMWindowProperty.h:
307         (WebCore::DOMWindowProperty::window const):
308         * page/History.idl:
309         * page/Location.idl:
310         * page/Navigator.cpp:
311         (WebCore::Navigator::plugins):
312         (WebCore::Navigator::mimeTypes):
313         * page/PerformanceNavigation.idl:
314         * page/PerformanceTiming.idl:
315         * page/Screen.idl:
316         * page/VisualViewport.cpp:
317         (WebCore::VisualViewport::scriptExecutionContext const):
318         * plugins/DOMMimeTypeArray.idl:
319         * plugins/DOMPluginArray.idl:
320
321 2019-03-09  Zalan Bujtas  <zalan@apple.com>
322
323         [ContentChangeObserver] Start observing for content change between touchEnd and mouseMoved start
324         https://bugs.webkit.org/show_bug.cgi?id=195510
325         <rdar://problem/48735695>
326
327         Reviewed by Simon Fraser.
328
329         This patch covers the observation of async changes triggered by touchStart/touchEnd (animations, timers, style recalcs).
330
331         Test: fast/events/touch/ios/content-observation/visibility-change-after-touch-end.html
332
333         * page/ios/ContentChangeObserver.cpp:
334         (WebCore::ContentChangeObserver::didCancelTouchEvent):
335         (WebCore::ContentChangeObserver::adjustObservedState):
336         * page/ios/ContentChangeObserver.h:
337         (WebCore::ContentChangeObserver::setIsInBetweenTouchEndAndMouseMoved):
338         (WebCore::ContentChangeObserver::isInBetweenTouchEndAndMouseMoved const):
339         (WebCore::ContentChangeObserver::isObservingContentChanges const):
340
341 2019-03-08  Simon Fraser  <simon.fraser@apple.com>
342
343         Make it clearer which data is protected by the two locks in ScrollingTree
344         https://bugs.webkit.org/show_bug.cgi?id=195501
345
346         Reviewed by Tim Horton.
347
348         Gather ScrollingTree member variables into two structs, and name the struct
349         members and the locks to make it clear which data is protected by each lock.
350         
351         We only need to protect data read by multiple threads; these are the scrolling
352         thread, the event handling thread (which runs ThreadedScrollingTree::tryToHandleWheelEvent()),
353         and the main thread, which pokes various bits of pin/rubber-banding state.
354         Ideally the main thread would always push data to the scrolling thread via a commit,
355         but that's not what happens now.
356
357         Suspiciously, ScrollingTree::shouldHandleWheelEventSynchronously() uses the root node,
358         so should probably hold a lock shared with the scrolling thread (webkit.org/b/195502).
359         
360         * page/scrolling/ScrollingTree.cpp:
361         (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
362         (WebCore::ScrollingTree::commitTreeState):
363         (WebCore::ScrollingTree::setAsyncFrameOrOverflowScrollingEnabled):
364         (WebCore::ScrollingTree::setMainFrameScrollPosition):
365         (WebCore::ScrollingTree::eventTrackingTypeForPoint):
366         (WebCore::ScrollingTree::isRubberBandInProgress):
367         (WebCore::ScrollingTree::setMainFrameIsRubberBanding):
368         (WebCore::ScrollingTree::isScrollSnapInProgress):
369         (WebCore::ScrollingTree::setMainFrameIsScrollSnapping):
370         (WebCore::ScrollingTree::setMainFramePinState):
371         (WebCore::ScrollingTree::setCanRubberBandState):
372         (WebCore::ScrollingTree::setScrollPinningBehavior):
373         (WebCore::ScrollingTree::scrollPinningBehavior):
374         (WebCore::ScrollingTree::willWheelEventStartSwipeGesture):
375         (WebCore::ScrollingTree::latchedNode):
376         (WebCore::ScrollingTree::setLatchedNode):
377         (WebCore::ScrollingTree::clearLatchedNode):
378         (WebCore::ScrollingTree::scrollingTreeAsText):
379         (WebCore::ScrollingTree::touchActionDataAtPoint const):
380         (WebCore::ScrollingTree::mainFrameScrollPosition): Deleted.
381         (WebCore::ScrollingTree::mainFrameLayoutViewport): Deleted.
382         (WebCore::ScrollingTree::rubberBandsAtLeft): Deleted.
383         (WebCore::ScrollingTree::rubberBandsAtRight): Deleted.
384         (WebCore::ScrollingTree::rubberBandsAtBottom): Deleted.
385         (WebCore::ScrollingTree::rubberBandsAtTop): Deleted.
386         * page/scrolling/ScrollingTree.h:
387         (WebCore::ScrollingTree::hasLatchedNode const):
388         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
389         (WebCore::ScrollingTreeScrollingNodeDelegateMac::stretchAmount):
390         * platform/graphics/FloatPoint.h:
391         (WebCore::FloatPoint::isZero const):
392
393 2019-03-08  Simon Fraser  <simon.fraser@apple.com>
394
395         Share some code that sets CALayer positions
396         https://bugs.webkit.org/show_bug.cgi?id=195485
397
398         Reviewed by Zalan Bujtas.
399
400         Share some code between ScrollingTreeStickyNode and ScrollingTreeFixedNode that sets the position
401         of a CALayer given the top-left location.
402
403         * page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
404         (WebCore::ScrollingTreeFixedNode::relatedNodeScrollPositionDidChange):
405         (WebCore::ScrollingTreeFixedNodeInternal::operator*): Deleted.
406         * page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
407         (WebCore::ScrollingTreeStickyNode::relatedNodeScrollPositionDidChange):
408         (WebCore::ScrollingTreeStickyNodeInternal::operator*): Deleted.
409         * platform/graphics/cocoa/WebCoreCALayerExtras.h:
410         * platform/graphics/cocoa/WebCoreCALayerExtras.mm:
411         (-[CALayer _web_setLayerTopLeftPosition:]):
412
413 2019-03-08  Chris Dumez  <cdumez@apple.com>
414
415         Add support for Device Orientation / Motion permission API
416         https://bugs.webkit.org/show_bug.cgi?id=195329
417         <rdar://problem/47645367>
418
419         Reviewed by Geoffrey Garen.
420
421         Add support for Device Orientation / Motion permission API:
422         - https://github.com/w3c/deviceorientation/issues/57
423
424         Pages can add event listeners for 'deviceorientation' / 'devicemotion' events but
425         such events will not be fired until the page's JavaScript calls
426         DeviceOrientationEvent.requestPermission() / DeviceMotionEvent.requestPermission()
427         and the user grants the request.
428
429         The feature is currently behind an experimental feature flag, off by default.
430
431         Tests: fast/device-orientation/device-motion-request-permission-denied.html
432                fast/device-orientation/device-motion-request-permission-granted.html
433                fast/device-orientation/device-motion-request-permission-user-gesture.html
434                fast/device-orientation/device-orientation-request-permission-denied.html
435                fast/device-orientation/device-orientation-request-permission-granted.html
436                fast/device-orientation/device-orientation-request-permission-user-gesture.html
437
438         * CMakeLists.txt:
439         * DerivedSources-input.xcfilelist:
440         * DerivedSources-output.xcfilelist:
441         * DerivedSources.make:
442         * Sources.txt:
443         * WebCore.xcodeproj/project.pbxproj:
444         * dom/DeviceMotionEvent.h:
445         * dom/DeviceMotionEvent.idl:
446         * dom/DeviceOrientationAndMotionAccessController.cpp: Added.
447         (WebCore::DeviceOrientationAndMotionAccessController::DeviceOrientationAndMotionAccessController):
448         (WebCore::DeviceOrientationAndMotionAccessController::shouldAllowAccess):
449         (WebCore::DeviceOrientationAndMotionAccessController::setAccessState):
450         * dom/DeviceOrientationAndMotionAccessController.h: Added.
451         (WebCore::DeviceOrientationAndMotionAccessController::accessState const):
452         * dom/DeviceOrientationEvent.h:
453         * dom/DeviceOrientationEvent.idl:
454         * dom/DeviceOrientationOrMotionEvent.cpp: Added.
455         (WebCore::DeviceOrientationOrMotionEvent::requestPermission):
456         * dom/DeviceOrientationOrMotionEvent.h: Added.
457         * dom/DeviceOrientationOrMotionEvent.idl: Added.
458         * dom/DeviceOrientationOrMotionPermissionState.h: Added.
459         * dom/DeviceOrientationOrMotionPermissionState.idl: Added.
460         * dom/Document.cpp:
461         (WebCore::Document::deviceOrientationAndMotionAccessController):
462         * dom/Document.h:
463         * dom/Event.cpp:
464         * dom/MessagePort.cpp:
465         * dom/Microtasks.cpp:
466         * page/ChromeClient.h:
467         * page/DOMWindow.cpp:
468         (WebCore::DOMWindow::addEventListener):
469         (WebCore::DOMWindow::deviceOrientationController const):
470         (WebCore::DOMWindow::deviceMotionController const):
471         (WebCore::DOMWindow::isAllowedToUseDeviceMotionOrientation const):
472         (WebCore::DOMWindow::isAllowedToAddDeviceMotionOrientationListener const):
473         (WebCore::DOMWindow::startListeningForDeviceOrientationIfNecessary):
474         (WebCore::DOMWindow::stopListeningForDeviceOrientationIfNecessary):
475         (WebCore::DOMWindow::startListeningForDeviceMotionIfNecessary):
476         (WebCore::DOMWindow::stopListeningForDeviceMotionIfNecessary):
477         (WebCore::DOMWindow::removeEventListener):
478         (WebCore::DOMWindow::removeAllEventListeners):
479         * page/DOMWindow.h:
480         * page/DeviceController.cpp:
481         (WebCore::DeviceController::hasDeviceEventListener const):
482         * page/DeviceController.h:
483         * page/Settings.yaml:
484
485 2019-03-08  Zalan Bujtas  <zalan@apple.com>
486
487         [ContentChangeObserver] Expand "isConsideredClickable" to descendants
488         https://bugs.webkit.org/show_bug.cgi?id=195478
489         <rdar://problem/48724935>
490
491         Reviewed by Simon Fraser.
492
493         In StyleChangeScope we try to figure out whether newly visible content should stick (menu panes etc) by checking if it is clickable.
494         This works fine as long as all the visible elements are gaining new renderers through this style update processs.
495         However when an element becomes visible by a change other than display: (not)none, it's not sufficient to just check the element itself,
496         since it might not respond to click at all, while its descendants do.
497         A concrete example is a max-height value change on usps.com, where the max-height is on a container (menu pane).
498         This container itself is not clickable while most of its children are (menu items).    
499
500         Test: fast/events/touch/ios/content-observation/clickable-content-is-inside-a-container.html
501
502         * page/ios/ContentChangeObserver.cpp:
503         (WebCore::ContentChangeObserver::StyleChangeScope::StyleChangeScope):
504         (WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
505         (WebCore::ContentChangeObserver::StyleChangeScope::isConsideredHidden const):
506         (WebCore::ContentChangeObserver::StyleChangeScope::isConsideredClickable const):
507         (WebCore::isConsideredHidden): Deleted.
508         * page/ios/ContentChangeObserver.h:
509
510 2019-03-08  Zalan Bujtas  <zalan@apple.com>
511
512         [ContentChangeObserver] Cleanup adjustObservedState
513         https://bugs.webkit.org/show_bug.cgi?id=195470
514         <rdar://problem/48717823>
515
516         Reviewed by Simon Fraser.
517
518         This is in preparation for introducing an observation window from touchStart -> mouseMoved.
519         1. Cancel pending activities (future timers, pending stylesheet recalcs) when visible content change is detected.
520         2. The fixed time window takes care of notifying the client -timers, style recalcs during the window should not signal themselves.  
521         3. Reset m_isObservingPendingStyleRecalc at StartedStyleRecalc instead of EndedStyleRecalc. 
522
523         * page/ios/ContentChangeObserver.cpp:
524         (WebCore::ContentChangeObserver::domTimerExecuteDidFinish):
525         (WebCore::ContentChangeObserver::styleRecalcDidStart):
526         (WebCore::ContentChangeObserver::styleRecalcDidFinish):
527         (WebCore::ContentChangeObserver::adjustObservedState):
528         * page/ios/ContentChangeObserver.h:
529         (WebCore::ContentChangeObserver::hasPendingActivity const):
530         (WebCore::ContentChangeObserver::isObservationTimeWindowActive const):
531
532 2019-03-08  Zalan Bujtas  <zalan@apple.com>
533
534         [ContentChangeObserver] Add StartedDOMTimerExecution and StartedStyleRecalc
535         https://bugs.webkit.org/show_bug.cgi?id=195463
536         <rdar://problem/48714762>
537
538         Reviewed by Simon Fraser.
539
540         This is in preparation for introducing m_isObservingContentChanges flag to track observing state across events (touchStart -> mouseMoved).
541
542         * page/ios/ContentChangeObserver.cpp:
543         (WebCore::ContentChangeObserver::domTimerExecuteDidStart):
544         (WebCore::ContentChangeObserver::styleRecalcDidStart):
545         (WebCore::ContentChangeObserver::styleRecalcDidFinish):
546         (WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc):
547         (WebCore::ContentChangeObserver::adjustObservedState):
548         * page/ios/ContentChangeObserver.h:
549         (WebCore::ContentChangeObserver::isObservingPendingStyleRecalc const):
550         (WebCore::ContentChangeObserver::isObservingStyleRecalc const): Deleted.
551
552 2019-03-08  Chris Fleizach  <cfleizach@apple.com>
553
554         AX: AOM accessibleclick does not work on iOS
555         https://bugs.webkit.org/show_bug.cgi?id=195423
556         <rdar://problem/48682110>
557
558         Reviewed by Joanmarie Diggs.
559
560         Return this value of this method so it can be surfaced to a higher level.
561
562         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
563         (-[WebAccessibilityObjectWrapper _accessibilityActivate]):
564
565 2019-03-08  Chris Dumez  <cdumez@apple.com>
566
567         imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_error.html is a flaky crash
568         https://bugs.webkit.org/show_bug.cgi?id=195441
569         <rdar://problem/43437394>
570
571         Reviewed by Alexey Proskuryakov.
572
573         FileReader is an ActiveDOMObject, which means that FileReader::stop() gets called when
574         its script execution context is about to get destroyed. FileReader::stop() sets m_state
575         to DONE. FileReader::abort() would schedule an asynchronous task and then ASSERT that
576         m_state is not DONE, which would hit if FileReader::stop() had been called in between
577         the task being scheduled and its execution. To address the issue, have the task abort
578         early if isContextStopped() returns true.
579
580         Also replace calls to setPendingActivity() / unsetPendingActivity() with a
581         PendingActivity data member as mismatched call to those can lead to leaks.
582
583         * fileapi/FileReader.cpp:
584         (WebCore::FileReader::canSuspendForDocumentSuspension const):
585         No reason not to suspend if there is no pending read.
586
587         (WebCore::FileReader::stop):
588         (WebCore::FileReader::readInternal):
589         (WebCore::FileReader::abort):
590         (WebCore::FileReader::didFinishLoading):
591         (WebCore::FileReader::didFail):
592         * fileapi/FileReader.h:
593
594 2019-03-08  Zan Dobersek  <zdobersek@igalia.com>
595
596         GLContextEGL: desired EGL config should search for 8-bit components by default
597         https://bugs.webkit.org/show_bug.cgi?id=195413
598
599         Reviewed by Carlos Garcia Campos.
600
601         The EGL config search in GLContextEGL should by default look for
602         RGBA8888 configurations while allowing RGB565 as an alternative.
603         This prevents from accidentally landing on an RGBA1010102
604         configuration that is available with some graphics stacks, and which is
605         not expected in e.g. window snapshotting that's done for layout test
606         output comparison.
607
608         * platform/graphics/egl/GLContextEGL.cpp:
609         (WebCore::GLContextEGL::getEGLConfig): EGL config search should by
610         default request 8-bit color channels.
611
612 2019-03-08  Miguel Gomez  <magomez@igalia.com>
613
614         Use a thread safe refcounter for FilterOperation.
615         https://bugs.webkit.org/show_bug.cgi?id=194149
616
617         Reviewed by Carlos Garcia Campos.
618
619         Use a thread safe refcounter for FilterOperation.
620
621         * platform/graphics/filters/FilterOperation.h:
622
623 2019-03-07  Yusuke Suzuki  <ysuzuki@apple.com>
624
625         [JSC] Make more fields lazy in JSGlobalObject
626         https://bugs.webkit.org/show_bug.cgi?id=195449
627
628         Reviewed by Mark Lam.
629
630         Use arrayBufferConstructor() since getDirect does not work with lazy property.
631
632         * bindings/js/JSDOMGlobalObject.cpp:
633         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
634
635 2019-03-07  Zalan Bujtas  <zalan@apple.com>
636
637         [ContentChangeObserver][REGRESSION] Check if visibility change happens while dispatching mouseMoved
638         https://bugs.webkit.org/show_bug.cgi?id=195421
639         <rdar://problem/48682004>
640
641         Reviewed by Simon Fraser.
642
643         Visibility change might be triggered synchronously while dispatching mouseMoved event.
644
645         Test: fast/events/touch/ios/content-observation/visibility-change-happens-while-in-mousemoved.html
646
647         * page/ios/ContentChangeObserver.cpp:
648         (WebCore::ContentChangeObserver::mouseMovedDidStart):
649         (WebCore::ContentChangeObserver::mouseMovedDidFinish):
650         (WebCore::ContentChangeObserver::isNotifyContentChangeAllowed const):
651         * page/ios/ContentChangeObserver.h:
652         (WebCore::ContentChangeObserver::isObservingContentChanges const):
653
654 2019-03-07  Zalan Bujtas  <zalan@apple.com>
655
656         [ContentChangeObserver] Check if max-height change triggers visible content change.
657         https://bugs.webkit.org/show_bug.cgi?id=195417
658         <rdar://problem/48680631>
659
660         Reviewed by Simon Fraser.
661
662         A fixed max-height non-zero value could indicate visible content change. usps.com uses this technique to show menu panes.  
663
664         Test: fast/events/touch/ios/content-observation/visibility-change-is-max-height-change.html
665
666         * page/ios/ContentChangeObserver.cpp:
667         (WebCore::isConsideredHidden):
668         (WebCore::ContentChangeObserver::StyleChangeScope::StyleChangeScope):
669         (WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
670         (WebCore::elementImplicitVisibility): Deleted.
671         * page/ios/ContentChangeObserver.h:
672
673 2019-03-07  Yusuke Suzuki  <ysuzuki@apple.com>
674
675         Unreviewed, fix failing EWS build for ios-sim
676
677         * page/ios/ContentChangeObserver.cpp:
678         (WebCore::ContentChangeObserver::touchEventDidStart):
679
680 2019-03-07  Eric Carlson  <eric.carlson@apple.com>
681
682         [MSE] Adopt new AVSampleBufferDisplayLayer SPI
683         https://bugs.webkit.org/show_bug.cgi?id=195445
684         <rdar://problem/48480516>
685
686         Reviewed by Jer Noble.
687
688         No new tests, no functional change.
689
690         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
691         (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC): Only register for 
692         kCMSampleBufferConsumerNotification_BufferConsumed notiication when
693         -[AVSampleBufferDisplayLayer prerollDecodeWithCompletionHandler:] isn't available.
694         (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC): Ditto, for unregistering.
695         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample): Use 
696         -[AVSampleBufferDisplayLayer prerollDecodeWithCompletionHandler:] when possible.
697
698 2019-03-07  Zalan Bujtas  <zalan@apple.com>
699
700         [ContentChangeObserver] Click event fires immediately on hover menu at Ebbets.com
701         https://bugs.webkit.org/show_bug.cgi?id=195397
702
703         Reviewed by Simon Fraser.
704
705         This patch introduces TouchEventScope to track changes triggered by touch start.
706
707         Test: fast/events/touch/ios/content-observation/visibility-change-on-touch-start-simple.html
708
709         * page/ios/ContentChangeObserver.cpp:
710         (WebCore::ContentChangeObserver::touchEventDidStart):
711         (WebCore::ContentChangeObserver::touchEventDidFinish):
712         (WebCore::ContentChangeObserver::mouseMovedDidStart):
713         (WebCore::ContentChangeObserver::mouseMovedDidFinish):
714         (WebCore::ContentChangeObserver::adjustObservedState):
715         (WebCore::ContentChangeObserver::TouchEventScope::TouchEventScope):
716         (WebCore::ContentChangeObserver::TouchEventScope::~TouchEventScope):
717         * page/ios/ContentChangeObserver.h:
718         (WebCore::ContentChangeObserver::isObservingContentChanges const):
719
720 2019-03-07  Zalan Bujtas  <zalan@apple.com>
721
722         [ContentChangeObserver] Introduce fixed duration content observation
723         https://bugs.webkit.org/show_bug.cgi?id=195295
724         <rdar://problem/48579913>
725
726         Reviewed by Simon Fraser.
727
728         Some pages have a runloop-like scheduling setup where the content triggering change happens at a nested timer firing.
729         This patch helps finding cases like that using a 32ms long fixed window. Currently nested timers get dropped on the floor and
730         we stop observing for content changes before they even get fired.
731
732         Test: fast/events/touch/ios/content-observation/visibility-change-happens-on-timer-hops.html
733
734         * page/ios/ContentChangeObserver.cpp:
735         (WebCore::ContentChangeObserver::ContentChangeObserver):
736         (WebCore::ContentChangeObserver::startContentObservationForDuration):
737         (WebCore::ContentChangeObserver::completeDurationBasedContentObservation):
738         (WebCore::ContentChangeObserver::didInstallDOMTimer):
739         (WebCore::ContentChangeObserver::didRemoveDOMTimer):
740         (WebCore::ContentChangeObserver::domTimerExecuteDidStart):
741         (WebCore::ContentChangeObserver::domTimerExecuteDidFinish):
742         (WebCore::ContentChangeObserver::styleRecalcDidStart):
743         (WebCore::ContentChangeObserver::styleRecalcDidFinish):
744         (WebCore::ContentChangeObserver::cancelPendingActivities):
745         (WebCore::ContentChangeObserver::didSuspendActiveDOMObjects):
746         (WebCore::ContentChangeObserver::willDetachPage):
747         (WebCore::ContentChangeObserver::contentVisibilityDidChange):
748         (WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc):
749         (WebCore::ContentChangeObserver::adjustObservedState):
750         (WebCore::ContentChangeObserver::StyleChangeScope::StyleChangeScope):
751         (WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
752         (WebCore::ContentChangeObserver::clearTimersAndReportContentChange): Deleted.
753         * page/ios/ContentChangeObserver.h:
754         (WebCore::ContentChangeObserver::clearObservedDOMTimers):
755         (WebCore::ContentChangeObserver::isObservingContentChanges const):
756         (WebCore::ContentChangeObserver::hasPendingActivity const):
757
758 2019-03-07  Said Abou-Hallawa  <sabouhallawa@apple.com>
759
760         requestAnimationFrame should execute before the next frame
761         https://bugs.webkit.org/show_bug.cgi?id=177484
762
763         Reviewed by Simon Fraser.
764
765         This change fixes two issues with animation timing:
766
767         1. Calling the requestAnimationFrame callbacks would have happened when
768            the DisplayLink fires. This may have happened even if the frame is
769            missed and no display is committed.
770
771         2. Style changes and layout triggered by script could trigger painting
772            at more than 60fps. CoreAnimation commits could happen at more than
773            60fps, although WindowServer will throttle those, and only some will
774            be shown on the screen.
775
776         This change introduces a new paint scheduling model where painting is
777         driven by a "RenderingUpdateScheduler", which only triggers paints once
778         per 16.7ms frame.
779
780         Code that previously scheduled a compositing layer flush now schedules a
781         "RenderingUpdate", and that update is driven by a DisplayRefreshMonitor
782         callback. When the render happens, we service requestAnimationFrame callbacks,
783         Web Animations and intersection observations per the "Update the rendering"
784         step of the HTML Event Loop specification
785         <https://html.spec.whatwg.org/multipage/webappapis.html#update-the-rendering>.
786
787         In the future, more rendering steps will be added to this code.
788
789         * Sources.txt:
790         * WebCore.xcodeproj/project.pbxproj:
791         * accessibility/mac/AXObjectCacheMac.mm:
792         Fix layout tests by adding null check.
793
794         * animation/DocumentAnimationScheduler.cpp: Removed.
795         * animation/DocumentAnimationScheduler.h: Removed.
796         * animation/DocumentTimeline.cpp:
797         (WebCore::DocumentTimeline::DocumentTimeline):
798         (WebCore::DocumentTimeline::updateThrottlingState):
799         (WebCore::DocumentTimeline::resumeAnimations):
800         (WebCore::DocumentTimeline::liveCurrentTime const):
801         (WebCore::DocumentTimeline::currentTime):
802         (WebCore::DocumentTimeline::animationTimingDidChange):
803         (WebCore::DocumentTimeline::scheduleAnimationResolution):
804         (WebCore::DocumentTimeline::unscheduleAnimationResolution):
805         (WebCore::DocumentTimeline::updateAnimationsAndSendEvents):
806         (WebCore::DocumentTimeline::internalUpdateAnimationsAndSendEvents):
807         (WebCore::DocumentTimeline::scheduleNextTick):
808         (WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement):
809         Simplify this function by handling the case of no-animations separately.
810
811         (WebCore::DocumentTimeline::resolveAnimationsForElement):
812         Simplify the loop and delete hasPendingAcceleratedAnimations because it
813         is initialized to true and is not changed inside the loop.
814
815         (WebCore::DocumentTimeline::scheduleAnimationResolutionIfNeeded): Deleted.
816         (WebCore::DocumentTimeline::animationResolutionTimerFired): Deleted.
817         * animation/DocumentTimeline.h:
818         * dom/Document.cpp:
819         (WebCore::Document::resolveStyle):
820         There is no need to force update in resolveStyle(). notifyFlushRequired()
821         will be called eventually which will scheduleRenderingUpdate().
822
823         (WebCore::Document::prepareForDestruction):
824         (WebCore::Document::updateAnimationsAndSendEvents):
825         (WebCore::Document::serviceRequestAnimationFrameCallbacks):
826         (WebCore::Document::windowScreenDidChange):
827         (WebCore::Document::updateIntersectionObservations):
828         (WebCore::Document::scheduleForcedIntersectionObservationUpdate): Deleted.
829         (WebCore::Document::animationScheduler): Deleted.
830         * dom/Document.h:
831         (WebCore::Document::numberOfIntersectionObservers const):
832         * dom/ScriptedAnimationController.cpp:
833         (WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks):
834         (WebCore::ScriptedAnimationController::scheduleAnimation):
835         (WebCore::ScriptedAnimationController::animationTimerFired):
836         (WebCore::ScriptedAnimationController::serviceScriptedAnimations): Deleted.
837         (WebCore::ScriptedAnimationController::documentAnimationSchedulerDidFire): Deleted.
838         * dom/ScriptedAnimationController.h:
839         * page/FrameView.cpp:
840         (WebCore::FrameView::viewportContentsChanged):
841         * page/IntersectionObserver.cpp:
842         (WebCore::IntersectionObserver::observe):
843         * page/Page.cpp:
844         (WebCore::Page::Page):
845         (WebCore::Page::layoutIfNeeded):
846         (WebCore::Page::renderingUpdate):
847         (WebCore::Page::renderingUpdateScheduler):
848         (WebCore::Page::willDisplayPage): Deleted.
849         (WebCore::Page::addDocumentNeedingIntersectionObservationUpdate): Deleted.
850         (WebCore::Page::updateIntersectionObservations): Deleted.
851         (WebCore::Page::scheduleForcedIntersectionObservationUpdate): Deleted.
852         * page/Page.h:
853         * page/PageOverlayController.cpp:
854         (WebCore::PageOverlayController::didChangeViewExposedRect):
855         (WebCore::PageOverlayController::notifyFlushRequired):
856         * page/ResourceUsageData.h:
857         Include header files that become missing because of adding 
858         RenderingUpdateScheduler.cpp.
859
860         * page/RenderingUpdateScheduler.cpp: Added.
861         (WebCore::RenderingUpdateScheduler::RenderingUpdateScheduler):
862         (WebCore::RenderingUpdateScheduler::scheduleRenderingUpdate):
863         (WebCore::RenderingUpdateScheduler::startTimer):
864         (WebCore::RenderingUpdateScheduler::clearTimer):
865         (WebCore::RenderingUpdateScheduler::windowScreenDidChange):
866         (WebCore::RenderingUpdateScheduler::createDisplayRefreshMonitor const):
867         (WebCore::RenderingUpdateScheduler::displayRefreshFired):
868         * page/RenderingUpdateScheduler.h: Added.
869         (WebCore::RenderingUpdateScheduler::create):
870         * page/ios/ContentChangeObserver.h:
871         Include header files that become missing because of adding 
872         RenderingUpdateScheduler.cpp.
873
874         * page/mac/ServicesOverlayController.mm:
875         (WebCore::ServicesOverlayController::Highlight::notifyFlushRequired):
876         * rendering/RenderLayerCompositor.cpp:
877         (WebCore::RenderLayerCompositor::scheduleLayerFlushNow):
878
879 2019-03-07  Zalan Bujtas  <zalan@apple.com>
880
881         [ContentChangeObserver] Add a setting to be able to turn content change observation on/off
882         https://bugs.webkit.org/show_bug.cgi?id=195353
883         <rdar://problem/48626394>
884
885         Reviewed by Simon Fraser.
886
887         Move content observation tests to a dedicated directory.
888
889         Tests: fast/events/touch/ios/content-observation/click-instead-of-hover-simple.html
890                fast/events/touch/ios/content-observation/hover-when-style-change-is-async.html
891                fast/events/touch/ios/content-observation/stuck-with-hover-state.html
892                fast/events/touch/ios/content-observation/style-recalc-schedule-and-force-relalc.html
893                fast/events/touch/ios/content-observation/visibility-change-happens-at-the-second-timer.html
894
895         * page/Settings.yaml:
896         * page/ios/ContentChangeObserver.cpp:
897         (WebCore::ContentChangeObserver::didInstallDOMTimer):
898         (WebCore::ContentChangeObserver::isNotifyContentChangeAllowed const):
899         * page/ios/ContentChangeObserver.h:
900         (WebCore::ContentChangeObserver::isNotifyContentChangeAllowed const): Deleted.
901         * testing/InternalSettings.cpp:
902         (WebCore::InternalSettings::resetToConsistentState):
903
904 2019-03-07  John Wilander  <wilander@apple.com>
905
906         Make sure an empty host matches the internal representation "nullOrigin" in WebCore::RegistrableDomain::matches()
907         https://bugs.webkit.org/show_bug.cgi?id=195435
908
909         Reviewed by Brent Fulgham.
910
911         No new tests. Tests are currently failing and will pass again with
912         this patch.
913
914         WebCore::RegistrableDomain::matches() is a quick way to compare a
915         RegistrableDomain with a URL. Since RegistrableDomain represents the
916         empty host as "nullOrigin," a URL with an empty host needs to match
917         that representation in WebCore::RegistrableDomain::matches().
918         Failure to do so caused debug assertions in fast/ layout tests after
919         https://trac.webkit.org/changeset/242603/webkit.
920
921         * platform/RegistrableDomain.h:
922         (WebCore::RegistrableDomain::matches const):
923
924 2019-03-07  Justin Fan  <justin_fan@apple.com>
925
926         Unreviewed build fixes since MTLClampToBorderColor is only supported on macOS.
927
928         * Modules/webgpu/GPUSamplerDescriptor.idl:
929         * platform/graphics/gpu/GPUSamplerDescriptor.h:
930         * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm: Forgot include.
931         * platform/graphics/gpu/cocoa/GPUSamplerMetal.mm:
932         (WebCore::mtlAddressModeForAddressMode):
933         (WebCore::tryCreateMtlSamplerState):
934         (WebCore::mtlBorderColorForBorderColor): Deleted.
935
936 2019-03-07  Justin Fan  <justin_fan@apple.com>
937
938         [Web GPU] GPUSampler implementation
939         https://bugs.webkit.org/show_bug.cgi?id=195427
940         <rdar://problem/48686011>
941
942         Reviewed by Dean Jackson.
943
944         Implement ability to create GPUSamplers and use them as pipeline resource bindings.
945
946         Test: texture-triangle-strip.html updated.
947
948         Add symbols to project:
949         * CMakeLists.txt:
950         * DerivedSources-input.xcfilelist:
951         * DerivedSources-output.xcfilelist:
952         * DerivedSources.make:
953         * Sources.txt:
954         * SourcesCocoa.txt:
955         * WebCore.xcodeproj/project.pbxproj:
956         * bindings/js/WebCoreBuiltinNames.h:
957
958         GPUSampler creation:
959         * Modules/webgpu/GPUSamplerDescriptor.idl: Added.
960         * Modules/webgpu/WebGPUDevice.cpp:
961         (WebCore::WebGPUDevice::createSampler const): Added.
962         * Modules/webgpu/WebGPUDevice.h:
963         * Modules/webgpu/WebGPUDevice.idl:
964         * Modules/webgpu/WebGPUSampler.cpp: Added.
965         (WebCore::WebGPUSampler::create):
966         (WebCore::WebGPUSampler::WebGPUSampler):
967         * Modules/webgpu/WebGPUSampler.h: Added.
968         (WebCore::WebGPUSampler::sampler const):
969         * Modules/webgpu/WebGPUSampler.idl: Added.
970         * platform/graphics/gpu/GPUDevice.cpp:
971         (WebCore::GPUDevice::tryCreateSampler const): Added.
972         * platform/graphics/gpu/GPUDevice.h:
973         * platform/graphics/gpu/GPUSampler.h: Added.
974         (WebCore::GPUSampler::platformSampler const):
975         * platform/graphics/gpu/GPUSamplerDescriptor.h: Added.
976         * platform/graphics/gpu/cocoa/GPUSamplerMetal.mm: Added.
977         (WebCore::mtlAddressModeForAddressMode):
978         (WebCore::mtlBorderColorForBorderColor):
979         (WebCore::mtlMinMagFilterForFilterMode):
980         (WebCore::mtlMipFilterForFilterMode):
981         (WebCore::tryCreateMtlSamplerState):
982         (WebCore::GPUSampler::tryCreate):
983         (WebCore::GPUSampler::GPUSampler):
984
985         Move GPUCompareFunction to Utils for shared use.
986         * platform/graphics/gpu/GPUCompareFunction.h:
987         * platform/graphics/gpu/GPUUtils.h:
988         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
989         (WebCore::tryCreateMtlDepthStencilState):
990         (WebCore::validateAndConvertDepthCompareFunctionToMtl): Deleted.
991         * platform/graphics/gpu/cocoa/GPUUtilsMetal.mm:
992         (WebCore::platformTextureFormatForGPUTextureFormat):
993         (WebCore::platformCompareFunctionForGPUCompareFunction):
994
995         Expand bind groups to accept GPUSamplers:
996         * Modules/webgpu/WebGPUBindGroupBinding.h:
997         * Modules/webgpu/WebGPUBindGroupBinding.idl:
998         * Modules/webgpu/WebGPUBindGroupDescriptor.cpp:
999         (WebCore::WebGPUBindGroupDescriptor::asGPUBindGroupDescriptor const):
1000         * platform/graphics/gpu/GPUBindGroupBinding.h:
1001         * platform/graphics/gpu/GPUProgrammablePassEncoder.h:
1002         * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
1003         (WebCore::GPUProgrammablePassEncoder::setBindGroup):
1004         (WebCore::GPUProgrammablePassEncoder::setResourceAsBufferOnEncoder):
1005         (WebCore::GPUProgrammablePassEncoder::setResourceAsSamplerOnEncoder): Added.
1006         (WebCore::GPUProgrammablePassEncoder::setResourceAsTextureOnEncoder):
1007
1008         Misc:
1009         * Modules/webgpu/WebGPUTexture.cpp: Missing includes.
1010         * Modules/webgpu/WebGPUTexture.h:
1011         * Modules/webgpu/WebGPUSwapChain.cpp: Removed extra include.
1012
1013 2019-03-07  Commit Queue  <commit-queue@webkit.org>
1014
1015         Unreviewed, rolling out r242297.
1016         https://bugs.webkit.org/show_bug.cgi?id=195430
1017
1018         Broke Microsoft Visio. (Requested by dydz on #webkit).
1019
1020         Reverted changeset:
1021
1022         "[iOS] Turn mouse event simulation on by default"
1023         https://bugs.webkit.org/show_bug.cgi?id=195218
1024         https://trac.webkit.org/changeset/242297
1025
1026 2019-03-07  Sihui Liu  <sihui_liu@apple.com>
1027
1028         Crash in com.apple.WebCore: WebCore::IDBTransaction::pendingOperationTimerFired + 72
1029         https://bugs.webkit.org/show_bug.cgi?id=195214
1030         <rdar://problem/48461116>
1031
1032         Reviewed by Geoffrey Garen.
1033
1034         When IDBTransaction is ready to commit, a commit operation would be schedule to 
1035         m_pendingTransactionOperationQueue. If connection to IDBServer is lost, pending operations are moved to 
1036         m_transactionOperationsInProgressQueue and will be completed with TransactionOperation::doComplete. doComplete 
1037         executes complete function of the operation, clears the complete function, and then removes the operation from 
1038         m_transactionOperationsInProgressQueue. In doComplete, we do early return when complete function is null, 
1039         since the doComplete could be invoked twice due to the race conditions between receiving "operation complete" 
1040         message from server and client-side abort.
1041
1042         However, commit operation does not have a complete function because it should be the last operation of 
1043         transaction and it gets removed from queue in its perform function. A commit operation would not be removed from 
1044         m_transactionOperationsInProgressQueue because of the early return. It would be removed from 
1045         m_transactionOperationMap, which may hold the last ref to the commit operation, in 
1046         IDBTransaction::connectionClosedFromServer. In this case, when pendingOperationTimerFired is called later, the 
1047         commit operation left in m_transactionOperationsInProgressQueue would be used and found to be freed. We should
1048         not use null check of complete function to decide whether an operation is completed.
1049
1050         * Modules/indexeddb/client/TransactionOperation.h:
1051         (WebCore::IDBClient::TransactionOperation::doComplete):
1052
1053 2019-03-07  John Wilander  <wilander@apple.com>
1054
1055         Resource Load Statistics: Log first-party navigations with link decoration
1056         https://bugs.webkit.org/show_bug.cgi?id=195301
1057         <rdar://problem/48569971>
1058
1059         Reviewed by Brent Fulgham.
1060
1061         Test: http/tests/resourceLoadStatistics/log-cross-site-load-with-link-decoration.html
1062
1063         This patch adds two new members to WebCore::ResourceLoadStatistics:
1064         - topFrameLinkDecorationsFrom, a set of domains
1065         - gotLinkDecorationFromPrevalentResource, a boolean state
1066
1067         * loader/ResourceLoadStatistics.cpp:
1068         (WebCore::ResourceLoadStatistics::encode const):
1069         (WebCore::ResourceLoadStatistics::decode):
1070         (WebCore::ResourceLoadStatistics::toString const):
1071         (WebCore::ResourceLoadStatistics::merge):
1072         * loader/ResourceLoadStatistics.h:
1073
1074 2019-03-07  Simon Fraser  <simon.fraser@apple.com>
1075
1076         [iOS WK] REGRESSION (r242132): Fixed position banners flicker and move when scrolling (Apple, Tesla, YouTube, Reddit)
1077         https://bugs.webkit.org/show_bug.cgi?id=195396
1078         rdar://problem/48518959
1079
1080         Reviewed by Antti Koivisto.
1081         
1082         r242132 introduced two issues that contributed to jumpiness of position:fixed layers when scrolling.
1083         
1084         First, ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling() would early return if the scroll position
1085         hadn't changed. It also needs to check the supplied layoutViewport (if any), but in some cases running the
1086         notifyRelatedNodesAfterScrollPositionChange() code is necessary even without a scroll position change:
1087         if the web process has committed new scrolling tree state (e.g. with new fixed constraints) since
1088         the last call, we have to run the layer positioning code to have fixed layers re-adjust their position relative
1089         to the root. This was the primary bug fix.
1090
1091         Secondly, a layer tree commit can give ScrollingTreeFrameScrollingNode a new layout viewport, but we need to
1092         adjust this by the scrolling tree's current scroll position in case it gets used before the next scroll.
1093
1094         Currently no way to test this, as it's very timing-dependent.
1095
1096         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
1097         (WebCore::ScrollingTreeFrameScrollingNode::commitStateBeforeChildren):
1098         (WebCore::ScrollingTreeFrameScrollingNode::scrollPositionAndLayoutViewportMatch):
1099         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
1100         * page/scrolling/ScrollingTreeScrollingNode.cpp:
1101         (WebCore::ScrollingTreeScrollingNode::scrollPositionAndLayoutViewportMatch):
1102         (WebCore::ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling):
1103         * page/scrolling/ScrollingTreeScrollingNode.h:
1104
1105 2019-03-07  Youenn Fablet  <youenn@apple.com>
1106
1107         Introduce a quota manager for Cache API/Service Worker/IDB storage
1108         https://bugs.webkit.org/show_bug.cgi?id=195283
1109
1110         Reviewed by Chris Dumez.
1111
1112         Introduce a generic quota manager and quota users to be used in Network Process.
1113         Quota manager/users are scoped by client origin.
1114         Quota manager is used to check for quota by an entity wanting to execute a storage task of a given taskSize.
1115         Quota manager will check the current space used by all its quota users.
1116         If the size + taskSize is above quota, it will call a function to try extend the quota.
1117         In the meantime, the task (and all tasks that may be added) are queued.
1118
1119         Once the new quota is received, the quota manager will either allow or disallow the first task in the queue.
1120         The quota manager will try to execute as many tasks as possible with the provided quota.
1121         If some tasks are remaining and quota limit is hit, the quota manager will compute the space needed for all remaining requests
1122         and do another quota extension request.
1123
1124         * Sources.txt:
1125         * WebCore.xcodeproj/project.pbxproj:
1126         * page/ClientOrigin.h:
1127         * storage/StorageQuotaManager.cpp: Added.
1128         (WebCore::StorageQuotaManager::~StorageQuotaManager):
1129         (WebCore::StorageQuotaManager::spaceUsage const):
1130         (WebCore::StorageQuotaManager::requestSpace):
1131         (WebCore::StorageQuotaManager::askForMoreSpace):
1132         (WebCore::StorageQuotaManager::processPendingRequests):
1133         * storage/StorageQuotaManager.h: Added.
1134         (WebCore::StorageQuotaManager::StorageQuotaManager):
1135         (WebCore::StorageQuotaManager::addUser):
1136         (WebCore::StorageQuotaManager::removeUser):
1137         * storage/StorageQuotaUser.h: Added.
1138
1139 2019-03-07  John Wilander  <wilander@apple.com>
1140
1141         Resource Load Statistics: Make it possible to purge only script-accessible cookies
1142         https://bugs.webkit.org/show_bug.cgi?id=195383
1143         <rdar://problem/48570136>
1144
1145         Reviewed by Brent Fulgham.
1146
1147         Test: http/tests/resourceLoadStatistics/delete-script-accessible-cookies.html
1148
1149         This patch provides the ability to purge all script-accessible cookies while leaving
1150         HttpOnly cookies in place.
1151
1152         * loader/CookieJar.h:
1153             Added boolean enum IncludeHttpOnlyCookies for use as function parameter.
1154         * platform/network/NetworkStorageSession.h:
1155         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
1156         (WebCore::NetworkStorageSession::deleteCookiesForHostnames):
1157             Support for the new IncludeHttpOnlyCookies flag.
1158         * platform/network/curl/NetworkStorageSessionCurl.cpp:
1159         (WebCore::NetworkStorageSession::deleteCookiesForHostnames):
1160             Stubbed out the new function and added a FIXME comment.
1161         * platform/network/soup/NetworkStorageSessionSoup.cpp:
1162         (WebCore::NetworkStorageSession::deleteCookiesForHostnames):
1163             Stubbed out the new function and added a FIXME comment.
1164
1165 2019-03-06  Mark Lam  <mark.lam@apple.com>
1166
1167         Exception is a JSCell, not a JSObject.
1168         https://bugs.webkit.org/show_bug.cgi?id=195392
1169
1170         Reviewed by Saam Barati.
1171
1172         * bridge/objc/objc_utility.h:
1173         * bridge/objc/objc_utility.mm:
1174         (JSC::Bindings::throwError):
1175         * bridge/runtime_object.cpp:
1176         (JSC::Bindings::RuntimeObject::throwInvalidAccessError):
1177         * bridge/runtime_object.h:
1178
1179 2019-03-07  Devin Rousso  <drousso@apple.com>
1180
1181         Web Inspector: Canvas: lazily create the agent
1182         https://bugs.webkit.org/show_bug.cgi?id=195241
1183
1184         Reviewed by Joseph Pecoraro.
1185
1186         No functionality change.
1187
1188         * html/canvas/CanvasRenderingContext.h:
1189         * html/canvas/CanvasRenderingContext.cpp:
1190         (WebCore::CanvasRenderingContext::instances): Added.
1191         (WebCore::CanvasRenderingContext::instancesMutex): Added.
1192         (WebCore::CanvasRenderingContext::CanvasRenderingContext):
1193         (WebCore::CanvasRenderingContext::~CanvasRenderingContext):
1194
1195         * html/canvas/WebGLProgram.h:
1196         * html/canvas/WebGLProgram.cpp:
1197         (WebCore::WebGLProgram::instances): Added.
1198         (WebCore::WebGLProgram::instancesMutex): Added.
1199         (WebCore::WebGLProgram::WebGLProgram):
1200         (WebCore::WebGLProgram::~WebGLProgram):
1201         * html/canvas/WebGLRenderingContextBase.cpp:
1202         (WebCore::WebGLRenderingContextBase::~WebGLRenderingContextBase):
1203
1204         * inspector/InspectorController.cpp:
1205         (WebCore::InspectorController::InspectorController):
1206         (WebCore::InspectorController::createLazyAgents):
1207
1208         * inspector/agents/InspectorCanvasAgent.h:
1209         * inspector/agents/InspectorCanvasAgent.cpp:
1210         (WebCore::InspectorCanvasAgent::enable):
1211         (WebCore::InspectorCanvasAgent::disable):
1212         (WebCore::InspectorCanvasAgent::frameNavigated):
1213         (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
1214         (WebCore::InspectorCanvasAgent::canvasDestroyed):
1215         (WebCore::InspectorCanvasAgent::didCreateProgram):
1216         (WebCore::InspectorCanvasAgent::willDeleteProgram):
1217         (WebCore::InspectorCanvasAgent::bindCanvas): Added.
1218         (WebCore::InspectorCanvasAgent::canvasDestroyedTimerFired):
1219
1220         * inspector/InspectorInstrumentation.h:
1221         (WebCore::InspectorInstrumentation::didCreateCanvasRenderingContext):
1222         (WebCore::InspectorInstrumentation::didCreateProgram):
1223         (WebCore::InspectorInstrumentation::willDeleteProgram):
1224
1225 2019-03-06  Ross Kirsling  <ross.kirsling@sony.com>
1226
1227         [Win] Remove -DUCHAR_TYPE=wchar_t stopgap and learn to live with char16_t.
1228         https://bugs.webkit.org/show_bug.cgi?id=195346
1229
1230         Reviewed by Fujii Hironori.
1231
1232         * platform/graphics/win/FontCacheWin.cpp:
1233         (WebCore::appendLinkedFonts):
1234         (WebCore::getLinkedFonts):
1235         (WebCore::FontCache::systemFallbackForCharacters):
1236         (WebCore::FontCache::fontFromDescriptionAndLogFont):
1237         (WebCore::createGDIFont):
1238         (WebCore::FontCache::getFontSelectionCapabilitiesInFamily):
1239         * platform/graphics/win/FontCustomPlatformDataCairo.cpp:
1240         (WebCore::FontCustomPlatformData::fontPlatformData):
1241         * platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp:
1242         (WebCore::GlyphPage::fill):
1243         * platform/graphics/win/IconWin.cpp:
1244         (WebCore::Icon::createIconForFiles):
1245         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
1246         (WebCore::mimeTypeCache):
1247         (WebCore::MediaPlayerPrivateMediaFoundation::startCreateMediaSource):
1248         * platform/graphics/win/UniscribeController.cpp:
1249         (WebCore::UniscribeController::itemizeShapeAndPlace):
1250         (WebCore::UniscribeController::shape):
1251         * platform/network/win/DownloadBundleWin.cpp:
1252         (WebCore::DownloadBundle::appendResumeData):
1253         (WebCore::DownloadBundle::extractResumeData):
1254         * platform/text/win/LocaleWin.cpp:
1255         (WebCore::LCIDFromLocaleInternal):
1256         (WebCore::LCIDFromLocale):
1257         (WebCore::LocaleWin::getLocaleInfoString):
1258         * platform/win/BString.cpp:
1259         (WebCore::BString::BString):
1260         * platform/win/ClipboardUtilitiesWin.cpp:
1261         (WebCore::getWebLocData):
1262         (WebCore::createGlobalData):
1263         (WebCore::getFileDescriptorData):
1264         (WebCore::getURL):
1265         (WebCore::getCFData):
1266         (WebCore::setCFData):
1267         * platform/win/DragDataWin.cpp:
1268         (WebCore::DragData::asFilenames const):
1269         * platform/win/DragImageWin.cpp:
1270         (WebCore::createDragImageIconForCachedImageFilename):
1271         (WebCore::dragLabelFont):
1272         * platform/win/MIMETypeRegistryWin.cpp:
1273         (WebCore::mimeTypeForExtension):
1274         (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType):
1275         * platform/win/PasteboardWin.cpp:
1276         (WebCore::Pasteboard::read):
1277         (WebCore::filesystemPathFromUrlOrTitle):
1278         (WebCore::Pasteboard::writeURLToDataObject):
1279         (WebCore::createGlobalImageFileDescriptor):
1280         (WebCore::createGlobalHDropContent):
1281         * platform/win/SSLKeyGeneratorWin.cpp:
1282         (WebCore::signedPublicKeyAndChallengeString):
1283         * platform/win/SharedBufferWin.cpp:
1284         (WebCore::SharedBuffer::createFromReadingFile):
1285         * rendering/RenderThemeWin.cpp:
1286         (WebCore::fillFontDescription):
1287         Use wchar helpers as needed.
1288
1289 2019-03-06  Devin Rousso  <drousso@apple.com>
1290
1291         Web Inspector: DOM Debugger: event breakpoints still fire when breakpoints are disabled
1292         https://bugs.webkit.org/show_bug.cgi?id=195377
1293         <rdar://problem/48651645>
1294
1295         Reviewed by Joseph Pecoraro and Matt Baker.
1296
1297         Test: inspector/dom-debugger/event-listener-breakpoints.html
1298
1299         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
1300         (WebCore::InspectorDOMDebuggerAgent::willHandleEvent):
1301         (WebCore::InspectorDOMDebuggerAgent::willFireTimer):
1302         (WebCore::InspectorDOMDebuggerAgent::willFireAnimationFrame):
1303
1304 2019-03-06  Wenson Hsieh  <wenson_hsieh@apple.com>
1305
1306         Crash when attempting to change input type while dismissing datalist suggestions
1307         https://bugs.webkit.org/show_bug.cgi?id=195384
1308         <rdar://problem/48563718>
1309
1310         Reviewed by Brent Fulgham.
1311
1312         When closing a datalist suggestion menu, WebPageProxy sends a message to WebPage instructing it to tell its
1313         active datalist suggestions picker to close. However, for a myriad of reasons, the suggestions picker (kept
1314         alive by its text input type) may have already gone away by this point. To mitigate this, make WebPage weakly
1315         reference its active datalist suggestions picker.
1316
1317         Test: fast/forms/datalist/change-input-type-after-closing-datalist-suggestions.html
1318
1319         * platform/DataListSuggestionPicker.h:
1320
1321         Make DataListSuggestionPicker capable of being weakly referenced. Additionally, fix some minor preexisting
1322         issues in this header (#imports instead of #includes, as well as an unnecessary include of IntRect.h).
1323
1324 2019-03-06  Ryan Haddad  <ryanhaddad@apple.com>
1325
1326         Remove an unneeded assert that was added with r242113
1327         https://bugs.webkit.org/show_bug.cgi?id=195391
1328
1329         Reviewed by Simon Fraser.
1330
1331         Many layout tests are failing ASSERT(m_mediaBufferingIsSuspended). Since m_mediaBufferingIsSuspended is
1332         protected by an 'if' statement directly afterwards, the assertion should be safe to remove.
1333
1334         * page/Page.cpp:
1335         (WebCore::Page::resumeAllMediaBuffering):
1336
1337 2019-03-06  Justin Fan  <justin_fan@apple.com>
1338
1339         Unreviewed build fix. Replace a forward declaration with an include.
1340
1341         * Modules/webgpu/WebGPUTextureView.cpp:
1342         * Modules/webgpu/WebGPUTextureView.h:
1343
1344 2019-03-06  Justin Fan  <justin_fan@apple.com>
1345
1346         [Web GPU] GPUTexture and GPUTextureView updates, and related GPUBindGroup updates
1347         https://bugs.webkit.org/show_bug.cgi?id=195347
1348
1349         Reviewed by Dean Jackson.
1350
1351         Implement the ability to display image data as a GPUTexture in the rendering pipeline. Improve GPUTexture and 
1352         GPUTextureView implementations. Rename various bind group classes to GPU* to match API.
1353
1354         Test: webgpu/texture-triangle-strip.html
1355
1356         * Modules/webgpu/WebGPUBindGroupDescriptor.cpp:
1357         (WebCore::WebGPUBindGroupDescriptor::asGPUBindGroupDescriptor const): Update to validate GPUTextureView resources.
1358         * Modules/webgpu/WebGPUCommandBuffer.cpp: Move instead of copy the converted view objects.
1359         (WebCore::WebGPUCommandBuffer::copyBufferToTexture):
1360         (WebCore::WebGPUCommandBuffer::copyTextureToBuffer):
1361         (WebCore::WebGPUCommandBuffer::copyTextureToTexture):
1362         * Modules/webgpu/WebGPUCommandBuffer.h:
1363         (WebCore::WebGPUCommandBuffer::commandBuffer const): No longer returns const so used resources can be registered on it.
1364         * Modules/webgpu/WebGPUDevice.cpp:
1365         (WebCore::WebGPUDevice::createBindGroupLayout const): Rename WebGPUBindGroupLayoutDescriptor and replace unnecessary rvalue reference.
1366         * Modules/webgpu/WebGPUDevice.h: Ditto.
1367         * Modules/webgpu/WebGPUDevice.idl: Ditto.
1368         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
1369         (WebCore::WebGPUProgrammablePassEncoder::setBindGroup const):
1370         * Modules/webgpu/WebGPUProgrammablePassEncoder.h:
1371         * Modules/webgpu/WebGPUQueue.cpp:
1372         (WebCore::WebGPUQueue::submit):
1373         * Modules/webgpu/WebGPURenderPassDescriptor.cpp:
1374         (WebCore::WebGPURenderPassDescriptor::asGPURenderPassDescriptor const):
1375         * Modules/webgpu/WebGPUTexture.cpp:
1376         (WebCore::WebGPUTexture::~WebGPUTexture): Clean up any resources created for and from this WebGPUTexture.
1377         (WebCore::WebGPUTexture::createDefaultTextureView): Now returns an empty object other than null on failure.
1378         (WebCore::WebGPUTexture::destroy):
1379         (WebCore::WebGPUTexture::destroyImpl):
1380         * Modules/webgpu/WebGPUTexture.h: Keep a list of any views created from this texture.
1381         * Modules/webgpu/WebGPUTexture.idl: Enable destroy.
1382         * Modules/webgpu/WebGPUTextureView.cpp:
1383         (WebCore::WebGPUTextureView::create):
1384         (WebCore::WebGPUTextureView::WebGPUTextureView):
1385         (WebCore::WebGPUTextureView::destroy):
1386         * Modules/webgpu/WebGPUTextureView.h:
1387         (WebCore::WebGPUTextureView::~WebGPUTextureView): Clean up any resources backing this WebGPUTextureView.
1388         (WebCore::WebGPUTextureView::texture const):
1389         (WebCore::WebGPUTextureView::texture): Deleted.
1390         * platform/graphics/gpu/GPUBindGroupLayout.h:
1391         * platform/graphics/gpu/GPUCommandBuffer.h:
1392         (WebCore::GPUCommandBuffer::usedTextures const): Keep a list of all texture resources that will be used by this command buffer on submit.
1393         (WebCore::GPUCommandBuffer::isEncodingPass const): Added to prevent multiple pass encoders from being active on one command buffer.
1394         (WebCore::GPUCommandBuffer::setIsEncodingPass):
1395         (WebCore::GPUCommandBuffer::useTexture):
1396         * platform/graphics/gpu/GPUDevice.cpp:
1397         (WebCore::GPUDevice::tryCreateBindGroupLayout const):
1398         * platform/graphics/gpu/GPUDevice.h:
1399         * platform/graphics/gpu/GPUPipelineLayout.cpp:
1400         (WebCore::GPUPipelineLayout::GPUPipelineLayout):
1401         * platform/graphics/gpu/GPUProgrammablePassEncoder.cpp:
1402         (WebCore::GPUProgrammablePassEncoder::GPUProgrammablePassEncoder):
1403         * platform/graphics/gpu/GPUProgrammablePassEncoder.h:
1404         (WebCore::GPUProgrammablePassEncoder::setVertexBuffer):
1405         (WebCore::GPUProgrammablePassEncoder::setFragmentBuffer):
1406         (): Deleted.
1407         * platform/graphics/gpu/GPUQueue.h:
1408         * platform/graphics/gpu/GPURenderPassEncoder.h:
1409         * platform/graphics/gpu/GPUTexture.h:
1410         (WebCore::GPUTexture::isReadOnly const):
1411         (WebCore::GPUTexture::destroy):
1412         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
1413         (WebCore::MTLDataTypeForBindingType):
1414         (WebCore::GPUBindGroupLayout::tryCreate):
1415         * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
1416         (WebCore::GPUCommandBuffer::create):
1417         (WebCore::GPUCommandBuffer::~GPUCommandBuffer): Ensure blitEncoder is ended before releasing it.
1418         (WebCore::GPUCommandBuffer::endBlitEncoding):
1419         (WebCore::GPUCommandBuffer::copyBufferToTexture): Ensure textures are marked for usage before submission occurs.
1420         (WebCore::GPUCommandBuffer::copyTextureToBuffer):
1421         (WebCore::GPUCommandBuffer::copyTextureToTexture):
1422         * platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
1423         (WebCore::GPUDevice::create):
1424         (WebCore::GPUDevice::GPUDevice):
1425         * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
1426         (WebCore::GPUProgrammablePassEncoder::endPass):
1427         (WebCore::GPUProgrammablePassEncoder::setBindGroup): Now supports texture resources.
1428         (WebCore::GPUProgrammablePassEncoder::setResourceAsBufferOnEncoder): Just moved.
1429         (WebCore::GPUProgrammablePassEncoder::setResourceAsTextureOnEncoder):
1430         * platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
1431         (WebCore::GPUQueue::submit): Ensures destroyed GPUTextures are not submitted.
1432         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
1433         (WebCore::GPURenderPassEncoder::tryCreate): Ensure any other encoders are ended before attempting to activate a new one.
1434         (WebCore::GPURenderPassEncoder::platformPassEncoder const):
1435         (WebCore::GPURenderPassEncoder::endPass): Invalidates the MTLCommandEncoder upon success.
1436         (WebCore::GPURenderPassEncoder::setPipeline):
1437         (WebCore::GPURenderPassEncoder::setVertexBuffers):
1438         (WebCore::GPURenderPassEncoder::draw):
1439         (WebCore::GPURenderPassEncoder::useResource):
1440         (WebCore::GPURenderPassEncoder::setVertexBuffer):
1441         (WebCore::GPURenderPassEncoder::setFragmentBuffer):
1442         * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
1443         (WebCore::GPUSwapChain::getNextTexture):
1444         * platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
1445         (WebCore::storageModeForPixelFormatAndSampleCount): 
1446                 Always create MTLStorageModePrivate textures on macOS, as Web GPU doesn't provide CPU access to textures anyway.
1447         (WebCore::tryCreateMtlTextureDescriptor):
1448         (WebCore::GPUTexture::create):
1449         (WebCore::GPUTexture::GPUTexture):
1450         (WebCore::GPUTexture::tryCreateDefaultTextureView): Renamed from createDefaultTextureView.
1451
1452         Update files and symbols in project:
1453         * CMakeLists.txt:
1454         * DerivedSources-input.xcfilelist:
1455         * DerivedSources-output.xcfilelist:
1456         * DerivedSources.make:
1457         * Modules/streams/WebGPUBindGroupLayoutDescriptor.h: Removed.
1458         * Modules/webgpu/GPUBindGroupLayoutBinding.h: Renamed from Source/WebCore/platform/graphics/gpu/GPUBindGroupLayoutBinding.h.
1459         * Modules/webgpu/GPUBindGroupLayoutBinding.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUBindGroupLayoutBinding.idl.
1460         * Modules/webgpu/GPUBindGroupLayoutDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPUBindGroupLayoutDescriptor.h.
1461         * Modules/webgpu/GPUBindGroupLayoutDescriptor.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUBindGroupLayoutDescriptor.idl.
1462         * Modules/webgpu/GPUShaderStageBit.h: Renamed from Source/WebCore/Modules/webgpu/WebGPUShaderStageBit.h.
1463         * Modules/webgpu/GPUShaderStageBit.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUShaderStageBit.idl.
1464         * Sources.txt:
1465         * WebCore.xcodeproj/project.pbxproj:
1466         * bindings/js/WebCoreBuiltinNames.h:
1467
1468 2019-03-06  Myles C. Maxfield  <mmaxfield@apple.com>
1469
1470         [WHLSL] Pack and unpack data at entry points and exit points
1471         https://bugs.webkit.org/show_bug.cgi?id=193877
1472
1473         Reviewed by Dean Jackson.
1474
1475         This implements the bulk of the rest of the Metal code generation piece.
1476         Specifically, this patch adds support for the packing and unpacking steps
1477         at the beginning of the entry point functions and all returns from those
1478         functions. It does this by creating an object, EntryPointScaffolding, that
1479         knows how to emit all the helper types, packing / unpacking code, and the
1480         function signature. This patch also accepts parts of the
1481         PipelineStateDescriptor so we know the data layout we should be packing and
1482         unpacking.
1483
1484         This is the last patch before enough of the compiler is present that we can
1485         start testing it. The next patch will start porting the test suite.
1486
1487         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
1488         (WebCore::WHLSL::Metal::attributeForSemantic):
1489         (WebCore::WHLSL::Metal::EntryPointScaffolding::EntryPointScaffolding):
1490         (WebCore::WHLSL::Metal::EntryPointScaffolding::mappedBindGroups const):
1491         (WebCore::WHLSL::Metal::EntryPointScaffolding::resourceHelperTypes):
1492         (WebCore::WHLSL::Metal::EntryPointScaffolding::resourceSignature):
1493         (WebCore::WHLSL::Metal::EntryPointScaffolding::builtInsSignature):
1494         (WebCore::WHLSL::Metal::EntryPointScaffolding::mangledInputPath):
1495         (WebCore::WHLSL::Metal::EntryPointScaffolding::mangledOutputPath):
1496         (WebCore::WHLSL::Metal::EntryPointScaffolding::unpackResourcesAndNamedBuiltIns):
1497         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::VertexEntryPointScaffolding):
1498         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::helperTypes):
1499         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::signature):
1500         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::unpack):
1501         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::pack):
1502         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::FragmentEntryPointScaffolding):
1503         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::helperTypes):
1504         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::signature):
1505         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::unpack):
1506         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::pack):
1507         (WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::ComputeEntryPointScaffolding):
1508         (WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::helperTypes):
1509         (WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::signature):
1510         (WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::unpack):
1511         (WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::pack):
1512         (WebCore::WHLSL::Metal::EntryPointScaffolding::helperTypes): Deleted.
1513         (WebCore::WHLSL::Metal::EntryPointScaffolding::signature): Deleted.
1514         (WebCore::WHLSL::Metal::EntryPointScaffolding::unpack): Deleted.
1515         (WebCore::WHLSL::Metal::EntryPointScaffolding::pack): Deleted.
1516         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h:
1517         (WebCore::WHLSL::Metal::EntryPointScaffolding::parameterVariables):
1518         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
1519         (WebCore::WHLSL::Metal::FunctionDeclarationWriter::toString):
1520         (WebCore::WHLSL::Metal::FunctionDeclarationWriter::visit):
1521         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::FunctionDefinitionWriter):
1522         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::generateNextVariableName):
1523         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
1524         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::constantExpressionString):
1525         (WebCore::WHLSL::Metal::RenderFunctionDefinitionWriter::RenderFunctionDefinitionWriter):
1526         (WebCore::WHLSL::Metal::RenderFunctionDefinitionWriter::takeVertexMappedBindGroups):
1527         (WebCore::WHLSL::Metal::RenderFunctionDefinitionWriter::takeFragmentMappedBindGroups):
1528         (WebCore::WHLSL::Metal::RenderFunctionDefinitionWriter::createEntryPointScaffolding):
1529         (WebCore::WHLSL::Metal::ComputeFunctionDefinitionWriter::ComputeFunctionDefinitionWriter):
1530         (WebCore::WHLSL::Metal::ComputeFunctionDefinitionWriter::takeMappedBindGroups):
1531         (WebCore::WHLSL::Metal::ComputeFunctionDefinitionWriter::createEntryPointScaffolding):
1532         (WebCore::WHLSL::Metal::sharedMetalFunctions):
1533         (WebCore::WHLSL::Metal::metalFunctions):
1534         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.h:
1535         * Modules/webgpu/WHLSL/Metal/WHLSLMappedBindings.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.h.
1536         * Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.cpp:
1537         (WebCore::WHLSL::Metal::generateMetalCodeShared):
1538         (WebCore::WHLSL::Metal::generateMetalCode):
1539         * Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.h:
1540         * Modules/webgpu/WHLSL/WHLSLIntrinsics.h:
1541         (WebCore::WHLSL::Intrinsics::float2Type const):
1542         * Modules/webgpu/WHLSL/WHLSLPipelineDescriptor.h: Added.
1543         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp: Added.
1544         (WebCore::WHLSL::prepareShared):
1545         (WebCore::WHLSL::prepare):
1546         * Modules/webgpu/WHLSL/WHLSLPrepare.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.h.
1547         * Modules/webgpu/WHLSL/WHLSLSemanticMatcher.cpp: Added.
1548         (WebCore::WHLSL::findEntryPoint):
1549         (WebCore::WHLSL::matchMode):
1550         (WebCore::WHLSL::matchResources):
1551         (WebCore::WHLSL::matchInputsOutputs):
1552         (WebCore::WHLSL::isAcceptableFormat):
1553         (WebCore::WHLSL::matchVertexAttributes):
1554         (WebCore::WHLSL::matchColorAttachments):
1555         (WebCore::WHLSL::matchDepthAttachment):
1556         (WebCore::WHLSL::matchSemantics):
1557         * Modules/webgpu/WHLSL/WHLSLSemanticMatcher.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp.
1558         * Sources.txt:
1559         * WebCore.xcodeproj/project.pbxproj:
1560
1561 2019-03-06  Wenson Hsieh  <wenson_hsieh@apple.com>
1562
1563         Move RenderObject::isTransparentOrFullyClippedRespectingParentFrames() to RenderLayer
1564         https://bugs.webkit.org/show_bug.cgi?id=195300
1565
1566         Reviewed by Simon Fraser.
1567
1568         Move isTransparentOrFullyClippedRespectingParentFrames() from RenderObject to RenderLayer, since this function
1569         asks questions about RenderLayers rather than their renderers. No change in behavior.
1570
1571         * rendering/RenderLayer.cpp:
1572         (WebCore::enclosingFrameRenderLayer):
1573         (WebCore::parentLayerCrossFrame):
1574
1575         Some static helpers currently in RenderObject that walk up the layer hierarchy through subframes are redundant
1576         with static helpers in RenderLayer. Now that isTransparentOrFullyClippedRespectingParentFrames exists in
1577         RenderLayer, simply use this existing helper instead and split logic to grab the enclosing layer around the
1578         owner element of a frame into a separate helper.
1579
1580         * rendering/RenderLayer.h:
1581         * rendering/RenderObject.cpp:
1582         (WebCore::enclosingFrameRenderLayer): Deleted.
1583         (WebCore::parentLayerCrossingFrameBoundaries): Deleted.
1584         (WebCore::RenderObject::isTransparentOrFullyClippedRespectingParentFrames const): Deleted.
1585
1586         Moved from RenderObject.
1587
1588         * rendering/RenderObject.h:
1589
1590 2019-03-06  Sihui Liu  <sihui_liu@apple.com>
1591
1592         Assertion Failed: m_databaseQueue.isKilled() in UniqueIDBDatabase::~UniqueIDBDatabase()
1593         https://bugs.webkit.org/show_bug.cgi?id=195073
1594         <rdar://problem/48285200>
1595
1596         Reviewed by Geoffrey Garen.
1597
1598         r240931 removed a retain cycle between IDBConnectionToServer and IDBConnectionToServerDelegate, so 
1599         IDBConnectionToServerDelegate, or InProcessIDBServer would not live forever. When IDBDatabase is gone, 
1600         InProcessIDBServer would schedule a notifification to IDBServer with databaseConnectionClosed. IDBServer would 
1601         then notify UniqueIDBDatabase. When UniqueIDBDatabase finds all database connections are gone, it would acquires
1602         its only reference pointer from IDBServer schedule and perform a shutdown that kills its database task queue.
1603
1604         The assertion failure tells us UniqueIDBDatabase was destructed at when IDBServer was destructed, which means 
1605         UniqueIDBDatabase had not acquired its pointer. It's probably because UniqueIDBDatabase had unfinished tasks or
1606         the operation timer function had not been executed. Since UniqueIDBDatabase needs to complete shutdown process,
1607         we should make IDBServer live as long as UniqueIDBDatabase by keeping a reference pointer of IDBServer in 
1608         UniqueIDBDatabase. 
1609
1610         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1611         (WebCore::IDBServer::UniqueIDBDatabase::UniqueIDBDatabase):
1612         (WebCore::IDBServer::UniqueIDBDatabase::deleteBackingStore):
1613         (WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose):
1614         (WebCore::IDBServer::UniqueIDBDatabase::openBackingStore):
1615         (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTask):
1616         (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTaskReply):
1617         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
1618         (WebCore::IDBServer::UniqueIDBDatabase::notifyServerAboutClose):
1619         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1620         (WebCore::IDBServer::UniqueIDBDatabase::server):
1621
1622 2019-03-06  Rob Buis  <rbuis@igalia.com>
1623
1624         Consider supporting the `referrerpolicy` attribute.
1625         https://bugs.webkit.org/show_bug.cgi?id=179053
1626
1627         Reviewed by Darin Adler.
1628
1629         This patch adds 'referrerpolicy' attribute support for iframe.
1630         If set, the value is restricted to the ReferrerPolicy enum, and
1631         if valid it is used for the subframe load.
1632         If not set or invalid, the current behavior is kept.
1633
1634         Tests: http/tests/referrer-policy-iframe/no-referrer-when-downgrade/cross-origin-http-http.html
1635                http/tests/referrer-policy-iframe/no-referrer-when-downgrade/cross-origin-http.https.html
1636                http/tests/referrer-policy-iframe/no-referrer-when-downgrade/same-origin.html
1637                http/tests/referrer-policy-iframe/no-referrer/cross-origin-http-http.html
1638                http/tests/referrer-policy-iframe/no-referrer/cross-origin-http.https.html
1639                http/tests/referrer-policy-iframe/no-referrer/same-origin.html
1640                http/tests/referrer-policy-iframe/origin-when-cross-origin/cross-origin-http-http.html
1641                http/tests/referrer-policy-iframe/origin-when-cross-origin/cross-origin-http.https.html
1642                http/tests/referrer-policy-iframe/origin-when-cross-origin/same-origin.html
1643                http/tests/referrer-policy-iframe/origin/cross-origin-http-http.html
1644                http/tests/referrer-policy-iframe/origin/cross-origin-http.https.html
1645                http/tests/referrer-policy-iframe/origin/same-origin.html
1646                http/tests/referrer-policy-iframe/same-origin/cross-origin-http-http.html
1647                http/tests/referrer-policy-iframe/same-origin/cross-origin-http.https.html
1648                http/tests/referrer-policy-iframe/same-origin/same-origin.html
1649                http/tests/referrer-policy-iframe/strict-origin-when-cross-origin/cross-origin-http-http.html
1650                http/tests/referrer-policy-iframe/strict-origin-when-cross-origin/cross-origin-http.https.html
1651                http/tests/referrer-policy-iframe/strict-origin-when-cross-origin/same-origin.html
1652                http/tests/referrer-policy-iframe/strict-origin/cross-origin-http-http.html
1653                http/tests/referrer-policy-iframe/strict-origin/cross-origin-http.https.html
1654                http/tests/referrer-policy-iframe/strict-origin/same-origin.html
1655                http/tests/referrer-policy-iframe/unsafe-url/cross-origin-http-http.html
1656                http/tests/referrer-policy-iframe/unsafe-url/cross-origin-http.https.html
1657                http/tests/referrer-policy-iframe/unsafe-url/same-origin.html
1658
1659         * html/HTMLAttributeNames.in:
1660         * html/HTMLFrameOwnerElement.h:
1661         (WebCore::HTMLFrameOwnerElement::referrerPolicy const):
1662         * html/HTMLIFrameElement.cpp:
1663         (WebCore::HTMLIFrameElement::setReferrerPolicyForBindings):
1664         (WebCore::HTMLIFrameElement::referrerPolicyForBindings const):
1665         (WebCore::HTMLIFrameElement::referrerPolicy const):
1666         * html/HTMLIFrameElement.h:
1667         * html/HTMLIFrameElement.idl:
1668         * loader/SubframeLoader.cpp:
1669         (WebCore::SubframeLoader::loadSubframe):
1670         * page/RuntimeEnabledFeatures.h:
1671         (WebCore::RuntimeEnabledFeatures::referrerPolicyAttributeEnabled const):
1672         (WebCore::RuntimeEnabledFeatures::setReferrerPolicyAttributeEnabled):
1673         * platform/ReferrerPolicy.cpp:
1674         (WebCore::parseReferrerPolicy):
1675         * platform/ReferrerPolicy.h:
1676
1677 2019-03-05  Takashi Komori  <Takashi.Komori@sony.com>
1678
1679         [curl] Remove unnecessary file.
1680         https://bugs.webkit.org/show_bug.cgi?id=195350
1681
1682         Reviewed by Fujii Hironori.
1683
1684         Removed unused file.
1685
1686         No new tests. No change in behavior.
1687
1688         * platform/network/curl/CookieJarCurlDatabase.cpp: Removed.
1689
1690 2019-03-05  Eric Liang  <ericliang@apple.com>
1691
1692         AX: Add remote search support for keyboard focusable element search type
1693         https://bugs.webkit.org/show_bug.cgi?id=195336
1694
1695         Reviewed by Chris Fleizach.
1696
1697         Added AXKeyboardFocusable search key to return default keyboard-focusable elements for accessibility.
1698
1699         Test: accessibility/mac/search-predicate-keyboard-focusable.html
1700
1701         * accessibility/AccessibilityObject.cpp:
1702         (WebCore::AccessibilityObject::isAccessibilityObjectSearchMatchAtIndex):
1703         (WebCore::AccessibilityObject::isKeyboardFocusable const):
1704         * accessibility/AccessibilityObject.h:
1705         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
1706         (createAccessibilitySearchKeyMap):
1707
1708 2019-03-05  Don Olmstead  <don.olmstead@sony.com>
1709
1710         [WinCairo] Enable CSS Typed OM
1711         https://bugs.webkit.org/show_bug.cgi?id=195340
1712
1713         Reviewed by Myles C. Maxfield.
1714
1715         * bindings/js/CallTracerTypes.h:
1716
1717 2019-03-05  Sihui Liu  <sihui_liu@apple.com>
1718
1719         Fix a typo in Web SQL quirk
1720         https://bugs.webkit.org/show_bug.cgi?id=195338
1721
1722         Reviewed by Geoffrey Garen.
1723
1724         * page/Quirks.cpp:
1725         (WebCore::Quirks::hasWebSQLSupportQuirk const):
1726
1727 2019-03-05  Daniel Bates  <dabates@apple.com>
1728
1729         [iOS] Should not scroll when checkbox, radio, submit, reset, or button is spacebar activated
1730         https://bugs.webkit.org/show_bug.cgi?id=195281
1731         <rdar://problem/48564347>
1732
1733         Reviewed by Simon Fraser.
1734
1735         Do not call the base class's default event handler (HTMLTextFormControlElement::defaultEventHandler())
1736         when WebCore sees a keydown of the spacebar as we consider such an event as handled.
1737         Otherwise, calling the base class's default event handler ultimately gives the embedding
1738         client a chance to wrongly handle the event. In the case of iOS, keydown of the spacebar
1739         causes the page to scroll.
1740
1741         WebCore implements spacebar activation on keydown for form controls. For IE compatibility
1742         WebCore does not mark such keydown events as handled so that a DOM keypress event will
1743         be subsequently dispatched. The current logic only skips calling the base class's default
1744         event handler if the DOM event was not marked handled. This is insufficient. We need to
1745         know whether WebCore handled the event. If asking the input type to handle the key down
1746         marks the DOM event as handled then, clearly, WebCore handled the event. However, if the
1747         event is not marked as handled, but WebCore actually accounted for this event then we need
1748         to know this so that we do not call the base class's default event handler and ultimately
1749         the embedding client asking for an interpretation of the key event. Towards this, have
1750         InputType::handleKeydownEvent() return a bit whether or not the base class's default
1751         event handler should be invoked.
1752
1753         Tests: fast/events/ios/activating-button-should-not-scroll-page.html
1754                fast/events/ios/activating-checkbox-should-not-scroll-page.html
1755                fast/events/ios/activating-radio-button-should-not-scroll-page.html
1756                fast/events/ios/activating-reset-button-should-not-scroll-page.html
1757                fast/events/ios/activating-submit-button-should-not-scroll-page.html
1758
1759         * html/BaseCheckableInputType.cpp:
1760         (WebCore::BaseCheckableInputType::handleKeydownEvent): Return ShouldCallBaseEventHandler::No
1761         if WebCore handled the spacebar activation. Otherewise, return ShouldCallBaseEventHandler::Yes.
1762         * html/BaseCheckableInputType.h:
1763         * html/BaseChooserOnlyDateAndTimeInputType.cpp:
1764         (WebCore::BaseChooserOnlyDateAndTimeInputType::handleKeydownEvent): Ditto.
1765         * html/BaseChooserOnlyDateAndTimeInputType.h:
1766         * html/BaseClickableWithKeyInputType.cpp:
1767         (WebCore::BaseClickableWithKeyInputType::handleKeydownEvent): Keep our current behavior by returning ShouldCallBaseEventHandler::Yes.
1768         * html/BaseClickableWithKeyInputType.h:
1769         * html/HTMLInputElement.cpp:
1770         (WebCore::HTMLInputElement::defaultEventHandler): Do not fallthrough and call the base class's default
1771         event handler if the input type told us it handled the event regardless of whether the event was handled
1772         from the perspective of the DOM.
1773         * html/InputType.cpp:
1774         (WebCore::InputType::handleKeydownEvent): Keep our current behavior by returning ShouldCallBaseEventHandler::Yes.
1775         * html/InputType.h:
1776
1777         * html/NumberInputType.cpp:
1778         (WebCore::NumberInputType::handleKeydownEvent):
1779         * html/NumberInputType.h:
1780         * html/RadioInputType.cpp:
1781         (WebCore::RadioInputType::handleKeydownEvent):
1782         * html/RadioInputType.h:
1783         * html/RangeInputType.cpp:
1784         (WebCore::RangeInputType::handleKeydownEvent):
1785         * html/RangeInputType.h:
1786         * html/SearchInputType.cpp:
1787         (WebCore::SearchInputType::handleKeydownEvent):
1788         * html/SearchInputType.h:
1789         * html/TextFieldInputType.cpp:
1790         (WebCore::TextFieldInputType::handleKeydownEvent):
1791         * html/TextFieldInputType.h:
1792         Keep our current behavior by returning ShouldCallBaseEventHandler::Yes.
1793
1794 2019-03-05  Takashi Komori  <Takashi.Komori@sony.com>
1795
1796         [Curl] Implement Cookie Accept Policy.
1797         https://bugs.webkit.org/show_bug.cgi?id=191645
1798
1799         Reviewed by Fujii Hironori.
1800
1801         Make Curl network layer respect to coookie accept policy.
1802         This patch fixes tests below on TestRunner, but doesn't fix tests on DumpRenderTree.
1803
1804         Tests: http/tests/cookies/only-accept-first-party-cookies.html
1805                http/tests/cookies/third-party-cookie-relaxing.html
1806                http/tests/security/cookies/third-party-cookie-blocking-redirect.html
1807                http/tests/security/cookies/third-party-cookie-blocking-user-action.html
1808                http/tests/security/cookies/third-party-cookie-blocking-xslt.xml
1809                http/tests/security/cookies/third-party-cookie-blocking.html
1810
1811         * platform/network/curl/CookieJarCurl.cpp:
1812         (WebCore::cookiesForSession):
1813         (WebCore::CookieJarCurl::setCookiesFromDOM const):
1814         (WebCore::CookieJarCurl::setCookiesFromHTTPResponse const):
1815         (WebCore::CookieJarCurl::setCookieAcceptPolicy const):
1816         (WebCore::CookieJarCurl::cookieAcceptPolicy const):
1817         (WebCore::CookieJarCurl::getRawCookies const):
1818         * platform/network/curl/CookieJarCurl.h:
1819         * platform/network/curl/CookieJarDB.cpp:
1820         (WebCore::CookieJarDB::openDatabase):
1821         (WebCore::CookieJarDB::isEnabled const):
1822         (WebCore::CookieJarDB::checkCookieAcceptPolicy):
1823         (WebCore::CookieJarDB::hasCookies):
1824         (WebCore::CookieJarDB::searchCookies):
1825         (WebCore::CookieJarDB::canAcceptCookie):
1826         (WebCore::CookieJarDB::setCookie):
1827         (WebCore::CookieJarDB::setEnabled): Deleted.
1828         * platform/network/curl/CookieJarDB.h:
1829         (WebCore::CookieJarDB::setAcceptPolicy):
1830         (WebCore::CookieJarDB::acceptPolicy const):
1831         * platform/network/curl/CookieUtil.cpp:
1832         (WebCore::CookieUtil::parseCookieAttributes):
1833         (WebCore::CookieUtil::parseCookieHeader):
1834         * platform/network/curl/CurlResourceHandleDelegate.cpp:
1835         (WebCore::handleCookieHeaders):
1836         (WebCore::CurlResourceHandleDelegate::curlDidReceiveResponse):
1837
1838 2019-03-05  Zalan Bujtas  <zalan@apple.com>
1839
1840         [ContentChangeObserver] Assert on if notify content change is allowed
1841         https://bugs.webkit.org/show_bug.cgi?id=195332
1842         <rdar://problem/48603276>
1843
1844         Reviewed by Simon Fraser.
1845
1846         Assert we don't notify the client about the state change while in handleSyntheticClick().
1847
1848         * page/ios/ContentChangeObserver.cpp:
1849         (WebCore::ContentChangeObserver::domTimerExecuteDidStart):
1850         (WebCore::ContentChangeObserver::domTimerExecuteDidFinish):
1851         (WebCore::ContentChangeObserver::adjustObservedState):
1852         * page/ios/ContentChangeObserver.h:
1853         (WebCore::ContentChangeObserver::isObservingContentChanges const):
1854         (WebCore::ContentChangeObserver::isNotifyContentChangeAllowed const):
1855
1856 2019-03-05  Said Abou-Hallawa  <sabouhallawa@apple.com>
1857
1858         SVGPathSegList.insertItemBefore() should fail if the newItem belongs to an animating animPathSegList
1859         https://bugs.webkit.org/show_bug.cgi?id=195333
1860         <rdar://problem/48475802>
1861
1862         Reviewed by Simon Fraser.
1863
1864         Because the SVG1.1 specs states that the newItem should be removed from
1865         its original list before adding it to another list,
1866         SVGPathSegList.insertItemBefore() should fail if the new item belongs to
1867         an animating animPathSegList since it is read-only.
1868
1869         Test: svg/dom/SVGPathSegList-insert-from-animating-animPathSegList.svg
1870
1871         * svg/SVGPathSegList.cpp:
1872         (WebCore::SVGPathSegList::processIncomingListItemValue):
1873
1874 2019-03-05  Zalan Bujtas  <zalan@apple.com>
1875
1876         [ContentChangeObserver] Send content change notification through adjustObservedState
1877         https://bugs.webkit.org/show_bug.cgi?id=195328
1878         <rdar://problem/48601143>
1879
1880         Reviewed by Simon Fraser.
1881
1882         Have a dedicated place for the notification logic.
1883
1884         * page/ios/ContentChangeObserver.cpp:
1885         (WebCore::ContentChangeObserver::stopDurationBasedContentObservation):
1886         (WebCore::ContentChangeObserver::didInstallDOMTimer):
1887         (WebCore::ContentChangeObserver::didRemoveDOMTimer):
1888         (WebCore::ContentChangeObserver::domTimerExecuteDidFinish):
1889         (WebCore::ContentChangeObserver::styleRecalcDidFinish):
1890         (WebCore::ContentChangeObserver::mouseMovedDidStart):
1891         (WebCore::ContentChangeObserver::adjustObservedState):
1892         (WebCore::ContentChangeObserver::registerDOMTimer): Deleted.
1893         (WebCore::ContentChangeObserver::unregisterDOMTimer): Deleted.
1894         (WebCore::ContentChangeObserver::notifyContentChangeIfNeeded): Deleted.
1895         * page/ios/ContentChangeObserver.h:
1896         (WebCore::ContentChangeObserver::registerDOMTimer):
1897         (WebCore::ContentChangeObserver::unregisterDOMTimer):
1898
1899 2019-03-05  Youenn Fablet  <youenn@apple.com>
1900
1901         MockLibWebRTCPeerConnection is leaking some session description
1902         https://bugs.webkit.org/show_bug.cgi?id=195315
1903         <rdar://problem/47840038>
1904
1905         Reviewed by David Kilzer.
1906
1907         Make sure to release raw pointers given from WebCore to mock libwebrtc layer.
1908         Covered by existing tests when run in leaks mode.
1909
1910         * testing/MockLibWebRTCPeerConnection.cpp:
1911         (WebCore::MockLibWebRTCPeerConnection::SetLocalDescription):
1912         (WebCore::MockLibWebRTCPeerConnection::SetRemoteDescription):
1913
1914 2019-03-05  Ryan Haddad  <ryanhaddad@apple.com>
1915
1916         Unreviewed, rolling out r242403.
1917
1918         Caused layout test crashes on iOS simulator.
1919
1920         Reverted changeset:
1921
1922         "[ContentChangeObserver] Introduce fixed duration content
1923         observation"
1924         https://bugs.webkit.org/show_bug.cgi?id=195295
1925         https://trac.webkit.org/changeset/242403
1926
1927 2019-03-05  Frederic Wang  <fwang@igalia.com>
1928
1929         Web Inspector: Better categorize CPU usage per-thread / worker
1930         https://bugs.webkit.org/show_bug.cgi?id=194564
1931
1932         Unreviewed compilation fix.
1933
1934         * page/ResourceUsageData.h: Add missing headers.
1935
1936 2019-03-05  Frederic Wang  <fwang@igalia.com>
1937
1938         Share more code for updating the state of frame scrolling nodes
1939         https://bugs.webkit.org/show_bug.cgi?id=195254
1940
1941         Unreviewed compilation warning fix.
1942
1943         * page/scrolling/AsyncScrollingCoordinator.cpp:
1944         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated): Add UNUSED_PARAM on non-Cocoa
1945         platforms.
1946
1947 2019-03-05  Cathie Chen  <cathiechen@igalia.com>
1948
1949         The include file in ScrollingStateFrameHostingNode.h is wrong.
1950         https://bugs.webkit.org/show_bug.cgi?id=195280
1951
1952         Reviewed by Frédéric Wang.
1953
1954         * page/scrolling/ScrollingStateFrameHostingNode.h:
1955
1956 2019-03-04  Justin Fan  <justin_fan@apple.com>
1957
1958         Unreviewed build fix for High Sierra.
1959
1960         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm: Should fix "global constructor" error.
1961
1962 2019-03-04  Brent Fulgham  <bfulgham@apple.com>
1963
1964         Use a SQLite database to hold the ResourceLoadStatistics data
1965         https://bugs.webkit.org/show_bug.cgi?id=194867
1966         <rdar://problem/24240854>
1967
1968         Reviewed by Chris Dumez.
1969
1970         Add a new runtime feature flag to support use of an experimental database
1971         back-end. Also expose some SQLite function calls for use outside of WebCore.
1972
1973         No change in functionality, so no new tests.
1974
1975         * page/RuntimeEnabledFeatures.h:
1976         (WebCore::RuntimeEnabledFeatures::setItpDatabaseModeEnabled):
1977         (WebCore::RuntimeEnabledFeatures::itpDatabaseModeEnabled const):
1978         * platform/sql/SQLiteDatabase.h:
1979         * platform/sql/SQLiteStatement.h:
1980
1981 2019-03-04  Justin Fan  <justin_fan@apple.com>
1982
1983         [Web GPU] Blitting function prototypes
1984         https://bugs.webkit.org/show_bug.cgi?id=195224
1985         <rdar://problem/48538902>
1986
1987         Reviewed by Dean Jackson.
1988
1989         Implement barebones GPUCommandBuffer::copy* prototypes while rounding out GPUTexture implementation details.
1990
1991         Test: webgpu/blit-commands.html
1992
1993         * Modules/webgpu/GPUOrigin3D.h: Added.
1994         * Modules/webgpu/GPUOrigin3D.idl: Added.
1995         * Modules/webgpu/WebGPUCommandBuffer.cpp: Add copy view struct implementations.
1996         (WebCore::WebGPUBufferCopyView::asGPUBufferCopyView const): Added.
1997         (WebCore::WebGPUTextureCopyView::asGPUTextureCopyView const): Added.
1998         (WebCore::WebGPUCommandBuffer::copyBufferToBuffer): Added.
1999         (WebCore::WebGPUCommandBuffer::copyBufferToTexture): Added.
2000         (WebCore::WebGPUCommandBuffer::copyTextureToBuffer): Added.
2001         (WebCore::WebGPUCommandBuffer::copyTextureToTexture): Added.
2002         * Modules/webgpu/WebGPUCommandBuffer.h: Add new functions and supporting structs.
2003         * Modules/webgpu/WebGPUCommandBuffer.idl: Ditto.
2004         * Modules/webgpu/WebGPURenderPassDescriptor.cpp: Refactor constructors to copy the entire base class.
2005         (WebCore::GPURenderPassColorAttachmentDescriptor::GPURenderPassColorAttachmentDescriptor):
2006         (WebCore::GPURenderPassDepthStencilAttachmentDescriptor::GPURenderPassDepthStencilAttachmentDescriptor):
2007         (WebCore::WebGPURenderPassDescriptor::asGPURenderPassDescriptor const):
2008         (WebCore::attachment): Deleted.
2009         * Modules/webgpu/WebGPUTexture.h:
2010         (WebCore::WebGPUTexture::texture const): Added.
2011         * platform/graphics/gpu/GPUBuffer.h:
2012         (WebCore::GPUBuffer::byteLength const): Added.
2013         (WebCore::GPUBuffer::isTransferSource const): Added.
2014         (WebCore::GPUBuffer::isTransferDestination const): Renamed from isTransferDst. Refactored for OptionSet API.
2015         (WebCore::GPUBuffer::isVertex const): Ditto.
2016         (WebCore::GPUBuffer::isUniform const): Ditto.
2017         (WebCore::GPUBuffer::isStorage const): Ditto.
2018         (WebCore::GPUBuffer::isMappable const): Ditto.
2019         (WebCore::GPUBuffer::isMapWrite const): Ditto.
2020         (WebCore::GPUBuffer::isMapRead const): Ditto.
2021         * platform/graphics/gpu/GPUBufferUsage.h: Refactored for better bit flag style.
2022         * platform/graphics/gpu/GPUCommandBuffer.h:
2023         (WebCore::GPUCommandBuffer::blitEncoder const): Added.
2024         * platform/graphics/gpu/GPURenderPassDescriptor.h: 
2025         * platform/graphics/gpu/GPUTexture.h: Cache usage flags for reference.
2026         (WebCore::GPUTexture::isTransferSrc const): Added.
2027         (WebCore::GPUTexture::isTransferDst const): Added.
2028         (WebCore::GPUTexture::isOutputAttachment const): Added.
2029         * platform/graphics/gpu/GPUTextureUsage.h: Refactor to match GPUBufferUsage.h.
2030         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
2031         (WebCore::GPUBuffer::validateBufferUsage): Renamed from validateBufferCreate, refactored for OptionSet.
2032         (WebCore::GPUBuffer::tryCreate):
2033         (WebCore::GPUBuffer::GPUBuffer):
2034         (WebCore::GPUBuffer::isReadOnly const):
2035         (WebCore::GPUBuffer::setSubData): Add alignment check according to Metal docs.
2036         * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm: 
2037         (WebCore::GPUCommandBuffer::create): No need to use this alias here.
2038         (WebCore::GPUCommandBuffer::GPUCommandBuffer): Ditto.
2039         (WebCore::GPUCommandBuffer::copyBufferToBuffer): Added.
2040         (WebCore::GPUCommandBuffer::copyBufferToTexture): Added.
2041         (WebCore::GPUCommandBuffer::copyTextureToBuffer): Added. 
2042         (WebCore::GPUCommandBuffer::copyTextureToTexture): Added. 
2043         * platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
2044         (WebCore::GPUQueue::submit): End encoding on the MTLCommandBuffer's blitCommandEncoder if it was used.
2045         * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
2046         (WebCore::GPUSwapChain::getNextTexture): Now provide usage flags to texture creation.
2047         * platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
2048         (WebCore::mtlTextureUsageForGPUTextureUsageFlags): Refactor validation.
2049         (WebCore::tryCreateMtlTextureDescriptor): Ditto.
2050         (WebCore::GPUTexture::tryCreate): Now provide usage flags to texture creation.
2051         (WebCore::GPUTexture::create): Ditto.
2052         (WebCore::GPUTexture::GPUTexture): Ditto.
2053         (WebCore::GPUTexture::createDefaultTextureView): Ditto.
2054
2055 2019-03-04  Zalan Bujtas  <zalan@apple.com>
2056
2057         [ContentChangeObserver] Introduce fixed duration content observation
2058         https://bugs.webkit.org/show_bug.cgi?id=195295
2059         <rdar://problem/48579913>
2060
2061         Reviewed by Simon Fraser.
2062
2063         Some pages have a runloop-like scheduling setup where the content triggering change happens at a nested timer firing.
2064         This patch helps finding cases like that using a 32ms long fixed window. Currently nested timers get dropped on the floor and
2065         we stop observing for content changes before they even get fired.
2066
2067         Test: fast/events/touch/ios/visibility-change-happens-on-timer-hops.html
2068
2069         * page/ios/ContentChangeObserver.cpp:
2070         (WebCore::ContentChangeObserver::ContentChangeObserver):
2071         (WebCore::ContentChangeObserver::startContentObservationForDuration):
2072         (WebCore::ContentChangeObserver::stopDurationBasedContentObservation):
2073         (WebCore::ContentChangeObserver::hasDeterminateState const):
2074         (WebCore::ContentChangeObserver::adjustObservedState):
2075         * page/ios/ContentChangeObserver.h:
2076         (WebCore::ContentChangeObserver::isObservingContentChanges const):
2077         (WebCore::ContentChangeObserver::hasPendingActivity const):
2078
2079 2019-03-04  Wenson Hsieh  <wenson_hsieh@apple.com>
2080
2081         Native text selection UI is incorrectly suppressed in Microsoft Visio
2082         https://bugs.webkit.org/show_bug.cgi?id=195178
2083         <rdar://problem/48519394>
2084
2085         Reviewed by Darin Adler.
2086
2087         Currently, our heuristics for detecting hidden editable areas attempt to search for empty parent renderers with
2088         "overflow: hidden". It does this by ascending the layer tree in search of renderers that have an empty content
2089         size, and whose renderers' styles indicate that they have overflow: hidden in the X or Y directions. This fails
2090         in the case where a child renderer is positioned out of flow, relative to one of its parent layers, since the
2091         child will be visible, but we'll incorrectly believe that it is hidden. This leads to selection UI unexpectedly
2092         disappearing in the online version of Microsoft Visio.
2093
2094         To fix this, we check whether the enclosing layer around the editable element has an empty clip rect; if the
2095         element is inside of a subframe, we additionally walk up to each enclosing frame's layer and check if that
2096         frame's layer has an empty clip rect.
2097
2098         Test: editing/selection/ios/do-not-hide-selection-in-visible-container.html
2099
2100         * rendering/RenderObject.cpp:
2101         (WebCore::RenderObject::isTransparentOrFullyClippedRespectingParentFrames const):
2102
2103 2019-03-01  Ryosuke Niwa  <rniwa@webkit.org>
2104
2105         gPictureOwnerMap is unnecessary
2106         https://bugs.webkit.org/show_bug.cgi?id=195228
2107
2108         Reviewed by Zalan Bujtas.
2109
2110         Just store in HTMLImageElement. An extra pointer isn't going to affect the memory use here.
2111         If anything, we should worry about m_editableImage and m_pendingClonedAttachmentID instead.
2112
2113         * html/HTMLImageElement.cpp:
2114         (WebCore::HTMLImageElement::pictureElement const):
2115         (WebCore::HTMLImageElement::setPictureElement):
2116         * html/HTMLImageElement.h:
2117
2118 2019-03-04  Daniel Bates  <dabates@apple.com>
2119
2120         [iOS] Caret x-position in empty text area does not match text field
2121         https://bugs.webkit.org/show_bug.cgi?id=195125
2122         <rdar://problem/47161070>
2123
2124         Remove the word "use" in the added comment to make it read well.
2125
2126         * css/html.css:
2127         (textarea):
2128
2129 2019-03-04  Joseph Pecoraro  <pecoraro@apple.com>
2130
2131         ITMLKit Inspector: Data Bindings / Associated Data for nodes
2132         https://bugs.webkit.org/show_bug.cgi?id=195290
2133         <rdar://problem/48304019>
2134
2135         Reviewed by Devin Rousso.
2136
2137         * inspector/agents/InspectorDOMAgent.h:
2138         * inspector/agents/InspectorDOMAgent.cpp:
2139         (WebCore::InspectorDOMAgent::getDataBindingsForNode):
2140         (WebCore::InspectorDOMAgent::getAssociatedDataForNode):
2141         Stub these for web pages, they will only be used for ITMLKit right now.
2142
2143 2019-03-04  Daniel Bates  <dabates@apple.com>
2144
2145         [iOS] Caret x-position in empty text area does not match text field
2146         https://bugs.webkit.org/show_bug.cgi?id=195125
2147         <rdar://problem/47161070>
2148
2149         Reviewed by Darin Adler.
2150
2151         Fix up User Agent styles for <textarea> on iOS such that they have the same left padding
2152         width and same text-indent as <input type="text">. This makes the x-position of the caret
2153         in an empty textarea match the position of the caret in an empty text field.
2154
2155         Test: fast/forms/textarea/ios/caret-x-position-in-textarea-matches-textfield.html
2156
2157         * css/html.css:
2158         (textarea): For iOS Family, do not use the padding shorthand property. Instead explicitly specify
2159         padding-top and padding-bottom to be 2px to keep our current behavior (because it looks reasonable)
2160         and do not specify left and right padding so that we inherit the padding set earlier in this file.
2161         (textarea::placeholder): Deleted. This was added to "try" to make fix up the position of the placeholder
2162         text so as to match the position of the textarea's inner text and the position of a text field's inner
2163         text. This fix up may have worked out visually when it was added, but based on the discovery of the
2164         hardcoded 3px left and right padding (see below remark) it looks like it was always one pixel too short.
2165         * html/HTMLTextAreaElement.cpp:
2166         (WebCore::HTMLTextAreaElement::createInnerTextStyle): Remove hardcoded 3px left and right padding.
2167
2168 2019-03-04  Youenn Fablet  <youenn@apple.com>
2169
2170         Make sure to correctly notify of end of a ServiceWorkerJob when the context is stopped
2171         https://bugs.webkit.org/show_bug.cgi?id=195195
2172
2173         Reviewed by Chris Dumez.
2174
2175         Before the patch, we were notifying that some jobs were finished too aggressively at context stop time.
2176         This was confusing the Network Process.
2177         Only notify such jobs that have pending loads.
2178         Improve the tracking of jobs doing registration resolution to ensure the Network Process gets notified
2179         in case of a registration promise being resolved but the settling callback being not yet called while the context is stopped.
2180
2181         Covered by existing tests not crashing anymore, in particular imported/w3c/web-platform-tests/service-workers/service-worker/skip-waiting.https.html.
2182
2183         * workers/service/ServiceWorkerContainer.cpp:
2184         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
2185         (WebCore::ServiceWorkerContainer::notifyRegistrationIsSettled):
2186         (WebCore::ServiceWorkerContainer::stop):
2187         * workers/service/ServiceWorkerContainer.h:
2188         * workers/service/ServiceWorkerJob.cpp:
2189         (WebCore::ServiceWorkerJob::cancelPendingLoad):
2190         * workers/service/ServiceWorkerJob.h:
2191         (WebCore::ServiceWorkerJob::isLoading const):
2192
2193 2019-03-04  Chris Dumez  <cdumez@apple.com>
2194
2195         [iOS] Improve our file picker
2196         https://bugs.webkit.org/show_bug.cgi?id=195284
2197         <rdar://problem/45655856>
2198
2199         Reviewed by Tim Horton and Wenson Hsieh.
2200
2201         Export UTIUtilities.h so that it can be used from WebKit2.
2202
2203         * WebCore.xcodeproj/project.pbxproj:
2204
2205 2019-03-04  Zalan Bujtas  <zalan@apple.com>
2206
2207         [ContentChangeObserver] Decouple mouseMoved event and the "is observing content change" status.
2208         https://bugs.webkit.org/show_bug.cgi?id=195286
2209
2210         Reviewed by Simon Fraser.
2211
2212         Now isObservingContentChanges returns true only when we are actively observing content change during timer firing and/or style recalculating.
2213         This patch also renames a couple of functions to follow the didStart/didFinish pattern.
2214
2215         * page/ios/ContentChangeObserver.cpp:
2216         (WebCore::ContentChangeObserver::domTimerExecuteDidStart):
2217         (WebCore::ContentChangeObserver::domTimerExecuteDidFinish):
2218         (WebCore::ContentChangeObserver::styleRecalcDidStart):
2219         (WebCore::ContentChangeObserver::styleRecalcDidFinish):
2220         (WebCore::ContentChangeObserver::mouseMovedDidStart):
2221         (WebCore::ContentChangeObserver::mouseMovedDidFinish):
2222         (WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc):
2223         (WebCore::ContentChangeObserver::StyleChangeScope::StyleChangeScope):
2224         (WebCore::ContentChangeObserver::MouseMovedScope::MouseMovedScope):
2225         (WebCore::ContentChangeObserver::MouseMovedScope::~MouseMovedScope):
2226         (WebCore::ContentChangeObserver::StyleRecalcScope::StyleRecalcScope):
2227         (WebCore::ContentChangeObserver::StyleRecalcScope::~StyleRecalcScope):
2228         (WebCore::ContentChangeObserver::DOMTimerScope::DOMTimerScope):
2229         (WebCore::ContentChangeObserver::DOMTimerScope::~DOMTimerScope):
2230         (WebCore::ContentChangeObserver::startObservingDOMTimerExecute): Deleted.
2231         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute): Deleted.
2232         (WebCore::ContentChangeObserver::startObservingStyleRecalc): Deleted.
2233         (WebCore::ContentChangeObserver::stopObservingStyleRecalc): Deleted.
2234         (WebCore::ContentChangeObserver::startObservingMouseMoved): Deleted.
2235         (WebCore::ContentChangeObserver::stopObservingMouseMoved): Deleted.
2236         (WebCore::ContentChangeObserver::setShouldObserveStyleRecalc): Deleted.
2237         * page/ios/ContentChangeObserver.h:
2238         (WebCore::ContentChangeObserver::setShouldObserveDOMTimerScheduling):
2239         (WebCore::ContentChangeObserver::isObservingDOMTimerScheduling const):
2240         (WebCore::ContentChangeObserver::isObservingStyleRecalc const):
2241         (WebCore::ContentChangeObserver::isObservingContentChanges const):
2242         (WebCore::ContentChangeObserver::startObservingDOMTimerScheduling): Deleted.
2243         (WebCore::ContentChangeObserver::stopObservingDOMTimerScheduling): Deleted.
2244         (WebCore::ContentChangeObserver::shouldObserveStyleRecalc const): Deleted.
2245
2246 2019-03-04  Yusuke Suzuki  <ysuzuki@apple.com>
2247
2248         [JSC] Offer @makeTypeError instead of exposing @TypeError
2249         https://bugs.webkit.org/show_bug.cgi?id=193858
2250
2251         Reviewed by Mark Lam.
2252
2253         Use @makeTypeError instead.
2254
2255         * Modules/mediastream/RTCPeerConnection.js:
2256         * Modules/mediastream/RTCPeerConnectionInternals.js:
2257         * Modules/streams/ReadableByteStreamInternals.js:
2258         (readableByteStreamControllerClose):
2259         (readableByteStreamControllerPullInto):
2260         * Modules/streams/ReadableStream.js:
2261         (cancel):
2262         (pipeTo):
2263         * Modules/streams/ReadableStreamBYOBReader.js:
2264         (cancel):
2265         (read):
2266         * Modules/streams/ReadableStreamDefaultReader.js:
2267         (cancel):
2268         (read):
2269         * Modules/streams/ReadableStreamInternals.js:
2270         (readableStreamReaderGenericRelease):
2271         * Modules/streams/WritableStream.js:
2272         (abort):
2273         (close):
2274         (write):
2275         (getter.closed):
2276         (getter.ready):
2277
2278 2019-03-04  Simon Fraser  <simon.fraser@apple.com>
2279
2280         Share more code between overflow and frame scrolling nodes, fixing overflow scrollbar display
2281         https://bugs.webkit.org/show_bug.cgi?id=195258
2282
2283         Reviewed by Antti Koivisto.
2284
2285         This patch moves management of scrollbar layers and scrollbar painters ("NSScrollerImp") down to
2286         ScrollingStateScrollingNode to be shared between frame and overflow nodes, allowing for
2287         scrolling thread updates of overflow scrollbars. It also moves some scrolling tree-side code
2288         to ScrollingTreeScrollingNodeDelegateMac to be shared between the "tree" nodes for overflow and frames.
2289
2290         Layers for scrollbars are given to scrolling state nodes via setNodeLayers() now, and
2291         RenderLayerCompositor::updateScrollingNodeLayers() is added to provide a bottleneck to call that.
2292         At some point AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange() should be relieved
2293         of the responsibility of pushing scrollbar layers (but the scrolling state tree needs to hold
2294         references to GraphicsLayers before that becomes safe).
2295         
2296         The actual fix that allows overflow scrollbars to show is the change in
2297         AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange() that calls scrollableArea.*ScrollbarLayerDidChange()
2298         for all ScrollableAreas. This ensures that the CALayer is pushed onto the NSScrollerImp.
2299
2300         * SourcesCocoa.txt:
2301         * WebCore.xcodeproj/project.pbxproj:
2302         * page/scrolling/AsyncScrollingCoordinator.cpp:
2303         (WebCore::AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange):
2304         (WebCore::AsyncScrollingCoordinator::setNodeLayers):
2305         (WebCore::AsyncScrollingCoordinator::setFrameScrollingNodeState):
2306         (WebCore::AsyncScrollingCoordinator::setScrollingNodeScrollableAreaGeometry):
2307         * page/scrolling/ScrollingCoordinator.h:
2308         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
2309         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
2310         (WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged):
2311         (WebCore::ScrollingStateFrameScrollingNode::setVerticalScrollbarLayer): Deleted.
2312         (WebCore::ScrollingStateFrameScrollingNode::setHorizontalScrollbarLayer): Deleted.
2313         (WebCore::ScrollingStateFrameScrollingNode::setScrollerImpsFromScrollbars): Deleted.
2314         * page/scrolling/ScrollingStateFrameScrollingNode.h:
2315         * page/scrolling/ScrollingStateScrollingNode.cpp:
2316         (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
2317         (WebCore::ScrollingStateScrollingNode::setAllPropertiesChanged):
2318         (WebCore::ScrollingStateScrollingNode::setHorizontalScrollbarLayer):
2319         (WebCore::ScrollingStateScrollingNode::setVerticalScrollbarLayer):
2320         (WebCore::ScrollingStateScrollingNode::setScrollerImpsFromScrollbars):
2321         * page/scrolling/ScrollingStateScrollingNode.h:
2322         (WebCore::ScrollingStateScrollingNode::horizontalScrollbarLayer const):
2323         (WebCore::ScrollingStateScrollingNode::verticalScrollbarLayer const):
2324         (WebCore::ScrollingStateScrollingNode::verticalScrollerImp const):
2325         (WebCore::ScrollingStateScrollingNode::horizontalScrollerImp const):
2326         * page/scrolling/ScrollingTree.cpp:
2327         (WebCore::ScrollingTree::setOrClearLatchedNode):
2328         (WebCore::ScrollingTree::handleWheelEvent):
2329         * page/scrolling/mac/ScrollingStateScrollingNodeMac.mm: Renamed from Source/WebCore/page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm.
2330         (WebCore::ScrollingStateScrollingNode::setScrollerImpsFromScrollbars):
2331         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
2332         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2333         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
2334         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
2335         (WebCore::ScrollingTreeFrameScrollingNodeMac::repositionRelatedLayers):
2336         (WebCore::ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac): Deleted.
2337         (WebCore::ScrollingTreeFrameScrollingNodeMac::releaseReferencesToScrollerImpsOnTheMainThread): Deleted.
2338         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
2339         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
2340         (WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateBeforeChildren):
2341         (WebCore::ScrollingTreeOverflowScrollingNodeMac::handleWheelEvent):
2342         (WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionRelatedLayers):
2343         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h:
2344         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
2345         (WebCore::ScrollingTreeScrollingNodeDelegateMac::~ScrollingTreeScrollingNodeDelegateMac):
2346         (WebCore::ScrollingTreeScrollingNodeDelegateMac::updateFromStateNode):
2347         (WebCore::ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent):
2348         (WebCore::ScrollingTreeScrollingNodeDelegateMac::updateScrollbarPainters):
2349         (WebCore::ScrollingTreeScrollingNodeDelegateMac::releaseReferencesToScrollerImpsOnTheMainThread):
2350         * platform/ScrollbarThemeComposite.h:
2351         * rendering/RenderLayerCompositor.cpp:
2352         (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
2353         (WebCore::RenderLayerCompositor::updateScrollingNodeLayers):
2354         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
2355         * rendering/RenderLayerCompositor.h:
2356
2357 2019-03-04  Jer Noble  <jer.noble@apple.com>
2358
2359         Remove HEVC as a codec requiring hardware support.
2360         https://bugs.webkit.org/show_bug.cgi?id=194960
2361         <rdar://problem/47741432>
2362
2363         Reviewed by Eric Carlson.
2364
2365         * page/cocoa/SettingsBaseCocoa.mm:
2366         (WebCore::SettingsBase::defaultMediaContentTypesRequiringHardwareSupport):
2367
2368 2019-03-04  Jer Noble  <jer.noble@apple.com>
2369
2370         [iOS] Fullscreen "stay in page" option breaks video playback
2371         https://bugs.webkit.org/show_bug.cgi?id=195277
2372         <rdar://problem/48537317>
2373
2374         Reviewed by Eric Carlson.
2375
2376         Add a LOG entry when playback is rejected due to media playback suspension.
2377
2378         * html/MediaElementSession.cpp:
2379         (WebCore::MediaElementSession::playbackPermitted const):
2380
2381 2019-03-04  Tim Horton  <timothy_horton@apple.com>
2382
2383         Fix the build.
2384
2385         * dom/Document.h:
2386
2387 2019-03-03  Zalan Bujtas  <zalan@apple.com>
2388
2389         [ContentChangeObserver] Content observation should be limited to the current document.
2390         https://bugs.webkit.org/show_bug.cgi?id=195256
2391         <rdar://problem/48544402>
2392
2393         Move ContentChangeObserver from Page to Document.
2394         It limits content observation to the target node's owner document.
2395
2396         Reviewed by Simon Fraser.
2397
2398         * dom/Document.cpp:
2399         (WebCore::m_contentChangeObserver):
2400         (WebCore::Document::updateStyleIfNeeded):
2401         (WebCore::Document::willDetachPage):
2402         (WebCore::Document::platformSuspendOrStopActiveDOMObjects):
2403         (WebCore::m_undoManager): Deleted.
2404         * dom/Document.h:
2405         (WebCore::Document::contentChangeObserver):
2406         * page/DOMTimer.cpp:
2407         (WebCore::DOMTimer::install):
2408         (WebCore::DOMTimer::removeById):
2409         (WebCore::DOMTimer::fired):
2410         * page/Frame.cpp:
2411         (WebCore::Frame::willDetachPage):
2412         * page/Page.cpp:
2413         (WebCore::Page::Page):
2414         * page/Page.h:
2415         (WebCore::Page::pointerLockController const):
2416         (WebCore::Page::contentChangeObserver): Deleted.
2417         * page/ios/ContentChangeObserver.cpp:
2418         (WebCore::ContentChangeObserver::ContentChangeObserver):
2419         (WebCore::ContentChangeObserver::didInstallDOMTimer):
2420         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
2421         (WebCore::ContentChangeObserver::stopObservingStyleRecalc):
2422         (WebCore::ContentChangeObserver::clearTimersAndReportContentChange):
2423         (WebCore::ContentChangeObserver::startObservingMouseMoved):
2424         (WebCore::ContentChangeObserver::hasDeterminateState const):
2425         (WebCore::ContentChangeObserver::adjustObservedState):
2426         (WebCore::ContentChangeObserver::notifyContentChangeIfNeeded):
2427         (WebCore::ContentChangeObserver::StyleChangeScope::StyleChangeScope):
2428         (WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
2429         (WebCore::ContentChangeObserver::MouseMovedScope::MouseMovedScope):
2430         (WebCore::ContentChangeObserver::MouseMovedScope::~MouseMovedScope):
2431         (WebCore::ContentChangeObserver::StyleRecalcScope::StyleRecalcScope):
2432         (WebCore::ContentChangeObserver::StyleRecalcScope::~StyleRecalcScope):
2433         (WebCore::ContentChangeObserver::DOMTimerScope::DOMTimerScope):
2434         (WebCore::ContentChangeObserver::DOMTimerScope::~DOMTimerScope):
2435         (WebCore::hasPendingStyleRecalc): Deleted.
2436         * page/ios/ContentChangeObserver.h:
2437         * page/ios/EventHandlerIOS.mm:
2438         (WebCore::EventHandler::mouseMoved):
2439         * rendering/updating/RenderTreeUpdater.cpp:
2440         (WebCore::RenderTreeUpdater::updateElementRenderer):
2441
2442 2019-03-02  Simon Fraser  <simon.fraser@apple.com>
2443
2444         Share more code for updating the state of frame scrolling nodes
2445         https://bugs.webkit.org/show_bug.cgi?id=195254
2446
2447         Reviewed by Antti Koivisto.
2448
2449         Responsibility for updating state on ScrollingStateFrameScrolling nodes was split between
2450         AsyncScrollingCoordinator::frameViewLayoutUpdated(), which is called post-layout, and
2451         RenderLayerCompositor. This patch gives that responsibility entirely to RenderLayerCompositor,
2452         ensuring that we update frame scrolling nodes at the same time as the rest of the scrolling
2453         state tree.
2454         
2455         We also share code between updating ScrollingStateFrameScrollingNodes and
2456         ScrollingStateOverflowScrollingNodews, since both can be updated from a ScrollableArea.
2457         Some minor cleanup of ScrollableArea is doing to help. For the first time, we're pushing
2458         ScrollableAreaParameters for overflow scrolling nodes, allowing rubber-banding to work
2459         on macOS.
2460
2461         * page/scrolling/AsyncScrollingCoordinator.cpp:
2462         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
2463         (WebCore::AsyncScrollingCoordinator::setRectRelativeToParentNode):
2464         (WebCore::AsyncScrollingCoordinator::setFrameScrollingNodeState):
2465         (WebCore::AsyncScrollingCoordinator::setScrollingNodeScrollableAreaGeometry):
2466         (WebCore::AsyncScrollingCoordinator::setViewportConstraintedNodeConstraints):
2467         (WebCore::AsyncScrollingCoordinator::setScrollingNodeGeometry): Deleted.
2468         (WebCore::AsyncScrollingCoordinator::setViewportConstraintedNodeGeometry): Deleted.
2469         * page/scrolling/AsyncScrollingCoordinator.h:
2470         * page/scrolling/ScrollingCoordinator.h:
2471         (WebCore::ScrollingCoordinator::setRectRelativeToParentNode):
2472         (WebCore::ScrollingCoordinator::setScrollingNodeScrollableAreaGeometry):
2473         (WebCore::ScrollingCoordinator::setFrameScrollingNodeState):
2474         (WebCore::ScrollingCoordinator::setViewportConstraintedNodeConstraints):
2475         (WebCore::ScrollingCoordinator::setScrollingNodeGeometry): Deleted.
2476         (WebCore::ScrollingCoordinator::setViewportConstraintedNodeGeometry): Deleted.
2477         * platform/ScrollView.h:
2478         (WebCore::ScrollView::horizontalScrollbarMode const): Deleted.
2479         (WebCore::ScrollView::verticalScrollbarMode const): Deleted.
2480         * platform/ScrollableArea.cpp:
2481         (WebCore::ScrollableArea::reachableTotalContentsSize const):
2482         * platform/ScrollableArea.h:
2483         (WebCore::ScrollableArea::horizontalScrollbarMode const):
2484         (WebCore::ScrollableArea::verticalScrollbarMode const):
2485         * rendering/RenderLayer.cpp:
2486         (WebCore::RenderLayer::overhangAmount const):
2487         (WebCore::RenderLayer::reachableTotalContentsSize const):
2488         (WebCore::RenderLayer::scrollableContentsSize const): Deleted.
2489         * rendering/RenderLayer.h:
2490         * rendering/RenderLayerCompositor.cpp:
2491         (WebCore::RenderLayerCompositor::updateCompositingLayers):
2492         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
2493         (WebCore::RenderLayerCompositor::updateScrollingNodeForViewportConstrainedRole):
2494         (WebCore::RenderLayerCompositor::rootParentRelativeScrollableRect const):
2495         (WebCore::RenderLayerCompositor::parentRelativeScrollableRect const):
2496         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
2497         (WebCore::RenderLayerCompositor::updateScrollingNodeForFrameHostingRole):
2498         (WebCore::RenderLayerCompositor::computeFrameScrollingGeometry const): Deleted.
2499         (WebCore::RenderLayerCompositor::computeFrameHostingGeometry const): Deleted.
2500         (WebCore::RenderLayerCompositor::computeOverflowScrollingGeometry const): Deleted.
2501         * rendering/RenderLayerCompositor.h:
2502
2503 2019-03-02  Darin Adler  <darin@apple.com>
2504
2505         Retire legacy dtoa function and DecimalNumber class
2506         https://bugs.webkit.org/show_bug.cgi?id=195253
2507
2508         Reviewed by Daniel Bates.
2509
2510         * css/CSSPrimitiveValue.cpp:
2511         (WebCore::CSSPrimitiveValue::formatNumberValue const): Use makeString instead
2512         of DecimalNumber. Also changed return type to String and use StringView and
2513         removed special handling of literals.
2514         (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText const): Removed an
2515         unnecessary use of StringBuilder.
2516
2517         * css/CSSPrimitiveValue.h: Updated for changes to formatNumberValue.
2518
2519 2019-03-03  Michael Catanzaro  <mcatanzaro@igalia.com>
2520
2521         [SOUP] Cleanups in SoupNetworkSession
2522         https://bugs.webkit.org/show_bug.cgi?id=195247
2523
2524         Reviewed by Daniel Bates.
2525
2526         This renames clientCertificates to allowedCertificates, since they are not client
2527         certificates at all, but server certificates. It also adds a using statement to avoid
2528         repeating the long type of the map, and avoids an unnecessary copy.
2529
2530         * platform/network/soup/SoupNetworkSession.cpp:
2531         (WebCore::allowedCertificates):
2532         (WebCore::SoupNetworkSession::checkTLSErrors):
2533         (WebCore::SoupNetworkSession::allowSpecificHTTPSCertificateForHost):
2534         (WebCore::clientCertificates): Deleted.
2535
2536 2019-03-03  Michael Catanzaro  <mcatanzaro@igalia.com>
2537
2538         -Wformat error in SharedBuffer::tryCreateArrayBuffer
2539         https://bugs.webkit.org/show_bug.cgi?id=195004
2540
2541         Reviewed by Darin Adler.
2542
2543         Seems C++ has no format specifier appropriate for printing the result of sizeof. We should
2544         just not try to print it. Anyway, that's easy in this case, because sizeof(char) is
2545         guaranteed to be 1. This code was an attempt to be pedantic to account for mythical systems
2546         with char larger than one byte, but perhaps it didn't realize sizeof always returns
2547         multiples of char and so sizeof(char) is always one even on such mythical systems.
2548
2549         Note the sizeof(char) use two lines up is left since it's not clear that switching it to 1
2550         would actually be more readable.
2551
2552         * platform/SharedBuffer.cpp:
2553         (WebCore::SharedBuffer::tryCreateArrayBuffer const):
2554
2555 2019-03-03  Tim Horton  <timothy_horton@apple.com>
2556
2557         Remove some more unused 32-bit code
2558         https://bugs.webkit.org/show_bug.cgi?id=195255
2559
2560         Reviewed by Darin Adler.
2561
2562         * platform/gamepad/cocoa/GameControllerGamepad.h:
2563         * platform/gamepad/cocoa/GameControllerGamepad.mm:
2564         * platform/gamepad/cocoa/GameControllerGamepadProvider.h:
2565         * platform/gamepad/cocoa/GameControllerGamepadProvider.mm:
2566         * platform/graphics/cocoa/FontCascadeCocoa.mm:
2567         * platform/mac/PlatformEventFactoryMac.mm:
2568         (WebCore::globalPointForEvent):
2569         (WebCore::pointForEvent):
2570         (WebCore::mouseButtonForEvent):
2571         (WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder):
2572         * rendering/RenderThemeMac.mm:
2573         (WebCore::RenderThemeMac::servicesRolloverButtonCell const):
2574         (WebCore::RenderThemeMac::paintImageControlsButton):
2575         (WebCore::RenderThemeMac::imageControlsButtonSize const):
2576         (WebCore::RenderThemeMac::imageControlsButtonPositionOffset const):
2577
2578 2019-03-02  Zalan Bujtas  <zalan@apple.com>
2579
2580         [ContentChangeObserver] Introduce ContentChangeObserver::MouseMovedScope
2581         https://bugs.webkit.org/show_bug.cgi?id=195252
2582         <rdar://problem/48539446>
2583
2584         Reviewed by Simon Fraser.
2585
2586         Scope the mouse-moved event to make the callsites less error-prone. 
2587
2588         * page/ios/ContentChangeObserver.cpp:
2589         (WebCore::ContentChangeObserver::startObservingMouseMoved):
2590         (WebCore::ContentChangeObserver::stopObservingMouseMoved):
2591         (WebCore::ContentChangeObserver::MouseMovedScope::MouseMovedScope):
2592         (WebCore::ContentChangeObserver::MouseMovedScope::~MouseMovedScope):
2593         (WebCore::ContentChangeObserver::startObservingContentChanges): Deleted.
2594         (WebCore::ContentChangeObserver::stopObservingContentChanges): Deleted.
2595         * page/ios/ContentChangeObserver.h:
2596         * page/ios/EventHandlerIOS.mm:
2597         (WebCore::EventHandler::mouseMoved):
2598
2599 2019-03-02  Zalan Bujtas  <zalan@apple.com>
2600
2601         [ContentChangeObserver] Introduce ContentChangeObserver::adjustObservedState
2602         https://bugs.webkit.org/show_bug.cgi?id=195244
2603         <rdar://problem/48536737>
2604
2605         Reviewed by Simon Fraser.
2606
2607         Move state change handling code to adjustObservedState() and introduce signalContentChangeIfNeeded() to
2608         let the client know about the state change (or lack of state change).
2609
2610         Test: fast/events/touch/ios/visibility-change-happens-at-the-second-timer.html
2611
2612         * page/ios/ContentChangeObserver.cpp:
2613         (WebCore::ContentChangeObserver::didInstallDOMTimer):
2614         (WebCore::ContentChangeObserver::didRemoveDOMTimer):
2615         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
2616         (WebCore::ContentChangeObserver::stopObservingStyleRecalc):
2617         (WebCore::ContentChangeObserver::clearTimersAndReportContentChange):
2618         (WebCore::ContentChangeObserver::didContentVisibilityChange):
2619         (WebCore::ContentChangeObserver::addObservedDOMTimer):
2620         (WebCore::ContentChangeObserver::removeObservedDOMTimer):
2621         (WebCore::ContentChangeObserver::setShouldObserveStyleRecalc):
2622         (WebCore::ContentChangeObserver::adjustObservedState):
2623         (WebCore::ContentChangeObserver::signalContentChangeIfNeeded):
2624         * page/ios/ContentChangeObserver.h:
2625         (WebCore::ContentChangeObserver::isObservingDOMTimerScheduling const):
2626         (WebCore::ContentChangeObserver::addObservedDOMTimer): Deleted.
2627         (WebCore::ContentChangeObserver::setShouldObserveStyleRecalc): Deleted.
2628
2629 2019-03-02  Zalan Bujtas  <zalan@apple.com>
2630
2631         [ContentChangeObserver] Move away from WKContentChange values
2632         https://bugs.webkit.org/show_bug.cgi?id=195240
2633         <rdar://problem/48532358>
2634
2635         Reviewed by Simon Fraser.
2636
2637         This is in preparation for moving towards a state machine-like implementation.
2638
2639         * page/ios/ContentChangeObserver.cpp:
2640         (WebCore::ContentChangeObserver::didInstallDOMTimer): Do not install the timer if we are already in "hover" state.
2641         (WebCore::ContentChangeObserver::didRemoveDOMTimer):
2642         (WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
2643         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
2644         (WebCore::ContentChangeObserver::startObservingStyleRecalc): No need to start observing the style recalc if we are already in "hover" state.
2645         (WebCore::ContentChangeObserver::stopObservingStyleRecalc):
2646         (WebCore::ContentChangeObserver::clearTimersAndReportContentChange):
2647         (WebCore::ContentChangeObserver::didContentVisibilityChange):
2648         (WebCore::ContentChangeObserver::startObservingContentChanges):
2649         (WebCore::ContentChangeObserver::observedContentChange const):
2650         (WebCore::ContentChangeObserver::removeObservedDOMTimer):
2651         (WebCore::ContentChangeObserver::hasDeterminedState const):
2652         (WebCore::ContentChangeObserver::observedContentChange): Deleted.
2653         (WebCore::ContentChangeObserver::resetObservedContentChange): Deleted.
2654         (WebCore::ContentChangeObserver::setObservedContentChange): Deleted.
2655         (WebCore::ContentChangeObserver::addObservedDOMTimer): Deleted.
2656         * page/ios/ContentChangeObserver.h:
2657         (WebCore::ContentChangeObserver::addObservedDOMTimer):
2658         (WebCore::ContentChangeObserver::clearObservedDOMTimers):
2659         (WebCore::ContentChangeObserver::hasVisibleChangeState const):
2660         (WebCore::ContentChangeObserver::hasObservedDOMTimer const):
2661         (WebCore::ContentChangeObserver::setHasNoChangeState):
2662         (WebCore::ContentChangeObserver::setHasIndeterminateState):
2663         (WebCore::ContentChangeObserver::setHasVisibleChangeState):
2664         (WebCore::ContentChangeObserver::countOfObservedDOMTimers const): Deleted.
2665
2666 2019-03-02  Wenson Hsieh  <wenson_hsieh@apple.com>
2667
2668         [iOS] Programmatic paste access should be granted when copying and pasting within the same origin
2669         https://bugs.webkit.org/show_bug.cgi?id=195053
2670         <rdar://problem/48134710>
2671
2672         Reviewed by Ryosuke Niwa.
2673
2674         Plumb the document pasteboard identifier through the client when making a DOM paste access request. See WebKit
2675         ChangeLog for more details.
2676
2677         Test: editing/pasteboard/ios/dom-paste-same-origin.html
2678
2679         * WebCore.xcodeproj/project.pbxproj:
2680         * dom/DOMPasteAccess.h: Renamed from Source/WebCore/dom/DOMPasteAccessPolicy.h.
2681
2682         Introduce DOMPasteAccessResponse, which is either DeniedForGesture, GrantedForCommand, or GrantedForGesture. In
2683         particular, when pasteboard identifiers match, we only grant access for the current paste command, rather than
2684         throughout the user gesture.
2685
2686         * dom/UserGestureIndicator.h:
2687         (WebCore::UserGestureToken::didRequestDOMPasteAccess):
2688         * loader/EmptyClients.cpp:
2689         * page/EditorClient.h:
2690         * page/Frame.cpp:
2691         (WebCore::Frame::requestDOMPasteAccess):
2692
2693 2019-02-27  Darin Adler  <darin@apple.com>
2694
2695         Fixed makeString(float) to do shortest-form serialization without first converting to double
2696         https://bugs.webkit.org/show_bug.cgi?id=195142
2697
2698         Reviewed by Daniel Bates.
2699
2700         * platform/graphics/Color.cpp: Removed unneeded include of DecimalNumber.h.
2701
2702 2019-03-02  Simon Fraser  <simon.fraser@apple.com>
2703
2704         REGRESSION (r242132): Incorrect positioning with multiple position:fixed elements
2705         https://bugs.webkit.org/show_bug.cgi?id=195246
2706
2707         Reviewed by Frederic Wang.
2708
2709         r242132 introduced a bug where the management of 'cumulativeDelta' in ScrollingTree::notifyRelatedNodesRecursive
2710         was incorrect. This value should propagate from ancestors to descendants, but not between siblings in the scrolling
2711         tree, which it did, causing sibling position:fixed to behave incorrectly.
2712
2713         Test: scrollingcoordinator/mac/multiple-fixed.html
2714
2715         * page/scrolling/ScrollingTree.cpp:
2716         (WebCore::ScrollingTree::notifyRelatedNodesRecursive):
2717         * page/scrolling/ScrollingTree.h:
2718
2719 2019-03-02  Darin Adler  <darin@apple.com>
2720
2721         Improve some comments
2722         https://bugs.webkit.org/show_bug.cgi?id=195243
2723
2724         Reviewed by Daniel Bates.
2725
2726         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2727         (-[WebAccessibilityObjectWrapper _addAccessibilityObject:toTextMarkerArray:]):
2728         Fix a typo in a comment.
2729
2730         * dom/RadioButtonGroups.cpp: Fix a typo in a comment.
2731         (WebCore::RadioButtonGroups::checkedButtonForGroup const): Use nullptr instead of 0.
2732
2733         * html/HTMLInputElement.cpp:
2734         (WebCore::HTMLInputElement::~HTMLInputElement): Improved a comment, but sadly made
2735         it a bit longer. Use nullptr instead of 0.
2736         (WebCore::HTMLInputElement::didMoveToNewDocument): Added a comment.
2737
2738 2019-03-01  Wenson Hsieh  <wenson_hsieh@apple.com>
2739
2740         [Datalist] fast/forms/datalist/datalist-child-validation.html crashes with a debug assertion in isValidFormControlElement()
2741         https://bugs.webkit.org/show_bug.cgi?id=190620
2742         <rdar://problem/19226679>
2743
2744         Reviewed by Ryosuke Niwa.
2745
2746         Fixes and re-enables an existing layout test that is asserting on debug builds (and failing on release builds).
2747         To understand why we hit this assertion, we first note several observations:
2748
2749             -   The validity of a form control (`isValid()`) depends on the value of `willValidate()`.
2750             -   Both of these results are cached in member variables: `m_isValid` and `m_willValidate`, respectively.
2751             -   `willValidate()` changes the cached value of `m_willValidate` if necessary, but `isValid()` uses the
2752                 cached value without update.
2753
2754         Now, consider the following scenario:
2755
2756             1.  Something changes in the DOM that changes the result of `willValidate()`. This can happen as a result of
2757                 several things:
2758                 a.  The form control changes readonly state
2759                 b.  The form control changes disabled state
2760                 c.  The form control is added to a datalist element
2761                 d.  The form control is removed from a datalist element
2762             2.  Call `willValidate()`.
2763             3.  Call `isValid()`.
2764
2765         In scenarios (a) - (c), we ensure that cached form control validity (`m_isValid`) is updated alongside
2766         `m_willValidate` by invoking `setNeedsWillValidateCheck()`, such that the result of `isValid()` matches the
2767         result of `m_isValid` in step (3). However, in the last scenario (d), we don't do this, which causes form
2768         control validity to fall out of sync with the result of `isValid()`. To fix the bug, we update willValidate and
2769         isValid when a form control is removed from an ancestor, only if one of its ancestors is a datalist element.
2770
2771         * html/HTMLFormControlElement.cpp:
2772         (WebCore::HTMLFormControlElement::insertedIntoAncestor):
2773         (WebCore::HTMLFormControlElement::removedFromAncestor):
2774
2775         Make a couple of minor tweaks:
2776           - Currently, we always invalidate `m_dataListAncestorState` by resetting the state to `Unknown` when the form
2777             control is removed from an ancestor or inserted. Instead, we only need to reset it when the form control
2778             already has an ancestor that is a datalist (in the case where it's being removed) or when the form control
2779             does not yet have an ancestor (in the case where it is being added).
2780           - If the form control was inside a datalist prior to removal, recompute its cached value of `m_willValidate`,
2781             as well as its cached validity (`m_isValid`).
2782
2783 2019-03-01  Darin Adler  <darin@apple.com>
2784
2785         Finish removing String::format
2786         https://bugs.webkit.org/show_bug.cgi?id=194893
2787
2788         Reviewed by Daniel Bates.
2789
2790         * dom/Document.cpp:
2791         (WebCore::Document::lastModified const): Use makeString and pad.
2792         * html/FTPDirectoryDocument.cpp:
2793         (WebCore::processFileDateString): Ditto.
2794
2795         * mathml/MathMLElement.cpp:
2796         (WebCore::convertToPercentageIfNeeded): Use makeString and FormattedNumber.
2797
2798         * page/cocoa/ResourceUsageOverlayCocoa.mm:
2799         (WebCore::ResourceUsageOverlay::platformDraw): Use makeString and pad.
2800
2801         * page/linux/ResourceUsageOverlayLinux.cpp:
2802         (WebCore::cpuUsageString): Use makeString, FormattedNumber, and pad.
2803         (WebCore::gcTimerString): Use String::number.
2804
2805         * platform/DateComponents.cpp:
2806         (WebCore::DateComponents::toStringForTime const): Use makeString and pad.
2807         (WebCore::DateComponents::toString const): Ditto.
2808
2809         * platform/LocalizedStrings.cpp: Removed comment that mentioned String::format,
2810         and that was also inaccurate.
2811
2812         * platform/audio/HRTFElevation.cpp:
2813         (WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
2814         Use makeString and pad.
2815         * platform/mock/MockRealtimeVideoSource.cpp:
2816         (WebCore::MockRealtimeVideoSource::drawText): Ditto.
2817         * rendering/RenderLayerCompositor.cpp:
2818         (WebCore::RenderLayerCompositor::logLayerInfo): Ditto.
2819         * rendering/RenderTheme.cpp:
2820         (WebCore::RenderTheme::formatMediaControlsTime const): Ditto.
2821
2822 2019-03-01  Chris Dumez  <cdumez@apple.com>
2823
2824         Do not attempt to set WAL Journal mode on a readonly SQLite database
2825         https://bugs.webkit.org/show_bug.cgi?id=195237
2826
2827         Reviewed by Simon Fraser.
2828
2829         This avoids logging errors when opening the database.
2830
2831         * platform/sql/SQLiteDatabase.cpp:
2832         (WebCore::SQLiteDatabase::open):
2833         (WebCore::SQLiteDatabase::useWALJournalMode):
2834         * platform/sql/SQLiteDatabase.h:
2835
2836 2019-03-01  Antoine Quint  <graouts@apple.com>
2837
2838         [iOS] Turn mouse event simulation on by default
2839         https://bugs.webkit.org/show_bug.cgi?id=195218
2840         <rdar://problem/48516794>
2841
2842         Reviewed by Dean Jackson.
2843
2844         * page/RuntimeEnabledFeatures.h:
2845
2846 2019-03-01  Chris Dumez  <cdumez@apple.com>
2847
2848         Disable NetworkStateNotifier::singleton()'s isMainThread() assertion when the WebThread is enabled
2849         https://bugs.webkit.org/show_bug.cgi?id=195230
2850         <rdar://problem/47925359>
2851
2852         Reviewed by Ryosuke Niwa.
2853
2854         Disable NetworkStateNotifier::singleton()'s isMainThread() assertion when the WebThread is enabled
2855         to address crashes on iOS WK1.
2856
2857         * platform/network/NetworkStateNotifier.cpp:
2858         (WebCore::shouldSuppressThreadSafetyCheck):
2859         (WebCore::NetworkStateNotifier::singleton):
2860
2861 2019-03-01  Simon Fraser  <simon.fraser@apple.com>
2862
2863         Show mouse event regions in the overlay
2864         https://bugs.webkit.org/show_bug.cgi?id=195227
2865
2866         Reviewed by Tim Horton.
2867
2868         Enhance event region overlays to show more kinds of events.
2869
2870         * page/DebugPageOverlays.cpp:
2871         (WebCore::touchEventRegionColors):
2872         (WebCore::NonFastScrollableRegionOverlay::drawRect):
2873
2874 2019-03-01  Zalan Bujtas  <zalan@apple.com>
2875
2876         [ContentChangeObserver] Check for pending style recalcs at the end of each timer run.
2877         https://bugs.webkit.org/show_bug.cgi?id=195220
2878         <rdar://problem/48518979>
2879
2880         Reviewed by Simon Fraser.
2881
2882         didScheduleStyleRecalc callback was introduced to see if a style recalc is scheduled while firing the DOM timer. However it does not handle the case
2883         when in addition to this style recalc scheduling, something later (though during the same timer firing) triggers a sync style recalc.
2884         Let's just check if we've got a pending style recalc when the DOM timer comes back.
2885
2886         Test: fast/events/touch/ios/style-recalc-schedule-and-force-relalc.html
2887
2888         * dom/Document.cpp:
2889         (WebCore::Document::scheduleStyleRecalc):
2890         * page/ios/ContentChangeObserver.cpp:
2891         (WebCore::hasPendingStyleRecalc):
2892         (WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
2893         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
2894         (WebCore::ContentChangeObserver::startObservingContentChanges):
2895         (WebCore::ContentChangeObserver::didScheduleStyleRecalc): Deleted.
2896         * page/ios/ContentChangeObserver.h:
2897         (WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling): Deleted.
2898         (WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling): Deleted.
2899         (WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling const): Deleted.
2900
2901 2019-03-01  John Wilander  <wilander@apple.com>
2902
2903         Resource Load Statistics: Further restrict client-side cookie persistence after cross-site navigations with link decoration
2904         https://bugs.webkit.org/show_bug.cgi?id=195196
2905         <rdar://problem/48006419>
2906
2907         Reviewed by Brent Fulgham.
2908
2909         Tests: http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-decoration-same-site.html
2910                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-fragment-from-prevalent-resource.html
2911                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-and-fragment-from-prevalent-resource.html
2912                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-from-prevalent-resource.html
2913                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-without-link-decoration-from-prevalent-resource.html
2914
2915         Trackers abuse link query parameters to transport user identifiers cross-site.
2916         This patch detects such navigations and applies further restrictions to
2917         client-site cookies on the destination page.
2918
2919         * platform/network/NetworkStorageSession.cpp:
2920         (WebCore::NetworkStorageSession::setAgeCapForClientSideCookies):
2921             Now sets the regular 7-day cap and a reduced 1-day cap.
2922         (WebCore::NetworkStorageSession::clearPageSpecificDataForResourceLoadStatistics):
2923             Renamed NetworkStorageSession::removeStorageAccessForAllFramesOnPage() to
2924             NetworkStorageSession::clearPageSpecificDataForResourceLoadStatistics since
2925             it now clears out two types of page-specific data.
2926         (WebCore::NetworkStorageSession::committedCrossSiteLoadWithLinkDecoration):
2927             This function receives a cross-site navigation and checks if the originating
2928             site is a prevalent resource. If so, it marks the page or stricter cookie
2929             rules.
2930         (WebCore::NetworkStorageSession::resetCrossSiteLoadsWithLinkDecorationForTesting):
2931             Test infrastructure. This sets a state that overrides the regular per-page
2932             clear of data. The reason is that the double clear was racy and caused test
2933             failures.
2934         (WebCore::NetworkStorageSession::clientSideCookieCap const):
2935             New function that returns the current cookie lifetime cap.
2936         (WebCore::NetworkStorageSession::removeStorageAccessForAllFramesOnPage): Deleted.
2937             Renamed to NetworkStorageSession::clearPageSpecificDataForResourceLoadStatistics().
2938         * platform/network/NetworkStorageSession.h:
2939         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
2940         (WebCore::NetworkStorageSession::setCookiesFromDOM const):
2941             Now calls NetworkStorageSession::clientSideCookieCap() to set the cap.
2942
2943 2019-03-01  Rob Buis  <rbuis@igalia.com>
2944
2945         Adjust XMLHttpRequest Content-Type handling
2946         https://bugs.webkit.org/show_bug.cgi?id=184645
2947
2948         Reviewed by Youenn Fablet.
2949
2950         Implement steps 4.4.1.2 and 4.4.1.3 of send() [1].
2951
2952         Test: web-platform-tests/xhr/send-content-type-charset.htm
2953
2954         [1] https://xhr.spec.whatwg.org/#dom-xmlhttprequest-send
2955
2956         * platform/network/ParsedContentType.cpp:
2957         (WebCore::ParsedContentType::setCharset):
2958         * platform/network/ParsedContentType.h:
2959         * xml/XMLHttpRequest.cpp:
2960         (WebCore::replaceCharsetInMediaTypeIfNeeded):
2961         (WebCore::XMLHttpRequest::send):
2962         (WebCore::replaceCharsetInMediaType): Deleted.
2963
2964 2019-03-01  Youenn Fablet  <youenn@apple.com>
2965
2966         Update originsMatch to handle the case of file origins which enforce file path separation
2967         https://bugs.webkit.org/show_bug.cgi?id=195216
2968
2969         Reviewed by Brady Eidson.
2970
2971         Covered by the assertion and existing tests like fast/xmlhttprequest/xmlhttprequest-no-file-access.html.
2972         Make sure originsMatch returns true if either compared origins are the same object
2973         or they have the same file path separation behavior.
2974
2975         * page/SecurityOrigin.cpp:
2976         (WebCore::areOriginsMatching):
2977         (WebCore::originsMatch):
2978
2979 2019-03-01  Youenn Fablet  <youenn@apple.com>
2980
2981         Serialize IndexedDB::ObjectStoreOverwriteMode as an enum
2982         https://bugs.webkit.org/show_bug.cgi?id=195213
2983
2984         Reviewed by Alex Christensen.
2985
2986         Add traits to enable enum IPC encoding.
2987         No change of behavior.
2988
2989         * Modules/indexeddb/IndexedDB.h:
2990
2991 2019-03-01  Don Olmstead  <don.olmstead@sony.com>
2992
2993         [WinCairo] Enable service worker
2994         https://bugs.webkit.org/show_bug.cgi?id=188318
2995
2996         Reviewed by Youenn Fablet.
2997
2998         * WebCorePrefix.h:
2999         * testing/ServiceWorkerInternals.h:
3000         * workers/service/context/SWContextManager.cpp:
3001         (WebCore::SWContextManager::serviceWorkerFailedToTerminate):
3002         * workers/service/context/SWContextManager.h:
3003
3004 2019-03-01  Sihui Liu  <sihui_liu@apple.com>
3005
3006         Add a quirk for bostongloble.com and latimes.com
3007         https://bugs.webkit.org/show_bug.cgi?id=195155
3008
3009         Reviewed by Geoffrey Garen.
3010
3011         Covered by manual testing.
3012
3013         * Modules/webdatabase/DOMWindowWebDatabase.idl:
3014         * bindings/scripts/CodeGeneratorJS.pm:
3015         (GenerateRuntimeEnableConditionalString):
3016         * bindings/scripts/IDLAttributes.json:
3017         * bindings/scripts/preprocess-idls.pl:
3018         (GenerateConstructorAttributes):
3019         * page/Quirks.cpp:
3020         (WebCore::Quirks::hasWebSQLSupportQuirk const):
3021         * page/Quirks.h:
3022
3023 2019-03-01  Zalan Bujtas  <zalan@apple.com>
3024
3025         [ContentChangeObserver] Rename members and move implementation to header.
3026         https://bugs.webkit.org/show_bug.cgi?id=195198
3027         <rdar://problem/48499967>
3028
3029         Reviewed by Simon Fraser.
3030
3031         * page/ios/ContentChangeObserver.cpp:
3032         (WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
3033         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
3034         (WebCore::ContentChangeObserver::startObservingStyleRecalc):
3035         (WebCore::ContentChangeObserver::stopObservingStyleRecalc):
3036         (WebCore::ContentChangeObserver::startObservingContentChanges):
3037         (WebCore::ContentChangeObserver::stopObservingContentChanges):
3038         (WebCore::ContentChangeObserver::StyleRecalcScope::StyleRecalcScope):
3039         (WebCore::ContentChangeObserver::StyleRecalcScope::~StyleRecalcScope):
3040         (WebCore::ContentChangeObserver::startObservingStyleResolve): Deleted.
3041         (WebCore::ContentChangeObserver::stopObservingStyleResolve): Deleted.
3042         (WebCore::ContentChangeObserver::isObservingContentChanges): Deleted.
3043         (WebCore::ContentChangeObserver::startObservingDOMTimerScheduling): Deleted.
3044         (WebCore::ContentChangeObserver::stopObservingDOMTimerScheduling): Deleted.
3045         (WebCore::ContentChangeObserver::isObservingDOMTimerScheduling): Deleted.
3046         (WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling): Deleted.
3047         (WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling): Deleted.
3048         (WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling): Deleted.
3049         (WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc): Deleted.
3050         (WebCore::ContentChangeObserver::shouldObserveNextStyleRecalc): Deleted.
3051         (WebCore::ContentChangeObserver::countOfObservedDOMTimers): Deleted.
3052         (WebCore::ContentChangeObserver::clearObservedDOMTimers): Deleted.
3053         (WebCore::ContentChangeObserver::containsObservedDOMTimer): Deleted.
3054         * page/ios/ContentChangeObserver.h:
3055         (WebCore::ContentChangeObserver::startObservingDOMTimerScheduling):
3056         (WebCore::ContentChangeObserver::stopObservingDOMTimerScheduling):
3057         (WebCore::ContentChangeObserver::isObservingDOMTimerScheduling const):
3058         (WebCore::ContentChangeObserver::containsObservedDOMTimer const):
3059         (WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling):
3060         (WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling):
3061         (WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling const):
3062         (WebCore::ContentChangeObserver::setShouldObserveStyleRecalc):
3063         (WebCore::ContentChangeObserver::shouldObserveStyleRecalc const):
3064         (WebCore::ContentChangeObserver::isObservingContentChanges const):
3065         (WebCore::ContentChangeObserver::countOfObservedDOMTimers const):
3066         (WebCore::ContentChangeObserver::clearObservedDOMTimers):
3067
3068 2019-03-01  Zalan Bujtas  <zalan@apple.com>
3069
3070         [ContentChangeObserver] ContentChangeObserver::StyleChangeScope should not set WKContentVisibilityChange directly
3071         https://bugs.webkit.org/show_bug.cgi?id=195197
3072         <rdar://problem/48498332>
3073
3074         Reviewed by Simon Fraser.
3075
3076         Add didContentVisibilityChange to hide WKContentVisibilityChange value. We might also want to add some logic to didContentVisibilityChange at some point.
3077
3078         * page/ios/ContentChangeObserver.cpp:
3079         (WebCore::ContentChangeObserver::didContentVisibilityChange):
3080         (WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
3081         * page/ios/ContentChangeObserver.h:
3082
3083 2019-03-01  Jer Noble  <jer.noble@apple.com>
3084
3085         [EME] Make sure the hasSessionSemaphore is set even if HAVE(AVSTREAMSESSION) is false
3086         https://bugs.webkit.org/show_bug.cgi?id=195217
3087
3088         Reviewed by Eric Carlson.
3089
3090         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3091         (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
3092
3093 2019-03-01  Justin Fan  <justin_fan@apple.com>
3094
3095         [Web GPU] 32-bit builds broken by attempt to disable WebGPU on 32-bit
3096         https://bugs.webkit.org/show_bug.cgi?id=195191
3097
3098         Rubber-stamped by Dean Jackson.
3099
3100         Dropping support for 32-bit entirely, so I'm intentionally leaving 32-bit broken.
3101
3102         * Configurations/FeatureDefines.xcconfig:
3103
3104 2019-02-28  Fujii Hironori  <Hironori.Fujii@sony.com>
3105
3106         HTTPSUpgradeList.db database should be opened in readonly mode
3107         https://bugs.webkit.org/show_bug.cgi?id=195194
3108         <rdar://problem/47103889>
3109
3110         Unreviewed build fix for curl.
3111
3112         * platform/network/curl/CookieJarDB.cpp:
3113         (WebCore::CookieJarDB::openDatabase): Removed the second arguemnt of SQLiteDatabase::open.
3114
3115 2019-02-28  Chris Dumez  <cdumez@apple.com>
3116
3117         Unreviewed Windows build fix after r242251.
3118
3119         * platform/win/SearchPopupMenuDB.cpp:
3120         (WebCore::SearchPopupMenuDB::openDatabase):
3121
3122 2019-02-28  Zalan Bujtas  <zalan@apple.com>
3123
3124         [ContentChangeObserver] Move timer removal code from DOMWindow::clearTimeout to DOMTimer::removeById
3125         https://bugs.webkit.org/show_bug.cgi?id=195143
3126         <rdar://problem/48462351>
3127
3128         Reviewed by Simon Fraser.
3129
3130         Currently DOMWindow::clearTimeout() is the only callsite that we are interested in, but this is more future-proof.
3131
3132         * page/DOMTimer.cpp:
3133         (WebCore::DOMTimer::removeById):
3134         * page/DOMWindow.cpp:
3135         (WebCore::DOMWindow::clearTimeout):
3136         * page/ios/ContentChangeObserver.cpp:
3137         (WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
3138         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
3139         (WebCore::ContentChangeObserver::didRemoveDOMTimer):
3140         (WebCore::ContentChangeObserver::removeDOMTimer): Deleted.
3141         * page/ios/ContentChangeObserver.h:
3142
3143 2019-02-28  Chris Dumez  <cdumez@apple.com>
3144
3145         HTTPSUpgradeList.db database should be opened in readonly mode
3146         https://bugs.webkit.org/show_bug.cgi?id=195194
3147         <rdar://problem/47103889>
3148
3149         Reviewed by Youenn Fablet.
3150
3151         Add parameter to SQLiteDatabase::open() to specific the open flags.
3152
3153         * Modules/webdatabase/Database.cpp:
3154         (WebCore::Database::performOpenAndVerify):
3155         * platform/sql/SQLiteDatabase.cpp:
3156         (WebCore::SQLiteDatabase::open):
3157         * platform/sql/SQLiteDatabase.h:
3158         * platform/sql/SQLiteFileSystem.cpp:
3159         * platform/sql/SQLiteFileSystem.h:
3160
3161 2019-02-28  Brady Eidson  <beidson@apple.com>
3162
3163         Followup to:
3164         Universal links from Google search results pages don't open the app
3165         https://bugs.webkit.org/show_bug.cgi?id=195126
3166
3167         Unreviewed.
3168
3169         * page/SecurityOrigin.cpp:
3170         (WebCore::originsMatch): Remove a bogus assertion (reasoning in bugzilla)
3171
3172 2019-02-28  Simon Fraser  <simon.fraser@apple.com>
3173
3174         [iOS] Dark flash when opening Google AMP pages
3175         https://bugs.webkit.org/show_bug.cgi?id=195193
3176         rdar://problem/48326442
3177
3178         Reviewed by Zalan Bujtas.
3179
3180         After the incremental compositing updates changes, it was possible for a change in the size
3181         of an overflow:hidden element to fail to update the "ancestor clipping layer" geometry on
3182         a composited descendant that is not a descendant in z-order. When Google search results
3183         create the <iframe> that contain AMP contents, we'd fail to update a zero-sized clipping layer,
3184         leaving the #222 background of an intermediate element visible.
3185
3186         Fix by setting a flag in RenderLayer::updateLayerPosition() (which is called in containing block order)
3187         that sets the "needs geometry update" dirty bit on containing-block-descendant layers. Currently
3188         this flag affects all descendants; in future, we might be able to clear it for grand-children.
3189
3190         Tests: compositing/geometry/ancestor-clip-change-interleaved-stacking-context.html
3191                compositing/geometry/ancestor-clip-change.html
3192
3193         * rendering/RenderLayer.cpp:
3194         (WebCore::RenderLayer::updateLayerPositions):
3195         (WebCore::RenderLayer::updateLayerPosition):
3196         * rendering/RenderLayer.h:
3197         * rendering/RenderLayerBacking.cpp:
3198         (WebCore::RenderLayerBacking::updateAfterLayout):
3199         * rendering/RenderLayerBacking.h:
3200
3201 2019-02-28  Myles C. Maxfield  <mmaxfield@apple.com>
3202
3203         Use-after-move in RenderCombineText::combineTextIfNeeded()
3204         https://bugs.webkit.org/show_bug.cgi?id=195188
3205
3206         Reviewed by Zalan Bujtas.
3207
3208         r241288 uncovered an existing problem with our text-combine code. r242204 alleviated the
3209         symptom, but this patch fixes the source of the problem (and reverts r242204).
3210
3211         The code in RenderCombineText::combineTextIfNeeded() has a bit that’s like:
3212
3213         FontDescription bestFitDescription;
3214         while (...) {
3215             FontCascade compressedFont(WTFMove(bestFitDescription), ...);
3216             ...
3217         }
3218
3219         Clearly this is wrong.
3220
3221         Test: fast/text/text-combine-crash-2.html
3222
3223         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
3224         (WebCore::FontDescription::platformResolveGenericFamily):
3225         * rendering/RenderCombineText.cpp:
3226         (WebCore::RenderCombineText::combineTextIfNeeded):
3227
3228 2019-02-28  Zalan Bujtas  <zalan@apple.com>
3229
3230         [ContentChangeObserver] Introduce observer subclasses to scope content change observing.
3231         https://bugs.webkit.org/show_bug.cgi?id=195172
3232         <rdar://problem/48479259>
3233
3234         Reviewed by Simon Fraser.
3235
3236         Let's scope start/stopObserving call pairs.
3237
3238         * dom/Document.cpp:
3239         (WebCore::Document::updateStyleIfNeeded):
3240         * page/DOMTimer.cpp:
3241         (WebCore::DOMTimer::fired):
3242         * page/ios/ContentChangeObserver.cpp:
3243         (WebCore::ContentChangeObserver::StyleChangeObserver::StyleChangeObserver):
3244         (WebCore::ContentChangeObserver::StyleChangeObserver::~StyleChangeObserver):
3245         (WebCore::ContentChangeObserver::StyleRecalcObserver::StyleRecalcObserver):
3246         (WebCore::ContentChangeObserver::StyleRecalcObserver::~StyleRecalcObserver):
3247         (WebCore::ContentChangeObserver::DOMTimerObserver::DOMTimerObserver):
3248         (WebCore::ContentChangeObserver::DOMTimerObserver::~DOMTimerObserver):
3249         (WebCore::ContentChangeObserver::StyleChange::StyleChange): Deleted.
3250         (WebCore::ContentChangeObserver::StyleChange::~StyleChange): Deleted.
3251         * page/ios/ContentChangeObserver.h:
3252         * rendering/updating/RenderTreeUpdater.cpp:
3253         (WebCore::RenderTreeUpdater::updateElementRenderer):
3254
3255 2019-02-28  Antoine Quint  <graouts@apple.com>
3256
3257         Enable the Pointer Events runtime flag by default
3258         https://bugs.webkit.org/show_bug.cgi?id=195156
3259
3260         Reviewed by Dean Jackson.
3261
3262         * page/RuntimeEnabledFeatures.h:
3263
3264 2019-02-28  Zalan Bujtas  <zalan@apple.com>
3265
3266         [ContentChangeObserver] Make observed state reset explicit.
3267         https://bugs.webkit.org/show_bug.cgi?id=195185
3268         <rdar://problem/48488342>
3269
3270         Reviewed by Simon Fraser.
3271
3272         Use setObservedContentChange only for setting the observed change while observing.
3273
3274         * page/ios/ContentChangeObserver.cpp:
3275         (WebCore::ContentChangeObserver::startObservingContentChanges):
3276         (WebCore::ContentChangeObserver::resetObservedContentChange):
3277         (WebCore::ContentChangeObserver::removeObservedDOMTimer):
3278         * page/ios/ContentChangeObserver.h:
3279
3280 2019-02-28  Commit Queue  <commit-queue@webkit.org>
3281
3282         Unreviewed, rolling out r242210.
3283         https://bugs.webkit.org/show_bug.cgi?id=195179
3284
3285         it broke hover menus on losaltosonline.com (Requested by zalan
3286         on #webkit).
3287
3288         Reverted changeset:
3289
3290         "[ContentChangeObserver] Move timer removal code from
3291         DOMWindow::clearTimeout to DOMTimer::removeById"
3292         https://bugs.webkit.org/show_bug.cgi?id=195143
3293         https://trac.webkit.org/changeset/242210
3294
3295 2019-02-28  Zalan Bujtas  <zalan@apple.com>
3296
3297         [ContentChangeObserver] Move timer removal code from DOMWindow::clearTimeout to DOMTimer::removeById
3298         https://bugs.webkit.org/show_bug.cgi?id=195143
3299         <rdar://problem/48462351>
3300
3301         Reviewed by Simon Fraser.
3302
3303         Currently DOMWindow::clearTimeout() is the only callsite that we are interested in, but this is more future-proof.
3304
3305         * page/DOMTimer.cpp:
3306         (WebCore::DOMTimer::removeById):
3307         * page/DOMWindow.cpp:
3308         (WebCore::DOMWindow::clearTimeout):
3309         * page/ios/ContentChangeObserver.cpp:
3310         (WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
3311         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
3312         (WebCore::ContentChangeObserver::didRemoveDOMTimer):
3313         (WebCore::ContentChangeObserver::removeDOMTimer): Deleted.
3314         * page/ios/ContentChangeObserver.h:
3315
3316 2019-02-28  Charles Vazac  <cvazac@akamai.com>
3317
3318         Fix Resource Timing buffer edge cases for WPT
3319         https://bugs.webkit.org/show_bug.cgi?id=193213
3320
3321         Reviewed by Youenn Fablet.
3322
3323         Test coverage by LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer*.html
3324
3325         * page/Performance.cpp:
3326         (WebCore::Performance::resourceTimingBufferFullTimerFired): Only dispatch the
3327         resourcetimingbufferfull event if the buffer is still full (as it may have been cleared or
3328         expanded). Also, avoid infinite loops if we aren't able to decrease the number of entries in
3329         the secondary buffer.
3330
3331 2019-02-28  Takashi Komori  <Takashi.Komori@sony.com>
3332
3333         [Curl] HTTP Body is missing with redirection.
3334         https://bugs.webkit.org/show_bug.cgi?id=191651
3335
3336         Reviewed by Don Olmstead.
3337
3338         Implement updateFromDelegatePreservingOldProperties for curl port.
3339
3340         Tests: http/tests/navigation/post-301-response.html
3341                http/tests/navigation/post-302-response.html
3342                http/tests/navigation/post-303-response.html
3343                http/tests/navigation/post-307-response.html
3344                http/tests/navigation/post-308-response.html
3345
3346         * platform/Curl.cmake:
3347         * platform/network/curl/ResourceRequest.h:
3348         (WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties): Deleted.
3349         * platform/network/curl/ResourceRequestCurl.cpp: Added.
3350         (WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties):
3351
3352 2019-02-28  Carlos Garcia Campos  <cgarcia@igalia.com>
3353
3354         [CoordinatedGraphics] Remove COORDINATED_GRAPHICS_THREADED option
3355         https://bugs.webkit.org/show_bug.cgi?id=195159
3356
3357         Reviewed by Don Olmstead.
3358
3359         Use COORDINATED_GRAPHICS instead.
3360
3361         * platform/graphics/GraphicsContext3D.h:
3362         * platform/graphics/PlatformLayer.h:
3363         * platform/graphics/cairo/ImageBufferCairo.cpp:
3364         (WebCore::ImageBufferData::ImageBufferData):
3365         (WebCore::ImageBufferData::~ImageBufferData):
3366         * platform/graphics/cairo/ImageBufferDataCairo.h:
3367         * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.cpp:
3368         * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.h:
3369         * platform/graphics/nicosia/texmap/NicosiaGC3DLayer.cpp:
3370         (Nicosia::GC3DLayer::swapBuffersIfNeeded):
3371         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
3372         (WebCore::GraphicsContext3D::reshapeFBOs):
3373         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
3374         (WebCore::GraphicsContext3D::prepareTexture):
3375         * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
3376         (WebCore::GraphicsContext3D::reshapeFBOs):
3377         * platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp:
3378         (WebCore::GraphicsContext3D::GraphicsContext3D):
3379         (WebCore::GraphicsContext3D::~GraphicsContext3D):
3380         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp:
3381         (WebCore::TextureMapperGC3DPlatformLayer::TextureMapperGC3DPlatformLayer):
3382         (WebCore::TextureMapperGC3DPlatformLayer::~TextureMapperGC3DPlatformLayer):
3383         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h:
3384         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
3385         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
3386         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
3387         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
3388         * platform/graphics/texmap/TextureMapperPlatformLayerProxyProvider.h:
3389         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3390         (WebCore::CoordinatedGraphicsLayer::setContentsNeedsDisplay):
3391         (WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer):
3392         (WebCore::CoordinatedGraphicsLayer::updatePlatformLayer):
3393         * rendering/RenderLayerBacking.cpp:
3394         (WebCore::RenderLayerBacking::paintsIntoWindow const):
3395         * rendering/RenderLayerCompositor.cpp:
3396         (WebCore::RenderLayerCompositor::shouldCompositeOverflowControls const):
3397
3398 2019-02-28  Myles C. Maxfield  <mmaxfield@apple.com>
3399
3400         Locale names can be nullptr
3401         https://bugs.webkit.org/show_bug.cgi?id=195171
3402         <rdar://problem/48262376>
3403
3404         Reviewed by Dean Jackson.
3405
3406         Nullptr can't be used in keys to HashMaps, so take an early out in this case.
3407
3408         This is a partial revert of r241288.
3409
3410         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
3411         (WebCore::FontDescription::platformResolveGenericFamily):
3412
3413 2019-02-28  Justin Fan  <justin_fan@apple.com>
3414
3415         [Web GPU] Enable Web GPU only on 64-bit
3416         https://bugs.webkit.org/show_bug.cgi?id=195139
3417
3418         Because Metal is only supported on 64 bit apps.
3419
3420         Unreviewed build fix.
3421
3422         * Configurations/FeatureDefines.xcconfig:
3423
3424 2019-02-27  Zalan Bujtas  <zalan@apple.com>
3425
3426         [ContentChangeObserver] Move WKSetObservedContentChange logic to ContentChangeObserver class.
3427         https://bugs.webkit.org/show_bug.cgi?id=195128
3428         <rdar://problem/48456752>
3429
3430         Reviewed by Simon Fraser.
3431
3432         Move the final bits over to ContentChangeObserver and delete WKContentObservationInternal.h.
3433
3434         * WebCore.xcodeproj/project.pbxproj:
3435         * page/ios/ContentChangeObserver.mm:
3436         (WebCore::ContentChangeObserver::setObservedContentChange):
3437         * platform/ios/wak/WKContentObservation.cpp:
3438         (WKSetObservedContentChange):
3439         * platform/ios/wak/WKContentObservation.h:
3440         * platform/ios/wak/WKContentObservationInternal.h: Removed.
3441
3442 2019-02-27  Simon Fraser  <simon.fraser@apple.com>
3443
3444         Roll out r242014; it caused crashes in compositing logging (webkit.org/b/195141)
3445
3446         * dom/Document.cpp:
3447         (WebCore::Document::lastModified const):
3448         * html/FTPDirectoryDocument.cpp:
3449         (WebCore::processFileDateString):
3450         * mathml/MathMLElement.cpp:
3451         (WebCore::convertToPercentageIfNeeded):
3452         (WebCore::MathMLElement::collectStyleForPresentationAttribute):
3453         * page/cocoa/ResourceUsageOverlayCocoa.mm:
3454         (WebCore::ResourceUsageOverlay::platformDraw):
3455         * page/linux/ResourceUsageOverlayLinux.cpp:
3456         (WebCore::cpuUsageString):
3457         (WebCore::gcTimerString):
3458         * platform/DateComponents.cpp:
3459         (WebCore::DateComponents::toStringForTime const):
3460         (WebCore::DateComponents::toString const):
3461         * platform/LocalizedStrings.cpp:
3462         (WebCore::localizedString):
3463         * platform/audio/HRTFElevation.cpp:
3464         (WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
3465         * platform/mock/MockRealtimeVideoSource.cpp:
3466         (WebCore::MockRealtimeVideoSource::drawText):
3467         * rendering/RenderLayerCompositor.cpp:
3468         (WebCore::RenderLayerCompositor::logLayerInfo):
3469         * rendering/RenderTheme.cpp:
3470         (WebCore::RenderTheme::formatMediaControlsTime const):
3471
3472 2019-02-27  Zalan Bujtas  <zalan@apple.com>
3473
3474         [ContentChangeObserver] Move _WKObservingContentChanges from global to ContentChangeObserver class
3475         https://bugs.webkit.org/show_bug.cgi?id=195091
3476         <rdar://problem/48427271>
3477
3478         Reviewed by Tim Horton.
3479
3480         * page/ios/ContentChangeObserver.h:
3481         * page/ios/ContentChangeObserver.mm:
3482         (WebCore::ContentChangeObserver::startObservingContentChanges):
3483         (WebCore::ContentChangeObserver::stopObservingContentChanges):
3484         (WebCore::ContentChangeObserver::isObservingContentChanges):
3485         * platform/ios/wak/WKContentObservation.cpp:
3486         (WKObservingContentChanges): Deleted.
3487         (WKStartObservingContentChanges): Deleted.
3488         (WKStopObservingContentChanges): Deleted.
3489         * platform/ios/wak/WKContentObservation.h:
3490         * platform/ios/wak/WKContentObservationInternal.h:
3491
3492 2019-02-27  Brady Eidson  <beidson@apple.com>
3493
3494         Universal links from Google search results pages don't open the app.
3495         <rdar://problem/46887179> and https://bugs.webkit.org/show_bug.cgi?id=195126
3496
3497         Reviewed by Geoffrey Garen.
3498
3499         Covered by new API tests.
3500
3501         * loader/DocumentLoader.cpp:
3502         (WebCore::DocumentLoader::shouldOpenExternalURLsPolicyToPropagate const): Propagate the external URL policy from
3503           an iframe if it is from the same security origin as the main frame.
3504
3505 2019-02-27  Zalan Bujtas  <zalan@apple.com>
3506
3507         [ContentChangeObserver] Move DOMTimer schedule handling from global to ContentChangeObserver class
3508         https://bugs.webkit.org/show_bug.cgi?id=195090
3509         <rdar://problem/48426771>
3510
3511         Reviewed by Tim Horton.
3512
3513         Also remove some unused functions from WKContentObservationInternal.
3514
3515         * page/ios/ContentChangeObserver.h:
3516         * page/ios/ContentChangeObserver.mm:
3517         (WebCore::ContentChangeObserver::startObservingDOMTimerScheduling):
3518         (WebCore::ContentChangeObserver::stopObservingDOMTimerScheduling):
3519         (WebCore::ContentChangeObserver::isObservingDOMTimerScheduling):
3520         * platform/ios/wak/WKContentObservation.cpp:
3521         (WKStartObservingDOMTimerScheduling): Deleted.
3522         (WKStopObservingDOMTimerScheduling): Deleted.
3523         (WKIsObservingDOMTimerScheduling): Deleted.
3524         * platform/ios/wak/WKContentObservation.h:
3525         * platform/ios/wak/WKContentObservationInternal.h:
3526
3527 2019-02-27  Zalan Bujtas  <zalan@apple.com>
3528
3529         [ContentChangeObserver] Move style recalc handling from global to ContentChangeObserver class
3530         https://bugs.webkit.org/show_bug.cgi?id=195087
3531
3532         Reviewed by Simon Fraser.
3533
3534         Add m_observingNextStyleRecalc/m_observingStyleRecalcScheduling to ContentChangeObserver and move the related code over from WK functions.
3535
3536         * page/ios/ContentChangeObserver.h:
3537         * page/ios/ContentChangeObserver.mm:
3538         (WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling):
3539         (WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling):
3540         (WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling):
3541         (WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc):
3542         (WebCore::ContentChangeObserver::shouldObserveNextStyleRecalc):
3543         (WebCore::ContentChangeObserver::setObservedContentChange):
3544         * platform/ios/wak/WKContentObservation.cpp:
3545         (WKSetObservedContentChange):
3546         (WKStartObservingStyleRecalcScheduling): Deleted.
3547         (WKStopObservingStyleRecalcScheduling): Deleted.
3548         (WKIsObservingStyleRecalcScheduling): Deleted.
3549         (WKSetShouldObserveNextStyleRecalc): Deleted.
3550         (WKShouldObserveNextStyleRecalc): Deleted.
3551         * platform/ios/wak/WKContentObservation.h:
3552
3553 2019-02-27  Zalan Bujtas  <zalan@apple.com>
3554
3555         [ContentChangeObserver] Move DOM timer handling from global to ContentChangeObserver class
3556         https://bugs.webkit.org/show_bug.cgi?id=195070
3557         <rdar://problem/48417650>
3558
3559         Reviewed by Tim Horton.
3560
3561         Add DOM timer list to ContentChangeObserver and move the related code over from WK functions.
3562
3563         * page/ios/ContentChangeObserver.h:
3564         * page/ios/ContentChangeObserver.mm:
3565         (WebCore::ContentChangeObserver::startObservingDOMTimerScheduling):
3566         (WebCore::ContentChangeObserver::countOfObservedDOMTimers):
3567         (WebCore::ContentChangeObserver::clearObservedDOMTimers):
3568         (WebCore::ContentChangeObserver::setObservedContentChange):
3569         (WebCore::ContentChangeObserver::containsObservedDOMTimer):
3570         (WebCore::ContentChangeObserver::addObservedDOMTimer):
3571         (WebCore::ContentChangeObserver::removeObservedDOMTimer):
3572         * platform/ios/wak/WKContentObservation.cpp:
3573         (WKStartObservingDOMTimerScheduling):
3574         (WKSetObservedContentChange):
3575         (WebThreadGetObservedDOMTimers): Deleted.
3576         (WebThreadCountOfObservedDOMTimers): Deleted.
3577         (WebThreadClearObservedDOMTimers): Deleted.
3578         (WebThreadContainsObservedDOMTimer): Deleted.
3579         (WebThreadAddObservedDOMTimer): Deleted.
3580         (WebThreadRemoveObservedDOMTimer): Deleted.
3581         * platform/ios/wak/WKContentObservation.h:
3582
3583 2019-02-27  Justin Fan  <justin_fan@apple.com>
3584         Fix build errors after Web GPU buffer updates changed some IDL fields from unsigned long to unsigned long long.
3585
3586         Unreviewed build fix.
3587
3588         * Modules/webgpu/WebGPUBuffer.cpp:
3589         (WebCore::WebGPUBuffer::setSubData):
3590         * Modules/webgpu/WebGPUBuffer.h:
3591         * Modules/webgpu/WebGPUBufferBinding.h:
3592         * Modules/webgpu/WebGPURenderPassEncoder.idl:
3593         * platform/graphics/gpu/GPUBufferBinding.h:
3594         * platform/graphics/gpu/GPUVertexAttributeDescriptor.h:
3595         * platform/graphics/gpu/GPUVertexInputDescriptor.h:
3596
3597 2019-02-27  John Wilander  <wilander@apple.com>
3598
3599         Adopt WebCore::RegistrableDomain in WebCore::ResourceLoadStatistics and WebKit::NetworkProcessProxy
3600         https://bugs.webkit.org/show_bug.cgi?id=195071
3601         <rdar://problem/48417690>
3602
3603         Reviewed by Alex Christensen and Brent Fulgham.
3604
3605         No new tests. This patch maintains functionality covered by plenty of layout
3606         tests under http/tests/resourceLoadStatistics/ and http/tests/storageAccess.
3607
3608         This patch adopts WebCore::RegistrableDomain in WebCore::ResourceLoadStatistics
3609         and makes the necessary infrastructure changes to support that.
3610
3611         The previous HashCountedSets in WebCore::ResourceLoadStatistics are now just
3612         HashSets since we never used the counts for anything. This change simplified
3613         encoding and decoding for IPC and will eventually simplify encoding and
3614         decoding in loader/ResourceLoadStatistics.cpp when we obsolete statistics
3615         model version 14 and below.
3616
3617         The patch also makes WebCore::RegistrableDomain's String constructor private.
3618         A new create function WebCore::RegistrableDomain::uncheckedCreateFromString()
3619         is introduced to better signal to users that creating a registrable domain
3620         object with a string may create an object that doesn't match a registrable
3621         domain in a valid HTTP-family URL. This change (private String constructor)
3622         motivated a change in WebCore::AdClickAttribution where the Source and
3623         Destination structs now take a URL as parameter instead of a String.
3624
3625         Finally, this patch harmonizes parameter and variable naming, going from
3626         "origin" to "domain" and "mainFrame" to "topFrame."
3627
3628         * html/HTMLAnchorElement.cpp:
3629         (WebCore::HTMLAnchorElement::parseAdClickAttribution const):
3630         * html/HTMLMediaElement.cpp:
3631         (WebCore::HTMLMediaElement::mediaSessionTitle const):
3632         * loader/AdClickAttribution.h:
3633         (WebCore::AdClickAttribution::Source::Source):
3634         (WebCore::AdClickAttribution::Source::deletedValue):
3635         (WebCore::AdClickAttribution::Destination::Destination):
3636         (WebCore::AdClickAttribution::Destination::deletedValue):
3637         (WebCore::AdClickAttribution::decode):
3638         * loader/ResourceLoadObserver.cpp:
3639         (WebCore::ResourceLoadObserver::logSubresourceLoading):
3640         (WebCore::ResourceLoadObserver::logWebSocketLoading):
3641         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
3642         (WebCore::ResourceLoadObserver::statisticsForURL):
3643         (WebCore::ResourceLoadObserver::statisticsForOrigin): Deleted.
3644         * loader/ResourceLoadObserver.h:
3645         * loader/ResourceLoadStatistics.cpp:
3646         (WebCore::encodeHashSet):
3647         (WebCore::ResourceLoadStatistics::encode const):
3648         (WebCore::decodeHashCountedSet):
3649         (WebCore::decodeHashSet):
3650         (WebCore::ResourceLoadStatistics::decode):
3651         (WebCore::appendHashSet):
3652         (WebCore::ResourceLoadStatistics::toString const):
3653         (WebCore::ResourceLoadStatistics::merge):
3654         (WebCore::encodeHashCountedSet): Deleted.
3655         (WebCore::encodeOriginHashSet): Deleted.
3656         (WebCore::decodeOriginHashSet): Deleted.
3657         (WebCore::appendHashCountedSet): Deleted.
3658         * loader/ResourceLoadStatistics.h:
3659         * platform/RegistrableDomain.h:
3660         (WebCore::RegistrableDomain::uncheckedCreateFromString):
3661         (WebCore::RegistrableDomain::RegistrableDomain):
3662         * testing/Internals.cpp:
3663         (WebCore::Internals::resourceLoadStatisticsForURL):
3664         (WebCore::Internals::resourceLoadStatisticsForOrigin): Deleted.
3665         * testing/Internals.h:
3666         * testing/Internals.idl:
3667
3668 2019-02-27  Justin Fan  <justin_fan@apple.com>
3669
3670         [Web GPU] Buffer updates part 2: setSubData, GPU/CPU synchronization
3671         https://bugs.webkit.org/show_bug.cgi?id=195077
3672         <rdar://problem/47805229>
3673
3674         Reviewed by Dean Jackson.
3675
3676         Implement GPUBuffer.setSubData and prevent the resolving of mapping promises if the buffer is scheduled to be 
3677         used on the GPU, and add handlers to resolve such promises after command buffer execution completes. In addition,
3678         update buffer sizes to u64 (unsigned long in C++) as per the updated Web GPU API.
3679
3680         Tests: webgpu/buffer-command-buffer-races.html
3681                webgpu/map-read-buffers.html
3682
3683         * Modules/webgpu/WebGPUBindGroup.h:
3684         (WebCore::WebGPUBindGroup::bindGroup const):
3685         * Modules/webgpu/WebGPUBindGroupDescriptor.cpp:
3686         (WebCore::WebGPUBindGroupDescriptor::asGPUBindGroupDescriptor const): Rename binding -> bufferBinding to reduce confusion.
3687         * Modules/webgpu/WebGPUBuffer.cpp: Small tweaks.
3688         (WebCore::WebGPUBuffer::setSubData):
3689         (WebCore::WebGPUBuffer::unmap): Correctly fail if buffer is destroyed.
3690         (WebCore::WebGPUBuffer::destroy):
3691         (WebCore::WebGPUBuffer::rejectOrRegisterPromiseCallback):
3692         * Modules/webgpu/WebGPUBuffer.h:
3693         (WebCore::WebGPUBuffer::buffer const): Returned buffer is no longer const so that it can be used in completed handler callbacks.
3694         * Modules/webgpu/WebGPUBuffer.idl: Enable setSubData.
3695         * Modules/webgpu/WebGPUCommandBuffer.cpp:
3696         (WebCore::WebGPUCommandBuffer::beginRenderPass):
3697         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
3698         (WebCore::WebGPUProgrammablePassEncoder::setBindGroup const):
3699         * Modules/webgpu/WebGPUProgrammablePassEncoder.h:
3700         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
3701         (WebCore::WebGPURenderPassEncoder::setVertexBuffers):
3702         * Sources.txt:
3703         * WebCore.xcodeproj/project.pbxproj:
3704         * platform/graphics/gpu/GPUBuffer.h:
3705         (WebCore::GPUBuffer::isTransferDst const): Added various state and flag getters.
3706         (WebCore::GPUBuffer::isVertex const):
3707         (WebCore::GPUBuffer::isUniform const):
3708         (WebCore::GPUBuffer::isStorage const):
3709         (WebCore::GPUBuffer::isReadOnly const):
3710         (WebCore::GPUBuffer::isMappable const):
3711         (WebCore::GPUBuffer::isMapWrite const):
3712         (WebCore::GPUBuffer::isMapRead const):
3713         (WebCore::GPUBuffer::isMapWriteable const):
3714         (WebCore::GPUBuffer::isMapReadable const):
3715         * platform/graphics/gpu/GPUBufferBinding.h:
3716         * platform/graphics/gpu/GPUCommandBuffer.h:
3717         (WebCore::GPUCommandBuffer::usedBuffers const):
3718         (WebCore::GPUCommandBuffer::useBuffer):
3719         * platform/graphics/gpu/GPUDevice.cpp:
3720         (WebCore::GPUDevice::tryCreateBuffer): Pass Ref of itself for Buffer to request the Queue later, if needed.
3721         (WebCore::GPUDevice::tryCreateBuffer const): Deleted.
3722         * platform/graphics/gpu/GPUDevice.h:
3723         * platform/graphics/gpu/GPUProgrammablePassEncoder.cpp: Retain the encoder's commandBuffer to reference its used resource buffers.
3724         (WebCore::GPUProgrammablePassEncoder::GPUProgrammablePassEncoder):
3725         * platform/graphics/gpu/GPUProgrammablePassEncoder.h:
3726         (WebCore::GPUProgrammablePassEncoder::commandBuffer const):
3727         * platform/graphics/gpu/GPURenderPassEncoder.h:
3728         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
3729         (WebCore::GPUBuffer::validateBufferCreate): Move validation out of tryCreate.
3730         (WebCore::GPUBuffer::tryCreate): Create both shared and private buffers, depending on usage.
3731         (WebCore::GPUBuffer::GPUBuffer):
3732         (WebCore::GPUBuffer::~GPUBuffer): Call destroy instead of just unmap.
3733         (WebCore::GPUBuffer::state const):
3734         (WebCore::GPUBuffer::setSubData): Uses a cached collection of staging MTLBuffers to encode data copies to the implementation MTLBuffer.
3735         (WebCore::GPUBuffer::commandBufferCommitted): Register on the GPUBuffer that the provided MTLCommandBuffer uses it, and is about to be committed.
3736         (WebCore::GPUBuffer::commandBufferCompleted): MTLCommandBuffer's onCompletedHandler calls this.
3737         (WebCore::GPUBuffer::reuseSubDataBuffer): SetSubData's blit command buffers call this to return a staging buffer to the pool.
3738         (WebCore::GPUBuffer::registerMappingCallback):
3739         (WebCore::GPUBuffer::runMappingCallback):
3740         (WebCore::GPUBuffer::unmap):
3741         (WebCore::GPUBuffer::destroy):
3742         (WebCore::GPUBuffer::tryCreateSharedBuffer): Deleted.
3743         * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
3744         (WebCore::GPUProgrammablePassEncoder::setResourceAsBufferOnEncoder):
3745         (WebCore::GPUProgrammablePassEncoder::setBindGroup):
3746         * platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
3747         (WebCore::GPUQueue::submit): Ensure submitted buffers are in the correct state, and add completed handlers for synchronization.
3748         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
3749         (WebCore::GPURenderPassEncoder::tryCreate):
3750         (WebCore::GPURenderPassEncoder::GPURenderPassEncoder): Retain the commandBuffer for later reference.
3751         (WebCore::GPURenderPassEncoder::setVertexBuffers): Mark vertex buffers as used before submission.
3752         (WebCore::GPURenderPassEncoder::create): Deleted.
3753
3754         Buffer size updates in the IDL:
3755         * Modules/webgpu/GPUBufferDescriptor.idl:
3756         * Modules/webgpu/WebGPUBuffer.idl:
3757         * Modules/webgpu/WebGPUBufferBinding.idl:
3758         * Modules/webgpu/WebGPUCommandBuffer.idl:
3759         * Modules/webgpu/WebGPURenderPassEncoder.idl:
3760         * Modules/webgpu/WebGPUVertexAttributeDescriptor.idl:
3761         * Modules/webgpu/WebGPUVertexInputDescriptor.idl:
3762
3763 2019-02-27  Youenn Fablet  <youenn@apple.com>
3764
3765         Remove LeetCode FetchRequest quirk
3766         https://bugs.webkit.org/show_bug.cgi?id=195100
3767
3768         Reviewed by Alex Christensen.
3769
3770         Covered by manual testing.
3771
3772         * Modules/fetch/FetchRequest.cpp:
3773         (WebCore::needsSignalQuirk):
3774
3775 2019-02-27  Chris Dumez  <cdumez@apple.com>
3776
3777         Unable to log into chase.com on iPad when DeviceMotionEvent API is disabled
3778         https://bugs.webkit.org/show_bug.cgi?id=195101
3779         <rdar://problem/48423023>
3780
3781         Reviewed by Geoffrey Garen.
3782
3783         Add site-specific quirk for chase.com on iOS where we fire a dummy DeviceMotionEvent if the page
3784         tries to register a "devicemotion" event listener and fails because the API is disabled. This is
3785         needed to unblock the site and proceed with the login flow.
3786
3787         Unfortunately, document()->settings().needsSiteSpecificQuirks() is false on iOS so I could not
3788         guard the quirk behind this flag.
3789
3790         * page/DOMWindow.cpp:
3791         (WebCore::DOMWindow::addEventListener):
3792         (WebCore::DOMWindow::failedToRegisterDeviceMotionEventListener):
3793         * page/DOMWindow.h:
3794
3795 2019-02-27  Antoine Quint  <graouts@apple.com>
3796
3797         Support Pointer Events on macOS
3798         https://bugs.webkit.org/show_bug.cgi?id=195008
3799         <rdar://problem/47454419>
3800
3801         Reviewed by Dean Jackson.
3802
3803         We now dispatch relevant pointer events as we prepare to dispatch mouse events. In most cases, this means we dispatch
3804         a pointer event of the same type, with "mouse" being substituted by "pointer", and with the same properties with the
3805         exception that if preventDefault() is called for a "pointerdown" event, the matching "mousedown" will not be dispatched,
3806         and the same behavior also extends to "pointerup".
3807
3808         Tests: pointerevents/mouse/over-enter-out-leave.html
3809                pointerevents/mouse/pointer-capture.html
3810                pointerevents/mouse/pointer-event-basic-properties.html
3811                pointerevents/mouse/pointer-events-before-mouse-events.html
3812                pointerevents/mouse/pointerdown-prevent-default.html
3813
3814         * Configurations/FeatureDefines.xcconfig:
3815         * dom/Document.cpp: All of the touch-action related members and functions should be iOS-specific since the touch-action
3816         property does not have any effect on macOS.
3817         (WebCore::Document::invalidateRenderingDependentRegions):
3818         (WebCore::Document::nodeWillBeRemoved):
3819         (WebCore::Document::updateTouchActionElements):
3820         * dom/Document.h:
3821         * dom/Element.cpp:
3822         (WebCore::Element::dispatchMouseEvent): Dispatch a pointer event matching the mouse event that is about to be dispatched.
3823         If preventDefault() is called in the event handler for either "pointerdown" or "pointerup", do not proceed with dispatching
3824         the mouse event.
3825         * dom/PointerEvent.cpp:
3826         (WebCore::pointerEventType):
3827         (WebCore::PointerEvent::create):
3828         * dom/PointerEvent.h:
3829         * page/EventHandler.cpp: Check both the pointer and mouse events to see if we need to dispatch "enter" and "leave" events.
3830         (WebCore::hierarchyHasCapturingEventListeners):
3831         (WebCore::EventHandler::updateMouseEventTargetNode):
3832         * page/PointerCaptureController.cpp: Fix a build error which only happened on macOS.
3833         (WebCore::PointerCaptureController::PointerCaptureController): Create the CapturingData for the unique mouse pointer.
3834         (WebCore::PointerCaptureController::hasPointerCapture): The code did not match the spec cited in the comment, only the
3835         pending target override needs to be considered to determine whether a given element has pointer capture enabled.
3836         (WebCore::PointerCaptureController::dispatchEvent): Dispatch the provided pointer event, accounting for pointer capture if
3837         it is set.
3838         * page/PointerLockController.cpp: Fix a build error which only happened on macOS.
3839         * style/StyleTreeResolver.cpp:
3840         (WebCore::Style::TreeResolver::resolveElement): Code related to touch-action is only relevant to iOS.
3841
3842 2019-02-27  Sihui Liu  <sihui_liu@apple.com>
3843
3844         Network Process is put to suspended when holding locked IndexedDB files
3845         https://bugs.webkit.org/show_bug.cgi?id=195024
3846         <rdar://problem/45194169>
3847
3848         Reviewed by Geoffrey Garen.
3849
3850         We found network process was suspended when IDBDatabase was being closed in the background database thread, 
3851         holding locks to its database file. To avoid starvation or deadlock, we need to keep network process alive by 
3852         taking background assertion in UI process until the closes are done and locks are released.
3853
3854         * Modules/indexeddb/server/IDBServer.cpp:
3855         (WebCore::IDBServer::IDBServer::create):
3856         (WebCore::IDBServer::IDBServer::IDBServer):
3857         (WebCore::IDBServer::IDBServer::createBackingStore):
3858         (WebCore::IDBServer::IDBServer::closeDatabase):
3859         (WebCore::IDBServer::IDBServer::didCloseDatabase):
3860         * Modules/indexeddb/server/IDBServer.h:
3861         (WebCore::IDBServer::IDBServer::create):
3862         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3863         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentDeleteOperation):
3864         (WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose):
3865         (WebCore::IDBServer::UniqueIDBDatabase::didShutdownForClose):
3866         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
3867         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
3868         (WebCore::IDBServer::UniqueIDBDatabase::notifyServerAboutClose):
3869         * Modules/indexeddb/server/UniqueIDBDatabase.h:
3870
3871 2019-02-26  Simon Fraser  <simon.fraser@apple.com>
3872
3873         Have a single notion of scroll position in the scrolling tree and derive layoutViewport from it
3874         https://bugs.webkit.org/show_bug.cgi?id=194973
3875
3876         Reviewed by Antti Koivisto.
3877
3878         This patch cleans up how the scrolling tree responds to scrolls.
3879
3880         First, ScrollingTreeScrollingNode::m_currentScrollPosition is "truth" for scrolling thread/
3881         UI process scroll position.
3882
3883         On macOS where handleWheelEvent on the scrolling thread changes scroll position, the
3884         bottleneck is ScrollingTreeScrollingNode::scrollTo() which sets the new scroll position,
3885         update the visual viewport (for frame scrolls) updates the scrolledContentsLayer position,
3886         updates related layers on this node (counter-scrolling layers etc), and then tells the
3887         scrolling tree, which recurses through descendant nodes so they can adjust their layer
3888         positions.
3889
3890         On iOS, the bottleneck is ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling(),
3891         which does the above other than setting scrolledContentsLayer (since we're reacting to
3892         layer state changes, not producing them).
3893
3894         updateLayersAfterAncestorChange() is renamed to relatedNodeScrollPositionDidChange(), and
3895         ScrollingTree does the tree walk so classes don't have to implement
3896         updateLayersAfterAncestorChange() just to talk children. The ScrollingTree tree walk knows
3897         how to get the correct layoutViewport and to stop at frame boundaries (layer updates never
3898         need to cross frame boundaries).
3899
3900         We preserve 'cumulativeDelta'; it's necessary for things like fixed inside overflow:scroll,
3901         since the fixed state was computed with the "layout" scroll position, so we have to account
3902         for the scroll delta since the last committed position. It's possible we could improve this
3903         in future.
3904
3905         * page/scrolling/ScrollingTree.cpp:
3906         (WebCore::ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling):
3907         (WebCore::ScrollingTree::notifyRelatedNodesAfterScrollPositionChange):
3908         (WebCore::ScrollingTree::notifyRelatedNodesRecursive):
3909         (WebCore::ScrollingTree::mainFrameLayoutViewport):
3910         (WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling): Deleted.
3911         * page/scrolling/ScrollingTree.h:
3912         * page/scrolling/ScrollingTreeFrameHostingNode.cpp:
3913         (WebCore::ScrollingTreeFrameHostingNode::updateLayersAfterAncestorChange): Deleted.
3914         * page/scrolling/ScrollingTreeFrameHostingNode.h:
3915         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
3916         (WebCore::ScrollingTreeFrameScrollingNode::updateViewportForCurrentScrollPosition):
3917         (WebCore::ScrollingTreeFrameScrollingNode::localToContentsPoint const):
3918         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
3919         * page/scrolling/ScrollingTreeNode.cpp:
3920         (WebCore::ScrollingTreeNode::relatedNodeScrollPositionDidChange):
3921         (WebCore::ScrollingTreeNode::enclosingScrollingNodeIncludingSelf):
3922         * page/scrolling/ScrollingTreeNode.h:
3923         * page/scrolling/ScrollingTreeScrollingNode.cpp:
3924         (WebCore::ScrollingTreeScrollingNode::minimumScrollPosition const):
3925         (WebCore::ScrollingTreeScrollingNode::scrollLimitReached const):
3926         (WebCore::ScrollingTreeScrollingNode::adjustedScrollPosition const):
3927         (WebCore::ScrollingTreeScrollingNode::scrollBy):
3928         (WebCore::ScrollingTreeScrollingNode::scrollTo):
3929         (WebCore::ScrollingTreeScrollingNode::currentScrollPositionChanged):
3930         (WebCore::ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling):
3931         (WebCore::ScrollingTreeScrollingNode::localToContentsPoint const):
3932         (WebCore::ScrollingTreeScrollingNode::updateLayersAfterAncestorChange): Deleted.
3933         (WebCore::ScrollingTreeScrollingNode::setScrollPosition): Deleted.
3934         * page/scrolling/ScrollingTreeScrollingNode.h:
3935         * page/scrolling/ScrollingTreeScrollingNodeDelegate.h:
3936         (WebCore::ScrollingTreeScrollingNodeDelegate::currentScrollPosition const):
3937         (WebCore::ScrollingTreeScrollingNodeDelegate::scrollPosition const): Deleted.
3938         * page/scrolling/ThreadedScrollingTree.cpp: