The include file in ScrollingStateFrameHostingNode.h is wrong.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-03-05  Cathie Chen  <cathiechen@igalia.com>
2
3         The include file in ScrollingStateFrameHostingNode.h is wrong.
4         https://bugs.webkit.org/show_bug.cgi?id=195280
5
6         Reviewed by Frédéric Wang.
7
8         * page/scrolling/ScrollingStateFrameHostingNode.h:
9
10 2019-03-04  Justin Fan  <justin_fan@apple.com>
11
12         Unreviewed build fix for High Sierra.
13
14         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm: Should fix "global constructor" error.
15
16 2019-03-04  Brent Fulgham  <bfulgham@apple.com>
17
18         Use a SQLite database to hold the ResourceLoadStatistics data
19         https://bugs.webkit.org/show_bug.cgi?id=194867
20         <rdar://problem/24240854>
21
22         Reviewed by Chris Dumez.
23
24         Add a new runtime feature flag to support use of an experimental database
25         back-end. Also expose some SQLite function calls for use outside of WebCore.
26
27         No change in functionality, so no new tests.
28
29         * page/RuntimeEnabledFeatures.h:
30         (WebCore::RuntimeEnabledFeatures::setItpDatabaseModeEnabled):
31         (WebCore::RuntimeEnabledFeatures::itpDatabaseModeEnabled const):
32         * platform/sql/SQLiteDatabase.h:
33         * platform/sql/SQLiteStatement.h:
34
35 2019-03-04  Justin Fan  <justin_fan@apple.com>
36
37         [Web GPU] Blitting function prototypes
38         https://bugs.webkit.org/show_bug.cgi?id=195224
39         <rdar://problem/48538902>
40
41         Reviewed by Dean Jackson.
42
43         Implement barebones GPUCommandBuffer::copy* prototypes while rounding out GPUTexture implementation details.
44
45         Test: webgpu/blit-commands.html
46
47         * Modules/webgpu/GPUOrigin3D.h: Added.
48         * Modules/webgpu/GPUOrigin3D.idl: Added.
49         * Modules/webgpu/WebGPUCommandBuffer.cpp: Add copy view struct implementations.
50         (WebCore::WebGPUBufferCopyView::asGPUBufferCopyView const): Added.
51         (WebCore::WebGPUTextureCopyView::asGPUTextureCopyView const): Added.
52         (WebCore::WebGPUCommandBuffer::copyBufferToBuffer): Added.
53         (WebCore::WebGPUCommandBuffer::copyBufferToTexture): Added.
54         (WebCore::WebGPUCommandBuffer::copyTextureToBuffer): Added.
55         (WebCore::WebGPUCommandBuffer::copyTextureToTexture): Added.
56         * Modules/webgpu/WebGPUCommandBuffer.h: Add new functions and supporting structs.
57         * Modules/webgpu/WebGPUCommandBuffer.idl: Ditto.
58         * Modules/webgpu/WebGPURenderPassDescriptor.cpp: Refactor constructors to copy the entire base class.
59         (WebCore::GPURenderPassColorAttachmentDescriptor::GPURenderPassColorAttachmentDescriptor):
60         (WebCore::GPURenderPassDepthStencilAttachmentDescriptor::GPURenderPassDepthStencilAttachmentDescriptor):
61         (WebCore::WebGPURenderPassDescriptor::asGPURenderPassDescriptor const):
62         (WebCore::attachment): Deleted.
63         * Modules/webgpu/WebGPUTexture.h:
64         (WebCore::WebGPUTexture::texture const): Added.
65         * platform/graphics/gpu/GPUBuffer.h:
66         (WebCore::GPUBuffer::byteLength const): Added.
67         (WebCore::GPUBuffer::isTransferSource const): Added.
68         (WebCore::GPUBuffer::isTransferDestination const): Renamed from isTransferDst. Refactored for OptionSet API.
69         (WebCore::GPUBuffer::isVertex const): Ditto.
70         (WebCore::GPUBuffer::isUniform const): Ditto.
71         (WebCore::GPUBuffer::isStorage const): Ditto.
72         (WebCore::GPUBuffer::isMappable const): Ditto.
73         (WebCore::GPUBuffer::isMapWrite const): Ditto.
74         (WebCore::GPUBuffer::isMapRead const): Ditto.
75         * platform/graphics/gpu/GPUBufferUsage.h: Refactored for better bit flag style.
76         * platform/graphics/gpu/GPUCommandBuffer.h:
77         (WebCore::GPUCommandBuffer::blitEncoder const): Added.
78         * platform/graphics/gpu/GPURenderPassDescriptor.h: 
79         * platform/graphics/gpu/GPUTexture.h: Cache usage flags for reference.
80         (WebCore::GPUTexture::isTransferSrc const): Added.
81         (WebCore::GPUTexture::isTransferDst const): Added.
82         (WebCore::GPUTexture::isOutputAttachment const): Added.
83         * platform/graphics/gpu/GPUTextureUsage.h: Refactor to match GPUBufferUsage.h.
84         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
85         (WebCore::GPUBuffer::validateBufferUsage): Renamed from validateBufferCreate, refactored for OptionSet.
86         (WebCore::GPUBuffer::tryCreate):
87         (WebCore::GPUBuffer::GPUBuffer):
88         (WebCore::GPUBuffer::isReadOnly const):
89         (WebCore::GPUBuffer::setSubData): Add alignment check according to Metal docs.
90         * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm: 
91         (WebCore::GPUCommandBuffer::create): No need to use this alias here.
92         (WebCore::GPUCommandBuffer::GPUCommandBuffer): Ditto.
93         (WebCore::GPUCommandBuffer::copyBufferToBuffer): Added.
94         (WebCore::GPUCommandBuffer::copyBufferToTexture): Added.
95         (WebCore::GPUCommandBuffer::copyTextureToBuffer): Added. 
96         (WebCore::GPUCommandBuffer::copyTextureToTexture): Added. 
97         * platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
98         (WebCore::GPUQueue::submit): End encoding on the MTLCommandBuffer's blitCommandEncoder if it was used.
99         * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
100         (WebCore::GPUSwapChain::getNextTexture): Now provide usage flags to texture creation.
101         * platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
102         (WebCore::mtlTextureUsageForGPUTextureUsageFlags): Refactor validation.
103         (WebCore::tryCreateMtlTextureDescriptor): Ditto.
104         (WebCore::GPUTexture::tryCreate): Now provide usage flags to texture creation.
105         (WebCore::GPUTexture::create): Ditto.
106         (WebCore::GPUTexture::GPUTexture): Ditto.
107         (WebCore::GPUTexture::createDefaultTextureView): Ditto.
108
109 2019-03-04  Zalan Bujtas  <zalan@apple.com>
110
111         [ContentChangeObserver] Introduce fixed duration content observation
112         https://bugs.webkit.org/show_bug.cgi?id=195295
113         <rdar://problem/48579913>
114
115         Reviewed by Simon Fraser.
116
117         Some pages have a runloop-like scheduling setup where the content triggering change happens at a nested timer firing.
118         This patch helps finding cases like that using a 32ms long fixed window. Currently nested timers get dropped on the floor and
119         we stop observing for content changes before they even get fired.
120
121         Test: fast/events/touch/ios/visibility-change-happens-on-timer-hops.html
122
123         * page/ios/ContentChangeObserver.cpp:
124         (WebCore::ContentChangeObserver::ContentChangeObserver):
125         (WebCore::ContentChangeObserver::startContentObservationForDuration):
126         (WebCore::ContentChangeObserver::stopDurationBasedContentObservation):
127         (WebCore::ContentChangeObserver::hasDeterminateState const):
128         (WebCore::ContentChangeObserver::adjustObservedState):
129         * page/ios/ContentChangeObserver.h:
130         (WebCore::ContentChangeObserver::isObservingContentChanges const):
131         (WebCore::ContentChangeObserver::hasPendingActivity const):
132
133 2019-03-04  Wenson Hsieh  <wenson_hsieh@apple.com>
134
135         Native text selection UI is incorrectly suppressed in Microsoft Visio
136         https://bugs.webkit.org/show_bug.cgi?id=195178
137         <rdar://problem/48519394>
138
139         Reviewed by Darin Adler.
140
141         Currently, our heuristics for detecting hidden editable areas attempt to search for empty parent renderers with
142         "overflow: hidden". It does this by ascending the layer tree in search of renderers that have an empty content
143         size, and whose renderers' styles indicate that they have overflow: hidden in the X or Y directions. This fails
144         in the case where a child renderer is positioned out of flow, relative to one of its parent layers, since the
145         child will be visible, but we'll incorrectly believe that it is hidden. This leads to selection UI unexpectedly
146         disappearing in the online version of Microsoft Visio.
147
148         To fix this, we check whether the enclosing layer around the editable element has an empty clip rect; if the
149         element is inside of a subframe, we additionally walk up to each enclosing frame's layer and check if that
150         frame's layer has an empty clip rect.
151
152         Test: editing/selection/ios/do-not-hide-selection-in-visible-container.html
153
154         * rendering/RenderObject.cpp:
155         (WebCore::RenderObject::isTransparentOrFullyClippedRespectingParentFrames const):
156
157 2019-03-01  Ryosuke Niwa  <rniwa@webkit.org>
158
159         gPictureOwnerMap is unnecessary
160         https://bugs.webkit.org/show_bug.cgi?id=195228
161
162         Reviewed by Zalan Bujtas.
163
164         Just store in HTMLImageElement. An extra pointer isn't going to affect the memory use here.
165         If anything, we should worry about m_editableImage and m_pendingClonedAttachmentID instead.
166
167         * html/HTMLImageElement.cpp:
168         (WebCore::HTMLImageElement::pictureElement const):
169         (WebCore::HTMLImageElement::setPictureElement):
170         * html/HTMLImageElement.h:
171
172 2019-03-04  Daniel Bates  <dabates@apple.com>
173
174         [iOS] Caret x-position in empty text area does not match text field
175         https://bugs.webkit.org/show_bug.cgi?id=195125
176         <rdar://problem/47161070>
177
178         Remove the word "use" in the added comment to make it read well.
179
180         * css/html.css:
181         (textarea):
182
183 2019-03-04  Joseph Pecoraro  <pecoraro@apple.com>
184
185         ITMLKit Inspector: Data Bindings / Associated Data for nodes
186         https://bugs.webkit.org/show_bug.cgi?id=195290
187         <rdar://problem/48304019>
188
189         Reviewed by Devin Rousso.
190
191         * inspector/agents/InspectorDOMAgent.h:
192         * inspector/agents/InspectorDOMAgent.cpp:
193         (WebCore::InspectorDOMAgent::getDataBindingsForNode):
194         (WebCore::InspectorDOMAgent::getAssociatedDataForNode):
195         Stub these for web pages, they will only be used for ITMLKit right now.
196
197 2019-03-04  Daniel Bates  <dabates@apple.com>
198
199         [iOS] Caret x-position in empty text area does not match text field
200         https://bugs.webkit.org/show_bug.cgi?id=195125
201         <rdar://problem/47161070>
202
203         Reviewed by Darin Adler.
204
205         Fix up User Agent styles for <textarea> on iOS such that they have the same left padding
206         width and same text-indent as <input type="text">. This makes the x-position of the caret
207         in an empty textarea match the position of the caret in an empty text field.
208
209         Test: fast/forms/textarea/ios/caret-x-position-in-textarea-matches-textfield.html
210
211         * css/html.css:
212         (textarea): For iOS Family, do not use the padding shorthand property. Instead explicitly specify
213         padding-top and padding-bottom to be 2px to keep our current behavior (because it looks reasonable)
214         and do not specify left and right padding so that we inherit the padding set earlier in this file.
215         (textarea::placeholder): Deleted. This was added to "try" to make fix up the position of the placeholder
216         text so as to match the position of the textarea's inner text and the position of a text field's inner
217         text. This fix up may have worked out visually when it was added, but based on the discovery of the
218         hardcoded 3px left and right padding (see below remark) it looks like it was always one pixel too short.
219         * html/HTMLTextAreaElement.cpp:
220         (WebCore::HTMLTextAreaElement::createInnerTextStyle): Remove hardcoded 3px left and right padding.
221
222 2019-03-04  Youenn Fablet  <youenn@apple.com>
223
224         Make sure to correctly notify of end of a ServiceWorkerJob when the context is stopped
225         https://bugs.webkit.org/show_bug.cgi?id=195195
226
227         Reviewed by Chris Dumez.
228
229         Before the patch, we were notifying that some jobs were finished too aggressively at context stop time.
230         This was confusing the Network Process.
231         Only notify such jobs that have pending loads.
232         Improve the tracking of jobs doing registration resolution to ensure the Network Process gets notified
233         in case of a registration promise being resolved but the settling callback being not yet called while the context is stopped.
234
235         Covered by existing tests not crashing anymore, in particular imported/w3c/web-platform-tests/service-workers/service-worker/skip-waiting.https.html.
236
237         * workers/service/ServiceWorkerContainer.cpp:
238         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
239         (WebCore::ServiceWorkerContainer::notifyRegistrationIsSettled):
240         (WebCore::ServiceWorkerContainer::stop):
241         * workers/service/ServiceWorkerContainer.h:
242         * workers/service/ServiceWorkerJob.cpp:
243         (WebCore::ServiceWorkerJob::cancelPendingLoad):
244         * workers/service/ServiceWorkerJob.h:
245         (WebCore::ServiceWorkerJob::isLoading const):
246
247 2019-03-04  Chris Dumez  <cdumez@apple.com>
248
249         [iOS] Improve our file picker
250         https://bugs.webkit.org/show_bug.cgi?id=195284
251         <rdar://problem/45655856>
252
253         Reviewed by Tim Horton and Wenson Hsieh.
254
255         Export UTIUtilities.h so that it can be used from WebKit2.
256
257         * WebCore.xcodeproj/project.pbxproj:
258
259 2019-03-04  Zalan Bujtas  <zalan@apple.com>
260
261         [ContentChangeObserver] Decouple mouseMoved event and the "is observing content change" status.
262         https://bugs.webkit.org/show_bug.cgi?id=195286
263
264         Reviewed by Simon Fraser.
265
266         Now isObservingContentChanges returns true only when we are actively observing content change during timer firing and/or style recalculating.
267         This patch also renames a couple of functions to follow the didStart/didFinish pattern.
268
269         * page/ios/ContentChangeObserver.cpp:
270         (WebCore::ContentChangeObserver::domTimerExecuteDidStart):
271         (WebCore::ContentChangeObserver::domTimerExecuteDidFinish):
272         (WebCore::ContentChangeObserver::styleRecalcDidStart):
273         (WebCore::ContentChangeObserver::styleRecalcDidFinish):
274         (WebCore::ContentChangeObserver::mouseMovedDidStart):
275         (WebCore::ContentChangeObserver::mouseMovedDidFinish):
276         (WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc):
277         (WebCore::ContentChangeObserver::StyleChangeScope::StyleChangeScope):
278         (WebCore::ContentChangeObserver::MouseMovedScope::MouseMovedScope):
279         (WebCore::ContentChangeObserver::MouseMovedScope::~MouseMovedScope):
280         (WebCore::ContentChangeObserver::StyleRecalcScope::StyleRecalcScope):
281         (WebCore::ContentChangeObserver::StyleRecalcScope::~StyleRecalcScope):
282         (WebCore::ContentChangeObserver::DOMTimerScope::DOMTimerScope):
283         (WebCore::ContentChangeObserver::DOMTimerScope::~DOMTimerScope):
284         (WebCore::ContentChangeObserver::startObservingDOMTimerExecute): Deleted.
285         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute): Deleted.
286         (WebCore::ContentChangeObserver::startObservingStyleRecalc): Deleted.
287         (WebCore::ContentChangeObserver::stopObservingStyleRecalc): Deleted.
288         (WebCore::ContentChangeObserver::startObservingMouseMoved): Deleted.
289         (WebCore::ContentChangeObserver::stopObservingMouseMoved): Deleted.
290         (WebCore::ContentChangeObserver::setShouldObserveStyleRecalc): Deleted.
291         * page/ios/ContentChangeObserver.h:
292         (WebCore::ContentChangeObserver::setShouldObserveDOMTimerScheduling):
293         (WebCore::ContentChangeObserver::isObservingDOMTimerScheduling const):
294         (WebCore::ContentChangeObserver::isObservingStyleRecalc const):
295         (WebCore::ContentChangeObserver::isObservingContentChanges const):
296         (WebCore::ContentChangeObserver::startObservingDOMTimerScheduling): Deleted.
297         (WebCore::ContentChangeObserver::stopObservingDOMTimerScheduling): Deleted.
298         (WebCore::ContentChangeObserver::shouldObserveStyleRecalc const): Deleted.
299
300 2019-03-04  Yusuke Suzuki  <ysuzuki@apple.com>
301
302         [JSC] Offer @makeTypeError instead of exposing @TypeError
303         https://bugs.webkit.org/show_bug.cgi?id=193858
304
305         Reviewed by Mark Lam.
306
307         Use @makeTypeError instead.
308
309         * Modules/mediastream/RTCPeerConnection.js:
310         * Modules/mediastream/RTCPeerConnectionInternals.js:
311         * Modules/streams/ReadableByteStreamInternals.js:
312         (readableByteStreamControllerClose):
313         (readableByteStreamControllerPullInto):
314         * Modules/streams/ReadableStream.js:
315         (cancel):
316         (pipeTo):
317         * Modules/streams/ReadableStreamBYOBReader.js:
318         (cancel):
319         (read):
320         * Modules/streams/ReadableStreamDefaultReader.js:
321         (cancel):
322         (read):
323         * Modules/streams/ReadableStreamInternals.js:
324         (readableStreamReaderGenericRelease):
325         * Modules/streams/WritableStream.js:
326         (abort):
327         (close):
328         (write):
329         (getter.closed):
330         (getter.ready):
331
332 2019-03-04  Simon Fraser  <simon.fraser@apple.com>
333
334         Share more code between overflow and frame scrolling nodes, fixing overflow scrollbar display
335         https://bugs.webkit.org/show_bug.cgi?id=195258
336
337         Reviewed by Antti Koivisto.
338
339         This patch moves management of scrollbar layers and scrollbar painters ("NSScrollerImp") down to
340         ScrollingStateScrollingNode to be shared between frame and overflow nodes, allowing for
341         scrolling thread updates of overflow scrollbars. It also moves some scrolling tree-side code
342         to ScrollingTreeScrollingNodeDelegateMac to be shared between the "tree" nodes for overflow and frames.
343
344         Layers for scrollbars are given to scrolling state nodes via setNodeLayers() now, and
345         RenderLayerCompositor::updateScrollingNodeLayers() is added to provide a bottleneck to call that.
346         At some point AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange() should be relieved
347         of the responsibility of pushing scrollbar layers (but the scrolling state tree needs to hold
348         references to GraphicsLayers before that becomes safe).
349         
350         The actual fix that allows overflow scrollbars to show is the change in
351         AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange() that calls scrollableArea.*ScrollbarLayerDidChange()
352         for all ScrollableAreas. This ensures that the CALayer is pushed onto the NSScrollerImp.
353
354         * SourcesCocoa.txt:
355         * WebCore.xcodeproj/project.pbxproj:
356         * page/scrolling/AsyncScrollingCoordinator.cpp:
357         (WebCore::AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange):
358         (WebCore::AsyncScrollingCoordinator::setNodeLayers):
359         (WebCore::AsyncScrollingCoordinator::setFrameScrollingNodeState):
360         (WebCore::AsyncScrollingCoordinator::setScrollingNodeScrollableAreaGeometry):
361         * page/scrolling/ScrollingCoordinator.h:
362         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
363         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
364         (WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged):
365         (WebCore::ScrollingStateFrameScrollingNode::setVerticalScrollbarLayer): Deleted.
366         (WebCore::ScrollingStateFrameScrollingNode::setHorizontalScrollbarLayer): Deleted.
367         (WebCore::ScrollingStateFrameScrollingNode::setScrollerImpsFromScrollbars): Deleted.
368         * page/scrolling/ScrollingStateFrameScrollingNode.h:
369         * page/scrolling/ScrollingStateScrollingNode.cpp:
370         (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
371         (WebCore::ScrollingStateScrollingNode::setAllPropertiesChanged):
372         (WebCore::ScrollingStateScrollingNode::setHorizontalScrollbarLayer):
373         (WebCore::ScrollingStateScrollingNode::setVerticalScrollbarLayer):
374         (WebCore::ScrollingStateScrollingNode::setScrollerImpsFromScrollbars):
375         * page/scrolling/ScrollingStateScrollingNode.h:
376         (WebCore::ScrollingStateScrollingNode::horizontalScrollbarLayer const):
377         (WebCore::ScrollingStateScrollingNode::verticalScrollbarLayer const):
378         (WebCore::ScrollingStateScrollingNode::verticalScrollerImp const):
379         (WebCore::ScrollingStateScrollingNode::horizontalScrollerImp const):
380         * page/scrolling/ScrollingTree.cpp:
381         (WebCore::ScrollingTree::setOrClearLatchedNode):
382         (WebCore::ScrollingTree::handleWheelEvent):
383         * page/scrolling/mac/ScrollingStateScrollingNodeMac.mm: Renamed from Source/WebCore/page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm.
384         (WebCore::ScrollingStateScrollingNode::setScrollerImpsFromScrollbars):
385         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
386         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
387         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
388         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
389         (WebCore::ScrollingTreeFrameScrollingNodeMac::repositionRelatedLayers):
390         (WebCore::ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac): Deleted.
391         (WebCore::ScrollingTreeFrameScrollingNodeMac::releaseReferencesToScrollerImpsOnTheMainThread): Deleted.
392         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
393         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
394         (WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateBeforeChildren):
395         (WebCore::ScrollingTreeOverflowScrollingNodeMac::handleWheelEvent):
396         (WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionRelatedLayers):
397         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h:
398         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
399         (WebCore::ScrollingTreeScrollingNodeDelegateMac::~ScrollingTreeScrollingNodeDelegateMac):
400         (WebCore::ScrollingTreeScrollingNodeDelegateMac::updateFromStateNode):
401         (WebCore::ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent):
402         (WebCore::ScrollingTreeScrollingNodeDelegateMac::updateScrollbarPainters):
403         (WebCore::ScrollingTreeScrollingNodeDelegateMac::releaseReferencesToScrollerImpsOnTheMainThread):
404         * platform/ScrollbarThemeComposite.h:
405         * rendering/RenderLayerCompositor.cpp:
406         (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
407         (WebCore::RenderLayerCompositor::updateScrollingNodeLayers):
408         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
409         * rendering/RenderLayerCompositor.h:
410
411 2019-03-04  Jer Noble  <jer.noble@apple.com>
412
413         Remove HEVC as a codec requiring hardware support.
414         https://bugs.webkit.org/show_bug.cgi?id=194960
415         <rdar://problem/47741432>
416
417         Reviewed by Eric Carlson.
418
419         * page/cocoa/SettingsBaseCocoa.mm:
420         (WebCore::SettingsBase::defaultMediaContentTypesRequiringHardwareSupport):
421
422 2019-03-04  Jer Noble  <jer.noble@apple.com>
423
424         [iOS] Fullscreen "stay in page" option breaks video playback
425         https://bugs.webkit.org/show_bug.cgi?id=195277
426         <rdar://problem/48537317>
427
428         Reviewed by Eric Carlson.
429
430         Add a LOG entry when playback is rejected due to media playback suspension.
431
432         * html/MediaElementSession.cpp:
433         (WebCore::MediaElementSession::playbackPermitted const):
434
435 2019-03-04  Tim Horton  <timothy_horton@apple.com>
436
437         Fix the build.
438
439         * dom/Document.h:
440
441 2019-03-03  Zalan Bujtas  <zalan@apple.com>
442
443         [ContentChangeObserver] Content observation should be limited to the current document.
444         https://bugs.webkit.org/show_bug.cgi?id=195256
445         <rdar://problem/48544402>
446
447         Move ContentChangeObserver from Page to Document.
448         It limits content observation to the target node's owner document.
449
450         Reviewed by Simon Fraser.
451
452         * dom/Document.cpp:
453         (WebCore::m_contentChangeObserver):
454         (WebCore::Document::updateStyleIfNeeded):
455         (WebCore::Document::willDetachPage):
456         (WebCore::Document::platformSuspendOrStopActiveDOMObjects):
457         (WebCore::m_undoManager): Deleted.
458         * dom/Document.h:
459         (WebCore::Document::contentChangeObserver):
460         * page/DOMTimer.cpp:
461         (WebCore::DOMTimer::install):
462         (WebCore::DOMTimer::removeById):
463         (WebCore::DOMTimer::fired):
464         * page/Frame.cpp:
465         (WebCore::Frame::willDetachPage):
466         * page/Page.cpp:
467         (WebCore::Page::Page):
468         * page/Page.h:
469         (WebCore::Page::pointerLockController const):
470         (WebCore::Page::contentChangeObserver): Deleted.
471         * page/ios/ContentChangeObserver.cpp:
472         (WebCore::ContentChangeObserver::ContentChangeObserver):
473         (WebCore::ContentChangeObserver::didInstallDOMTimer):
474         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
475         (WebCore::ContentChangeObserver::stopObservingStyleRecalc):
476         (WebCore::ContentChangeObserver::clearTimersAndReportContentChange):
477         (WebCore::ContentChangeObserver::startObservingMouseMoved):
478         (WebCore::ContentChangeObserver::hasDeterminateState const):
479         (WebCore::ContentChangeObserver::adjustObservedState):
480         (WebCore::ContentChangeObserver::notifyContentChangeIfNeeded):
481         (WebCore::ContentChangeObserver::StyleChangeScope::StyleChangeScope):
482         (WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
483         (WebCore::ContentChangeObserver::MouseMovedScope::MouseMovedScope):
484         (WebCore::ContentChangeObserver::MouseMovedScope::~MouseMovedScope):
485         (WebCore::ContentChangeObserver::StyleRecalcScope::StyleRecalcScope):
486         (WebCore::ContentChangeObserver::StyleRecalcScope::~StyleRecalcScope):
487         (WebCore::ContentChangeObserver::DOMTimerScope::DOMTimerScope):
488         (WebCore::ContentChangeObserver::DOMTimerScope::~DOMTimerScope):
489         (WebCore::hasPendingStyleRecalc): Deleted.
490         * page/ios/ContentChangeObserver.h:
491         * page/ios/EventHandlerIOS.mm:
492         (WebCore::EventHandler::mouseMoved):
493         * rendering/updating/RenderTreeUpdater.cpp:
494         (WebCore::RenderTreeUpdater::updateElementRenderer):
495
496 2019-03-02  Simon Fraser  <simon.fraser@apple.com>
497
498         Share more code for updating the state of frame scrolling nodes
499         https://bugs.webkit.org/show_bug.cgi?id=195254
500
501         Reviewed by Antti Koivisto.
502
503         Responsibility for updating state on ScrollingStateFrameScrolling nodes was split between
504         AsyncScrollingCoordinator::frameViewLayoutUpdated(), which is called post-layout, and
505         RenderLayerCompositor. This patch gives that responsibility entirely to RenderLayerCompositor,
506         ensuring that we update frame scrolling nodes at the same time as the rest of the scrolling
507         state tree.
508         
509         We also share code between updating ScrollingStateFrameScrollingNodes and
510         ScrollingStateOverflowScrollingNodews, since both can be updated from a ScrollableArea.
511         Some minor cleanup of ScrollableArea is doing to help. For the first time, we're pushing
512         ScrollableAreaParameters for overflow scrolling nodes, allowing rubber-banding to work
513         on macOS.
514
515         * page/scrolling/AsyncScrollingCoordinator.cpp:
516         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
517         (WebCore::AsyncScrollingCoordinator::setRectRelativeToParentNode):
518         (WebCore::AsyncScrollingCoordinator::setFrameScrollingNodeState):
519         (WebCore::AsyncScrollingCoordinator::setScrollingNodeScrollableAreaGeometry):
520         (WebCore::AsyncScrollingCoordinator::setViewportConstraintedNodeConstraints):
521         (WebCore::AsyncScrollingCoordinator::setScrollingNodeGeometry): Deleted.
522         (WebCore::AsyncScrollingCoordinator::setViewportConstraintedNodeGeometry): Deleted.
523         * page/scrolling/AsyncScrollingCoordinator.h:
524         * page/scrolling/ScrollingCoordinator.h:
525         (WebCore::ScrollingCoordinator::setRectRelativeToParentNode):
526         (WebCore::ScrollingCoordinator::setScrollingNodeScrollableAreaGeometry):
527         (WebCore::ScrollingCoordinator::setFrameScrollingNodeState):
528         (WebCore::ScrollingCoordinator::setViewportConstraintedNodeConstraints):
529         (WebCore::ScrollingCoordinator::setScrollingNodeGeometry): Deleted.
530         (WebCore::ScrollingCoordinator::setViewportConstraintedNodeGeometry): Deleted.
531         * platform/ScrollView.h:
532         (WebCore::ScrollView::horizontalScrollbarMode const): Deleted.
533         (WebCore::ScrollView::verticalScrollbarMode const): Deleted.
534         * platform/ScrollableArea.cpp:
535         (WebCore::ScrollableArea::reachableTotalContentsSize const):
536         * platform/ScrollableArea.h:
537         (WebCore::ScrollableArea::horizontalScrollbarMode const):
538         (WebCore::ScrollableArea::verticalScrollbarMode const):
539         * rendering/RenderLayer.cpp:
540         (WebCore::RenderLayer::overhangAmount const):
541         (WebCore::RenderLayer::reachableTotalContentsSize const):
542         (WebCore::RenderLayer::scrollableContentsSize const): Deleted.
543         * rendering/RenderLayer.h:
544         * rendering/RenderLayerCompositor.cpp:
545         (WebCore::RenderLayerCompositor::updateCompositingLayers):
546         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
547         (WebCore::RenderLayerCompositor::updateScrollingNodeForViewportConstrainedRole):
548         (WebCore::RenderLayerCompositor::rootParentRelativeScrollableRect const):
549         (WebCore::RenderLayerCompositor::parentRelativeScrollableRect const):
550         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
551         (WebCore::RenderLayerCompositor::updateScrollingNodeForFrameHostingRole):
552         (WebCore::RenderLayerCompositor::computeFrameScrollingGeometry const): Deleted.
553         (WebCore::RenderLayerCompositor::computeFrameHostingGeometry const): Deleted.
554         (WebCore::RenderLayerCompositor::computeOverflowScrollingGeometry const): Deleted.
555         * rendering/RenderLayerCompositor.h:
556
557 2019-03-02  Darin Adler  <darin@apple.com>
558
559         Retire legacy dtoa function and DecimalNumber class
560         https://bugs.webkit.org/show_bug.cgi?id=195253
561
562         Reviewed by Daniel Bates.
563
564         * css/CSSPrimitiveValue.cpp:
565         (WebCore::CSSPrimitiveValue::formatNumberValue const): Use makeString instead
566         of DecimalNumber. Also changed return type to String and use StringView and
567         removed special handling of literals.
568         (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText const): Removed an
569         unnecessary use of StringBuilder.
570
571         * css/CSSPrimitiveValue.h: Updated for changes to formatNumberValue.
572
573 2019-03-03  Michael Catanzaro  <mcatanzaro@igalia.com>
574
575         [SOUP] Cleanups in SoupNetworkSession
576         https://bugs.webkit.org/show_bug.cgi?id=195247
577
578         Reviewed by Daniel Bates.
579
580         This renames clientCertificates to allowedCertificates, since they are not client
581         certificates at all, but server certificates. It also adds a using statement to avoid
582         repeating the long type of the map, and avoids an unnecessary copy.
583
584         * platform/network/soup/SoupNetworkSession.cpp:
585         (WebCore::allowedCertificates):
586         (WebCore::SoupNetworkSession::checkTLSErrors):
587         (WebCore::SoupNetworkSession::allowSpecificHTTPSCertificateForHost):
588         (WebCore::clientCertificates): Deleted.
589
590 2019-03-03  Michael Catanzaro  <mcatanzaro@igalia.com>
591
592         -Wformat error in SharedBuffer::tryCreateArrayBuffer
593         https://bugs.webkit.org/show_bug.cgi?id=195004
594
595         Reviewed by Darin Adler.
596
597         Seems C++ has no format specifier appropriate for printing the result of sizeof. We should
598         just not try to print it. Anyway, that's easy in this case, because sizeof(char) is
599         guaranteed to be 1. This code was an attempt to be pedantic to account for mythical systems
600         with char larger than one byte, but perhaps it didn't realize sizeof always returns
601         multiples of char and so sizeof(char) is always one even on such mythical systems.
602
603         Note the sizeof(char) use two lines up is left since it's not clear that switching it to 1
604         would actually be more readable.
605
606         * platform/SharedBuffer.cpp:
607         (WebCore::SharedBuffer::tryCreateArrayBuffer const):
608
609 2019-03-03  Tim Horton  <timothy_horton@apple.com>
610
611         Remove some more unused 32-bit code
612         https://bugs.webkit.org/show_bug.cgi?id=195255
613
614         Reviewed by Darin Adler.
615
616         * platform/gamepad/cocoa/GameControllerGamepad.h:
617         * platform/gamepad/cocoa/GameControllerGamepad.mm:
618         * platform/gamepad/cocoa/GameControllerGamepadProvider.h:
619         * platform/gamepad/cocoa/GameControllerGamepadProvider.mm:
620         * platform/graphics/cocoa/FontCascadeCocoa.mm:
621         * platform/mac/PlatformEventFactoryMac.mm:
622         (WebCore::globalPointForEvent):
623         (WebCore::pointForEvent):
624         (WebCore::mouseButtonForEvent):
625         (WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder):
626         * rendering/RenderThemeMac.mm:
627         (WebCore::RenderThemeMac::servicesRolloverButtonCell const):
628         (WebCore::RenderThemeMac::paintImageControlsButton):
629         (WebCore::RenderThemeMac::imageControlsButtonSize const):
630         (WebCore::RenderThemeMac::imageControlsButtonPositionOffset const):
631
632 2019-03-02  Zalan Bujtas  <zalan@apple.com>
633
634         [ContentChangeObserver] Introduce ContentChangeObserver::MouseMovedScope
635         https://bugs.webkit.org/show_bug.cgi?id=195252
636         <rdar://problem/48539446>
637
638         Reviewed by Simon Fraser.
639
640         Scope the mouse-moved event to make the callsites less error-prone. 
641
642         * page/ios/ContentChangeObserver.cpp:
643         (WebCore::ContentChangeObserver::startObservingMouseMoved):
644         (WebCore::ContentChangeObserver::stopObservingMouseMoved):
645         (WebCore::ContentChangeObserver::MouseMovedScope::MouseMovedScope):
646         (WebCore::ContentChangeObserver::MouseMovedScope::~MouseMovedScope):
647         (WebCore::ContentChangeObserver::startObservingContentChanges): Deleted.
648         (WebCore::ContentChangeObserver::stopObservingContentChanges): Deleted.
649         * page/ios/ContentChangeObserver.h:
650         * page/ios/EventHandlerIOS.mm:
651         (WebCore::EventHandler::mouseMoved):
652
653 2019-03-02  Zalan Bujtas  <zalan@apple.com>
654
655         [ContentChangeObserver] Introduce ContentChangeObserver::adjustObservedState
656         https://bugs.webkit.org/show_bug.cgi?id=195244
657         <rdar://problem/48536737>
658
659         Reviewed by Simon Fraser.
660
661         Move state change handling code to adjustObservedState() and introduce signalContentChangeIfNeeded() to
662         let the client know about the state change (or lack of state change).
663
664         Test: fast/events/touch/ios/visibility-change-happens-at-the-second-timer.html
665
666         * page/ios/ContentChangeObserver.cpp:
667         (WebCore::ContentChangeObserver::didInstallDOMTimer):
668         (WebCore::ContentChangeObserver::didRemoveDOMTimer):
669         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
670         (WebCore::ContentChangeObserver::stopObservingStyleRecalc):
671         (WebCore::ContentChangeObserver::clearTimersAndReportContentChange):
672         (WebCore::ContentChangeObserver::didContentVisibilityChange):
673         (WebCore::ContentChangeObserver::addObservedDOMTimer):
674         (WebCore::ContentChangeObserver::removeObservedDOMTimer):
675         (WebCore::ContentChangeObserver::setShouldObserveStyleRecalc):
676         (WebCore::ContentChangeObserver::adjustObservedState):
677         (WebCore::ContentChangeObserver::signalContentChangeIfNeeded):
678         * page/ios/ContentChangeObserver.h:
679         (WebCore::ContentChangeObserver::isObservingDOMTimerScheduling const):
680         (WebCore::ContentChangeObserver::addObservedDOMTimer): Deleted.
681         (WebCore::ContentChangeObserver::setShouldObserveStyleRecalc): Deleted.
682
683 2019-03-02  Zalan Bujtas  <zalan@apple.com>
684
685         [ContentChangeObserver] Move away from WKContentChange values
686         https://bugs.webkit.org/show_bug.cgi?id=195240
687         <rdar://problem/48532358>
688
689         Reviewed by Simon Fraser.
690
691         This is in preparation for moving towards a state machine-like implementation.
692
693         * page/ios/ContentChangeObserver.cpp:
694         (WebCore::ContentChangeObserver::didInstallDOMTimer): Do not install the timer if we are already in "hover" state.
695         (WebCore::ContentChangeObserver::didRemoveDOMTimer):
696         (WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
697         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
698         (WebCore::ContentChangeObserver::startObservingStyleRecalc): No need to start observing the style recalc if we are already in "hover" state.
699         (WebCore::ContentChangeObserver::stopObservingStyleRecalc):
700         (WebCore::ContentChangeObserver::clearTimersAndReportContentChange):
701         (WebCore::ContentChangeObserver::didContentVisibilityChange):
702         (WebCore::ContentChangeObserver::startObservingContentChanges):
703         (WebCore::ContentChangeObserver::observedContentChange const):
704         (WebCore::ContentChangeObserver::removeObservedDOMTimer):
705         (WebCore::ContentChangeObserver::hasDeterminedState const):
706         (WebCore::ContentChangeObserver::observedContentChange): Deleted.
707         (WebCore::ContentChangeObserver::resetObservedContentChange): Deleted.
708         (WebCore::ContentChangeObserver::setObservedContentChange): Deleted.
709         (WebCore::ContentChangeObserver::addObservedDOMTimer): Deleted.
710         * page/ios/ContentChangeObserver.h:
711         (WebCore::ContentChangeObserver::addObservedDOMTimer):
712         (WebCore::ContentChangeObserver::clearObservedDOMTimers):
713         (WebCore::ContentChangeObserver::hasVisibleChangeState const):
714         (WebCore::ContentChangeObserver::hasObservedDOMTimer const):
715         (WebCore::ContentChangeObserver::setHasNoChangeState):
716         (WebCore::ContentChangeObserver::setHasIndeterminateState):
717         (WebCore::ContentChangeObserver::setHasVisibleChangeState):
718         (WebCore::ContentChangeObserver::countOfObservedDOMTimers const): Deleted.
719
720 2019-03-02  Wenson Hsieh  <wenson_hsieh@apple.com>
721
722         [iOS] Programmatic paste access should be granted when copying and pasting within the same origin
723         https://bugs.webkit.org/show_bug.cgi?id=195053
724         <rdar://problem/48134710>
725
726         Reviewed by Ryosuke Niwa.
727
728         Plumb the document pasteboard identifier through the client when making a DOM paste access request. See WebKit
729         ChangeLog for more details.
730
731         Test: editing/pasteboard/ios/dom-paste-same-origin.html
732
733         * WebCore.xcodeproj/project.pbxproj:
734         * dom/DOMPasteAccess.h: Renamed from Source/WebCore/dom/DOMPasteAccessPolicy.h.
735
736         Introduce DOMPasteAccessResponse, which is either DeniedForGesture, GrantedForCommand, or GrantedForGesture. In
737         particular, when pasteboard identifiers match, we only grant access for the current paste command, rather than
738         throughout the user gesture.
739
740         * dom/UserGestureIndicator.h:
741         (WebCore::UserGestureToken::didRequestDOMPasteAccess):
742         * loader/EmptyClients.cpp:
743         * page/EditorClient.h:
744         * page/Frame.cpp:
745         (WebCore::Frame::requestDOMPasteAccess):
746
747 2019-02-27  Darin Adler  <darin@apple.com>
748
749         Fixed makeString(float) to do shortest-form serialization without first converting to double
750         https://bugs.webkit.org/show_bug.cgi?id=195142
751
752         Reviewed by Daniel Bates.
753
754         * platform/graphics/Color.cpp: Removed unneeded include of DecimalNumber.h.
755
756 2019-03-02  Simon Fraser  <simon.fraser@apple.com>
757
758         REGRESSION (r242132): Incorrect positioning with multiple position:fixed elements
759         https://bugs.webkit.org/show_bug.cgi?id=195246
760
761         Reviewed by Frederic Wang.
762
763         r242132 introduced a bug where the management of 'cumulativeDelta' in ScrollingTree::notifyRelatedNodesRecursive
764         was incorrect. This value should propagate from ancestors to descendants, but not between siblings in the scrolling
765         tree, which it did, causing sibling position:fixed to behave incorrectly.
766
767         Test: scrollingcoordinator/mac/multiple-fixed.html
768
769         * page/scrolling/ScrollingTree.cpp:
770         (WebCore::ScrollingTree::notifyRelatedNodesRecursive):
771         * page/scrolling/ScrollingTree.h:
772
773 2019-03-02  Darin Adler  <darin@apple.com>
774
775         Improve some comments
776         https://bugs.webkit.org/show_bug.cgi?id=195243
777
778         Reviewed by Daniel Bates.
779
780         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
781         (-[WebAccessibilityObjectWrapper _addAccessibilityObject:toTextMarkerArray:]):
782         Fix a typo in a comment.
783
784         * dom/RadioButtonGroups.cpp: Fix a typo in a comment.
785         (WebCore::RadioButtonGroups::checkedButtonForGroup const): Use nullptr instead of 0.
786
787         * html/HTMLInputElement.cpp:
788         (WebCore::HTMLInputElement::~HTMLInputElement): Improved a comment, but sadly made
789         it a bit longer. Use nullptr instead of 0.
790         (WebCore::HTMLInputElement::didMoveToNewDocument): Added a comment.
791
792 2019-03-01  Wenson Hsieh  <wenson_hsieh@apple.com>
793
794         [Datalist] fast/forms/datalist/datalist-child-validation.html crashes with a debug assertion in isValidFormControlElement()
795         https://bugs.webkit.org/show_bug.cgi?id=190620
796         <rdar://problem/19226679>
797
798         Reviewed by Ryosuke Niwa.
799
800         Fixes and re-enables an existing layout test that is asserting on debug builds (and failing on release builds).
801         To understand why we hit this assertion, we first note several observations:
802
803             -   The validity of a form control (`isValid()`) depends on the value of `willValidate()`.
804             -   Both of these results are cached in member variables: `m_isValid` and `m_willValidate`, respectively.
805             -   `willValidate()` changes the cached value of `m_willValidate` if necessary, but `isValid()` uses the
806                 cached value without update.
807
808         Now, consider the following scenario:
809
810             1.  Something changes in the DOM that changes the result of `willValidate()`. This can happen as a result of
811                 several things:
812                 a.  The form control changes readonly state
813                 b.  The form control changes disabled state
814                 c.  The form control is added to a datalist element
815                 d.  The form control is removed from a datalist element
816             2.  Call `willValidate()`.
817             3.  Call `isValid()`.
818
819         In scenarios (a) - (c), we ensure that cached form control validity (`m_isValid`) is updated alongside
820         `m_willValidate` by invoking `setNeedsWillValidateCheck()`, such that the result of `isValid()` matches the
821         result of `m_isValid` in step (3). However, in the last scenario (d), we don't do this, which causes form
822         control validity to fall out of sync with the result of `isValid()`. To fix the bug, we update willValidate and
823         isValid when a form control is removed from an ancestor, only if one of its ancestors is a datalist element.
824
825         * html/HTMLFormControlElement.cpp:
826         (WebCore::HTMLFormControlElement::insertedIntoAncestor):
827         (WebCore::HTMLFormControlElement::removedFromAncestor):
828
829         Make a couple of minor tweaks:
830           - Currently, we always invalidate `m_dataListAncestorState` by resetting the state to `Unknown` when the form
831             control is removed from an ancestor or inserted. Instead, we only need to reset it when the form control
832             already has an ancestor that is a datalist (in the case where it's being removed) or when the form control
833             does not yet have an ancestor (in the case where it is being added).
834           - If the form control was inside a datalist prior to removal, recompute its cached value of `m_willValidate`,
835             as well as its cached validity (`m_isValid`).
836
837 2019-03-01  Darin Adler  <darin@apple.com>
838
839         Finish removing String::format
840         https://bugs.webkit.org/show_bug.cgi?id=194893
841
842         Reviewed by Daniel Bates.
843
844         * dom/Document.cpp:
845         (WebCore::Document::lastModified const): Use makeString and pad.
846         * html/FTPDirectoryDocument.cpp:
847         (WebCore::processFileDateString): Ditto.
848
849         * mathml/MathMLElement.cpp:
850         (WebCore::convertToPercentageIfNeeded): Use makeString and FormattedNumber.
851
852         * page/cocoa/ResourceUsageOverlayCocoa.mm:
853         (WebCore::ResourceUsageOverlay::platformDraw): Use makeString and pad.
854
855         * page/linux/ResourceUsageOverlayLinux.cpp:
856         (WebCore::cpuUsageString): Use makeString, FormattedNumber, and pad.
857         (WebCore::gcTimerString): Use String::number.
858
859         * platform/DateComponents.cpp:
860         (WebCore::DateComponents::toStringForTime const): Use makeString and pad.
861         (WebCore::DateComponents::toString const): Ditto.
862
863         * platform/LocalizedStrings.cpp: Removed comment that mentioned String::format,
864         and that was also inaccurate.
865
866         * platform/audio/HRTFElevation.cpp:
867         (WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
868         Use makeString and pad.
869         * platform/mock/MockRealtimeVideoSource.cpp:
870         (WebCore::MockRealtimeVideoSource::drawText): Ditto.
871         * rendering/RenderLayerCompositor.cpp:
872         (WebCore::RenderLayerCompositor::logLayerInfo): Ditto.
873         * rendering/RenderTheme.cpp:
874         (WebCore::RenderTheme::formatMediaControlsTime const): Ditto.
875
876 2019-03-01  Chris Dumez  <cdumez@apple.com>
877
878         Do not attempt to set WAL Journal mode on a readonly SQLite database
879         https://bugs.webkit.org/show_bug.cgi?id=195237
880
881         Reviewed by Simon Fraser.
882
883         This avoids logging errors when opening the database.
884
885         * platform/sql/SQLiteDatabase.cpp:
886         (WebCore::SQLiteDatabase::open):
887         (WebCore::SQLiteDatabase::useWALJournalMode):
888         * platform/sql/SQLiteDatabase.h:
889
890 2019-03-01  Antoine Quint  <graouts@apple.com>
891
892         [iOS] Turn mouse event simulation on by default
893         https://bugs.webkit.org/show_bug.cgi?id=195218
894         <rdar://problem/48516794>
895
896         Reviewed by Dean Jackson.
897
898         * page/RuntimeEnabledFeatures.h:
899
900 2019-03-01  Chris Dumez  <cdumez@apple.com>
901
902         Disable NetworkStateNotifier::singleton()'s isMainThread() assertion when the WebThread is enabled
903         https://bugs.webkit.org/show_bug.cgi?id=195230
904         <rdar://problem/47925359>
905
906         Reviewed by Ryosuke Niwa.
907
908         Disable NetworkStateNotifier::singleton()'s isMainThread() assertion when the WebThread is enabled
909         to address crashes on iOS WK1.
910
911         * platform/network/NetworkStateNotifier.cpp:
912         (WebCore::shouldSuppressThreadSafetyCheck):
913         (WebCore::NetworkStateNotifier::singleton):
914
915 2019-03-01  Simon Fraser  <simon.fraser@apple.com>
916
917         Show mouse event regions in the overlay
918         https://bugs.webkit.org/show_bug.cgi?id=195227
919
920         Reviewed by Tim Horton.
921
922         Enhance event region overlays to show more kinds of events.
923
924         * page/DebugPageOverlays.cpp:
925         (WebCore::touchEventRegionColors):
926         (WebCore::NonFastScrollableRegionOverlay::drawRect):
927
928 2019-03-01  Zalan Bujtas  <zalan@apple.com>
929
930         [ContentChangeObserver] Check for pending style recalcs at the end of each timer run.
931         https://bugs.webkit.org/show_bug.cgi?id=195220
932         <rdar://problem/48518979>
933
934         Reviewed by Simon Fraser.
935
936         didScheduleStyleRecalc callback was introduced to see if a style recalc is scheduled while firing the DOM timer. However it does not handle the case
937         when in addition to this style recalc scheduling, something later (though during the same timer firing) triggers a sync style recalc.
938         Let's just check if we've got a pending style recalc when the DOM timer comes back.
939
940         Test: fast/events/touch/ios/style-recalc-schedule-and-force-relalc.html
941
942         * dom/Document.cpp:
943         (WebCore::Document::scheduleStyleRecalc):
944         * page/ios/ContentChangeObserver.cpp:
945         (WebCore::hasPendingStyleRecalc):
946         (WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
947         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
948         (WebCore::ContentChangeObserver::startObservingContentChanges):
949         (WebCore::ContentChangeObserver::didScheduleStyleRecalc): Deleted.
950         * page/ios/ContentChangeObserver.h:
951         (WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling): Deleted.
952         (WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling): Deleted.
953         (WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling const): Deleted.
954
955 2019-03-01  John Wilander  <wilander@apple.com>
956
957         Resource Load Statistics: Further restrict client-side cookie persistence after cross-site navigations with link decoration
958         https://bugs.webkit.org/show_bug.cgi?id=195196
959         <rdar://problem/48006419>
960
961         Reviewed by Brent Fulgham.
962
963         Tests: http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-decoration-same-site.html
964                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-fragment-from-prevalent-resource.html
965                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-and-fragment-from-prevalent-resource.html
966                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-from-prevalent-resource.html
967                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-without-link-decoration-from-prevalent-resource.html
968
969         Trackers abuse link query parameters to transport user identifiers cross-site.
970         This patch detects such navigations and applies further restrictions to
971         client-site cookies on the destination page.
972
973         * platform/network/NetworkStorageSession.cpp:
974         (WebCore::NetworkStorageSession::setAgeCapForClientSideCookies):
975             Now sets the regular 7-day cap and a reduced 1-day cap.
976         (WebCore::NetworkStorageSession::clearPageSpecificDataForResourceLoadStatistics):
977             Renamed NetworkStorageSession::removeStorageAccessForAllFramesOnPage() to
978             NetworkStorageSession::clearPageSpecificDataForResourceLoadStatistics since
979             it now clears out two types of page-specific data.
980         (WebCore::NetworkStorageSession::committedCrossSiteLoadWithLinkDecoration):
981             This function receives a cross-site navigation and checks if the originating
982             site is a prevalent resource. If so, it marks the page or stricter cookie
983             rules.
984         (WebCore::NetworkStorageSession::resetCrossSiteLoadsWithLinkDecorationForTesting):
985             Test infrastructure. This sets a state that overrides the regular per-page
986             clear of data. The reason is that the double clear was racy and caused test
987             failures.
988         (WebCore::NetworkStorageSession::clientSideCookieCap const):
989             New function that returns the current cookie lifetime cap.
990         (WebCore::NetworkStorageSession::removeStorageAccessForAllFramesOnPage): Deleted.
991             Renamed to NetworkStorageSession::clearPageSpecificDataForResourceLoadStatistics().
992         * platform/network/NetworkStorageSession.h:
993         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
994         (WebCore::NetworkStorageSession::setCookiesFromDOM const):
995             Now calls NetworkStorageSession::clientSideCookieCap() to set the cap.
996
997 2019-03-01  Rob Buis  <rbuis@igalia.com>
998
999         Adjust XMLHttpRequest Content-Type handling
1000         https://bugs.webkit.org/show_bug.cgi?id=184645
1001
1002         Reviewed by Youenn Fablet.
1003
1004         Implement steps 4.4.1.2 and 4.4.1.3 of send() [1].
1005
1006         Test: web-platform-tests/xhr/send-content-type-charset.htm
1007
1008         [1] https://xhr.spec.whatwg.org/#dom-xmlhttprequest-send
1009
1010         * platform/network/ParsedContentType.cpp:
1011         (WebCore::ParsedContentType::setCharset):
1012         * platform/network/ParsedContentType.h:
1013         * xml/XMLHttpRequest.cpp:
1014         (WebCore::replaceCharsetInMediaTypeIfNeeded):
1015         (WebCore::XMLHttpRequest::send):
1016         (WebCore::replaceCharsetInMediaType): Deleted.
1017
1018 2019-03-01  Youenn Fablet  <youenn@apple.com>
1019
1020         Update originsMatch to handle the case of file origins which enforce file path separation
1021         https://bugs.webkit.org/show_bug.cgi?id=195216
1022
1023         Reviewed by Brady Eidson.
1024
1025         Covered by the assertion and existing tests like fast/xmlhttprequest/xmlhttprequest-no-file-access.html.
1026         Make sure originsMatch returns true if either compared origins are the same object
1027         or they have the same file path separation behavior.
1028
1029         * page/SecurityOrigin.cpp:
1030         (WebCore::areOriginsMatching):
1031         (WebCore::originsMatch):
1032
1033 2019-03-01  Youenn Fablet  <youenn@apple.com>
1034
1035         Serialize IndexedDB::ObjectStoreOverwriteMode as an enum
1036         https://bugs.webkit.org/show_bug.cgi?id=195213
1037
1038         Reviewed by Alex Christensen.
1039
1040         Add traits to enable enum IPC encoding.
1041         No change of behavior.
1042
1043         * Modules/indexeddb/IndexedDB.h:
1044
1045 2019-03-01  Don Olmstead  <don.olmstead@sony.com>
1046
1047         [WinCairo] Enable service worker
1048         https://bugs.webkit.org/show_bug.cgi?id=188318
1049
1050         Reviewed by Youenn Fablet.
1051
1052         * WebCorePrefix.h:
1053         * testing/ServiceWorkerInternals.h:
1054         * workers/service/context/SWContextManager.cpp:
1055         (WebCore::SWContextManager::serviceWorkerFailedToTerminate):
1056         * workers/service/context/SWContextManager.h:
1057
1058 2019-03-01  Sihui Liu  <sihui_liu@apple.com>
1059
1060         Add a quirk for bostongloble.com and latimes.com
1061         https://bugs.webkit.org/show_bug.cgi?id=195155
1062
1063         Reviewed by Geoffrey Garen.
1064
1065         Covered by manual testing.
1066
1067         * Modules/webdatabase/DOMWindowWebDatabase.idl:
1068         * bindings/scripts/CodeGeneratorJS.pm:
1069         (GenerateRuntimeEnableConditionalString):
1070         * bindings/scripts/IDLAttributes.json:
1071         * bindings/scripts/preprocess-idls.pl:
1072         (GenerateConstructorAttributes):
1073         * page/Quirks.cpp:
1074         (WebCore::Quirks::hasWebSQLSupportQuirk const):
1075         * page/Quirks.h:
1076
1077 2019-03-01  Zalan Bujtas  <zalan@apple.com>
1078
1079         [ContentChangeObserver] Rename members and move implementation to header.
1080         https://bugs.webkit.org/show_bug.cgi?id=195198
1081         <rdar://problem/48499967>
1082
1083         Reviewed by Simon Fraser.
1084
1085         * page/ios/ContentChangeObserver.cpp:
1086         (WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
1087         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
1088         (WebCore::ContentChangeObserver::startObservingStyleRecalc):
1089         (WebCore::ContentChangeObserver::stopObservingStyleRecalc):
1090         (WebCore::ContentChangeObserver::startObservingContentChanges):
1091         (WebCore::ContentChangeObserver::stopObservingContentChanges):
1092         (WebCore::ContentChangeObserver::StyleRecalcScope::StyleRecalcScope):
1093         (WebCore::ContentChangeObserver::StyleRecalcScope::~StyleRecalcScope):
1094         (WebCore::ContentChangeObserver::startObservingStyleResolve): Deleted.
1095         (WebCore::ContentChangeObserver::stopObservingStyleResolve): Deleted.
1096         (WebCore::ContentChangeObserver::isObservingContentChanges): Deleted.
1097         (WebCore::ContentChangeObserver::startObservingDOMTimerScheduling): Deleted.
1098         (WebCore::ContentChangeObserver::stopObservingDOMTimerScheduling): Deleted.
1099         (WebCore::ContentChangeObserver::isObservingDOMTimerScheduling): Deleted.
1100         (WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling): Deleted.
1101         (WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling): Deleted.
1102         (WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling): Deleted.
1103         (WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc): Deleted.
1104         (WebCore::ContentChangeObserver::shouldObserveNextStyleRecalc): Deleted.
1105         (WebCore::ContentChangeObserver::countOfObservedDOMTimers): Deleted.
1106         (WebCore::ContentChangeObserver::clearObservedDOMTimers): Deleted.
1107         (WebCore::ContentChangeObserver::containsObservedDOMTimer): Deleted.
1108         * page/ios/ContentChangeObserver.h:
1109         (WebCore::ContentChangeObserver::startObservingDOMTimerScheduling):
1110         (WebCore::ContentChangeObserver::stopObservingDOMTimerScheduling):
1111         (WebCore::ContentChangeObserver::isObservingDOMTimerScheduling const):
1112         (WebCore::ContentChangeObserver::containsObservedDOMTimer const):
1113         (WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling):
1114         (WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling):
1115         (WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling const):
1116         (WebCore::ContentChangeObserver::setShouldObserveStyleRecalc):
1117         (WebCore::ContentChangeObserver::shouldObserveStyleRecalc const):
1118         (WebCore::ContentChangeObserver::isObservingContentChanges const):
1119         (WebCore::ContentChangeObserver::countOfObservedDOMTimers const):
1120         (WebCore::ContentChangeObserver::clearObservedDOMTimers):
1121
1122 2019-03-01  Zalan Bujtas  <zalan@apple.com>
1123
1124         [ContentChangeObserver] ContentChangeObserver::StyleChangeScope should not set WKContentVisibilityChange directly
1125         https://bugs.webkit.org/show_bug.cgi?id=195197
1126         <rdar://problem/48498332>
1127
1128         Reviewed by Simon Fraser.
1129
1130         Add didContentVisibilityChange to hide WKContentVisibilityChange value. We might also want to add some logic to didContentVisibilityChange at some point.
1131
1132         * page/ios/ContentChangeObserver.cpp:
1133         (WebCore::ContentChangeObserver::didContentVisibilityChange):
1134         (WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
1135         * page/ios/ContentChangeObserver.h:
1136
1137 2019-03-01  Jer Noble  <jer.noble@apple.com>
1138
1139         [EME] Make sure the hasSessionSemaphore is set even if HAVE(AVSTREAMSESSION) is false
1140         https://bugs.webkit.org/show_bug.cgi?id=195217
1141
1142         Reviewed by Eric Carlson.
1143
1144         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1145         (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
1146
1147 2019-03-01  Justin Fan  <justin_fan@apple.com>
1148
1149         [Web GPU] 32-bit builds broken by attempt to disable WebGPU on 32-bit
1150         https://bugs.webkit.org/show_bug.cgi?id=195191
1151
1152         Rubber-stamped by Dean Jackson.
1153
1154         Dropping support for 32-bit entirely, so I'm intentionally leaving 32-bit broken.
1155
1156         * Configurations/FeatureDefines.xcconfig:
1157
1158 2019-02-28  Fujii Hironori  <Hironori.Fujii@sony.com>
1159
1160         HTTPSUpgradeList.db database should be opened in readonly mode
1161         https://bugs.webkit.org/show_bug.cgi?id=195194
1162         <rdar://problem/47103889>
1163
1164         Unreviewed build fix for curl.
1165
1166         * platform/network/curl/CookieJarDB.cpp:
1167         (WebCore::CookieJarDB::openDatabase): Removed the second arguemnt of SQLiteDatabase::open.
1168
1169 2019-02-28  Chris Dumez  <cdumez@apple.com>
1170
1171         Unreviewed Windows build fix after r242251.
1172
1173         * platform/win/SearchPopupMenuDB.cpp:
1174         (WebCore::SearchPopupMenuDB::openDatabase):
1175
1176 2019-02-28  Zalan Bujtas  <zalan@apple.com>
1177
1178         [ContentChangeObserver] Move timer removal code from DOMWindow::clearTimeout to DOMTimer::removeById
1179         https://bugs.webkit.org/show_bug.cgi?id=195143
1180         <rdar://problem/48462351>
1181
1182         Reviewed by Simon Fraser.
1183
1184         Currently DOMWindow::clearTimeout() is the only callsite that we are interested in, but this is more future-proof.
1185
1186         * page/DOMTimer.cpp:
1187         (WebCore::DOMTimer::removeById):
1188         * page/DOMWindow.cpp:
1189         (WebCore::DOMWindow::clearTimeout):
1190         * page/ios/ContentChangeObserver.cpp:
1191         (WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
1192         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
1193         (WebCore::ContentChangeObserver::didRemoveDOMTimer):
1194         (WebCore::ContentChangeObserver::removeDOMTimer): Deleted.
1195         * page/ios/ContentChangeObserver.h:
1196
1197 2019-02-28  Chris Dumez  <cdumez@apple.com>
1198
1199         HTTPSUpgradeList.db database should be opened in readonly mode
1200         https://bugs.webkit.org/show_bug.cgi?id=195194
1201         <rdar://problem/47103889>
1202
1203         Reviewed by Youenn Fablet.
1204
1205         Add parameter to SQLiteDatabase::open() to specific the open flags.
1206
1207         * Modules/webdatabase/Database.cpp:
1208         (WebCore::Database::performOpenAndVerify):
1209         * platform/sql/SQLiteDatabase.cpp:
1210         (WebCore::SQLiteDatabase::open):
1211         * platform/sql/SQLiteDatabase.h:
1212         * platform/sql/SQLiteFileSystem.cpp:
1213         * platform/sql/SQLiteFileSystem.h:
1214
1215 2019-02-28  Brady Eidson  <beidson@apple.com>
1216
1217         Followup to:
1218         Universal links from Google search results pages don't open the app
1219         https://bugs.webkit.org/show_bug.cgi?id=195126
1220
1221         Unreviewed.
1222
1223         * page/SecurityOrigin.cpp:
1224         (WebCore::originsMatch): Remove a bogus assertion (reasoning in bugzilla)
1225
1226 2019-02-28  Simon Fraser  <simon.fraser@apple.com>
1227
1228         [iOS] Dark flash when opening Google AMP pages
1229         https://bugs.webkit.org/show_bug.cgi?id=195193
1230         rdar://problem/48326442
1231
1232         Reviewed by Zalan Bujtas.
1233
1234         After the incremental compositing updates changes, it was possible for a change in the size
1235         of an overflow:hidden element to fail to update the "ancestor clipping layer" geometry on
1236         a composited descendant that is not a descendant in z-order. When Google search results
1237         create the <iframe> that contain AMP contents, we'd fail to update a zero-sized clipping layer,
1238         leaving the #222 background of an intermediate element visible.
1239
1240         Fix by setting a flag in RenderLayer::updateLayerPosition() (which is called in containing block order)
1241         that sets the "needs geometry update" dirty bit on containing-block-descendant layers. Currently
1242         this flag affects all descendants; in future, we might be able to clear it for grand-children.
1243
1244         Tests: compositing/geometry/ancestor-clip-change-interleaved-stacking-context.html
1245                compositing/geometry/ancestor-clip-change.html
1246
1247         * rendering/RenderLayer.cpp:
1248         (WebCore::RenderLayer::updateLayerPositions):
1249         (WebCore::RenderLayer::updateLayerPosition):
1250         * rendering/RenderLayer.h:
1251         * rendering/RenderLayerBacking.cpp:
1252         (WebCore::RenderLayerBacking::updateAfterLayout):
1253         * rendering/RenderLayerBacking.h:
1254
1255 2019-02-28  Myles C. Maxfield  <mmaxfield@apple.com>
1256
1257         Use-after-move in RenderCombineText::combineTextIfNeeded()
1258         https://bugs.webkit.org/show_bug.cgi?id=195188
1259
1260         Reviewed by Zalan Bujtas.
1261
1262         r241288 uncovered an existing problem with our text-combine code. r242204 alleviated the
1263         symptom, but this patch fixes the source of the problem (and reverts r242204).
1264
1265         The code in RenderCombineText::combineTextIfNeeded() has a bit that’s like:
1266
1267         FontDescription bestFitDescription;
1268         while (...) {
1269             FontCascade compressedFont(WTFMove(bestFitDescription), ...);
1270             ...
1271         }
1272
1273         Clearly this is wrong.
1274
1275         Test: fast/text/text-combine-crash-2.html
1276
1277         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
1278         (WebCore::FontDescription::platformResolveGenericFamily):
1279         * rendering/RenderCombineText.cpp:
1280         (WebCore::RenderCombineText::combineTextIfNeeded):
1281
1282 2019-02-28  Zalan Bujtas  <zalan@apple.com>
1283
1284         [ContentChangeObserver] Introduce observer subclasses to scope content change observing.
1285         https://bugs.webkit.org/show_bug.cgi?id=195172
1286         <rdar://problem/48479259>
1287
1288         Reviewed by Simon Fraser.
1289
1290         Let's scope start/stopObserving call pairs.
1291
1292         * dom/Document.cpp:
1293         (WebCore::Document::updateStyleIfNeeded):
1294         * page/DOMTimer.cpp:
1295         (WebCore::DOMTimer::fired):
1296         * page/ios/ContentChangeObserver.cpp:
1297         (WebCore::ContentChangeObserver::StyleChangeObserver::StyleChangeObserver):
1298         (WebCore::ContentChangeObserver::StyleChangeObserver::~StyleChangeObserver):
1299         (WebCore::ContentChangeObserver::StyleRecalcObserver::StyleRecalcObserver):
1300         (WebCore::ContentChangeObserver::StyleRecalcObserver::~StyleRecalcObserver):
1301         (WebCore::ContentChangeObserver::DOMTimerObserver::DOMTimerObserver):
1302         (WebCore::ContentChangeObserver::DOMTimerObserver::~DOMTimerObserver):
1303         (WebCore::ContentChangeObserver::StyleChange::StyleChange): Deleted.
1304         (WebCore::ContentChangeObserver::StyleChange::~StyleChange): Deleted.
1305         * page/ios/ContentChangeObserver.h:
1306         * rendering/updating/RenderTreeUpdater.cpp:
1307         (WebCore::RenderTreeUpdater::updateElementRenderer):
1308
1309 2019-02-28  Antoine Quint  <graouts@apple.com>
1310
1311         Enable the Pointer Events runtime flag by default
1312         https://bugs.webkit.org/show_bug.cgi?id=195156
1313
1314         Reviewed by Dean Jackson.
1315
1316         * page/RuntimeEnabledFeatures.h:
1317
1318 2019-02-28  Zalan Bujtas  <zalan@apple.com>
1319
1320         [ContentChangeObserver] Make observed state reset explicit.
1321         https://bugs.webkit.org/show_bug.cgi?id=195185
1322         <rdar://problem/48488342>
1323
1324         Reviewed by Simon Fraser.
1325
1326         Use setObservedContentChange only for setting the observed change while observing.
1327
1328         * page/ios/ContentChangeObserver.cpp:
1329         (WebCore::ContentChangeObserver::startObservingContentChanges):
1330         (WebCore::ContentChangeObserver::resetObservedContentChange):
1331         (WebCore::ContentChangeObserver::removeObservedDOMTimer):
1332         * page/ios/ContentChangeObserver.h:
1333
1334 2019-02-28  Commit Queue  <commit-queue@webkit.org>
1335
1336         Unreviewed, rolling out r242210.
1337         https://bugs.webkit.org/show_bug.cgi?id=195179
1338
1339         it broke hover menus on losaltosonline.com (Requested by zalan
1340         on #webkit).
1341
1342         Reverted changeset:
1343
1344         "[ContentChangeObserver] Move timer removal code from
1345         DOMWindow::clearTimeout to DOMTimer::removeById"
1346         https://bugs.webkit.org/show_bug.cgi?id=195143
1347         https://trac.webkit.org/changeset/242210
1348
1349 2019-02-28  Zalan Bujtas  <zalan@apple.com>
1350
1351         [ContentChangeObserver] Move timer removal code from DOMWindow::clearTimeout to DOMTimer::removeById
1352         https://bugs.webkit.org/show_bug.cgi?id=195143
1353         <rdar://problem/48462351>
1354
1355         Reviewed by Simon Fraser.
1356
1357         Currently DOMWindow::clearTimeout() is the only callsite that we are interested in, but this is more future-proof.
1358
1359         * page/DOMTimer.cpp:
1360         (WebCore::DOMTimer::removeById):
1361         * page/DOMWindow.cpp:
1362         (WebCore::DOMWindow::clearTimeout):
1363         * page/ios/ContentChangeObserver.cpp:
1364         (WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
1365         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
1366         (WebCore::ContentChangeObserver::didRemoveDOMTimer):
1367         (WebCore::ContentChangeObserver::removeDOMTimer): Deleted.
1368         * page/ios/ContentChangeObserver.h:
1369
1370 2019-02-28  Charles Vazac  <cvazac@akamai.com>
1371
1372         Fix Resource Timing buffer edge cases for WPT
1373         https://bugs.webkit.org/show_bug.cgi?id=193213
1374
1375         Reviewed by Youenn Fablet.
1376
1377         Test coverage by LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer*.html
1378
1379         * page/Performance.cpp:
1380         (WebCore::Performance::resourceTimingBufferFullTimerFired): Only dispatch the
1381         resourcetimingbufferfull event if the buffer is still full (as it may have been cleared or
1382         expanded). Also, avoid infinite loops if we aren't able to decrease the number of entries in
1383         the secondary buffer.
1384
1385 2019-02-28  Takashi Komori  <Takashi.Komori@sony.com>
1386
1387         [Curl] HTTP Body is missing with redirection.
1388         https://bugs.webkit.org/show_bug.cgi?id=191651
1389
1390         Reviewed by Don Olmstead.
1391
1392         Implement updateFromDelegatePreservingOldProperties for curl port.
1393
1394         Tests: http/tests/navigation/post-301-response.html
1395                http/tests/navigation/post-302-response.html
1396                http/tests/navigation/post-303-response.html
1397                http/tests/navigation/post-307-response.html
1398                http/tests/navigation/post-308-response.html
1399
1400         * platform/Curl.cmake:
1401         * platform/network/curl/ResourceRequest.h:
1402         (WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties): Deleted.
1403         * platform/network/curl/ResourceRequestCurl.cpp: Added.
1404         (WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties):
1405
1406 2019-02-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1407
1408         [CoordinatedGraphics] Remove COORDINATED_GRAPHICS_THREADED option
1409         https://bugs.webkit.org/show_bug.cgi?id=195159
1410
1411         Reviewed by Don Olmstead.
1412
1413         Use COORDINATED_GRAPHICS instead.
1414
1415         * platform/graphics/GraphicsContext3D.h:
1416         * platform/graphics/PlatformLayer.h:
1417         * platform/graphics/cairo/ImageBufferCairo.cpp:
1418         (WebCore::ImageBufferData::ImageBufferData):
1419         (WebCore::ImageBufferData::~ImageBufferData):
1420         * platform/graphics/cairo/ImageBufferDataCairo.h:
1421         * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.cpp:
1422         * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.h:
1423         * platform/graphics/nicosia/texmap/NicosiaGC3DLayer.cpp:
1424         (Nicosia::GC3DLayer::swapBuffersIfNeeded):
1425         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
1426         (WebCore::GraphicsContext3D::reshapeFBOs):
1427         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1428         (WebCore::GraphicsContext3D::prepareTexture):
1429         * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
1430         (WebCore::GraphicsContext3D::reshapeFBOs):
1431         * platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp:
1432         (WebCore::GraphicsContext3D::GraphicsContext3D):
1433         (WebCore::GraphicsContext3D::~GraphicsContext3D):
1434         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp:
1435         (WebCore::TextureMapperGC3DPlatformLayer::TextureMapperGC3DPlatformLayer):
1436         (WebCore::TextureMapperGC3DPlatformLayer::~TextureMapperGC3DPlatformLayer):
1437         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h:
1438         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
1439         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
1440         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
1441         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
1442         * platform/graphics/texmap/TextureMapperPlatformLayerProxyProvider.h:
1443         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1444         (WebCore::CoordinatedGraphicsLayer::setContentsNeedsDisplay):
1445         (WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer):
1446         (WebCore::CoordinatedGraphicsLayer::updatePlatformLayer):
1447         * rendering/RenderLayerBacking.cpp:
1448         (WebCore::RenderLayerBacking::paintsIntoWindow const):
1449         * rendering/RenderLayerCompositor.cpp:
1450         (WebCore::RenderLayerCompositor::shouldCompositeOverflowControls const):
1451
1452 2019-02-28  Myles C. Maxfield  <mmaxfield@apple.com>
1453
1454         Locale names can be nullptr
1455         https://bugs.webkit.org/show_bug.cgi?id=195171
1456         <rdar://problem/48262376>
1457
1458         Reviewed by Dean Jackson.
1459
1460         Nullptr can't be used in keys to HashMaps, so take an early out in this case.
1461
1462         This is a partial revert of r241288.
1463
1464         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
1465         (WebCore::FontDescription::platformResolveGenericFamily):
1466
1467 2019-02-28  Justin Fan  <justin_fan@apple.com>
1468
1469         [Web GPU] Enable Web GPU only on 64-bit
1470         https://bugs.webkit.org/show_bug.cgi?id=195139
1471
1472         Because Metal is only supported on 64 bit apps.
1473
1474         Unreviewed build fix.
1475
1476         * Configurations/FeatureDefines.xcconfig:
1477
1478 2019-02-27  Zalan Bujtas  <zalan@apple.com>
1479
1480         [ContentChangeObserver] Move WKSetObservedContentChange logic to ContentChangeObserver class.
1481         https://bugs.webkit.org/show_bug.cgi?id=195128
1482         <rdar://problem/48456752>
1483
1484         Reviewed by Simon Fraser.
1485
1486         Move the final bits over to ContentChangeObserver and delete WKContentObservationInternal.h.
1487
1488         * WebCore.xcodeproj/project.pbxproj:
1489         * page/ios/ContentChangeObserver.mm:
1490         (WebCore::ContentChangeObserver::setObservedContentChange):
1491         * platform/ios/wak/WKContentObservation.cpp:
1492         (WKSetObservedContentChange):
1493         * platform/ios/wak/WKContentObservation.h:
1494         * platform/ios/wak/WKContentObservationInternal.h: Removed.
1495
1496 2019-02-27  Simon Fraser  <simon.fraser@apple.com>
1497
1498         Roll out r242014; it caused crashes in compositing logging (webkit.org/b/195141)
1499
1500         * dom/Document.cpp:
1501         (WebCore::Document::lastModified const):
1502         * html/FTPDirectoryDocument.cpp:
1503         (WebCore::processFileDateString):
1504         * mathml/MathMLElement.cpp:
1505         (WebCore::convertToPercentageIfNeeded):
1506         (WebCore::MathMLElement::collectStyleForPresentationAttribute):
1507         * page/cocoa/ResourceUsageOverlayCocoa.mm:
1508         (WebCore::ResourceUsageOverlay::platformDraw):
1509         * page/linux/ResourceUsageOverlayLinux.cpp:
1510         (WebCore::cpuUsageString):
1511         (WebCore::gcTimerString):
1512         * platform/DateComponents.cpp:
1513         (WebCore::DateComponents::toStringForTime const):
1514         (WebCore::DateComponents::toString const):
1515         * platform/LocalizedStrings.cpp:
1516         (WebCore::localizedString):
1517         * platform/audio/HRTFElevation.cpp:
1518         (WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
1519         * platform/mock/MockRealtimeVideoSource.cpp:
1520         (WebCore::MockRealtimeVideoSource::drawText):
1521         * rendering/RenderLayerCompositor.cpp:
1522         (WebCore::RenderLayerCompositor::logLayerInfo):
1523         * rendering/RenderTheme.cpp:
1524         (WebCore::RenderTheme::formatMediaControlsTime const):
1525
1526 2019-02-27  Zalan Bujtas  <zalan@apple.com>
1527
1528         [ContentChangeObserver] Move _WKObservingContentChanges from global to ContentChangeObserver class
1529         https://bugs.webkit.org/show_bug.cgi?id=195091
1530         <rdar://problem/48427271>
1531
1532         Reviewed by Tim Horton.
1533
1534         * page/ios/ContentChangeObserver.h:
1535         * page/ios/ContentChangeObserver.mm:
1536         (WebCore::ContentChangeObserver::startObservingContentChanges):
1537         (WebCore::ContentChangeObserver::stopObservingContentChanges):
1538         (WebCore::ContentChangeObserver::isObservingContentChanges):
1539         * platform/ios/wak/WKContentObservation.cpp:
1540         (WKObservingContentChanges): Deleted.
1541         (WKStartObservingContentChanges): Deleted.
1542         (WKStopObservingContentChanges): Deleted.
1543         * platform/ios/wak/WKContentObservation.h:
1544         * platform/ios/wak/WKContentObservationInternal.h:
1545
1546 2019-02-27  Brady Eidson  <beidson@apple.com>
1547
1548         Universal links from Google search results pages don't open the app.
1549         <rdar://problem/46887179> and https://bugs.webkit.org/show_bug.cgi?id=195126
1550
1551         Reviewed by Geoffrey Garen.
1552
1553         Covered by new API tests.
1554
1555         * loader/DocumentLoader.cpp:
1556         (WebCore::DocumentLoader::shouldOpenExternalURLsPolicyToPropagate const): Propagate the external URL policy from
1557           an iframe if it is from the same security origin as the main frame.
1558
1559 2019-02-27  Zalan Bujtas  <zalan@apple.com>
1560
1561         [ContentChangeObserver] Move DOMTimer schedule handling from global to ContentChangeObserver class
1562         https://bugs.webkit.org/show_bug.cgi?id=195090
1563         <rdar://problem/48426771>
1564
1565         Reviewed by Tim Horton.
1566
1567         Also remove some unused functions from WKContentObservationInternal.
1568
1569         * page/ios/ContentChangeObserver.h:
1570         * page/ios/ContentChangeObserver.mm:
1571         (WebCore::ContentChangeObserver::startObservingDOMTimerScheduling):
1572         (WebCore::ContentChangeObserver::stopObservingDOMTimerScheduling):
1573         (WebCore::ContentChangeObserver::isObservingDOMTimerScheduling):
1574         * platform/ios/wak/WKContentObservation.cpp:
1575         (WKStartObservingDOMTimerScheduling): Deleted.
1576         (WKStopObservingDOMTimerScheduling): Deleted.
1577         (WKIsObservingDOMTimerScheduling): Deleted.
1578         * platform/ios/wak/WKContentObservation.h:
1579         * platform/ios/wak/WKContentObservationInternal.h:
1580
1581 2019-02-27  Zalan Bujtas  <zalan@apple.com>
1582
1583         [ContentChangeObserver] Move style recalc handling from global to ContentChangeObserver class
1584         https://bugs.webkit.org/show_bug.cgi?id=195087
1585
1586         Reviewed by Simon Fraser.
1587
1588         Add m_observingNextStyleRecalc/m_observingStyleRecalcScheduling to ContentChangeObserver and move the related code over from WK functions.
1589
1590         * page/ios/ContentChangeObserver.h:
1591         * page/ios/ContentChangeObserver.mm:
1592         (WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling):
1593         (WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling):
1594         (WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling):
1595         (WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc):
1596         (WebCore::ContentChangeObserver::shouldObserveNextStyleRecalc):
1597         (WebCore::ContentChangeObserver::setObservedContentChange):
1598         * platform/ios/wak/WKContentObservation.cpp:
1599         (WKSetObservedContentChange):
1600         (WKStartObservingStyleRecalcScheduling): Deleted.
1601         (WKStopObservingStyleRecalcScheduling): Deleted.
1602         (WKIsObservingStyleRecalcScheduling): Deleted.
1603         (WKSetShouldObserveNextStyleRecalc): Deleted.
1604         (WKShouldObserveNextStyleRecalc): Deleted.
1605         * platform/ios/wak/WKContentObservation.h:
1606
1607 2019-02-27  Zalan Bujtas  <zalan@apple.com>
1608
1609         [ContentChangeObserver] Move DOM timer handling from global to ContentChangeObserver class
1610         https://bugs.webkit.org/show_bug.cgi?id=195070
1611         <rdar://problem/48417650>
1612
1613         Reviewed by Tim Horton.
1614
1615         Add DOM timer list to ContentChangeObserver and move the related code over from WK functions.
1616
1617         * page/ios/ContentChangeObserver.h:
1618         * page/ios/ContentChangeObserver.mm:
1619         (WebCore::ContentChangeObserver::startObservingDOMTimerScheduling):
1620         (WebCore::ContentChangeObserver::countOfObservedDOMTimers):
1621         (WebCore::ContentChangeObserver::clearObservedDOMTimers):
1622         (WebCore::ContentChangeObserver::setObservedContentChange):
1623         (WebCore::ContentChangeObserver::containsObservedDOMTimer):
1624         (WebCore::ContentChangeObserver::addObservedDOMTimer):
1625         (WebCore::ContentChangeObserver::removeObservedDOMTimer):
1626         * platform/ios/wak/WKContentObservation.cpp:
1627         (WKStartObservingDOMTimerScheduling):
1628         (WKSetObservedContentChange):
1629         (WebThreadGetObservedDOMTimers): Deleted.
1630         (WebThreadCountOfObservedDOMTimers): Deleted.
1631         (WebThreadClearObservedDOMTimers): Deleted.
1632         (WebThreadContainsObservedDOMTimer): Deleted.
1633         (WebThreadAddObservedDOMTimer): Deleted.
1634         (WebThreadRemoveObservedDOMTimer): Deleted.
1635         * platform/ios/wak/WKContentObservation.h:
1636
1637 2019-02-27  Justin Fan  <justin_fan@apple.com>
1638         Fix build errors after Web GPU buffer updates changed some IDL fields from unsigned long to unsigned long long.
1639
1640         Unreviewed build fix.
1641
1642         * Modules/webgpu/WebGPUBuffer.cpp:
1643         (WebCore::WebGPUBuffer::setSubData):
1644         * Modules/webgpu/WebGPUBuffer.h:
1645         * Modules/webgpu/WebGPUBufferBinding.h:
1646         * Modules/webgpu/WebGPURenderPassEncoder.idl:
1647         * platform/graphics/gpu/GPUBufferBinding.h:
1648         * platform/graphics/gpu/GPUVertexAttributeDescriptor.h:
1649         * platform/graphics/gpu/GPUVertexInputDescriptor.h:
1650
1651 2019-02-27  John Wilander  <wilander@apple.com>
1652
1653         Adopt WebCore::RegistrableDomain in WebCore::ResourceLoadStatistics and WebKit::NetworkProcessProxy
1654         https://bugs.webkit.org/show_bug.cgi?id=195071
1655         <rdar://problem/48417690>
1656
1657         Reviewed by Alex Christensen and Brent Fulgham.
1658
1659         No new tests. This patch maintains functionality covered by plenty of layout
1660         tests under http/tests/resourceLoadStatistics/ and http/tests/storageAccess.
1661
1662         This patch adopts WebCore::RegistrableDomain in WebCore::ResourceLoadStatistics
1663         and makes the necessary infrastructure changes to support that.
1664
1665         The previous HashCountedSets in WebCore::ResourceLoadStatistics are now just
1666         HashSets since we never used the counts for anything. This change simplified
1667         encoding and decoding for IPC and will eventually simplify encoding and
1668         decoding in loader/ResourceLoadStatistics.cpp when we obsolete statistics
1669         model version 14 and below.
1670
1671         The patch also makes WebCore::RegistrableDomain's String constructor private.
1672         A new create function WebCore::RegistrableDomain::uncheckedCreateFromString()
1673         is introduced to better signal to users that creating a registrable domain
1674         object with a string may create an object that doesn't match a registrable
1675         domain in a valid HTTP-family URL. This change (private String constructor)
1676         motivated a change in WebCore::AdClickAttribution where the Source and
1677         Destination structs now take a URL as parameter instead of a String.
1678
1679         Finally, this patch harmonizes parameter and variable naming, going from
1680         "origin" to "domain" and "mainFrame" to "topFrame."
1681
1682         * html/HTMLAnchorElement.cpp:
1683         (WebCore::HTMLAnchorElement::parseAdClickAttribution const):
1684         * html/HTMLMediaElement.cpp:
1685         (WebCore::HTMLMediaElement::mediaSessionTitle const):
1686         * loader/AdClickAttribution.h:
1687         (WebCore::AdClickAttribution::Source::Source):
1688         (WebCore::AdClickAttribution::Source::deletedValue):
1689         (WebCore::AdClickAttribution::Destination::Destination):
1690         (WebCore::AdClickAttribution::Destination::deletedValue):
1691         (WebCore::AdClickAttribution::decode):
1692         * loader/ResourceLoadObserver.cpp:
1693         (WebCore::ResourceLoadObserver::logSubresourceLoading):
1694         (WebCore::ResourceLoadObserver::logWebSocketLoading):
1695         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
1696         (WebCore::ResourceLoadObserver::statisticsForURL):
1697         (WebCore::ResourceLoadObserver::statisticsForOrigin): Deleted.
1698         * loader/ResourceLoadObserver.h:
1699         * loader/ResourceLoadStatistics.cpp:
1700         (WebCore::encodeHashSet):
1701         (WebCore::ResourceLoadStatistics::encode const):
1702         (WebCore::decodeHashCountedSet):
1703         (WebCore::decodeHashSet):
1704         (WebCore::ResourceLoadStatistics::decode):
1705         (WebCore::appendHashSet):
1706         (WebCore::ResourceLoadStatistics::toString const):
1707         (WebCore::ResourceLoadStatistics::merge):
1708         (WebCore::encodeHashCountedSet): Deleted.
1709         (WebCore::encodeOriginHashSet): Deleted.
1710         (WebCore::decodeOriginHashSet): Deleted.
1711         (WebCore::appendHashCountedSet): Deleted.
1712         * loader/ResourceLoadStatistics.h:
1713         * platform/RegistrableDomain.h:
1714         (WebCore::RegistrableDomain::uncheckedCreateFromString):
1715         (WebCore::RegistrableDomain::RegistrableDomain):
1716         * testing/Internals.cpp:
1717         (WebCore::Internals::resourceLoadStatisticsForURL):
1718         (WebCore::Internals::resourceLoadStatisticsForOrigin): Deleted.
1719         * testing/Internals.h:
1720         * testing/Internals.idl:
1721
1722 2019-02-27  Justin Fan  <justin_fan@apple.com>
1723
1724         [Web GPU] Buffer updates part 2: setSubData, GPU/CPU synchronization
1725         https://bugs.webkit.org/show_bug.cgi?id=195077
1726         <rdar://problem/47805229>
1727
1728         Reviewed by Dean Jackson.
1729
1730         Implement GPUBuffer.setSubData and prevent the resolving of mapping promises if the buffer is scheduled to be 
1731         used on the GPU, and add handlers to resolve such promises after command buffer execution completes. In addition,
1732         update buffer sizes to u64 (unsigned long in C++) as per the updated Web GPU API.
1733
1734         Tests: webgpu/buffer-command-buffer-races.html
1735                webgpu/map-read-buffers.html
1736
1737         * Modules/webgpu/WebGPUBindGroup.h:
1738         (WebCore::WebGPUBindGroup::bindGroup const):
1739         * Modules/webgpu/WebGPUBindGroupDescriptor.cpp:
1740         (WebCore::WebGPUBindGroupDescriptor::asGPUBindGroupDescriptor const): Rename binding -> bufferBinding to reduce confusion.
1741         * Modules/webgpu/WebGPUBuffer.cpp: Small tweaks.
1742         (WebCore::WebGPUBuffer::setSubData):
1743         (WebCore::WebGPUBuffer::unmap): Correctly fail if buffer is destroyed.
1744         (WebCore::WebGPUBuffer::destroy):
1745         (WebCore::WebGPUBuffer::rejectOrRegisterPromiseCallback):
1746         * Modules/webgpu/WebGPUBuffer.h:
1747         (WebCore::WebGPUBuffer::buffer const): Returned buffer is no longer const so that it can be used in completed handler callbacks.
1748         * Modules/webgpu/WebGPUBuffer.idl: Enable setSubData.
1749         * Modules/webgpu/WebGPUCommandBuffer.cpp:
1750         (WebCore::WebGPUCommandBuffer::beginRenderPass):
1751         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
1752         (WebCore::WebGPUProgrammablePassEncoder::setBindGroup const):
1753         * Modules/webgpu/WebGPUProgrammablePassEncoder.h:
1754         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
1755         (WebCore::WebGPURenderPassEncoder::setVertexBuffers):
1756         * Sources.txt:
1757         * WebCore.xcodeproj/project.pbxproj:
1758         * platform/graphics/gpu/GPUBuffer.h:
1759         (WebCore::GPUBuffer::isTransferDst const): Added various state and flag getters.
1760         (WebCore::GPUBuffer::isVertex const):
1761         (WebCore::GPUBuffer::isUniform const):
1762         (WebCore::GPUBuffer::isStorage const):
1763         (WebCore::GPUBuffer::isReadOnly const):
1764         (WebCore::GPUBuffer::isMappable const):
1765         (WebCore::GPUBuffer::isMapWrite const):
1766         (WebCore::GPUBuffer::isMapRead const):
1767         (WebCore::GPUBuffer::isMapWriteable const):
1768         (WebCore::GPUBuffer::isMapReadable const):
1769         * platform/graphics/gpu/GPUBufferBinding.h:
1770         * platform/graphics/gpu/GPUCommandBuffer.h:
1771         (WebCore::GPUCommandBuffer::usedBuffers const):
1772         (WebCore::GPUCommandBuffer::useBuffer):
1773         * platform/graphics/gpu/GPUDevice.cpp:
1774         (WebCore::GPUDevice::tryCreateBuffer): Pass Ref of itself for Buffer to request the Queue later, if needed.
1775         (WebCore::GPUDevice::tryCreateBuffer const): Deleted.
1776         * platform/graphics/gpu/GPUDevice.h:
1777         * platform/graphics/gpu/GPUProgrammablePassEncoder.cpp: Retain the encoder's commandBuffer to reference its used resource buffers.
1778         (WebCore::GPUProgrammablePassEncoder::GPUProgrammablePassEncoder):
1779         * platform/graphics/gpu/GPUProgrammablePassEncoder.h:
1780         (WebCore::GPUProgrammablePassEncoder::commandBuffer const):
1781         * platform/graphics/gpu/GPURenderPassEncoder.h:
1782         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
1783         (WebCore::GPUBuffer::validateBufferCreate): Move validation out of tryCreate.
1784         (WebCore::GPUBuffer::tryCreate): Create both shared and private buffers, depending on usage.
1785         (WebCore::GPUBuffer::GPUBuffer):
1786         (WebCore::GPUBuffer::~GPUBuffer): Call destroy instead of just unmap.
1787         (WebCore::GPUBuffer::state const):
1788         (WebCore::GPUBuffer::setSubData): Uses a cached collection of staging MTLBuffers to encode data copies to the implementation MTLBuffer.
1789         (WebCore::GPUBuffer::commandBufferCommitted): Register on the GPUBuffer that the provided MTLCommandBuffer uses it, and is about to be committed.
1790         (WebCore::GPUBuffer::commandBufferCompleted): MTLCommandBuffer's onCompletedHandler calls this.
1791         (WebCore::GPUBuffer::reuseSubDataBuffer): SetSubData's blit command buffers call this to return a staging buffer to the pool.
1792         (WebCore::GPUBuffer::registerMappingCallback):
1793         (WebCore::GPUBuffer::runMappingCallback):
1794         (WebCore::GPUBuffer::unmap):
1795         (WebCore::GPUBuffer::destroy):
1796         (WebCore::GPUBuffer::tryCreateSharedBuffer): Deleted.
1797         * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
1798         (WebCore::GPUProgrammablePassEncoder::setResourceAsBufferOnEncoder):
1799         (WebCore::GPUProgrammablePassEncoder::setBindGroup):
1800         * platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
1801         (WebCore::GPUQueue::submit): Ensure submitted buffers are in the correct state, and add completed handlers for synchronization.
1802         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
1803         (WebCore::GPURenderPassEncoder::tryCreate):
1804         (WebCore::GPURenderPassEncoder::GPURenderPassEncoder): Retain the commandBuffer for later reference.
1805         (WebCore::GPURenderPassEncoder::setVertexBuffers): Mark vertex buffers as used before submission.
1806         (WebCore::GPURenderPassEncoder::create): Deleted.
1807
1808         Buffer size updates in the IDL:
1809         * Modules/webgpu/GPUBufferDescriptor.idl:
1810         * Modules/webgpu/WebGPUBuffer.idl:
1811         * Modules/webgpu/WebGPUBufferBinding.idl:
1812         * Modules/webgpu/WebGPUCommandBuffer.idl:
1813         * Modules/webgpu/WebGPURenderPassEncoder.idl:
1814         * Modules/webgpu/WebGPUVertexAttributeDescriptor.idl:
1815         * Modules/webgpu/WebGPUVertexInputDescriptor.idl:
1816
1817 2019-02-27  Youenn Fablet  <youenn@apple.com>
1818
1819         Remove LeetCode FetchRequest quirk
1820         https://bugs.webkit.org/show_bug.cgi?id=195100
1821
1822         Reviewed by Alex Christensen.
1823
1824         Covered by manual testing.
1825
1826         * Modules/fetch/FetchRequest.cpp:
1827         (WebCore::needsSignalQuirk):
1828
1829 2019-02-27  Chris Dumez  <cdumez@apple.com>
1830
1831         Unable to log into chase.com on iPad when DeviceMotionEvent API is disabled
1832         https://bugs.webkit.org/show_bug.cgi?id=195101
1833         <rdar://problem/48423023>
1834
1835         Reviewed by Geoffrey Garen.
1836
1837         Add site-specific quirk for chase.com on iOS where we fire a dummy DeviceMotionEvent if the page
1838         tries to register a "devicemotion" event listener and fails because the API is disabled. This is
1839         needed to unblock the site and proceed with the login flow.
1840
1841         Unfortunately, document()->settings().needsSiteSpecificQuirks() is false on iOS so I could not
1842         guard the quirk behind this flag.
1843
1844         * page/DOMWindow.cpp:
1845         (WebCore::DOMWindow::addEventListener):
1846         (WebCore::DOMWindow::failedToRegisterDeviceMotionEventListener):
1847         * page/DOMWindow.h:
1848
1849 2019-02-27  Antoine Quint  <graouts@apple.com>
1850
1851         Support Pointer Events on macOS
1852         https://bugs.webkit.org/show_bug.cgi?id=195008
1853         <rdar://problem/47454419>
1854
1855         Reviewed by Dean Jackson.
1856
1857         We now dispatch relevant pointer events as we prepare to dispatch mouse events. In most cases, this means we dispatch
1858         a pointer event of the same type, with "mouse" being substituted by "pointer", and with the same properties with the
1859         exception that if preventDefault() is called for a "pointerdown" event, the matching "mousedown" will not be dispatched,
1860         and the same behavior also extends to "pointerup".
1861
1862         Tests: pointerevents/mouse/over-enter-out-leave.html
1863                pointerevents/mouse/pointer-capture.html
1864                pointerevents/mouse/pointer-event-basic-properties.html
1865                pointerevents/mouse/pointer-events-before-mouse-events.html
1866                pointerevents/mouse/pointerdown-prevent-default.html
1867
1868         * Configurations/FeatureDefines.xcconfig:
1869         * dom/Document.cpp: All of the touch-action related members and functions should be iOS-specific since the touch-action
1870         property does not have any effect on macOS.
1871         (WebCore::Document::invalidateRenderingDependentRegions):
1872         (WebCore::Document::nodeWillBeRemoved):
1873         (WebCore::Document::updateTouchActionElements):
1874         * dom/Document.h:
1875         * dom/Element.cpp:
1876         (WebCore::Element::dispatchMouseEvent): Dispatch a pointer event matching the mouse event that is about to be dispatched.
1877         If preventDefault() is called in the event handler for either "pointerdown" or "pointerup", do not proceed with dispatching
1878         the mouse event.
1879         * dom/PointerEvent.cpp:
1880         (WebCore::pointerEventType):
1881         (WebCore::PointerEvent::create):
1882         * dom/PointerEvent.h:
1883         * page/EventHandler.cpp: Check both the pointer and mouse events to see if we need to dispatch "enter" and "leave" events.
1884         (WebCore::hierarchyHasCapturingEventListeners):
1885         (WebCore::EventHandler::updateMouseEventTargetNode):
1886         * page/PointerCaptureController.cpp: Fix a build error which only happened on macOS.
1887         (WebCore::PointerCaptureController::PointerCaptureController): Create the CapturingData for the unique mouse pointer.
1888         (WebCore::PointerCaptureController::hasPointerCapture): The code did not match the spec cited in the comment, only the
1889         pending target override needs to be considered to determine whether a given element has pointer capture enabled.
1890         (WebCore::PointerCaptureController::dispatchEvent): Dispatch the provided pointer event, accounting for pointer capture if
1891         it is set.
1892         * page/PointerLockController.cpp: Fix a build error which only happened on macOS.
1893         * style/StyleTreeResolver.cpp:
1894         (WebCore::Style::TreeResolver::resolveElement): Code related to touch-action is only relevant to iOS.
1895
1896 2019-02-27  Sihui Liu  <sihui_liu@apple.com>
1897
1898         Network Process is put to suspended when holding locked IndexedDB files
1899         https://bugs.webkit.org/show_bug.cgi?id=195024
1900         <rdar://problem/45194169>
1901
1902         Reviewed by Geoffrey Garen.
1903
1904         We found network process was suspended when IDBDatabase was being closed in the background database thread, 
1905         holding locks to its database file. To avoid starvation or deadlock, we need to keep network process alive by 
1906         taking background assertion in UI process until the closes are done and locks are released.
1907
1908         * Modules/indexeddb/server/IDBServer.cpp:
1909         (WebCore::IDBServer::IDBServer::create):
1910         (WebCore::IDBServer::IDBServer::IDBServer):
1911         (WebCore::IDBServer::IDBServer::createBackingStore):
1912         (WebCore::IDBServer::IDBServer::closeDatabase):
1913         (WebCore::IDBServer::IDBServer::didCloseDatabase):
1914         * Modules/indexeddb/server/IDBServer.h:
1915         (WebCore::IDBServer::IDBServer::create):
1916         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1917         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentDeleteOperation):
1918         (WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose):
1919         (WebCore::IDBServer::UniqueIDBDatabase::didShutdownForClose):
1920         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
1921         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
1922         (WebCore::IDBServer::UniqueIDBDatabase::notifyServerAboutClose):
1923         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1924
1925 2019-02-26  Simon Fraser  <simon.fraser@apple.com>
1926
1927         Have a single notion of scroll position in the scrolling tree and derive layoutViewport from it
1928         https://bugs.webkit.org/show_bug.cgi?id=194973
1929
1930         Reviewed by Antti Koivisto.
1931
1932         This patch cleans up how the scrolling tree responds to scrolls.
1933
1934         First, ScrollingTreeScrollingNode::m_currentScrollPosition is "truth" for scrolling thread/
1935         UI process scroll position.
1936
1937         On macOS where handleWheelEvent on the scrolling thread changes scroll position, the
1938         bottleneck is ScrollingTreeScrollingNode::scrollTo() which sets the new scroll position,
1939         update the visual viewport (for frame scrolls) updates the scrolledContentsLayer position,
1940         updates related layers on this node (counter-scrolling layers etc), and then tells the
1941         scrolling tree, which recurses through descendant nodes so they can adjust their layer
1942         positions.
1943
1944         On iOS, the bottleneck is ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling(),
1945         which does the above other than setting scrolledContentsLayer (since we're reacting to
1946         layer state changes, not producing them).
1947
1948         updateLayersAfterAncestorChange() is renamed to relatedNodeScrollPositionDidChange(), and
1949         ScrollingTree does the tree walk so classes don't have to implement
1950         updateLayersAfterAncestorChange() just to talk children. The ScrollingTree tree walk knows
1951         how to get the correct layoutViewport and to stop at frame boundaries (layer updates never
1952         need to cross frame boundaries).
1953
1954         We preserve 'cumulativeDelta'; it's necessary for things like fixed inside overflow:scroll,
1955         since the fixed state was computed with the "layout" scroll position, so we have to account
1956         for the scroll delta since the last committed position. It's possible we could improve this
1957         in future.
1958
1959         * page/scrolling/ScrollingTree.cpp:
1960         (WebCore::ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling):
1961         (WebCore::ScrollingTree::notifyRelatedNodesAfterScrollPositionChange):
1962         (WebCore::ScrollingTree::notifyRelatedNodesRecursive):
1963         (WebCore::ScrollingTree::mainFrameLayoutViewport):
1964         (WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling): Deleted.
1965         * page/scrolling/ScrollingTree.h:
1966         * page/scrolling/ScrollingTreeFrameHostingNode.cpp:
1967         (WebCore::ScrollingTreeFrameHostingNode::updateLayersAfterAncestorChange): Deleted.
1968         * page/scrolling/ScrollingTreeFrameHostingNode.h:
1969         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
1970         (WebCore::ScrollingTreeFrameScrollingNode::updateViewportForCurrentScrollPosition):
1971         (WebCore::ScrollingTreeFrameScrollingNode::localToContentsPoint const):
1972         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
1973         * page/scrolling/ScrollingTreeNode.cpp:
1974         (WebCore::ScrollingTreeNode::relatedNodeScrollPositionDidChange):
1975         (WebCore::ScrollingTreeNode::enclosingScrollingNodeIncludingSelf):
1976         * page/scrolling/ScrollingTreeNode.h:
1977         * page/scrolling/ScrollingTreeScrollingNode.cpp:
1978         (WebCore::ScrollingTreeScrollingNode::minimumScrollPosition const):
1979         (WebCore::ScrollingTreeScrollingNode::scrollLimitReached const):
1980         (WebCore::ScrollingTreeScrollingNode::adjustedScrollPosition const):
1981         (WebCore::ScrollingTreeScrollingNode::scrollBy):
1982         (WebCore::ScrollingTreeScrollingNode::scrollTo):
1983         (WebCore::ScrollingTreeScrollingNode::currentScrollPositionChanged):
1984         (WebCore::ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling):
1985         (WebCore::ScrollingTreeScrollingNode::localToContentsPoint const):
1986         (WebCore::ScrollingTreeScrollingNode::updateLayersAfterAncestorChange): Deleted.
1987         (WebCore::ScrollingTreeScrollingNode::setScrollPosition): Deleted.
1988         * page/scrolling/ScrollingTreeScrollingNode.h:
1989         * page/scrolling/ScrollingTreeScrollingNodeDelegate.h:
1990         (WebCore::ScrollingTreeScrollingNodeDelegate::currentScrollPosition const):
1991         (WebCore::ScrollingTreeScrollingNodeDelegate::scrollPosition const): Deleted.
1992         * page/scrolling/ThreadedScrollingTree.cpp:
1993         (WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
1994         * page/scrolling/ThreadedScrollingTree.h:
1995         * page/scrolling/cocoa/ScrollingTreeFixedNode.h:
1996         * page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
1997         (WebCore::ScrollingTreeFixedNode::relatedNodeScrollPositionDidChange):
1998         (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange): Deleted.
1999         * page/scrolling/cocoa/ScrollingTreeStickyNode.h:
2000         * page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
2001         (WebCore::ScrollingTreeStickyNode::relatedNodeScrollPositionDidChange):
2002         (WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange): Deleted.
2003         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
2004         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2005         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
2006         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
2007         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
2008         (WebCore::ScrollingTreeFrameScrollingNodeMac::adjustedScrollPosition const):
2009         (WebCore::ScrollingTreeFrameScrollingNodeMac::currentScrollPositionChanged):
2010         (WebCore::ScrollingTreeFrameScrollingNodeMac::repositionScrollingLayers):
2011         (WebCore::ScrollingTreeFrameScrollingNodeMac::repositionRelatedLayers):
2012         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateMainFramePinState):
2013         (WebCore::ScrollingTreeFrameScrollingNodeMac::exposedUnfilledArea const):
2014         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollPosition const): Deleted.
2015         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition): Deleted.
2016         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition): Deleted.
2017         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateLayersAfterViewportChange): Deleted.
2018         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
2019         (): Deleted.
2020         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
2021         (WebCore::ScrollingTreeOverflowScrollingNodeMac::adjustedScrollPosition const):
2022         (WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionScrollingLayers):
2023         (WebCore::ScrollingTreeOverflowScrollingNodeMac::~ScrollingTreeOverflowScrollingNodeMac): Deleted.
2024         (WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterAncestorChange): Deleted.
2025         (WebCore::ScrollingTreeOverflowScrollingNodeMac::scrollPosition const): Deleted.
2026         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPosition): Deleted.
2027         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition): Deleted.
2028         (WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterDelegatedScroll): Deleted.
2029         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
2030         (WebCore::ScrollingTreeScrollingNodeDelegateMac::isAlreadyPinnedInDirectionOfGesture):
2031         (WebCore::ScrollingTreeScrollingNodeDelegateMac::stretchAmount):
2032         (WebCore::ScrollingTreeScrollingNodeDelegateMac::pinnedInDirection):
2033         (WebCore::ScrollingTreeScrollingNodeDelegateMac::adjustScrollPositionToBoundsIfNecessary):
2034         (WebCore::ScrollingTreeScrollingNodeDelegateMac::scrollOffset const):
2035         (WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollOnAxis):
2036
2037 2019-02-22  Simon Fraser  <simon.fraser@apple.com>
2038
2039         Have a single notion of scroll position in the scrolling tree and derive layoutViewport from it
2040         https://bugs.webkit.org/show_bug.cgi?id=194973
2041
2042         Reviewed by Antti Koivisto.
2043
2044         The "master" value for the scroll position of a ScrollingTreeScrollingNode is now its m_scrollPosition member;
2045         layout viewports and layer positions will be set from this. This allows scrollPosition() to no longer be virtual
2046         and require different code for each scrolling node subclass, and adds a choke point that we can use to update
2047         the layout viewport.
2048         
2049         We can remove m_probableMainThreadScrollPosition on ScrollingTreeFrameScrollingNodeMac because this was really just
2050         an alias for the scroll position.
2051
2052         Add some isRootNode() checks for things that should only affect the main frame.
2053
2054         * page/scrolling/ScrollingTree.h: Remove fixedPositionRect() which was unused, and is a per-frame thing so makes
2055         no sense here.
2056         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
2057         (WebCore::ScrollingTreeFrameScrollingNode::didChangeScrollPosition):
2058         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
2059         (WebCore::ScrollingTreeFrameScrollingNode::layoutViewport const):
2060         (WebCore::ScrollingTreeFrameScrollingNode::setLayoutViewport):
2061         (WebCore::ScrollingTreeFrameScrollingNode::fixedPositionRect): Deleted.
2062         * page/scrolling/ScrollingTreeScrollingNode.cpp:
2063         (WebCore::ScrollingTreeScrollingNode::setScrollPosition):
2064         (WebCore::ScrollingTreeScrollingNode::setScrollPositionInternal):
2065         (WebCore::ScrollingTreeScrollingNode::didChangeScrollPosition):
2066         * page/scrolling/ScrollingTreeScrollingNode.h:
2067         (WebCore::ScrollingTreeScrollingNode::scrollPosition const):
2068         * page/scrolling/ios/ScrollingTreeIOS.cpp:
2069         (WebCore::ScrollingTreeIOS::fixedPositionRect): Deleted.
2070         * page/scrolling/ios/ScrollingTreeIOS.h:
2071         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
2072         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2073         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
2074         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
2075         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
2076         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition):
2077         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateMainFramePinState):
2078         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollPosition const): Deleted.
2079         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
2080         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
2081         (WebCore::ScrollingTreeOverflowScrollingNodeMac::scrollPosition const): Deleted.
2082
2083 2019-02-27  Ulrich Pflueger  <up@nanocosmos.de>
2084
2085         [MSE] SourceBuffer sample time increment vs. last frame duration check is broken
2086         https://bugs.webkit.org/show_bug.cgi?id=194747
2087         <rdar://problem/48148469>
2088
2089         Reviewed by Jer Noble.
2090
2091         Prevent unintended frame drops by including last frame duration in discontinuity check. 
2092
2093         Test: media/media-source/media-source-append-variable-frame-lengths-with-matching-durations.html
2094
2095         * Modules/mediasource/SourceBuffer.cpp:
2096         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
2097
2098 2019-02-27  Timothy Hatcher  <timothy@apple.com>
2099
2100         REGRESSION: WebKit content crash in Base System (because NSAppearance is NULL).
2101         https://bugs.webkit.org/show_bug.cgi?id=195086
2102         rdar://problem/48419124
2103
2104         Reviewed by Tim Horton.
2105
2106         * platform/mac/ScrollAnimatorMac.mm:
2107         (-[WebScrollerImpDelegate effectiveAppearanceForScrollerImp:]): Always return a valid NSAppearance.
2108
2109 2019-02-26  Wenson Hsieh  <wenson_hsieh@apple.com>
2110
2111         Remove conditional compile guard for InsertIntoTextNodeCommand::doReapply
2112         https://bugs.webkit.org/show_bug.cgi?id=195067
2113         <rdar://problem/44812080>
2114
2115         Reviewed by Tim Horton.
2116
2117         This iOS-specific override was introduced to fix <rdar://problem/7114425>, in which the last typed character
2118         would be revealed when redoing text input on iOS inside a password field. The associated change fixed this bug
2119         by overriding doReapply on iOS to only insert text (instead of additionally handling password echo); however, it
2120         really makes sense to skip password echo when redoing on all platforms, so we can just remove the platform-
2121         specific guards around this logic.
2122
2123         Doing this allows us to add the `hasEditableStyle()` check on iOS when redoing text insertion, which results in
2124         a very subtle behavior change covered by the new layout test below.
2125
2126         Test: editing/undo/redo-text-insertion-in-non-editable-node.html
2127
2128         * editing/InsertIntoTextNodeCommand.cpp:
2129         (WebCore::InsertIntoTextNodeCommand::doReapply):
2130         * editing/InsertIntoTextNodeCommand.h:
2131
2132 2019-02-26  Keith Miller  <keith_miller@apple.com>
2133
2134         Code quality cleanup in NeverDestroyed
2135         https://bugs.webkit.org/show_bug.cgi?id=194824
2136
2137         Reviewed by Mark Lam.
2138
2139         name_names.pl should not just assume the layout of LazyNeverDestroyed.
2140
2141         * dom/make_names.pl:
2142         (printNamesCppFile):
2143
2144 2019-02-26  Zalan Bujtas  <zalan@apple.com>
2145
2146         Do not try to observe the timer when Page is nullptr
2147         https://bugs.webkit.org/show_bug.cgi?id=195076
2148
2149         Reviewed by Tim Horton.
2150
2151         Covered by fast/dom/Window/timer-null-script-execution-context.html.
2152
2153         * page/DOMTimer.cpp:
2154         (WebCore::DOMTimer::install):
2155
2156 2019-02-20  Jer Noble  <jer.noble@apple.com>
2157
2158         [Cocoa] Media elements will restart network buffering just before suspending
2159         https://bugs.webkit.org/show_bug.cgi?id=193691
2160
2161         Reviewed by Eric Carlson.
2162
2163         API Test: WebKit.ProcessSuspendMediaBuffering
2164
2165         Allow the Page to suspend all media buffering in its child Documents.
2166
2167         * dom/Document.cpp:
2168         (WebCore::Document::suspendAllMediaBuffering):
2169         (WebCore::Document::resumeAllMediaBuffering):
2170         * dom/Document.h:
2171         * html/MediaElementSession.cpp:
2172         (WebCore::MediaElementSession::dataBufferingPermitted const):
2173         (WebCore::MediaElementSession::suspendBuffering):
2174         (WebCore::MediaElementSession::resumeBuffering):
2175         (WebCore::MediaElementSession::bufferingSuspended const):
2176         * html/MediaElementSession.h:
2177         * page/Page.cpp:
2178         (WebCore::Page::suspendAllMediaBuffering):
2179         (WebCore::Page::resumeAllMediaBuffering):
2180         * page/Page.h:
2181         (WebCore::Page::mediaPlaybackIsSuspended const):
2182         (WebCore::Page::mediaBufferingIsSuspended const):
2183         (WebCore::Page::mediaPlaybackIsSuspended): Deleted.
2184         * platform/audio/PlatformMediaSession.h:
2185         (WebCore::PlatformMediaSession::suspendBuffering):
2186         (WebCore::PlatformMediaSession::resumeBuffering):
2187         * platform/audio/PlatformMediaSessionManager.cpp:
2188         (WebCore::PlatformMediaSessionManager::suspendAllMediaBufferingForDocument):
2189         (WebCore::PlatformMediaSessionManager::resumeAllMediaBufferingForDocument):
2190         * platform/audio/PlatformMediaSessionManager.h:
2191
2192 2019-02-26  Youenn Fablet  <youenn@apple.com>
2193
2194         Move service worker response validation from the service worker client to the service worker itself
2195         https://bugs.webkit.org/show_bug.cgi?id=194716
2196
2197         Reviewed by Geoffrey Garen.
2198
2199         Added response validation at service worker side.
2200
2201         No change of behavior except for now logging validation error messages in the console.
2202         Covered by rebased tests.
2203
2204         * workers/service/context/ServiceWorkerFetch.cpp:
2205         (WebCore::ServiceWorkerFetch::validateResponse):
2206         (WebCore::ServiceWorkerFetch::processResponse):
2207         (WebCore::ServiceWorkerFetch::dispatchFetchEvent):
2208
2209 2019-02-26  Sihui Liu  <sihui_liu@apple.com>
2210
2211         [Mac WK2] storage/indexeddb/IDBObject-leak.html is flaky
2212         https://bugs.webkit.org/show_bug.cgi?id=195036
2213
2214         Reviewed by Geoffrey Garen.
2215
2216         When connection to IDBServer is lost, IDBDatabase in web process should not only stop active transactions, but 
2217         also transactions in committing process.
2218
2219         Also, TransactionOpration should clear its perform function when the operation is being completed, otherwise 
2220         there is a reference cycle of TransactionOpration.
2221
2222         Covered by existing tests storage/indexeddb/IDBObject-leak.html.
2223
2224         * Modules/indexeddb/IDBDatabase.cpp:
2225         (WebCore::IDBDatabase::connectionToServerLost): notify committing transasctions that connection is lost.
2226         * Modules/indexeddb/IDBTransaction.cpp:
2227         (WebCore::IDBTransaction::connectionClosedFromServer): notify IDBConnectionProxy that transaction ends.
2228         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
2229         (WebCore::IDBClient::IDBConnectionProxy::forgetTransaction): clear finished transactions.
2230         * Modules/indexeddb/client/IDBConnectionProxy.h:
2231         * Modules/indexeddb/client/TransactionOperation.h:
2232         (WebCore::IDBClient::TransactionOperation::doComplete): clear perform function unconditionally when the 
2233         operation is in completion process. 
2234
2235 2019-02-26  Zalan Bujtas  <zalan@apple.com>
2236
2237         [ContentChangeObserver] clearContentChangeObservers should be internal to ContentChangeObserver class
2238         https://bugs.webkit.org/show_bug.cgi?id=195066
2239         <rdar://problem/48411682>
2240
2241         Reviewed by Tim Horton.
2242
2243         Now all the empty clearContentChangeObservers() implementations can be removed.
2244
2245         * dom/Document.cpp:
2246         (WebCore::Document::platformSuspendOrStopActiveDOMObjects):
2247         * loader/EmptyClients.h:
2248         * page/ChromeClient.h:
2249         * page/Frame.cpp:
2250         (WebCore::Frame::willDetachPage):
2251         * page/ios/ContentChangeObserver.h:
2252         * page/ios/ContentChangeObserver.mm:
2253         (WebCore::ContentChangeObserver::clearTimersAndReportContentChange):
2254         (WebCore::ContentChangeObserver::didSuspendActiveDOMObjects): Might need to merge them.
2255         (WebCore::ContentChangeObserver::willDetachPage):
2256
2257 2019-02-26  Zalan Bujtas  <zalan@apple.com>
2258
2259         [ContentChangeObserver] Move style recalc schedule observation logic to ContentChangeObserver
2260         https://bugs.webkit.org/show_bug.cgi?id=195062
2261         <rdar://problem/48409258>
2262
2263         Reviewed by Tim Horton.
2264
2265         Also rename registerDOMTimerForContentObservationIfNeeded to be consistent with the did* naming style.
2266
2267         * dom/Document.cpp:
2268         (WebCore::Document::scheduleStyleRecalc):
2269         * page/DOMTimer.cpp:
2270         (WebCore::DOMTimer::install):
2271         * page/ios/ContentChangeObserver.h:
2272         * page/ios/ContentChangeObserver.mm:
2273         (WebCore::ContentChangeObserver::didInstallDOMTimer):
2274         (WebCore::ContentChangeObserver::didScheduleStyleRecalc):
2275         (WebCore::ContentChangeObserver::registerDOMTimerForContentObservationIfNeeded): Deleted.
2276
2277 2019-02-26  Chris Dumez  <cdumez@apple.com>
2278
2279         [iOS] Regression(PSON) Scroll position is no longer restored when navigating back to reddit.com
2280         https://bugs.webkit.org/show_bug.cgi?id=195054
2281         <rdar://problem/48330549>
2282
2283         Reviewed by Geoff Garen.
2284
2285         Add MaintainMemoryCache flag to indicate that the memory cache should not get purged.
2286
2287         * page/MemoryRelease.cpp:
2288         (WebCore::releaseNoncriticalMemory):
2289         (WebCore::releaseCriticalMemory):
2290         (WebCore::releaseMemory):
2291         * page/MemoryRelease.h:
2292
2293 2019-02-26  Commit Queue  <commit-queue@webkit.org>
2294
2295         Unreviewed, rolling out r241970.
2296         https://bugs.webkit.org/show_bug.cgi?id=195057
2297
2298         made the QuickLook.LegacyQuickLookContent API test flakey
2299         (Requested by estes on #webkit).
2300
2301         Reverted changeset:
2302
2303         "[iOS] Break a reference cycle between PreviewLoader and
2304         ResourceLoader"
2305         https://bugs.webkit.org/show_bug.cgi?id=194964
2306         https://trac.webkit.org/changeset/241970
2307
2308 2019-02-26  Zalan Bujtas  <zalan@apple.com>
2309
2310         [ContentChangeObserver] Simplify content observation API by removing explicit DOMTimer observation.
2311         https://bugs.webkit.org/show_bug.cgi?id=195023
2312         <rdar://problem/48381885>
2313
2314         Reviewed by Tim Horton.
2315
2316         In the future we might decide that certain activities don't require DOMTimer observation, but that should
2317         be internal to ContentChangeObserver.
2318
2319         * page/ios/ContentChangeObserver.h:
2320         * page/ios/ContentChangeObserver.mm:
2321         (WebCore::ContentChangeObserver::startObservingContentChanges):
2322         (WebCore::ContentChangeObserver::stopObservingContentChanges):
2323         * page/ios/EventHandlerIOS.mm:
2324         (WebCore::EventHandler::mouseMoved):
2325
2326 2019-02-26  Zalan Bujtas  <zalan@apple.com>
2327
2328         [ContentChangeObserver] Move observing logic from Document::updateStyleIfNeeded to ContentChangeObserver
2329         https://bugs.webkit.org/show_bug.cgi?id=195032
2330         <rdar://problem/48388063>
2331
2332         Reviewed by Tim Horton.
2333
2334         This might eventually turn into a regular start/stop content observing call.
2335
2336         * dom/Document.cpp:
2337         (WebCore::Document::updateStyleIfNeeded):
2338         * page/ios/ContentChangeObserver.h:
2339         * page/ios/ContentChangeObserver.mm:
2340         (WebCore::ContentChangeObserver::startObservingStyleResolve):
2341         (WebCore::ContentChangeObserver::stopObservingStyleResolve):
2342
2343 2019-02-26  Zalan Bujtas  <zalan@apple.com>
2344
2345         [ContentChangeObserver] Move CheckForVisibilityChange to ContentChangeObserver class
2346         https://bugs.webkit.org/show_bug.cgi?id=195035
2347         <rdar://problem/48389123>
2348
2349         Reviewed by Tim Horton.
2350
2351         Visibility checking logic belongs to ContentChangeObserver.
2352
2353         * page/ios/ContentChangeObserver.h:
2354         * page/ios/ContentChangeObserver.mm:
2355         (WebCore::elementImplicitVisibility):
2356         (WebCore::ContentChangeObserver::StyleChange::StyleChange):
2357         (WebCore::ContentChangeObserver::StyleChange::~StyleChange):
2358         * rendering/updating/RenderTreeUpdater.cpp:
2359         (WebCore::RenderTreeUpdater::updateElementRenderer):
2360         (WebCore::elementImplicitVisibility): Deleted.
2361         (WebCore::CheckForVisibilityChange::CheckForVisibilityChange): Deleted.
2362         (WebCore::CheckForVisibilityChange::~CheckForVisibilityChange): Deleted.
2363
2364 2019-02-26  Philippe Normand  <pnormand@igalia.com>
2365
2366         [EGL] Runtime support for RGB565 pixel layout
2367         https://bugs.webkit.org/show_bug.cgi?id=194817
2368
2369         Reviewed by Carlos Garcia Campos.
2370
2371         Currently our graphics pipeline always relies on a ARGB8888 (32
2372         bpp) pixel configuration. On some low-end (old) embedded platforms
2373         the graphics driver is sometimes optimized for 16 bpp
2374         configurations, such as RGB565. On those platforms the application
2375         can now set the WEBKIT_EGL_PIXEL_LAYOUT environment variable to
2376         "RGB565" to adjust to the best pixel configuration supported by
2377         the screen and graphics driver.
2378
2379         * platform/graphics/egl/GLContextEGL.cpp:
2380         (WebCore::GLContextEGL::getEGLConfig):
2381
2382 2019-02-26  Philippe Normand  <pnormand@igalia.com> and Carlos Garcia Campos  <cgarcia@igalia.com>
2383
2384         [WPE] Add API for webview background color configuration
2385         https://bugs.webkit.org/show_bug.cgi?id=192305
2386
2387         Reviewed by Michael Catanzaro.
2388
2389         Adapt the FrameView API to allow a default non-white background color.
2390
2391         * page/Frame.cpp:
2392         (WebCore::Frame::createView): Replace isTransparent argument with a background color one.
2393         * page/Frame.h:
2394         * page/FrameView.cpp:
2395         (WebCore::FrameView::recalculateBaseBackgroundColor): Use Color::transparent if m_isTransparent is true.
2396         (WebCore::FrameView::updateBackgroundRecursively): Allow the fallback background color to be non-white, this is
2397         used only in non-dark-mode-css build configurations.
2398         * page/FrameView.h:
2399         * testing/Internals.cpp:
2400         (WebCore::Internals::setViewIsTransparent): Use Color::transparent if transparent is true.
2401
2402 2019-02-25  Yongjun Zhang  <yongjun_zhang@apple.com>
2403
2404         scalableNativeWebpageParameters() is not preserved on new page navigation.
2405         https://bugs.webkit.org/show_bug.cgi?id=194892
2406         <rdar://problem/47538280>
2407
2408         If a page's current default viewport configuration is scalableNativeWebpageParameters due to
2409         the fact that m_canIgnoreScalingConstraints is true, loading a new page should preserve this
2410         configuration until we derive the right values from viewport meta-tag.
2411
2412         Reviewed by Wenson Hsieh.
2413
2414         Test: fast/viewport/ios/viewport-shrink-to-fit-on-new-navigation.html
2415
2416         * page/ViewportConfiguration.cpp:
2417         (WebCore::ViewportConfiguration::canOverrideConfigurationParameters const): Use fixedNativeWebpageParameters().
2418         (WebCore::ViewportConfiguration::updateDefaultConfiguration): Use nativeWebpageParameters.
2419         (WebCore::ViewportConfiguration::nativeWebpageParameters): Return the appropriate default configuration
2420             based on m_canIgnoreScalingConstraints and shouldIgnoreMinimumEffectiveDeviceWidth().
2421         (WebCore::ViewportConfiguration::fixedNativeWebpageParameters): Renamed from nativeWebpageParameters()
2422         (WebCore::ViewportConfiguration::scalableNativeWebpageParameters): Use fixedNativeWebpageParameters.
2423         * page/ViewportConfiguration.h: Make nativeWebpageParameters() an instance method and change the old
2424             static method to fixedNativeWebpageParameters which better reflects the actual behavior.
2425
2426 2019-02-25  Zalan Bujtas  <zalan@apple.com>
2427
2428         [ContentChangeObserver] Move observing logic from DOMWindow::clearTimeout to ContentChangeObserver
2429         https://bugs.webkit.org/show_bug.cgi?id=194988
2430         <rdar://problem/48343040>
2431
2432         Reviewed by Tim Horton.
2433
2434         ContentChangeObserver::removeDOMTimer takes care of the canceled timer removal.
2435
2436         * page/DOMWindow.cpp:
2437         (WebCore::DOMWindow::clearTimeout):
2438         * page/ios/ContentChangeObserver.h:
2439         * page/ios/ContentChangeObserver.mm:
2440         (WebCore::ContentChangeObserver::startObservingDOMTimer):
2441         (WebCore::ContentChangeObserver::stopObservingDOMTimer):
2442         (WebCore::ContentChangeObserver::removeDOMTimer):
2443
2444 2019-02-25  Zalan Bujtas  <zalan@apple.com>
2445
2446         [ContentChangeObserver] Move observing logic from DOMTimer to ContentChangeObserver
2447         https://bugs.webkit.org/show_bug.cgi?id=194987
2448         <rdar://problem/48342910>
2449
2450         Reviewed by Tim Horton.
2451
2452         Content obvservation logic should all move to the ContentChangeObserver class.
2453
2454         * page/DOMTimer.cpp:
2455         (WebCore::DOMTimer::install):
2456         (WebCore::DOMTimer::fired):
2457         * page/Page.cpp:
2458         (WebCore::Page::Page):
2459         * page/Page.h:
2460         (WebCore::Page::contentChangeObserver):
2461         * page/ios/ContentChangeObserver.h:
2462         * page/ios/ContentChangeObserver.mm:
2463         (WebCore::ContentChangeObserver::ContentChangeObserver):
2464         (WebCore::ContentChangeObserver::registerDOMTimerForContentObservationIfNeeded):
2465         (WebCore::ContentChangeObserver::startObservingDOMTimer):
2466         (WebCore::ContentChangeObserver::stopObservingDOMTimer):
2467         (WebCore::ContentChangeObserver::containsObservedDOMTimer):
2468         (WebCore::ContentChangeObserver::addObservedDOMTimer):
2469         (WebCore::ContentChangeObserver::removeObservedDOMTimer):
2470
2471 2019-02-25  John Wilander  <wilander@apple.com>
2472
2473         Introduce and adopt new class RegistrableDomain for eTLD+1
2474         https://bugs.webkit.org/show_bug.cgi?id=194791
2475         <rdar://problem/48179240>
2476
2477         Reviewed by Alex Christensen, Fujii Hironori, and Brent Fulgham.
2478
2479         A new API test was added. Plenty of existing layout tests under
2480         http/tests/resourceLoadStatistics/ and http/tests/storageAccess/ test the code.
2481
2482         This patch introduces and adopts a new class called WebCore::RegistrableDomain
2483         which represents a domain's eTLD+1 (effective top level domain plus one) and is
2484         the basis for the term "site," as in same-site. Other popular names include
2485         high-level domain, primary domain, and top privately controlled/owned domain.
2486         Effective top level domains are enumerated on the Public Suffix List
2487         (https://publicsuffix.org).
2488
2489         This class just uses the full domain for when the Public Suffix List cannot help
2490         finding the registrable domain and for WebKit ports that haven't enabled
2491         PUBLIC_SUFFIX_LIST. It also uses the string "nullOrigin" as a representation
2492         for the null or unique origin (this matches how these origins were handled
2493         before).
2494
2495         The implementation is a wrapper around a String and the functions and class
2496         members that now make use of this new class used to handle regular String
2497         objects which didn't help much in terms of type safety or guarantees that the
2498         string had already been converted to an eTLD+1.
2499
2500         We've at least two bad bugs in the Storage Access API because of confusion
2501         between a URL's eTLD+1 and its host. The usage of WebCore::RegistrableDomain
2502         will prohibit such bugs in the future.
2503
2504         Partitioning in WebKit also uses eTLD+1 to a large extent. I plan to adopt
2505         WebCore::RegistrableDomain for partitioning in a later patch.
2506
2507         This patch also enhances parameter naming by:
2508         - Removing parts that refer to "primary" as in primaryDomain.
2509         - Replacing references to "TopPrivatelyControlledDomain" with "RegistrableDomain."
2510         - Replacing references to "TopPrivatelyOwnedDomain" with "RegistrableDomain."
2511         - Using the term "domain" consistently instead of e.g. "host."
2512
2513         * WebCore.xcodeproj/project.pbxproj:
2514         * dom/Document.cpp:
2515         (WebCore::Document::hasRequestedPageSpecificStorageAccessWithUserInteraction):
2516         (WebCore::Document::setHasRequestedPageSpecificStorageAccessWithUserInteraction):
2517         * dom/Document.h:
2518         * html/HTMLAnchorElement.cpp:
2519         (WebCore::HTMLAnchorElement::parseAdClickAttribution const):
2520         * html/HTMLMediaElement.cpp:
2521         (WebCore::HTMLMediaElement::mediaSessionTitle const):
2522         * loader/AdClickAttribution.cpp:
2523         (WebCore::AdClickAttribution::url const):
2524         (WebCore::AdClickAttribution::referrer const):
2525         (WebCore::AdClickAttribution::toString const):
2526         * loader/AdClickAttribution.h:
2527         (WebCore::AdClickAttribution::Source::Source):
2528         (WebCore::AdClickAttribution::Source::matches const):
2529         (WebCore::AdClickAttribution::Source::deleteValue):
2530         (WebCore::AdClickAttribution::Destination::Destination):
2531         (WebCore::AdClickAttribution::Destination::matches const):
2532         (WebCore::AdClickAttribution::Destination::deleteValue):
2533         * loader/ResourceLoadObserver.cpp:
2534         (WebCore::ResourceLoadObserver::setRequestStorageAccessUnderOpenerCallback):
2535         (WebCore::ResourceLoadObserver::setLogUserInteractionNotificationCallback):
2536         (WebCore::ResourceLoadObserver::setLogWebSocketLoadingNotificationCallback):
2537         (WebCore::ResourceLoadObserver::setLogSubresourceLoadingNotificationCallback):
2538         (WebCore::ResourceLoadObserver::setLogSubresourceRedirectNotificationCallback):
2539         (WebCore::ResourceLoadObserver::logSubresourceLoading):
2540         (WebCore::ResourceLoadObserver::logWebSocketLoading):
2541         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
2542         (WebCore::ResourceLoadObserver::requestStorageAccessUnderOpener):
2543         (WebCore::ResourceLoadObserver::logFontLoad):
2544         (WebCore::ResourceLoadObserver::logCanvasRead):
2545         (WebCore::ResourceLoadObserver::logCanvasWriteOrMeasure):
2546         (WebCore::ResourceLoadObserver::logNavigatorAPIAccessed):
2547         (WebCore::ResourceLoadObserver::logScreenAPIAccessed):
2548         (WebCore::ResourceLoadObserver::ensureResourceStatisticsForRegistrableDomain):
2549         (WebCore::ResourceLoadObserver::statisticsForOrigin):
2550         (WebCore::primaryDomain): Deleted.
2551         (WebCore::ResourceLoadObserver::ensureResourceStatisticsForPrimaryDomain): Deleted.
2552         * loader/ResourceLoadObserver.h:
2553         * loader/ResourceLoadStatistics.cpp:
2554         (WebCore::ResourceLoadStatistics::encode const):
2555         (WebCore::ResourceLoadStatistics::decode):
2556         (WebCore::ResourceLoadStatistics::toString const):
2557         (WebCore::ResourceLoadStatistics::merge):
2558         (WebCore::ResourceLoadStatistics::primaryDomain): Deleted.
2559         * loader/ResourceLoadStatistics.h:
2560         (WebCore::ResourceLoadStatistics::ResourceLoadStatistics):
2561         * page/Page.cpp:
2562         (WebCore::Page::logNavigation):
2563         (WebCore::Page::mainFrameLoadStarted):
2564         * page/Page.h:
2565         * page/PerformanceMonitor.cpp:
2566         (WebCore::reportPageOverPostLoadResourceThreshold):
2567         * platform/RegistrableDomain.h: Added.
2568         (WebCore::RegistrableDomain::RegistrableDomain):
2569         (WebCore::RegistrableDomain::isEmpty const):
2570         (WebCore::RegistrableDomain::string const):
2571         (WebCore::RegistrableDomain::operator!= const):
2572         (WebCore::RegistrableDomain::operator== const):
2573         (WebCore::RegistrableDomain::matches const):
2574         (WebCore::RegistrableDomain::isolatedCopy const):
2575         (WebCore::RegistrableDomain::isHashTableDeletedValue const):
2576         (WebCore::RegistrableDomain::hash const):
2577         (WebCore::RegistrableDomain::RegistrableDomainHash::hash):
2578         (WebCore::RegistrableDomain::RegistrableDomainHash::equal):
2579         (WebCore::RegistrableDomain::encode const):
2580         (WebCore::RegistrableDomain::decode):
2581         * platform/network/NetworkStorageSession.cpp:
2582         (WebCore::NetworkStorageSession::shouldBlockThirdPartyCookies const):
2583         (WebCore::NetworkStorageSession::shouldBlockCookies const):
2584         (WebCore::NetworkStorageSession::setPrevalentDomainsToBlockCookiesFor):
2585         (WebCore::NetworkStorageSession::removePrevalentDomains):
2586         (WebCore::NetworkStorageSession::hasStorageAccess const):
2587         (WebCore::NetworkStorageSession::getAllStorageAccessEntries const):
2588         (WebCore::NetworkStorageSession::grantStorageAccess):
2589         (WebCore::getPartitioningDomain): Deleted.
2590         * platform/network/NetworkStorageSession.h:
2591
2592 2019-02-25  Chris Fleizach  <cfleizach@apple.com>
2593
2594         AX: <footer> HTML5 tag not reading as ARIA Landmark to VoiceOver
2595         https://bugs.webkit.org/show_bug.cgi?id=190138
2596         <rdar://problem/44907695>
2597
2598         Reviewed by Joanmarie Diggs.
2599
2600         Make sure that footer elements use the right role depending on their context.
2601         If scoped to body, they become contentinfo. Otherwise they are just delineated by
2602         a footer subrole.
2603
2604         * accessibility/AccessibilityObject.cpp:
2605         (WebCore::AccessibilityObject::isLandmark const):
2606         * accessibility/AccessibilityRenderObject.cpp:
2607         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const):
2608         (WebCore::AccessibilityRenderObject::isDescendantOfElementType const):
2609         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
2610         * accessibility/AccessibilityRenderObject.h:
2611         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2612         (-[WebAccessibilityObjectWrapper _accessibilityIsLandmarkRole:]):
2613         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2614         (-[WebAccessibilityObjectWrapper subrole]):
2615
2616 2019-02-25  Sihui Liu  <sihui_liu@apple.com>
2617
2618         IndexedDB: IDBDatabase and IDBTransaction are leaked in layout tests
2619         https://bugs.webkit.org/show_bug.cgi?id=194709
2620
2621         Reviewed by Geoffrey Garen.
2622
2623         When connection to IDB server is closed, IDBTransaction would abort without notifying IDBDatabase, so 
2624         IDBDatabase didn't clear its reference to IDBTransaction which created a reference cycle. 
2625  
2626         Also IDBTransaction didn't clear its reference to IDBRequest in this case and it led to another reference cycle
2627         between IDBOpenDBRequest and IDBTransaction.
2628
2629         Test: storage/indexeddb/IDBObject-leak.html
2630
2631         * Modules/indexeddb/IDBDatabase.cpp:
2632         (WebCore::IDBDatabase::connectionToServerLost):
2633         * Modules/indexeddb/IDBTransaction.cpp:
2634         (WebCore::IDBTransaction::IDBTransaction):
2635         (WebCore::IDBTransaction::~IDBTransaction):
2636         (WebCore::IDBTransaction::connectionClosedFromServer):
2637         * Modules/indexeddb/IDBTransaction.h:
2638         * testing/Internals.cpp:
2639         (WebCore::Internals::numberOfIDBTransactions const):
2640         * testing/Internals.h:
2641         * testing/Internals.idl:
2642
2643 2019-02-25  Zalan Bujtas  <zalan@apple.com>
2644
2645         Add missing stream parameter. Unreviewed.
2646
2647         * page/DOMTimer.cpp:
2648         (WebCore::DOMTimer::fired):
2649
2650 2019-02-25  Zalan Bujtas  <zalan@apple.com>
2651
2652         Unreviewed build fix after r242032.
2653
2654         * page/DOMTimer.cpp:
2655         (WebCore::DOMTimer::install):
2656
2657 2019-02-20  Darin Adler  <darin@apple.com>
2658
2659         Incorrect use of String::foldCase for font family names
2660         https://bugs.webkit.org/show_bug.cgi?id=194895
2661
2662         Reviewed by Myles C. Maxfield.
2663
2664         * platform/graphics/FontCascadeDescription.cpp:
2665         (WebCore::FontCascadeDescription::familiesEqualForTextAutoSizing): Use
2666         familyNamesAreEqual instead of calling convertToASCIILowercase directly.
2667         (WebCore::FontCascadeDescription::familyNamesAreEqual): Use AtomicString's
2668         operator== when we want case sensitive family name comparisons. This is a special
2669         case to accomodate CoreText, which uses "."-prefix names for internal fonts that
2670         are treated case sensitively. (Ideally webpages would not use these fonts at all.)
2671         (WebCore::FontCascadeDescription::familyNameHash): Use AtomicString's existingHash
2672         when we want case sensitive family name hashing.
2673         (WebCore::FontCascadeDescription::foldedFamilyName): Take a String instead of an
2674         AtomicString so we can use this at an additional call site. Converting from an
2675         AtomicString to a String if free and automatic at the existing call sites. Use
2676         convertToASCIILowercase instead of foldCase for three reasons: 1) Other functions
2677         here are folding only ASCII case by using ASCIICaseInsensitiveHash, and this one
2678         must be consistent. 2) this is considerably faster, and 3) font family names don't
2679         need arbitrary Unicode case folding, it's only A-Z that should be folded.
2680         * platform/graphics/FontCascadeDescription.h: Take a String instead of AtomicString
2681         in the foldedFamilyName function.
2682
2683         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2684         (WebCore::FontDatabase::collectionForFamily): Instead of calling foldCase, use
2685         FontCascadeDescription::foldedFamilyName to correctly fold font family names.
2686
2687 2019-02-25  Charlie Turner  <cturner@igalia.com>
2688
2689         [EME][GStreamer] Replace caps field loop with gst_structure_remove_fields
2690         https://bugs.webkit.org/show_bug.cgi?id=194992
2691
2692         Reviewed by Xabier Rodriguez-Calvar.
2693
2694         Refactoring, no new tests.
2695
2696         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
2697         (transformCaps): Simplify the code a little. The idea to use this
2698         utility function came from a review upstream here:
2699         https://gitlab.freedesktop.org/gstreamer/gst-devtools/merge_requests/67
2700
2701 2019-02-25  Alicia Boya García  <aboya@igalia.com>
2702
2703         [MSE][GStreamer] Batch player duration updates
2704         https://bugs.webkit.org/show_bug.cgi?id=194220
2705
2706         Reviewed by Xabier Rodriguez-Calvar.
2707
2708         This saves up a ton of CPU cycles doing layout unnecessarily when all
2709         the appended frames extend the duration of the movie, like in
2710         YTTV 2018 59.DASHLatencyVP9.
2711
2712         This patch is an optimization that introduces no new behavior.
2713
2714         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
2715         (WebCore::AppendPipeline::consumeAppsinkAvailableSamples):
2716         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
2717         (WebCore::MediaPlayerPrivateGStreamerMSE::blockDurationChanges):
2718         (WebCore::MediaPlayerPrivateGStreamerMSE::unblockDurationChanges):
2719         (WebCore::MediaPlayerPrivateGStreamerMSE::durationChanged):
2720         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
2721
2722 2019-02-25  Miguel Gomez  <magomez@igalia.com>
2723
2724         [WPE] Add support for holepunch using an external video player
2725         https://bugs.webkit.org/show_bug.cgi?id=194899
2726
2727         Reviewed by Xabier Rodriguez-Calvar.
2728
2729         Implement the holepunch feature to allow playback using an external player. This creates
2730         a new dummy MediaPlayerPrivateHolePunch that accepts only the type "video/holepunch", and
2731         whose goal is to just draw a transparent rectangle in the position where the video should be.
2732         This can be used to allow a player placed on a lower plane than the browser to become visible.
2733
2734         Added ManualTest wpe/video-player-holepunch-external.html to test the feature.
2735
2736         * PlatformWPE.cmake:
2737         * platform/HolePunch.cmake: Added.
2738         * platform/graphics/MediaPlayer.cpp:
2739         (WebCore::buildMediaEnginesVector):
2740         * platform/graphics/holepunch/MediaPlayerPrivateHolePunch.cpp: Added.
2741         (WebCore::MediaPlayerPrivateHolePunch::MediaPlayerPrivateHolePunch):
2742         (WebCore::MediaPlayerPrivateHolePunch::~MediaPlayerPrivateHolePunch):
2743         (WebCore::MediaPlayerPrivateHolePunch::platformLayer const):
2744         (WebCore::MediaPlayerPrivateHolePunch::naturalSize const):
2745         (WebCore::MediaPlayerPrivateHolePunch::pushNextHolePunchBuffer):
2746         (WebCore::MediaPlayerPrivateHolePunch::swapBuffersIfNeeded):
2747         (WebCore::MediaPlayerPrivateHolePunch::proxy const):
2748         (WebCore::mimeTypeCache):
2749         (WebCore::MediaPlayerPrivateHolePunch::getSupportedTypes):
2750         (WebCore::MediaPlayerPrivateHolePunch::supportsType):
2751         (WebCore::MediaPlayerPrivateHolePunch::registerMediaEngine):
2752         (WebCore::MediaPlayerPrivateHolePunch::notifyReadyState):
2753         * platform/graphics/holepunch/MediaPlayerPrivateHolePunch.h: Added.
2754         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
2755         (WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper):
2756
2757 2019-02-24  Zalan Bujtas  <zalan@apple.com>
2758
2759         Introduce ContentChangeObserver class
2760         https://bugs.webkit.org/show_bug.cgi?id=194977
2761         <rdar://problem/48338115>
2762
2763         Reviewed by Simon Fraser.
2764
2765         This patch is about piping through all the related WK* calls. 
2766
2767         * SourcesCocoa.txt:
2768         * WebCore.xcodeproj/project.pbxproj:
2769         * dom/Document.cpp:
2770         (WebCore::Document::scheduleStyleRecalc):
2771         (WebCore::Document::updateStyleIfNeeded):
2772         (WebCore::Document::platformSuspendOrStopActiveDOMObjects):
2773         * loader/FrameLoader.cpp:
2774         * page/DOMTimer.cpp:
2775         (WebCore::DOMTimer::install):
2776         (WebCore::DOMTimer::fired):
2777         * page/DOMWindow.cpp:
2778         (WebCore::DOMWindow::clearTimeout):
2779         * page/Frame.cpp:
2780         (WebCore::Frame::willDetachPage):
2781         * page/Page.h:
2782         (WebCore::Page::contentChangeObserver):
2783         * page/ios/EventHandlerIOS.mm:
2784         (WebCore::EventHandler::mouseMoved):
2785         * rendering/updating/RenderTreeUpdater.cpp:
2786         (WebCore::RenderTreeUpdater::updateElementRenderer):
2787         (WebCore::CheckForVisibilityChange::CheckForVisibilityChange):
2788         (WebCore::CheckForVisibilityChange::~CheckForVisibilityChange):
2789
2790 2019-02-24  Simon Fraser  <simon.fraser@apple.com>
2791
2792         Migrate from "fixedPositionRect" to "layoutViewport" in the scrolling tree
2793         https://bugs.webkit.org/show_bug.cgi?id=194984
2794
2795         Reviewed by Sam Weinig.
2796
2797         Rename "fixedPositionRect" to "layoutViewport" in scrolling tree code.
2798
2799         Remove ScrollingTree::fixedPositionRect() which was only used on iOS, to fetch the
2800         current layout viewport rect. Instead, set the layout viewport on the root
2801         node in ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling().
2802
2803         * page/scrolling/ScrollingTree.cpp:
2804         (WebCore::ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling):
2805         (WebCore::ScrollingTree::viewportChangedViaDelegatedScrolling): Deleted.
2806         * page/scrolling/ScrollingTree.h:
2807         * page/scrolling/ScrollingTreeFrameHostingNode.cpp:
2808         (WebCore::ScrollingTreeFrameHostingNode::updateLayersAfterAncestorChange):
2809         * page/scrolling/ScrollingTreeFrameHostingNode.h:
2810         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
2811         * page/scrolling/ScrollingTreeNode.h:
2812         * page/scrolling/ScrollingTreeScrollingNode.cpp:
2813         (WebCore::ScrollingTreeScrollingNode::updateLayersAfterAncestorChange):
2814         * page/scrolling/ScrollingTreeScrollingNode.h:
2815         * page/scrolling/cocoa/ScrollingTreeFixedNode.h:
2816         * page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
2817         (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange):
2818         * page/scrolling/cocoa/ScrollingTreeStickyNode.h:
2819         * page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
2820         (WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange):
2821         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
2822         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
2823         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
2824         (WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterAncestorChange):
2825         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition):
2826
2827 2019-02-24  Devin Rousso  <drousso@apple.com>
2828
2829         Web Inspector: Change the InspectorOverlay to use native rather than canvas
2830         https://bugs.webkit.org/show_bug.cgi?id=105023
2831         <rdar://problem/13443692>
2832
2833         Reviewed by Brian Burg.
2834
2835         Should be no change in observed functionality.
2836
2837         * inspector/InspectorOverlay.h:
2838         * inspector/InspectorOverlay.cpp:
2839         (WebCore::truncateWithEllipsis): Added.
2840         (WebCore::localPointToRootPoint): Added.
2841         (WebCore::contentsQuadToCoordinateSystem):
2842         (WebCore::effectiveElementForNode): Added.
2843         (WebCore::quadToPath): Added.
2844         (WebCore::drawOutlinedQuadWithClip): Added.
2845         (WebCore::drawOutlinedQuad): Added.
2846         (WebCore::drawFragmentHighlight): Added.
2847         (WebCore::drawShapeHighlight): Added.
2848         (WebCore::InspectorOverlay::paint):
2849         (WebCore::InspectorOverlay::setIndicating):
2850         (WebCore::InspectorOverlay::shouldShowOverlay const):
2851         (WebCore::InspectorOverlay::update):
2852         (WebCore::InspectorOverlay::setShowPaintRects): Added.
2853         (WebCore::InspectorOverlay::showPaintRect):
2854         (WebCore::InspectorOverlay::updatePaintRectsTimerFired):
2855         (WebCore::InspectorOverlay::drawNodeHighlight):
2856         (WebCore::InspectorOverlay::drawQuadHighlight):
2857         (WebCore::InspectorOverlay::drawPaintRects):
2858         (WebCore::InspectorOverlay::drawBounds): Added.
2859         (WebCore::InspectorOverlay::drawRulers):
2860         (WebCore::InspectorOverlay::drawElementTitle): Added.
2861         (WebCore::contentsQuadToPage): Deleted.
2862         (WebCore::InspectorOverlay::setPausedInDebuggerMessage): Deleted.
2863         (WebCore::buildObjectForPoint): Deleted.
2864         (WebCore::buildObjectForRect): Deleted.
2865         (WebCore::buildArrayForQuad): Deleted.
2866         (WebCore::buildObjectForHighlight): Deleted.
2867         (WebCore::buildObjectForSize): Deleted.
2868         (WebCore::InspectorOverlay::setShowingPaintRects): Deleted.
2869         (WebCore::buildArrayForRendererFragments): Deleted.
2870         (WebCore::localPointToRoot): Deleted.
2871         (WebCore::appendPathCommandAndPoints): Deleted.
2872         (WebCore::appendPathSegment): Deleted.
2873         (WebCore::buildObjectForShapeOutside): Deleted.
2874         (WebCore::buildObjectForElementData): Deleted.
2875         (WebCore::InspectorOverlay::buildHighlightObjectForNode const): Deleted.
2876         (WebCore::InspectorOverlay::buildObjectForHighlightedNodes const): Deleted.
2877         (WebCore::InspectorOverlay::drawPausedInDebuggerMessage): Deleted.
2878         (WebCore::InspectorOverlay::overlayPage): Deleted.
2879         (WebCore::InspectorOverlay::forcePaint): Deleted.
2880         (WebCore::InspectorOverlay::reset): Deleted.
2881         (WebCore::evaluateCommandInOverlay): Deleted.
2882         (WebCore::InspectorOverlay::evaluateInOverlay): Deleted.
2883         (WebCore::InspectorOverlay::freePage): Deleted.
2884
2885         * inspector/agents/InspectorPageAgent.cpp:
2886         (WebCore::InspectorPageAgent::disable):
2887         (WebCore::InspectorPageAgent::setShowPaintRects):
2888         Drive-by: rename `setShowingPaintRects` to better match the protocol.
2889
2890         * inspector/agents/page/PageDebuggerAgent.h:
2891         * inspector/agents/page/PageDebuggerAgent.cpp:
2892         (WebCore::PageDebuggerAgent::PageDebuggerAgent):
2893         (WebCore::PageDebuggerAgent::setOverlayMessage): Deleted.
2894         Remove `Debugger.setOverlayMessage` command as it hasn't been used and is no longer supported.
2895
2896         * inspector/InspectorController.h:
2897         * inspector/InspectorController.cpp:
2898         (WebCore::InspectorController::createLazyAgents):
2899         (WebCore::InspectorController::disconnectFrontend):
2900         (WebCore::InspectorController::disconnectAllFrontends):
2901         (WebCore::InspectorController::buildObjectForHighlightedNodes const): Deleted.
2902
2903         * testing/Internals.h:
2904         * testing/Internals.idl:
2905         * testing/Internals.cpp:
2906         (WebCore::Internals::inspectorHighlightObject): Deleted.
2907
2908         * inspector/InspectorOverlayPage.css: Removed.
2909         * inspector/InspectorOverlayPage.html: Removed.
2910         * inspector/InspectorOverlayPage.js: Removed.
2911
2912         * CMakeLists.txt:
2913         * DerivedSources-input.xcfilelist:
2914         * DerivedSources-output.xcfilelist:
2915         * DerivedSources.make:
2916         * WebCore.xcodeproj/project.pbxproj:
2917
2918 2019-02-20  Darin Adler  <darin@apple.com>
2919
2920         Finish removing String::format
2921         https://bugs.webkit.org/show_bug.cgi?id=194893
2922
2923         Reviewed by Daniel Bates.
2924
2925         * dom/Document.cpp:
2926         (WebCore::Document::lastModified const): Use makeString and pad.
2927         * html/FTPDirectoryDocument.cpp:
2928         (WebCore::processFileDateString): Ditto.
2929
2930         * mathml/MathMLElement.cpp:
2931         (WebCore::convertToPercentageIfNeeded): Use makeString and FormattedNumber.
2932
2933         * page/cocoa/ResourceUsageOverlayCocoa.mm:
2934         (WebCore::ResourceUsageOverlay::platformDraw): Use makeString and pad.
2935
2936         * page/linux/ResourceUsageOverlayLinux.cpp:
2937         (WebCore::cpuUsageString): Use makeString, FormattedNumber, and pad.
2938         (WebCore::gcTimerString): Use String::number.
2939
2940         * platform/DateComponents.cpp:
2941         (WebCore::DateComponents::toStringForTime const): Use makeString and pad.
2942         (WebCore::DateComponents::toString const): Ditto.
2943
2944         * platform/LocalizedStrings.cpp: Removed comment that mentioned String::format,
2945         and that was also inaccurate.
2946
2947         * platform/audio/HRTFElevation.cpp:
2948         (WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
2949         Use makeString and pad.
2950         * platform/mock/MockRealtimeVideoSource.cpp:
2951         (WebCore::MockRealtimeVideoSource::drawText): Ditto.
2952         * rendering/RenderLayerCompositor.cpp:
2953         (WebCore::RenderLayerCompositor::logLayerInfo): Ditto.
2954         * rendering/RenderTheme.cpp:
2955         (WebCore::RenderTheme::formatMediaControlsTime const): Ditto.
2956
2957 2019-02-24  Michael Catanzaro  <mcatanzaro@igalia.com>
2958
2959         [WPE][GTK] Remove user agent quirk for washingtonpost.com
2960         https://bugs.webkit.org/show_bug.cgi?id=194981
2961
2962         Reviewed by Žan Doberšek.
2963
2964         Remove user agent quirk for washingtonpost.com because we support JPEG 2000 now.
2965
2966         * platform/UserAgentQuirks.cpp:
2967         (WebCore::urlRequiresChromeBrowser):
2968
2969 2019-02-23  Simon Fraser  <simon.fraser@apple.com>
2970
2971         Remove remnants of iOS WK1 scrolling tree code
2972         https://bugs.webkit.org/show_bug.cgi?id=194980
2973
2974         Reviewed by Sam Weinig.
2975
2976         Remove ScrollingTreeIOS and ScrollingCoordinatorIOS which were never instantiated,
2977         to reduce maintenance costs and simplify.
2978
2979         Merge ScrollingTreeFrameScrollingNodeIOS into ScrollingTreeFrameScrollingNodeRemoteIOS
2980         since that was the only concrete subclass, removing code which never applies to iOS WK2
2981         (e.g. the synchronous scrolling code path).
2982
2983         * SourcesCocoa.txt:
2984         * WebCore.xcodeproj/project.pbxproj:
2985         * page/FrameView.h:
2986         * page/scrolling/ScrollingCoordinator.cpp:
2987         * page/scrolling/ScrollingTree.h:
2988         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
2989         * page/scrolling/ScrollingTreeNode.h:
2990         * page/scrolling/ScrollingTreeScrollingNode.cpp:
2991         (WebCore::ScrollingTreeScrollingNode::handleWheelEvent):
2992         * page/scrolling/ScrollingTreeScrollingNode.h:
2993         (WebCore::ScrollingTreeScrollingNode::updateLayersAfterDelegatedScroll): Deleted.
2994         (WebCore::ScrollingTreeScrollingNode::scrollableAreaSize const): Deleted.
2995         (WebCore::ScrollingTreeScrollingNode::totalContentsSize const): Deleted.
2996         (WebCore::ScrollingTreeScrollingNode::horizontalSnapOffsets const): Deleted.
2997         (WebCore::ScrollingTreeScrollingNode::verticalSnapOffsets const): Deleted.
2998         (WebCore::ScrollingTreeScrollingNode::horizontalSnapOffsetRanges const): Deleted.
2999         (WebCore::ScrollingTreeScrollingNode::verticalSnapOffsetRanges const): Deleted.
3000         (WebCore::ScrollingTreeScrollingNode::currentHorizontalSnapPointIndex const): Deleted.
3001         (WebCore::ScrollingTreeScrollingNode::currentVerticalSnapPointIndex const): Deleted.
3002         (WebCore::ScrollingTreeScrollingNode::setCurrentHorizontalSnapPointIndex): Deleted.
3003         (WebCore::ScrollingTreeScrollingNode::setCurrentVerticalSnapPointIndex): Deleted.
3004         (WebCore::ScrollingTreeScrollingNode::useDarkAppearanceForScrollbars const): Deleted.
3005         (WebCore::ScrollingTreeScrollingNode::lastCommittedScrollPosition const): Deleted.
3006         (WebCore::ScrollingTreeScrollingNode::reachableContentsSize const): Deleted.
3007         (WebCore::ScrollingTreeScrollingNode::parentRelativeScrollableRect const): Deleted.
3008         (WebCore::ScrollingTreeScrollingNode::scrollOrigin const): Deleted.
3009         (WebCore::ScrollingTreeScrollingNode::totalContentsSizeForRubberBand const): Deleted.
3010         (WebCore::ScrollingTreeScrollingNode::setTotalContentsSizeForRubberBand): Deleted.
3011         (WebCore::ScrollingTreeScrollingNode::horizontalScrollElasticity const): Deleted.
3012         (WebCore::ScrollingTreeScrollingNode::verticalScrollElasticity const): Deleted.
3013         (WebCore::ScrollingTreeScrollingNode::hasEnabledHorizontalScrollbar const): Deleted.
3014         (WebCore::ScrollingTreeScrollingNode::hasEnabledVerticalScrollbar const): Deleted.
3015         (WebCore::ScrollingTreeScrollingNode::canHaveScrollbars const): Deleted.
3016         (WebCore::ScrollingTreeScrollingNode::expectsWheelEventTestTrigger const): Deleted.
3017         (WebCore::ScrollingTreeScrollingNode::scrollContainerLayer const): Deleted.
3018         (WebCore::ScrollingTreeScrollingNode::scrolledContentsLayer const): Deleted.
3019         * page/scrolling/ios/ScrollingCoordinatorIOS.h: Removed.
3020         * page/scrolling/ios/ScrollingCoordinatorIOS.mm: Removed.
3021         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h: Removed.
3022         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm: Removed.
3023         * page/scrolling/ios/ScrollingTreeIOS.cpp: Removed.
3024         * page/scrolling/ios/ScrollingTreeIOS.h: Removed.
3025         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
3026         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition):
3027
3028 2019-02-23  Justin Fan  <justin_fan@apple.com>
3029
3030         [WebGPU] Buffer updates part 1: async mapping functions, unmap, and destroy
3031         https://bugs.webkit.org/show_bug.cgi?id=194665
3032
3033         Reviewed by Dean Jackson.
3034
3035         Test: map-write-buffers.html. Other tests updated to match new API.
3036
3037         * Modules/webgpu/WebGPUBindGroupDescriptor.cpp: Added.
3038         (WebCore::validateBufferBindingType): Ensure buffer binding usages match the binding type.
3039         (WebCore::WebGPUBindGroupDescriptor::asGPUBindGroupDescriptor const): Logic moved out from WebGPUDevice.cpp.
3040         * Modules/webgpu/WebGPUBindGroupDescriptor.h:
3041         * Modules/webgpu/WebGPUBuffer.cpp: Added GPUBuffer functionality.
3042         (WebCore::WebGPUBuffer::create):
3043         (WebCore::WebGPUBuffer::WebGPUBuffer):
3044         (WebCore::WebGPUBuffer::mapReadAsync):
3045         (WebCore::WebGPUBuffer::mapWriteAsync):
3046         (WebCore::WebGPUBuffer::unmap):
3047         (WebCore::WebGPUBuffer::destroy):
3048         (WebCore::WebGPUBuffer::rejectOrRegisterPromiseCallback): Register a mapping request on the GPUBuffer, if valid.
3049         * Modules/webgpu/WebGPUBuffer.h:
3050         (WebCore::WebGPUBuffer::buffer const):
3051         (WebCore::WebGPUBuffer::mapping const): Deleted.
3052         * Modules/webgpu/WebGPUBuffer.idl: Update to latest API and enable every function except setSubData.
3053         * Modules/webgpu/WebGPUCommandBuffer.cpp:
3054         (WebCore::WebGPUCommandBuffer::beginRenderPass): Renamed descriptor conversion method.
3055         * Modules/webgpu/WebGPUDevice.cpp:
3056         (WebCore::WebGPUDevice::createBuffer const): Update to non-nullable return type.
3057         (WebCore::WebGPUDevice::createBindGroup const): Move descriptor validation logic to descriptor implementation.
3058         * Modules/webgpu/WebGPUDevice.h:
3059         * Modules/webgpu/WebGPURenderPassDescriptor.cpp:
3060         (WebCore::WebGPURenderPassDescriptor::asGPURenderPassDescriptor const): Renamed from validateAndConvertToGPUVersion.
3061         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
3062         (WebCore::WebGPURenderPassEncoder::setVertexBuffers): Add validation for submitted buffers.
3063         * platform/graphics/gpu/GPUBuffer.cpp: Added.
3064         (WebCore::GPUBuffer::PendingMappingCallback::PendingMappingCallback): New struct for retaining a reference to mapping callbacks.
3065         * platform/graphics/gpu/GPUBuffer.h: Add functionality to retain callbacks and usage bits.
3066         (WebCore::GPUBuffer::isVertex const):
3067         (WebCore::GPUBuffer::isUniform const):
3068         (WebCore::GPUBuffer::isStorage const):
3069         (WebCore::GPUBuffer::isReadOnly const):
3070         (WebCore::GPUBuffer::PendingMapPromise::create):
3071         (WebCore::GPUBuffer::isMappable const):
3072         (WebCore::GPUBuffer::isMapWriteable const):
3073         (WebCore::GPUBuffer::isMapReadable const):
3074         (WebCore::GPUBuffer::mapping const): Deleted.
3075         * platform/graphics/gpu/GPUBufferUsage.h: enum class cannot be logical ORed together.
3076         * platform/graphics/gpu/GPUDevice.cpp:
3077         (WebCore::GPUDevice::tryCreateBuffer const): Renamed from createBuffer. 
3078         (WebCore::GPUDevice::createBuffer const): Deleted.
3079         * platform/graphics/gpu/GPUDevice.h:
3080         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
3081         (WebCore::GPUBuffer::tryCreateSharedBuffer): Attempt to create a MTLBuffer with shared memory.
3082         (WebCore::GPUBuffer::tryCreate): No longer use Gigacage-allocated memory for MTLBuffer.
3083         (WebCore::GPUBuffer::GPUBuffer):
3084         (WebCore::GPUBuffer::~GPUBuffer):
3085         (WebCore::GPUBuffer::registerMappingCallback): Register the provided callback to be executed when the staging buffer can be safely exposed.
3086         (WebCore::GPUBuffer::stagingBufferForRead): Prepare the arrayBuffer for reading and run the mapping callback.
3087         (WebCore::GPUBuffer::stagingBufferForWrite): Ditto, but for writing.
3088         (WebCore::GPUBuffer::unmap): If needed, copy the staging ArrayBuffer to the MTLBuffer. Unregister any mapping callback.
3089         (WebCore::GPUBuffer::destroy): Stub implementation for now. Frees the MTLBuffer as soon as possible.
3090         (WebCore::GPUBuffer::create): Deleted.
3091         * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
3092         (WebCore::GPUProgrammablePassEncoder::setResourceAsBufferOnEncoder): Ensure only read-only GPUBuffers are used as read-only on the GPU.
3093
3094         Add symbols for new files:
3095         * Sources.txt:
3096         * WebCore.xcodeproj/project.pbxproj:
3097
3098 2019-02-23  Keith Miller  <keith_miller@apple.com>
3099
3100         Add new mac target numbers
3101         https://bugs.webkit.org/show_bug.cgi?id=194955
3102
3103         Reviewed by Tim Horton.
3104
3105         * Configurations/Base.xcconfig:
3106         * Configurations/DebugRelease.xcconfig:
3107
3108 2019-02-23  chris fleizach  <cfleizach@apple.com>
3109
3110         AX: WebKit is incorrectly mapping the <meter> element to progressbar
3111         https://bugs.webkit.org/show_bug.cgi?id=164051
3112         <rdar://problem/29055615>
3113
3114         Reviewed by Joanmarie Diggs.
3115
3116         Add a specific role for meter and map that to the appropriate mac role. 
3117
3118         * accessibility/AccessibilityNodeObject.cpp:
3119         (WebCore::AccessibilityNodeObject::canHaveChildren const):
3120         (WebCore::AccessibilityNodeObject::isProgressIndicator const):
3121         * accessibility/AccessibilityObject.cpp:
3122         (WebCore::AccessibilityObject::accessibleNameDerivesFromContent const):
3123         (WebCore::AccessibilityObject::isRangeControl const):
3124         (WebCore::AccessibilityObject::computedRoleString const):
3125         * accessibility/AccessibilityObjectInterface.h:
3126         * accessibility/AccessibilityProgressIndicator.cpp:
3127         (WebCore::AccessibilityProgressIndicator::roleValue const):
3128         * accessibility/AccessibilityProgressIndicator.h:
3129         * accessibility/AccessibilityRenderObject.cpp:
3130         (WebCore::AccessibilityRenderObject::shouldFocusActiveDescendant const):
3131         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3132         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
3133         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3134         (createAccessibilityRoleMap):
3135
3136 2019-02-22  Ryosuke Niwa  <rniwa@webkit.org>
3137
3138         Crash in SWServerJobQueue::runNextJobSynchronously
3139         https://bugs.webkit.org/show_bug.cgi?id=194974
3140
3141         Reviewed by Geoffrey Garen.
3142
3143         We suspect the crash is happening due to m_jobQueue being empty in runNextJobSynchronously
3144         or there is a timer heap corruption again :(
3145
3146         Exit early when m_jobQueue is empty. Also add a debug assert that this should never happen
3147         but convert an existing release assert to a debug assert since this appears to be hitting
3148         too frequently in wild.
3149
3150         * workers/service/server/SWServerJobQueue.cpp:
3151         (WebCore::SWServerJobQueue::runNextJobSynchronously):
3152
3153 2019-02-22  Simon Fraser  <simon.fraser@apple.com>
3154
3155         Clean up the setScrollPosition/setScrollPositionWithoutContentEdgeConstraints confusion in the scrolling tree nodes
3156         https://bugs.webkit.org/show_bug.cgi?id=194968
3157
3158         Reviewed by Antti Koivisto.
3159
3160         Having both setScrollPosition() and setScrollPositionWithoutContentEdgeConstraints() is confusing because
3161         you can't tell which is the bottleneck. So add a 'clamp' parameter to setScrollPosition() and merge them.
3162
3163         ScrollingTreeFrameScrollingNodeMac::setScrollPosition() replicates a bit of code but future cleanups will
3164         reduce that.
3165
3166         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
3167         (WebCore::ScrollingTreeFrameScrollingNode::setScrollPosition): Deleted. This was the same as the base class method.
3168         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
3169         * page/scrolling/ScrollingTreeScrollingNode.cpp:
3170         (WebCore::ScrollingTreeScrollingNode::setScrollPosition):
3171         (WebCore::ScrollingTreeScrollingNode::clampScrollPosition const):
3172         (WebCore::ScrollingTreeScrollingNode::scrollBy):
3173         (WebCore::ScrollingTreeScrollingNode::setScrollPositionWithoutContentEdgeConstraints): Deleted.
3174         (WebCore::ScrollingTreeScrollingNode::scrollByWithoutContentEdgeConstraints): Deleted.
3175         * page/scrolling/ScrollingTreeScrollingNode.h:
3176         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
3177         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
3178         (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPosition):
3179         (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPositionWithoutContentEdgeConstraints): Deleted. Did nothing.
3180         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
3181         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
3182         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
3183         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
3184         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition):
3185         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints): Deleted.
3186         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
3187         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
3188         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPosition):
3189         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints): Deleted.
3190         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
3191         (WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollByWithoutContentEdgeConstraints):
3192         * platform/PlatformWheelEvent.h:
3193         (WebCore::PlatformWheelEvent::delta const):
3194         * platform/ScrollTypes.h:
3195
3196 2019-02-22  Eric Liang  <ericliang@apple.com>
3197
3198         AX: Treat AXChildrenInNavigationOrder as AXChildren before adding support for aria-flowto
3199         https://bugs.webkit.org/show_bug.cgi?id=194923
3200
3201         Reviewed by Chris Fleizach.
3202
3203         Added AXChildrenInNavigationOrder attribute that returns the same array as from AXChildren. It prevents AppKit from reordering elements from the fallback AXChildren attribute.
3204
3205         Test: accessibility/mac/children-in-navigation-order-returns-children.html
3206
3207         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3208         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
3209
3210 2019-02-22  Tim Horton  <timothy_horton@apple.com>
3211
3212         ProcessSwap.PageOverlayLayerPersistence fails on iOS and in debug builds
3213         https://bugs.webkit.org/show_bug.cgi?id=194963
3214
3215         Reviewed by Dean Jackson.
3216
3217         Tested by existing failing API test.
3218
3219         * page/Page.cpp:
3220         (WebCore::Page::installedPageOverlaysChanged): Deleted.
3221         * page/Page.h:
3222         (WebCore::Page::pageOverlayController):
3223         * page/PageOverlayController.cpp:
3224         (WebCore::PageOverlayController::installedPageOverlaysChanged):
3225         (WebCore::PageOverlayController::detachViewOverlayLayers):
3226         (WebCore::PageOverlayController::installPageOverlay):
3227         (WebCore::PageOverlayController::uninstallPageOverlay):
3228         (WebCore::PageOverlayController::willDetachRootLayer): Deleted.
3229         * page/PageOverlayController.h:
3230         As intended by r240940, move installedPageOverlaysChanged to PageOverlayController.
3231         Also, make it ignore isInWindow state; otherwise, if you install a overlay
3232         and then come into window, nothing installs the root layer. There is no
3233         need for this code to follow in-window state manually anymore since
3234         the DrawingArea and RenderLayerCompositor just hook the layers up when needed.
3235
3236         Make some methods private, and make detachViewOverlayLayers only touch
3237         *view* overlays, so that we don't detach the document-relative root
3238         layer when you drop to having no view overlays. This maintains
3239         existing behavior because nothing was calling PageOverlayController::detachViewOverlayLayers.
3240
3241         Now there are no callers of willDetachRootLayer, so remove it.
3242
3243 2019-02-22  Andy Estes  <aestes@apple.com>
3244
3245         [iOS] Break a reference cycle between PreviewLoader and ResourceLoader
3246         https://bugs.webkit.org/show_bug.cgi?id=194964
3247         <rdar://problem/48279441>
3248
3249         Reviewed by Alex Christensen.
3250
3251         When a document's QuickLook preview is loaded, a reference cycle is created between
3252         PreviewLoader and ResourceLoader. Break the cycle by clearing m_previewLoader in
3253         ResourceLoader::releaseResources().
3254
3255         Fixes leaks detected by `run-webkit-tests --leaks LayoutTests/quicklook`.
3256
3257         * loader/ResourceLoader.cpp:
3258         (WebCore::ResourceLoader::releaseResources):
3259
3260 2019-02-22  Sihui Liu  <sihui_liu@apple.com>
3261
3262         Crash under IDBServer::IDBConnectionToClient::identifier() const
3263         https://bugs.webkit.org/show_bug.cgi?id=194843
3264         <rdar://problem/48203102>
3265
3266         Reviewed by Geoffrey Garen.
3267
3268         UniqueIDBDatabase should ignore requests from connections that are already closed.
3269
3270         Tests are hard to create without some tricks on UniqueIDBDatabase so this fix is verified manually. 
3271         One test is created by adding delay to UniqueIDBDatabase::openBackingStore on the background thread to make sure
3272         disconnection of web process happens before UniqueIDBDatabase::didOpenBackingStore, because didOpenBackingStore
3273         may start a version change transaction and ask for identifier from the connection that is already gone.
3274
3275         * Modules/indexeddb/server/IDBConnectionToClient.cpp:
3276         (WebCore::IDBServer::IDBConnectionToClient::connectionToClientClosed):
3277         * Modules/indexeddb/server/IDBConnectionToClient.h:
3278         (WebCore::IDBServer::IDBConnectionToClient::isClosed):
3279         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3280         (WebCore::IDBServer::UniqueIDBDatabase::clearStalePendingOpenDBRequests):
3281         (WebCore::IDBServer::UniqueIDBDatabase::handleDatabaseOperations):
3282         (WebCore::IDBServer::UniqueIDBDatabase::operationAndTransactionTimerFired):
3283         * Modules/indexeddb/server/UniqueIDBDatabase.h:
3284
3285 2019-02-22  Wenson Hsieh  <wenson_hsieh@apple.com>
3286
3287         Input type "formatSetInlineTextDirection" is dispatched when changing paragraph-level text direction
3288         https://bugs.webkit.org/show_bug.cgi?id=194703
3289         <rdar://problem/48111775>
3290
3291         Reviewed by Ryosuke Niwa.
3292
3293         Currently, when changing text direction, WebKit always sends input events of type formatSetInlineTextDirection,
3294         even when changing paragraph text direction. Instead, we should be emitting formatSetBlockTextDirection in this
3295         scenario. This is problematic when using the context menus on macOS to change writing direction, since changing
3296         "Selection Direction" is currently indistinguishable from changing "Paragraph Direction".
3297
3298         To fix this, we split EditAction::SetWritingDirection into EditAction::SetInlineWritingDirection and
3299         EditAction::SetBlockWritingDirection, which emit inline and block text direction input events, respectively.
3300
3301         Tests: fast/events/before-input-events-prevent-block-text-direction.html
3302                fast/events/before-input-events-prevent-inline-text-direction.html
3303
3304         * editing/CompositeEditCommand.cpp:
3305         (WebCore::CompositeEditCommand::apply):
3306         * editing/EditAction.cpp:
3307         (WebCore::undoRedoLabel):
3308         * editing/EditAction.h:
3309         * editing/EditCommand.cpp:
3310         (WebCore::inputTypeNameForEditingAction):
3311         * editing/Editor.cpp:
3312         (WebCore::inputEventDataForEditingStyleAndAction):
3313         (WebCore::Editor::setBaseWritingDirection):
3314         * editing/EditorCommand.cpp:
3315         (WebCore::executeMakeTextWritingDirectionLeftToRight):
3316         (WebCore::executeMakeTextWritingDirectionNatural):
3317         (WebCore::executeMakeTextWritingDirectionRightToLeft):
3318
3319 2019-02-22  Rob Buis  <rbuis@igalia.com>
3320
3321         Remove stripLeadingAndTrailingWhitespace from MathMLElement.cpp
3322         https://bugs.webkit.org/show_bug.cgi?id=160172
3323
3324         Reviewed by Frédéric Wang.
3325
3326         Remove stripLeadingAndTrailingWhitespace and use stripLeadingAndTrailingHTTPSpaces
3327         from HTTPParsers instead.
3328
3329         No new tests, already covered by MathML tests.
3330
3331         * mathml/MathMLElement.cpp:
3332         (WebCore::MathMLElement::stripLeadingAndTrailingWhitespace): Deleted.
3333         * mathml/MathMLElement.h:
3334         * mathml/MathMLPresentationElement.cpp:
3335         (WebCore::MathMLPresentationElement::parseMathMLLength):
3336         * mathml/MathMLTokenElement.cpp:
3337         (WebCore::MathMLTokenElement::convertToSingleCodePoint):
3338
3339 2019-02-22  Eric Carlson  <eric.carlson@apple.com>
3340
3341         Update some media logging
3342         https://bugs.webkit.org/show_bug.cgi?id=194915
3343
3344         Reviewed by Jer Noble.
3345
3346         No new tests, no functional change.
3347
3348         * Modules/mediasource/SourceBuffer.cpp:
3349         (WebCore::SourceBuffer::evictCodedFrames):
3350         (WebCore::SourceBuffer::provideMediaData):
3351         (WebCore::SourceBuffer::trySignalAllSamplesInTrackEnqueued):
3352
3353         * html/HTMLMediaElement.cpp:
3354         (WebCore::HTMLMediaElement::checkPlaybackTargetCompatablity):
3355         (WebCore::HTMLMediaElement::loadResource):
3356         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
3357         (WebCore::HTMLMediaElement::canTransitionFromAutoplayToPlay const):
3358         (WebCore::HTMLMediaElement::seekTask):
3359         (WebCore::HTMLMediaElement::playInternal):
3360         (WebCore::HTMLMediaElement::pauseInternal):
3361         (WebCore::HTMLMediaElement::setLoop):
3362         (WebCore::HTMLMediaElement::setControls):
3363         (WebCore::HTMLMediaElement::sourceWasRemoved):
3364
3365         * html/MediaElementSession.cpp:
3366         (WebCore::convertEnumerationToString):
3367
3368         * html/MediaElementSession.h:
3369         (WTF::LogArgument<WebCore::MediaPlaybackDenialReason>::toString):
3370
3371         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3372         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
3373
3374 2019-02-22  Rob Buis  <rbuis@igalia.com>
3375
3376         Fix unitless usage of mathsize
3377         https://bugs.webkit.org/show_bug.cgi?id=194940
3378
3379         Reviewed by Frédéric Wang.
3380
3381         Convert unitless lengths to percentage values to correct the computed
3382         font size.
3383
3384         * mathml/MathMLElement.cpp:
3385         (WebCore::convertToPercentageIfNeeded):
3386         (WebCore::MathMLElement::collectStyleForPresentationAttribute):
3387
3388 2019-02-21  Simon Fraser  <simon.fraser@apple.com>
3389