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