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